@run-trace/duckdb-wasm 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var duckdb=(()=>{var Ig=Object.create;var Bs=Object.defineProperty;var Tg=Object.getOwnPropertyDescriptor;var jg=Object.getOwnPropertyNames;var Dg=Object.getPrototypeOf,Bg=Object.prototype.hasOwnProperty;var Da=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var Fg=(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 Lr=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),$i=(i,t)=>{for(var e in t)Bs(i,e,{get:t[e],enumerable:!0})},pl=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of jg(t))!Bg.call(i,c)&&c!==e&&Bs(i,c,{get:()=>t[c],enumerable:!(r=Tg(t,c))||r.enumerable});return i};var _l=(i,t,e)=>(e=i!=null?Ig(Dg(i)):{},pl(t||!i||!i.__esModule?Bs(e,"default",{value:i,enumerable:!0}):e,i)),Ag=i=>pl(Bs({},"__esModule",{value:!0}),i);var xg=function(i,t){this[0]=i,this[1]=t};var ur=i=>{var t=i[Da("asyncIterator")],e=!1,r,c={};return t==null?(t=i[Da("iterator")](),r=f=>c[f]=_=>t[f](_)):(t=t.call(i),r=f=>c[f]=_=>{if(e){if(e=!1,f==="throw")throw _;return _}return e=!0,{done:!1,value:new xg(new Promise(b=>{var g=t[f](_);if(!(g instanceof Object))throw TypeError("Object expected");b(g)}),1)}}),c[Da("iterator")]=()=>c,r("next"),"throw"in t?r("throw"):c.throw=f=>{throw f},"return"in t&&r("return"),c};var _d=Lr(()=>{});var yd=Lr(()=>{});var vd=Lr((bd,Ec)=>{"use strict";var md=(()=>{var t;var i=typeof document<"u"?(t=document.currentScript)==null?void 0:t.src:void 0;return typeof __filename<"u"&&(i||(i=__filename)),function(e={}){var r=e,c,f,_=new Promise((n,s)=>{c=n,f=s}),b=Object.assign({},r),g=[],T="./this.program",D=(n,s)=>{throw s},U=typeof window=="object",M=typeof importScripts=="function",N=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",nt="";function Et(n){return r.locateFile?r.locateFile(n,nt):nt+n}var Wt,Vt,kt;if(N){var Dt=_d(),Qt=yd();M?nt=Qt.dirname(nt)+"/":nt=__dirname+"/",Wt=(n,s)=>(n=Mc(n)?new URL(n):Qt.normalize(n),Dt.readFileSync(n,s?void 0:"utf8")),kt=n=>{var s=Wt(n,!0);return s.buffer||(s=new Uint8Array(s)),s},Vt=(n,s,o,a=!0)=>{n=Mc(n)?new URL(n):Qt.normalize(n),Dt.readFile(n,a?void 0:"utf8",(l,u)=>{l?o(l):s(a?u.buffer:u)})},!r.thisProgram&&process.argv.length>1&&(T=process.argv[1].replace(/\\/g,"/")),g=process.argv.slice(2),D=(n,s)=>{throw process.exitCode=n,s}}else(U||M)&&(M?nt=self.location.href:typeof document<"u"&&document.currentScript&&(nt=document.currentScript.src),i&&(nt=i),nt.startsWith("blob:")?nt="":nt=nt.substr(0,nt.replace(/[?#].*/,"").lastIndexOf("/")+1),Wt=n=>{var s=new XMLHttpRequest;return s.open("GET",n,!1),s.send(null),s.responseText},M&&(kt=n=>{var s=new XMLHttpRequest;return s.open("GET",n,!1),s.responseType="arraybuffer",s.send(null),new Uint8Array(s.response)}),Vt=(n,s,o)=>{var a=new XMLHttpRequest;a.open("GET",n,!0),a.responseType="arraybuffer",a.onload=()=>{if(a.status==200||a.status==0&&a.response){s(a.response);return}o()},a.onerror=o,a.send(null)});var te=r.print||console.log.bind(console),k=r.printErr||console.error.bind(console);Object.assign(r,b),b=null,r.arguments&&(g=r.arguments),r.thisProgram&&(T=r.thisProgram),r.quit&&(D=r.quit);var P;r.wasmBinary&&(P=r.wasmBinary);var q,O=!1,W;function R(n,s){n||Ie(s)}var J,E,X,st,C,_t,ti,St;function Ee(){var n=q.buffer;r.HEAP8=J=new Int8Array(n),r.HEAP16=X=new Int16Array(n),r.HEAPU8=E=new Uint8Array(n),r.HEAPU16=st=new Uint16Array(n),r.HEAP32=C=new Int32Array(n),r.HEAPU32=_t=new Uint32Array(n),r.HEAPF32=ti=new Float32Array(n),r.HEAPF64=St=new Float64Array(n)}var Oe=[],Vi=[],pn=[],kr=[],Er=!1;function Ad(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Od(r.preRun.shift());ms(Oe)}function xd(){Er=!0,ms(Vi)}function kd(){ms(pn)}function Ed(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Md(r.postRun.shift());ms(kr)}function Od(n){Oe.unshift(n)}function Ud(n){Vi.unshift(n)}function Md(n){kr.unshift(n)}var cr=0,ya=null,_n=null;function Rd(n){var s;cr++,(s=r.monitorRunDependencies)==null||s.call(r,cr)}function Cd(n){var o;if(cr--,(o=r.monitorRunDependencies)==null||o.call(r,cr),cr==0&&(ya!==null&&(clearInterval(ya),ya=null),_n)){var s=_n;_n=null,s()}}function Ie(n){var o;(o=r.onAbort)==null||o.call(r,n),n="Aborted("+n+")",k(n),O=!0,W=1,n+=". Build with -sASSERTIONS for more info.";var s=new WebAssembly.RuntimeError(n);throw f(s),s}var Ld="data:application/octet-stream;base64,",Uc=n=>n.startsWith(Ld),Mc=n=>n.startsWith("file://"),Or;Or="./duckdb-mvp.wasm",Uc(Or)||(Or=Et(Or));function Rc(n){if(n==Or&&P)return new Uint8Array(P);if(kt)return kt(n);throw"both async and sync fetching of the wasm failed"}function Nd(n){return!P&&(U||M)&&typeof fetch=="function"?fetch(n,{credentials:"same-origin"}).then(s=>{if(!s.ok)throw"failed to load wasm binary file at '".concat(n,"'");return s.arrayBuffer()}).catch(()=>Rc(n)):Promise.resolve().then(()=>Rc(n))}function Cc(n,s,o){return Nd(n).then(a=>WebAssembly.instantiate(a,s)).then(o,a=>{k("failed to asynchronously prepare wasm: ".concat(a)),Ie(a)})}function Pd(n,s,o,a){return!n&&typeof WebAssembly.instantiateStreaming=="function"&&!Uc(s)&&!N&&typeof fetch=="function"?fetch(s,{credentials:"same-origin"}).then(l=>{var u=WebAssembly.instantiateStreaming(l,o);return u.then(a,function(d){return k("wasm streaming compile failed: ".concat(d)),k("falling back to ArrayBuffer instantiation"),Cc(s,o,a)})}):Cc(s,o,a)}function Vd(){var n={a:zh};function s(a,l){return K=a.exports,K=wg(K),q=K.vh,Ee(),Ta=K.yh,Ud(K.wh),Cd("wasm-instantiate"),K}Rd("wasm-instantiate");function o(a){s(a.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(n,s)}catch(a){k("Module.instantiateWasm callback failed with error: ".concat(a)),f(a)}return Pd(P,Or,n,o).catch(f),{}}var Te,Ur,Hd={10164832:(n,s,o,a)=>{var l=It(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(It(a),l,!1),u.responseType="arraybuffer";for(var d=0,v=s;d<v*2;){var h=C[o/4+d>>>0],p=C[o/4+d+1>>>0];try{var y=encodeURI(It(h));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,It(p)):u.setRequestHeader(y,encodeURI(It(p)))}catch($){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",$)}d+=2}try{u.send(null)}catch($){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,I=hi(v+4),B=new Uint8Array(m),F=0;F<v;F++)r.HEAPU8[F+I+4]=B[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,r.HEAPU8.set(A,I),I},10166239:(n,s,o,a,l,u)=>{var d=It(n);if(typeof XMLHttpRequest>"u")return 0;let h=new XMLHttpRequest;h.open(It(a),d,!1),h.responseType="arraybuffer";for(var p=0,A=s;p<A*2;){var y=C[o/4+p>>>0],m=C[o/4+p+1>>>0];try{var v=encodeURI(It(y));v==="Host"&&(v="X-Host-Override"),v==="User-Agent"&&(v="X-user-agent"),v==="Authorization"?h.setRequestHeader(v,It(m)):h.setRequestHeader(v,encodeURI(It(m)))}catch(H){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",H)}p+=2}try{for(var I=new Uint8Array(u),B=0;B<u;B++)I[B]=r.HEAPU8[B+l];h.send(I)}catch(H){return 0}if(h.status>=400)return 0;for(var F=Uint8Array.from(Array.from(h.getResponseHeader("Etag")).map(H=>H.charCodeAt(0))),A=F.byteLength,$=hi(A+4),yt=new Uint8Array(F),B=0;B<A;B++)r.HEAPU8[B+$+4]=yt[B];var x=new Uint8Array(4);return x[0]=A%256,A-=x[0],A/=256,x[1]=A%256,A-=x[1],A/=256,x[2]=A%256,A-=x[2],A/=256,x[3]=A%256,A-=x[3],A/=256,r.HEAPU8.set(x,$),$},10167859:(n,s,o,a)=>{var l=It(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(It(a),l,!1),u.responseType="arraybuffer";for(var d=0,v=s;d<v*2;){var h=C[o/4+d>>>0],p=C[o/4+d+1>>>0];console.log("HEAD",It(h),It(p));try{var y=encodeURI(It(h));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,It(p)):u.setRequestHeader(y,encodeURI(It(p)))}catch(x){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",x)}d+=2}try{u.send(null)}catch(x){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,I=hi(v+8),B=new Uint8Array(m),F=0;F<v;F++)r.HEAPU8[F+I+8]=B[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,r.HEAPU8.set(A,I+4);var $=Uint8Array.from(Array.from(u.getAllResponseHeaders()).map(x=>x.charCodeAt(0)));v=$.byteLength;for(var yt=hi(v+8),F=0;F<v;F++)r.HEAPU8[F+yt+8]=$[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,r.HEAPU8.set(A,yt+4),v=yt,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,r.HEAPU8.set(A,I),I},10170204:(n,s,o,a)=>{var l=It(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(It(a),l,!1),u.responseType="arraybuffer";for(var d=0,v=s;d<v*2;){var h=C[o/4+d>>>0],p=C[o/4+d+1>>>0];try{var y=encodeURI(It(h));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,It(p)):u.setRequestHeader(y,encodeURI(It(p)))}catch($){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",$)}d+=2}try{u.send(null)}catch($){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,I=hi(v+4),B=new Uint8Array(m),F=0;F<v;F++)r.HEAPU8[F+I+4]=B[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,r.HEAPU8.set(A,I),I},10171611:(n,s,o,a,l,u)=>{var d=It(n);if(typeof XMLHttpRequest>"u")return 0;let h=new XMLHttpRequest;h.open(It(a),d,!1),h.responseType="arraybuffer";for(var p=0,A=s;p<A*2;){var y=C[o/4+p>>>0],m=C[o/4+p+1>>>0];try{var v=encodeURI(It(y));v==="Host"&&(v="X-Host-Override"),v==="User-Agent"&&(v="X-user-agent"),v==="Authorization"?h.setRequestHeader(v,It(m)):h.setRequestHeader(v,encodeURI(It(m)))}catch(H){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",H)}p+=2}try{for(var I=new Uint8Array(u),B=0;B<u;B++)I[B]=r.HEAPU8[B+l];h.send(I)}catch(H){return 0}if(h.status>=400)return 0;for(var F=h.response,A=F.byteLength,$=hi(A+4),yt=new Uint8Array(F),B=0;B<A;B++)r.HEAPU8[B+$+4]=yt[B];var x=new Uint8Array(4);return x[0]=A%256,A-=x[0],A/=256,x[1]=A%256,A-=x[1],A/=256,x[2]=A%256,A-=x[2],A/=256,x[3]=A%256,A-=x[3],A/=256,r.HEAPU8.set(x,$),$}};function Lc(n){this.name="ExitStatus",this.message="Program terminated with exit(".concat(n,")"),this.status=n}var ms=n=>{for(;n.length>0;)n.shift()(r)},zd=r.noExitRuntime||!0,w=n=>ll(n),S=()=>dl(),Hi=[],bs=0,lr=(n,s)=>s+2097152>>>0<4194305-!!n?(n>>>0)+s*4294967296:NaN;function Wd(n){n>>>=0;var s=new vs(n);return s.get_caught()||(s.set_caught(!0),bs--),s.set_rethrown(!1),Hi.push(s),___cxa_increment_exception_refcount(s.excPtr),s.get_exception_ptr()}function $d(){if(!Hi.length)return 0;var n=Hi[Hi.length-1];return ___cxa_increment_exception_refcount(n.excPtr),n.excPtr}var fi=0,Yd=()=>{_setThrew(0,0);var n=Hi.pop();___cxa_decrement_exception_refcount(n.excPtr),fi=0};class vs{constructor(s){this.excPtr=s,this.ptr=s-24}set_type(s){_t[this.ptr+4>>>2>>>0]=s}get_type(){return _t[this.ptr+4>>>2>>>0]}set_destructor(s){_t[this.ptr+8>>>2>>>0]=s}get_destructor(){return _t[this.ptr+8>>>2>>>0]}set_caught(s){s=s?1:0,J[this.ptr+12>>>0]=s}get_caught(){return J[this.ptr+12>>>0]!=0}set_rethrown(s){s=s?1:0,J[this.ptr+13>>>0]=s}get_rethrown(){return J[this.ptr+13>>>0]!=0}init(s,o){this.set_adjusted_ptr(0),this.set_type(s),this.set_destructor(o)}set_adjusted_ptr(s){_t[this.ptr+16>>>2>>>0]=s}get_adjusted_ptr(){return _t[this.ptr+16>>>2>>>0]}get_exception_ptr(){var s=___cxa_is_pointer_type(this.get_type());if(s)return _t[this.excPtr>>>2>>>0];var o=this.get_adjusted_ptr();return o!==0?o:this.excPtr}}function Gd(n){throw n>>>=0,fi||(fi=n),fi}var Mr=n=>al(n),gs=n=>{var s=fi;if(!s)return Mr(0),0;var o=new vs(s);o.set_adjusted_ptr(s);var a=o.get_type();if(!a)return Mr(0),s;for(var l in n){var u=n[l];if(u===0||u===a)break;var d=o.ptr+16;if(___cxa_can_catch(u,a,d))return Mr(u),s}return Mr(a),s};function Kd(){return gs([])}function qd(n){return n>>>=0,gs([n])}function Jd(n,s){return n>>>=0,s>>>=0,gs([n,s])}function Xd(n,s,o){return n>>>=0,s>>>=0,o>>>=0,gs([n,s,o])}var Nc=()=>{var n=Hi.pop();n||Ie("no exception to throw");var s=n.excPtr;throw n.get_rethrown()||(Hi.push(n),n.set_rethrown(!0),n.set_caught(!1),bs++),fi=s,fi};function Zd(n){if(n>>>=0,!!n){var s=new vs(n);Hi.push(s),s.set_rethrown(!0),Nc()}}function Qd(n,s,o){n>>>=0,s>>>=0,o>>>=0;var a=new vs(n);throw a.init(s,o),fi=n,bs++,fi}var tf=()=>bs;function Pc(){Ie("missing function: $SOCKFS")}Pc.stub=!0;function ma(){Ie("missing function: $FS")}ma.stub=!0;var Rr=n=>{var s=Pc.getSocket(n);if(!s)throw new ma.ErrnoError(8);return s},ba=n=>(n&255)+"."+(n>>8&255)+"."+(n>>16&255)+"."+(n>>24&255),Vc=n=>{var s="",o=0,a=0,l=0,u=0,d=0,h=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(h=0;h<5;h++)if(p[h]!==0){y=!1;break}if(y){if(m=ba(p[6]|p[7]<<16),p[5]===-1)return s="::ffff:",s+=m,s;if(p[5]===0)return s="::",m==="0.0.0.0"&&(m=""),m==="0.0.0.1"&&(m="1"),s+=m,s}for(o=0;o<8;o++)p[o]===0&&(o-l>1&&(d=0),l=o,d++),d>a&&(a=d,u=o-a+1);for(o=0;o<8;o++){if(a>1&&p[o]===0&&o>=u&&o<u+a){o===u&&(s+=":",u===0&&(s+=":"));continue}s+=Number(_ntohs(p[o]&65535)).toString(16),s+=o<7?":":""}return s},Hc=(n,s)=>{var o=X[n>>>1>>>0],a=_ntohs(st[n+2>>>1>>>0]),l;switch(o){case 2:if(s!==16)return{errno:28};l=C[n+4>>>2>>>0],l=ba(l);break;case 10:if(s!==28)return{errno:28};l=[C[n+8>>>2>>>0],C[n+12>>>2>>>0],C[n+16>>>2>>>0],C[n+20>>>2>>>0]],l=Vc(l);break;default:return{errno:5}}return{family:o,addr:l,port:a}},ws=n=>{for(var s=n.split("."),o=0;o<4;o++){var a=Number(s[o]);if(isNaN(a))return null;s[o]=a}return(s[0]|s[1]<<8|s[2]<<16|s[3]<<24)>>>0},Ss=n=>parseInt(n),va=n=>{var s,o,a,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,d=[];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"),":"),s=n.split(":"),s[s.length-4]=Ss(s[s.length-4])+Ss(s[s.length-3])*256,s[s.length-3]=Ss(s[s.length-2])+Ss(s[s.length-1])*256,s=s.slice(0,s.length-2)):s=n.split(":"),a=0,l=0,o=0;o<s.length;o++)if(typeof s[o]=="string")if(s[o]==="Z"){for(l=0;l<8-s.length+1;l++)d[o+l]=0;a=l-1}else d[o+a]=_htons(parseInt(s[o],16));else d[o+a]=s[o];return[d[1]<<16|d[0],d[3]<<16|d[2],d[5]<<16|d[4],d[7]<<16|d[6]]},_e={address_map:{id:1,addrs:{},names:{}},lookup_name(n){var s=ws(n);if(s!==null||(s=va(n),s!==null))return n;var o;if(_e.address_map.addrs[n])o=_e.address_map.addrs[n];else{var a=_e.address_map.id++;R(a<65535,"exceeded max address mappings of 65535"),o="172.29."+(a&255)+"."+(a&65280),_e.address_map.names[o]=n,_e.address_map.addrs[n]=o}return o},lookup_addr(n){return _e.address_map.names[n]?_e.address_map.names[n]:null}},zc=(n,s,o)=>{if(o&&n===0)return null;var a=Hc(n,s);if(a.errno)throw new ma.ErrnoError(a.errno);return a.addr=_e.lookup_addr(a.addr)||a.addr,a};function ef(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n),h=zc(s,o);return d.sock_ops.bind(d,h.addr,h.port),0}function rf(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n),h=zc(s,o);return d.sock_ops.connect(d,h.addr,h.port),0}var nf=(n,s,o)=>{};function sf(n,s,o,a){s>>>=0}var Wc=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,$c=(n,s,o)=>{s>>>=0;for(var a=s+o,l=s;n[l]&&!(l>=a);)++l;if(l-s>16&&n.buffer&&Wc)return Wc.decode(n.subarray(s,l));for(var u="";s<l;){var d=n[s++];if(!(d&128)){u+=String.fromCharCode(d);continue}var h=n[s++]&63;if((d&224)==192){u+=String.fromCharCode((d&31)<<6|h);continue}var p=n[s++]&63;if((d&240)==224?d=(d&15)<<12|h<<6|p:d=(d&7)<<18|h<<12|p<<6|n[s++]&63,d<65536)u+=String.fromCharCode(d);else{var y=d-65536;u+=String.fromCharCode(55296|y>>10,56320|y&1023)}}return u},It=(n,s)=>(n>>>=0,n?$c(E,n,s):""),ga={varargs:void 0,getStr(n){var s=It(n);return s}};function of(n,s,o){return o>>>=0,ga.varargs=o,0}function af(n,s){s>>>=0}function cf(n,s,o){var a=lr(s,o)}var wa=n=>{for(var s=0,o=0;o<n.length;++o){var a=n.charCodeAt(o);a<=127?s++:a<=2047?s+=2:a>=55296&&a<=57343?(s+=4,++o):s+=3}return s};r.lengthBytesUTF8=wa;var Yc=(n,s,o,a)=>{if(o>>>=0,!(a>0))return 0;for(var l=o,u=o+a-1,d=0;d<n.length;++d){var h=n.charCodeAt(d);if(h>=55296&&h<=57343){var p=n.charCodeAt(++d);h=65536+((h&1023)<<10)|p&1023}if(h<=127){if(o>=u)break;s[o++>>>0]=h}else if(h<=2047){if(o+1>=u)break;s[o++>>>0]=192|h>>6,s[o++>>>0]=128|h&63}else if(h<=65535){if(o+2>=u)break;s[o++>>>0]=224|h>>12,s[o++>>>0]=128|h>>6&63,s[o++>>>0]=128|h&63}else{if(o+3>=u)break;s[o++>>>0]=240|h>>18,s[o++>>>0]=128|h>>12&63,s[o++>>>0]=128|h>>6&63,s[o++>>>0]=128|h&63}}return s[o>>>0]=0,o-l},zi=(n,s,o)=>Yc(n,E,s,o);r.stringToUTF8=zi;function lf(n,s){n>>>=0,s>>>=0}function uf(n,s,o){s>>>=0,o>>>=0}var Gc=(n,s)=>(E.fill(0,n,n+s),n),Is=(n,s,o,a,l)=>{switch(s){case 2:o=ws(o),Gc(n,16),l&&(C[l>>>2>>>0]=16),X[n>>>1>>>0]=s,C[n+4>>>2>>>0]=o,X[n+2>>>1>>>0]=_htons(a);break;case 10:o=va(o),Gc(n,28),l&&(C[l>>>2>>>0]=28),C[n>>>2>>>0]=s,C[n+8>>>2>>>0]=o[0],C[n+12>>>2>>>0]=o[1],C[n+16>>>2>>>0]=o[2],C[n+20>>>2>>>0]=o[3],X[n+2>>>1>>>0]=_htons(a);break;default:return 5}return 0};function df(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n);if(!d.daddr)return-53;var h=Is(s,d.family,_e.lookup_name(d.daddr),d.dport,o);return 0}function ff(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n),h=Is(s,d.family,_e.lookup_name(d.saddr||"0.0.0.0"),d.sport,o);return 0}function hf(n,s,o,a,l,u){a>>>=0,l>>>=0;var d=Rr(n);return s===1&&o===4?(C[a>>>2>>>0]=d.error,C[l>>>2>>>0]=4,d.error=null,0):-50}function pf(n,s,o){return o>>>=0,ga.varargs=o,0}function _f(n,s){n>>>=0,s>>>=0}function yf(n,s,o){s>>>=0}function mf(n,s,o,a){s>>>=0,o>>>=0}function bf(n,s,o,a){s>>>=0,a>>>=0,ga.varargs=a}function vf(n,s,o){n>>>=0}function gf(n,s,o,a){s>>>=0,o>>>=0,a>>>=0}function wf(n,s,o,a,l,u){s>>>=0,o>>>=0,l>>>=0,u>>>=0;var d=Rr(n),h=d.sock_ops.recvmsg(d,o);if(!h)return 0;if(l)var p=Is(l,d.family,_e.lookup_name(h.addr),h.port,u);return E.set(h.buffer,s>>>0),h.buffer.byteLength}function Sf(n,s,o,a){s>>>=0,a>>>=0}function If(n){n>>>=0}function Tf(n,s,o,a,l,u){s>>>=0,o>>>=0,l>>>=0,u>>>=0}var jf=(n,s,o)=>{};function Df(n,s){n>>>=0,s>>>=0}function Bf(n,s,o){n>>>=0,s>>>=0,o>>>=0}function Ff(n,s,o){s>>>=0}var Af=1,xf=()=>Af,kf=()=>{throw 1/0};function Kc(){Ie("missing function: _emval_call_method")}Kc.stub=!0;function qc(){Ie("missing function: _emval_decref")}qc.stub=!0;function Jc(){Ie("missing function: _emval_get_global")}Jc.stub=!0;function Xc(){Ie("missing function: _emval_get_method_caller")}Xc.stub=!0;function Zc(){Ie("missing function: _emval_run_destructors")}Zc.stub=!0;var yn=n=>n%4===0&&(n%100!==0||n%400===0),Ef=[0,31,60,91,121,152,182,213,244,274,305,335],Of=[0,31,59,90,120,151,181,212,243,273,304,334],Uf=n=>{var s=yn(n.getFullYear()),o=s?Ef:Of,a=o[n.getMonth()]+n.getDate()-1;return a};function Mf(n,s,o){var a=lr(n,s);o>>>=0;var l=new Date(a*1e3);C[o>>>2>>>0]=l.getSeconds(),C[o+4>>>2>>>0]=l.getMinutes(),C[o+8>>>2>>>0]=l.getHours(),C[o+12>>>2>>>0]=l.getDate(),C[o+16>>>2>>>0]=l.getMonth(),C[o+20>>>2>>>0]=l.getFullYear()-1900,C[o+24>>>2>>>0]=l.getDay();var u=Uf(l)|0;C[o+28>>>2>>>0]=u,C[o+36>>>2>>>0]=-(l.getTimezoneOffset()*60);var d=new Date(l.getFullYear(),0,1),h=new Date(l.getFullYear(),6,1).getTimezoneOffset(),p=d.getTimezoneOffset(),y=(h!=p&&l.getTimezoneOffset()==Math.min(p,h))|0;C[o+32>>>2>>>0]=y}function Rf(n,s,o,a,l,u,d,h){n>>>=0;var p=lr(l,u);return d>>>=0,h>>>=0,-52}function Cf(n,s,o,a,l,u,d){n>>>=0,s>>>=0;var h=lr(u,d)}var Lf=function(n,s,o,a){n>>>=0,s>>>=0,o>>>=0,a>>>=0;var l=new Date().getFullYear(),u=new Date(l,0,1),d=new Date(l,6,1),h=u.getTimezoneOffset(),p=d.getTimezoneOffset(),y=Math.max(h,p);_t[n>>>2>>>0]=y*60,C[s>>>2>>>0]=+(h!=p);var m=B=>B.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],v=m(u),I=m(d);p<h?(zi(v,o,17),zi(I,a,17)):(zi(v,a,17),zi(I,o,17))},Nf=()=>{Ie("")};function Pf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.createDirectory(r,n,s)}function Vf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.checkDirectory(r,n,s)}function Hf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.listDirectoryEntries(r,n,s)}function zf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.removeDirectory(r,n,s)}function Wf(n){return globalThis.DUCKDB_RUNTIME.closeFile(r,n)}function $f(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.dropFile(r,n,s)}function Yf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.checkFile(r,n,s)}function Gf(n,s,o,a){return n>>>=0,o>>>=0,globalThis.DUCKDB_RUNTIME.moveFile(r,n,s,o,a)}function Kf(n,s){return globalThis.DUCKDB_RUNTIME.openFile(r,n,s)}function qf(n,s,o,a){return s>>>=0,globalThis.DUCKDB_RUNTIME.readFile(r,n,s,o,a)}function Jf(n,s){return globalThis.DUCKDB_RUNTIME.truncateFile(r,n,s)}function Xf(n,s,o,a){return s>>>=0,globalThis.DUCKDB_RUNTIME.writeFile(r,n,s,o,a)}function Zf(n){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(n)}function Qf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.glob(r,n,s)}function th(n){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(r,n)}function eh(n,s,o,a,l,u){return n>>>=0,o>>>=0,l>>>=0,globalThis.DUCKDB_RUNTIME.callScalarUDF(r,n,s,o,a,l,u)}var Sa=[],ih=(n,s)=>{Sa.length=0;for(var o;o=E[n++>>>0];){var a=o!=105;a&=o!=112,s+=a&&s%8?4:0,Sa.push(o==112?_t[s>>>2>>>0]:o==105?C[s>>>2>>>0]:St[s>>>3>>>0]),s+=a?8:4}return Sa},rh=(n,s,o)=>{var a=ih(s,o);return Hd[n](...a)};function nh(n,s,o){return n>>>=0,s>>>=0,o>>>=0,rh(n,s,o)}var sh=()=>Date.now(),Qc=()=>4294901760;function oh(){return Qc()}var tl;tl=()=>performance.now();var ah=n=>{var s=q.buffer,o=(n-s.byteLength+65535)/65536;try{return q.grow(o),Ee(),1}catch(a){}};function ch(n){n>>>=0;var s=E.length,o=Qc();if(n>o)return!1;for(var a=(p,y)=>p+(y-p%y)%y,l=1;l<=4;l*=2){var u=s*(1+.2/l);u=Math.min(u,n+100663296);var d=Math.min(o,a(Math.max(n,u),65536)),h=ah(d);if(h)return!0}return!1}var Ia={},lh=()=>T||"./this.program",mn=()=>{if(!mn.strings){var n=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",s={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:n,_:lh()};for(var o in Ia)Ia[o]===void 0?delete s[o]:s[o]=Ia[o];var a=[];for(var o in s)a.push("".concat(o,"=").concat(s[o]));mn.strings=a}return mn.strings},uh=(n,s)=>{for(var o=0;o<n.length;++o)J[s++>>>0]=n.charCodeAt(o);J[s>>>0]=0},dh=function(n,s){n>>>=0,s>>>=0;var o=0;return mn().forEach((a,l)=>{var u=s+o;_t[n+l*4>>>2>>>0]=u,uh(a,u),o+=a.length+1}),0},fh=function(n,s){n>>>=0,s>>>=0;var o=mn();_t[n>>>2>>>0]=o.length;var a=0;return o.forEach(l=>a+=l.length+1),_t[s>>>2>>>0]=a,0},hh=0,ph=()=>zd||hh>0,_h=n=>{var s;W=n,ph()||((s=r.onExit)==null||s.call(r,n),O=!0),D(n,new Lc(n))},el=(n,s)=>{W=n,_h(n)},yh=el,mh=n=>52;function bh(n,s){s>>>=0;var o=0,a=0,l=0;{var u=2;n==0?o=2:(n==1||n==2)&&(o=64),l=1}return J[s>>>0]=u,X[s+2>>>1>>>0]=l,Ur=[o>>>0,(Te=o,+Math.abs(Te)>=1?Te>0?+Math.floor(Te/4294967296)>>>0:~~+Math.ceil((Te-+(~~Te>>>0))/4294967296)>>>0:0)],C[s+8>>>2>>>0]=Ur[0],C[s+12>>>2>>>0]=Ur[1],Ur=[a>>>0,(Te=a,+Math.abs(Te)>=1?Te>0?+Math.floor(Te/4294967296)>>>0:~~+Math.ceil((Te-+(~~Te>>>0))/4294967296)>>>0:0)],C[s+16>>>2>>>0]=Ur[0],C[s+20>>>2>>>0]=Ur[1],0}function vh(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=lr(a,l);return u>>>=0,52}function gh(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=lr(a,l);return u>>>=0,52}function wh(n,s,o,a){return s>>>=0,o>>>=0,a>>>=0,52}function Sh(n,s,o,a,l){var u=lr(s,o);return l>>>=0,70}var Ih=n=>52,Th=[null,[],[]],jh=(n,s)=>{var o=Th[n];s===0||s===10?((n===1?te:k)($c(o,0)),o.length=0):o.push(s)};function Dh(n,s,o,a){s>>>=0,o>>>=0,a>>>=0;for(var l=0,u=0;u<o;u++){var d=_t[s>>>2>>>0],h=_t[s+4>>>2>>>0];s+=8;for(var p=0;p<h;p++)jh(n,E[d+p>>>0]);l+=h}return _t[a>>>2>>>0]=l,0}function Bh(n,s,o,a){n>>>=0,s>>>=0,o>>>=0,a>>>=0;var l=0,u=0,d=0,h=0,p=0,y=0,m;function v(I,B,F,A,$,yt){var x,H,Tt,Nt;return H=I===10?28:16,$=I===10?Vc($):ba($),x=hi(H),Nt=Is(x,I,$,yt),R(!Nt),Tt=hi(32),C[Tt+4>>>2>>>0]=I,C[Tt+8>>>2>>>0]=B,C[Tt+12>>>2>>>0]=F,_t[Tt+24>>>2>>>0]=A,_t[Tt+20>>>2>>>0]=x,I===10?C[Tt+16>>>2>>>0]=28:C[Tt+16>>>2>>>0]=16,C[Tt+28>>>2>>>0]=0,Tt}if(o&&(d=C[o>>>2>>>0],h=C[o+4>>>2>>>0],p=C[o+8>>>2>>>0],y=C[o+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&&!s)return-2;if(d&-1088||o!==0&&C[o>>>2>>>0]&2&&!n)return-1;if(d&32)return-2;if(p!==0&&p!==1&&p!==2)return-7;if(h!==0&&h!==2&&h!==10)return-6;if(s&&(s=It(s),u=parseInt(s,10),isNaN(u)))return d&1024?-2:-8;if(!n)return h===0&&(h=2),d&1||(h===2?l=_htonl(2130706433):l=[0,0,0,1]),m=v(h,p,y,null,l,u),_t[a>>>2>>>0]=m,0;if(n=It(n),l=ws(n),l!==null)if(h===0||h===2)h=2;else if(h===10&&d&8)l=[0,0,_htonl(65535),l],h=10;else return-2;else if(l=va(n),l!==null)if(h===0||h===10)h=10;else return-2;return l!=null?(m=v(h,p,y,n,l,u),_t[a>>>2>>>0]=m,0):d&4?-2:(n=_e.lookup_name(n),l=ws(n),h===0?h=2:h===10&&(l=[0,0,_htonl(65535),l]),m=v(h,p,y,null,l,u),_t[a>>>2>>>0]=m,0)}var Fh=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return a=>crypto.getRandomValues(a);if(N)try{var n=Fg("crypto"),s=n.randomFillSync;if(s)return a=>n.randomFillSync(a);var o=n.randomBytes;return a=>(a.set(o(a.byteLength)),a)}catch(a){}Ie("initRandomDevice")},il=n=>(il=Fh())(n);function Ah(n,s){return n>>>=0,s>>>=0,il(E.subarray(n>>>0,n+s>>>0)),0}function xh(n,s,o,a,l,u,d){n>>>=0,o>>>=0,l>>>=0;var h=Hc(n,s);if(h.errno)return-6;var p=h.port,y=h.addr,m=!1;if(o&&a){var v;if(d&1||!(v=_e.lookup_addr(y))){if(d&8)return-2}else y=v;var I=zi(y,o,a);I+1>=a&&(m=!0)}if(l&&u){p=""+p;var I=zi(p,l,u);I+1>=u&&(m=!0)}return m?-12:0}function kh(n){return n>>>=0,n}var Eh=(n,s)=>{for(var o=0,a=0;a<=s;o+=n[a++]);return o},rl=[31,29,31,30,31,30,31,31,30,31,30,31],nl=[31,28,31,30,31,30,31,31,30,31,30,31],Oh=(n,s)=>{for(var o=new Date(n.getTime());s>0;){var a=yn(o.getFullYear()),l=o.getMonth(),u=(a?rl:nl)[l];if(s>u-o.getDate())s-=u-o.getDate()+1,o.setDate(1),l<11?o.setMonth(l+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1));else return o.setDate(o.getDate()+s),o}return o};function Uh(n,s,o){var a=o>0?o:wa(n)+1,l=new Array(a),u=Yc(n,l,0,l.length);return s&&(l.length=u),l}var sl=(n,s)=>{J.set(n,s>>>0)};function Mh(n,s,o,a){n>>>=0,s>>>=0,o>>>=0,a>>>=0;var l=_t[a+40>>>2>>>0],u={tm_sec:C[a>>>2>>>0],tm_min:C[a+4>>>2>>>0],tm_hour:C[a+8>>>2>>>0],tm_mday:C[a+12>>>2>>>0],tm_mon:C[a+16>>>2>>>0],tm_year:C[a+20>>>2>>>0],tm_wday:C[a+24>>>2>>>0],tm_yday:C[a+28>>>2>>>0],tm_isdst:C[a+32>>>2>>>0],tm_gmtoff:C[a+36>>>2>>>0],tm_zone:l?It(l):""},d=It(o),h={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in h)d=d.replace(new RegExp(p,"g"),h[p]);var y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"];function v(x,H,Tt){for(var Nt=typeof x=="number"?x.toString():x||"";Nt.length<H;)Nt=Tt[0]+Nt;return Nt}function I(x,H){return v(x,H,"0")}function B(x,H){function Tt(Wi){return Wi<0?-1:Wi>0?1:0}var Nt;return(Nt=Tt(x.getFullYear()-H.getFullYear()))===0&&(Nt=Tt(x.getMonth()-H.getMonth()))===0&&(Nt=Tt(x.getDate()-H.getDate())),Nt}function F(x){switch(x.getDay()){case 0:return new Date(x.getFullYear()-1,11,29);case 1:return x;case 2:return new Date(x.getFullYear(),0,3);case 3:return new Date(x.getFullYear(),0,2);case 4:return new Date(x.getFullYear(),0,1);case 5:return new Date(x.getFullYear()-1,11,31);case 6:return new Date(x.getFullYear()-1,11,30)}}function A(x){var H=Oh(new Date(x.tm_year+1900,0,1),x.tm_yday),Tt=new Date(H.getFullYear(),0,4),Nt=new Date(H.getFullYear()+1,0,4),Wi=F(Tt),pi=F(Nt);return B(Wi,H)<=0?B(pi,H)<=0?H.getFullYear()+1:H.getFullYear():H.getFullYear()-1}var $={"%a":x=>y[x.tm_wday].substring(0,3),"%A":x=>y[x.tm_wday],"%b":x=>m[x.tm_mon].substring(0,3),"%B":x=>m[x.tm_mon],"%C":x=>{var H=x.tm_year+1900;return I(H/100|0,2)},"%d":x=>I(x.tm_mday,2),"%e":x=>v(x.tm_mday,2," "),"%g":x=>A(x).toString().substring(2),"%G":A,"%H":x=>I(x.tm_hour,2),"%I":x=>{var H=x.tm_hour;return H==0?H=12:H>12&&(H-=12),I(H,2)},"%j":x=>I(x.tm_mday+Eh(yn(x.tm_year+1900)?rl:nl,x.tm_mon-1),3),"%m":x=>I(x.tm_mon+1,2),"%M":x=>I(x.tm_min,2),"%n":()=>"\n","%p":x=>x.tm_hour>=0&&x.tm_hour<12?"AM":"PM","%S":x=>I(x.tm_sec,2),"%t":()=>" ","%u":x=>x.tm_wday||7,"%U":x=>{var H=x.tm_yday+7-x.tm_wday;return I(Math.floor(H/7),2)},"%V":x=>{var H=Math.floor((x.tm_yday+7-(x.tm_wday+6)%7)/7);if((x.tm_wday+371-x.tm_yday-2)%7<=2&&H++,H){if(H==53){var Nt=(x.tm_wday+371-x.tm_yday)%7;Nt!=4&&(Nt!=3||!yn(x.tm_year))&&(H=1)}}else{H=52;var Tt=(x.tm_wday+7-x.tm_yday-1)%7;(Tt==4||Tt==5&&yn(x.tm_year%400-1))&&H++}return I(H,2)},"%w":x=>x.tm_wday,"%W":x=>{var H=x.tm_yday+7-(x.tm_wday+6)%7;return I(Math.floor(H/7),2)},"%y":x=>(x.tm_year+1900).toString().substring(2),"%Y":x=>x.tm_year+1900,"%z":x=>{var H=x.tm_gmtoff,Tt=H>=0;return H=Math.abs(H)/60,H=H/60*100+H%60,(Tt?"+":"-")+("0000"+H).slice(-4)},"%Z":x=>x.tm_zone,"%%":()=>"%"};d=d.replace(/%%/g,"\0\0");for(var p in $)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),$[p](u)));d=d.replace(/\0\0/g,"%");var yt=Uh(d,!1);return yt.length>s?0:(sl(yt,n),yt.length-1)}function Rh(n,s,o,a,l){return n>>>=0,s>>>=0,o>>>=0,a>>>=0,l>>>=0,Mh(n,s,o,a)}var Ch=n=>{if(n instanceof Lc||n=="unwind")return W;D(1,n)},Ts=[],Ta,L=n=>{var s=Ts[n];return s||(n>=Ts.length&&(Ts.length=n+1),Ts[n]=s=Ta.get(n)),s},Lh=n=>{var s=r["_"+n];return s},js=n=>ul(n);r.stackAlloc=js;var Nh=n=>{var s=wa(n)+1,o=js(s);return zi(n,o,s),o},Ph=(n,s,o,a,l)=>{var u={string:F=>{var A=0;return F!=null&&F!==0&&(A=Nh(F)),A},array:F=>{var A=js(F.length);return sl(F,A),A}};function d(F){return s==="string"?It(F):s==="boolean"?!!F:F}var h=Lh(n),p=[],y=0;if(a)for(var m=0;m<a.length;m++){var v=u[o[m]];v?(y===0&&(y=S()),p[m]=v(a[m])):p[m]=a[m]}var I=h(...p);function B(F){return y!==0&&w(y),d(F)}return I=B(I),I},Cr=(n,s)=>{n<128?s.push(n):s.push(n%128|128,n>>7)},ja=(n,s)=>{var o=n.slice(0,1),a=n.slice(1),l={i:127,p:127,j:126,f:125,d:124,e:111};s.push(96),Cr(a.length,s);for(var u=0;u<a.length;++u)s.push(l[a[u]]);o=="v"?s.push(0):s.push(1,l[o])},Vh=n=>{var s=[],o=[0,97,115,109,1,0,0,0];s.push(o);var a=[n[0].replace("j","i"),"i",n.slice(1).replace(/j/g,"ii")].join(""),l=[3];ja(a,l),ja(n,l),ja("vi",l);var u=[1];Cr(l.length,u),u.push(...l),s.push(u);var d=[2,15,2,1,101,1,116,1,112,0,0,1,101,1,114,0,2];s.push(d);var h=[3,2,1,0];s.push(h);var p=[7,5,1,1,102,0,1];s.push(p);var y=[];n[0]==="j"?y=[1,1,126]:y.push(0);function m(H){y.push(32),Cr(H,y)}for(var v=1,I=1;I<n.length;I++)n[I]=="j"?(m(v+1),y.push(173,66,32,134),m(v),y.push(172,132),v+=2):(m(v),v++);y.push(32,0,17,1,0),n[0]==="j"&&(y.push(34),Cr(v,y),y.push(66,32,136,167,16,0),m(v),y.push(167)),y.push(11);var B=[1];Cr(y.length,B),B.push(...y);var F=[10];Cr(B.length,F),F.push(...B),s.push(F);var A=new Uint8Array([].concat.apply([],s)),$=new WebAssembly.Module(A),yt=new WebAssembly.Instance($,{e:{t:Ta,r:Mr}}),x=yt.exports.f;return x},Hh=n=>cl(),zh={q:Wd,Vb:$d,u:Yd,a:Kd,k:qd,B:Jd,ma:Xd,Pa:Nc,Kb:Zd,s:Qd,L:tf,c:Gd,gb:ef,lb:rf,Kg:nf,mh:sf,ba:of,lh:af,$b:cf,nh:lf,gh:uf,fb:df,eb:ff,jb:hf,Aa:pf,ih:_f,hh:yf,jh:mf,Na:bf,kb:vf,dh:gf,hb:wf,eh:Sf,$a:If,ib:Tf,Ma:jf,kh:Df,oh:Bf,ab:Ff,mb:xf,Lg:kf,Hg:Kc,Fg:qc,Jg:Jc,Ig:Xc,Gg:Zc,ec:Mf,Rc:Rf,Sc:Cf,rh:Lf,F:Nf,Xg:Pf,Yg:Vf,Vg:Hf,Wg:zf,Ya:Wf,$g:$f,Tg:Yf,Ug:Gf,_g:Kf,ua:qf,Zg:Jf,Za:Xf,ah:Zf,Sg:Qf,Xa:th,bh:eh,ra:nh,qa:sh,nb:oh,ya:tl,uh:ch,Od:dh,Zd:fh,_:yh,na:mh,df:bh,bc:vh,ac:gh,Qa:wh,Cg:Sh,fh:Ih,Ba:Dh,La:Bh,ch:Ah,Ka:xh,Q:ey,J:x_,ga:N_,D:d_,Ja:w_,$:T_,Wa:ty,oa:$p,Sa:uy,ia:B_,da:E_,Ta:sy,U:O_,rc:Iv,lc:Av,If:dm,sb:yg,Kc:nv,Qd:eb,jc:kv,kc:xv,X:b_,Ra:Wp,va:Q_,sc:Sv,Jf:um,p:Xp,E:y_,ph:$_,sh:H_,T:M_,ha:f_,za:z_,S:__,qh:W_,th:V_,ca:P_,d:Cp,O:C_,H:L_,_a:G_,C:S_,sa:K_,la:q_,zc:_v,Ga:Y_,pa:J_,b:Np,Fa:cy,yd:bb,Ve:Xm,g:Pp,bb:U_,Ea:dy,Da:fy,j:zp,Oa:n_,Qg:oy,ka:ly,o:Vp,cb:F_,v:Qp,w:Kp,I:u_,R:l_,Z:qp,ja:t_,r:Jp,A:o_,Og:hy,W:g_,x:v_,vb:hg,Nd:rb,xd:vb,He:d0,vd:wb,zd:mb,Jd:ab,Vd:J0,wd:gb,xb:dg,de:V0,Id:cb,Ad:yb,Yd:G0,Ie:u0,Wd:q0,$d:$0,Md:nb,Ue:Zm,rf:Fm,Mf:am,ue:T0,xe:w0,hd:Mb,Ag:vy,pf:xm,Nf:om,Hf:fm,of:km,Be:m0,zg:gy,ud:Sb,td:Ib,le:O0,qg:Ay,sf:Bm,Ae:b0,se:D0,ge:L0,sd:Tb,rd:jb,md:xb,Tc:Xb,Se:t0,Kd:ob,Xd:K0,Wf:Xy,pg:xy,lg:Uy,Ff:pm,Vf:Zy,ub:pg,Jb:Qv,Hb:eg,Yc:Yb,Sb:$v,Ub:zv,Rb:Yv,og:ky,xf:Sm,wf:Im,Le:a0,te:j0,rb:mg,vc:vv,Mb:Xv,vg:Ty,wb:fg,ve:I0,mg:Oy,Uf:Qy,Xf:Jy,Qe:i0,Ee:p0,Lc:rv,ld:kb,Ib:tg,Lb:Zv,Of:sm,bd:Vb,ig:Cy,Pe:r0,Oc:tv,Ac:pv,Oe:n0,Me:o0,wc:bv,xc:mv,tc:wv,Sf:em,cg:zy,we:S0,nc:Bv,fd:Cb,Ef:_m,Ke:c0,yf:wm,We:qm,Xe:Km,wg:Iy,tg:Dy,Rf:im,Eg:yy,Re:e0,nf:Em,Fd:db,yc:yv,Ze:Ym,Bc:hv,Hd:lb,Ye:Gm,Cd:pb,Dc:dv,Gc:cv,Vc:qb,mf:Om,ff:Nm,Td:Z0,Ud:X0,Hc:av,af:zm,ye:g0,kf:Mm,Kf:lm,Cf:mm,Zb:Nv,Cc:fv,_b:Lv,ef:Pm,Bd:_b,Ec:uv,zf:gm,Qc:Zb,Fb:rg,me:E0,Zc:$b,Bb:ag,ob:gg,Rd:tb,Gb:ig,pb:vg,sg:By,cd:Pb,oc:Dv,qb:bg,dd:Nb,ic:Ev,Ic:ov,_c:Wb,uc:gv,l:Mp,Ng:py,Rg:iy,Va:ry,h:Lp,G:c_,Ha:k_,K:j_,wa:Z_,Ua:ny,Mg:_y,Y:a_,N:A_,xa:X_,e:Rp,Ca:Gp,db:D_,f:Hp,Pg:ay,i:Yp,m:s_,n:r_,y:Zp,t:h_,P:m_,M:e_,aa:p_,Ia:I_,ea:R_,ta:i_,gg:Ny,lf:Um,qf:Am,Jc:sv,Pc:Qb,ne:k0,Af:vm,Ce:y0,Je:l0,tf:Dm,$c:zb,bf:Hm,ie:R0,Xb:Vv,ug:jy,Bf:bm,Dd:hb,Pb:Kv,fc:Mv,gc:Uv,ad:Hb,id:Ub,re:B0,Ld:sb,Uc:Jb,_d:Y0,ce:H0,Eb:ng,hg:Ly,yg:wy,fa:Jm,tb:_g,Qf:rm,uf:jm,vf:Tm,Fc:lv,dc:Rv,be:z0,gf:Lm,oe:x0,he:C0,Sd:Q0,je:M0,Qb:Gv,$f:Yy,Xc:Gb,Wc:Kb,Ed:fb,bg:Wy,yb:ug,dg:Hy,pd:Bb,xg:Sy,Mc:iv,Zf:Ky,Bg:by,jg:Ry,gd:Rb,Lf:cm,qe:F0,pe:A0,Tb:Wv,Wb:Hv,jd:Ob,fg:Py,Ob:qv,ae:W0,nd:Ab,qd:Db,cf:Vm,Dg:my,ke:U0,Gd:ub,kd:Eb,_f:Gy,ag:$y,Db:sg,od:Fb,Cb:og,rg:Fy,kg:My,Yf:qy,Ne:s0,ng:Ey,Ge:f0,Fe:h0,ze:v0,Ab:cg,zb:lg,Nb:Jv,ee:P0,Tf:tm,mc:Fv,qc:Tv,eg:Vy,Pd:ib,Yb:Pv,Te:Qm,$e:Wm,fe:N0,pc:jv,Pf:nm,_e:$m,Gf:hm,cc:Cv,ed:Lb,Df:ym,De:_0,hc:Ov,Nc:ev,jf:Rm,hf:Cm,z:kh,V:Rh},K=Vd(),ol=r._main=(n,s)=>(ol=r._main=K.xh)(n,s),Wh=r._duckdb_web_fs_glob_add_path=n=>(Wh=r._duckdb_web_fs_glob_add_path=K.zh)(n),$h=r._duckdb_web_clear_response=()=>($h=r._duckdb_web_clear_response=K.Ah)(),Yh=r._duckdb_web_fail_with=n=>(Yh=r._duckdb_web_fail_with=K.Bh)(n),Gh=r._duckdb_web_reset=n=>(Gh=r._duckdb_web_reset=K.Ch)(n),Kh=r._duckdb_web_connect=()=>(Kh=r._duckdb_web_connect=K.Dh)(),qh=r._duckdb_web_disconnect=n=>(qh=r._duckdb_web_disconnect=K.Eh)(n),Jh=r._duckdb_web_flush_files=()=>(Jh=r._duckdb_web_flush_files=K.Fh)(),Xh=r._duckdb_web_flush_file=n=>(Xh=r._duckdb_web_flush_file=K.Gh)(n),Zh=r._duckdb_web_open=(n,s)=>(Zh=r._duckdb_web_open=K.Hh)(n,s),Qh=r._duckdb_web_get_global_file_info=(n,s)=>(Qh=r._duckdb_web_get_global_file_info=K.Ih)(n,s),tp=r._duckdb_web_collect_file_stats=(n,s,o)=>(tp=r._duckdb_web_collect_file_stats=K.Jh)(n,s,o),ep=r._duckdb_web_export_file_stats=(n,s)=>(ep=r._duckdb_web_export_file_stats=K.Kh)(n,s),ip=r._duckdb_web_fs_drop_file=(n,s)=>(ip=r._duckdb_web_fs_drop_file=K.Lh)(n,s),rp=r._duckdb_web_fs_drop_files=(n,s,o)=>(rp=r._duckdb_web_fs_drop_files=K.Mh)(n,s,o),np=r._duckdb_web_fs_glob_file_infos=(n,s)=>(np=r._duckdb_web_fs_glob_file_infos=K.Nh)(n,s),sp=r._duckdb_web_fs_get_file_info_by_id=(n,s,o)=>(sp=r._duckdb_web_fs_get_file_info_by_id=K.Oh)(n,s,o),op=r._duckdb_web_fs_get_file_info_by_name=(n,s,o)=>(op=r._duckdb_web_fs_get_file_info_by_name=K.Ph)(n,s,o),ap=r._duckdb_web_fs_register_file_url=(n,s,o,a,l)=>(ap=r._duckdb_web_fs_register_file_url=K.Qh)(n,s,o,a,l),cp=r._duckdb_web_fs_register_file_buffer=(n,s,o,a)=>(cp=r._duckdb_web_fs_register_file_buffer=K.Rh)(n,s,o,a),lp=r._duckdb_web_copy_file_to_buffer=(n,s)=>(lp=r._duckdb_web_copy_file_to_buffer=K.Sh)(n,s),up=r._duckdb_web_copy_file_to_path=(n,s,o)=>(up=r._duckdb_web_copy_file_to_path=K.Th)(n,s,o),dp=r._duckdb_web_get_version=n=>(dp=r._duckdb_web_get_version=K.Uh)(n),fp=r._duckdb_web_get_feature_flags=()=>(fp=r._duckdb_web_get_feature_flags=K.Vh)(),hp=r._duckdb_web_tokenize=(n,s)=>(hp=r._duckdb_web_tokenize=K.Wh)(n,s),pp=r._duckdb_web_tokenize_buffer=(n,s,o)=>(pp=r._duckdb_web_tokenize_buffer=K.Xh)(n,s,o),_p=r._duckdb_web_udf_scalar_create=(n,s,o)=>(_p=r._duckdb_web_udf_scalar_create=K.Yh)(n,s,o),yp=r._duckdb_web_prepared_create=(n,s,o)=>(yp=r._duckdb_web_prepared_create=K.Zh)(n,s,o),mp=r._duckdb_web_prepared_create_buffer=(n,s,o,a)=>(mp=r._duckdb_web_prepared_create_buffer=K._h)(n,s,o,a),bp=r._duckdb_web_prepared_close=(n,s,o)=>(bp=r._duckdb_web_prepared_close=K.$h)(n,s,o),vp=r._duckdb_web_prepared_run=(n,s,o,a)=>(vp=r._duckdb_web_prepared_run=K.ai)(n,s,o,a),gp=r._duckdb_web_prepared_send=(n,s,o,a)=>(gp=r._duckdb_web_prepared_send=K.bi)(n,s,o,a),wp=r._duckdb_web_query_run=(n,s,o)=>(wp=r._duckdb_web_query_run=K.ci)(n,s,o),Sp=r._duckdb_web_query_run_buffer=(n,s,o,a)=>(Sp=r._duckdb_web_query_run_buffer=K.di)(n,s,o,a),Ip=r._duckdb_web_pending_query_start=(n,s,o,a)=>(Ip=r._duckdb_web_pending_query_start=K.ei)(n,s,o,a),Tp=r._duckdb_web_pending_query_start_buffer=(n,s,o,a,l)=>(Tp=r._duckdb_web_pending_query_start_buffer=K.fi)(n,s,o,a,l),jp=r._duckdb_web_pending_query_poll=(n,s,o)=>(jp=r._duckdb_web_pending_query_poll=K.gi)(n,s,o),Dp=r._duckdb_web_pending_query_cancel=(n,s)=>(Dp=r._duckdb_web_pending_query_cancel=K.hi)(n,s),Bp=r._duckdb_web_query_fetch_results=(n,s)=>(Bp=r._duckdb_web_query_fetch_results=K.ii)(n,s),Fp=r._duckdb_web_get_tablenames=(n,s,o)=>(Fp=r._duckdb_web_get_tablenames=K.ji)(n,s,o),Ap=r._duckdb_web_get_tablenames_buffer=(n,s,o,a)=>(Ap=r._duckdb_web_get_tablenames_buffer=K.ki)(n,s,o,a),xp=r._duckdb_web_insert_arrow_from_ipc_stream=(n,s,o,a,l)=>(xp=r._duckdb_web_insert_arrow_from_ipc_stream=K.li)(n,s,o,a,l),kp=r._duckdb_web_insert_csv_from_path=(n,s,o,a)=>(kp=r._duckdb_web_insert_csv_from_path=K.mi)(n,s,o,a),Ep=r._duckdb_web_insert_json_from_path=(n,s,o,a)=>(Ep=r._duckdb_web_insert_json_from_path=K.ni)(n,s,o,a),hi=r._malloc=n=>(hi=r._malloc=K.ri)(n),Op=r._free=n=>(Op=r._free=K.si)(n),Up=r._calloc=(n,s)=>(Up=r._calloc=K.ti)(n,s),al=n=>(al=K.vi)(n),cl=()=>(cl=K.wi)(),ll=n=>(ll=K.xi)(n),ul=n=>(ul=K.yi)(n),dl=()=>(dl=K.zi)();function Mp(n){var s=S();try{L(n)()}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function Rp(n,s,o){var a=S();try{L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Cp(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Lp(n,s){var o=S();try{L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Np(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Pp(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Vp(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Hp(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function zp(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Wp(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function $p(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Yp(n,s,o,a,l){var u=S();try{L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Gp(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Kp(n,s,o,a,l,u,d,h){var p=S();try{return L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function qp(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Jp(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Xp(n){var s=S();try{return L(n)()}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function Zp(n,s,o,a,l,u,d,h){var p=S();try{L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Qp(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function t_(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function e_(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{L(n)(s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function i_(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A){var $=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A)}catch(yt){if(w($),yt!==yt+0)throw yt;_setThrew(1,0)}}function r_(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function n_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function s_(n,s,o,a,l,u){var d=S();try{L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function o_(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function a_(n,s,o){var a=S();try{L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function c_(n,s,o){var a=S();try{L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function l_(n,s,o,a,l,u,d,h,p,y){var m=S();try{return L(n)(s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function u_(n,s,o,a,l,u,d,h,p){var y=S();try{return L(n)(s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function d_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function f_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function h_(n,s,o,a,l,u,d,h,p){var y=S();try{L(n)(s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function p_(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function __(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function y_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function m_(n,s,o,a,l,u,d,h,p,y){var m=S();try{L(n)(s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function b_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function v_(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt){var x=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt)}catch(H){if(w(x),H!==H+0)throw H;_setThrew(1,0)}}function g_(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$){var yt=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$)}catch(x){if(w(yt),x!==x+0)throw x;_setThrew(1,0)}}function w_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function S_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function I_(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function T_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function j_(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function D_(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{L(n)(s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function B_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function F_(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function A_(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function x_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function k_(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function E_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function O_(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function U_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function M_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function R_(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function C_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function L_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function N_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function P_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function V_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function H_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function z_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function W_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function $_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Y_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function G_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function K_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function q_(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function J_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function X_(n,s,o,a,l){var u=S();try{L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Z_(n,s,o,a,l){var u=S();try{L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Q_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function ty(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ey(n){var s=S();try{return L(n)()}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function iy(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ry(n,s,o,a,l,u,d,h){var p=S();try{L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ny(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function sy(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function oy(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ay(n,s,o,a,l,u){var d=S();try{L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function cy(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ly(n,s,o,a,l,u,d,h){var p=S();try{return L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function uy(n,s,o,a,l,u,d,h,p,y){var m=S();try{return L(n)(s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function dy(n,s,o,a,l,u,d,h,p){var y=S();try{return L(n)(s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function fy(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function hy(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A){var $=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A)}catch(yt){if(w($),yt!==yt+0)throw yt;_setThrew(1,0)}}function py(n,s,o,a,l,u){var d=S();try{L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function _y(n,s,o,a,l,u,d,h){var p=S();try{L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function yy(n,s,o,a,l){var u=S();try{return dynCall_jiiii(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function my(n,s,o,a,l,u,d){var h=S();try{dynCall_viijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function by(n,s,o,a,l,u,d){var h=S();try{dynCall_viijii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function vy(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function gy(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiijj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function wy(n,s,o,a,l,u){var d=S();try{dynCall_viiij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Sy(n,s,o,a,l){var u=S();try{dynCall_viij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Iy(n,s){var o=S();try{return dynCall_ji(n,s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Ty(n,s,o,a){var l=S();try{return dynCall_iij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function jy(n,s,o,a,l,u,d){var h=S();try{dynCall_viiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Dy(n,s,o){var a=S();try{return dynCall_jii(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function By(n,s,o){var a=S();try{return dynCall_jj(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Fy(n,s,o,a){var l=S();try{dynCall_vij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Ay(n,s,o,a,l,u){var d=S();try{return dynCall_iiiij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function xy(n,s,o,a,l){var u=S();try{return dynCall_iiij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function ky(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiijij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Ey(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijiiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Oy(n,s,o,a,l){var u=S();try{return dynCall_iiji(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Uy(n,s,o,a,l,u){var d=S();try{return dynCall_iiiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function My(n,s,o,a,l){var u=S();try{dynCall_viji(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Ry(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viijiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Cy(n,s,o,a,l,u){var d=S();try{return dynCall_iijj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Ly(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiijjjii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Ny(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiiiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Py(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viijij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Vy(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijijj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Hy(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijjjj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function zy(n,s,o,a){var l=S();try{return dynCall_iji(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Wy(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function $y(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijjji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Yy(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiijj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Gy(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijjj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Ky(n,s,o,a,l,u){var d=S();try{dynCall_viiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function qy(n,s,o,a,l,u){var d=S();try{dynCall_vijii(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Jy(n,s,o,a,l,u,d){var h=S();try{return dynCall_iijiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Xy(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiijjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Zy(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiijiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Qy(n,s,o,a,l,u){var d=S();try{return dynCall_iijii(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function tm(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function em(n,s,o){var a=S();try{return dynCall_ij(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function im(n,s,o,a){var l=S();try{return dynCall_jiii(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function rm(n,s,o,a,l,u,d){var h=S();try{dynCall_viiiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function nm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijjj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function sm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iijij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function om(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiijii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function am(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiiijii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function cm(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function lm(n,s,o,a,l,u){var d=S();try{return dynCall_jiiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function um(n,s,o,a,l,u){var d=S();try{return dynCall_fiiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function dm(n,s,o,a,l,u){var d=S();try{return dynCall_diiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function fm(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiijiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function hm(n,s,o){var a=S();try{dynCall_vj(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function pm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiijii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function _m(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_ijjiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ym(n,s,o,a,l,u,d){var h=S();try{dynCall_vjiiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function mm(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiijii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function bm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiiiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function vm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiiiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function gm(n,s,o,a){var l=S();try{return dynCall_jij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function wm(n){var s=S();try{return dynCall_j(n)}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function Sm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Im(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiijji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Tm(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiijiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function jm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiijii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Dm(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiiijiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Bm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiiiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Fm(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Am(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiiiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function xm(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiiiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function km(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiijiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Em(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiiiiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Om(n,s,o,a,l,u){var d=S();try{return dynCall_jiiij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Um(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiiiijij(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Mm(n,s,o,a,l){var u=S();try{return dynCall_jiij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Rm(n,s,o,a,l,u,d){var h=S();try{dynCall_vjjii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Cm(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_vjjijij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Lm(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijiijij(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Nm(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiiiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Pm(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiijiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Vm(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijijj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Hm(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiiijij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function zm(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiijij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Wm(n,s,o,a,l,u,d){var h=S();try{dynCall_vijji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function $m(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijjji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Ym(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiiiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Gm(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Km(n,s){var o=S();try{return dynCall_jf(n,s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function qm(n,s){var o=S();try{return dynCall_jd(n,s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Jm(n,s,o,a,l,u,d){var h=S();try{dynCall_viiijd(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Xm(n,s,o,a,l,u){var d=S();try{return dynCall_iiifj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Zm(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiiiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Qm(n,s,o,a,l,u){var d=S();try{dynCall_vijj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function t0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiijj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function e0(n,s,o,a,l,u){var d=S();try{return dynCall_jiiiii(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function i0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iijiiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function r0(n,s,o,a,l,u,d){var h=S();try{return dynCall_iijji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function n0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijjiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function s0(n,s,o,a,l,u,d){var h=S();try{dynCall_vijiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function o0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iijjiiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function a0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijjiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function c0(n,s,o,a,l,u,d){var h=S();try{return dynCall_ijjj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function l0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiiijii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function u0(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt){var Wi=S();try{return dynCall_iiiiiiiijjjjjjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt)}catch(pi){if(w(Wi),pi!==pi+0)throw pi;_setThrew(1,0)}}function d0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiiiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function f0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijiiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function h0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_vijiiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function p0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iijiiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function _0(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vjiiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function y0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function m0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiijiiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function b0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiijii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function v0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_vijiiiiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function g0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiijj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function w0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiiijji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function S0(n,s,o,a,l){var u=S();try{return dynCall_ijii(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function I0(n,s,o,a,l){var u=S();try{return dynCall_iijf(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function T0(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$){var yt=S();try{return dynCall_iiiiiijiijjji(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$)}catch(x){if(w(yt),x!==x+0)throw x;_setThrew(1,0)}}function j0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiijjijiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function D0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiijiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function B0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiijij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function F0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viijiiiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function A0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function x0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijiijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function k0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiiijjj(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function E0(n,s,o,a,l,u,d){var h=S();try{return dynCall_jijij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function O0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiijjj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function U0(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viijji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function M0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiijijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function R0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiijjij(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function C0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiijij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function L0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiijiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function N0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijjiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function P0(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function V0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiiiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function H0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiijjij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function z0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijiiijii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function W0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijijiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function $0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiiiiji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Y0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiijjii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function G0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiiijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function K0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiijjiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function q0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiiiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function J0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiiiiiiiijii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function X0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiijiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Z0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiijii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Q0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijiji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function tb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jijjj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function eb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_dijjj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ib(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_vijijjd(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function rb(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{return dynCall_iiiiiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function nb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiijji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function sb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiijj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function ob(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiijji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function ab(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function cb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function lb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_jiiiiijji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function ub(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijjii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function db(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiiiiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function fb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiijjiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function hb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiijii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function pb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiiiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function _b(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function yb(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiiiiiiijiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function mb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiiiiiij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function bb(n,s,o,a,l,u){var d=S();try{return dynCall_iiidj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function vb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A){var $=S();try{return dynCall_iiiiiiiiiiijiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A)}catch(yt){if(w($),yt!==yt+0)throw yt;_setThrew(1,0)}}function gb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x){var H=S();try{return dynCall_iiiiiiiiijiiiiiiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x)}catch(Tt){if(w(H),Tt!==Tt+0)throw Tt;_setThrew(1,0)}}function wb(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiiiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Sb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiijjii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Ib(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiijjij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Tb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiijiiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function jb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiijiiij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Db(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{dynCall_viijijijiji(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function Bb(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{dynCall_viiijjjjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function Fb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijjjji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Ab(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{dynCall_viijijijij(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function xb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{return dynCall_iiiijiijjiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function kb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iijiiiiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Eb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijjiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Ob(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijiijji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Ub(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{dynCall_viiiijiijjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function Mb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H){var Tt=S();try{return dynCall_iiiiiijjiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H)}catch(Nt){if(w(Tt),Nt!==Nt+0)throw Nt;_setThrew(1,0)}}function Rb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Cb(n,s,o,a,l,u){var d=S();try{return dynCall_ijji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Lb(n,s,o,a,l){var u=S();try{dynCall_vjii(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Nb(n,s,o,a,l){var u=S();try{return dynCall_jjj(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Pb(n,s,o,a){var l=S();try{return dynCall_jji(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Vb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iijiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Hb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{dynCall_viiiijiiiiiiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function zb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiiijiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Wb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jjjij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function $b(n,s,o,a,l,u){var d=S();try{return dynCall_jijj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Yb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiijiiiji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Gb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiijji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Kb(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijjii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function qb(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiiiijji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Jb(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiijji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Xb(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiijij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Zb(n,s,o,a,l){var u=S();try{return dynCall_jiji(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Qb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiiiijij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function tv(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iijjii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ev(n,s,o,a,l){var u=S();try{dynCall_vjj(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function iv(n,s,o,a,l,u){var d=S();try{dynCall_viijd(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function rv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijiiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function nv(n,s,o,a){var l=S();try{return dynCall_dij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function sv(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiiiiji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ov(n,s,o,a,l,u,d){var h=S();try{return dynCall_jjjii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function av(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_jiiijiijiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function cv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiiiijiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function lv(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function uv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiijjiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function dv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiiijii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function fv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiijiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function hv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_jiiiiijiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function pv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iijjiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function _v(n,s,o,a,l){var u=S();try{return dynCall_iidj(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function yv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiiiiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function mv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijjjii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function bv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iijjji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function vv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiijjj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function gv(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jjjji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function wv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijjjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Sv(n,s,o,a,l,u,d){var h=S();try{return dynCall_fiiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Iv(n,s,o,a,l,u,d){var h=S();try{return dynCall_diiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Tv(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function jv(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijjij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Dv(n,s,o,a,l,u){var d=S();try{return dynCall_jjij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Bv(n,s,o,a,l,u){var d=S();try{return dynCall_ijij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Fv(n,s,o,a,l,u,d){var h=S();try{dynCall_vijij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Av(n,s,o,a,l){var u=S();try{return dynCall_diij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function xv(n,s,o,a,l,u){var d=S();try{return dynCall_djij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function kv(n,s,o){var a=S();try{return dynCall_dj(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Ev(n,s,o,a,l,u){var d=S();try{return dynCall_jjjd(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Ov(n,s,o,a,l,u){var d=S();try{dynCall_vjij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Uv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiijiiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Mv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiijiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Rv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijiiiji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Cv(n,s,o,a){var l=S();try{dynCall_vji(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Lv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiijiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Nv(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiijiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Pv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_vijijjji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Vv(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiijjji(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Hv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viijiijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function zv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiijiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Wv(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function $v(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiijiiijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Yv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiijiijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Gv(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijijjj(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Kv(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiijiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function qv(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Jv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_vijiiiiji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Xv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijjji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Zv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijiijj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Qv(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiijiiiijj(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function tg(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iijiiijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function eg(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ig(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jijjjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function rg(n,s,o,a,l,u,d){var h=S();try{return dynCall_jijiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ng(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiijjj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function sg(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijjjiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function og(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viijjjjii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function ag(n,s,o,a,l,u,d){var h=S();try{return dynCall_jijji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function cg(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_vijiiiiiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function lg(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_vijiiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ug(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijjjiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function dg(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{return dynCall_iiiiiiiiijji(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function fg(n,s,o,a,l){var u=S();try{return dynCall_iijd(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function hg(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt){var Wi=S();try{return dynCall_iiiiiiiiiiiijjidjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt)}catch(pi){if(w(Wi),pi!==pi+0)throw pi;_setThrew(1,0)}}function pg(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function _g(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijdjji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function yg(n,s,o,a,l,u,d){var h=S();try{return dynCall_diijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function mg(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiijjijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function bg(n,s,o,a,l,u,d){var h=S();try{return dynCall_jjiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function vg(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_jijjjjjd(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function gg(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jijjiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function wg(n){n=Object.assign({},n);var s=a=>l=>a(l)>>>0,o=a=>()=>a()>>>0;return n.ri=s(n.ri),n.yi=s(n.yi),n.zi=o(n.zi),n}r.stackSave=S,r.stackRestore=w,r.stackAlloc=js,r.getTempRet0=Hh,r.setTempRet0=Mr,r.ccall=Ph,r.createDyncallWrapper=Vh;var Ds;_n=function n(){Ds||fl(),Ds||(_n=n)};function Sg(){var n=ol,s=0,o=0;try{var a=n(s,o);return el(a,!0),a}catch(l){return Ch(l)}}function fl(){if(cr>0||(Ad(),cr>0))return;function n(){Ds||(Ds=!0,r.calledRun=!0,!O&&(xd(),kd(),c(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),hl&&Sg(),Ed()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),n()},1)):n()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var hl=!0;return r.noInitialRun&&(hl=!1),fl(),_}})();typeof bd=="object"&&typeof Ec=="object"?Ec.exports=md:typeof define=="function"&&define.amd&&define([],()=>md)});var wd=Lr(()=>{});var Sd=Lr(()=>{});var Id=Lr((c2,_a)=>{(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",c=!e.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node&&process.type!="renderer";c?e=global:r&&(e=self);var f=!e.JS_SHA256_NO_COMMON_JS&&typeof _a=="object"&&_a.exports,_=typeof define=="function"&&define.amd,b=!e.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),T=[-2147483648,8388608,32768,128],D=[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],M=["hex","array","digest","arrayBuffer"],N=[];(e.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),b&&(e.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(k){return typeof k=="object"&&k.buffer&&k.buffer.constructor===ArrayBuffer});var nt=function(k,P){return function(q){return new Dt(P,!0).update(q)[k]()}},Et=function(k){var P=nt("hex",k);c&&(P=Wt(P,k)),P.create=function(){return new Dt(k)},P.update=function(W){return P.create().update(W)};for(var q=0;q<M.length;++q){var O=M[q];P[O]=nt(O,k)}return P},Wt=function(k,P){var q=wd(),O=Sd().Buffer,W=P?"sha224":"sha256",R;O.from&&!e.JS_SHA256_NO_BUFFER_FROM?R=O.from:R=function(E){return new O(E)};var J=function(E){if(typeof E=="string")return q.createHash(W).update(E,"utf8").digest("hex");if(E==null)throw new Error(i);return E.constructor===ArrayBuffer&&(E=new Uint8Array(E)),Array.isArray(E)||ArrayBuffer.isView(E)||E.constructor===O?q.createHash(W).update(R(E)).digest("hex"):k(E)};return J},Vt=function(k,P){return function(q,O){return new Qt(q,P,!0).update(O)[k]()}},kt=function(k){var P=Vt("hex",k);P.create=function(W){return new Qt(W,k)},P.update=function(W,R){return P.create(W).update(R)};for(var q=0;q<M.length;++q){var O=M[q];P[O]=Vt(O,k)}return P};function Dt(k,P){P?(N[0]=N[16]=N[1]=N[2]=N[3]=N[4]=N[5]=N[6]=N[7]=N[8]=N[9]=N[10]=N[11]=N[12]=N[13]=N[14]=N[15]=0,this.blocks=N):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],k?(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=k}Dt.prototype.update=function(k){if(!this.finalized){var P,q=typeof k;if(q!=="string"){if(q==="object"){if(k===null)throw new Error(i);if(b&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!b||!ArrayBuffer.isView(k)))throw new Error(i)}else throw new Error(i);P=!0}for(var O,W=0,R,J=k.length,E=this.blocks;W<J;){if(this.hashed&&(this.hashed=!1,E[0]=this.block,this.block=E[16]=E[1]=E[2]=E[3]=E[4]=E[5]=E[6]=E[7]=E[8]=E[9]=E[10]=E[11]=E[12]=E[13]=E[14]=E[15]=0),P)for(R=this.start;W<J&&R<64;++W)E[R>>>2]|=k[W]<<D[R++&3];else for(R=this.start;W<J&&R<64;++W)O=k.charCodeAt(W),O<128?E[R>>>2]|=O<<D[R++&3]:O<2048?(E[R>>>2]|=(192|O>>>6)<<D[R++&3],E[R>>>2]|=(128|O&63)<<D[R++&3]):O<55296||O>=57344?(E[R>>>2]|=(224|O>>>12)<<D[R++&3],E[R>>>2]|=(128|O>>>6&63)<<D[R++&3],E[R>>>2]|=(128|O&63)<<D[R++&3]):(O=65536+((O&1023)<<10|k.charCodeAt(++W)&1023),E[R>>>2]|=(240|O>>>18)<<D[R++&3],E[R>>>2]|=(128|O>>>12&63)<<D[R++&3],E[R>>>2]|=(128|O>>>6&63)<<D[R++&3],E[R>>>2]|=(128|O&63)<<D[R++&3]);this.lastByteIndex=R,this.bytes+=R-this.start,R>=64?(this.block=E[16],this.start=R-64,this.hash(),this.hashed=!0):this.start=R}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Dt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var k=this.blocks,P=this.lastByteIndex;k[16]=this.block,k[P>>>2]|=T[P&3],this.block=k[16],P>=56&&(this.hashed||this.hash(),k[0]=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),k[14]=this.hBytes<<3|this.bytes>>>29,k[15]=this.bytes<<3,this.hash()}},Dt.prototype.hash=function(){var k=this.h0,P=this.h1,q=this.h2,O=this.h3,W=this.h4,R=this.h5,J=this.h6,E=this.h7,X=this.blocks,st,C,_t,ti,St,Ee,Oe,Vi,pn,kr,Er;for(st=16;st<64;++st)St=X[st-15],C=(St>>>7|St<<25)^(St>>>18|St<<14)^St>>>3,St=X[st-2],_t=(St>>>17|St<<15)^(St>>>19|St<<13)^St>>>10,X[st]=X[st-16]+C+X[st-7]+_t<<0;for(Er=P&q,st=0;st<64;st+=4)this.first?(this.is224?(Vi=300032,St=X[0]-1413257819,E=St-150054599<<0,O=St+24177077<<0):(Vi=704751109,St=X[0]-210244248,E=St-1521486534<<0,O=St+143694565<<0),this.first=!1):(C=(k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10),_t=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),Vi=k&P,ti=Vi^k&q^Er,Oe=W&R^~W&J,St=E+_t+Oe+U[st]+X[st],Ee=C+ti,E=O+St<<0,O=St+Ee<<0),C=(O>>>2|O<<30)^(O>>>13|O<<19)^(O>>>22|O<<10),_t=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),pn=O&k,ti=pn^O&P^Vi,Oe=E&W^~E&R,St=J+_t+Oe+U[st+1]+X[st+1],Ee=C+ti,J=q+St<<0,q=St+Ee<<0,C=(q>>>2|q<<30)^(q>>>13|q<<19)^(q>>>22|q<<10),_t=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),kr=q&O,ti=kr^q&k^pn,Oe=J&E^~J&W,St=R+_t+Oe+U[st+2]+X[st+2],Ee=C+ti,R=P+St<<0,P=St+Ee<<0,C=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),_t=(R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7),Er=P&q,ti=Er^P&O^kr,Oe=R&J^~R&E,St=W+_t+Oe+U[st+3]+X[st+3],Ee=C+ti,W=k+St<<0,k=St+Ee<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+k<<0,this.h1=this.h1+P<<0,this.h2=this.h2+q<<0,this.h3=this.h3+O<<0,this.h4=this.h4+W<<0,this.h5=this.h5+R<<0,this.h6=this.h6+J<<0,this.h7=this.h7+E<<0},Dt.prototype.hex=function(){this.finalize();var k=this.h0,P=this.h1,q=this.h2,O=this.h3,W=this.h4,R=this.h5,J=this.h6,E=this.h7,X=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[P>>>28&15]+g[P>>>24&15]+g[P>>>20&15]+g[P>>>16&15]+g[P>>>12&15]+g[P>>>8&15]+g[P>>>4&15]+g[P&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]+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[W>>>28&15]+g[W>>>24&15]+g[W>>>20&15]+g[W>>>16&15]+g[W>>>12&15]+g[W>>>8&15]+g[W>>>4&15]+g[W&15]+g[R>>>28&15]+g[R>>>24&15]+g[R>>>20&15]+g[R>>>16&15]+g[R>>>12&15]+g[R>>>8&15]+g[R>>>4&15]+g[R&15]+g[J>>>28&15]+g[J>>>24&15]+g[J>>>20&15]+g[J>>>16&15]+g[J>>>12&15]+g[J>>>8&15]+g[J>>>4&15]+g[J&15];return this.is224||(X+=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]),X},Dt.prototype.toString=Dt.prototype.hex,Dt.prototype.digest=function(){this.finalize();var k=this.h0,P=this.h1,q=this.h2,O=this.h3,W=this.h4,R=this.h5,J=this.h6,E=this.h7,X=[k>>>24&255,k>>>16&255,k>>>8&255,k&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,q>>>24&255,q>>>16&255,q>>>8&255,q&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255,R>>>24&255,R>>>16&255,R>>>8&255,R&255,J>>>24&255,J>>>16&255,J>>>8&255,J&255];return this.is224||X.push(E>>>24&255,E>>>16&255,E>>>8&255,E&255),X},Dt.prototype.array=Dt.prototype.digest,Dt.prototype.arrayBuffer=function(){this.finalize();var k=new ArrayBuffer(this.is224?28:32),P=new DataView(k);return P.setUint32(0,this.h0),P.setUint32(4,this.h1),P.setUint32(8,this.h2),P.setUint32(12,this.h3),P.setUint32(16,this.h4),P.setUint32(20,this.h5),P.setUint32(24,this.h6),this.is224||P.setUint32(28,this.h7),k};function Qt(k,P,q){var O,W=typeof k;if(W==="string"){var R=[],J=k.length,E=0,X;for(O=0;O<J;++O)X=k.charCodeAt(O),X<128?R[E++]=X:X<2048?(R[E++]=192|X>>>6,R[E++]=128|X&63):X<55296||X>=57344?(R[E++]=224|X>>>12,R[E++]=128|X>>>6&63,R[E++]=128|X&63):(X=65536+((X&1023)<<10|k.charCodeAt(++O)&1023),R[E++]=240|X>>>18,R[E++]=128|X>>>12&63,R[E++]=128|X>>>6&63,R[E++]=128|X&63);k=R}else if(W==="object"){if(k===null)throw new Error(i);if(b&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!b||!ArrayBuffer.isView(k)))throw new Error(i)}else throw new Error(i);k.length>64&&(k=new Dt(P,!0).update(k).array());var st=[],C=[];for(O=0;O<64;++O){var _t=k[O]||0;st[O]=92^_t,C[O]=54^_t}Dt.call(this,P,q),this.update(C),this.oKeyPad=st,this.inner=!0,this.sharedMemory=q}Qt.prototype=new Dt,Qt.prototype.finalize=function(){if(Dt.prototype.finalize.call(this),this.inner){this.inner=!1;var k=this.array();Dt.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(k),Dt.prototype.finalize.call(this)}};var te=Et();te.sha256=te,te.sha224=Et(!0),te.sha256.hmac=kt(),te.sha224.hmac=kt(!0),f?_a.exports=te:(e.sha256=te.sha256,e.sha224=te.sha224,_&&define(function(){return te}))})()});var s1={};$i(s1,{registerWorker:()=>Fd});function ml(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 c=0,r=Object.getOwnPropertySymbols(i);c<r.length;c++)t.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(i,r[c])&&(e[r[c]]=i[r[c]]);return e}function V(i,t,e,r){function c(f){return f instanceof e?f:new e(function(_){_(f)})}return new(e||(e=Promise))(function(f,_){function b(D){try{T(r.next(D))}catch(U){_(U)}}function g(D){try{T(r.throw(D))}catch(U){_(U)}}function T(D){D.done?f(D.value):c(D.value).then(b,g)}T((r=r.apply(i,t||[])).next())})}function yl(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 pt(i){return this instanceof pt?(this.v=i,this):new pt(i)}function ye(i,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e.apply(i,t||[]),c,f=[];return c={},_("next"),_("throw"),_("return"),c[Symbol.asyncIterator]=function(){return this},c;function _(M){r[M]&&(c[M]=function(N){return new Promise(function(nt,Et){f.push([M,N,nt,Et])>1||b(M,N)})})}function b(M,N){try{g(r[M](N))}catch(nt){U(f[0][3],nt)}}function g(M){M.value instanceof pt?Promise.resolve(M.value.v).then(T,D):U(f[0][2],M)}function T(M){b("next",M)}function D(M){b("throw",M)}function U(M,N){M(N),f.shift(),f.length&&b(f[0][0],f[0][1])}}function Nr(i){var t,e;return t={},r("next"),r("throw",function(c){throw c}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(c,f){t[c]=i[c]?function(_){return(e=!e)?{value:pt(i[c](_)),done:!1}:f?f(_):_}:f}}function Ue(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 yl=="function"?yl(i):i[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(f){e[f]=i[f]&&function(_){return new Promise(function(b,g){_=i[f](_),c(b,g,_.done,_.value)})}}function c(f,_,b,g){Promise.resolve(g).then(function(T){f({value:T,done:b})},_)}}var Ea={};$i(Ea,{compareArrayLike:()=>ka,joinUint8Arrays:()=>me,memcpy:()=>gn,rebaseValueOffsets:()=>Ms,toArrayBufferView:()=>mt,toArrayBufferViewAsyncIterator:()=>Ce,toArrayBufferViewIterator:()=>ii,toBigInt64Array:()=>Us,toBigUint64Array:()=>Ng,toFloat32Array:()=>Pg,toFloat32ArrayAsyncIterator:()=>iw,toFloat32ArrayIterator:()=>Kg,toFloat64Array:()=>Vg,toFloat64ArrayAsyncIterator:()=>rw,toFloat64ArrayIterator:()=>qg,toInt16Array:()=>Rg,toInt16ArrayAsyncIterator:()=>Zg,toInt16ArrayIterator:()=>Wg,toInt32Array:()=>dr,toInt32ArrayAsyncIterator:()=>Qg,toInt32ArrayIterator:()=>$g,toInt8Array:()=>Mg,toInt8ArrayAsyncIterator:()=>Xg,toInt8ArrayIterator:()=>zg,toUint16Array:()=>Cg,toUint16ArrayAsyncIterator:()=>tw,toUint16ArrayIterator:()=>Yg,toUint32Array:()=>Lg,toUint32ArrayAsyncIterator:()=>ew,toUint32ArrayIterator:()=>Gg,toUint8Array:()=>ot,toUint8ArrayAsyncIterator:()=>xa,toUint8ArrayIterator:()=>Aa,toUint8ClampedArray:()=>Hg,toUint8ClampedArrayAsyncIterator:()=>nw,toUint8ClampedArrayIterator:()=>Jg});var kg=new TextDecoder("utf-8"),bn=i=>kg.decode(i),Eg=new TextEncoder,ei=i=>Eg.encode(i);var Og=i=>typeof i=="number",bl=i=>typeof i=="boolean",qt=i=>typeof i=="function",oe=i=>i!=null&&Object(i)===i,Me=i=>oe(i)&&qt(i.then);var Re=i=>oe(i)&&qt(i[Symbol.iterator]),je=i=>oe(i)&&qt(i[Symbol.asyncIterator]),Fs=i=>oe(i)&&oe(i.schema);var As=i=>oe(i)&&"done"in i&&"value"in i;var xs=i=>oe(i)&&qt(i.stat)&&Og(i.fd);var ks=i=>oe(i)&&vn(i.body),Es=i=>"_getDOMStream"in i&&"_getNodeStream"in i,vl=i=>oe(i)&&qt(i.abort)&&qt(i.getWriter)&&!Es(i),vn=i=>oe(i)&&qt(i.cancel)&&qt(i.getReader)&&!Es(i),gl=i=>oe(i)&&qt(i.end)&&qt(i.write)&&bl(i.writable)&&!Es(i),Os=i=>oe(i)&&qt(i.read)&&qt(i.pipe)&&bl(i.readable)&&!Es(i),wl=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 Fa=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Ug(i){let t=i[0]?[i[0]]:[],e,r,c,f;for(let _,b,g=0,T=0,D=i.length;++g<D;){if(_=t[T],b=i[g],!_||!b||_.buffer!==b.buffer||b.byteOffset<_.byteOffset){b&&(t[++T]=b);continue}if({byteOffset:e,byteLength:c}=_,{byteOffset:r,byteLength:f}=b,e+c<r||r+f<e){b&&(t[++T]=b);continue}t[T]=new Uint8Array(_.buffer,e,r-e+f)}return t}function gn(i,t,e=0,r=t.byteLength){let c=i.byteLength,f=new Uint8Array(i.buffer,i.byteOffset,c),_=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,c));return f.set(_,e),i}function me(i,t){let e=Ug(i),r=e.reduce((D,U)=>D+U.byteLength,0),c,f,_,b=0,g=-1,T=Math.min(t||Number.POSITIVE_INFINITY,r);for(let D=e.length;++g<D;){if(c=e[g],f=c.subarray(0,Math.min(c.length,T-b)),T<=b+f.length){f.length<c.length?e[g]=c.subarray(f.length):f.length===c.length&&g++,_?gn(_,f,b):_=f;break}gn(_||(_=new Uint8Array(T)),f,b),b+=f.length}return[_||new Uint8Array(0),e.slice(g),r-(_?_.byteLength:0)]}function mt(i,t){let e=As(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 Fa?new i(e):wl(e)?mt(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 Mg=i=>mt(Int8Array,i),Rg=i=>mt(Int16Array,i),dr=i=>mt(Int32Array,i),Us=i=>mt(BigInt64Array,i),ot=i=>mt(Uint8Array,i),Cg=i=>mt(Uint16Array,i),Lg=i=>mt(Uint32Array,i),Ng=i=>mt(BigUint64Array,i),Pg=i=>mt(Float32Array,i),Vg=i=>mt(Float64Array,i),Hg=i=>mt(Uint8ClampedArray,i),Ba=i=>(i.next(),i);function*ii(i,t){let e=function*(c){yield c},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Fa?e(t):Re(t)?t:e(t);return yield*ur(Ba(function*(c){let f=null;do f=c.next(yield mt(i,f));while(!f.done)}(r[Symbol.iterator]()))),new i}var zg=i=>ii(Int8Array,i),Wg=i=>ii(Int16Array,i),$g=i=>ii(Int32Array,i),Aa=i=>ii(Uint8Array,i),Yg=i=>ii(Uint16Array,i),Gg=i=>ii(Uint32Array,i),Kg=i=>ii(Float32Array,i),qg=i=>ii(Float64Array,i),Jg=i=>ii(Uint8ClampedArray,i);function Ce(i,t){return ye(this,arguments,function*(){if(Me(t))return yield pt(yield pt(yield*ur(Nr(Ue(Ce(i,yield pt(t)))))));let r=function(_){return ye(this,arguments,function*(){yield yield pt(yield pt(_))})},c=function(_){return ye(this,arguments,function*(){yield pt(yield*ur(Nr(Ue(Ba(function*(b){let g=null;do g=b.next(yield g==null?void 0:g.value);while(!g.done)}(_[Symbol.iterator]()))))))})},f=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Fa?r(t):Re(t)?c(t):je(t)?t:r(t);return yield pt(yield*ur(Nr(Ue(Ba(function(_){return ye(this,arguments,function*(){let b=null;do b=yield pt(_.next(yield yield pt(mt(i,b))));while(!b.done)})}(f[Symbol.asyncIterator]())))))),yield pt(new i)})}var Xg=i=>Ce(Int8Array,i),Zg=i=>Ce(Int16Array,i),Qg=i=>Ce(Int32Array,i),xa=i=>Ce(Uint8Array,i),tw=i=>Ce(Uint16Array,i),ew=i=>Ce(Uint32Array,i),iw=i=>Ce(Float32Array,i),rw=i=>Ce(Float64Array,i),nw=i=>Ce(Uint8ClampedArray,i);function Ms(i,t,e){if(i!==0){e=e.slice(0,t);for(let r=-1,c=e.length;++r<c;)e[r]+=i}return e.subarray(0,t)}function ka(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 ee={fromIterable(i){return Rs(sw(i))},fromAsyncIterable(i){return Rs(ow(i))},fromDOMStream(i){return Rs(aw(i))},fromNodeStream(i){return Rs(cw(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')}},Rs=i=>(i.next(),i);function*sw(i){let t,e=!1,r=[],c,f,_,b=0;function g(){return f==="peek"?me(r,_)[0]:([c,r,b]=me(r,_),c)}({cmd:f,size:_}=(yield null)||{cmd:"read",size:0});let T=Aa(i)[Symbol.iterator]();try{do if({done:t,value:c}=Number.isNaN(_-b)?T.next():T.next(_-b),!t&&c.byteLength>0&&(r.push(c),b+=c.byteLength),t||_<=b)do({cmd:f,size:_}=yield g());while(_<b);while(!t)}catch(D){(e=!0)&&typeof T.throw=="function"&&T.throw(D)}finally{e===!1&&typeof T.return=="function"&&T.return(null)}return null}function ow(i){return ye(this,arguments,function*(){let e,r=!1,c=[],f,_,b,g=0;function T(){return _==="peek"?me(c,b)[0]:([f,c,g]=me(c,b),f)}({cmd:_,size:b}=(yield yield pt(null))||{cmd:"read",size:0});let D=xa(i)[Symbol.asyncIterator]();try{do if({done:e,value:f}=Number.isNaN(b-g)?yield pt(D.next()):yield pt(D.next(b-g)),!e&&f.byteLength>0&&(c.push(f),g+=f.byteLength),e||b<=g)do({cmd:_,size:b}=yield yield pt(T()));while(b<g);while(!e)}catch(U){(r=!0)&&typeof D.throw=="function"&&(yield pt(D.throw(U)))}finally{r===!1&&typeof D.return=="function"&&(yield pt(D.return(new Uint8Array(0))))}return yield pt(null)})}function aw(i){return ye(this,arguments,function*(){let e=!1,r=!1,c=[],f,_,b,g=0;function T(){return _==="peek"?me(c,b)[0]:([f,c,g]=me(c,b),f)}({cmd:_,size:b}=(yield yield pt(null))||{cmd:"read",size:0});let D=new Ua(i);try{do if({done:e,value:f}=Number.isNaN(b-g)?yield pt(D.read()):yield pt(D.read(b-g)),!e&&f.byteLength>0&&(c.push(ot(f)),g+=f.byteLength),e||b<=g)do({cmd:_,size:b}=yield yield pt(T()));while(b<g);while(!e)}catch(U){(r=!0)&&(yield pt(D.cancel(U)))}finally{r===!1?yield pt(D.cancel()):i.locked&&D.releaseLock()}return yield pt(null)})}var Ua=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 V(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 V(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=ot(e)),e})}},Oa=(i,t)=>{let e=c=>r([t,c]),r;return[t,e,new Promise(c=>(r=c)&&i.once(t,e))]};function cw(i){return ye(this,arguments,function*(){let e=[],r="error",c=!1,f=null,_,b,g=0,T=[],D;function U(){return _==="peek"?me(T,b)[0]:([D,T,g]=me(T,b),D)}if({cmd:_,size:b}=(yield yield pt(null))||{cmd:"read",size:0},i.isTTY)return yield yield pt(new Uint8Array(0)),yield pt(null);try{e[0]=Oa(i,"end"),e[1]=Oa(i,"error");do{if(e[2]=Oa(i,"readable"),[r,f]=yield pt(Promise.race(e.map(N=>N[2]))),r==="error")break;if((c=r==="end")||(Number.isFinite(b-g)?(D=ot(i.read(b-g)),D.byteLength<b-g&&(D=ot(i.read()))):D=ot(i.read()),D.byteLength>0&&(T.push(D),g+=D.byteLength)),c||b<=g)do({cmd:_,size:b}=yield yield pt(U()));while(b<g)}while(!c)}finally{yield pt(M(e,r==="error"?f:null))}return yield pt(null);function M(N,nt){return D=T=null,new Promise((Et,Wt)=>{for(let[Vt,kt]of N)i.off(Vt,kt);try{let Vt=i.destroy;Vt&&Vt.call(i,nt),nt=void 0}catch(Vt){nt=Vt||nt}finally{nt!=null?Wt(nt):Et()}})}})}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 Ut;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Ut||(Ut={}));var Ot;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(Ot||(Ot={}));var $t;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})($t||($t={}));var Y;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(Y||(Y={}));var Jt;(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"})(Jt||(Jt={}));var ri=new Int32Array(2),Cs=new Float32Array(ri.buffer),Ls=new Float64Array(ri.buffer),Pr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var wn;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(wn||(wn={}));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),Cs[0]}readFloat64(t){return ri[Pr?0:1]=this.readInt32(t),ri[Pr?1:0]=this.readInt32(t+4),Ls[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){Cs[0]=e,this.writeInt32(t,ri[0])}writeFloat64(t,e){Ls[0]=e,this.writeInt32(t,ri[Pr?0:1]),this.writeInt32(t+4,ri[Pr?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 c=this.bytes_.subarray(t,t+r);return e===wn.UTF8_BYTES?c:this.text_decoder_.decode(c)}__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 c=0;c<e;++c){let f=t(c);f!==null&&r.push(f)}return r}createObjList(t,e){let r=[];for(let c=0;c<e;++c){let f=t(c);f!==null&&r.push(f.unpack())}return r}};var fr=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 c=this.bb.capacity();this.bb=i.growByteBuffer(this.bb),this.space+=this.bb.capacity()-c}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,c=be.allocate(r);return c.setPosition(r-e),c.bytes().set(t.bytes(),r-e),c}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 c=2;this.addInt16(t-this.object_start);let f=(r+c)*2;this.addInt16(f);let _=0,b=this.space;t:for(e=0;e<this.vtables.length;e++){let g=this.bb.capacity()-this.vtables[e];if(f==this.bb.readInt16(g)){for(let T=2;T<f;T+=2)if(this.bb.readInt16(b+T)!=this.bb.readInt16(g+T))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 c=r?4:0;if(e){let f=e;if(this.prep(this.minalign,8+c),f.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let _=3;_>=0;_--)this.writeInt8(f.charCodeAt(_))}this.prep(this.minalign,4+c),this.addOffset(t),c&&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,c=r-this.bb.readInt32(r);if(!(e<this.bb.readInt16(c)&&this.bb.readInt16(c+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 c=t[r];if(c!==null)e.push(this.createObjectOffset(c));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 Sn;(function(i){i[i.BUFFER=0]="BUFFER"})(Sn||(Sn={}));var In;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(In||(In={}));var Ps=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):In.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Sn.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,In.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Sn.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 Vr=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 Hr=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 Hr).__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 Vr).__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 Ps).__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 _i=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 Yi;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(Yi||(Yi={}));var Tn;(function(i){i[i.DenseArray=0]="DenseArray"})(Tn||(Tn={}));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 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 Ne).__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):Tn.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,Tn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var Xt=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 jn=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 Dn=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 Gi=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):$t.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,$t.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,c){return i.startDecimal(t),i.addPrecision(t,e),i.addScale(t,r),i.addBitWidth(t,c),i.endDecimal(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 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):Y.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Y.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return i.startDuration(t),i.addUnit(t,e),i.endDuration(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 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):Ot.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Ot.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):Jt.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Jt.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return i.startInterval(t),i.addUnit(t,e),i.endInterval(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 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 Fn=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 An=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 xn=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 kn=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 yi=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):Y.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,Y.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 mi=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):Y.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,Y.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 Pe=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):Ut.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,Ut.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 En=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 Mt;(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"})(Mt||(Mt={}));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 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):Mt.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 Xt).__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,Mt.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):Yi.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new se).__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 Xt).__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,Yi.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,c,f){return i.startSchema(t),i.addEndianness(t,e),i.addFields(t,r),i.addCustomMetadata(t,c),i.addFeatures(t,f),i.endSchema(t)}};var vt;(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"})(vt||(vt={}));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 Be;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Be||(Be={}));var tc={};$i(tc,{clampRange:()=>Rn,createElementComparator:()=>rr,wrapIndex:()=>hr});var Ma={};$i(Ma,{valueToString:()=>Ve});function Ve(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=>Ve(t)),"]"):"[".concat(i,"]"):ArrayBuffer.isView(i)?"[".concat(i,"]"):JSON.stringify(i,(t,e)=>typeof e=="bigint"?"".concat(e):e)}var Na={};$i(Na,{BN:()=>Un,bigNumToBigInt:()=>Il,bigNumToNumber:()=>La,bigNumToString:()=>$r,isArrowBigNumSymbol:()=>Sl});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 Ra(i,t){return wt(i/t)+wt(i%t)/wt(t)}var Sl=Symbol.for("isArrowBigNum");function He(i,...t){return t.length===0?Object.setPrototypeOf(mt(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}He.prototype[Sl]=!0;He.prototype.toJSON=function(){return'"'.concat($r(this),'"')};He.prototype.valueOf=function(i){return La(this,i)};He.prototype.toString=function(){return $r(this)};He.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return La(this);case"string":return $r(this);case"default":return Il(this)}return $r(this)};function zr(...i){return He.apply(this,i)}function Wr(...i){return He.apply(this,i)}function On(...i){return He.apply(this,i)}Object.setPrototypeOf(zr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Wr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(On.prototype,Object.create(Uint32Array.prototype));Object.assign(zr.prototype,He.prototype,{constructor:zr,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Wr.prototype,He.prototype,{constructor:Wr,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(On.prototype,He.prototype,{constructor:On,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var lw=BigInt(4294967296)*BigInt(4294967296),uw=lw-BigInt(1);function La(i,t){let{buffer:e,byteOffset:r,byteLength:c,signed:f}=i,_=new BigUint64Array(e,r,c/8),b=f&&_.at(-1)&BigInt(1)<<BigInt(63),g=BigInt(0),T=0;if(b){for(let D of _)g|=(D^uw)*(BigInt(1)<<BigInt(64*T++));g*=BigInt(-1),g-=BigInt(1)}else for(let D of _)g|=D*(BigInt(1)<<BigInt(64*T++));if(typeof t=="number"){let D=BigInt(Math.pow(10,t)),U=g/D,M=g%D;return wt(U)+wt(M)/wt(D)}return wt(g)}function $r(i){if(i.byteLength===8){let f=new i.BigIntArray(i.buffer,i.byteOffset,1);return"".concat(f[0])}if(!i.signed)return Ca(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Ca(i);t=t.slice();let r=1;for(let f=0;f<t.length;f++){let _=t[f],b=~_+r;t[f]=b,r&=_===0?1:0}let c=Ca(t);return"-".concat(c)}function Il(i){return i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:$r(i)}function Ca(i){let t="",e=new Uint32Array(2),r=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),c=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),f=-1,_=r.length-1;do{for(e[0]=r[f=0];f<_;)r[f++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[f];r[f]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t="".concat(e[0]).concat(t)}while(c[0]||c[1]||c[2]||c[3]);return t!=null?t:"0"}var Un=class i{static new(t,e){switch(e){case!0:return new zr(t);case!1:return new Wr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new zr(t)}return t.byteLength===16?new On(t):new Wr(t)}static signed(t){return new zr(t)}static unsigned(t){return new Wr(t)}static decimal(t){return new On(t)}constructor(t,e){return i.new(t,e)}};var Tl,jl,Dl,Bl,Fl,Al,xl,kl,El,Ol,Ul,Ml,Rl,Cl,Ll,Nl,Pl,Vl,Hl,zl,Wl,$l,z=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===Ut.Dense}static isSparseUnion(t){return i.isUnion(t)&&t.mode===Ut.Sparse}constructor(t){this.typeId=t}};Tl=Symbol.toStringTag;z[Tl]=(i=>(i.children=null,i.ArrayType=Array,i.OffsetArrayType=Int32Array,i[Symbol.toStringTag]="DataType"))(z.prototype);var ae=class extends z{constructor(){super(j.Null)}toString(){return"Null"}};jl=Symbol.toStringTag;ae[jl]=(i=>i[Symbol.toStringTag]="Null")(ae.prototype);var Zt=class extends z{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;Zt[Dl]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Zt.prototype);var Vs=class extends Zt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Hs=class extends Zt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},oi=class extends Zt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},zs=class extends Zt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Ws=class extends Zt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},$s=class extends Zt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Ys=class extends Zt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Gs=class extends Zt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Vs.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Hs.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(oi.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(zs.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ws.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty($s.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ys.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Gs.prototype,"ArrayType",{value:BigUint64Array});var Fe=class extends z{constructor(t){super(j.Float),this.precision=t}get ArrayType(){switch(this.precision){case Ot.HALF:return Uint16Array;case Ot.SINGLE:return Float32Array;case Ot.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};Bl=Symbol.toStringTag;Fe[Bl]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(Fe.prototype);var Ks=class extends Fe{constructor(){super(Ot.HALF)}},qs=class extends Fe{constructor(){super(Ot.SINGLE)}},Js=class extends Fe{constructor(){super(Ot.DOUBLE)}};Object.defineProperty(Ks.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(qs.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Js.prototype,"ArrayType",{value:Float64Array});var bi=class extends z{constructor(){super(j.Binary)}toString(){return"Binary"}};Fl=Symbol.toStringTag;bi[Fl]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(bi.prototype);var vi=class extends z{constructor(){super(j.LargeBinary)}toString(){return"LargeBinary"}};Al=Symbol.toStringTag;vi[Al]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeBinary"))(vi.prototype);var gi=class extends z{constructor(){super(j.Utf8)}toString(){return"Utf8"}};xl=Symbol.toStringTag;gi[xl]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(gi.prototype);var wi=class extends z{constructor(){super(j.LargeUtf8)}toString(){return"LargeUtf8"}};kl=Symbol.toStringTag;wi[kl]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeUtf8"))(wi.prototype);var Si=class extends z{constructor(){super(j.Bool)}toString(){return"Bool"}};El=Symbol.toStringTag;Si[El]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(Si.prototype);var Ii=class extends z{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,"]")}};Ol=Symbol.toStringTag;Ii[Ol]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Ii.prototype);var Ti=class extends z{constructor(t){super(j.Date),this.unit=t}toString(){return"Date".concat((this.unit+1)*32,"<").concat($t[this.unit],">")}get ArrayType(){return this.unit===$t.DAY?Int32Array:BigInt64Array}};Ul=Symbol.toStringTag;Ti[Ul]=(i=>(i.unit=null,i[Symbol.toStringTag]="Date"))(Ti.prototype);var ji=class extends z{constructor(t,e){super(j.Time),this.unit=t,this.bitWidth=e}toString(){return"Time".concat(this.bitWidth,"<").concat(Y[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};Ml=Symbol.toStringTag;ji[Ml]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(ji.prototype);var Di=class extends z{constructor(t,e){super(j.Timestamp),this.unit=t,this.timezone=e}toString(){return"Timestamp<".concat(Y[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};Rl=Symbol.toStringTag;Di[Rl]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Timestamp"))(Di.prototype);var Bi=class extends z{constructor(t){super(j.Interval),this.unit=t}toString(){return"Interval<".concat(Jt[this.unit],">")}};Cl=Symbol.toStringTag;Bi[Cl]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(Bi.prototype);var Fi=class extends z{constructor(t){super(j.Duration),this.unit=t}toString(){return"Duration<".concat(Y[this.unit],">")}};Ll=Symbol.toStringTag;Fi[Ll]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(Fi.prototype);var ze=class extends z{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}};Nl=Symbol.toStringTag;ze[Nl]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(ze.prototype);var Ct=class extends z{constructor(t){super(j.Struct),this.children=t}toString(){return"Struct<{".concat(this.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}};Pl=Symbol.toStringTag;Ct[Pl]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(Ct.prototype);var We=class extends z{constructor(t,e,r){super(j.Union),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((c,f,_)=>(c[f]=_)&&c||c,Object.create(null))}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(t=>"".concat(t.type)).join(" | "),">")}};Vl=Symbol.toStringTag;We[Vl]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(We.prototype);var Ai=class extends z{constructor(t){super(j.FixedSizeBinary),this.byteWidth=t}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};Hl=Symbol.toStringTag;Ai[Hl]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Ai.prototype);var $e=class extends z{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,">")}};zl=Symbol.toStringTag;$e[zl]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))($e.prototype);var Ye=class extends z{constructor(t,e=!1){var r,c,f;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 _=(c=t==null?void 0:t.type)===null||c===void 0?void 0:c.children[0];_&&(_.name="key");let b=(f=t==null?void 0:t.type)===null||f===void 0?void 0:f.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(", "),"}>")}};Wl=Symbol.toStringTag;Ye[Wl]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(Ye.prototype);var dw=(i=>()=>++i)(-1),ge=class extends z{constructor(t,e,r,c){super(j.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=c||!1,this.id=r==null?dw():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,">")}};$l=Symbol.toStringTag;ge[$l]=(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 Z=class{visitMany(t,...e){return t.map((r,c)=>this.visit(r,...e.map(f=>f[c])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return fw(this,t,e)}getVisitFnByTypeId(t,e=!0){return Yr(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 fw(i,t,e=!0){return typeof t=="number"?Yr(i,t,e):typeof t=="string"&&t in j?Yr(i,j[t],e):t&&t instanceof z?Yr(i,Yl(t),e):t!=null&&t.type&&t.type instanceof z?Yr(i,Yl(t.type),e):Yr(i,j.NONE,e)}function Yr(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 Yl(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 Ot.HALF:return j.Float16;case Ot.SINGLE:return j.Float32;case Ot.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 Y.SECOND:return j.TimeSecond;case Y.MILLISECOND:return j.TimeMillisecond;case Y.MICROSECOND:return j.TimeMicrosecond;case Y.NANOSECOND:return j.TimeNanosecond}return j.Time;case j.Timestamp:switch(i.unit){case Y.SECOND:return j.TimestampSecond;case Y.MILLISECOND:return j.TimestampMillisecond;case Y.MICROSECOND:return j.TimestampMicrosecond;case Y.NANOSECOND:return j.TimestampNanosecond}return j.Timestamp;case j.Date:switch(i.unit){case $t.DAY:return j.DateDay;case $t.MILLISECOND:return j.DateMillisecond}return j.Date;case j.Interval:switch(i.unit){case Jt.DAY_TIME:return j.IntervalDayTime;case Jt.YEAR_MONTH:return j.IntervalYearMonth}return j.Interval;case j.Duration:switch(i.unit){case Y.SECOND:return j.DurationSecond;case Y.MILLISECOND:return j.DurationMillisecond;case Y.MICROSECOND:return j.DurationMicrosecond;case Y.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 Ut.Dense:return j.DenseUnion;case Ut.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],"'"))}Z.prototype.visitInt8=null;Z.prototype.visitInt16=null;Z.prototype.visitInt32=null;Z.prototype.visitInt64=null;Z.prototype.visitUint8=null;Z.prototype.visitUint16=null;Z.prototype.visitUint32=null;Z.prototype.visitUint64=null;Z.prototype.visitFloat16=null;Z.prototype.visitFloat32=null;Z.prototype.visitFloat64=null;Z.prototype.visitDateDay=null;Z.prototype.visitDateMillisecond=null;Z.prototype.visitTimestampSecond=null;Z.prototype.visitTimestampMillisecond=null;Z.prototype.visitTimestampMicrosecond=null;Z.prototype.visitTimestampNanosecond=null;Z.prototype.visitTimeSecond=null;Z.prototype.visitTimeMillisecond=null;Z.prototype.visitTimeMicrosecond=null;Z.prototype.visitTimeNanosecond=null;Z.prototype.visitDenseUnion=null;Z.prototype.visitSparseUnion=null;Z.prototype.visitIntervalDayTime=null;Z.prototype.visitIntervalYearMonth=null;Z.prototype.visitDuration=null;Z.prototype.visitDurationSecond=null;Z.prototype.visitDurationMillisecond=null;Z.prototype.visitDurationMicrosecond=null;Z.prototype.visitDurationNanosecond=null;var Pa={};$i(Pa,{float64ToUint16:()=>Mn,uint16ToFloat64:()=>Xs});var Gl=new Float64Array(1),Gr=new Uint32Array(Gl.buffer);function Xs(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 Mn(i){if(i!==i)return 32256;Gl[0]=i;let t=(Gr[1]&2147483648)>>16&65535,e=Gr[1]&2146435072,r=0;return e>=1089470464?Gr[0]>0?e=31744:(e=(e&2080374784)>>16,r=(Gr[1]&1048575)>>10):e<=1056964608?(r=1048576+(Gr[1]&1048575),r=1048576+(r<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,r=(Gr[1]&1048575)+512>>10),t|e|r&65535}var rt=class extends Z{};function ut(i){return(t,e,r)=>{if(t.setValid(e,r!=null))return i(t,e,r)}}var hw=(i,t,e)=>{i[t]=Math.floor(e/864e5)},Kl=(i,t,e,r)=>{if(e+1<t.length){let c=wt(t[e]),f=wt(t[e+1]);i.set(r.subarray(0,f-c),c)}},pw=({offset:i,values:t},e,r)=>{let c=i+e;r?t[c>>3]|=1<<c%8:t[c>>3]&=~(1<<c%8)},xi=({values:i},t,e)=>{i[t]=e},Va=({values:i},t,e)=>{i[t]=e},ql=({values:i},t,e)=>{i[t]=Mn(e)},_w=(i,t,e)=>{switch(i.type.precision){case Ot.HALF:return ql(i,t,e);case Ot.SINGLE:case Ot.DOUBLE:return Va(i,t,e)}},Zs=({values:i},t,e)=>{hw(i,t,e.valueOf())},Qs=({values:i},t,e)=>{i[t]=BigInt(e)},Ha=({stride:i,values:t},e,r)=>{t.set(r.subarray(0,i),i*e)},Jl=({values:i,valueOffsets:t},e,r)=>Kl(i,t,e,r),Xl=({values:i,valueOffsets:t},e,r)=>Kl(i,t,e,ei(r)),za=(i,t,e)=>{i.type.unit===$t.DAY?Zs(i,t,e):Qs(i,t,e)},to=({values:i},t,e)=>{i[t]=BigInt(e/1e3)},eo=({values:i},t,e)=>{i[t]=BigInt(e)},io=({values:i},t,e)=>{i[t]=BigInt(e*1e3)},ro=({values:i},t,e)=>{i[t]=BigInt(e*1e6)},Wa=(i,t,e)=>{switch(i.type.unit){case Y.SECOND:return to(i,t,e);case Y.MILLISECOND:return eo(i,t,e);case Y.MICROSECOND:return io(i,t,e);case Y.NANOSECOND:return ro(i,t,e)}},no=({values:i},t,e)=>{i[t]=e},so=({values:i},t,e)=>{i[t]=e},oo=({values:i},t,e)=>{i[t]=e},ao=({values:i},t,e)=>{i[t]=e},$a=(i,t,e)=>{switch(i.type.unit){case Y.SECOND:return no(i,t,e);case Y.MILLISECOND:return so(i,t,e);case Y.MICROSECOND:return oo(i,t,e);case Y.NANOSECOND:return ao(i,t,e)}},Ya=({values:i,stride:t},e,r)=>{i.set(r.subarray(0,t),t*e)},yw=(i,t,e)=>{let r=i.children[0],c=i.valueOffsets,f=ie.getVisitFn(r);if(Array.isArray(e))for(let _=-1,b=c[t],g=c[t+1];b<g;)f(r,b++,e[++_]);else for(let _=-1,b=c[t],g=c[t+1];b<g;)f(r,b++,e.get(++_))},mw=(i,t,e)=>{let r=i.children[0],{valueOffsets:c}=i,f=ie.getVisitFn(r),{[t]:_,[t+1]:b}=c,g=e instanceof Map?e.entries():Object.entries(e);for(let T of g)if(f(r,_,T),++_>=b)break},bw=(i,t)=>(e,r,c,f)=>r&&e(r,i,t[f]),vw=(i,t)=>(e,r,c,f)=>r&&e(r,i,t.get(f)),gw=(i,t)=>(e,r,c,f)=>r&&e(r,i,t.get(c.name)),ww=(i,t)=>(e,r,c,f)=>r&&e(r,i,t[c.name]),Sw=(i,t,e)=>{let r=i.type.children.map(f=>ie.getVisitFn(f.type)),c=e instanceof Map?gw(t,e):e instanceof gt?vw(t,e):Array.isArray(e)?bw(t,e):ww(t,e);i.type.children.forEach((f,_)=>c(r[_],i.children[_],f,_))},Iw=(i,t,e)=>{i.type.mode===Ut.Dense?Zl(i,t,e):Ql(i,t,e)},Zl=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],c=i.children[r];ie.visit(c,i.valueOffsets[t],e)},Ql=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],c=i.children[r];ie.visit(c,t,e)},Tw=(i,t,e)=>{var r;(r=i.dictionary)===null||r===void 0||r.set(i.values[t],e)},Ga=(i,t,e)=>{i.type.unit===Jt.DAY_TIME?co(i,t,e):lo(i,t,e)},co=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},lo=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},uo=({values:i},t,e)=>{i[t]=e},fo=({values:i},t,e)=>{i[t]=e},ho=({values:i},t,e)=>{i[t]=e},po=({values:i},t,e)=>{i[t]=e},Ka=(i,t,e)=>{switch(i.type.unit){case Y.SECOND:return uo(i,t,e);case Y.MILLISECOND:return fo(i,t,e);case Y.MICROSECOND:return ho(i,t,e);case Y.NANOSECOND:return po(i,t,e)}},jw=(i,t,e)=>{let{stride:r}=i,c=i.children[0],f=ie.getVisitFn(c);if(Array.isArray(e))for(let _=-1,b=t*r;++_<r;)f(c,b+_,e[_]);else for(let _=-1,b=t*r;++_<r;)f(c,b+_,e.get(_))};rt.prototype.visitBool=ut(pw);rt.prototype.visitInt=ut(xi);rt.prototype.visitInt8=ut(xi);rt.prototype.visitInt16=ut(xi);rt.prototype.visitInt32=ut(xi);rt.prototype.visitInt64=ut(xi);rt.prototype.visitUint8=ut(xi);rt.prototype.visitUint16=ut(xi);rt.prototype.visitUint32=ut(xi);rt.prototype.visitUint64=ut(xi);rt.prototype.visitFloat=ut(_w);rt.prototype.visitFloat16=ut(ql);rt.prototype.visitFloat32=ut(Va);rt.prototype.visitFloat64=ut(Va);rt.prototype.visitUtf8=ut(Xl);rt.prototype.visitLargeUtf8=ut(Xl);rt.prototype.visitBinary=ut(Jl);rt.prototype.visitLargeBinary=ut(Jl);rt.prototype.visitFixedSizeBinary=ut(Ha);rt.prototype.visitDate=ut(za);rt.prototype.visitDateDay=ut(Zs);rt.prototype.visitDateMillisecond=ut(Qs);rt.prototype.visitTimestamp=ut(Wa);rt.prototype.visitTimestampSecond=ut(to);rt.prototype.visitTimestampMillisecond=ut(eo);rt.prototype.visitTimestampMicrosecond=ut(io);rt.prototype.visitTimestampNanosecond=ut(ro);rt.prototype.visitTime=ut($a);rt.prototype.visitTimeSecond=ut(no);rt.prototype.visitTimeMillisecond=ut(so);rt.prototype.visitTimeMicrosecond=ut(oo);rt.prototype.visitTimeNanosecond=ut(ao);rt.prototype.visitDecimal=ut(Ya);rt.prototype.visitList=ut(yw);rt.prototype.visitStruct=ut(Sw);rt.prototype.visitUnion=ut(Iw);rt.prototype.visitDenseUnion=ut(Zl);rt.prototype.visitSparseUnion=ut(Ql);rt.prototype.visitDictionary=ut(Tw);rt.prototype.visitInterval=ut(Ga);rt.prototype.visitIntervalDayTime=ut(co);rt.prototype.visitIntervalYearMonth=ut(lo);rt.prototype.visitDuration=ut(Ka);rt.prototype.visitDurationSecond=ut(uo);rt.prototype.visitDurationMillisecond=ut(fo);rt.prototype.visitDurationMicrosecond=ut(ho);rt.prototype.visitDurationNanosecond=ut(po);rt.prototype.visitFixedSizeList=ut(jw);rt.prototype.visitMap=ut(mw);var ie=new rt;var Ge=Symbol.for("parent"),Kr=Symbol.for("rowIndex"),tr=class{constructor(t,e){return this[Ge]=t,this[Kr]=e,new Proxy(this,new Ja)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Kr],e=this[Ge],r=e.type.children,c={};for(let f=-1,_=r.length;++f<_;)c[r[f].name]=Gt.visit(e.children[f],t);return c}toString(){return"{".concat([...this].map(([t,e])=>"".concat(Ve(t),": ").concat(Ve(e))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new qa(this[Ge],this[Kr])}},qa=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"},[Ge]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Kr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Ja=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ge].type.children.map(e=>e.name)}has(t,e){return t[Ge].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Ge].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[Ge].type.children.findIndex(c=>c.name===e);if(r!==-1){let c=Gt.visit(t[Ge].children[r],t[Kr]);return Reflect.set(t,e,c),c}}set(t,e,r){let c=t[Ge].type.children.findIndex(f=>f.name===e);return c!==-1?(ie.visit(t[Ge].children[c],t[Kr],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}};var Q=class extends Z{};function at(i){return(t,e)=>t.getValid(e)?i(t,e):null}var Dw=(i,t)=>864e5*i[t],Bw=(i,t)=>null,tu=(i,t,e)=>{if(e+1>=t.length)return null;let r=wt(t[e]),c=wt(t[e+1]);return i.subarray(r,c)},Fw=({offset:i,values:t},e)=>{let r=i+e;return(t[r>>3]&1<<r%8)!==0},eu=({values:i},t)=>Dw(i,t),iu=({values:i},t)=>wt(i[t]),er=({stride:i,values:t},e)=>t[i*e],Aw=({stride:i,values:t},e)=>Xs(t[i*e]),ru=({values:i},t)=>i[t],xw=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),nu=({values:i,valueOffsets:t},e)=>tu(i,t,e),su=({values:i,valueOffsets:t},e)=>{let r=tu(i,t,e);return r!==null?bn(r):null},kw=({values:i},t)=>i[t],Ew=({type:i,values:t},e)=>i.precision!==Ot.HALF?t[e]:Xs(t[e]),Ow=(i,t)=>i.type.unit===$t.DAY?eu(i,t):iu(i,t),ou=({values:i},t)=>1e3*wt(i[t]),au=({values:i},t)=>wt(i[t]),cu=({values:i},t)=>Ra(i[t],BigInt(1e3)),lu=({values:i},t)=>Ra(i[t],BigInt(1e6)),Uw=(i,t)=>{switch(i.type.unit){case Y.SECOND:return ou(i,t);case Y.MILLISECOND:return au(i,t);case Y.MICROSECOND:return cu(i,t);case Y.NANOSECOND:return lu(i,t)}},uu=({values:i},t)=>i[t],du=({values:i},t)=>i[t],fu=({values:i},t)=>i[t],hu=({values:i},t)=>i[t],Mw=(i,t)=>{switch(i.type.unit){case Y.SECOND:return uu(i,t);case Y.MILLISECOND:return du(i,t);case Y.MICROSECOND:return fu(i,t);case Y.NANOSECOND:return hu(i,t)}},Rw=({values:i,stride:t},e)=>Un.decimal(i.subarray(t*e,t*(e+1))),Cw=(i,t)=>{let{valueOffsets:e,stride:r,children:c}=i,{[t*r]:f,[t*r+1]:_}=e,g=c[0].slice(f,_-f);return new gt([g])},Lw=(i,t)=>{let{valueOffsets:e,children:r}=i,{[t]:c,[t+1]:f}=e,_=r[0];return new ai(_.slice(c,f-c))},Nw=(i,t)=>new tr(i,t),Pw=(i,t)=>i.type.mode===Ut.Dense?pu(i,t):_u(i,t),pu=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Gt.visit(r,i.valueOffsets[t])},_u=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Gt.visit(r,t)},Vw=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Hw=(i,t)=>i.type.unit===Jt.DAY_TIME?yu(i,t):mu(i,t),yu=({values:i},t)=>i.subarray(2*t,2*(t+1)),mu=({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},bu=({values:i},t)=>i[t],vu=({values:i},t)=>i[t],gu=({values:i},t)=>i[t],wu=({values:i},t)=>i[t],zw=(i,t)=>{switch(i.type.unit){case Y.SECOND:return bu(i,t);case Y.MILLISECOND:return vu(i,t);case Y.MICROSECOND:return gu(i,t);case Y.NANOSECOND:return wu(i,t)}},Ww=(i,t)=>{let{stride:e,children:r}=i,f=r[0].slice(t*e,e);return new gt([f])};Q.prototype.visitNull=at(Bw);Q.prototype.visitBool=at(Fw);Q.prototype.visitInt=at(kw);Q.prototype.visitInt8=at(er);Q.prototype.visitInt16=at(er);Q.prototype.visitInt32=at(er);Q.prototype.visitInt64=at(ru);Q.prototype.visitUint8=at(er);Q.prototype.visitUint16=at(er);Q.prototype.visitUint32=at(er);Q.prototype.visitUint64=at(ru);Q.prototype.visitFloat=at(Ew);Q.prototype.visitFloat16=at(Aw);Q.prototype.visitFloat32=at(er);Q.prototype.visitFloat64=at(er);Q.prototype.visitUtf8=at(su);Q.prototype.visitLargeUtf8=at(su);Q.prototype.visitBinary=at(nu);Q.prototype.visitLargeBinary=at(nu);Q.prototype.visitFixedSizeBinary=at(xw);Q.prototype.visitDate=at(Ow);Q.prototype.visitDateDay=at(eu);Q.prototype.visitDateMillisecond=at(iu);Q.prototype.visitTimestamp=at(Uw);Q.prototype.visitTimestampSecond=at(ou);Q.prototype.visitTimestampMillisecond=at(au);Q.prototype.visitTimestampMicrosecond=at(cu);Q.prototype.visitTimestampNanosecond=at(lu);Q.prototype.visitTime=at(Mw);Q.prototype.visitTimeSecond=at(uu);Q.prototype.visitTimeMillisecond=at(du);Q.prototype.visitTimeMicrosecond=at(fu);Q.prototype.visitTimeNanosecond=at(hu);Q.prototype.visitDecimal=at(Rw);Q.prototype.visitList=at(Cw);Q.prototype.visitStruct=at(Nw);Q.prototype.visitUnion=at(Pw);Q.prototype.visitDenseUnion=at(pu);Q.prototype.visitSparseUnion=at(_u);Q.prototype.visitDictionary=at(Vw);Q.prototype.visitInterval=at(Hw);Q.prototype.visitIntervalDayTime=at(yu);Q.prototype.visitIntervalYearMonth=at(mu);Q.prototype.visitDuration=at(zw);Q.prototype.visitDurationSecond=at(bu);Q.prototype.visitDurationMillisecond=at(vu);Q.prototype.visitDurationMicrosecond=at(gu);Q.prototype.visitDurationNanosecond=at(wu);Q.prototype.visitFixedSizeList=at(Ww);Q.prototype.visitMap=at(Lw);var Gt=new Q;var ir=Symbol.for("keys"),Jr=Symbol.for("vals"),qr=Symbol.for("kKeysAsStrings"),Xa=Symbol.for("_kKeysAsStrings"),ai=class{constructor(t){return this[ir]=new gt([t.children[0]]).memoize(),this[Jr]=t.children[1],new Proxy(this,new Qa)}get[qr](){return this[Xa]||(this[Xa]=Array.from(this[ir].toArray(),String))}[Symbol.iterator](){return new Za(this[ir],this[Jr])}get size(){return this[ir].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ir],e=this[Jr],r={};for(let c=-1,f=t.length;++c<f;)r[t.get(c)]=Gt.visit(e,c);return r}toString(){return"{".concat([...this].map(([t,e])=>"".concat(Ve(t),": ").concat(Ve(e))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Za=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)]})}},Qa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[qr]}has(t,e){return t[qr].includes(e)}getOwnPropertyDescriptor(t,e){if(t[qr].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[qr].indexOf(e);if(r!==-1){let c=Gt.visit(Reflect.get(t,Jr),r);return Reflect.set(t,e,c),c}}set(t,e,r){let c=t[qr].indexOf(e);return c!==-1?(ie.visit(Reflect.get(t,Jr),c,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},[Jr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xa]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Su;function Rn(i,t,e,r){let{length:c=0}=i,f=typeof t!="number"?0:t,_=typeof e!="number"?c:e;return f<0&&(f=(f%c+c)%c),_<0&&(_=(_%c+c)%c),_<f&&(Su=f,f=_,_=Su),_>c&&(_=c),r?r(i,f,_):[f,_]}var hr=(i,t)=>i<0?t+i:i,Iu=i=>i!==i;function rr(i){if(typeof i!=="object"||i===null)return Iu(i)?Iu: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?ka(i,e):!1:i instanceof Map?Yw(i):Array.isArray(i)?$w(i):i instanceof gt?Gw(i):Kw(i,!0)}function $w(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=rr(i[e]);return _o(t)}function Yw(i){let t=-1,e=[];for(let r of i.values())e[++t]=rr(r);return _o(e)}function Gw(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=rr(i.get(e));return _o(t)}function Kw(i,t=!1){let e=Object.keys(i);if(!t&&e.length===0)return()=>!1;let r=[];for(let c=-1,f=e.length;++c<f;)r[c]=rr(i[e[c]]);return _o(r,e)}function _o(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return qw(i,e);case Map:return Tu(i,e,e.keys());case ai:case tr:case Object:case void 0:return Tu(i,e,t||Object.keys(e))}return e instanceof gt?Jw(i,e):!1}}function qw(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 Jw(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 Tu(i,t,e){let r=e[Symbol.iterator](),c=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),f=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),_=0,b=i.length,g=f.next(),T=r.next(),D=c.next();for(;_<b&&!T.done&&!D.done&&!g.done&&!(T.value!==D.value||!i[_](g.value));++_,T=r.next(),D=c.next(),g=f.next());return _===b&&T.done&&D.done&&g.done?!0:(r.return&&r.return(),c.return&&c.return(),f.return&&f.return(),!1)}var ec={};$i(ec,{BitIterator:()=>pr,getBit:()=>ju,getBool:()=>mo,packBools:()=>yr,popcnt_array:()=>Du,popcnt_bit_range:()=>Cn,popcnt_uint32:()=>yo,setBool:()=>Xw,truncateBitmap:()=>_r});function mo(i,t,e,r){return(e&1<<r)!==0}function ju(i,t,e,r){return(e&1<<r)>>r}function Xw(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 c=new Uint8Array(r);return c.set(i%8===0?e.subarray(i>>3):yr(new pr(e,i,t,null,mo)).subarray(0,r)),c}return e}function yr(i){let t=[],e=0,r=0,c=0;for(let _ of i)_&&(c|=1<<r),++r===8&&(t[e++]=c,c=r=0);(e===0||r>0)&&(t[e++]=c);let f=new Uint8Array(t.length+7&-8);return f.set(t),f}var pr=class{constructor(t,e,r,c,f){this.bytes=t,this.length=r,this.context=c,this.get=f,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 f=0;for(let _ of new pr(i,t,e-t,i,ju))f+=_;return f}let r=e>>3<<3,c=t+(t%8===0?0:8-t%8);return Cn(i,t,c)+Cn(i,r,e)+Du(i,c>>3,r-c>>3)}function Du(i,t,e){let r=0,c=Math.trunc(t),f=new DataView(i.buffer,i.byteOffset,i.byteLength),_=e===void 0?i.byteLength:c+e;for(;_-c>=4;)r+=yo(f.getUint32(c)),c+=4;for(;_-c>=2;)r+=yo(f.getUint16(c)),c+=2;for(;_-c>=1;)r+=yo(f.getUint8(c)),c+=1;return r}function yo(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 Zw=-1,jt=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 z.isSparseUnion(t)?this.children.some(e=>e.nullable):z.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:c,typeIds:f}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),c&&(t+=c.byteLength),f&&(t+=f.byteLength),this.children.reduce((_,b)=>_+b.byteLength,t)}get nullCount(){if(z.isUnion(this.type))return this.children.reduce((r,c)=>r+c.nullCount,0);let t=this._nullCount,e;return t<=Zw&&(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,c,f,_=[],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(c||0,-1));let g;f instanceof i?(this.stride=f.stride,this.values=f.values,this.typeIds=f.typeIds,this.nullBitmap=f.nullBitmap,this.valueOffsets=f.valueOffsets):(this.stride=we(t),f&&((g=f[0])&&(this.valueOffsets=g),(g=f[1])&&(this.values=g),(g=f[2])&&(this.nullBitmap=g),(g=f[3])&&(this.typeIds=g)))}getValid(t){let{type:e}=this;if(z.isUnion(e)){let r=e,c=this.children[r.typeIdToChildIndex[this.typeIds[t]]],f=r.mode===Ut.Dense?this.valueOffsets[t]:t;return c.getValid(f)}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:c}=this;if(z.isUnion(c)){let f=c,_=this.children[f.typeIdToChildIndex[this.typeIds[t]]],b=f.mode===Ut.Dense?this.valueOffsets[t]:t;r=_.getValid(b),_.setValid(b,e)}else{let{nullBitmap:f}=this,{offset:_,length:b}=this,g=_+t,T=1<<g%8,D=g>>3;(!f||f.byteLength<=D)&&(f=new Uint8Array((_+b+63&-64)>>3).fill(255),this.nullCount>0?(f.set(_r(_,b,this.nullBitmap),0),Object.assign(this,{nullBitmap:f})):Object.assign(this,{nullBitmap:f,_nullCount:0}));let U=f[D];r=(U&T)!==0,f[D]=e?U|T:U&~T}return r!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,r=this.length,c=this._nullCount,f=this,_=this.children){return new i(t,e,r,c,f,_,this.dictionary)}slice(t,e){let{stride:r,typeId:c,children:f}=this,_=+(this._nullCount===0)-1,b=c===16?r:1,g=this._sliceBuffers(t,e,r,c);return this.clone(this.type,this.offset+t,e,_,g,f.length===0||this.valueOffsets?f:this._sliceChildren(f,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,c=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);c[e>>3]=(1<<e-(e&-8))-1,r>0&&c.set(_r(this.offset,e,this.nullBitmap),0);let f=this.buffers;return f[Be.VALIDITY]=c,this.clone(this.type,0,t,r+(t-e),f)}_sliceBuffers(t,e,r,c){let f,{buffers:_}=this;return(f=_[Be.TYPE])&&(_[Be.TYPE]=f.subarray(t,t+e)),(f=_[Be.OFFSET])&&(_[Be.OFFSET]=f.subarray(t,t+e+1))||(f=_[Be.DATA])&&(_[Be.DATA]=c===6?f:f.subarray(r*t,r*(t+e))),_}_sliceChildren(t,e,r){return t.map(c=>c.slice(e,r))}};jt.prototype.children=Object.freeze([]);var ic=class i extends Z{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:r=0,["length"]:c=0}=t;return new jt(e,r,c,c)}visitBool(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length>>3,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitInt(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitFloat(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitUtf8(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitLargeUtf8(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=Us(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitBinary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitLargeBinary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=Us(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitDate(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitTimestamp(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitTime(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitDecimal(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitList(t){let{["type"]:e,["offset"]:r=0,["child"]:c}=t,f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,void 0,f],[c])}visitStruct(t){let{["type"]:e,["offset"]:r=0,["children"]:c=[]}=t,f=ot(t.nullBitmap),{length:_=c.reduce((g,{length:T})=>Math.max(g,T),0),nullCount:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,void 0,f],c)}visitUnion(t){let{["type"]:e,["offset"]:r=0,["children"]:c=[]}=t,f=mt(e.ArrayType,t.typeIds),{["length"]:_=f.length,["nullCount"]:b=-1}=t;if(z.isSparseUnion(e))return new jt(e,r,_,b,[void 0,void 0,void 0,f],c);let g=dr(t.valueOffsets);return new jt(e,r,_,b,[g,void 0,void 0,f],c)}visitDictionary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.indices.ArrayType,t.data),{["dictionary"]:_=new gt([new i().visit({type:e.dictionary})])}=t,{["length"]:b=f.length,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[void 0,f,c],[],_)}visitInterval(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitDuration(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitFixedSizeList(t){let{["type"]:e,["offset"]:r=0,["child"]:c=new i().visit({type:e.valueType})}=t,f=ot(t.nullBitmap),{["length"]:_=c.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,void 0,f],[c])}visitMap(t){let{["type"]:e,["offset"]:r=0,["child"]:c=new i().visit({type:e.childType})}=t,f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,void 0,f],[c])}},Qw=new ic;function dt(i){return Qw.visit(i)}var Ln=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 Bu(i){return i.some(t=>t.nullable)}function bo(i){return i.reduce((t,e)=>t+e.nullCount,0)}function vo(i){return i.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(i.length+1))}function go(i,t,e,r){let c=[];for(let f=-1,_=i.length;++f<_;){let b=i[f],g=t[f],{length:T}=b;if(g>=r)break;if(e>=g+T)continue;if(g>=e&&g+T<=r){c.push(b);continue}let D=Math.max(0,e-g),U=Math.min(r-g,T);c.push(b.slice(D,U-D))}return c.length===0&&c.push(i[0].slice(0,0)),c}function rc(i,t,e,r){let c=0,f=0,_=t.length-1;do{if(c>=_-1)return e<t[_]?r(i,c,e-t[c]):null;f=c+Math.trunc((_-c)*.5),e<t[f]?_=f:c=f}while(c<_)}function Nn(i,t){return i.getValid(t)}function Xr(i){function t(e,r,c){return i(e[r],c)}return function(e){let r=this.data;return rc(r,this._offsets,e,t)}}function wo(i){let t;function e(r,c,f){return i(r[c],f,t)}return function(r,c){let f=this.data;t=c;let _=rc(f,this._offsets,r,e);return t=void 0,_}}function So(i){let t;function e(r,c,f){let _=f,b=0,g=0;for(let T=c-1,D=r.length;++T<D;){let U=r[T];if(~(b=i(U,t,_)))return g+b;_=0,g+=U.length}return-1}return function(r,c){t=r;let f=this.data,_=typeof c!="number"?e(f,0,0):rc(f,this._offsets,c,e);return t=void 0,_}}var tt=class extends Z{};function tS(i,t){return t===null&&i.length>0?0:-1}function eS(i,t){let{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let r=0;for(let c of new pr(e,i.offset+(t||0),i.length,e,mo)){if(!c)return r;++r}return-1}function ft(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 eS(i,e)}let r=Gt.getVisitFn(i),c=rr(t);for(let f=(e||0)-1,_=i.length;++f<_;)if(c(r(i,f)))return f;return-1}function Fu(i,t,e){let r=Gt.getVisitFn(i),c=rr(t);for(let f=(e||0)-1,_=i.length;++f<_;)if(c(r(i,f)))return f;return-1}tt.prototype.visitNull=tS;tt.prototype.visitBool=ft;tt.prototype.visitInt=ft;tt.prototype.visitInt8=ft;tt.prototype.visitInt16=ft;tt.prototype.visitInt32=ft;tt.prototype.visitInt64=ft;tt.prototype.visitUint8=ft;tt.prototype.visitUint16=ft;tt.prototype.visitUint32=ft;tt.prototype.visitUint64=ft;tt.prototype.visitFloat=ft;tt.prototype.visitFloat16=ft;tt.prototype.visitFloat32=ft;tt.prototype.visitFloat64=ft;tt.prototype.visitUtf8=ft;tt.prototype.visitLargeUtf8=ft;tt.prototype.visitBinary=ft;tt.prototype.visitLargeBinary=ft;tt.prototype.visitFixedSizeBinary=ft;tt.prototype.visitDate=ft;tt.prototype.visitDateDay=ft;tt.prototype.visitDateMillisecond=ft;tt.prototype.visitTimestamp=ft;tt.prototype.visitTimestampSecond=ft;tt.prototype.visitTimestampMillisecond=ft;tt.prototype.visitTimestampMicrosecond=ft;tt.prototype.visitTimestampNanosecond=ft;tt.prototype.visitTime=ft;tt.prototype.visitTimeSecond=ft;tt.prototype.visitTimeMillisecond=ft;tt.prototype.visitTimeMicrosecond=ft;tt.prototype.visitTimeNanosecond=ft;tt.prototype.visitDecimal=ft;tt.prototype.visitList=ft;tt.prototype.visitStruct=ft;tt.prototype.visitUnion=ft;tt.prototype.visitDenseUnion=Fu;tt.prototype.visitSparseUnion=Fu;tt.prototype.visitDictionary=ft;tt.prototype.visitInterval=ft;tt.prototype.visitIntervalDayTime=ft;tt.prototype.visitIntervalYearMonth=ft;tt.prototype.visitDuration=ft;tt.prototype.visitDurationSecond=ft;tt.prototype.visitDurationMillisecond=ft;tt.prototype.visitDurationMicrosecond=ft;tt.prototype.visitDurationNanosecond=ft;tt.prototype.visitFixedSizeList=ft;tt.prototype.visitMap=ft;var mr=new tt;var et=class extends Z{};function ct(i){let{type:t}=i;if(i.nullCount===0&&i.stride===1&&(z.isInt(t)&&t.bitWidth!==64||z.isTime(t)&&t.bitWidth!==64||z.isFloat(t)&&t.precision!==Ot.HALF))return new Ln(i.data.length,r=>{let c=i.data[r];return c.values.subarray(0,c.length)[Symbol.iterator]()});let e=0;return new Ln(i.data.length,r=>{let f=i.data[r].length,_=i.slice(e,e+f);return e+=f,new nc(_)})}var nc=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}};et.prototype.visitNull=ct;et.prototype.visitBool=ct;et.prototype.visitInt=ct;et.prototype.visitInt8=ct;et.prototype.visitInt16=ct;et.prototype.visitInt32=ct;et.prototype.visitInt64=ct;et.prototype.visitUint8=ct;et.prototype.visitUint16=ct;et.prototype.visitUint32=ct;et.prototype.visitUint64=ct;et.prototype.visitFloat=ct;et.prototype.visitFloat16=ct;et.prototype.visitFloat32=ct;et.prototype.visitFloat64=ct;et.prototype.visitUtf8=ct;et.prototype.visitLargeUtf8=ct;et.prototype.visitBinary=ct;et.prototype.visitLargeBinary=ct;et.prototype.visitFixedSizeBinary=ct;et.prototype.visitDate=ct;et.prototype.visitDateDay=ct;et.prototype.visitDateMillisecond=ct;et.prototype.visitTimestamp=ct;et.prototype.visitTimestampSecond=ct;et.prototype.visitTimestampMillisecond=ct;et.prototype.visitTimestampMicrosecond=ct;et.prototype.visitTimestampNanosecond=ct;et.prototype.visitTime=ct;et.prototype.visitTimeSecond=ct;et.prototype.visitTimeMillisecond=ct;et.prototype.visitTimeMicrosecond=ct;et.prototype.visitTimeNanosecond=ct;et.prototype.visitDecimal=ct;et.prototype.visitList=ct;et.prototype.visitStruct=ct;et.prototype.visitUnion=ct;et.prototype.visitDenseUnion=ct;et.prototype.visitSparseUnion=ct;et.prototype.visitDictionary=ct;et.prototype.visitInterval=ct;et.prototype.visitIntervalDayTime=ct;et.prototype.visitIntervalYearMonth=ct;et.prototype.visitDuration=ct;et.prototype.visitDurationSecond=ct;et.prototype.visitDurationMillisecond=ct;et.prototype.visitDurationMicrosecond=ct;et.prototype.visitDurationNanosecond=ct;et.prototype.visitFixedSizeList=ct;et.prototype.visitMap=ct;var Zr=new et;var Au,xu={},ku={},gt=class i{constructor(t){var e,r,c;let f=t[0]instanceof i?t.flatMap(b=>b.data):t;if(f.length===0||f.some(b=>!(b instanceof jt)))throw new TypeError("Vector constructor expects an Array of Data instances.");let _=(e=f[0])===null||e===void 0?void 0:e.type;switch(f.length){case 0:this._offsets=[0];break;case 1:{let{get:b,set:g,indexOf:T}=xu[_.typeId],D=f[0];this.isValid=U=>Nn(D,U),this.get=U=>b(D,U),this.set=(U,M)=>g(D,U,M),this.indexOf=U=>T(D,U),this._offsets=[0,D.length];break}default:Object.setPrototypeOf(this,ku[_.typeId]),this._offsets=vo(f);break}this.data=f,this.type=_,this.stride=we(_),this.numChildren=(c=(r=_.children)===null||r===void 0?void 0:r.length)!==null&&c!==void 0?c:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return Bu(this.data)}get nullCount(){return bo(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(hr(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return Zr.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(Rn(this,t,e,({data:r,_offsets:c},f,_)=>go(r,c,f,_)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:c,ArrayType:f}=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 f;case 1:return e[0].values.subarray(0,r*c);default:return e.reduce((_,{values:b,length:g})=>(_.array.set(b.subarray(0,g*c),_.offset),_.offset+=g*c,_),{array:new f(r*c),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 z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let t=new Io(this.data[0].dictionary),e=this.data.map(r=>{let c=r.clone();return c.dictionary=t,c});return new i(e)}return new Io(this)}unmemoize(){if(z.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{let c=r.clone();return c.dictionary=t,c});return new i(e)}return this}};Au=Symbol.toStringTag;gt[Au]=(i=>{i.type=z.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),c=ie.getVisitFnByTypeId(e),f=mr.getVisitFnByTypeId(e);xu[e]={get:r,set:c,indexOf:f},ku[e]=Object.create(i,{isValid:{value:Xr(Nn)},get:{value:Xr(Gt.getVisitFnByTypeId(e))},set:{value:wo(ie.getVisitFnByTypeId(e))},indexOf:{value:So(mr.getVisitFnByTypeId(e))}})}return"Vector"})(gt.prototype);var Io=class i extends gt{constructor(t){super(t.data);let e=this.get,r=this.set,c=this.slice,f=new Array(this.length);Object.defineProperty(this,"get",{value(_){let b=f[_];if(b!==void 0)return b;let g=e.call(this,_);return f[_]=g,g}}),Object.defineProperty(this,"set",{value(_,b){r.call(this,_,b),f[_]=b}}),Object.defineProperty(this,"slice",{value:(_,b)=>new i(c.call(this,_,b))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new gt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Eu(i){if(!i||i.length<=0)return function(c){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(iS(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 iS(i){return typeof i!="bigint"?Ve(i):"".concat(Ve(i),"n")}function sc(i,t){let e=Math.ceil(i)*t-1;return(e-e%64+64||64)/t}function Ou(i,t=0){return i.length>=t?i.subarray(0,t):gn(new i.constructor(t),i,0)}var Ke=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,c=this.buffer.length;r>=c&&this._resize(c===0?sc(r*1,this.BYTES_PER_ELEMENT):sc(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=sc(t*this.stride,this.BYTES_PER_ELEMENT);let e=Ou(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=Ou(this.buffer,t)}},ki=class extends Ke{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}},Qr=class extends ki{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),c=t>>3,f=t%8,_=r[c]>>f&1;return e?_===0&&(r[c]|=1<<f,++this.numValid):_===1&&(r[c]&=~(1<<f),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},tn=class extends ki{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,e){let r=this.length-1,c=this.reserve(t-r+1).buffer;return r<t++&&r>=0&&c.fill(c[r],r,t),c[t]=c[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 Pt=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 Qr,e&&e.length>0&&(this._isValid=Eu(e))}toVector(){return new gt([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:c,_typeIds:f,children:_}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),c&&(t+=c.byteLength),f&&(t+=f.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,c,{type:f,length:_,nullCount:b,_typeIds:g,_offsets:T,_values:D,_nulls:U}=this;(e=g==null?void 0:g.flush(_))?c=T==null?void 0:T.flush(_):(c=T==null?void 0:T.flush(_))?t=D==null?void 0:D.flush(T.last()):t=D==null?void 0:D.flush(_),b>0&&(r=U==null?void 0:U.flush(_));let M=this.children.map(N=>N.flush());return this.clear(),dt({type:f,length:_,nullCount:b,children:M,child:M[0],data:t,typeIds:e,nullBitmap:r,valueOffsets:c})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,r,c;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(),(c=this._typeIds)===null||c===void 0||c.clear();for(let f of this.children)f.clear();return this}};Pt.prototype.length=1;Pt.prototype.stride=1;Pt.prototype.children=null;Pt.prototype.finished=!1;Pt.prototype.nullValues=null;Pt.prototype._isValid=()=>!0;var Kt=class extends Pt{constructor(t){super(t),this._values=new ki(this.ArrayType,0,this.stride)}setValue(t,e){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}},de=class extends Pt{constructor(t){super(t),this._pendingLength=0,this._offsets=new tn(t.type)}setValue(t,e){let r=this._pending||(this._pending=new Map),c=r.get(t);c&&(this._pendingLength-=c.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,c){return t.prep(8,24),t.writeInt64(BigInt(c!=null?c: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 Xt).__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 At=class i{constructor(t=[],e,r,c=Bt.V5){this.fields=t||[],this.metadata=e||new Map,r||(r=oc(this.fields)),this.dictionaries=r,this.metadataVersion=c}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(c=>e.has(c.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],c=To(To(new Map,this.metadata),e.metadata),f=e.fields.filter(b=>{let g=r.findIndex(T=>T.name===b.name);return~g?(r[g]=b.clone({metadata:To(To(new Map,r[g].metadata),b.metadata)}))&&!1:!0}),_=oc(f,new Map);return new i([...r,...f],c,new Map([...this.dictionaries,..._]))}};At.prototype.fields=null;At.prototype.metadata=null;At.prototype.dictionaries=null;var bt=class i{static new(...t){let[e,r,c,f]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),c===void 0&&(c=t[0].nullable),f===void 0&&(f=t[0].metadata)),new i("".concat(e),r,c,f)}constructor(t,e,r=!1,c){this.name=t,this.type=e,this.nullable=r,this.metadata=c||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,c,f]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,c=this.nullable,f=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:c=this.nullable,metadata:f=this.metadata}=t[0],i.new(e,r,c,f)}};bt.prototype.type=null;bt.prototype.name=null;bt.prototype.nullable=null;bt.prototype.metadata=null;function To(i,t){return new Map([...i||new Map,...t||new Map])}function oc(i,t=new Map){for(let e=-1,r=i.length;++e<r;){let f=i[e].type;if(z.isDictionary(f)){if(!t.has(f.id))t.set(f.id,f.dictionary);else if(t.get(f.id)!==f.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}f.children&&f.children.length>0&&oc(f.children,t)}return t}var rS=fr,nS=be,Ei=class{static decode(t){t=new nS(ot(t));let e=Se.getRootAsFooter(t),r=At.decode(e.schema(),new Map,e.version());return new ac(r,e)}static encode(t){let e=new rS,r=At.encode(e,t.schema);Se.startRecordBatchesVector(e,t.numRecordBatches);for(let _ of[...t.recordBatches()].slice().reverse())Oi.encode(e,_);let c=e.endVector();Se.startDictionariesVector(e,t.numDictionaries);for(let _ of[...t.dictionaryBatches()].slice().reverse())Oi.encode(e,_);let f=e.endVector();return Se.startFooter(e),Se.addSchema(e,r),Se.addVersion(e,Bt.V5),Se.addRecordBatches(e,c),Se.addDictionaries(e,f),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,c){this.schema=t,this.version=e,r&&(this._recordBatches=r),c&&(this._dictionaryBatches=c)}*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 ac=class extends Ei{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 Oi.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return Oi.decode(e)}return null}},Oi=class i{static decode(t){return new i(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:r}=e,c=BigInt(e.offset),f=BigInt(e.bodyLength);return br.createBlock(t,c,r,f)}constructor(t,e,r){this.metaDataLength=t,this.offset=wt(r),this.bodyLength=wt(e)}};var Lt=Object.freeze({done:!0,value:void 0}),Pn=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())}},jo=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 V(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(Lt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return ee.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return ee.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return V(this,void 0,void 0,function*(){return yield this.abort(t),Lt})}return(t){return V(this,void 0,void 0,function*(){return yield this.close(),Lt})}read(t){return V(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return V(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(Lt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var ci=class extends jo{write(t){if((t=ot(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?bn(this.toUint8Array(!0)):this.toUint8Array(!1).then(bn)}toUint8Array(t=!1){return t?me(this._values)[0]:V(this,void 0,void 0,function*(){var e,r,c,f;let _=[],b=0;try{for(var g=!0,T=Ue(this),D;D=yield T.next(),e=D.done,!e;g=!0){f=D.value,g=!1;let U=f;_.push(U),b+=U.byteLength}}catch(U){r={error:U}}finally{try{!g&&!e&&(c=T.return)&&(yield c.call(T))}finally{if(r)throw r.error}}return me(_,b)[0]})}},li=class{constructor(t){t&&(this.source=new cc(ee.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)}},Ae=class i{constructor(t){t instanceof i?this.source=t.source:t instanceof ci?this.source=new Ui(ee.fromAsyncIterable(t)):Os(t)?this.source=new Ui(ee.fromNodeStream(t)):vn(t)?this.source=new Ui(ee.fromDOMStream(t)):ks(t)?this.source=new Ui(ee.fromDOMStream(t.body)):Re(t)?this.source=new Ui(ee.fromIterable(t)):Me(t)?this.source=new Ui(ee.fromAsyncIterable(t)):je(t)&&(this.source=new Ui(ee.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)}},cc=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)||Lt)}return(t){return Object.create(this.source.return&&this.source.return(t)||Lt)}},Ui=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return V(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return V(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return V(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return V(this,arguments,void 0,function*(e,r="read"){return yield this.source.next({cmd:r,size:e})})}throw(t){return V(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||Lt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return V(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||Lt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Vn=class extends li{constructor(t,e){super(),this.position=0,this.buffer=ot(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:c}=this;return e&&c<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,c+Math.min(r-c,t)),e.subarray(c,this.position)):null}readAt(t,e){let r=this.buffer,c=Math.min(this.size,t+e);return r?r.subarray(t,c):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 Ae{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=V(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return V(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 V(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 V(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:r,position:c}=this;if(e&&c<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let f=c,_=0,b=0,g=Math.min(r,f+Math.min(r-f,t)),T=new Uint8Array(Math.max(0,(this.position=g)-f));for(;(f+=b)<g&&(_+=b)<T.byteLength;)({bytesRead:b}=yield e.read(T,_,T.byteLength-_,f));return T}return null})}readAt(t,e){return V(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:c}=this;if(r&&t+e<c){let f=Math.min(c,t+e),_=new Uint8Array(f-t);return(yield r.read(_,0,e,t)).buffer}return new Uint8Array(e)})}close(){return V(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return V(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return V(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var uc={};$i(uc,{BaseInt64:()=>Hn,Int128:()=>zn,Int64:()=>Mi,Uint64:()=>zt});function en(i){return i<0&&(i=4294967295+i+1),"0x".concat(i.toString(16))}var rn=8,lc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Hn=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]),c=e[3]*r[3];this.buffer[0]=c&65535;let f=c>>>16;return c=e[2]*r[3],f+=c,c=e[3]*r[2]>>>0,f+=c,this.buffer[0]+=f<<16,this.buffer[1]=f>>>0<c?65536:0,this.buffer[1]+=f>>>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(en(this.buffer[1])," ").concat(en(this.buffer[0]))}},zt=class i extends Hn{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,c=new i(e);for(let f=0;f<r;){let _=rn<r-f?rn:r-f,b=new i(new Uint32Array([Number.parseInt(t.slice(f,f+_),10),0])),g=new i(new Uint32Array([lc[_],0]));c.times(g),c.plus(b),f+=_}return c}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,c=t.length;++r<c;)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)}},Mi=class i extends Hn{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("-"),c=t.length,f=new i(e);for(let _=r?1:0;_<c;){let b=rn<c-_?rn:c-_,g=new i(new Uint32Array([Number.parseInt(t.slice(_,_+b),10),0])),T=new i(new Uint32Array([lc[b],0]));f.times(T),f.plus(g),_+=b}return r?f.negate():f}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,c=t.length;++r<c;)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)}},zn=class i{constructor(t){this.buffer=t}high(){return new Mi(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Mi(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 zt(new Uint32Array([this.buffer[3],0])),r=new zt(new Uint32Array([this.buffer[2],0])),c=new zt(new Uint32Array([this.buffer[1],0])),f=new zt(new Uint32Array([this.buffer[0],0])),_=new zt(new Uint32Array([t.buffer[3],0])),b=new zt(new Uint32Array([t.buffer[2],0])),g=new zt(new Uint32Array([t.buffer[1],0])),T=new zt(new Uint32Array([t.buffer[0],0])),D=zt.multiply(f,T);this.buffer[0]=D.low();let U=new zt(new Uint32Array([D.high(),0]));return D=zt.multiply(c,T),U.plus(D),D=zt.multiply(f,g),U.plus(D),this.buffer[1]=U.low(),this.buffer[3]=U.lessThan(D)?1:0,this.buffer[2]=U.high(),new zt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(zt.multiply(r,T)).plus(zt.multiply(c,g)).plus(zt.multiply(f,b)),this.buffer[3]+=zt.multiply(e,T).plus(zt.multiply(r,g)).plus(zt.multiply(c,b)).plus(zt.multiply(f,_)).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(en(this.buffer[3])," ").concat(en(this.buffer[2])," ").concat(en(this.buffer[1])," ").concat(en(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("-"),c=t.length,f=new i(e);for(let _=r?1:0;_<c;){let b=rn<c-_?rn:c-_,g=new i(new Uint32Array([Number.parseInt(t.slice(_,_+b),10),0,0,0])),T=new i(new Uint32Array([lc[b],0,0,0]));f.times(T),f.plus(g),_+=b}return r?f.negate():f}static convertArray(t){let e=new Uint32Array(t.length*4);for(let r=-1,c=t.length;++r<c;)i.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}};var Wn=class extends Z{constructor(t,e,r,c,f=Bt.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=c,this.metadataVersion=f}visit(t){return super.visit(t instanceof bt?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return dt({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({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 dt({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 dt({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 dt({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 dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({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 dt({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===Ut.Sparse?this.visitSparseUnion(t,{length:e,nullCount:r}):this.visitDenseUnion(t,{length:e,nullCount:r})}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({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 dt({type:t,length:e,nullCount:r,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({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 dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({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 dt({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)}},Do=class extends Wn{constructor(t,e,r,c,f){super(new Uint8Array(0),e,r,c,f),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 mt(Uint8Array,mt(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return mt(Uint8Array,mt(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;return z.isTimestamp(t)?mt(Uint8Array,Mi.convertArray(r[e])):(z.isInt(t)||z.isTime(t))&&t.bitWidth===64||z.isDuration(t)?mt(Uint8Array,Mi.convertArray(r[e])):z.isDate(t)&&t.unit===$t.MILLISECOND?mt(Uint8Array,Mi.convertArray(r[e])):z.isDecimal(t)?mt(Uint8Array,zn.convertArray(r[e])):z.isBinary(t)||z.isLargeBinary(t)||z.isFixedSizeBinary(t)?sS(r[e]):z.isBool(t)?yr(r[e]):z.isUtf8(t)||z.isLargeUtf8(t)?ei(r[e].join("")):mt(Uint8Array,mt(t.ArrayType,r[e].map(c=>+c)))}};function sS(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 nn=class extends de{constructor(t){super(t),this._values=new Ke(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,ot(e))}_flushPending(t,e){let r=this._offsets,c=this._values.reserve(e).buffer,f=0;for(let[_,b]of t)if(b===void 0)r.set(_,0);else{let g=b.length;c.set(b,f),r.set(_,g),f+=g}}};var sn=class extends de{constructor(t){super(t),this._values=new Ke(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,ot(e))}_flushPending(t,e){let r=this._offsets,c=this._values.reserve(e).buffer,f=0;for(let[_,b]of t)if(b===void 0)r.set(_,BigInt(0));else{let g=b.length;c.set(b,f),r.set(_,BigInt(g)),f+=g}}};var Bo=class extends Pt{constructor(t){super(t),this._values=new Qr}setValue(t,e){this._values.set(t,+e)}};var gr=class extends Kt{};gr.prototype._setValue=za;var $n=class extends gr{};$n.prototype._setValue=Zs;var Yn=class extends gr{};Yn.prototype._setValue=Qs;var Gn=class extends Kt{};Gn.prototype._setValue=Ya;var Fo=class extends Pt{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,c=this.valueToKey(e),f=r[c];return f===void 0&&(r[c]=f=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,f)}flush(){let t=this.type,e=this._dictionary,r=this.dictionary.toVector(),c=this.indices.flush().clone(t);return c.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=c.dictionary,this.clear(),c}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 Kn=class extends Kt{};Kn.prototype._setValue=Ha;var Ao=class extends Pt{setValue(t,e){let[r]=this.children,c=t*this.stride;for(let f=-1,_=e.length;++f<_;)r.set(c+f,e[f])}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 $e(this.type.listSize,new bt(e,t.type,!0)),r}};var Sr=class extends Kt{setValue(t,e){this._values.set(t,e)}},xo=class extends Sr{setValue(t,e){super.setValue(t,Mn(e))}},ko=class extends Sr{},Eo=class extends Sr{};var Ir=class extends Kt{};Ir.prototype._setValue=Ga;var qn=class extends Ir{};qn.prototype._setValue=co;var Jn=class extends Ir{};Jn.prototype._setValue=lo;var Ri=class extends Kt{};Ri.prototype._setValue=Ka;var Xn=class extends Ri{};Xn.prototype._setValue=uo;var Zn=class extends Ri{};Zn.prototype._setValue=fo;var Qn=class extends Ri{};Qn.prototype._setValue=ho;var ts=class extends Ri{};ts.prototype._setValue=po;var xe=class extends Kt{setValue(t,e){this._values.set(t,e)}},Oo=class extends xe{},Uo=class extends xe{},Mo=class extends xe{},Ro=class extends xe{},Co=class extends xe{},Lo=class extends xe{},No=class extends xe{},Po=class extends xe{};var Vo=class extends de{constructor(t){super(t),this._offsets=new tn(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 ze(new bt(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[c,f]of t)if(typeof f>"u")e.set(c,0);else{let _=f,b=_.length,g=e.set(c,b).buffer[c];for(let T=-1;++T<b;)r.set(g+T,_[T])}}};var Ho=class extends de{set(t,e){return super.set(t,e)}setValue(t,e){let r=e instanceof Map?e:new Map(Object.entries(e)),c=this._pending||(this._pending=new Map),f=c.get(t);f&&(this._pendingLength-=f.size),this._pendingLength+=r.size,c.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 Ye(new bt(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[c,f]of t)if(f===void 0)e.set(c,0);else{let{[c]:_,[c+1]:b}=e.set(c,f.size).buffer;for(let g of f.entries())if(r.set(_,g),++_>=b)break}}};var zo=class extends Pt{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var Wo=class extends Pt{setValue(t,e){let{children:r,type:c}=this;switch(Array.isArray(e)||e.constructor){case!0:return c.children.forEach((f,_)=>r[_].set(t,e[_]));case Map:return c.children.forEach((f,_)=>r[_].set(t,e.get(f.name)));default:return c.children.forEach((f,_)=>r[_].set(t,e[f.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 bt(e,t.type,!0)]),r}};var Ci=class extends Kt{};Ci.prototype._setValue=Wa;var es=class extends Ci{};es.prototype._setValue=to;var is=class extends Ci{};is.prototype._setValue=eo;var rs=class extends Ci{};rs.prototype._setValue=io;var ns=class extends Ci{};ns.prototype._setValue=ro;var Li=class extends Kt{};Li.prototype._setValue=$a;var ss=class extends Li{};ss.prototype._setValue=no;var os=class extends Li{};os.prototype._setValue=so;var as=class extends Li{};as.prototype._setValue=oo;var cs=class extends Li{};cs.prototype._setValue=ao;var on=class extends Pt{constructor(t){super(t),this._typeIds=new ki(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 c=this.type.typeIdToChildIndex[r],f=this.children[c];f==null||f.set(t,e)}addChild(t,e="".concat(this.children.length)){let r=this.children.push(t),{type:{children:c,mode:f,typeIds:_}}=this,b=[...c,new bt(e,t.type)];return this.type=new We(f,[..._,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.")}},$o=class extends on{},Yo=class extends on{constructor(t){super(t),this._offsets=new ki(Int32Array)}setValue(t,e,r){let c=this._typeIds.set(t,r).buffer[t],f=this.getChildAt(this.type.typeIdToChildIndex[c]),_=this._offsets.set(t,f.length).buffer[t];f==null||f.set(_,e)}};var ls=class extends de{constructor(t){super(t),this._values=new Ke(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){}};ls.prototype._flushPending=nn.prototype._flushPending;var us=class extends de{constructor(t){super(t),this._values=new Ke(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){}};us.prototype._flushPending=sn.prototype._flushPending;var dc=class extends Z{visitNull(){return zo}visitBool(){return Bo}visitInt(){return xe}visitInt8(){return Oo}visitInt16(){return Uo}visitInt32(){return Mo}visitInt64(){return Ro}visitUint8(){return Co}visitUint16(){return Lo}visitUint32(){return No}visitUint64(){return Po}visitFloat(){return Sr}visitFloat16(){return xo}visitFloat32(){return ko}visitFloat64(){return Eo}visitUtf8(){return ls}visitLargeUtf8(){return us}visitBinary(){return nn}visitLargeBinary(){return sn}visitFixedSizeBinary(){return Kn}visitDate(){return gr}visitDateDay(){return $n}visitDateMillisecond(){return Yn}visitTimestamp(){return Ci}visitTimestampSecond(){return es}visitTimestampMillisecond(){return is}visitTimestampMicrosecond(){return rs}visitTimestampNanosecond(){return ns}visitTime(){return Li}visitTimeSecond(){return ss}visitTimeMillisecond(){return os}visitTimeMicrosecond(){return as}visitTimeNanosecond(){return cs}visitDecimal(){return Gn}visitList(){return Vo}visitStruct(){return Wo}visitUnion(){return on}visitDenseUnion(){return Yo}visitSparseUnion(){return $o}visitDictionary(){return Fo}visitInterval(){return Ir}visitIntervalDayTime(){return qn}visitIntervalYearMonth(){return Jn}visitDuration(){return Ri}visitDurationSecond(){return Xn}visitDurationMillisecond(){return Zn}visitDurationMicrosecond(){return Qn}visitDurationNanosecond(){return ts}visitFixedSizeList(){return Ao}visitMap(){return Ho}},Uu=new dc;var it=class extends Z{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,c)=>this.compareFields(r,e[c]))}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 Ni(i,t){return i===t||ce(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function Go(i,t){return i===t||ce(i,t)&&i.precision===t.precision}function oS(i,t){return i===t||ce(i,t)&&i.byteWidth===t.byteWidth}function fc(i,t){return i===t||ce(i,t)&&i.unit===t.unit}function ds(i,t){return i===t||ce(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function fs(i,t){return i===t||ce(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function aS(i,t){return i===t||ce(i,t)&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function cS(i,t){return i===t||ce(i,t)&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function hc(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 lS(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 pc(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 uS(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 dS(i,t){return i===t||ce(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}it.prototype.visitNull=Tr;it.prototype.visitBool=Tr;it.prototype.visitInt=Ni;it.prototype.visitInt8=Ni;it.prototype.visitInt16=Ni;it.prototype.visitInt32=Ni;it.prototype.visitInt64=Ni;it.prototype.visitUint8=Ni;it.prototype.visitUint16=Ni;it.prototype.visitUint32=Ni;it.prototype.visitUint64=Ni;it.prototype.visitFloat=Go;it.prototype.visitFloat16=Go;it.prototype.visitFloat32=Go;it.prototype.visitFloat64=Go;it.prototype.visitUtf8=Tr;it.prototype.visitLargeUtf8=Tr;it.prototype.visitBinary=Tr;it.prototype.visitLargeBinary=Tr;it.prototype.visitFixedSizeBinary=oS;it.prototype.visitDate=fc;it.prototype.visitDateDay=fc;it.prototype.visitDateMillisecond=fc;it.prototype.visitTimestamp=ds;it.prototype.visitTimestampSecond=ds;it.prototype.visitTimestampMillisecond=ds;it.prototype.visitTimestampMicrosecond=ds;it.prototype.visitTimestampNanosecond=ds;it.prototype.visitTime=fs;it.prototype.visitTimeSecond=fs;it.prototype.visitTimeMillisecond=fs;it.prototype.visitTimeMicrosecond=fs;it.prototype.visitTimeNanosecond=fs;it.prototype.visitDecimal=Tr;it.prototype.visitList=aS;it.prototype.visitStruct=cS;it.prototype.visitUnion=hc;it.prototype.visitDenseUnion=hc;it.prototype.visitSparseUnion=hc;it.prototype.visitDictionary=lS;it.prototype.visitInterval=pc;it.prototype.visitIntervalDayTime=pc;it.prototype.visitIntervalYearMonth=pc;it.prototype.visitDuration=hs;it.prototype.visitDurationSecond=hs;it.prototype.visitDurationMillisecond=hs;it.prototype.visitDurationMicrosecond=hs;it.prototype.visitDurationNanosecond=hs;it.prototype.visitFixedSizeList=uS;it.prototype.visitMap=dS;var ui=new it;function jr(i,t){return ui.compareSchemas(i,t)}function Mu(i,t){return ui.compareFields(i,t)}function Ru(i,t){return ui.visit(i,t)}function wr(i){let t=i.type,e=new(Uu.getVisitFn(t)())(i);if(t.children&&t.children.length>0){let r=i.children||[],c={nullValues:i.nullValues},f=Array.isArray(r)?(_,b)=>r[b]||c:({name:_})=>r[_]||c;for(let[_,b]of t.children.entries()){let{type:g}=b,T=f(b,_);e.children.push(wr(Object.assign(Object.assign({},T),{type:g})))}}return e}function Ko(i,t){return fS(i,t.map(e=>e.data.concat()))}function fS(i,t){let e=[...i.fields],r=[],c={numBatches:t.reduce((U,M)=>Math.max(U,M.length),0)},f=0,_=0,b=-1,g=t.length,T,D=[];for(;c.numBatches-- >0;){for(_=Number.POSITIVE_INFINITY,b=-1;++b<g;)D[b]=T=t[b].shift(),_=Math.min(_,T?T.length:_);Number.isFinite(_)&&(D=hS(e,_,D,t,c),_>0&&(r[f++]=dt({type:new Ct(e),length:_,nullCount:0,children:D.slice()})))}return[i=i.assign(e),r.map(U=>new Yt(i,U))]}function hS(i,t,e,r,c){var f;let _=(t+63&-64)>>3;for(let b=-1,g=r.length;++b<g;){let T=e[b],D=T==null?void 0:T.length;if(D>=t)D===t?e[b]=T:(e[b]=T.slice(0,t),c.numBatches=Math.max(c.numBatches,r[b].unshift(T.slice(t,D-t))));else{let U=i[b];i[b]=U.clone({nullable:!0}),e[b]=(f=T==null?void 0:T._changeLengthAndBackfillNullBitmap(t))!==null&&f!==void 0?f:dt({type:U.type,length:t,nullCount:t,nullBitmap:new Uint8Array(_)})}}return e}var Cu,le=class i{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new At([]),this._offsets=[0],this;let c,f;t[0]instanceof At&&(c=t.shift()),t.at(-1)instanceof Uint32Array&&(f=t.pop());let _=g=>{if(g){if(g instanceof Yt)return[g];if(g instanceof i)return g.batches;if(g instanceof jt){if(g.type instanceof Ct)return[new Yt(new At(g.type.children),g)]}else{if(Array.isArray(g))return g.flatMap(T=>_(T));if(typeof g[Symbol.iterator]=="function")return[...g].flatMap(T=>_(T));if(typeof g=="object"){let T=Object.keys(g),D=T.map(N=>new gt([g[N]])),U=c!=null?c:new At(T.map((N,nt)=>new bt(String(N),D[nt].type,D[nt].nullable))),[,M]=Ko(U,D);return M.length===0?[new Yt(g)]:M}}}return[]},b=t.flatMap(g=>_(g));if(c=(r=c!=null?c:(e=b[0])===null||e===void 0?void 0:e.schema)!==null&&r!==void 0?r:new At([]),!(c instanceof At))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let g of b){if(!(g instanceof Yt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!jr(c,g.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=c,this.batches=b,this._offsets=f!=null?f:vo(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=bo(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(hr(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?Zr.visit(new gt(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:c})=>c));return new i(e,r.map(c=>new Yt(e,c)))}slice(t,e){let r=this.schema;[t,e]=Rn({length:this.numRows},t,e);let c=go(this.data,this._offsets,t,e);return new i(r,c.map(f=>new Yt(r,f)))}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],c=dt({type:r,length:0,nullCount:0});e.push(c._changeLengthAndBackfillNullBitmap(this.numRows))}return new gt(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(c=>c.name===t),e)}setChildAt(t,e){let r=this.schema,c=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new gt([dt({type:new ae,length:this.numRows})]));let f=r.fields.slice(),_=f[t].clone({type:e.type}),b=this.schema.fields.map((g,T)=>this.getChildAt(T));[f[t],b[t]]=[_,e],[r,c]=Ko(r,b)}return new i(r,c)}select(t){let e=this.schema.fields.reduce((r,c,f)=>r.set(c.name,f),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(c=>c.selectAt(t));return new i(e,r)}assign(t){let e=this.schema.fields,[r,c]=t.schema.fields.reduce((b,g,T)=>{let[D,U]=b,M=e.findIndex(N=>N.name===g.name);return~M?U[M]=T:D.push(T),b},[[],[]]),f=this.schema.assign(t.schema),_=[...e.map((b,g)=>[g,c[g]]).map(([b,g])=>g===void 0?this.getChildAt(b):t.getChildAt(g)),...r.map(b=>t.getChildAt(b))].filter(Boolean);return new i(...Ko(f,_))}};Cu=Symbol.toStringTag;le[Cu]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Xr(Nn),i.get=Xr(Gt.getVisitFn(j.Struct)),i.set=wo(ie.getVisitFn(j.Struct)),i.indexOf=So(mr.getVisitFn(j.Struct)),"Table"))(le.prototype);var Nu,Yt=class i{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof At))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=dt({nullCount:0,type:new Ct(this.schema.fields),children:this.schema.fields.map(e=>dt({type:e.type,nullCount:0}))})]=t,!(this.data instanceof jt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Lu(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:r,children:c,length:f}=Object.keys(e).reduce((g,T,D)=>(g.children[D]=e[T],g.length=Math.max(g.length,e[T].length),g.fields[D]=bt.new({name:T,type:e[T].type,nullable:!0}),g),{length:0,fields:new Array,children:new Array}),_=new At(r),b=dt({type:new Ct(r),length:f,children:c,nullCount:0});[this.schema,this.data]=Lu(_,b.children,f);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=Pu(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(hr(t,this.numRows))}set(t,e){return ie.visit(this.data,t,e)}indexOf(t,e){return mr.visit(this.data,t,e)}[Symbol.iterator](){return Zr.visit(new gt([this.data]))}toArray(){return[...this]}concat(...t){return new le(this.schema,[this,...t])}slice(t,e){let[r]=new gt([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 gt([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(c=>c.name===t),e)}setChildAt(t,e){let r=this.schema,c=this.data;if(t>-1&&t<this.numCols){e||(e=new gt([dt({type:new ae,length:this.numRows})]));let f=r.fields.slice(),_=c.children.slice(),b=f[t].clone({type:e.type});[f[t],_[t]]=[b,e.data[0]],r=new At(f,new Map(this.schema.metadata)),c=dt({type:new Ct(f),children:_})}return new i(r,c)}select(t){let e=this.schema.select(t),r=new Ct(e.fields),c=[];for(let f of t){let _=this.schema.fields.findIndex(b=>b.name===f);~_&&(c[_]=this.data.children[_])}return new i(e,dt({type:r,length:this.numRows,children:c}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(f=>this.data.children[f]).filter(Boolean),c=dt({type:new Ct(e.fields),length:this.numRows,children:r});return new i(e,c)}};Nu=Symbol.toStringTag;Yt[Nu]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Yt.prototype);function Lu(i,t,e=t.reduce((r,c)=>Math.max(r,c.length),0)){var r;let c=[...i.fields],f=[...t],_=(e+63&-64)>>3;for(let[b,g]of i.fields.entries()){let T=t[b];(!T||T.length!==e)&&(c[b]=g.clone({nullable:!0}),f[b]=(r=T==null?void 0:T._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:dt({type:g.type,length:e,nullCount:e,nullBitmap:new Uint8Array(_)}))}return[i.assign(c),dt({type:new Ct(c),length:e,children:f})]}function Pu(i,t,e=new Map){var r,c;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 f=-1,_=i.length;++f<_;){let{type:b}=i[f],g=t[f];for(let T of[g,...((c=g==null?void 0:g.dictionary)===null||c===void 0?void 0:c.data)||[]])Pu(b.children,T==null?void 0:T.children,e);if(z.isDictionary(b)){let{id:T}=b;if(!e.has(T))g!=null&&g.dictionary&&e.set(T,g.dictionary);else if(e.get(T)!==g.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return e}var Dr=class extends Yt{constructor(t){let e=t.fields.map(c=>dt({type:c.type})),r=dt({type:new Ct(t.fields),nullCount:0,children:e});super(t,r)}};var qe=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):vt.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 Xt).__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,vt.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,c,f,_){return i.startMessage(t),i.addVersion(t,e),i.addHeaderType(t,r),i.addHeader(t,c),i.addBodyLength(t,f),i.addCustomMetadata(t,_),i.endMessage(t)}};var _c=class extends Z{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return xn.startNull(e),xn.endNull(e)}visitInt(t,e){return Ne.startInt(e),Ne.addBitWidth(e,t.bitWidth),Ne.addIsSigned(e,t.isSigned),Ne.endInt(e)}visitFloat(t,e){return Xi.startFloatingPoint(e),Xi.addPrecision(e,t.precision),Xi.endFloatingPoint(e)}visitBinary(t,e){return jn.startBinary(e),jn.endBinary(e)}visitLargeBinary(t,e){return Bn.startLargeBinary(e),Bn.endLargeBinary(e)}visitBool(t,e){return Dn.startBool(e),Dn.endBool(e)}visitUtf8(t,e){return En.startUtf8(e),En.endUtf8(e)}visitLargeUtf8(t,e){return Fn.startLargeUtf8(e),Fn.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 Gi.startDate(e),Gi.addUnit(e,t.unit),Gi.endDate(e)}visitTime(t,e){return yi.startTime(e),yi.addUnit(e,t.unit),yi.addBitWidth(e,t.bitWidth),yi.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return mi.startTimestamp(e),mi.addUnit(e,t.unit),r!==void 0&&mi.addTimezone(e,r),mi.endTimestamp(e)}visitInterval(t,e){return Zi.startInterval(e),Zi.addUnit(e,t.unit),Zi.endInterval(e)}visitDuration(t,e){return Ki.startDuration(e),Ki.addUnit(e,t.unit),Ki.endDuration(e)}visitList(t,e){return An.startList(e),An.endList(e)}visitStruct(t,e){return kn.startStruct_(e),kn.endStruct_(e)}visitUnion(t,e){Pe.startTypeIdsVector(e,t.typeIds.length);let r=Pe.createTypeIdsVector(e,t.typeIds);return Pe.startUnion(e),Pe.addMode(e,t.mode),Pe.addTypeIds(e,r),Pe.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 qi.startFixedSizeBinary(e),qi.addByteWidth(e,t.byteWidth),qi.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)}},qo=new _c;function Wu(i,t=new Map){return new At(_S(i,t),Jo(i.metadata),t)}function yc(i){return new re(i.count,Yu(i.columns),Gu(i.columns))}function $u(i){return new he(yc(i.data),i.id,i.isDelta)}function _S(i,t){return(i.fields||[]).filter(Boolean).map(e=>bt.fromJSON(e,t))}function Vu(i,t){return(i.children||[]).filter(Boolean).map(e=>bt.fromJSON(e,t))}function Yu(i){return(i||[]).reduce((t,e)=>[...t,new ke(e.count,yS(e.VALIDITY)),...Yu(e.children)],[])}function Gu(i,t=[]){for(let e=-1,r=(i||[]).length;++e<r;){let c=i[e];c.VALIDITY&&t.push(new fe(t.length,c.VALIDITY.length)),c.TYPE_ID&&t.push(new fe(t.length,c.TYPE_ID.length)),c.OFFSET&&t.push(new fe(t.length,c.OFFSET.length)),c.DATA&&t.push(new fe(t.length,c.DATA.length)),t=Gu(c.children,t)}return t}function yS(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function Ku(i,t){let e,r,c,f,_,b;return!t||!(f=i.dictionary)?(_=zu(i,Vu(i,t)),c=new bt(i.name,_,i.nullable,Jo(i.metadata))):t.has(e=f.id)?(r=(r=f.indexType)?Hu(r):new oi,b=new ge(t.get(e),r,e,f.isOrdered),c=new bt(i.name,b,i.nullable,Jo(i.metadata))):(r=(r=f.indexType)?Hu(r):new oi,t.set(e,_=zu(i,Vu(i,t))),b=new ge(_,r,e,f.isOrdered),c=new bt(i.name,b,i.nullable,Jo(i.metadata))),c||null}function Jo(i=[]){return new Map(i.map(({key:t,value:e})=>[t,e]))}function Hu(i){return new Zt(i.isSigned,i.bitWidth)}function zu(i,t){let e=i.type.name;switch(e){case"NONE":return new ae;case"null":return new ae;case"binary":return new bi;case"largebinary":return new vi;case"utf8":return new gi;case"largeutf8":return new wi;case"bool":return new Si;case"list":return new ze((t||[])[0]);case"struct":return new Ct(t||[]);case"struct_":return new Ct(t||[])}switch(e){case"int":{let r=i.type;return new Zt(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=i.type;return new Fe(Ot[r.precision])}case"decimal":{let r=i.type;return new Ii(r.scale,r.precision,r.bitWidth)}case"date":{let r=i.type;return new Ti($t[r.unit])}case"time":{let r=i.type;return new ji(Y[r.unit],r.bitWidth)}case"timestamp":{let r=i.type;return new Di(Y[r.unit],r.timezone)}case"interval":{let r=i.type;return new Bi(Jt[r.unit])}case"duration":{let r=i.type;return new Fi(Y[r.unit])}case"union":{let r=i.type,[c,...f]=(r.mode+"").toLowerCase(),_=c.toUpperCase()+f.join("");return new We(Ut[_],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=i.type;return new Ai(r.byteWidth)}case"fixedsizelist":{let r=i.type;return new $e(r.listSize,(t||[])[0])}case"map":{let r=i.type;return new Ye((t||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(e,'"'))}var mS=fr,bS=be,pe=class i{static fromJSON(t,e){let r=new i(0,Bt.V5,e);return r._createHeader=vS(t,e),r}static decode(t){t=new bS(ot(t));let e=qe.getRootAsMessage(t),r=e.bodyLength(),c=e.version(),f=e.headerType(),_=new i(r,c,f);return _._createHeader=gS(e,f),_}static encode(t){let e=new mS,r=-1;return t.isSchema()?r=At.encode(e,t.header()):t.isRecordBatch()?r=re.encode(e,t.header()):t.isDictionaryBatch()&&(r=he.encode(e,t.header())),qe.startMessage(e),qe.addVersion(e,Bt.V5),qe.addHeader(e,r),qe.addHeaderType(e,t.headerType),qe.addBodyLength(e,BigInt(t.bodyLength)),qe.finishMessageBuffer(e,qe.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof At)return new i(0,Bt.V5,vt.Schema,t);if(t instanceof re)return new i(e,Bt.V5,vt.RecordBatch,t);if(t instanceof he)return new i(e,Bt.V5,vt.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===vt.Schema}isRecordBatch(){return this.headerType===vt.RecordBatch}isDictionaryBatch(){return this.headerType===vt.DictionaryBatch}constructor(t,e,r,c){this._version=e,this._headerType=r,this.body=new Uint8Array(0),c&&(this._createHeader=()=>c),this._bodyLength=wt(t)}},re=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)}},he=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id=wt(e)}},fe=class{constructor(t,e){this.offset=wt(t),this.length=wt(e)}},ke=class{constructor(t,e){this.length=wt(t),this.nullCount=wt(e)}};function vS(i,t){return()=>{switch(t){case vt.Schema:return At.fromJSON(i);case vt.RecordBatch:return re.fromJSON(i);case vt.DictionaryBatch:return he.fromJSON(i)}throw new Error("Unrecognized Message type: { name: ".concat(vt[t],", type: ").concat(t," }"))}}function gS(i,t){return()=>{switch(t){case vt.Schema:return At.decode(i.header(new ue),new Map,i.version());case vt.RecordBatch:return re.decode(i.header(new ve),i.version());case vt.DictionaryBatch:return he.decode(i.header(new _i),i.version())}throw new Error("Unrecognized Message type: { name: ".concat(vt[t],", type: ").concat(t," }"))}}bt.encode=kS;bt.decode=AS;bt.fromJSON=Ku;At.encode=xS;At.decode=wS;At.fromJSON=Wu;re.encode=ES;re.decode=SS;re.fromJSON=yc;he.encode=OS;he.decode=IS;he.fromJSON=$u;ke.encode=US;ke.decode=jS;fe.encode=MS;fe.decode=TS;function wS(i,t=new Map,e=Bt.V5){let r=FS(i,t);return new At(r,Xo(i),t,e)}function SS(i,t=Bt.V5){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new re(i.length(),DS(i),BS(i,t))}function IS(i,t=Bt.V5){return new he(re.decode(i.data(),t),i.id(),i.isDelta())}function TS(i){return new fe(i.offset(),i.length())}function jS(i){return new ke(i.length(),i.nullCount())}function DS(i){let t=[];for(let e,r=-1,c=-1,f=i.nodesLength();++r<f;)(e=i.nodes(r))&&(t[++c]=ke.decode(e));return t}function BS(i,t){let e=[];for(let r,c=-1,f=-1,_=i.buffersLength();++c<_;)(r=i.buffers(c))&&(t<Bt.V4&&(r.bb_pos+=8*(c+1)),e[++f]=fe.decode(r));return e}function FS(i,t){let e=[];for(let r,c=-1,f=-1,_=i.fieldsLength();++c<_;)(r=i.fields(c))&&(e[++f]=bt.decode(r,t));return e}function qu(i,t){let e=[];for(let r,c=-1,f=-1,_=i.childrenLength();++c<_;)(r=i.children(c))&&(e[++f]=bt.decode(r,t));return e}function AS(i,t){let e,r,c,f,_,b;return!t||!(b=i.dictionary())?(c=Xu(i,qu(i,t)),r=new bt(i.name(),c,i.nullable(),Xo(i))):t.has(e=wt(b.id()))?(f=(f=b.indexType())?Ju(f):new oi,_=new ge(t.get(e),f,e,b.isOrdered()),r=new bt(i.name(),_,i.nullable(),Xo(i))):(f=(f=b.indexType())?Ju(f):new oi,t.set(e,c=Xu(i,qu(i,t))),_=new ge(c,f,e,b.isOrdered()),r=new bt(i.name(),_,i.nullable(),Xo(i))),r||null}function Xo(i){let t=new Map;if(i)for(let e,r,c=-1,f=Math.trunc(i.customMetadataLength());++c<f;)(e=i.customMetadata(c))&&(r=e.key())!=null&&t.set(r,e.value());return t}function Ju(i){return new Zt(i.isSigned(),i.bitWidth())}function Xu(i,t){let e=i.typeType();switch(e){case Mt.NONE:return new ae;case Mt.Null:return new ae;case Mt.Binary:return new bi;case Mt.LargeBinary:return new vi;case Mt.Utf8:return new gi;case Mt.LargeUtf8:return new wi;case Mt.Bool:return new Si;case Mt.List:return new ze((t||[])[0]);case Mt.Struct_:return new Ct(t||[])}switch(e){case Mt.Int:{let r=i.type(new Ne);return new Zt(r.isSigned(),r.bitWidth())}case Mt.FloatingPoint:{let r=i.type(new Xi);return new Fe(r.precision())}case Mt.Decimal:{let r=i.type(new si);return new Ii(r.scale(),r.precision(),r.bitWidth())}case Mt.Date:{let r=i.type(new Gi);return new Ti(r.unit())}case Mt.Time:{let r=i.type(new yi);return new ji(r.unit(),r.bitWidth())}case Mt.Timestamp:{let r=i.type(new mi);return new Di(r.unit(),r.timezone())}case Mt.Interval:{let r=i.type(new Zi);return new Bi(r.unit())}case Mt.Duration:{let r=i.type(new Ki);return new Fi(r.unit())}case Mt.Union:{let r=i.type(new Pe);return new We(r.mode(),r.typeIdsArray()||[],t||[])}case Mt.FixedSizeBinary:{let r=i.type(new qi);return new Ai(r.byteWidth())}case Mt.FixedSizeList:{let r=i.type(new Ji);return new $e(r.listSize(),(t||[])[0])}case Mt.Map:{let r=i.type(new Qi);return new Ye((t||[])[0],r.keysSorted())}}throw new Error('Unrecognized type: "'.concat(Mt[e],'" (').concat(e,")"))}function xS(i,t){let e=t.fields.map(f=>bt.encode(i,f));ue.startFieldsVector(i,e.length);let r=ue.createFieldsVector(i,e),c=t.metadata&&t.metadata.size>0?ue.createCustomMetadataVector(i,[...t.metadata].map(([f,_])=>{let b=i.createString("".concat(f)),g=i.createString("".concat(_));return Xt.startKeyValue(i),Xt.addKey(i,b),Xt.addValue(i,g),Xt.endKeyValue(i)})):-1;return ue.startSchema(i),ue.addFields(i,r),ue.addEndianness(i,RS?Yi.Little:Yi.Big),c!==-1&&ue.addCustomMetadata(i,c),ue.endSchema(i)}function kS(i,t){let e=-1,r=-1,c=-1,f=t.type,_=t.typeId;z.isDictionary(f)?(_=f.dictionary.typeId,c=qo.visit(f,i),r=qo.visit(f.dictionary,i)):r=qo.visit(f,i);let b=(f.children||[]).map(D=>bt.encode(i,D)),g=se.createChildrenVector(i,b),T=t.metadata&&t.metadata.size>0?se.createCustomMetadataVector(i,[...t.metadata].map(([D,U])=>{let M=i.createString("".concat(D)),N=i.createString("".concat(U));return Xt.startKeyValue(i),Xt.addKey(i,M),Xt.addValue(i,N),Xt.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),se.startField(i),se.addType(i,r),se.addTypeType(i,_),se.addChildren(i,g),se.addNullable(i,!!t.nullable),e!==-1&&se.addName(i,e),c!==-1&&se.addDictionary(i,c),T!==-1&&se.addCustomMetadata(i,T),se.endField(i)}function ES(i,t){let e=t.nodes||[],r=t.buffers||[];ve.startNodesVector(i,e.length);for(let _ of e.slice().reverse())ke.encode(i,_);let c=i.endVector();ve.startBuffersVector(i,r.length);for(let _ of r.slice().reverse())fe.encode(i,_);let f=i.endVector();return ve.startRecordBatch(i),ve.addLength(i,BigInt(t.length)),ve.addNodes(i,c),ve.addBuffers(i,f),ve.endRecordBatch(i)}function OS(i,t){let e=re.encode(i,t.data);return _i.startDictionaryBatch(i),_i.addId(i,BigInt(t.id)),_i.addIsDelta(i,t.isDelta),_i.addData(i,e),_i.endDictionaryBatch(i)}function US(i,t){return Hr.createFieldNode(i,BigInt(t.length),BigInt(t.nullCount))}function MS(i,t){return Vr.createBuffer(i,BigInt(t.offset),BigInt(t.length))}var RS=(()=>{let i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})();var bc=i=>"Expected ".concat(vt[i]," Message in stream, but was null or length 0."),vc=i=>"Header pointer of flatbuffer-encoded ".concat(vt[i]," Message is null or length 0."),Zu=(i,t)=>"Expected to read ".concat(i," metadata bytes, but only read ").concat(t,"."),Qu=(i,t)=>"Expected to read ".concat(i," bytes for message body, but only read ").concat(t,"."),an=class{constructor(t){this.source=t instanceof li?t:new li(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?Lt:t.value===-1&&(t=this.readMetadataLength()).done?Lt:(t=this.readMetadata(t.value)).done?Lt: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(bc(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=ot(this.source.read(t));if(e.byteLength<t)throw new Error(Qu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=vt.Schema,r=this.readMessage(e),c=r==null?void 0:r.header();if(t&&!c)throw new Error(vc(e));return c}readMetadataLength(){let t=this.source.read(Zo),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 Lt;if(e.byteLength<t)throw new Error(Zu(t,e.byteLength));return{done:!1,value:pe.decode(e)}}},ps=class{constructor(t,e){this.source=t instanceof Ae?t:xs(t)?new nr(t,e):new Ae(t)}[Symbol.asyncIterator](){return this}next(){return V(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?Lt:t.value===-1&&(t=yield this.readMetadataLength()).done?Lt:(t=yield this.readMetadata(t.value)).done?Lt:t})}throw(t){return V(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return V(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return V(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(bc(t));return e.value})}readMessageBody(t){return V(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=ot(yield this.source.read(t));if(e.byteLength<t)throw new Error(Qu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(){return V(this,arguments,void 0,function*(t=!1){let e=vt.Schema,r=yield this.readMessage(e),c=r==null?void 0:r.header();if(t&&!c)throw new Error(vc(e));return c})}readMetadataLength(){return V(this,void 0,void 0,function*(){let t=yield this.source.read(Zo),e=t&&new be(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return V(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return Lt;if(e.byteLength<t)throw new Error(Zu(t,e.byteLength));return{done:!1,value:pe.decode(e)}})}},_s=class extends an{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Pn?t:new Pn(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:pe.fromJSON(t.schema,vt.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,vt.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:pe.fromJSON(e,vt.RecordBatch)}}return this._body=[],Lt}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((c,f)=>[...c,...f.VALIDITY&&[f.VALIDITY]||[],...f.TYPE_ID&&[f.TYPE_ID]||[],...f.OFFSET&&[f.OFFSET]||[],...f.DATA&&[f.DATA]||[],...e(f.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(bc(t));return e.value}readSchema(){let t=vt.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(vc(t));return r}},Zo=4,mc="ARROW1",cn=new Uint8Array(mc.length);for(let i=0;i<mc.length;i+=1)cn[i]=mc.codePointAt(i);function Qo(i,t=0){for(let e=-1,r=cn.length;++e<r;)if(cn[e]!==i[t+e])return!1;return!0}var ln=cn.length,gc=ln+Zo,td=ln*2+Zo;var ne=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 Me(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 ee.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return ee.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:Fs(t)?LS(t):xs(t)?VS(t):Me(t)?V(this,void 0,void 0,function*(){return yield i.from(yield t)}):ks(t)||vn(t)||Os(t)||je(t)?PS(new Ae(t)):NS(new li(t))}static readAll(t){return t instanceof i?t.isSync()?ed(t):id(t):Fs(t)||ArrayBuffer.isView(t)||Re(t)||As(t)?ed(t):id(t)}},di=class extends ne{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 pt(yield*ur(Nr(Ue(this[Symbol.iterator]()))))})}},sr=class extends ne{constructor(t){super(t),this._impl=t}readAll(){return V(this,void 0,void 0,function*(){var t,e,r,c;let f=new Array;try{for(var _=!0,b=Ue(this),g;g=yield b.next(),t=g.done,!t;_=!0){c=g.value,_=!1;let T=c;f.push(T)}}catch(T){e={error:T}}finally{try{!_&&!t&&(r=b.return)&&(yield r.call(b))}finally{if(e)throw e.error}}return f})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},or=class extends di{constructor(t){super(t),this._impl=t}},ys=class extends sr{constructor(t){super(t),this._impl=t}},ta=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),c=dt({type:new Ct(this.schema.fields),length:t.length,children:r});return new Yt(this.schema,c)}_loadDictionaryBatch(t,e){let{id:r,isDelta:c}=t,{dictionaries:f,schema:_}=this,b=f.get(r),g=_.dictionaries.get(r),T=this._loadVectors(t.data,e,[g]);return(b&&c?b.concat(new gt(T)):new gt(T)).memoize()}_loadVectors(t,e,r){return new Wn(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},un=class extends ta{constructor(t,e){super(e),this._reader=Fs(t)?new _s(this._handle=t):new an(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=rd(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):Lt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Lt}next(){if(this.closed)return Lt;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(),c=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,c)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),c=e.readMessageBody(t.bodyLength),f=this._loadDictionaryBatch(r,c);this.dictionaries.set(r.id,f)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},dn=class extends ta{constructor(t,e){super(e),this._reader=new ps(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return V(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 V(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=rd(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return V(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Lt})}return(t){return V(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Lt})}next(){return V(this,void 0,void 0,function*(){if(this.closed)return Lt;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(),c=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,c)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),c=yield e.readMessageBody(t.bodyLength),f=this._loadDictionaryBatch(r,c);this.dictionaries.set(r.id,f)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return V(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},ea=class extends un{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 Vn?t:new Vn(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 c=this._reader.readMessage(vt.RecordBatch);if(c!=null&&c.isRecordBatch()){let f=c.header(),_=this._reader.readMessageBody(c.bodyLength);return this._loadRecordBatch(f,_)}}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 c=this._reader.readMessage(vt.DictionaryBatch);if(c!=null&&c.isDictionaryBatch()){let f=c.header(),_=this._reader.readMessageBody(c.bodyLength),b=this._loadDictionaryBatch(f,_);this.dictionaries.set(f.id,b)}}}_readFooter(){let{_handle:t}=this,e=t.size-gc,r=t.readInt32(e),c=t.readAt(e-r,r);return Ei.decode(c)}_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}},wc=class extends dn{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,c=e[0]instanceof Map?e.shift():void 0;super(t instanceof nr?t:new nr(t,r),c)}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return V(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 V(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 c=yield this._reader.readMessage(vt.RecordBatch);if(c!=null&&c.isRecordBatch()){let f=c.header(),_=yield this._reader.readMessageBody(c.bodyLength);return this._loadRecordBatch(f,_)}}return null})}_readDictionaryBatch(t){return V(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 c=yield this._reader.readMessage(vt.DictionaryBatch);if(c!=null&&c.isDictionaryBatch()){let f=c.header(),_=yield this._reader.readMessageBody(c.bodyLength),b=this._loadDictionaryBatch(f,_);this.dictionaries.set(f.id,b)}}})}_readFooter(){return V(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-gc,r=yield t.readInt32(e),c=yield t.readAt(e-r,r);return Ei.decode(c)})}_readNextMessageAndValidate(t){return V(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})}},Sc=class extends un{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new Do(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function rd(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*ed(i){let t=ne.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function id(i){return ye(this,arguments,function*(){let e=yield pt(ne.from(i));try{if(!(yield pt(e.open({autoDestroy:!1}))).closed)do yield yield pt(e);while(!(yield pt(e.reset().open())).closed)}finally{yield pt(e.cancel())}})}function LS(i){return new di(new Sc(i))}function NS(i){let t=i.peek(ln+7&-8);return t&&t.byteLength>=4?Qo(t)?new or(new ea(i.read())):new di(new un(i)):new di(new un(function*(){}()))}function PS(i){return V(this,void 0,void 0,function*(){let t=yield i.peek(ln+7&-8);return t&&t.byteLength>=4?Qo(t)?new or(new ea(yield i.read())):new sr(new dn(i)):new sr(new dn(function(){return ye(this,arguments,function*(){})}()))})}function VS(i){return V(this,void 0,void 0,function*(){let{size:t}=yield i.stat(),e=new nr(i,t);return t>=td&&Qo(yield e.readAt(0,ln+7&-8))?new ys(new wc(e)):new sr(new dn(e))})}var Ht=class i extends Z{static assemble(...t){let e=c=>c.flatMap(f=>Array.isArray(f)?e(f):f instanceof Yt?f.data.children:f.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 gt)return this.visitMany(t.data),this;let{type:e}=t;if(!z.isDictionary(e)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(z.isUnion(e))this.nodes.push(new ke(r,0));else{let{nullCount:c}=t;z.isNull(e)||Je.call(this,c<=0?new Uint8Array(0):_r(t.offset,r,t.nullBitmap)),this.nodes.push(new ke(r,c))}}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 Je(i){let t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new fe(this._byteLength,t)),this._byteLength+=t,this}function HS(i){var t;let{type:e,length:r,typeIds:c,valueOffsets:f}=i;if(Je.call(this,c),e.mode===Ut.Sparse)return Ic.call(this,i);if(e.mode===Ut.Dense){if(i.offset<=0)return Je.call(this,f),Ic.call(this,i);{let _=new Int32Array(r),b=Object.create(null),g=Object.create(null);for(let T,D,U=-1;++U<r;)(T=c[U])!==void 0&&((D=b[T])===void 0&&(D=b[T]=f[U]),_[U]=f[U]-D,g[T]=((t=g[T])!==null&&t!==void 0?t:0)+1);Je.call(this,_),this.visitMany(i.children.map((T,D)=>{let U=e.typeIds[D],M=b[U],N=g[U];return T.slice(M,Math.min(r,N))}))}}return this}function zS(i){let t;return i.nullCount>=i.length?Je.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?Je.call(this,_r(i.offset,i.length,t)):Je.call(this,yr(i.values))}function Pi(i){return Je.call(this,i.values.subarray(0,i.length*i.stride))}function ia(i){let{length:t,values:e,valueOffsets:r}=i,c=wt(r[0]),f=wt(r[t]),_=Math.min(f-c,e.byteLength-c);return Je.call(this,Ms(-c,t+1,r)),Je.call(this,e.subarray(c,c+_)),this}function Tc(i){let{length:t,valueOffsets:e}=i;if(e){let{[0]:r,[t]:c}=e;return Je.call(this,Ms(-r,t+1,e)),this.visit(i.children[0].slice(r,c-r))}return this.visit(i.children[0])}function Ic(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}Ht.prototype.visitBool=zS;Ht.prototype.visitInt=Pi;Ht.prototype.visitFloat=Pi;Ht.prototype.visitUtf8=ia;Ht.prototype.visitLargeUtf8=ia;Ht.prototype.visitBinary=ia;Ht.prototype.visitLargeBinary=ia;Ht.prototype.visitFixedSizeBinary=Pi;Ht.prototype.visitDate=Pi;Ht.prototype.visitTimestamp=Pi;Ht.prototype.visitTime=Pi;Ht.prototype.visitDecimal=Pi;Ht.prototype.visitList=Tc;Ht.prototype.visitStruct=Ic;Ht.prototype.visitUnion=HS;Ht.prototype.visitInterval=Pi;Ht.prototype.visitDuration=Pi;Ht.prototype.visitFixedSizeList=Tc;Ht.prototype.visitMap=Tc;var Br=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 Me(t)?t.then(e=>this.writeAll(e)):je(t)?Dc(this,t):jc(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&&vl(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&gl(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 Yt&&!(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 Yt?t instanceof Dr||this._writeRecordBatch(t):t instanceof le?this.writeAll(t.batches):Re(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,c=pe.encode(t),f=c.byteLength,_=this._writeLegacyIpcFormat?4:8,b=f+_+r&~r,g=b-f-_;return t.headerType===vt.RecordBatch?this._recordBatchBlocks.push(new Oi(b,t.bodyLength,this._position)):t.headerType===vt.DictionaryBatch&&this._dictionaryBlocks.push(new Oi(b,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(b-_)),f>0&&this._write(c),this._writePadding(g)}_write(t){if(this._started){let e=ot(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(cn)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:c,buffers:f}=Ht.assemble(t),_=new re(t.numRows,r,c),b=pe.from(_,e);return this._writeDictionaries(t)._writeMessage(b)._writeBodyBuffers(f)}_writeDictionaryBatch(t,e,r=!1){let{byteLength:c,nodes:f,bufferRegions:_,buffers:b}=Ht.assemble(new gt([t])),g=new re(t.length,f,_),T=new he(g,e,r),D=pe.from(T,c);return this._writeMessage(D)._writeBodyBuffers(b)}_writeBodyBuffers(t){let e,r,c;for(let f=-1,_=t.length;++f<_;)(e=t[f])&&(r=e.byteLength)>0&&(this._write(e),(c=(r+7&-8)-r)>0&&this._writePadding(c));return this}_writeDictionaries(t){var e,r;for(let[c,f]of t.dictionaries){let _=(e=f==null?void 0:f.data)!==null&&e!==void 0?e:[],b=this._seenDictionaries.get(c),g=(r=this._dictionaryDeltaOffsets.get(c))!==null&&r!==void 0?r:0;if(!b||b.data[0]!==_[0])for(let[T,D]of _.entries())this._writeDictionaryBatch(D,c,T>0);else if(g<_.length)for(let T of _.slice(g))this._writeDictionaryBatch(T,c,!0);this._seenDictionaries.set(c,f),this._dictionaryDeltaOffsets.set(c,_.length)}return this}},Fr=class i extends Br{static writeAll(t,e){let r=new i(e);return Me(t)?t.then(c=>r.writeAll(c)):je(t)?Dc(r,t):jc(r,t)}},Ar=class i extends Br{static writeAll(t){let e=new i;return Me(t)?t.then(r=>e.writeAll(r)):je(t)?Dc(e,t):jc(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=Ei.encode(new Ei(t,Bt.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function jc(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 Dc(i,t){return V(this,void 0,void 0,function*(){var e,r,c,f,_,b,g;try{for(e=!0,r=Ue(t);c=yield r.next(),f=c.done,!f;e=!0){g=c.value,e=!1;let T=g;i.write(T)}}catch(T){_={error:T}}finally{try{!e&&!f&&(b=r.return)&&(yield b.call(r))}finally{if(_)throw _.error}}return i.finish()})}function nd(i,t){if(je(i))return $S(i,t);if(Re(i))return WS(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function WS(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,c=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(_){f(_,e||(e=i[Symbol.iterator]()))},pull(_){e?f(_,e):_.close()},cancel(){(e!=null&&e.return&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:r?c:void 0},t));function f(_,b){let g,T=null,D=_.desiredSize||null;for(;!(T=b.next(r?D:null)).done;)if(ArrayBuffer.isView(T.value)&&(g=ot(T.value))&&(D!=null&&r&&(D=D-g.byteLength+1),T.value=g),_.enqueue(T.value),D!=null&&--D<=0)return;_.close()}}function $S(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,c=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(_){return V(this,void 0,void 0,function*(){yield f(_,e||(e=i[Symbol.asyncIterator]()))})},pull(_){return V(this,void 0,void 0,function*(){e?yield f(_,e):_.close()})},cancel(){return V(this,void 0,void 0,function*(){(e!=null&&e.return&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:r?c:void 0},t));function f(_,b){return V(this,void 0,void 0,function*(){let g,T=null,D=_.desiredSize||null;for(;!(T=yield b.next(r?D:null)).done;)if(ArrayBuffer.isView(T.value)&&(g=ot(T.value))&&(D!=null&&r&&(D=D-g.byteLength+1),T.value=g),_.enqueue(T.value),D!=null&&--D<=0)return;_.close()})}}function ad(i){return new Bc(i)}var Bc=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:r,["queueingStrategy"]:c="count"}=t,f=ml(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=wr(f),this._getSize=c!=="bytes"?sd:od;let{["highWaterMark"]:_=c==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:b=c==="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:c!=="bytes"?sd:od}),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)}},sd=i=>{var t;return(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0},od=i=>{var t;return(t=i==null?void 0:i.byteLength)!==null&&t!==void 0?t:0};function ra(i,t){let e=new ci,r=null,c=new ReadableStream({cancel(){return V(this,void 0,void 0,function*(){yield e.close()})},start(b){return V(this,void 0,void 0,function*(){yield _(b,r||(r=yield f()))})},pull(b){return V(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:c};function f(){return V(this,void 0,void 0,function*(){return yield(yield ne.from(e)).open(t)})}function _(b,g){return V(this,void 0,void 0,function*(){let T=b.desiredSize,D=null;for(;!(D=yield g.next()).done;)if(b.enqueue(D.value),T!=null&&--T<=0)return;b.close()})}}function na(i,t){let e=new this(i),r=new Ae(e),c=new ReadableStream({cancel(){return V(this,void 0,void 0,function*(){yield r.cancel()})},pull(_){return V(this,void 0,void 0,function*(){yield f(_)})},start(_){return V(this,void 0,void 0,function*(){yield f(_)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:c};function f(_){return V(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 sa(i,t="stream"){return(t==="stream"?Fr:Ar).writeAll(i).toUint8Array(!0)}var qS=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Na),uc),ec),Pa),Ea),tc),Ma),{compareSchemas:jr,compareFields:Mu,compareTypes:Ru});ee.toDOMStream=nd;Pt.throughDOM=ad;ne.throughDOM=ra;or.throughDOM=ra;di.throughDOM=ra;Br.throughDOM=na;Ar.throughDOM=na;Fr.throughDOM=na;function fn(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:fn(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=>oa(e.name,e.type))};case j.Map:{let t=i;return{sqlType:"map",keyType:fn(t.keyType),valueType:fn(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 oa(i,t){let e=fn(t);return e.name=i,e}var aa=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=ne.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 c=new ca(this._bindings,this._conn,r),f=ne.from(c);return console.assert(f.isSync()),console.assert(f.isStream()),f}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 Fc(this._bindings,this._conn,e)}createScalarFunction(t,e,r){this._bindings.createScalarFunction(this._conn,t,e,r)}insertArrowTable(t,e){let r=sa(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)}},ca=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}},Fc=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=ne.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 ca(this.bindings,this.connectionId,e),c=ne.from(r);return console.assert(c.isSync()),console.assert(c.isStream()),c}};function ld(i){return i<=255}function ud(i){return i===256}var hd=new TextEncoder,dd=new TextDecoder("utf-8");function Ac(i,t,e){let r=hd.encode(e),c=i._malloc(r.byteLength),f=i.HEAPU8.subarray(c,c+r.byteLength);f.set(r),i.HEAPF64[(t>>3)+0]=1,i.HEAPF64[(t>>3)+1]=c,i.HEAPF64[(t>>3)+2]=f.byteLength}function kc(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 xc(i,t,e,r){let c=i.HEAPU8.subarray(t,t+r*kc(e));switch(e){case"UINT8":return new Uint8Array(c.buffer,c.byteOffset,r);case"INT8":return new Int8Array(c.buffer,c.byteOffset,r);case"INT32":return new Int32Array(c.buffer,c.byteOffset,r);case"FLOAT":return new Float32Array(c.buffer,c.byteOffset,r);case"DOUBLE":return new Float64Array(c.buffer,c.byteOffset,r);case"VARCHAR":return new Float64Array(c.buffer,c.byteOffset,r);default:return new Array(0)}}function fd(i,t,e){let r=i.HEAPU8.subarray(t,t+e);return new Uint8Array(r.buffer,r.byteOffset,e)}function la(i,t,e){let r=i.HEAPU8.subarray(t,t+e*8);return new Float64Array(r.buffer,r.byteOffset,e)}function pd(i,t,e,r,c,f,_,b){try{let g=i._udfFunctions.get(r);if(!g){Ac(t,e,"Unknown UDF with id: "+r);return}let T=dd.decode(t.HEAPU8.subarray(c,c+f)),D=JSON.parse(T),U=la(t,_,b/8),M=O=>{var R;let W=null;switch(O.validityBuffer!==void 0&&(W=fd(t,U[O.validityBuffer],D.rows)),O.physicalType){case"VARCHAR":{if(O.dataBuffer===null||O.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(O.lengthBuffer===null||O.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let J=xc(t,U[O.dataBuffer],O.physicalType,D.rows),E=[],X=la(t,U[O.lengthBuffer],D.rows);for(let st=0;st<D.rows;++st){if(W!=null&&!W[st]){E.push(null);continue}let C=t.HEAPU8.subarray(J[st],J[st]+X[st]),_t=dd.decode(C);E.push(_t)}return st=>E[st]}case"STRUCT":{let J={},E=[];for(let X=0;X<(((R=O.children)==null?void 0:R.length)||0);++X){let st=O.children[X],C=M(st);E.push(_t=>{J[st.name]=C(_t)})}return W!=null?X=>{if(!W[X])return null;for(let st of E)st(X);return J}:X=>{for(let st of E)st(X);return J}}default:{if(O.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+O.physicalType);let J=xc(t,U[O.dataBuffer],O.physicalType,D.rows);return W!=null?E=>W[E]?J[E]:null:E=>J[E]}}},N=[];for(let O=0;O<D.args.length;++O)N.push(M(D.args[O]));let nt=D.rows*kc(D.ret.physicalType),Et=t._malloc(nt),Wt=xc(t,Et,D.ret.physicalType,D.rows),Vt=t._malloc(D.rows),kt=fd(t,Vt,D.rows);if(Wt.length==0||kt.length==0){Ac(t,e,"Can't create physical arrays for result");return}let Dt=Wt;D.ret.physicalType=="VARCHAR"&&(Dt=new Array(D.rows));let Qt=[];for(let O=0;O<D.args.length;++O)Qt.push(null);for(let O=0;O<D.rows;++O){for(let R=0;R<D.args.length;++R)Qt[R]=N[R](O);let W=g.func(...Qt);Dt[O]=W,kt[O]=W==null?0:1}let te=0;switch(D.ret.physicalType){case"VARCHAR":{let O=new Array(0);te=t._malloc(D.rows*kc("DOUBLE"));let W=la(t,te,D.rows),R=0;for(let st=0;st<D.rows;++st){let C=hd.encode(Dt[st]||"");O.push(C),W[st]=C.length,R+=C.length}let J=t._malloc(R),E=t.HEAPU8.subarray(J,J+R),X=0;for(let st=0;st<D.rows;++st){Wt[st]=X;let C=O[st];E.subarray(X,X+C.length).set(C),X+=C.length}}}let k=3*8,P=t._malloc(k),q=la(t,P,3);q[0]=Et,q[1]=Vt,q[2]=te,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=P,t.HEAPF64[(e>>3)+2]=0}catch(g){Ac(t,e,g.toString())}}function XS(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}var ZS=XS();function Xe(i,t){console.error("FAIL WITH: ".concat(t)),i.ccall("duckdb_web_fail_with",null,["string"],[t])}function xr(i,t,e){let r=i.HEAPU8.subarray(t,t+e),c=new Uint8Array(new ArrayBuffer(r.byteLength));return c.set(r),c}function ht(i,t,e){return ZS(i.HEAPU8.subarray(t,t+e))}function xt(i,t,e,r){let c=i.stackSave(),f=i.stackAlloc(3*8);e.unshift("number"),r.unshift(f),i.ccall(t,null,e,r);let _=i.HEAPF64[(f>>3)+0],b=i.HEAPF64[(f>>3)+1],g=i.HEAPF64[(f>>3)+2];return i.stackRestore(c),[_,b,g]}function Rt(i){i.ccall("duckdb_web_clear_response",null,[],[])}var ua=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 hn=new TextEncoder;var da=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,c]=xt(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(ht(this.mod,r,c));Rt(this.mod)}reset(){let[t,e,r]=xt(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(ht(this.mod,e,r));Rt(this.mod)}getVersion(){let[t,e,r]=xt(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(ht(this.mod,e,r));let c=ht(this.mod,e,r);return Rt(this.mod),c}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let e=hn.encode(t),r=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(r,r+e.length).set(e);let[f,_,b]=xt(this.mod,"duckdb_web_tokenize_buffer",["number","number"],[r,e.length]);if(this.mod._free(r),f!==0)throw new Error(ht(this.mod,_,b));let g=ht(this.mod,_,b);return Rt(this.mod),JSON.parse(g)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new aa(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=hn.encode(e),c=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(c,c+r.length).set(r);let[_,b,g]=xt(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[t,c,r.length]);if(this.mod._free(c),_!==0)throw new Error(ht(this.mod,b,g));let T=xr(this.mod,b,g);return Rt(this.mod),T}startPendingQuery(t,e,r=!1){let c=hn.encode(e),f=this.mod._malloc(c.length);this.mod.HEAPU8.subarray(f,f+c.length).set(c);let[b,g,T]=xt(this.mod,"duckdb_web_pending_query_start_buffer",["number","number","number","boolean"],[t,f,c.length,r]);if(this.mod._free(f),b!==0)throw new Error(ht(this.mod,g,T));if(g==0)return null;let D=xr(this.mod,g,T);return Rt(this.mod),D}pollPendingQuery(t){let[e,r,c]=xt(this.mod,"duckdb_web_pending_query_poll",["number"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));if(r==0)return null;let f=xr(this.mod,r,c);return Rt(this.mod),f}cancelPendingQuery(t){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[t])}fetchQueryResults(t){let[e,r,c]=xt(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(ud(e))return Rt(this.mod),null;if(!ld(e))throw new Error("Unexpected StatusCode from duckdb_web_query_fetch_results ("+e+") and with self reported error as"+ht(this.mod,r,c));if(e!==0)throw new Error(ht(this.mod,r,c));let f=xr(this.mod,r,c);return Rt(this.mod),f}getTableNames(t,e){let r=hn.encode(e),c=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(c,c+r.length).set(r);let[_,b,g]=xt(this.mod,"duckdb_web_get_tablenames_buffer",["number","number","number"],[t,c,r.length]);if(this.mod._free(c),_!==0)throw new Error(ht(this.mod,b,g));let T=ht(this.mod,b,g);return Rt(this.mod),JSON.parse(T)}createScalarFunction(t,e,r,c){let f={functionId:this._nextUDFId,name:e,returnType:fn(r)},_={functionId:f.functionId,connectionId:t,name:e,returnType:r,func:c};this._nextUDFId+=1;let[b,g,T]=xt(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(f)]);if(b!==0)throw new Error(ht(this.mod,g,T));if(Rt(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(_.functionId,_),this.pthread)for(let D of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])D.postMessage({cmd:"registerUDFFunction",udf:_})}createPrepared(t,e){let r=hn.encode(e),c=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(c,c+r.length).set(r);let[_,b,g]=xt(this.mod,"duckdb_web_prepared_create_buffer",["number","number","number"],[t,c,r.length]);if(this.mod._free(c),_!==0)throw new Error(ht(this.mod,b,g));return Rt(this.mod),b}closePrepared(t,e){let[r,c,f]=xt(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(r!==0)throw new Error(ht(this.mod,c,f));Rt(this.mod)}runPrepared(t,e,r){let[c,f,_]=xt(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(r)]);if(c!==0)throw new Error(ht(this.mod,f,_));let b=xr(this.mod,f,_);return Rt(this.mod),b}sendPrepared(t,e,r){let[c,f,_]=xt(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(r)]);if(c!==0)throw new Error(ht(this.mod,f,_));let b=xr(this.mod,f,_);return Rt(this.mod),b}insertArrowFromIPCStream(t,e,r){if(e.length==0)return;let c=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(c,c+e.length).set(e);let _=r?JSON.stringify(r):"",[b,g,T]=xt(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,c,e.length,_]);if(this.mod._free(c),b!==0)throw new Error(ht(this.mod,g,T))}insertCSVFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let T in r.columns)r.columnsFlat.push(oa(T,r.columns[T]))}let c={...r};c.columns=c.columnsFlat,delete c.columnsFlat;let f=JSON.stringify(c),[_,b,g]=xt(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,f]);if(_!==0)throw new Error(ht(this.mod,b,g))}insertJSONFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let T in r.columns)r.columnsFlat.push(oa(T,r.columns[T]))}let c={...r};c.columns=c.columnsFlat,delete c.columnsFlat;let f=JSON.stringify(c),[_,b,g]=xt(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,f]);if(_!==0)throw new Error(ht(this.mod,b,g))}globFiles(t){let[e,r,c]=xt(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));let f=ht(this.mod,r,c);Rt(this.mod);let _=JSON.parse(f);return _==null?[]:_}registerFileURL(t,e,r,c=!1){e===void 0&&(e=t);let[f,_,b]=xt(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[t,e,r,c]);if(f!==0)throw new Error(ht(this.mod,_,b));Rt(this.mod)}registerFileText(t,e){let r=hn.encode(e);this.registerFileBuffer(t,r)}registerFileBuffer(t,e){let r=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(r,r+e.length).set(e);let[f,_,b]=xt(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,r,e.length]);if(f!==0)throw new Error(ht(this.mod,_,b));Rt(this.mod)}async prepareFileHandle(t,e){if(e===3&&this._runtime.prepareFileHandles){let r=await this._runtime.prepareFileHandles([t],3);for(let c of r){let{handle:f,path:_,fromCached:b}=c;!b&&await this.registerFileHandleAsync(_,f,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 c of r){let{handle:f,path:_,fromCached:b}=c;!b&&await this.registerFileHandleAsync(_,f,3,!0)}return}throw new Error("prepareDBFileHandle: unsupported protocol ".concat(e))}async prepareFileHandleAsync(t,e,r,c){if(r===3&&!(e instanceof FileSystemSyncAccessHandle)){if(e instanceof FileSystemFileHandle){let f=e;try{e=await f.createSyncAccessHandle()}catch(_){throw new Error(_.message+":"+t)}}else if(t!=null)try{e=await(await(await navigator.storage.getDirectory()).getFileHandle(t)).createSyncAccessHandle()}catch(f){throw new Error(f.message+":"+t)}}return e}async registerFileHandleAsync(t,e,r,c){let f=await this.prepareFileHandleAsync(t,e,r,c);this.registerFileHandle(t,f,r,c)}registerFileHandle(t,e,r,c){var g;let[f,_,b]=xt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[t,t,r,c]);if(f!==0)throw new Error(ht(this.mod,_,b));/*PATCH_C1*/if(t.startsWith("opfs://")){let _alt="opfs:/"+t.slice(7);xt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[_alt,_alt,r,c])}if(Rt(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),t.startsWith("opfs://")&&globalThis.DUCKDB_RUNTIME._files.set("opfs:/"+t.slice(7),e),(g=globalThis.DUCKDB_RUNTIME._preparedHandles)!=null&&g[t]&&delete globalThis.DUCKDB_RUNTIME._preparedHandles[t],this.pthread){/*PATCH_D*/try{for(let T of this.pthread.runningWorkers)T.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e})}catch(_e){};for(let T of this.pthread.unusedWorkers)T.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,r,c]=xt(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));Rt(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,T=this.mod._malloc(g);if(!T)throw new Error("Failed to allocate memory for string: ".concat(b));this.mod.stringToUTF8(b,T,g),e.push(T)}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[c,f,_]=xt(this.mod,"duckdb_web_fs_drop_files",["number","number"],[r,e.length]);if(c!==0)throw new Error(ht(this.mod,f,_));Rt(this.mod)}finally{for(let c of e)this.mod._free(c);r>0&&this.mod._free(r)}}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[r,c,f]=xt(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(r!==0)throw new Error(ht(this.mod,c,f));Rt(this.mod)}copyFileToBuffer(t){let[e,r,c]=xt(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));let f=this.mod.HEAPU8.subarray(r,r+c),_=new Uint8Array(f.length);return _.set(f),Rt(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,c,f]=xt(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(r!==0)throw new Error(ht(this.mod,c,f))}exportFileStatistics(t){let[e,r,c]=xt(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));return new ua(this.mod.HEAPU8.subarray(r,r+c))}};var fa=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;e!=null&&e.startsWith("opfs://")&&(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,c)=>c)},[]);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":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 gd=_l(vd());var ha=class extends da{constructor(t,e,r,c){super(t,e),this.mainModuleURL=r,this.pthreadWorkerURL=c}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 f=(async()=>{var nt;let _=new Request(this.mainModuleURL),b=await fetch(_),g=b.headers.get("content-length"),T=g&&parseInt(g,10)||0,D=new Date,U={startedAt:D,updatedAt:D,bytesTotal:T||0,bytesLoaded:0},M={transform(Et,Wt){U.bytesLoaded+=Et.byteLength;let Vt=new Date;if(Vt.getTime()-U.updatedAt.getTime()<20){U.updatedAt=Vt,Wt.enqueue(Et);return}for(let kt of r)kt(U);Wt.enqueue(Et)}},N=new TransformStream(M);return new Response((nt=b.body)==null?void 0:nt.pipeThrough(N),b)})();WebAssembly.instantiateStreaming(f,t).then(_=>{e(_.instance,_.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let c=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(c),t).then(f=>{e(f.instance,f.module)})}else if(typeof XMLHttpRequest=="function"){let c=new XMLHttpRequest,f=this.mainModuleURL,_=new Date,b={startedAt:_,updatedAt:_,bytesTotal:0,bytesLoaded:0};c.open("GET",f),c.responseType="arraybuffer",c.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())},c.onprogress=g=>{b.bytesTotal=g.total,b.bytesLoaded=g.loaded;let T=new Date;if(T.getTime()-b.updatedAt.getTime()<20){b.updatedAt=T;return}for(let D of r)D(b)},c.onload=()=>{WebAssembly.instantiate(c.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)})},c.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let f=new Request(this.mainModuleURL),b=await(await fetch(f)).arrayBuffer();WebAssembly.instantiate(b,t).then(g=>{e(g.instance,g.module)})})();return[]}};var pa=class extends ha{constructor(t,e,r,c=null){super(t,e,r,c)}instantiateImpl(t){return(0,gd.default)({...t,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var ar=_l(Id()),Td=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 t1(i,t,e){var f,_,b,g;let r=jd(t),c=r.path;if(Dd(i)){let T="";if(i!=null&&i.endpoint){let D=new URL(i.endpoint);D.pathname!=="/"&&(T=D.pathname)}c="".concat(T,"/").concat(r.bucket).concat(c)}return{url:c,query:"",host:Td(i,t,r.bucket),region:(f=i==null?void 0:i.region)!=null?f:"",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 e1(i,t=!1){let e="0123456789ABCDEF",r="";for(let c=0;c<i.length;c++){let f=i[c];f>="A"&&f<="Z"||f>="a"&&f<="z"||f>="0"&&f<="9"||f=="_"||f=="-"||f=="~"||f=="."?r+=f:f=="/"?t?r+="%2F":r+=f:(r+="%",r+=e[f.charCodeAt(0)>>4],r+=e[f.charCodeAt(0)&15])}return r}function i1(i,t=null){var nt;let e=(nt=t==null?void 0:t.contentHash)!=null?nt:"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 c="";t!=null&&t.contentType&&(c+="content-type;"),c+="host;x-amz-content-sha256;x-amz-date",i.sessionToken&&(c+=";x-amz-security-token");let f=i.method+"\n"+e1(i.url)+"\n"+i.query;t!=null&&t.contentType&&(f+="\ncontent-type:"+(t==null?void 0:t.contentType)),f+="\nhost:"+i.host+"\nx-amz-content-sha256:"+e+"\nx-amz-date:"+i.datetimeNow,i.sessionToken&&i.sessionToken.length>0&&(f+="\nx-amz-security-token:"+i.sessionToken),f+="\n\n"+c+"\n"+e;let _=(0,ar.sha256)(f),b="AWS4-HMAC-SHA256\n"+i.datetimeNow+"\n"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request\n"+_,g="AWS4"+i.secretAccessKey,T=ar.sha256.hmac.arrayBuffer(g,i.dateNow),D=ar.sha256.hmac.arrayBuffer(T,i.region),U=ar.sha256.hmac.arrayBuffer(D,i.service),M=ar.sha256.hmac.arrayBuffer(U,"aws4_request"),N=ar.sha256.hmac(M,b);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+i.accessKeyId+"/"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request, SignedHeaders="+c+", Signature="+N),r}var r1=function(i,t,e,r=null,c=null){let f=t1(i,t,e),_={contentType:r,contentHash:c?ar.sha256.hex(c):null};return i1(f,_)};function Ze(i,t,e,r,c=null,f=null){(t!=null&&t.accessKeyId||t!=null&&t.sessionToken)&&(r1(t,e,r,c,f).forEach((b,g)=>{i.setRequestHeader(g,b)}),c&&i.setRequestHeader("content-type",c))}function jd(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 Dd(i){var t;return!!((t=i==null?void 0:i.endpoint)!=null&&t.startsWith("http"))}function Qe(i,t){let e=jd(t);return Dd(i)?"".concat(i==null?void 0:i.endpoint,"/").concat(e.bucket)+e.path:"https://"+Td(i,t,e.bucket)+e.path}var n1=7,Bd=/\/|\\/,lt={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,_preparedHandles:{},_opfsRoot:null,getFileInfo(i,t){try{let e=lt._fileInfoCache.get(t),[r,c,f]=xt(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(f===0)return e;let _=ht(i,c,f);Rt(i);try{let b=JSON.parse(_);if(b==null)return null;let g={...b,blob:null};return lt._fileInfoCache.set(t,g),!lt._files.has(g.fileName)&&(lt._preparedHandles[g.fileName]?(lt._files.set(g.fileName,lt._preparedHandles[g.fileName]),delete lt._preparedHandles[g.fileName]):g.fileName.startsWith("opfs:/")&&!g.fileName.startsWith("opfs://")&&lt._preparedHandles["opfs://"+g.fileName.slice(6)]&&(lt._files.set(g.fileName,lt._preparedHandles["opfs://"+g.fileName.slice(6)]),delete lt._preparedHandles["opfs://"+g.fileName.slice(6)])),g}catch(b){return console.warn(b),null}}catch(e){return console.log(e),null}},getGlobalFileInfo(i){var t;try{let[e,r,c]=xt(i,"duckdb_web_get_global_file_info",["number"],[((t=lt._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(c===0)return lt._globalFileInfo;let f=ht(i,r,c);Rt(i);let _=JSON.parse(f);return _==null?null:(lt._globalFileInfo={..._,blob:null},lt._globalFileInfo)}catch(e){return console.log(e),null}},async assignOPFSRoot(){lt._opfsRoot||(lt._opfsRoot=await navigator.storage.getDirectory())},async prepareFileHandles(i,t){if(t===3){await lt.assignOPFSRoot();let e=async c=>{if(lt._files.has(c))return{path:c,handle:lt._files.get(c),fromCached:!0};let _=lt._opfsRoot,b=c.slice(n1),g=b;if(Bd.test(b)){let D=b.split(Bd);if(D.length===0)throw new Error("Invalid path ".concat(b));if(g=D[D.length-1],!g)throw new Error("Invalid path ".concat(b,". File Not Found."));D.pop();for(let U of D)_=await _.getDirectoryHandle(U,{create:!0})}let T=await _.getFileHandle(g,{create:!1}).catch(D=>{if((D==null?void 0:D.name)==="NotFoundError")return console.debug("File ".concat(c," does not exists yet, creating...")),_.getFileHandle(g,{create:!0});throw D});try{let D=await T.createSyncAccessHandle();return lt._preparedHandles[c]=D,/*PATCH_A*/c.startsWith("opfs://")&&(lt._preparedHandles["opfs:/"+c.slice(7)]=D),{path:c,handle:D,fromCached:!1}}catch(D){throw new Error(D.message+":"+name)}},r=[];for(let c of i){let f=await e(c);r.push(f)}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,c,f,_,b,g;try{lt._fileInfoCache.delete(t);let T=lt.getFileInfo(i,t);switch(T==null?void 0:T.dataProtocol){case 4:case 5:{if(e&1&&e&2)throw new Error("Opening file ".concat(T.fileName," failed: cannot open file with both read and write flags set"));if(e&32)throw new Error("Opening file ".concat(T.fileName," failed: appending to HTTP/S3 files is not supported"));if(e&2){let M=new XMLHttpRequest;if(T.dataProtocol==5?(M.open("HEAD",Qe(T.s3Config,T.dataUrl),!1),Ze(M,T.s3Config,T.dataUrl,"HEAD")):M.open("HEAD",T.dataUrl,!1),M.send(null),M.status!=200&&M.status!=404)throw new Error("Opening file ".concat(T.fileName," failed: Unexpected return status from server (").concat(M.status,")"));if(M.status==404&&!(e&8||e&16))throw new Error("Opening file ".concat(T.fileName," failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag."));let N=i._malloc(1),nt=new Uint8Array;i.HEAPU8.set(nt,N);let Et=i._malloc(3*8);return i.HEAPF64[(Et>>3)+0]=1,i.HEAPF64[(Et>>3)+1]=N,i.HEAPF64[(Et>>3)+2]=new Date().getTime()/1e3,Et}else if(!(e&1))throw new Error("Opening file ".concat(T.fileName," failed: unsupported file flags: ").concat(e));let D=null,U=null;if(!T.forceFullHttpReads&&(T.reliableHeadRequests||!T.allowFullHttpReads))try{let M=new XMLHttpRequest;T.dataProtocol==5?(M.open("HEAD",Qe(T.s3Config,T.dataUrl),!1),Ze(M,T.s3Config,T.dataUrl,"HEAD")):M.open("HEAD",T.dataUrl,!1),M.setRequestHeader("Range","bytes=0-"),M.send(null),D=null;try{D=M.getResponseHeader("Content-Length")}catch(N){console.warn("Failed to get Content-Length on request")}if(D!==null&&M.status==206){let N=i._malloc(24);i.HEAPF64[(N>>3)+0]=+D,i.HEAPF64[(N>>3)+1]=0;let nt=0;try{nt=new Date((r=M.getResponseHeader("Last-Modified"))!=null?r:"").getTime()/1e3}catch(Et){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(N>>3)+2]=+nt,N}}catch(M){U=M,console.warn("HEAD request with range header failed: ".concat(M))}if(T.allowFullHttpReads){if(!T.forceFullHttpReads){let N=new XMLHttpRequest;T.dataProtocol==5?(N.open("GET",Qe(T.s3Config,T.dataUrl),!1),Ze(N,T.s3Config,T.dataUrl,"GET")):N.open("GET",T.dataUrl,!1),N.responseType="arraybuffer",N.setRequestHeader("Range","bytes=0-0"),N.send(null);let nt=null;try{nt=N.getResponseHeader("Content-Length")}catch(kt){console.warn("Failed to get Content-Length on request")}let Et=nt==null?void 0:nt.split("/")[1],Wt=nt,Vt=null;if(Et!==void 0)Vt=Et;else if(!T.reliableHeadRequests){let kt=new XMLHttpRequest;T.dataProtocol==5?(kt.open("HEAD",Qe(T.s3Config,T.dataUrl),!1),Ze(kt,T.s3Config,T.dataUrl,"HEAD")):kt.open("HEAD",T.dataUrl,!1),kt.setRequestHeader("Range","bytes=0-"),kt.send(null),D=null;try{D=kt.getResponseHeader("Content-Length")}catch(Dt){console.warn("Failed to get Content-Length on request")}D!==null&&+D>1&&(Vt=D)}if(N.status==206&&Wt!==null&&+Wt==1&&Vt!==null){let kt=i._malloc(24);i.HEAPF64[(kt>>3)+0]=+Vt,i.HEAPF64[(kt>>3)+1]=0;let Dt=0;try{Dt=new Date((c=N.getResponseHeader("Last-Modified"))!=null?c:"").getTime()/1e3}catch(Qt){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(kt>>3)+2]=+Dt,kt}if(N.status==200&&Wt!==null&&D!==null&&+Wt==+D){console.warn("fall back to full HTTP read for: ".concat(T.dataUrl));let kt=i._malloc(N.response.byteLength),Dt=new Uint8Array(N.response,0,N.response.byteLength);i.HEAPU8.set(Dt,kt);let Qt=i._malloc(3*8);i.HEAPF64[(Qt>>3)+0]=N.response.byteLength,i.HEAPF64[(Qt>>3)+1]=kt;let te=0;try{te=new Date((f=N.getResponseHeader("Last-Modified"))!=null?f:"").getTime()/1e3}catch(k){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(Qt>>3)+2]=+te,Qt}console.warn("falling back to full HTTP read for: ".concat(T.dataUrl))}let M=new XMLHttpRequest;if(T.dataProtocol==5?(M.open("GET",Qe(T.s3Config,T.dataUrl),!1),Ze(M,T.s3Config,T.dataUrl,"GET")):M.open("GET",T.dataUrl,!1),M.responseType="arraybuffer",M.send(null),M.status==200){let N=i._malloc(M.response.byteLength),nt=new Uint8Array(M.response,0,M.response.byteLength);i.HEAPU8.set(nt,N);let Et=i._malloc(3*8);i.HEAPF64[(Et>>3)+0]=M.response.byteLength,i.HEAPF64[(Et>>3)+1]=N;let Wt=0;try{Wt=new Date((_=M.getResponseHeader("Last-Modified"))!=null?_:"").getTime()/1e3}catch(Vt){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(Et>>3)+2]=+Wt,Et}}if(U!=null)throw new Error("Reading file ".concat(T.fileName," failed with error: ").concat(U));return 0}case 2:{let D=(b=lt._files)==null?void 0:b.get(T.fileName);if(D){let N=i._malloc(24);return i.HEAPF64[(N>>3)+0]=D.size,i.HEAPF64[(N>>3)+1]=0,i.HEAPF64[(N>>3)+2]=0,N}if(e&128)return 0;console.warn("Buffering missing file: ".concat(T.fileName));let U=i._malloc(3*8),M=i._malloc(1);return i.HEAPF64[(U>>3)+0]=1,i.HEAPF64[(U>>3)+1]=M,i.HEAPF64[(U>>3)+2]=0,U}case 3:{let D=(g=lt._files)==null?void 0:g.get(T.fileName);if(!D)throw new Error("No OPFS access handle registered with name: ".concat(T.fileName));e&16&&D.truncate(0);let U=i._malloc(3*8),M=D.getSize();return i.HEAPF64[(U>>3)+0]=M,i.HEAPF64[(U>>3)+1]=0,i.HEAPF64[(U>>3)+2]=0,U}}}catch(T){console.error(T.toString()),Xe(i,T.toString())}return 0},glob:(i,t,e)=>{var r;try{let c=ht(i,t,e);if(c.startsWith("http")||c.startsWith("s3://")){let f=new XMLHttpRequest;if(c.startsWith("s3://")){let _=lt.getGlobalFileInfo(i);f.open("HEAD",Qe(_==null?void 0:_.s3Config,c),!1),Ze(f,_==null?void 0:_.s3Config,c,"HEAD")}else f.open("HEAD",c,!1);if(f.send(null),f.status!=200&&f.status!==206){if(!((r=lt.getGlobalFileInfo(i))!=null&&r.allowFullHttpReads))return console.log("HEAD request failed: ".concat(c,", with full http reads are disabled")),0;let _=new XMLHttpRequest;if(c.startsWith("s3://")){let g=lt.getGlobalFileInfo(i);_.open("GET",Qe(g==null?void 0:g.s3Config,c),!1),Ze(_,g==null?void 0:g.s3Config,c,"HEAD")}else _.open("GET",c,!1);if(_.setRequestHeader("Range","bytes=0-0"),_.send(null),_.status!=200&&_.status!==206)return console.log("HEAD and GET requests failed: ".concat(c)),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(c," did not return a partial response: ").concat(_.status,' "').concat(_.statusText,'"'))}i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[c])}else for(let[f]of lt._files.entries()||[])f.startsWith(c)&&i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[f])}catch(c){return console.log(c),Xe(i,c.toString()),0}},checkFile:(i,t,e)=>{try{let r=ht(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let c=new XMLHttpRequest;if(r.startsWith("s3://")){let f=lt.getGlobalFileInfo(i);c.open("HEAD",Qe(f==null?void 0:f.s3Config,r),!1),Ze(c,f==null?void 0:f.s3Config,r,"HEAD")}else c.open("HEAD",r,!1);return c.send(null),c.status==206||c.status==200}else return lt._files.has(r)}catch(r){return console.log(r),!1}return!1},syncFile:(i,t)=>{},closeFile:(i,t)=>{var r;let e=lt.getFileInfo(i,t);lt._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 c=(r=lt._files)==null?void 0:r.get(e.fileName);if(!c)throw new Error("No OPFS access handle registered with name: ".concat(e.fileName));return c.flush()}}}catch(c){console.log(c),Xe(i,c.toString())}},dropFile:(i,t,e)=>{var f;let r=ht(i,t,e),c=(f=lt._files)==null?void 0:f.get(r);if(c){if(lt._files.delete(r),c instanceof FileSystemSyncAccessHandle)try{c.flush(),c.close()}catch(_){throw new Error("Cannot drop file with name: ".concat(r))}c instanceof Blob}},truncateFile:(i,t,e)=>{var c;let r=lt.getFileInfo(i,t);switch(r==null?void 0:r.dataProtocol){case 4:Xe(i,"Cannot truncate a http file");return;case 5:Xe(i,"Cannot truncate an s3 file");return;case 0:case 1:case 2:Xe(i,"truncateFile not implemented");return;case 3:{let f=(c=lt._files)==null?void 0:c.get(r.fileName);if(!f)throw new Error("No OPFS access handle registered with name: ".concat(r.fileName));return f.truncate(e)}}return 0},readFile(i,t,e,r,c){var f;if(r==0)return 0;try{let _=lt.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",Qe(_==null?void 0:_.s3Config,_.dataUrl),!1),Ze(b,_==null?void 0:_.s3Config,_.dataUrl,"GET")):b.open("GET",_.dataUrl,!1),b.responseType="arraybuffer",b.setRequestHeader("Range","bytes=".concat(c,"-").concat(c+r-1)),b.send(null),b.status==206||b.status==200&&r==b.response.byteLength&&c==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,c,Math.min(b.response.byteLength-c,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=(f=lt._files)==null?void 0:f.get(_.fileName);if(!b)throw new Error("No HTML5 file registered with name: ".concat(_.fileName));let g=b.slice(c,c+r),T=new Uint8Array(new FileReaderSync().readAsArrayBuffer(g));return i.HEAPU8.set(T,e),T.byteLength}case 3:{let b=lt._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:c})}}return 0}catch(_){return console.log(_),Xe(i,_.toString()),0}},writeFile:(i,t,e,r,c)=>{var _;let f=lt.getFileInfo(i,t);switch(f==null?void 0:f.dataProtocol){case 4:return Xe(i,"Cannot write to HTTP file"),0;case 5:{let b=i.HEAPU8.subarray(e,e+r),g=new XMLHttpRequest;return g.open("PUT",Qe(f==null?void 0:f.s3Config,f.dataUrl),!1),Ze(g,f==null?void 0:f.s3Config,f.dataUrl,"PUT","",b),g.send(b),g.status!==200?(Xe(i,"Failed writing file: HTTP "+g.status),0):r}case 2:return Xe(i,"cannot write using the html5 file reader api"),0;case 3:{let b=(_=lt._files)==null?void 0:_.get(f.fileName);if(!b)throw new Error("No OPFS access handle registered with name: ".concat(f.fileName));let g=i.HEAPU8.subarray(e,e+r);return b.write(g,{at:c})}}return 0},getLastFileModificationTime:(i,t)=>{var r;let e=lt.getFileInfo(i,t);switch(e==null?void 0:e.dataProtocol){case 2:{if(!((r=lt._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,c)=>{var g,T;let f=ht(i,t,e),_=ht(i,r,c),b=(g=lt._files)==null?void 0:g.get(f);b!==void 0&&(lt._files.delete(b),lt._files.set(_,b));for(let[D,U]of((T=lt._fileInfoCache)==null?void 0:T.entries())||[])if(U.dataUrl==f){lt._fileInfoCache.delete(D);break}return!0},removeFile:(i,t,e)=>{},callScalarUDF:(i,t,e,r,c,f,_)=>{pd(lt,i,t,e,r,c,f,_)}};var Oc=class extends fa{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,r){return await new pa(this,lt,t,e).instantiate(r)}};function Fd(){let i=new Oc;globalThis.onmessage=async t=>{await i.onMessage(t.data)}}Fd();return Ag(s1);})();
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
2
  /*! Bundled license information:
3
3
 
4
4
  js-sha256/src/sha256.js: