@duckdb/duckdb-wasm 1.14.4 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/duckdb-browser-blocking.cjs +6 -6
  2. package/dist/duckdb-browser-blocking.cjs.map +4 -4
  3. package/dist/duckdb-browser-blocking.mjs +6 -6
  4. package/dist/duckdb-browser-blocking.mjs.map +4 -4
  5. package/dist/duckdb-browser-coi.pthread.worker.js +8 -8
  6. package/dist/duckdb-browser-coi.pthread.worker.js.map +4 -4
  7. package/dist/duckdb-browser-coi.worker.js +9 -23
  8. package/dist/duckdb-browser-coi.worker.js.map +4 -4
  9. package/dist/duckdb-browser-eh.worker.js +8 -22
  10. package/dist/duckdb-browser-eh.worker.js.map +4 -4
  11. package/dist/duckdb-browser-mvp.worker.js +8 -22
  12. package/dist/duckdb-browser-mvp.worker.js.map +4 -4
  13. package/dist/duckdb-browser.cjs +1 -1
  14. package/dist/duckdb-browser.cjs.map +4 -4
  15. package/dist/duckdb-browser.mjs +1 -1
  16. package/dist/duckdb-browser.mjs.map +4 -4
  17. package/dist/duckdb-coi.wasm +0 -0
  18. package/dist/duckdb-eh.wasm +0 -0
  19. package/dist/duckdb-mvp.wasm +0 -0
  20. package/dist/duckdb-node-blocking.cjs +4 -4
  21. package/dist/duckdb-node-blocking.cjs.map +4 -4
  22. package/dist/duckdb-node-eh.worker.cjs +4 -4
  23. package/dist/duckdb-node-eh.worker.cjs.map +4 -4
  24. package/dist/duckdb-node-mvp.worker.cjs +3 -3
  25. package/dist/duckdb-node-mvp.worker.cjs.map +4 -4
  26. package/dist/duckdb-node.cjs +1 -1
  27. package/dist/duckdb-node.cjs.map +4 -4
  28. package/dist/img/duckdb_version_badge.svg +1 -1
  29. package/dist/tests-browser.js +1551 -1039
  30. package/dist/tests-browser.js.map +4 -4
  31. package/dist/tests-node.cjs +1497 -1040
  32. package/dist/tests-node.cjs.map +4 -4
  33. package/dist/types/src/bindings/bindings_base.d.ts +11 -2
  34. package/dist/types/src/bindings/bindings_interface.d.ts +3 -1
  35. package/dist/types/src/bindings/config.d.ts +4 -0
  36. package/dist/types/src/bindings/connection.d.ts +3 -1
  37. package/dist/types/src/bindings/runtime.d.ts +1 -1
  38. package/dist/types/src/parallel/async_bindings.d.ts +6 -2
  39. package/dist/types/src/parallel/async_bindings_interface.d.ts +3 -1
  40. package/dist/types/src/parallel/async_connection.d.ts +2 -0
  41. package/dist/types/src/parallel/worker_request.d.ts +9 -6
  42. package/package.json +17 -17
@@ -1,15 +1,15 @@
1
- var duckdb=(()=>{var X0=Object.create;var _n=Object.defineProperty,G0=Object.defineProperties,K0=Object.getOwnPropertyDescriptor,J0=Object.getOwnPropertyDescriptors,q0=Object.getOwnPropertyNames,yf=Object.getOwnPropertySymbols,Z0=Object.getPrototypeOf,mf=Object.prototype.hasOwnProperty,Q0=Object.prototype.propertyIsEnumerable;var _f=(i,t,e)=>t in i?_n(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Xi=(i,t)=>{for(var e in t||(t={}))mf.call(t,e)&&_f(i,e,t[e]);if(yf)for(var e of yf(t))Q0.call(t,e)&&_f(i,e,t[e]);return i},mn=(i,t)=>G0(i,J0(t));var tw=(i=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(i,{get:(t,e)=>(typeof require!="undefined"?require:t)[e]}):i)(function(i){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')});var gs=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),_r=(i,t)=>{for(var e in t)_n(i,e,{get:t[e],enumerable:!0})},bf=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of q0(t))!mf.call(i,n)&&n!==e&&_n(i,n,{get:()=>t[n],enumerable:!(r=K0(t,n))||r.enumerable});return i};var vf=(i,t,e)=>(e=i!=null?X0(Z0(i)):{},bf(t||!i||!i.__esModule?_n(e,"default",{value:i,enumerable:!0}):e,i)),ew=i=>bf(_n({},"__esModule",{value:!0}),i);var Pf=gs((JS,Ss)=>{var gf,wf,jf,Sf,If,Af,xf,Ff,Cf,ws,pa,Bf,Tf,Df,Or,Ef,kf,Of,Mf,Rf,Uf,Nf,Lf,js;(function(i){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){i(e(t,e(r)))}):typeof Ss=="object"&&typeof Ss.exports=="object"?i(e(t,e(Ss.exports))):i(e(t));function e(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,c){return r[o]=n?n(o,c):c}}})(function(i){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])};gf=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function o(){this.constructor=r}r.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)},wf=Object.assign||function(r){for(var n,o=1,c=arguments.length;o<c;o++){n=arguments[o];for(var h in n)Object.prototype.hasOwnProperty.call(n,h)&&(r[h]=n[h])}return r},jf=function(r,n){var o={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&n.indexOf(c)<0&&(o[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var h=0,c=Object.getOwnPropertySymbols(r);h<c.length;h++)n.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(r,c[h])&&(o[c[h]]=r[c[h]]);return o},Sf=function(r,n,o,c){var h=arguments.length,m=h<3?n:c===null?c=Object.getOwnPropertyDescriptor(n,o):c,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,n,o,c);else for(var x=r.length-1;x>=0;x--)(g=r[x])&&(m=(h<3?g(m):h>3?g(n,o,m):g(n,o))||m);return h>3&&m&&Object.defineProperty(n,o,m),m},If=function(r,n){return function(o,c){n(o,c,r)}},Af=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},xf=function(r,n,o,c){function h(m){return m instanceof o?m:new o(function(g){g(m)})}return new(o||(o=Promise))(function(m,g){function x(k){try{C(c.next(k))}catch(lt){g(lt)}}function T(k){try{C(c.throw(k))}catch(lt){g(lt)}}function C(k){k.done?m(k.value):h(k.value).then(x,T)}C((c=c.apply(r,n||[])).next())})},Ff=function(r,n){var o={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},c,h,m,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(C){return function(k){return T([C,k])}}function T(C){if(c)throw new TypeError("Generator is already executing.");for(;o;)try{if(c=1,h&&(m=C[0]&2?h.return:C[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,C[1])).done)return m;switch(h=0,m&&(C=[C[0]&2,m.value]),C[0]){case 0:case 1:m=C;break;case 4:return o.label++,{value:C[1],done:!1};case 5:o.label++,h=C[1],C=[0];continue;case 7:C=o.ops.pop(),o.trys.pop();continue;default:if(m=o.trys,!(m=m.length>0&&m[m.length-1])&&(C[0]===6||C[0]===2)){o=0;continue}if(C[0]===3&&(!m||C[1]>m[0]&&C[1]<m[3])){o.label=C[1];break}if(C[0]===6&&o.label<m[1]){o.label=m[1],m=C;break}if(m&&o.label<m[2]){o.label=m[2],o.ops.push(C);break}m[2]&&o.ops.pop(),o.trys.pop();continue}C=n.call(r,o)}catch(k){C=[6,k],h=0}finally{c=m=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}},Cf=function(r,n){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&js(n,r,o)},js=Object.create?function(r,n,o,c){c===void 0&&(c=o),Object.defineProperty(r,c,{enumerable:!0,get:function(){return n[o]}})}:function(r,n,o,c){c===void 0&&(c=o),r[c]=n[o]},ws=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,o=n&&r[n],c=0;if(o)return o.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&c>=r.length&&(r=void 0),{value:r&&r[c++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},pa=function(r,n){var o=typeof Symbol=="function"&&r[Symbol.iterator];if(!o)return r;var c=o.call(r),h,m=[],g;try{for(;(n===void 0||n-- >0)&&!(h=c.next()).done;)m.push(h.value)}catch(x){g={error:x}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(g)throw g.error}}return m},Bf=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(pa(arguments[n]));return r},Tf=function(){for(var r=0,n=0,o=arguments.length;n<o;n++)r+=arguments[n].length;for(var c=Array(r),h=0,n=0;n<o;n++)for(var m=arguments[n],g=0,x=m.length;g<x;g++,h++)c[h]=m[g];return c},Df=function(r,n,o){if(o||arguments.length===2)for(var c=0,h=n.length,m;c<h;c++)(m||!(c in n))&&(m||(m=Array.prototype.slice.call(n,0,c)),m[c]=n[c]);return r.concat(m||Array.prototype.slice.call(n))},Or=function(r){return this instanceof Or?(this.v=r,this):new Or(r)},Ef=function(r,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=o.apply(r,n||[]),h,m=[];return h={},g("next"),g("throw"),g("return"),h[Symbol.asyncIterator]=function(){return this},h;function g(ct){c[ct]&&(h[ct]=function(mt){return new Promise(function(kt,ae){m.push([ct,mt,kt,ae])>1||x(ct,mt)})})}function x(ct,mt){try{T(c[ct](mt))}catch(kt){lt(m[0][3],kt)}}function T(ct){ct.value instanceof Or?Promise.resolve(ct.value.v).then(C,k):lt(m[0][2],ct)}function C(ct){x("next",ct)}function k(ct){x("throw",ct)}function lt(ct,mt){ct(mt),m.shift(),m.length&&x(m[0][0],m[0][1])}},kf=function(r){var n,o;return n={},c("next"),c("throw",function(h){throw h}),c("return"),n[Symbol.iterator]=function(){return this},n;function c(h,m){n[h]=r[h]?function(g){return(o=!o)?{value:Or(r[h](g)),done:h==="return"}:m?m(g):g}:m}},Of=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],o;return n?n.call(r):(r=typeof ws=="function"?ws(r):r[Symbol.iterator](),o={},c("next"),c("throw"),c("return"),o[Symbol.asyncIterator]=function(){return this},o);function c(m){o[m]=r[m]&&function(g){return new Promise(function(x,T){g=r[m](g),h(x,T,g.done,g.value)})}}function h(m,g,x,T){Promise.resolve(T).then(function(C){m({value:C,done:x})},g)}},Mf=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var e=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Rf=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&js(n,r,o);return e(n,r),n},Uf=function(r){return r&&r.__esModule?r:{default:r}},Nf=function(r,n,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!c:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(r):c?c.value:n.get(r)},Lf=function(r,n,o,c,h){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!h)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!h:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?h.call(r,o):h?h.value=o:n.set(r,o),o},i("__extends",gf),i("__assign",wf),i("__rest",jf),i("__decorate",Sf),i("__param",If),i("__metadata",Af),i("__awaiter",xf),i("__generator",Ff),i("__exportStar",Cf),i("__createBinding",js),i("__values",ws),i("__read",pa),i("__spread",Bf),i("__spreadArrays",Tf),i("__spreadArray",Df),i("__await",Or),i("__asyncGenerator",Ef),i("__asyncDelegator",kf),i("__asyncValues",Of),i("__makeTemplateObject",Mf),i("__importStar",Rf),i("__importDefault",Uf),i("__classPrivateFieldGet",Nf),i("__classPrivateFieldSet",Lf)})});var fl=gs(()=>{});var xp=gs(()=>{});var kp=gs((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(i){return Object.prototype.toString.call(i)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(i){return typeof i=="object"&&i.buffer&&i.buffer.constructor===ArrayBuffer});var createOutputMethod=function(i,t){return function(e){return new Sha256(t,!0).update(e)[i]()}},createMethod=function(i){var t=createOutputMethod("hex",i);NODE_JS&&(t=nodeWrap(t,i)),t.create=function(){return new Sha256(i)},t.update=function(n){return t.create().update(n)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createOutputMethod(r,i)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(i){if(typeof i=="string")return crypto.createHash(algorithm).update(i,"utf8").digest("hex");if(i==null)throw new Error(ERROR);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(i)).digest("hex"):method(i)};return nodeMethod},createHmacOutputMethod=function(i,t){return function(e,r){return new HmacSha256(e,t,!0).update(r)[i]()}},createHmacMethod=function(i){var t=createHmacOutputMethod("hex",i);t.create=function(n){return new HmacSha256(n,i)},t.update=function(n,o){return t.create(n).update(o)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createHmacOutputMethod(r,i)}return t};function Sha256(i,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i?(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=i}Sha256.prototype.update=function(i){if(!this.finalized){var t,e=typeof i;if(e!=="string"){if(e==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var r,n=0,o,c=i.length,h=this.blocks;n<c;){if(this.hashed&&(this.hashed=!1,h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),t)for(o=this.start;n<c&&o<64;++n)h[o>>2]|=i[n]<<SHIFT[o++&3];else for(o=this.start;n<c&&o<64;++n)r=i.charCodeAt(n),r<128?h[o>>2]|=r<<SHIFT[o++&3]:r<2048?(h[o>>2]|=(192|r>>6)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]):r<55296||r>=57344?(h[o>>2]|=(224|r>>12)<<SHIFT[o++&3],h[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]):(r=65536+((r&1023)<<10|i.charCodeAt(++n)&1023),h[o>>2]|=(240|r>>18)<<SHIFT[o++&3],h[o>>2]|=(128|r>>12&63)<<SHIFT[o++&3],h[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=h[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}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var i=this.blocks,t=this.lastByteIndex;i[16]=this.block,i[t>>2]|=EXTRA[t&3],this.block=i[16],t>=56&&(this.hashed||this.hash(),i[0]=this.block,i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),i[14]=this.hBytes<<3|this.bytes>>>29,i[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,h=this.h7,m=this.blocks,g,x,T,C,k,lt,ct,mt,kt,ae,he;for(g=16;g<64;++g)k=m[g-15],x=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,k=m[g-2],T=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,m[g]=m[g-16]+x+m[g-7]+T<<0;for(he=t&e,g=0;g<64;g+=4)this.first?(this.is224?(mt=300032,k=m[0]-1413257819,h=k-150054599<<0,r=k+24177077<<0):(mt=704751109,k=m[0]-210244248,h=k-1521486534<<0,r=k+143694565<<0),this.first=!1):(x=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),T=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),mt=i&t,C=mt^i&e^he,ct=n&o^~n&c,k=h+T+ct+K[g]+m[g],lt=x+C,h=r+k<<0,r=k+lt<<0),x=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),T=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),kt=r&i,C=kt^r&t^mt,ct=h&n^~h&o,k=c+T+ct+K[g+1]+m[g+1],lt=x+C,c=e+k<<0,e=k+lt<<0,x=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),T=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),ae=e&r,C=ae^e&i^kt,ct=c&h^~c&n,k=o+T+ct+K[g+2]+m[g+2],lt=x+C,o=t+k<<0,t=k+lt<<0,x=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),T=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),he=t&e,C=he^t&r^ae,ct=o&c^~o&h,k=n+T+ct+K[g+3]+m[g+3],lt=x+C,n=i+k<<0,i=k+lt<<0;this.h0=this.h0+i<<0,this.h1=this.h1+t<<0,this.h2=this.h2+e<<0,this.h3=this.h3+r<<0,this.h4=this.h4+n<<0,this.h5=this.h5+o<<0,this.h6=this.h6+c<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,h=this.h7,m=HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15];return this.is224||(m+=HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]),m},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,h=this.h7,m=[i>>24&255,i>>16&255,i>>8&255,i&255,t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,n>>24&255,n>>16&255,n>>8&255,n&255,o>>24&255,o>>16&255,o>>8&255,o&255,c>>24&255,c>>16&255,c>>8&255,c&255];return this.is224||m.push(h>>24&255,h>>16&255,h>>8&255,h&255),m},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var i=new ArrayBuffer(this.is224?28:32),t=new DataView(i);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),i};function HmacSha256(i,t,e){var r,n=typeof i;if(n==="string"){var o=[],c=i.length,h=0,m;for(r=0;r<c;++r)m=i.charCodeAt(r),m<128?o[h++]=m:m<2048?(o[h++]=192|m>>6,o[h++]=128|m&63):m<55296||m>=57344?(o[h++]=224|m>>12,o[h++]=128|m>>6&63,o[h++]=128|m&63):(m=65536+((m&1023)<<10|i.charCodeAt(++r)&1023),o[h++]=240|m>>18,o[h++]=128|m>>12&63,o[h++]=128|m>>6&63,o[h++]=128|m&63);i=o}else if(n==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);i.length>64&&(i=new Sha256(t,!0).update(i).array());var g=[],x=[];for(r=0;r<64;++r){var T=i[r]||0;g[r]=92^T,x[r]=54^T}Sha256.call(this,t,e),this.update(x),this.oKeyPad=g,this.inner=!0,this.sharedMemory=e}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var i=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(i),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var YS={};_r(YS,{registerWorker:()=>Rp});var Vf=vf(Pf(),1),{__extends:qS,__assign:ZS,__rest:Hf,__decorate:QS,__param:tI,__metadata:eI,__awaiter:O,__generator:iI,__exportStar:rI,__createBinding:nI,__values:sI,__read:oI,__spread:aI,__spreadArrays:lI,__spreadArray:cI,__await:rt,__asyncGenerator:_e,__asyncDelegator:Mr,__asyncValues:Ne,__makeTemplateObject:uI,__importStar:dI,__importDefault:fI,__classPrivateFieldGet:hI,__classPrivateFieldSet:pI}=Vf.default;var ga={};_r(ga,{compareArrayLike:()=>va,joinUint8Arrays:()=>Be,memcpy:()=>Ur,rebaseValueOffsets:()=>wn,toArrayBufferView:()=>nt,toArrayBufferViewAsyncIterator:()=>Xe,toArrayBufferViewIterator:()=>ai,toBigInt64Array:()=>lw,toBigUint64Array:()=>dw,toFloat32Array:()=>fw,toFloat32ArrayAsyncIterator:()=>Cw,toFloat32ArrayIterator:()=>gw,toFloat64Array:()=>hw,toFloat64ArrayAsyncIterator:()=>Bw,toFloat64ArrayIterator:()=>ww,toInt16Array:()=>aw,toInt16ArrayAsyncIterator:()=>Iw,toInt16ArrayIterator:()=>_w,toInt32Array:()=>mr,toInt32ArrayAsyncIterator:()=>Aw,toInt32ArrayIterator:()=>mw,toInt8Array:()=>ow,toInt8ArrayAsyncIterator:()=>Sw,toInt8ArrayIterator:()=>yw,toUint16Array:()=>cw,toUint16ArrayAsyncIterator:()=>xw,toUint16ArrayIterator:()=>bw,toUint32Array:()=>uw,toUint32ArrayAsyncIterator:()=>Fw,toUint32ArrayIterator:()=>vw,toUint8Array:()=>Y,toUint8ArrayAsyncIterator:()=>ba,toUint8ArrayIterator:()=>ma,toUint8ClampedArray:()=>pw,toUint8ClampedArrayAsyncIterator:()=>Tw,toUint8ClampedArrayIterator:()=>jw});var iw=new TextDecoder("utf-8"),bn=i=>iw.decode(i),rw=new TextEncoder,Gi=i=>rw.encode(i);var[mI,Is]=(()=>{let i=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw i()}return t.asIntN=()=>{throw i()},t.asUintN=()=>{throw i()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[vn,bI]=(()=>{let i=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Rr,vI]=(()=>{let i=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})();var nw=i=>typeof i=="number",zf=i=>typeof i=="boolean",Wt=i=>typeof i=="function",ce=i=>i!=null&&Object(i)===i,$e=i=>ce(i)&&Wt(i.then);var Ye=i=>ce(i)&&Wt(i[Symbol.iterator]),Le=i=>ce(i)&&Wt(i[Symbol.asyncIterator]),As=i=>ce(i)&&ce(i.schema);var xs=i=>ce(i)&&"done"in i&&"value"in i;var Fs=i=>ce(i)&&Wt(i.stat)&&nw(i.fd);var Cs=i=>ce(i)&&gn(i.body),Bs=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Wf=i=>ce(i)&&Wt(i.abort)&&Wt(i.getWriter)&&!Bs(i),gn=i=>ce(i)&&Wt(i.cancel)&&Wt(i.getReader)&&!Bs(i),$f=i=>ce(i)&&Wt(i.end)&&Wt(i.write)&&zf(i.writable)&&!Bs(i),Ts=i=>ce(i)&&Wt(i.read)&&Wt(i.pipe)&&zf(i.readable)&&!Bs(i),Yf=i=>ce(i)&&Wt(i.clear)&&Wt(i.bytes)&&Wt(i.position)&&Wt(i.setPosition)&&Wt(i.capacity)&&Wt(i.getBufferIdentifier)&&Wt(i.createLong);var _a=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function sw(i){let t=i[0]?[i[0]]:[],e,r,n,o;for(let c,h,m=0,g=0,x=i.length;++m<x;){if(c=t[g],h=i[m],!c||!h||c.buffer!==h.buffer||h.byteOffset<c.byteOffset){h&&(t[++g]=h);continue}if({byteOffset:e,byteLength:n}=c,{byteOffset:r,byteLength:o}=h,e+n<r||r+o<e){h&&(t[++g]=h);continue}t[g]=new Uint8Array(c.buffer,e,r-e+o)}return t}function Ur(i,t,e=0,r=t.byteLength){let n=i.byteLength,o=new Uint8Array(i.buffer,i.byteOffset,n),c=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,n));return o.set(c,e),i}function Be(i,t){let e=sw(i),r=e.reduce((x,T)=>x+T.byteLength,0),n,o,c,h=0,m=-1,g=Math.min(t||Number.POSITIVE_INFINITY,r);for(let x=e.length;++m<x;){if(n=e[m],o=n.subarray(0,Math.min(n.length,g-h)),g<=h+o.length){o.length<n.length?e[m]=n.subarray(o.length):o.length===n.length&&m++,c?Ur(c,o,h):c=o;break}Ur(c||(c=new Uint8Array(g)),o,h),h+=o.length}return[c||new Uint8Array(0),e.slice(m),r-(c?c.byteLength:0)]}function nt(i,t){let e=xs(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Gi(e)),e instanceof ArrayBuffer?new i(e):e instanceof _a?new i(e):Yf(e)?nt(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 ow=i=>nt(Int8Array,i),aw=i=>nt(Int16Array,i),mr=i=>nt(Int32Array,i),lw=i=>nt(vn,i),Y=i=>nt(Uint8Array,i),cw=i=>nt(Uint16Array,i),uw=i=>nt(Uint32Array,i),dw=i=>nt(Rr,i),fw=i=>nt(Float32Array,i),hw=i=>nt(Float64Array,i),pw=i=>nt(Uint8ClampedArray,i),ya=i=>(i.next(),i);function*ai(i,t){let e=function*(n){yield n},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof _a?e(t):Ye(t)?t:e(t);return yield*ya(function*(n){let o=null;do o=n.next(yield nt(i,o));while(!o.done)}(r[Symbol.iterator]())),new i}var yw=i=>ai(Int8Array,i),_w=i=>ai(Int16Array,i),mw=i=>ai(Int32Array,i),ma=i=>ai(Uint8Array,i),bw=i=>ai(Uint16Array,i),vw=i=>ai(Uint32Array,i),gw=i=>ai(Float32Array,i),ww=i=>ai(Float64Array,i),jw=i=>ai(Uint8ClampedArray,i);function Xe(i,t){return _e(this,arguments,function*(){if($e(t))return yield rt(yield rt(yield*Mr(Ne(Xe(i,yield rt(t))))));let r=function(c){return _e(this,arguments,function*(){yield yield rt(yield rt(c))})},n=function(c){return _e(this,arguments,function*(){yield rt(yield*Mr(Ne(ya(function*(h){let m=null;do m=h.next(yield m==null?void 0:m.value);while(!m.done)}(c[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof _a?r(t):Ye(t)?n(t):Le(t)?t:r(t);return yield rt(yield*Mr(Ne(ya(function(c){return _e(this,arguments,function*(){let h=null;do h=yield rt(c.next(yield yield rt(nt(i,h))));while(!h.done)})}(o[Symbol.asyncIterator]()))))),yield rt(new i)})}var Sw=i=>Xe(Int8Array,i),Iw=i=>Xe(Int16Array,i),Aw=i=>Xe(Int32Array,i),ba=i=>Xe(Uint8Array,i),xw=i=>Xe(Uint16Array,i),Fw=i=>Xe(Uint32Array,i),Cw=i=>Xe(Float32Array,i),Bw=i=>Xe(Float64Array,i),Tw=i=>Xe(Uint8ClampedArray,i);function wn(i,t,e){if(i!==0){e=e.slice(0,t+1);for(let r=-1;++r<=t;)e[r]+=i}return e}function va(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 Qt={fromIterable(i){return Ds(Dw(i))},fromAsyncIterable(i){return Ds(Ew(i))},fromDOMStream(i){return Ds(kw(i))},fromNodeStream(i){return Ds(Ow(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')}},Ds=i=>(i.next(),i);function*Dw(i){let t,e=!1,r=[],n,o,c,h=0;function m(){return o==="peek"?Be(r,c)[0]:([n,r,h]=Be(r,c),n)}({cmd:o,size:c}=yield null);let g=ma(i)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(c-h)?g.next():g.next(c-h),!t&&n.byteLength>0&&(r.push(n),h+=n.byteLength),t||c<=h)do({cmd:o,size:c}=yield m());while(c<h);while(!t)}catch(x){(e=!0)&&typeof g.throw=="function"&&g.throw(x)}finally{e===!1&&typeof g.return=="function"&&g.return(null)}return null}function Ew(i){return _e(this,arguments,function*(){let e,r=!1,n=[],o,c,h,m=0;function g(){return c==="peek"?Be(n,h)[0]:([o,n,m]=Be(n,h),o)}({cmd:c,size:h}=yield yield rt(null));let x=ba(i)[Symbol.asyncIterator]();try{do if({done:e,value:o}=Number.isNaN(h-m)?yield rt(x.next()):yield rt(x.next(h-m)),!e&&o.byteLength>0&&(n.push(o),m+=o.byteLength),e||h<=m)do({cmd:c,size:h}=yield yield rt(g()));while(h<m);while(!e)}catch(T){(r=!0)&&typeof x.throw=="function"&&(yield rt(x.throw(T)))}finally{r===!1&&typeof x.return=="function"&&(yield rt(x.return(new Uint8Array(0))))}return yield rt(null)})}function kw(i){return _e(this,arguments,function*(){let e=!1,r=!1,n=[],o,c,h,m=0;function g(){return c==="peek"?Be(n,h)[0]:([o,n,m]=Be(n,h),o)}({cmd:c,size:h}=yield yield rt(null));let x=new ja(i);try{do if({done:e,value:o}=Number.isNaN(h-m)?yield rt(x.read()):yield rt(x.read(h-m)),!e&&o.byteLength>0&&(n.push(Y(o)),m+=o.byteLength),e||h<=m)do({cmd:c,size:h}=yield yield rt(g()));while(h<m);while(!e)}catch(T){(r=!0)&&(yield rt(x.cancel(T)))}finally{r===!1?yield rt(x.cancel()):i.locked&&x.releaseLock()}return yield rt(null)})}var ja=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 O(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 O(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=Y(e)),e})}},wa=(i,t)=>{let e=n=>r([t,n]),r;return[t,e,new Promise(n=>(r=n)&&i.once(t,e))]};function Ow(i){return _e(this,arguments,function*(){let e=[],r="error",n=!1,o=null,c,h,m=0,g=[],x;function T(){return c==="peek"?Be(g,h)[0]:([x,g,m]=Be(g,h),x)}if({cmd:c,size:h}=yield yield rt(null),i.isTTY)return yield yield rt(new Uint8Array(0)),yield rt(null);try{e[0]=wa(i,"end"),e[1]=wa(i,"error");do{if(e[2]=wa(i,"readable"),[r,o]=yield rt(Promise.race(e.map(k=>k[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(h-m)?(x=Y(i.read(h-m)),x.byteLength<h-m&&(x=Y(i.read()))):x=Y(i.read()),x.byteLength>0&&(g.push(x),m+=x.byteLength)),n||h<=m)do({cmd:c,size:h}=yield yield rt(T()));while(h<m)}while(!n)}finally{yield rt(C(e,r==="error"?o:null))}return yield rt(null);function C(k,lt){return x=g=null,new Promise((ct,mt)=>{for(let[kt,ae]of k)i.off(kt,ae);try{let kt=i.destroy;kt&&kt.call(i,lt),lt=void 0}catch(kt){lt=kt||lt}finally{lt!=null?mt(lt):ct()}})}})}var $t;(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"})($t||($t={}));var Tt;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Tt||(Tt={}));var At;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(At||(At={}));var te;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(te||(te={}));var ot;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(ot||(ot={}));var ue;(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"})(ue||(ue={}));var dt;(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"})(dt||(dt={}));var A;(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.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"})(A||(A={}));var Pe;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Pe||(Pe={}));var La={};_r(La,{clampIndex:()=>Ij,clampRange:()=>In,createElementComparator:()=>Zi});function Ge(i){if(i===null)return"null";if(i===void 0)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>Ge(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}var Ia={};_r(Ia,{BN:()=>br,bignumToBigInt:()=>Es,bignumToString:()=>Ki,isArrowBigNumSymbol:()=>Xf});var Xf=Symbol.for("isArrowBigNum");function Ke(i,...t){return t.length===0?Object.setPrototypeOf(nt(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Ke.prototype[Xf]=!0;Ke.prototype.toJSON=function(){return`"${Ki(this)}"`};Ke.prototype.valueOf=function(){return Gf(this)};Ke.prototype.toString=function(){return Ki(this)};Ke.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return Gf(this);case"string":return Ki(this);case"default":return Es(this)}return Ki(this)};function Nr(...i){return Ke.apply(this,i)}function Lr(...i){return Ke.apply(this,i)}function jn(...i){return Ke.apply(this,i)}Object.setPrototypeOf(Nr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Lr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(jn.prototype,Object.create(Uint32Array.prototype));Object.assign(Nr.prototype,Ke.prototype,{constructor:Nr,signed:!0,TypedArray:Int32Array,BigIntArray:vn});Object.assign(Lr.prototype,Ke.prototype,{constructor:Lr,signed:!1,TypedArray:Uint32Array,BigIntArray:Rr});Object.assign(jn.prototype,Ke.prototype,{constructor:jn,signed:!0,TypedArray:Uint32Array,BigIntArray:Rr});function Gf(i){let{buffer:t,byteOffset:e,length:r,signed:n}=i,o=new Rr(t,e,r),c=n&&o[o.length-1]&BigInt(1)<<BigInt(63),h=BigInt(c?1:0),m=BigInt(0);if(c){for(let g of o)h+=~g*(BigInt(1)<<BigInt(32)*m++);h*=BigInt(-1)}else for(let g of o)h+=g*(BigInt(1)<<BigInt(32)*m++);return h}var Ki,Es;Is?(Es=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:Sa(i),Ki=i=>i.byteLength===8?`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`:Sa(i)):(Ki=Sa,Es=Ki);function Sa(i){let t="",e=new Uint32Array(2),r=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),n=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,c=r.length-1;do{for(e[0]=r[o=0];o<c;)r[o++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[o];r[o]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(n[0]||n[1]||n[2]||n[3]);return t||"0"}var br=class{static new(t,e){switch(e){case!0:return new Nr(t);case!1:return new Lr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case vn:return new Nr(t)}return t.byteLength===16?new jn(t):new Lr(t)}static signed(t){return new Nr(t)}static unsigned(t){return new Lr(t)}static decimal(t){return new jn(t)}constructor(t,e){return br.new(t,e)}};var Kf,Jf,qf,Zf,Qf,th,eh,ih,rh,nh,sh,oh,ah,lh,ch,uh,dh,fh,hh,U=class{static isNull(t){return(t==null?void 0:t.typeId)===A.Null}static isInt(t){return(t==null?void 0:t.typeId)===A.Int}static isFloat(t){return(t==null?void 0:t.typeId)===A.Float}static isBinary(t){return(t==null?void 0:t.typeId)===A.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===A.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===A.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===A.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===A.Date}static isTime(t){return(t==null?void 0:t.typeId)===A.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===A.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===A.Interval}static isList(t){return(t==null?void 0:t.typeId)===A.List}static isStruct(t){return(t==null?void 0:t.typeId)===A.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===A.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===A.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===A.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===A.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===A.Dictionary}static isDenseUnion(t){return U.isUnion(t)&&t.mode===Tt.Dense}static isSparseUnion(t){return U.isUnion(t)&&t.mode===Tt.Sparse}get typeId(){return A.NONE}};Kf=Symbol.toStringTag;U[Kf]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(U.prototype);var de=class extends U{toString(){return"Null"}get typeId(){return A.Null}};Jf=Symbol.toStringTag;de[Jf]=(i=>i[Symbol.toStringTag]="Null")(de.prototype);var Mt=class extends U{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return A.Int}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 ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};qf=Symbol.toStringTag;Mt[qf]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Mt.prototype);var ks=class extends Mt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Os=class extends Mt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},li=class extends Mt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Ms=class extends Mt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Rs=class extends Mt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Us=class extends Mt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Ns=class extends Mt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Ls=class extends Mt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(ks.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Os.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(li.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Ms.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Rs.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Us.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ns.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Ls.prototype,"ArrayType",{value:BigUint64Array});var me=class extends U{constructor(t){super(),this.precision=t}get typeId(){return A.Float}get ArrayType(){switch(this.precision){case At.HALF:return Uint16Array;case At.SINGLE:return Float32Array;case At.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Zf=Symbol.toStringTag;me[Zf]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(me.prototype);var Ps=class extends me{constructor(){super(At.HALF)}},Vs=class extends me{constructor(){super(At.SINGLE)}},Hs=class extends me{constructor(){super(At.DOUBLE)}};Object.defineProperty(Ps.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Vs.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Hs.prototype,"ArrayType",{value:Float64Array});var Ci=class extends U{constructor(){super()}get typeId(){return A.Binary}toString(){return"Binary"}};Qf=Symbol.toStringTag;Ci[Qf]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(Ci.prototype);var Bi=class extends U{constructor(){super()}get typeId(){return A.Utf8}toString(){return"Utf8"}};th=Symbol.toStringTag;Bi[th]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(Bi.prototype);var Ti=class extends U{constructor(){super()}get typeId(){return A.Bool}toString(){return"Bool"}};eh=Symbol.toStringTag;Ti[eh]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(Ti.prototype);var Di=class extends U{constructor(t,e,r=128){super(),this.scale=t,this.precision=e,this.bitWidth=r}get typeId(){return A.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};ih=Symbol.toStringTag;Di[ih]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Di.prototype);var Ei=class extends U{constructor(t){super(),this.unit=t}get typeId(){return A.Date}toString(){return`Date${(this.unit+1)*32}<${te[this.unit]}>`}};rh=Symbol.toStringTag;Ei[rh]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(Ei.prototype);var Je=class extends U{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return A.Time}toString(){return`Time${this.bitWidth}<${ot[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};nh=Symbol.toStringTag;Je[nh]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Je.prototype);var ki=class extends U{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return A.Timestamp}toString(){return`Timestamp<${ot[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};sh=Symbol.toStringTag;ki[sh]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(ki.prototype);var Oi=class extends U{constructor(t){super(),this.unit=t}get typeId(){return A.Interval}toString(){return`Interval<${ue[this.unit]}>`}};oh=Symbol.toStringTag;Oi[oh]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(Oi.prototype);var qe=class extends U{constructor(t){super(),this.children=[t]}get typeId(){return A.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ah=Symbol.toStringTag;qe[ah]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(qe.prototype);var wt=class extends U{constructor(t){super(),this.children=t}get typeId(){return A.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};lh=Symbol.toStringTag;wt[lh]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(wt.prototype);var Ze=class extends U{constructor(t,e,r){super(),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,o,c)=>(n[o]=c)&&n||n,Object.create(null))}get typeId(){return A.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};ch=Symbol.toStringTag;Ze[ch]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(Ze.prototype);var Mi=class extends U{constructor(t){super(),this.byteWidth=t}get typeId(){return A.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};uh=Symbol.toStringTag;Mi[uh]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Mi.prototype);var Qe=class extends U{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return A.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};dh=Symbol.toStringTag;Qe[dh]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(Qe.prototype);var ti=class extends U{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return A.Map}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<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};fh=Symbol.toStringTag;ti[fh]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(ti.prototype);var Mw=(i=>()=>++i)(-1),Te=class extends U{constructor(t,e,r,n){super(),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=r==null?Mw():typeof r=="number"?r:r.low}get typeId(){return A.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};hh=Symbol.toStringTag;Te[hh]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(Te.prototype);function De(i){let t=i;switch(i.typeId){case A.Decimal:return i.bitWidth/32;case A.Timestamp:return 2;case A.Date:return 1+t.unit;case A.Interval:return 1+t.unit;case A.FixedSizeList:return t.listSize;case A.FixedSizeBinary:return t.byteWidth;default:return 1}}var V=class{visitMany(t,...e){return t.map((r,n)=>this.visit(r,...e.map(o=>o[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return Rw(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}visitBinary(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}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function Rw(i,t,e=!0){return typeof t=="number"?Pr(i,t,e):typeof t=="string"&&t in A?Pr(i,A[t],e):t&&t instanceof U?Pr(i,ph(t),e):(t==null?void 0:t.type)&&t.type instanceof U?Pr(i,ph(t.type),e):Pr(i,A.NONE,e)}function Pr(i,t,e=!0){let r=null;switch(t){case A.Null:r=i.visitNull;break;case A.Bool:r=i.visitBool;break;case A.Int:r=i.visitInt;break;case A.Int8:r=i.visitInt8||i.visitInt;break;case A.Int16:r=i.visitInt16||i.visitInt;break;case A.Int32:r=i.visitInt32||i.visitInt;break;case A.Int64:r=i.visitInt64||i.visitInt;break;case A.Uint8:r=i.visitUint8||i.visitInt;break;case A.Uint16:r=i.visitUint16||i.visitInt;break;case A.Uint32:r=i.visitUint32||i.visitInt;break;case A.Uint64:r=i.visitUint64||i.visitInt;break;case A.Float:r=i.visitFloat;break;case A.Float16:r=i.visitFloat16||i.visitFloat;break;case A.Float32:r=i.visitFloat32||i.visitFloat;break;case A.Float64:r=i.visitFloat64||i.visitFloat;break;case A.Utf8:r=i.visitUtf8;break;case A.Binary:r=i.visitBinary;break;case A.FixedSizeBinary:r=i.visitFixedSizeBinary;break;case A.Date:r=i.visitDate;break;case A.DateDay:r=i.visitDateDay||i.visitDate;break;case A.DateMillisecond:r=i.visitDateMillisecond||i.visitDate;break;case A.Timestamp:r=i.visitTimestamp;break;case A.TimestampSecond:r=i.visitTimestampSecond||i.visitTimestamp;break;case A.TimestampMillisecond:r=i.visitTimestampMillisecond||i.visitTimestamp;break;case A.TimestampMicrosecond:r=i.visitTimestampMicrosecond||i.visitTimestamp;break;case A.TimestampNanosecond:r=i.visitTimestampNanosecond||i.visitTimestamp;break;case A.Time:r=i.visitTime;break;case A.TimeSecond:r=i.visitTimeSecond||i.visitTime;break;case A.TimeMillisecond:r=i.visitTimeMillisecond||i.visitTime;break;case A.TimeMicrosecond:r=i.visitTimeMicrosecond||i.visitTime;break;case A.TimeNanosecond:r=i.visitTimeNanosecond||i.visitTime;break;case A.Decimal:r=i.visitDecimal;break;case A.List:r=i.visitList;break;case A.Struct:r=i.visitStruct;break;case A.Union:r=i.visitUnion;break;case A.DenseUnion:r=i.visitDenseUnion||i.visitUnion;break;case A.SparseUnion:r=i.visitSparseUnion||i.visitUnion;break;case A.Dictionary:r=i.visitDictionary;break;case A.Interval:r=i.visitInterval;break;case A.IntervalDayTime:r=i.visitIntervalDayTime||i.visitInterval;break;case A.IntervalYearMonth:r=i.visitIntervalYearMonth||i.visitInterval;break;case A.FixedSizeList:r=i.visitFixedSizeList;break;case A.Map:r=i.visitMap;break}if(typeof r=="function")return r;if(!e)return()=>null;throw new Error(`Unrecognized type '${A[t]}'`)}function ph(i){switch(i.typeId){case A.Null:return A.Null;case A.Int:{let{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?A.Int8:A.Uint8;case 16:return e?A.Int16:A.Uint16;case 32:return e?A.Int32:A.Uint32;case 64:return e?A.Int64:A.Uint64}return A.Int}case A.Float:switch(i.precision){case At.HALF:return A.Float16;case At.SINGLE:return A.Float32;case At.DOUBLE:return A.Float64}return A.Float;case A.Binary:return A.Binary;case A.Utf8:return A.Utf8;case A.Bool:return A.Bool;case A.Decimal:return A.Decimal;case A.Time:switch(i.unit){case ot.SECOND:return A.TimeSecond;case ot.MILLISECOND:return A.TimeMillisecond;case ot.MICROSECOND:return A.TimeMicrosecond;case ot.NANOSECOND:return A.TimeNanosecond}return A.Time;case A.Timestamp:switch(i.unit){case ot.SECOND:return A.TimestampSecond;case ot.MILLISECOND:return A.TimestampMillisecond;case ot.MICROSECOND:return A.TimestampMicrosecond;case ot.NANOSECOND:return A.TimestampNanosecond}return A.Timestamp;case A.Date:switch(i.unit){case te.DAY:return A.DateDay;case te.MILLISECOND:return A.DateMillisecond}return A.Date;case A.Interval:switch(i.unit){case ue.DAY_TIME:return A.IntervalDayTime;case ue.YEAR_MONTH:return A.IntervalYearMonth}return A.Interval;case A.Map:return A.Map;case A.List:return A.List;case A.Struct:return A.Struct;case A.Union:switch(i.mode){case Tt.Dense:return A.DenseUnion;case Tt.Sparse:return A.SparseUnion}return A.Union;case A.FixedSizeBinary:return A.FixedSizeBinary;case A.FixedSizeList:return A.FixedSizeList;case A.Dictionary:return A.Dictionary}throw new Error(`Unrecognized type '${A[i.typeId]}'`)}V.prototype.visitInt8=null;V.prototype.visitInt16=null;V.prototype.visitInt32=null;V.prototype.visitInt64=null;V.prototype.visitUint8=null;V.prototype.visitUint16=null;V.prototype.visitUint32=null;V.prototype.visitUint64=null;V.prototype.visitFloat16=null;V.prototype.visitFloat32=null;V.prototype.visitFloat64=null;V.prototype.visitDateDay=null;V.prototype.visitDateMillisecond=null;V.prototype.visitTimestampSecond=null;V.prototype.visitTimestampMillisecond=null;V.prototype.visitTimestampMicrosecond=null;V.prototype.visitTimestampNanosecond=null;V.prototype.visitTimeSecond=null;V.prototype.visitTimeMillisecond=null;V.prototype.visitTimeMicrosecond=null;V.prototype.visitTimeNanosecond=null;V.prototype.visitDenseUnion=null;V.prototype.visitSparseUnion=null;V.prototype.visitIntervalDayTime=null;V.prototype.visitIntervalYearMonth=null;var Aa={};_r(Aa,{float64ToUint16:()=>Sn,uint16ToFloat64:()=>zs});var yh=new Float64Array(1),Vr=new Uint32Array(yh.buffer);function zs(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 Sn(i){if(i!==i)return 32256;yh[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 X=class extends V{};function et(i){return(t,e,r)=>{if(t.setValid(e,r!=null))return i(t,e,r)}}var Uw=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},xa=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},Nw=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},Lw=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},_h=(i,t,e,r)=>{if(e+1<t.length){let{[e]:n,[e+1]:o}=t;i.set(r.subarray(0,o-n),n)}},Pw=({offset:i,values:t},e,r)=>{let n=i+e;r?t[n>>3]|=1<<n%8:t[n>>3]&=~(1<<n%8)},Ri=({values:i},t,e)=>{i[t]=e},Fa=({values:i},t,e)=>{i[t]=e},mh=({values:i},t,e)=>{i[t]=Sn(e)},Vw=(i,t,e)=>{switch(i.type.precision){case At.HALF:return mh(i,t,e);case At.SINGLE:case At.DOUBLE:return Fa(i,t,e)}},Ws=({values:i},t,e)=>{Uw(i,t,e.valueOf())},$s=({values:i},t,e)=>{xa(i,t*2,e.valueOf())},Ca=({stride:i,values:t},e,r)=>{t.set(r.subarray(0,i),i*e)},Hw=({values:i,valueOffsets:t},e,r)=>_h(i,t,e,r),zw=({values:i,valueOffsets:t},e,r)=>{_h(i,t,e,Gi(r))},Ba=(i,t,e)=>{i.type.unit===te.DAY?Ws(i,t,e):$s(i,t,e)},Ys=({values:i},t,e)=>xa(i,t*2,e/1e3),Xs=({values:i},t,e)=>xa(i,t*2,e),Gs=({values:i},t,e)=>Nw(i,t*2,e),Ks=({values:i},t,e)=>Lw(i,t*2,e),Ta=(i,t,e)=>{switch(i.type.unit){case ot.SECOND:return Ys(i,t,e);case ot.MILLISECOND:return Xs(i,t,e);case ot.MICROSECOND:return Gs(i,t,e);case ot.NANOSECOND:return Ks(i,t,e)}},Js=({values:i},t,e)=>{i[t]=e},qs=({values:i},t,e)=>{i[t]=e},Zs=({values:i},t,e)=>{i[t]=e},Qs=({values:i},t,e)=>{i[t]=e},Da=(i,t,e)=>{switch(i.type.unit){case ot.SECOND:return Js(i,t,e);case ot.MILLISECOND:return qs(i,t,e);case ot.MICROSECOND:return Zs(i,t,e);case ot.NANOSECOND:return Qs(i,t,e)}},Ea=({values:i,stride:t},e,r)=>{i.set(r.subarray(0,t),t*e)},Ww=(i,t,e)=>{let r=i.children[0],n=i.valueOffsets,o=ee.getVisitFn(r);if(Array.isArray(e))for(let c=-1,h=n[t],m=n[t+1];h<m;)o(r,h++,e[++c]);else for(let c=-1,h=n[t],m=n[t+1];h<m;)o(r,h++,e.get(++c))},$w=(i,t,e)=>{let r=i.children[0],{valueOffsets:n}=i,o=ee.getVisitFn(r),{[t]:c,[t+1]:h}=n,m=e instanceof Map?e.entries():Object.entries(e);for(let g of m)if(o(r,c,g),++c>=h)break},Yw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[o]),Xw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(o)),Gw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(n.name)),Kw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[n.name]),Jw=(i,t,e)=>{let r=i.type.children.map(o=>ee.getVisitFn(o.type)),n=e instanceof Map?Gw(t,e):e instanceof G?Xw(t,e):Array.isArray(e)?Yw(t,e):Kw(t,e);i.type.children.forEach((o,c)=>n(r[c],i.children[c],o,c))},qw=(i,t,e)=>{i.type.mode===Tt.Dense?bh(i,t,e):vh(i,t,e)},bh=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ee.visit(n,i.valueOffsets[t],e)},vh=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ee.visit(n,t,e)},Zw=(i,t,e)=>{var r;(r=i.dictionary)===null||r===void 0||r.set(i.values[t],e)},ka=(i,t,e)=>{i.type.unit===ue.DAY_TIME?to(i,t,e):eo(i,t,e)},to=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},eo=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},Qw=(i,t,e)=>{let{stride:r}=i,n=i.children[0],o=ee.getVisitFn(n);if(Array.isArray(e))for(let c=-1,h=t*r;++c<r;)o(n,h+c,e[c]);else for(let c=-1,h=t*r;++c<r;)o(n,h+c,e.get(c))};X.prototype.visitBool=et(Pw);X.prototype.visitInt=et(Ri);X.prototype.visitInt8=et(Ri);X.prototype.visitInt16=et(Ri);X.prototype.visitInt32=et(Ri);X.prototype.visitInt64=et(Ri);X.prototype.visitUint8=et(Ri);X.prototype.visitUint16=et(Ri);X.prototype.visitUint32=et(Ri);X.prototype.visitUint64=et(Ri);X.prototype.visitFloat=et(Vw);X.prototype.visitFloat16=et(mh);X.prototype.visitFloat32=et(Fa);X.prototype.visitFloat64=et(Fa);X.prototype.visitUtf8=et(zw);X.prototype.visitBinary=et(Hw);X.prototype.visitFixedSizeBinary=et(Ca);X.prototype.visitDate=et(Ba);X.prototype.visitDateDay=et(Ws);X.prototype.visitDateMillisecond=et($s);X.prototype.visitTimestamp=et(Ta);X.prototype.visitTimestampSecond=et(Ys);X.prototype.visitTimestampMillisecond=et(Xs);X.prototype.visitTimestampMicrosecond=et(Gs);X.prototype.visitTimestampNanosecond=et(Ks);X.prototype.visitTime=et(Da);X.prototype.visitTimeSecond=et(Js);X.prototype.visitTimeMillisecond=et(qs);X.prototype.visitTimeMicrosecond=et(Zs);X.prototype.visitTimeNanosecond=et(Qs);X.prototype.visitDecimal=et(Ea);X.prototype.visitList=et(Ww);X.prototype.visitStruct=et(Jw);X.prototype.visitUnion=et(qw);X.prototype.visitDenseUnion=et(bh);X.prototype.visitSparseUnion=et(vh);X.prototype.visitDictionary=et(Zw);X.prototype.visitInterval=et(ka);X.prototype.visitIntervalDayTime=et(to);X.prototype.visitIntervalYearMonth=et(eo);X.prototype.visitFixedSizeList=et(Qw);X.prototype.visitMap=et($w);var ee=new X;var ei=Symbol.for("parent"),Hr=Symbol.for("rowIndex"),Ji=class{constructor(t,e){return this[ei]=t,this[Hr]=e,new Proxy(this,new Ma)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Hr],e=this[ei],r=e.type.children,n={};for(let o=-1,c=r.length;++o<c;)n[r[o].name]=Nt.visit(e.children[o],t);return n}toString(){return`{${[...this].map(([t,e])=>`${Ge(t)}: ${Ge(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Oa(this[ei],this[Hr])}},Oa=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,Nt.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Ji.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ei]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Ma=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ei].type.children.map(e=>e.name)}has(t,e){return t[ei].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[ei].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[ei].type.children.findIndex(n=>n.name===e);if(r!==-1){let n=Nt.visit(t[ei].children[r],t[Hr]);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[ei].type.children.findIndex(o=>o.name===e);return n!==-1?(ee.visit(t[ei].children[n],t[Hr],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}};var H=class extends V{};function Z(i){return(t,e)=>t.getValid(e)?i(t,e):null}var tj=(i,t)=>864e5*i[t],Ra=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),ej=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,ij=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,gh=i=>new Date(i),rj=(i,t)=>gh(tj(i,t)),nj=(i,t)=>gh(Ra(i,t)),sj=(i,t)=>null,wh=(i,t,e)=>{if(e+1>=t.length)return null;let r=t[e],n=t[e+1];return i.subarray(r,n)},oj=({offset:i,values:t},e)=>{let r=i+e;return(t[r>>3]&1<<r%8)!==0},jh=({values:i},t)=>rj(i,t),Sh=({values:i},t)=>nj(i,t*2),qi=({stride:i,values:t},e)=>t[i*e],aj=({stride:i,values:t},e)=>zs(t[i*e]),Ih=({values:i},t)=>i[t],lj=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),cj=({values:i,valueOffsets:t},e)=>wh(i,t,e),uj=({values:i,valueOffsets:t},e)=>{let r=wh(i,t,e);return r!==null?bn(r):null},dj=({values:i},t)=>i[t],fj=({type:i,values:t},e)=>i.precision!==At.HALF?t[e]:zs(t[e]),hj=(i,t)=>i.type.unit===te.DAY?jh(i,t):Sh(i,t),Ah=({values:i},t)=>1e3*Ra(i,t*2),xh=({values:i},t)=>Ra(i,t*2),Fh=({values:i},t)=>ej(i,t*2),Ch=({values:i},t)=>ij(i,t*2),pj=(i,t)=>{switch(i.type.unit){case ot.SECOND:return Ah(i,t);case ot.MILLISECOND:return xh(i,t);case ot.MICROSECOND:return Fh(i,t);case ot.NANOSECOND:return Ch(i,t)}},Bh=({values:i},t)=>i[t],Th=({values:i},t)=>i[t],Dh=({values:i},t)=>i[t],Eh=({values:i},t)=>i[t],yj=(i,t)=>{switch(i.type.unit){case ot.SECOND:return Bh(i,t);case ot.MILLISECOND:return Th(i,t);case ot.MICROSECOND:return Dh(i,t);case ot.NANOSECOND:return Eh(i,t)}},_j=({values:i,stride:t},e)=>br.decimal(i.subarray(t*e,t*(e+1))),mj=(i,t)=>{let{valueOffsets:e,stride:r,children:n}=i,{[t*r]:o,[t*r+1]:c}=e,m=n[0].slice(o,c-o);return new G([m])},bj=(i,t)=>{let{valueOffsets:e,children:r}=i,{[t]:n,[t+1]:o}=e,c=r[0];return new ci(c.slice(n,o-n))},vj=(i,t)=>new Ji(i,t),gj=(i,t)=>i.type.mode===Tt.Dense?kh(i,t):Oh(i,t),kh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Nt.visit(r,i.valueOffsets[t])},Oh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Nt.visit(r,t)},wj=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},jj=(i,t)=>i.type.unit===ue.DAY_TIME?Mh(i,t):Rh(i,t),Mh=({values:i},t)=>i.subarray(2*t,2*(t+1)),Rh=({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},Sj=(i,t)=>{let{stride:e,children:r}=i,o=r[0].slice(t*e,e);return new G([o])};H.prototype.visitNull=Z(sj);H.prototype.visitBool=Z(oj);H.prototype.visitInt=Z(dj);H.prototype.visitInt8=Z(qi);H.prototype.visitInt16=Z(qi);H.prototype.visitInt32=Z(qi);H.prototype.visitInt64=Z(Ih);H.prototype.visitUint8=Z(qi);H.prototype.visitUint16=Z(qi);H.prototype.visitUint32=Z(qi);H.prototype.visitUint64=Z(Ih);H.prototype.visitFloat=Z(fj);H.prototype.visitFloat16=Z(aj);H.prototype.visitFloat32=Z(qi);H.prototype.visitFloat64=Z(qi);H.prototype.visitUtf8=Z(uj);H.prototype.visitBinary=Z(cj);H.prototype.visitFixedSizeBinary=Z(lj);H.prototype.visitDate=Z(hj);H.prototype.visitDateDay=Z(jh);H.prototype.visitDateMillisecond=Z(Sh);H.prototype.visitTimestamp=Z(pj);H.prototype.visitTimestampSecond=Z(Ah);H.prototype.visitTimestampMillisecond=Z(xh);H.prototype.visitTimestampMicrosecond=Z(Fh);H.prototype.visitTimestampNanosecond=Z(Ch);H.prototype.visitTime=Z(yj);H.prototype.visitTimeSecond=Z(Bh);H.prototype.visitTimeMillisecond=Z(Th);H.prototype.visitTimeMicrosecond=Z(Dh);H.prototype.visitTimeNanosecond=Z(Eh);H.prototype.visitDecimal=Z(_j);H.prototype.visitList=Z(mj);H.prototype.visitStruct=Z(vj);H.prototype.visitUnion=Z(gj);H.prototype.visitDenseUnion=Z(kh);H.prototype.visitSparseUnion=Z(Oh);H.prototype.visitDictionary=Z(wj);H.prototype.visitInterval=Z(jj);H.prototype.visitIntervalDayTime=Z(Mh);H.prototype.visitIntervalYearMonth=Z(Rh);H.prototype.visitFixedSizeList=Z(Sj);H.prototype.visitMap=Z(bj);var Nt=new H;var Ve=Symbol.for("keys"),zr=Symbol.for("vals"),ci=class{constructor(t){return this[Ve]=new G([t.children[0]]).memoize(),this[zr]=t.children[1],new Proxy(this,new Na)}[Symbol.iterator](){return new Ua(this[Ve],this[zr])}get size(){return this[Ve].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Ve],e=this[zr],r={};for(let n=-1,o=t.length;++n<o;)r[t.get(n)]=Nt.visit(e,n);return r}toString(){return`{${[...this].map(([t,e])=>`${Ge(t)}: ${Ge(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Ua=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),Nt.visit(this.vals,t)]})}},Na=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ve].toArray().map(String)}has(t,e){return t[Ve].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ve].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[Ve].indexOf(e);if(r!==-1){let n=Nt.visit(Reflect.get(t,zr),r);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[Ve].indexOf(e);return n!==-1?(ee.visit(Reflect.get(t,zr),n,r),Reflect.set(t,e,r)):Reflect.has(t,e)?Reflect.set(t,e,r):!1}};Object.defineProperties(ci.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ve]:{writable:!0,enumerable:!1,configurable:!1,value:null},[zr]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function Ij(i,t,e){let r=i.length,n=t>-1?t:r+t%r;return e?e(i,n):n}var Uh;function In(i,t,e,r){let{length:n=0}=i,o=typeof t!="number"?0:t,c=typeof e!="number"?n:e;return o<0&&(o=(o%n+n)%n),c<0&&(c=(c%n+n)%n),c<o&&(Uh=o,o=c,c=Uh),c>n&&(c=n),r?r(i,o,c):[o,c]}var Nh=i=>i!==i;function Zi(i){if(typeof i!=="object"||i===null)return Nh(i)?Nh: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?va(i,e):!1:i instanceof Map?xj(i):Array.isArray(i)?Aj(i):i instanceof G?Fj(i):Cj(i,!0)}function Aj(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=Zi(i[e]);return io(t)}function xj(i){let t=-1,e=[];for(let r of i.values())e[++t]=Zi(r);return io(e)}function Fj(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=Zi(i.get(e));return io(t)}function Cj(i,t=!1){let e=Object.keys(i);if(!t&&e.length===0)return()=>!1;let r=[];for(let n=-1,o=e.length;++n<o;)r[n]=Zi(i[e[n]]);return io(r,e)}function io(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return Bj(i,e);case Map:return Lh(i,e,e.keys());case ci:case Ji:case Object:case void 0:return Lh(i,e,t||Object.keys(e))}return e instanceof G?Tj(i,e):!1}}function Bj(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 Tj(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 Lh(i,t,e){let r=e[Symbol.iterator](),n=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),c=0,h=i.length,m=o.next(),g=r.next(),x=n.next();for(;c<h&&!g.done&&!x.done&&!m.done&&!(g.value!==x.value||!i[c](m.value));++c,g=r.next(),x=n.next(),m=o.next());return c===h&&g.done&&x.done&&m.done?!0:(r.return&&r.return(),n.return&&n.return(),o.return&&o.return(),!1)}var Pa={};_r(Pa,{BitIterator:()=>vr,getBit:()=>Ph,getBool:()=>no,packBools:()=>gr,popcnt_array:()=>Vh,popcnt_bit_range:()=>An,popcnt_uint32:()=>ro,setBool:()=>Dj,truncateBitmap:()=>Wr});function no(i,t,e,r){return(e&1<<r)!==0}function Ph(i,t,e,r){return(e&1<<r)>>r}function Dj(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function Wr(i,t,e){let r=e.byteLength+7&-8;if(i>0||e.byteLength<r){let n=new Uint8Array(r);return n.set(i%8===0?e.subarray(i>>3):gr(new vr(e,i,t,null,no)).subarray(0,r)),n}return e}function gr(i){let t=[],e=0,r=0,n=0;for(let c of i)c&&(n|=1<<r),++r===8&&(t[e++]=n,n=r=0);(e===0||r>0)&&(t[e++]=n);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var vr=class{constructor(t,e,r,n,o){this.bytes=t,this.length=r,this.context=n,this.get=o,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 An(i,t,e){if(e-t<=0)return 0;if(e-t<8){let o=0;for(let c of new vr(i,t,e-t,i,Ph))o+=c;return o}let r=e>>3<<3,n=t+(t%8===0?0:8-t%8);return An(i,t,n)+An(i,r,e)+Vh(i,n>>3,r-n>>3)}function Vh(i,t,e){let r=0,n=Math.trunc(t),o=new DataView(i.buffer,i.byteOffset,i.byteLength),c=e===void 0?i.byteLength:n+e;for(;c-n>=4;)r+=ro(o.getUint32(n)),n+=4;for(;c-n>=2;)r+=ro(o.getUint16(n)),n+=2;for(;c-n>=1;)r+=ro(o.getUint8(n)),n+=1;return r}function ro(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 Ej=-1,ft=class{constructor(t,e,r,n,o,c=[],h){this.type=t,this.children=c,this.dictionary=h,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let m;o instanceof ft?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=De(t),o&&((m=o[0])&&(this.valueOffsets=m),(m=o[1])&&(this.values=m),(m=o[2])&&(this.nullBitmap=m),(m=o[3])&&(this.typeIds=m))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:n,typeIds:o}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),this.children.reduce((c,h)=>c+h.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=Ej&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-An(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){let e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){let{nullBitmap:m}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:m,_nullCount:0})}let{nullBitmap:r,offset:n}=this,o=n+t>>3,c=(n+t)%8,h=r[o]>>c&1;return e?h===0&&(r[o]|=1<<c,this._nullCount=this.nullCount+1):h===1&&(r[o]&=~(1<<c),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,r=this.length,n=this._nullCount,o=this,c=this.children){return new ft(t,e,r,n,o,c,this.dictionary)}slice(t,e){let{stride:r,typeId:n,children:o}=this,c=+(this._nullCount===0)-1,h=n===16?r:1,m=this._sliceBuffers(t,e,r,n);return this.clone(this.type,this.offset+t,e,c,m,o.length===0||this.valueOffsets?o:this._sliceChildren(o,h*t,h*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===A.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:r}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<<e-(e&-8))-1,r>0&&n.set(Wr(this.offset,e,this.nullBitmap),0);let o=this.buffers;return o[Pe.VALIDITY]=n,this.clone(this.type,0,t,r+(t-e),o)}_sliceBuffers(t,e,r,n){let o,{buffers:c}=this;return(o=c[Pe.TYPE])&&(c[Pe.TYPE]=o.subarray(t,t+e)),(o=c[Pe.OFFSET])&&(c[Pe.OFFSET]=o.subarray(t,t+e+1))||(o=c[Pe.DATA])&&(c[Pe.DATA]=n===6?o:o.subarray(r*t,r*(t+e))),c}_sliceChildren(t,e,r){return t.map(n=>n.slice(e,r))}};ft.prototype.children=Object.freeze([]);var wr=class extends V{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:r=0,["length"]:n=0}=t;return new ft(e,r,n,0)}visitBool(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length>>3,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitInt(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitFloat(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitUtf8(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),c=mr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,n,o])}visitBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),c=mr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,n,o])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitDate(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitTimestamp(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitTime(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitDecimal(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitList(t){let{["type"]:e,["offset"]:r=0,["child"]:n}=t,o=Y(t.nullBitmap),c=mr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,void 0,o],[n])}visitStruct(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),{length:c=n.reduce((m,{length:g})=>Math.max(m,g),0),nullCount:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,void 0,o],n)}visitUnion(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),c=nt(e.ArrayType,t.typeIds),{["length"]:h=c.length,["nullCount"]:m=t.nullBitmap?-1:0}=t;if(U.isSparseUnion(e))return new ft(e,r,h,m,[void 0,void 0,o,c],n);let g=mr(t.valueOffsets);return new ft(e,r,h,m,[g,void 0,o,c],n)}visitDictionary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.indices.ArrayType,t.data),{["dictionary"]:c=new G([new wr().visit({type:e.dictionary})])}=t,{["length"]:h=o.length,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[void 0,o,n],[],c)}visitInterval(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=nt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitFixedSizeList(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new wr().visit({type:e.valueType})}=t,o=Y(t.nullBitmap),{["length"]:c=n.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,void 0,o],[n])}visitMap(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new wr().visit({type:e.childType})}=t,o=Y(t.nullBitmap),c=mr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,void 0,o],[n])}};function J(i){return new wr().visit(i)}var xn=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 so(i){return i.reduce((t,e)=>t+e.nullCount,0)}function oo(i){return i.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(i.length+1))}function ao(i,t,e,r){let n=[];for(let o=-1,c=i.length;++o<c;){let h=i[o],m=t[o],{length:g}=h;if(m>=r)break;if(e>=m+g)continue;if(m>=e&&m+g<=r){n.push(h);continue}let x=Math.max(0,e-m),T=Math.min(r-m,g);n.push(h.slice(x,T-x))}return n.length===0&&n.push(i[0].slice(0,0)),n}function Va(i,t,e,r){let n=0,o=0,c=t.length-1;do{if(n>=c-1)return e<t[c]?r(i,n,e-t[n]):null;o=n+Math.trunc((c-n)*.5),e<t[o]?c=o:n=o}while(n<c)}function Fn(i,t){return i.getValid(t)}function Qi(i){function t(e,r,n){return i(e[r],n)}return function(e){let r=this.data;return Va(r,this._offsets,e,t)}}function lo(i){let t;function e(r,n,o){return i(r[n],o,t)}return function(r,n){let o=this.data;t=n;let c=Va(o,this._offsets,r,e);return t=void 0,c}}function co(i){let t;function e(r,n,o){let c=o,h=0,m=0;for(let g=n-1,x=r.length;++g<x;){let T=r[g];if(~(h=i(T,t,c)))return m+h;c=0,m+=T.length}return-1}return function(r,n){t=r;let o=this.data,c=typeof n!="number"?e(o,0,0):Va(o,this._offsets,n,e);return t=void 0,c}}var z=class extends V{};function kj(i,t){return t===null&&i.length>0?0:-1}function Oj(i,t){let{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let r=0;for(let n of new vr(e,i.offset+(t||0),i.length,e,no)){if(!n)return r;++r}return-1}function st(i,t,e){if(t===void 0)return-1;if(t===null)return Oj(i,e);let r=Nt.getVisitFn(i),n=Zi(t);for(let o=(e||0)-1,c=i.length;++o<c;)if(n(r(i,o)))return o;return-1}function Hh(i,t,e){let r=Nt.getVisitFn(i),n=Zi(t);for(let o=(e||0)-1,c=i.length;++o<c;)if(n(r(i,o)))return o;return-1}z.prototype.visitNull=kj;z.prototype.visitBool=st;z.prototype.visitInt=st;z.prototype.visitInt8=st;z.prototype.visitInt16=st;z.prototype.visitInt32=st;z.prototype.visitInt64=st;z.prototype.visitUint8=st;z.prototype.visitUint16=st;z.prototype.visitUint32=st;z.prototype.visitUint64=st;z.prototype.visitFloat=st;z.prototype.visitFloat16=st;z.prototype.visitFloat32=st;z.prototype.visitFloat64=st;z.prototype.visitUtf8=st;z.prototype.visitBinary=st;z.prototype.visitFixedSizeBinary=st;z.prototype.visitDate=st;z.prototype.visitDateDay=st;z.prototype.visitDateMillisecond=st;z.prototype.visitTimestamp=st;z.prototype.visitTimestampSecond=st;z.prototype.visitTimestampMillisecond=st;z.prototype.visitTimestampMicrosecond=st;z.prototype.visitTimestampNanosecond=st;z.prototype.visitTime=st;z.prototype.visitTimeSecond=st;z.prototype.visitTimeMillisecond=st;z.prototype.visitTimeMicrosecond=st;z.prototype.visitTimeNanosecond=st;z.prototype.visitDecimal=st;z.prototype.visitList=st;z.prototype.visitStruct=st;z.prototype.visitUnion=st;z.prototype.visitDenseUnion=Hh;z.prototype.visitSparseUnion=Hh;z.prototype.visitDictionary=st;z.prototype.visitInterval=st;z.prototype.visitIntervalDayTime=st;z.prototype.visitIntervalYearMonth=st;z.prototype.visitFixedSizeList=st;z.prototype.visitMap=st;var jr=new z;var W=class extends V{};function Q(i){let{type:t}=i;if(i.nullCount===0&&i.stride===1&&(t.typeId===A.Timestamp||t instanceof Mt&&t.bitWidth!==64||t instanceof Je&&t.bitWidth!==64||t instanceof me&&t.precision!==At.HALF))return new xn(i.data.length,r=>{let n=i.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new xn(i.data.length,r=>{let o=i.data[r].length,c=i.slice(e,e+o);return e+=o,new Ha(c)})}var Ha=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}};W.prototype.visitNull=Q;W.prototype.visitBool=Q;W.prototype.visitInt=Q;W.prototype.visitInt8=Q;W.prototype.visitInt16=Q;W.prototype.visitInt32=Q;W.prototype.visitInt64=Q;W.prototype.visitUint8=Q;W.prototype.visitUint16=Q;W.prototype.visitUint32=Q;W.prototype.visitUint64=Q;W.prototype.visitFloat=Q;W.prototype.visitFloat16=Q;W.prototype.visitFloat32=Q;W.prototype.visitFloat64=Q;W.prototype.visitUtf8=Q;W.prototype.visitBinary=Q;W.prototype.visitFixedSizeBinary=Q;W.prototype.visitDate=Q;W.prototype.visitDateDay=Q;W.prototype.visitDateMillisecond=Q;W.prototype.visitTimestamp=Q;W.prototype.visitTimestampSecond=Q;W.prototype.visitTimestampMillisecond=Q;W.prototype.visitTimestampMicrosecond=Q;W.prototype.visitTimestampNanosecond=Q;W.prototype.visitTime=Q;W.prototype.visitTimeSecond=Q;W.prototype.visitTimeMillisecond=Q;W.prototype.visitTimeMicrosecond=Q;W.prototype.visitTimeNanosecond=Q;W.prototype.visitDecimal=Q;W.prototype.visitList=Q;W.prototype.visitStruct=Q;W.prototype.visitUnion=Q;W.prototype.visitDenseUnion=Q;W.prototype.visitSparseUnion=Q;W.prototype.visitDictionary=Q;W.prototype.visitInterval=Q;W.prototype.visitIntervalDayTime=Q;W.prototype.visitIntervalYearMonth=Q;W.prototype.visitFixedSizeList=Q;W.prototype.visitMap=Q;var $r=new W;var Mj=(i,t)=>i+t,ui=class extends V{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===ot.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((r,n)=>r+Ee.visit(n,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((r,n)=>r+Ee.visit(n,e),0)}visitDictionary(t,e){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[e]))||0)}},Rj=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),Uj=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),Nj=({valueOffsets:i,stride:t,children:e},r)=>{let n=e[0],{[r*t]:o}=i,{[r*t+1]:c}=i,h=Ee.getVisitFn(n.type),m=n.slice(o,c-o),g=8;for(let x=-1,T=c-o;++x<T;)g+=h(m,x);return g},Lj=({stride:i,children:t},e)=>{let r=t[0],n=r.slice(e*i,i),o=Ee.getVisitFn(r.type),c=0;for(let h=-1,m=n.length;++h<m;)c+=o(n,h);return c},Pj=(i,t)=>i.type.mode===Tt.Dense?zh(i,t):Wh(i,t),zh=({type:i,children:t,typeIds:e,valueOffsets:r},n)=>{let o=i.typeIdToChildIndex[e[n]];return 8+Ee.visit(t[o],r[n])},Wh=({children:i},t)=>4+Ee.visitMany(i,i.map(()=>t)).reduce(Mj,0);ui.prototype.visitUtf8=Rj;ui.prototype.visitBinary=Uj;ui.prototype.visitList=Nj;ui.prototype.visitFixedSizeList=Lj;ui.prototype.visitUnion=Pj;ui.prototype.visitDenseUnion=zh;ui.prototype.visitSparseUnion=Wh;var Ee=new ui;var $h,Yh={},Xh={},G=class{constructor(t){var e,r,n;let o=t[0]instanceof G?t.flatMap(h=>h.data):t;if(o.some(h=>!(h instanceof ft)))throw new TypeError("Vector constructor expects an Array of Data instances.");let c=(e=o[0])===null||e===void 0?void 0:e.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:h,set:m,indexOf:g,byteLength:x}=Yh[c.typeId],T=o[0];this.isValid=C=>Fn(T,C),this.get=C=>h(T,C),this.set=(C,k)=>m(T,C,k),this.indexOf=C=>g(T,C),this.getByteLength=C=>x(T,C),this._offsets=[0,T.length];break}default:Object.setPrototypeOf(this,Xh[c.typeId]),this._offsets=oo(o);break}this.data=o,this.type=c,this.stride=De(c),this.numChildren=(n=(r=c.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=so(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${A[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return $r.visit(this)}concat(...t){return new G(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new G(In(this,t,e,({data:r,_offsets:n},o,c)=>ao(r,n,o,c)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:n,ArrayType:o}=this;switch(t.typeId){case A.Int:case A.Float:case A.Decimal:case A.Time:case A.Timestamp:switch(e.length){case 0:return new o;case 1:return e[0].values.subarray(0,r*n);default:return e.reduce((c,{values:h})=>(c.array.set(h,c.offset),c.offset+=h.length,c),{array:new o(r*n),offset:0}).array}}return[...this]}toString(){return`[${[...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 G(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return U.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(U.isDictionary(this.type)){let t=new Yr(this.data[0].dictionary),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return new Yr(this)}unmemoize(){if(U.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return this}};$h=Symbol.toStringTag;G[$h]=(i=>{i.type=U.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._nullCount=-1,i._byteLength=-1,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;let t=Object.keys(A).map(e=>A[e]).filter(e=>typeof e=="number"&&e!==A.NONE);for(let e of t){let r=Nt.getVisitFnByTypeId(e),n=ee.getVisitFnByTypeId(e),o=jr.getVisitFnByTypeId(e),c=Ee.getVisitFnByTypeId(e);Yh[e]={get:r,set:n,indexOf:o,byteLength:c},Xh[e]=Object.create(i,{isValid:{value:Qi(Fn)},get:{value:Qi(Nt.getVisitFnByTypeId(e))},set:{value:lo(ee.getVisitFnByTypeId(e))},indexOf:{value:co(jr.getVisitFnByTypeId(e))},getByteLength:{value:Qi(Ee.getVisitFnByTypeId(e))}})}return"Vector"})(G.prototype);var Yr=class extends G{constructor(t){super(t.data);let e=this.get,r=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(c){let h=o[c];if(h!==void 0)return h;let m=e.call(this,c);return o[c]=m,m}}),Object.defineProperty(this,"set",{value(c,h){r.call(this,c,h),o[c]=h}}),Object.defineProperty(this,"slice",{value:(c,h)=>new Yr(n.call(this,c,h))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new G(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Gh(i){if(!i||i.length<=0)return function(n){return!0};let t="",e=i.filter(r=>r===r);return e.length>0&&(t=`
1
+ "use strict";var duckdb=(()=>{var Q0=Object.create;var ms=Object.defineProperty;var tw=Object.getOwnPropertyDescriptor;var ew=Object.getOwnPropertyNames;var iw=Object.getPrototypeOf,rw=Object.prototype.hasOwnProperty;var nw=(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 new Error('Dynamic require of "'+i+'" is not supported')});var bs=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),hr=(i,t)=>{for(var e in t)ms(i,e,{get:t[e],enumerable:!0})},gf=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ew(t))!rw.call(i,n)&&n!==e&&ms(i,n,{get:()=>t[n],enumerable:!(r=tw(t,n))||r.enumerable});return i};var vf=(i,t,e)=>(e=i!=null?Q0(iw(i)):{},gf(t||!i||!i.__esModule?ms(e,"default",{value:i,enumerable:!0}):e,i)),sw=i=>gf(ms({},"__esModule",{value:!0}),i);var Hf=bs((tI,ws)=>{var wf,jf,Sf,If,Af,Cf,xf,Ff,Bf,gs,ha,Tf,Df,Ef,kr,kf,Of,Mf,Rf,Uf,Nf,Lf,Pf,Vf,vs;(function(i){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){i(e(t,e(r)))}):typeof ws=="object"&&typeof ws.exports=="object"?i(e(t,e(ws.exports))):i(e(t));function e(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,c){return r[o]=n?n(o,c):c}}})(function(i){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])};wf=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function o(){this.constructor=r}r.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)},jf=Object.assign||function(r){for(var n,o=1,c=arguments.length;o<c;o++){n=arguments[o];for(var h in n)Object.prototype.hasOwnProperty.call(n,h)&&(r[h]=n[h])}return r},Sf=function(r,n){var o={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&n.indexOf(c)<0&&(o[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var h=0,c=Object.getOwnPropertySymbols(r);h<c.length;h++)n.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(r,c[h])&&(o[c[h]]=r[c[h]]);return o},If=function(r,n,o,c){var h=arguments.length,m=h<3?n:c===null?c=Object.getOwnPropertyDescriptor(n,o):c,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,n,o,c);else for(var C=r.length-1;C>=0;C--)(v=r[C])&&(m=(h<3?v(m):h>3?v(n,o,m):v(n,o))||m);return h>3&&m&&Object.defineProperty(n,o,m),m},Af=function(r,n){return function(o,c){n(o,c,r)}},Cf=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},xf=function(r,n,o,c){function h(m){return m instanceof o?m:new o(function(v){v(m)})}return new(o||(o=Promise))(function(m,v){function C(k){try{F(c.next(k))}catch(lt){v(lt)}}function B(k){try{F(c.throw(k))}catch(lt){v(lt)}}function F(k){k.done?m(k.value):h(k.value).then(C,B)}F((c=c.apply(r,n||[])).next())})},Ff=function(r,n){var o={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},c,h,m,v;return v={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function C(F){return function(k){return B([F,k])}}function B(F){if(c)throw new TypeError("Generator is already executing.");for(;o;)try{if(c=1,h&&(m=F[0]&2?h.return:F[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,F[1])).done)return m;switch(h=0,m&&(F=[F[0]&2,m.value]),F[0]){case 0:case 1:m=F;break;case 4:return o.label++,{value:F[1],done:!1};case 5:o.label++,h=F[1],F=[0];continue;case 7:F=o.ops.pop(),o.trys.pop();continue;default:if(m=o.trys,!(m=m.length>0&&m[m.length-1])&&(F[0]===6||F[0]===2)){o=0;continue}if(F[0]===3&&(!m||F[1]>m[0]&&F[1]<m[3])){o.label=F[1];break}if(F[0]===6&&o.label<m[1]){o.label=m[1],m=F;break}if(m&&o.label<m[2]){o.label=m[2],o.ops.push(F);break}m[2]&&o.ops.pop(),o.trys.pop();continue}F=n.call(r,o)}catch(k){F=[6,k],h=0}finally{c=m=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}},Bf=function(r,n){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&vs(n,r,o)},vs=Object.create?function(r,n,o,c){c===void 0&&(c=o);var h=Object.getOwnPropertyDescriptor(n,o);(!h||("get"in h?!n.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(r,c,h)}:function(r,n,o,c){c===void 0&&(c=o),r[c]=n[o]},gs=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,o=n&&r[n],c=0;if(o)return o.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&c>=r.length&&(r=void 0),{value:r&&r[c++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},ha=function(r,n){var o=typeof Symbol=="function"&&r[Symbol.iterator];if(!o)return r;var c=o.call(r),h,m=[],v;try{for(;(n===void 0||n-- >0)&&!(h=c.next()).done;)m.push(h.value)}catch(C){v={error:C}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(v)throw v.error}}return m},Tf=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ha(arguments[n]));return r},Df=function(){for(var r=0,n=0,o=arguments.length;n<o;n++)r+=arguments[n].length;for(var c=Array(r),h=0,n=0;n<o;n++)for(var m=arguments[n],v=0,C=m.length;v<C;v++,h++)c[h]=m[v];return c},Ef=function(r,n,o){if(o||arguments.length===2)for(var c=0,h=n.length,m;c<h;c++)(m||!(c in n))&&(m||(m=Array.prototype.slice.call(n,0,c)),m[c]=n[c]);return r.concat(m||Array.prototype.slice.call(n))},kr=function(r){return this instanceof kr?(this.v=r,this):new kr(r)},kf=function(r,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=o.apply(r,n||[]),h,m=[];return h={},v("next"),v("throw"),v("return"),h[Symbol.asyncIterator]=function(){return this},h;function v(ct){c[ct]&&(h[ct]=function(mt){return new Promise(function(Dt,ae){m.push([ct,mt,Dt,ae])>1||C(ct,mt)})})}function C(ct,mt){try{B(c[ct](mt))}catch(Dt){lt(m[0][3],Dt)}}function B(ct){ct.value instanceof kr?Promise.resolve(ct.value.v).then(F,k):lt(m[0][2],ct)}function F(ct){C("next",ct)}function k(ct){C("throw",ct)}function lt(ct,mt){ct(mt),m.shift(),m.length&&C(m[0][0],m[0][1])}},Of=function(r){var n,o;return n={},c("next"),c("throw",function(h){throw h}),c("return"),n[Symbol.iterator]=function(){return this},n;function c(h,m){n[h]=r[h]?function(v){return(o=!o)?{value:kr(r[h](v)),done:h==="return"}:m?m(v):v}:m}},Mf=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],o;return n?n.call(r):(r=typeof gs=="function"?gs(r):r[Symbol.iterator](),o={},c("next"),c("throw"),c("return"),o[Symbol.asyncIterator]=function(){return this},o);function c(m){o[m]=r[m]&&function(v){return new Promise(function(C,B){v=r[m](v),h(C,B,v.done,v.value)})}}function h(m,v,C,B){Promise.resolve(B).then(function(F){m({value:F,done:C})},v)}},Rf=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var e=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Uf=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&vs(n,r,o);return e(n,r),n},Nf=function(r){return r&&r.__esModule?r:{default:r}},Lf=function(r,n,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!c:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(r):c?c.value:n.get(r)},Pf=function(r,n,o,c,h){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!h)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!h:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?h.call(r,o):h?h.value=o:n.set(r,o),o},Vf=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},i("__extends",wf),i("__assign",jf),i("__rest",Sf),i("__decorate",If),i("__param",Af),i("__metadata",Cf),i("__awaiter",xf),i("__generator",Ff),i("__exportStar",Bf),i("__createBinding",vs),i("__values",gs),i("__read",ha),i("__spread",Tf),i("__spreadArrays",Df),i("__spreadArray",Ef),i("__await",kr),i("__asyncGenerator",kf),i("__asyncDelegator",Of),i("__asyncValues",Mf),i("__makeTemplateObject",Rf),i("__importStar",Uf),i("__importDefault",Nf),i("__classPrivateFieldGet",Lf),i("__classPrivateFieldSet",Pf),i("__classPrivateFieldIn",Vf)})});var dl=bs(()=>{});var Fp=bs(()=>{});var Mp=bs((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(i){return Object.prototype.toString.call(i)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(i){return typeof i=="object"&&i.buffer&&i.buffer.constructor===ArrayBuffer});var createOutputMethod=function(i,t){return function(e){return new Sha256(t,!0).update(e)[i]()}},createMethod=function(i){var t=createOutputMethod("hex",i);NODE_JS&&(t=nodeWrap(t,i)),t.create=function(){return new Sha256(i)},t.update=function(n){return t.create().update(n)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createOutputMethod(r,i)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(i){if(typeof i=="string")return crypto.createHash(algorithm).update(i,"utf8").digest("hex");if(i==null)throw new Error(ERROR);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(i)).digest("hex"):method(i)};return nodeMethod},createHmacOutputMethod=function(i,t){return function(e,r){return new HmacSha256(e,t,!0).update(r)[i]()}},createHmacMethod=function(i){var t=createHmacOutputMethod("hex",i);t.create=function(n){return new HmacSha256(n,i)},t.update=function(n,o){return t.create(n).update(o)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createHmacOutputMethod(r,i)}return t};function Sha256(i,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i?(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=i}Sha256.prototype.update=function(i){if(!this.finalized){var t,e=typeof i;if(e!=="string"){if(e==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var r,n=0,o,c=i.length,h=this.blocks;n<c;){if(this.hashed&&(this.hashed=!1,h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),t)for(o=this.start;n<c&&o<64;++n)h[o>>2]|=i[n]<<SHIFT[o++&3];else for(o=this.start;n<c&&o<64;++n)r=i.charCodeAt(n),r<128?h[o>>2]|=r<<SHIFT[o++&3]:r<2048?(h[o>>2]|=(192|r>>6)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]):r<55296||r>=57344?(h[o>>2]|=(224|r>>12)<<SHIFT[o++&3],h[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]):(r=65536+((r&1023)<<10|i.charCodeAt(++n)&1023),h[o>>2]|=(240|r>>18)<<SHIFT[o++&3],h[o>>2]|=(128|r>>12&63)<<SHIFT[o++&3],h[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=h[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}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var i=this.blocks,t=this.lastByteIndex;i[16]=this.block,i[t>>2]|=EXTRA[t&3],this.block=i[16],t>=56&&(this.hashed||this.hash(),i[0]=this.block,i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),i[14]=this.hBytes<<3|this.bytes>>>29,i[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,h=this.h7,m=this.blocks,v,C,B,F,k,lt,ct,mt,Dt,ae,he;for(v=16;v<64;++v)k=m[v-15],C=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,k=m[v-2],B=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,m[v]=m[v-16]+C+m[v-7]+B<<0;for(he=t&e,v=0;v<64;v+=4)this.first?(this.is224?(mt=300032,k=m[0]-1413257819,h=k-150054599<<0,r=k+24177077<<0):(mt=704751109,k=m[0]-210244248,h=k-1521486534<<0,r=k+143694565<<0),this.first=!1):(C=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),B=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),mt=i&t,F=mt^i&e^he,ct=n&o^~n&c,k=h+B+ct+K[v]+m[v],lt=C+F,h=r+k<<0,r=k+lt<<0),C=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),B=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),Dt=r&i,F=Dt^r&t^mt,ct=h&n^~h&o,k=c+B+ct+K[v+1]+m[v+1],lt=C+F,c=e+k<<0,e=k+lt<<0,C=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),B=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),ae=e&r,F=ae^e&i^Dt,ct=c&h^~c&n,k=o+B+ct+K[v+2]+m[v+2],lt=C+F,o=t+k<<0,t=k+lt<<0,C=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),B=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),he=t&e,F=he^t&r^ae,ct=o&c^~o&h,k=n+B+ct+K[v+3]+m[v+3],lt=C+F,n=i+k<<0,i=k+lt<<0;this.h0=this.h0+i<<0,this.h1=this.h1+t<<0,this.h2=this.h2+e<<0,this.h3=this.h3+r<<0,this.h4=this.h4+n<<0,this.h5=this.h5+o<<0,this.h6=this.h6+c<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,h=this.h7,m=HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15];return this.is224||(m+=HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]),m},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,h=this.h7,m=[i>>24&255,i>>16&255,i>>8&255,i&255,t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,n>>24&255,n>>16&255,n>>8&255,n&255,o>>24&255,o>>16&255,o>>8&255,o&255,c>>24&255,c>>16&255,c>>8&255,c&255];return this.is224||m.push(h>>24&255,h>>16&255,h>>8&255,h&255),m},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var i=new ArrayBuffer(this.is224?28:32),t=new DataView(i);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),i};function HmacSha256(i,t,e){var r,n=typeof i;if(n==="string"){var o=[],c=i.length,h=0,m;for(r=0;r<c;++r)m=i.charCodeAt(r),m<128?o[h++]=m:m<2048?(o[h++]=192|m>>6,o[h++]=128|m&63):m<55296||m>=57344?(o[h++]=224|m>>12,o[h++]=128|m>>6&63,o[h++]=128|m&63):(m=65536+((m&1023)<<10|i.charCodeAt(++r)&1023),o[h++]=240|m>>18,o[h++]=128|m>>12&63,o[h++]=128|m>>6&63,o[h++]=128|m&63);i=o}else if(n==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);i.length>64&&(i=new Sha256(t,!0).update(i).array());var v=[],C=[];for(r=0;r<64;++r){var B=i[r]||0;v[r]=92^B,C[r]=54^B}Sha256.call(this,t,e),this.update(C),this.oKeyPad=v,this.inner=!0,this.sharedMemory=e}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var i=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(i),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var JS={};hr(JS,{registerWorker:()=>Np});var zf=vf(Hf(),1),{__extends:eI,__assign:iI,__rest:Wf,__decorate:rI,__param:nI,__metadata:sI,__awaiter:O,__generator:oI,__exportStar:aI,__createBinding:lI,__values:cI,__read:uI,__spread:dI,__spreadArrays:fI,__spreadArray:hI,__await:it,__asyncGenerator:_e,__asyncDelegator:Or,__asyncValues:Ne,__makeTemplateObject:pI,__importStar:yI,__importDefault:_I,__classPrivateFieldGet:mI,__classPrivateFieldSet:bI,__classPrivateFieldIn:gI}=zf.default;var ga={};hr(ga,{compareArrayLike:()=>ba,joinUint8Arrays:()=>Be,memcpy:()=>Rr,rebaseValueOffsets:()=>mn,toArrayBufferView:()=>rt,toArrayBufferViewAsyncIterator:()=>Xe,toArrayBufferViewIterator:()=>ai,toBigInt64Array:()=>fw,toBigUint64Array:()=>yw,toFloat32Array:()=>_w,toFloat32ArrayAsyncIterator:()=>Ew,toFloat32ArrayIterator:()=>Iw,toFloat64Array:()=>mw,toFloat64ArrayAsyncIterator:()=>kw,toFloat64ArrayIterator:()=>Aw,toInt16Array:()=>dw,toInt16ArrayAsyncIterator:()=>Fw,toInt16ArrayIterator:()=>vw,toInt32Array:()=>pr,toInt32ArrayAsyncIterator:()=>Bw,toInt32ArrayIterator:()=>ww,toInt8Array:()=>uw,toInt8ArrayAsyncIterator:()=>xw,toInt8ArrayIterator:()=>gw,toUint16Array:()=>hw,toUint16ArrayAsyncIterator:()=>Tw,toUint16ArrayIterator:()=>jw,toUint32Array:()=>pw,toUint32ArrayAsyncIterator:()=>Dw,toUint32ArrayIterator:()=>Sw,toUint8Array:()=>Y,toUint8ArrayAsyncIterator:()=>ma,toUint8ArrayIterator:()=>_a,toUint8ClampedArray:()=>bw,toUint8ClampedArrayAsyncIterator:()=>Ow,toUint8ClampedArrayIterator:()=>Cw});var ow=new TextDecoder("utf-8"),pn=i=>ow.decode(i),aw=new TextEncoder,Xi=i=>aw.encode(i);var[jI,js]=(()=>{let i=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw i()}return t.asIntN=()=>{throw i()},t.asUintN=()=>{throw i()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[yn,SI]=(()=>{let i=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Mr,II]=(()=>{let i=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})();var lw=i=>typeof i=="number",$f=i=>typeof i=="boolean",zt=i=>typeof i=="function",ce=i=>i!=null&&Object(i)===i,$e=i=>ce(i)&&zt(i.then);var Ye=i=>ce(i)&&zt(i[Symbol.iterator]),Le=i=>ce(i)&&zt(i[Symbol.asyncIterator]),Ss=i=>ce(i)&&ce(i.schema);var Is=i=>ce(i)&&"done"in i&&"value"in i;var As=i=>ce(i)&&zt(i.stat)&&lw(i.fd);var Cs=i=>ce(i)&&_n(i.body),xs=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Yf=i=>ce(i)&&zt(i.abort)&&zt(i.getWriter)&&!xs(i),_n=i=>ce(i)&&zt(i.cancel)&&zt(i.getReader)&&!xs(i),Xf=i=>ce(i)&&zt(i.end)&&zt(i.write)&&$f(i.writable)&&!xs(i),Fs=i=>ce(i)&&zt(i.read)&&zt(i.pipe)&&$f(i.readable)&&!xs(i),Gf=i=>ce(i)&&zt(i.clear)&&zt(i.bytes)&&zt(i.position)&&zt(i.setPosition)&&zt(i.capacity)&&zt(i.getBufferIdentifier)&&zt(i.createLong);var ya=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function cw(i){let t=i[0]?[i[0]]:[],e,r,n,o;for(let c,h,m=0,v=0,C=i.length;++m<C;){if(c=t[v],h=i[m],!c||!h||c.buffer!==h.buffer||h.byteOffset<c.byteOffset){h&&(t[++v]=h);continue}if({byteOffset:e,byteLength:n}=c,{byteOffset:r,byteLength:o}=h,e+n<r||r+o<e){h&&(t[++v]=h);continue}t[v]=new Uint8Array(c.buffer,e,r-e+o)}return t}function Rr(i,t,e=0,r=t.byteLength){let n=i.byteLength,o=new Uint8Array(i.buffer,i.byteOffset,n),c=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,n));return o.set(c,e),i}function Be(i,t){let e=cw(i),r=e.reduce((C,B)=>C+B.byteLength,0),n,o,c,h=0,m=-1,v=Math.min(t||Number.POSITIVE_INFINITY,r);for(let C=e.length;++m<C;){if(n=e[m],o=n.subarray(0,Math.min(n.length,v-h)),v<=h+o.length){o.length<n.length?e[m]=n.subarray(o.length):o.length===n.length&&m++,c?Rr(c,o,h):c=o;break}Rr(c||(c=new Uint8Array(v)),o,h),h+=o.length}return[c||new Uint8Array(0),e.slice(m),r-(c?c.byteLength:0)]}function rt(i,t){let e=Is(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Xi(e)),e instanceof ArrayBuffer?new i(e):e instanceof ya?new i(e):Gf(e)?rt(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 uw=i=>rt(Int8Array,i),dw=i=>rt(Int16Array,i),pr=i=>rt(Int32Array,i),fw=i=>rt(yn,i),Y=i=>rt(Uint8Array,i),hw=i=>rt(Uint16Array,i),pw=i=>rt(Uint32Array,i),yw=i=>rt(Mr,i),_w=i=>rt(Float32Array,i),mw=i=>rt(Float64Array,i),bw=i=>rt(Uint8ClampedArray,i),pa=i=>(i.next(),i);function*ai(i,t){let e=function*(n){yield n},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ya?e(t):Ye(t)?t:e(t);return yield*pa(function*(n){let o=null;do o=n.next(yield rt(i,o));while(!o.done)}(r[Symbol.iterator]())),new i}var gw=i=>ai(Int8Array,i),vw=i=>ai(Int16Array,i),ww=i=>ai(Int32Array,i),_a=i=>ai(Uint8Array,i),jw=i=>ai(Uint16Array,i),Sw=i=>ai(Uint32Array,i),Iw=i=>ai(Float32Array,i),Aw=i=>ai(Float64Array,i),Cw=i=>ai(Uint8ClampedArray,i);function Xe(i,t){return _e(this,arguments,function*(){if($e(t))return yield it(yield it(yield*Or(Ne(Xe(i,yield it(t))))));let r=function(c){return _e(this,arguments,function*(){yield yield it(yield it(c))})},n=function(c){return _e(this,arguments,function*(){yield it(yield*Or(Ne(pa(function*(h){let m=null;do m=h.next(yield m==null?void 0:m.value);while(!m.done)}(c[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ya?r(t):Ye(t)?n(t):Le(t)?t:r(t);return yield it(yield*Or(Ne(pa(function(c){return _e(this,arguments,function*(){let h=null;do h=yield it(c.next(yield yield it(rt(i,h))));while(!h.done)})}(o[Symbol.asyncIterator]()))))),yield it(new i)})}var xw=i=>Xe(Int8Array,i),Fw=i=>Xe(Int16Array,i),Bw=i=>Xe(Int32Array,i),ma=i=>Xe(Uint8Array,i),Tw=i=>Xe(Uint16Array,i),Dw=i=>Xe(Uint32Array,i),Ew=i=>Xe(Float32Array,i),kw=i=>Xe(Float64Array,i),Ow=i=>Xe(Uint8ClampedArray,i);function mn(i,t,e){if(i!==0){e=e.slice(0,t+1);for(let r=-1;++r<=t;)e[r]+=i}return e}function ba(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 Qt={fromIterable(i){return Bs(Mw(i))},fromAsyncIterable(i){return Bs(Rw(i))},fromDOMStream(i){return Bs(Uw(i))},fromNodeStream(i){return Bs(Nw(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')}},Bs=i=>(i.next(),i);function*Mw(i){let t,e=!1,r=[],n,o,c,h=0;function m(){return o==="peek"?Be(r,c)[0]:([n,r,h]=Be(r,c),n)}({cmd:o,size:c}=yield null);let v=_a(i)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(c-h)?v.next():v.next(c-h),!t&&n.byteLength>0&&(r.push(n),h+=n.byteLength),t||c<=h)do({cmd:o,size:c}=yield m());while(c<h);while(!t)}catch(C){(e=!0)&&typeof v.throw=="function"&&v.throw(C)}finally{e===!1&&typeof v.return=="function"&&v.return(null)}return null}function Rw(i){return _e(this,arguments,function*(){let e,r=!1,n=[],o,c,h,m=0;function v(){return c==="peek"?Be(n,h)[0]:([o,n,m]=Be(n,h),o)}({cmd:c,size:h}=yield yield it(null));let C=ma(i)[Symbol.asyncIterator]();try{do if({done:e,value:o}=Number.isNaN(h-m)?yield it(C.next()):yield it(C.next(h-m)),!e&&o.byteLength>0&&(n.push(o),m+=o.byteLength),e||h<=m)do({cmd:c,size:h}=yield yield it(v()));while(h<m);while(!e)}catch(B){(r=!0)&&typeof C.throw=="function"&&(yield it(C.throw(B)))}finally{r===!1&&typeof C.return=="function"&&(yield it(C.return(new Uint8Array(0))))}return yield it(null)})}function Uw(i){return _e(this,arguments,function*(){let e=!1,r=!1,n=[],o,c,h,m=0;function v(){return c==="peek"?Be(n,h)[0]:([o,n,m]=Be(n,h),o)}({cmd:c,size:h}=yield yield it(null));let C=new wa(i);try{do if({done:e,value:o}=Number.isNaN(h-m)?yield it(C.read()):yield it(C.read(h-m)),!e&&o.byteLength>0&&(n.push(Y(o)),m+=o.byteLength),e||h<=m)do({cmd:c,size:h}=yield yield it(v()));while(h<m);while(!e)}catch(B){(r=!0)&&(yield it(C.cancel(B)))}finally{r===!1?yield it(C.cancel()):i.locked&&C.releaseLock()}return yield it(null)})}var wa=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 O(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 O(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=Y(e)),e})}},va=(i,t)=>{let e=n=>r([t,n]),r;return[t,e,new Promise(n=>(r=n)&&i.once(t,e))]};function Nw(i){return _e(this,arguments,function*(){let e=[],r="error",n=!1,o=null,c,h,m=0,v=[],C;function B(){return c==="peek"?Be(v,h)[0]:([C,v,m]=Be(v,h),C)}if({cmd:c,size:h}=yield yield it(null),i.isTTY)return yield yield it(new Uint8Array(0)),yield it(null);try{e[0]=va(i,"end"),e[1]=va(i,"error");do{if(e[2]=va(i,"readable"),[r,o]=yield it(Promise.race(e.map(k=>k[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(h-m)?(C=Y(i.read(h-m)),C.byteLength<h-m&&(C=Y(i.read()))):C=Y(i.read()),C.byteLength>0&&(v.push(C),m+=C.byteLength)),n||h<=m)do({cmd:c,size:h}=yield yield it(B()));while(h<m)}while(!n)}finally{yield it(F(e,r==="error"?o:null))}return yield it(null);function F(k,lt){return C=v=null,new Promise((ct,mt)=>{for(let[Dt,ae]of k)i.off(Dt,ae);try{let Dt=i.destroy;Dt&&Dt.call(i,lt),lt=void 0}catch(Dt){lt=Dt||lt}finally{lt!=null?mt(lt):ct()}})}})}var Wt;(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"})(Wt||(Wt={}));var Ft;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Ft||(Ft={}));var It;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(It||(It={}));var te;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(te||(te={}));var ot;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(ot||(ot={}));var ue;(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"})(ue||(ue={}));var ut;(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"})(ut||(ut={}));var A;(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.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"})(A||(A={}));var Pe;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Pe||(Pe={}));var Na={};hr(Na,{clampIndex:()=>Fj,clampRange:()=>vn,createElementComparator:()=>qi});function Ge(i){if(i===null)return"null";if(i===void 0)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>Ge(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}var Sa={};hr(Sa,{BN:()=>yr,bignumToBigInt:()=>Ts,bignumToString:()=>Gi,isArrowBigNumSymbol:()=>Kf});var Kf=Symbol.for("isArrowBigNum");function Ke(i,...t){return t.length===0?Object.setPrototypeOf(rt(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Ke.prototype[Kf]=!0;Ke.prototype.toJSON=function(){return`"${Gi(this)}"`};Ke.prototype.valueOf=function(){return Jf(this)};Ke.prototype.toString=function(){return Gi(this)};Ke.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return Jf(this);case"string":return Gi(this);case"default":return Ts(this)}return Gi(this)};function Ur(...i){return Ke.apply(this,i)}function Nr(...i){return Ke.apply(this,i)}function bn(...i){return Ke.apply(this,i)}Object.setPrototypeOf(Ur.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Nr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(bn.prototype,Object.create(Uint32Array.prototype));Object.assign(Ur.prototype,Ke.prototype,{constructor:Ur,signed:!0,TypedArray:Int32Array,BigIntArray:yn});Object.assign(Nr.prototype,Ke.prototype,{constructor:Nr,signed:!1,TypedArray:Uint32Array,BigIntArray:Mr});Object.assign(bn.prototype,Ke.prototype,{constructor:bn,signed:!0,TypedArray:Uint32Array,BigIntArray:Mr});function Jf(i){let{buffer:t,byteOffset:e,length:r,signed:n}=i,o=new Mr(t,e,r),c=n&&o[o.length-1]&BigInt(1)<<BigInt(63),h=BigInt(c?1:0),m=BigInt(0);if(c){for(let v of o)h+=~v*(BigInt(1)<<BigInt(32)*m++);h*=BigInt(-1)}else for(let v of o)h+=v*(BigInt(1)<<BigInt(32)*m++);return h}var Gi,Ts;js?(Ts=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:ja(i),Gi=i=>i.byteLength===8?`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`:ja(i)):(Gi=ja,Ts=Gi);function ja(i){let t="",e=new Uint32Array(2),r=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),n=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,c=r.length-1;do{for(e[0]=r[o=0];o<c;)r[o++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[o];r[o]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(n[0]||n[1]||n[2]||n[3]);return t||"0"}var yr=class{static new(t,e){switch(e){case!0:return new Ur(t);case!1:return new Nr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case yn:return new Ur(t)}return t.byteLength===16?new bn(t):new Nr(t)}static signed(t){return new Ur(t)}static unsigned(t){return new Nr(t)}static decimal(t){return new bn(t)}constructor(t,e){return yr.new(t,e)}};var qf,Zf,Qf,th,eh,ih,rh,nh,sh,oh,ah,lh,ch,uh,dh,fh,hh,ph,yh,R=class{static isNull(t){return(t==null?void 0:t.typeId)===A.Null}static isInt(t){return(t==null?void 0:t.typeId)===A.Int}static isFloat(t){return(t==null?void 0:t.typeId)===A.Float}static isBinary(t){return(t==null?void 0:t.typeId)===A.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===A.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===A.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===A.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===A.Date}static isTime(t){return(t==null?void 0:t.typeId)===A.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===A.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===A.Interval}static isList(t){return(t==null?void 0:t.typeId)===A.List}static isStruct(t){return(t==null?void 0:t.typeId)===A.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===A.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===A.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===A.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===A.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===A.Dictionary}static isDenseUnion(t){return R.isUnion(t)&&t.mode===Ft.Dense}static isSparseUnion(t){return R.isUnion(t)&&t.mode===Ft.Sparse}get typeId(){return A.NONE}};qf=Symbol.toStringTag;R[qf]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(R.prototype);var de=class extends R{toString(){return"Null"}get typeId(){return A.Null}};Zf=Symbol.toStringTag;de[Zf]=(i=>i[Symbol.toStringTag]="Null")(de.prototype);var Ot=class extends R{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return A.Int}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 ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};Qf=Symbol.toStringTag;Ot[Qf]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Ot.prototype);var Ds=class extends Ot{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Es=class extends Ot{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},li=class extends Ot{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},ks=class extends Ot{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Os=class extends Ot{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Ms=class extends Ot{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Rs=class extends Ot{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Us=class extends Ot{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Ds.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Es.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(li.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(ks.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Os.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Ms.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Rs.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Us.prototype,"ArrayType",{value:BigUint64Array});var me=class extends R{constructor(t){super(),this.precision=t}get typeId(){return A.Float}get ArrayType(){switch(this.precision){case It.HALF:return Uint16Array;case It.SINGLE:return Float32Array;case It.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};th=Symbol.toStringTag;me[th]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(me.prototype);var Ns=class extends me{constructor(){super(It.HALF)}},Ls=class extends me{constructor(){super(It.SINGLE)}},Ps=class extends me{constructor(){super(It.DOUBLE)}};Object.defineProperty(Ns.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ls.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ps.prototype,"ArrayType",{value:Float64Array});var xi=class extends R{constructor(){super()}get typeId(){return A.Binary}toString(){return"Binary"}};eh=Symbol.toStringTag;xi[eh]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(xi.prototype);var Fi=class extends R{constructor(){super()}get typeId(){return A.Utf8}toString(){return"Utf8"}};ih=Symbol.toStringTag;Fi[ih]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(Fi.prototype);var Bi=class extends R{constructor(){super()}get typeId(){return A.Bool}toString(){return"Bool"}};rh=Symbol.toStringTag;Bi[rh]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(Bi.prototype);var Ti=class extends R{constructor(t,e,r=128){super(),this.scale=t,this.precision=e,this.bitWidth=r}get typeId(){return A.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};nh=Symbol.toStringTag;Ti[nh]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Ti.prototype);var Di=class extends R{constructor(t){super(),this.unit=t}get typeId(){return A.Date}toString(){return`Date${(this.unit+1)*32}<${te[this.unit]}>`}};sh=Symbol.toStringTag;Di[sh]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(Di.prototype);var Je=class extends R{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return A.Time}toString(){return`Time${this.bitWidth}<${ot[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};oh=Symbol.toStringTag;Je[oh]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Je.prototype);var Ei=class extends R{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return A.Timestamp}toString(){return`Timestamp<${ot[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};ah=Symbol.toStringTag;Ei[ah]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(Ei.prototype);var ki=class extends R{constructor(t){super(),this.unit=t}get typeId(){return A.Interval}toString(){return`Interval<${ue[this.unit]}>`}};lh=Symbol.toStringTag;ki[lh]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(ki.prototype);var qe=class extends R{constructor(t){super(),this.children=[t]}get typeId(){return A.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ch=Symbol.toStringTag;qe[ch]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(qe.prototype);var vt=class extends R{constructor(t){super(),this.children=t}get typeId(){return A.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};uh=Symbol.toStringTag;vt[uh]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(vt.prototype);var Ze=class extends R{constructor(t,e,r){super(),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,o,c)=>(n[o]=c)&&n||n,Object.create(null))}get typeId(){return A.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};dh=Symbol.toStringTag;Ze[dh]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(Ze.prototype);var Oi=class extends R{constructor(t){super(),this.byteWidth=t}get typeId(){return A.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};fh=Symbol.toStringTag;Oi[fh]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Oi.prototype);var Qe=class extends R{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return A.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};hh=Symbol.toStringTag;Qe[hh]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(Qe.prototype);var ti=class extends R{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return A.Map}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<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};ph=Symbol.toStringTag;ti[ph]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(ti.prototype);var Lw=(i=>()=>++i)(-1),Te=class extends R{constructor(t,e,r,n){super(),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=r==null?Lw():typeof r=="number"?r:r.low}get typeId(){return A.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};yh=Symbol.toStringTag;Te[yh]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(Te.prototype);function De(i){let t=i;switch(i.typeId){case A.Decimal:return i.bitWidth/32;case A.Timestamp:return 2;case A.Date:return 1+t.unit;case A.Interval:return 1+t.unit;case A.FixedSizeList:return t.listSize;case A.FixedSizeBinary:return t.byteWidth;default:return 1}}var V=class{visitMany(t,...e){return t.map((r,n)=>this.visit(r,...e.map(o=>o[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return Pw(this,t,e)}getVisitFnByTypeId(t,e=!0){return Lr(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}visitBinary(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}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function Pw(i,t,e=!0){return typeof t=="number"?Lr(i,t,e):typeof t=="string"&&t in A?Lr(i,A[t],e):t&&t instanceof R?Lr(i,_h(t),e):(t==null?void 0:t.type)&&t.type instanceof R?Lr(i,_h(t.type),e):Lr(i,A.NONE,e)}function Lr(i,t,e=!0){let r=null;switch(t){case A.Null:r=i.visitNull;break;case A.Bool:r=i.visitBool;break;case A.Int:r=i.visitInt;break;case A.Int8:r=i.visitInt8||i.visitInt;break;case A.Int16:r=i.visitInt16||i.visitInt;break;case A.Int32:r=i.visitInt32||i.visitInt;break;case A.Int64:r=i.visitInt64||i.visitInt;break;case A.Uint8:r=i.visitUint8||i.visitInt;break;case A.Uint16:r=i.visitUint16||i.visitInt;break;case A.Uint32:r=i.visitUint32||i.visitInt;break;case A.Uint64:r=i.visitUint64||i.visitInt;break;case A.Float:r=i.visitFloat;break;case A.Float16:r=i.visitFloat16||i.visitFloat;break;case A.Float32:r=i.visitFloat32||i.visitFloat;break;case A.Float64:r=i.visitFloat64||i.visitFloat;break;case A.Utf8:r=i.visitUtf8;break;case A.Binary:r=i.visitBinary;break;case A.FixedSizeBinary:r=i.visitFixedSizeBinary;break;case A.Date:r=i.visitDate;break;case A.DateDay:r=i.visitDateDay||i.visitDate;break;case A.DateMillisecond:r=i.visitDateMillisecond||i.visitDate;break;case A.Timestamp:r=i.visitTimestamp;break;case A.TimestampSecond:r=i.visitTimestampSecond||i.visitTimestamp;break;case A.TimestampMillisecond:r=i.visitTimestampMillisecond||i.visitTimestamp;break;case A.TimestampMicrosecond:r=i.visitTimestampMicrosecond||i.visitTimestamp;break;case A.TimestampNanosecond:r=i.visitTimestampNanosecond||i.visitTimestamp;break;case A.Time:r=i.visitTime;break;case A.TimeSecond:r=i.visitTimeSecond||i.visitTime;break;case A.TimeMillisecond:r=i.visitTimeMillisecond||i.visitTime;break;case A.TimeMicrosecond:r=i.visitTimeMicrosecond||i.visitTime;break;case A.TimeNanosecond:r=i.visitTimeNanosecond||i.visitTime;break;case A.Decimal:r=i.visitDecimal;break;case A.List:r=i.visitList;break;case A.Struct:r=i.visitStruct;break;case A.Union:r=i.visitUnion;break;case A.DenseUnion:r=i.visitDenseUnion||i.visitUnion;break;case A.SparseUnion:r=i.visitSparseUnion||i.visitUnion;break;case A.Dictionary:r=i.visitDictionary;break;case A.Interval:r=i.visitInterval;break;case A.IntervalDayTime:r=i.visitIntervalDayTime||i.visitInterval;break;case A.IntervalYearMonth:r=i.visitIntervalYearMonth||i.visitInterval;break;case A.FixedSizeList:r=i.visitFixedSizeList;break;case A.Map:r=i.visitMap;break}if(typeof r=="function")return r;if(!e)return()=>null;throw new Error(`Unrecognized type '${A[t]}'`)}function _h(i){switch(i.typeId){case A.Null:return A.Null;case A.Int:{let{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?A.Int8:A.Uint8;case 16:return e?A.Int16:A.Uint16;case 32:return e?A.Int32:A.Uint32;case 64:return e?A.Int64:A.Uint64}return A.Int}case A.Float:switch(i.precision){case It.HALF:return A.Float16;case It.SINGLE:return A.Float32;case It.DOUBLE:return A.Float64}return A.Float;case A.Binary:return A.Binary;case A.Utf8:return A.Utf8;case A.Bool:return A.Bool;case A.Decimal:return A.Decimal;case A.Time:switch(i.unit){case ot.SECOND:return A.TimeSecond;case ot.MILLISECOND:return A.TimeMillisecond;case ot.MICROSECOND:return A.TimeMicrosecond;case ot.NANOSECOND:return A.TimeNanosecond}return A.Time;case A.Timestamp:switch(i.unit){case ot.SECOND:return A.TimestampSecond;case ot.MILLISECOND:return A.TimestampMillisecond;case ot.MICROSECOND:return A.TimestampMicrosecond;case ot.NANOSECOND:return A.TimestampNanosecond}return A.Timestamp;case A.Date:switch(i.unit){case te.DAY:return A.DateDay;case te.MILLISECOND:return A.DateMillisecond}return A.Date;case A.Interval:switch(i.unit){case ue.DAY_TIME:return A.IntervalDayTime;case ue.YEAR_MONTH:return A.IntervalYearMonth}return A.Interval;case A.Map:return A.Map;case A.List:return A.List;case A.Struct:return A.Struct;case A.Union:switch(i.mode){case Ft.Dense:return A.DenseUnion;case Ft.Sparse:return A.SparseUnion}return A.Union;case A.FixedSizeBinary:return A.FixedSizeBinary;case A.FixedSizeList:return A.FixedSizeList;case A.Dictionary:return A.Dictionary}throw new Error(`Unrecognized type '${A[i.typeId]}'`)}V.prototype.visitInt8=null;V.prototype.visitInt16=null;V.prototype.visitInt32=null;V.prototype.visitInt64=null;V.prototype.visitUint8=null;V.prototype.visitUint16=null;V.prototype.visitUint32=null;V.prototype.visitUint64=null;V.prototype.visitFloat16=null;V.prototype.visitFloat32=null;V.prototype.visitFloat64=null;V.prototype.visitDateDay=null;V.prototype.visitDateMillisecond=null;V.prototype.visitTimestampSecond=null;V.prototype.visitTimestampMillisecond=null;V.prototype.visitTimestampMicrosecond=null;V.prototype.visitTimestampNanosecond=null;V.prototype.visitTimeSecond=null;V.prototype.visitTimeMillisecond=null;V.prototype.visitTimeMicrosecond=null;V.prototype.visitTimeNanosecond=null;V.prototype.visitDenseUnion=null;V.prototype.visitSparseUnion=null;V.prototype.visitIntervalDayTime=null;V.prototype.visitIntervalYearMonth=null;var Ia={};hr(Ia,{float64ToUint16:()=>gn,uint16ToFloat64:()=>Vs});var mh=new Float64Array(1),Pr=new Uint32Array(mh.buffer);function Vs(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 gn(i){if(i!==i)return 32256;mh[0]=i;let t=(Pr[1]&2147483648)>>16&65535,e=Pr[1]&2146435072,r=0;return e>=1089470464?Pr[0]>0?e=31744:(e=(e&2080374784)>>16,r=(Pr[1]&1048575)>>10):e<=1056964608?(r=1048576+(Pr[1]&1048575),r=1048576+(r<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,r=(Pr[1]&1048575)+512>>10),t|e|r&65535}var X=class extends V{};function et(i){return(t,e,r)=>{if(t.setValid(e,r!=null))return i(t,e,r)}}var Vw=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},Aa=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},Hw=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},zw=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},bh=(i,t,e,r)=>{if(e+1<t.length){let{[e]:n,[e+1]:o}=t;i.set(r.subarray(0,o-n),n)}},Ww=({offset:i,values:t},e,r)=>{let n=i+e;r?t[n>>3]|=1<<n%8:t[n>>3]&=~(1<<n%8)},Mi=({values:i},t,e)=>{i[t]=e},Ca=({values:i},t,e)=>{i[t]=e},gh=({values:i},t,e)=>{i[t]=gn(e)},$w=(i,t,e)=>{switch(i.type.precision){case It.HALF:return gh(i,t,e);case It.SINGLE:case It.DOUBLE:return Ca(i,t,e)}},Hs=({values:i},t,e)=>{Vw(i,t,e.valueOf())},zs=({values:i},t,e)=>{Aa(i,t*2,e.valueOf())},xa=({stride:i,values:t},e,r)=>{t.set(r.subarray(0,i),i*e)},Yw=({values:i,valueOffsets:t},e,r)=>bh(i,t,e,r),Xw=({values:i,valueOffsets:t},e,r)=>{bh(i,t,e,Xi(r))},Fa=(i,t,e)=>{i.type.unit===te.DAY?Hs(i,t,e):zs(i,t,e)},Ws=({values:i},t,e)=>Aa(i,t*2,e/1e3),$s=({values:i},t,e)=>Aa(i,t*2,e),Ys=({values:i},t,e)=>Hw(i,t*2,e),Xs=({values:i},t,e)=>zw(i,t*2,e),Ba=(i,t,e)=>{switch(i.type.unit){case ot.SECOND:return Ws(i,t,e);case ot.MILLISECOND:return $s(i,t,e);case ot.MICROSECOND:return Ys(i,t,e);case ot.NANOSECOND:return Xs(i,t,e)}},Gs=({values:i},t,e)=>{i[t]=e},Ks=({values:i},t,e)=>{i[t]=e},Js=({values:i},t,e)=>{i[t]=e},qs=({values:i},t,e)=>{i[t]=e},Ta=(i,t,e)=>{switch(i.type.unit){case ot.SECOND:return Gs(i,t,e);case ot.MILLISECOND:return Ks(i,t,e);case ot.MICROSECOND:return Js(i,t,e);case ot.NANOSECOND:return qs(i,t,e)}},Da=({values:i,stride:t},e,r)=>{i.set(r.subarray(0,t),t*e)},Gw=(i,t,e)=>{let r=i.children[0],n=i.valueOffsets,o=ee.getVisitFn(r);if(Array.isArray(e))for(let c=-1,h=n[t],m=n[t+1];h<m;)o(r,h++,e[++c]);else for(let c=-1,h=n[t],m=n[t+1];h<m;)o(r,h++,e.get(++c))},Kw=(i,t,e)=>{let r=i.children[0],{valueOffsets:n}=i,o=ee.getVisitFn(r),{[t]:c,[t+1]:h}=n,m=e instanceof Map?e.entries():Object.entries(e);for(let v of m)if(o(r,c,v),++c>=h)break},Jw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[o]),qw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(o)),Zw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(n.name)),Qw=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[n.name]),tj=(i,t,e)=>{let r=i.type.children.map(o=>ee.getVisitFn(o.type)),n=e instanceof Map?Zw(t,e):e instanceof G?qw(t,e):Array.isArray(e)?Jw(t,e):Qw(t,e);i.type.children.forEach((o,c)=>n(r[c],i.children[c],o,c))},ej=(i,t,e)=>{i.type.mode===Ft.Dense?vh(i,t,e):wh(i,t,e)},vh=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ee.visit(n,i.valueOffsets[t],e)},wh=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ee.visit(n,t,e)},ij=(i,t,e)=>{var r;(r=i.dictionary)===null||r===void 0||r.set(i.values[t],e)},Ea=(i,t,e)=>{i.type.unit===ue.DAY_TIME?Zs(i,t,e):Qs(i,t,e)},Zs=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},Qs=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},rj=(i,t,e)=>{let{stride:r}=i,n=i.children[0],o=ee.getVisitFn(n);if(Array.isArray(e))for(let c=-1,h=t*r;++c<r;)o(n,h+c,e[c]);else for(let c=-1,h=t*r;++c<r;)o(n,h+c,e.get(c))};X.prototype.visitBool=et(Ww);X.prototype.visitInt=et(Mi);X.prototype.visitInt8=et(Mi);X.prototype.visitInt16=et(Mi);X.prototype.visitInt32=et(Mi);X.prototype.visitInt64=et(Mi);X.prototype.visitUint8=et(Mi);X.prototype.visitUint16=et(Mi);X.prototype.visitUint32=et(Mi);X.prototype.visitUint64=et(Mi);X.prototype.visitFloat=et($w);X.prototype.visitFloat16=et(gh);X.prototype.visitFloat32=et(Ca);X.prototype.visitFloat64=et(Ca);X.prototype.visitUtf8=et(Xw);X.prototype.visitBinary=et(Yw);X.prototype.visitFixedSizeBinary=et(xa);X.prototype.visitDate=et(Fa);X.prototype.visitDateDay=et(Hs);X.prototype.visitDateMillisecond=et(zs);X.prototype.visitTimestamp=et(Ba);X.prototype.visitTimestampSecond=et(Ws);X.prototype.visitTimestampMillisecond=et($s);X.prototype.visitTimestampMicrosecond=et(Ys);X.prototype.visitTimestampNanosecond=et(Xs);X.prototype.visitTime=et(Ta);X.prototype.visitTimeSecond=et(Gs);X.prototype.visitTimeMillisecond=et(Ks);X.prototype.visitTimeMicrosecond=et(Js);X.prototype.visitTimeNanosecond=et(qs);X.prototype.visitDecimal=et(Da);X.prototype.visitList=et(Gw);X.prototype.visitStruct=et(tj);X.prototype.visitUnion=et(ej);X.prototype.visitDenseUnion=et(vh);X.prototype.visitSparseUnion=et(wh);X.prototype.visitDictionary=et(ij);X.prototype.visitInterval=et(Ea);X.prototype.visitIntervalDayTime=et(Zs);X.prototype.visitIntervalYearMonth=et(Qs);X.prototype.visitFixedSizeList=et(rj);X.prototype.visitMap=et(Kw);var ee=new X;var ei=Symbol.for("parent"),Vr=Symbol.for("rowIndex"),Ki=class{constructor(t,e){return this[ei]=t,this[Vr]=e,new Proxy(this,new Oa)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Vr],e=this[ei],r=e.type.children,n={};for(let o=-1,c=r.length;++o<c;)n[r[o].name]=Ut.visit(e.children[o],t);return n}toString(){return`{${[...this].map(([t,e])=>`${Ge(t)}: ${Ge(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new ka(this[ei],this[Vr])}},ka=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,Ut.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Ki.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ei]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Vr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Oa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ei].type.children.map(e=>e.name)}has(t,e){return t[ei].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[ei].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[ei].type.children.findIndex(n=>n.name===e);if(r!==-1){let n=Ut.visit(t[ei].children[r],t[Vr]);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[ei].type.children.findIndex(o=>o.name===e);return n!==-1?(ee.visit(t[ei].children[n],t[Vr],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}};var H=class extends V{};function q(i){return(t,e)=>t.getValid(e)?i(t,e):null}var nj=(i,t)=>864e5*i[t],Ma=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),sj=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,oj=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,jh=i=>new Date(i),aj=(i,t)=>jh(nj(i,t)),lj=(i,t)=>jh(Ma(i,t)),cj=(i,t)=>null,Sh=(i,t,e)=>{if(e+1>=t.length)return null;let r=t[e],n=t[e+1];return i.subarray(r,n)},uj=({offset:i,values:t},e)=>{let r=i+e;return(t[r>>3]&1<<r%8)!==0},Ih=({values:i},t)=>aj(i,t),Ah=({values:i},t)=>lj(i,t*2),Ji=({stride:i,values:t},e)=>t[i*e],dj=({stride:i,values:t},e)=>Vs(t[i*e]),Ch=({values:i},t)=>i[t],fj=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),hj=({values:i,valueOffsets:t},e)=>Sh(i,t,e),pj=({values:i,valueOffsets:t},e)=>{let r=Sh(i,t,e);return r!==null?pn(r):null},yj=({values:i},t)=>i[t],_j=({type:i,values:t},e)=>i.precision!==It.HALF?t[e]:Vs(t[e]),mj=(i,t)=>i.type.unit===te.DAY?Ih(i,t):Ah(i,t),xh=({values:i},t)=>1e3*Ma(i,t*2),Fh=({values:i},t)=>Ma(i,t*2),Bh=({values:i},t)=>sj(i,t*2),Th=({values:i},t)=>oj(i,t*2),bj=(i,t)=>{switch(i.type.unit){case ot.SECOND:return xh(i,t);case ot.MILLISECOND:return Fh(i,t);case ot.MICROSECOND:return Bh(i,t);case ot.NANOSECOND:return Th(i,t)}},Dh=({values:i},t)=>i[t],Eh=({values:i},t)=>i[t],kh=({values:i},t)=>i[t],Oh=({values:i},t)=>i[t],gj=(i,t)=>{switch(i.type.unit){case ot.SECOND:return Dh(i,t);case ot.MILLISECOND:return Eh(i,t);case ot.MICROSECOND:return kh(i,t);case ot.NANOSECOND:return Oh(i,t)}},vj=({values:i,stride:t},e)=>yr.decimal(i.subarray(t*e,t*(e+1))),wj=(i,t)=>{let{valueOffsets:e,stride:r,children:n}=i,{[t*r]:o,[t*r+1]:c}=e,m=n[0].slice(o,c-o);return new G([m])},jj=(i,t)=>{let{valueOffsets:e,children:r}=i,{[t]:n,[t+1]:o}=e,c=r[0];return new ci(c.slice(n,o-n))},Sj=(i,t)=>new Ki(i,t),Ij=(i,t)=>i.type.mode===Ft.Dense?Mh(i,t):Rh(i,t),Mh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Ut.visit(r,i.valueOffsets[t])},Rh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Ut.visit(r,t)},Aj=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Cj=(i,t)=>i.type.unit===ue.DAY_TIME?Uh(i,t):Nh(i,t),Uh=({values:i},t)=>i.subarray(2*t,2*(t+1)),Nh=({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},xj=(i,t)=>{let{stride:e,children:r}=i,o=r[0].slice(t*e,e);return new G([o])};H.prototype.visitNull=q(cj);H.prototype.visitBool=q(uj);H.prototype.visitInt=q(yj);H.prototype.visitInt8=q(Ji);H.prototype.visitInt16=q(Ji);H.prototype.visitInt32=q(Ji);H.prototype.visitInt64=q(Ch);H.prototype.visitUint8=q(Ji);H.prototype.visitUint16=q(Ji);H.prototype.visitUint32=q(Ji);H.prototype.visitUint64=q(Ch);H.prototype.visitFloat=q(_j);H.prototype.visitFloat16=q(dj);H.prototype.visitFloat32=q(Ji);H.prototype.visitFloat64=q(Ji);H.prototype.visitUtf8=q(pj);H.prototype.visitBinary=q(hj);H.prototype.visitFixedSizeBinary=q(fj);H.prototype.visitDate=q(mj);H.prototype.visitDateDay=q(Ih);H.prototype.visitDateMillisecond=q(Ah);H.prototype.visitTimestamp=q(bj);H.prototype.visitTimestampSecond=q(xh);H.prototype.visitTimestampMillisecond=q(Fh);H.prototype.visitTimestampMicrosecond=q(Bh);H.prototype.visitTimestampNanosecond=q(Th);H.prototype.visitTime=q(gj);H.prototype.visitTimeSecond=q(Dh);H.prototype.visitTimeMillisecond=q(Eh);H.prototype.visitTimeMicrosecond=q(kh);H.prototype.visitTimeNanosecond=q(Oh);H.prototype.visitDecimal=q(vj);H.prototype.visitList=q(wj);H.prototype.visitStruct=q(Sj);H.prototype.visitUnion=q(Ij);H.prototype.visitDenseUnion=q(Mh);H.prototype.visitSparseUnion=q(Rh);H.prototype.visitDictionary=q(Aj);H.prototype.visitInterval=q(Cj);H.prototype.visitIntervalDayTime=q(Uh);H.prototype.visitIntervalYearMonth=q(Nh);H.prototype.visitFixedSizeList=q(xj);H.prototype.visitMap=q(jj);var Ut=new H;var Ve=Symbol.for("keys"),Hr=Symbol.for("vals"),ci=class{constructor(t){return this[Ve]=new G([t.children[0]]).memoize(),this[Hr]=t.children[1],new Proxy(this,new Ua)}[Symbol.iterator](){return new Ra(this[Ve],this[Hr])}get size(){return this[Ve].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Ve],e=this[Hr],r={};for(let n=-1,o=t.length;++n<o;)r[t.get(n)]=Ut.visit(e,n);return r}toString(){return`{${[...this].map(([t,e])=>`${Ge(t)}: ${Ge(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Ra=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),Ut.visit(this.vals,t)]})}},Ua=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ve].toArray().map(String)}has(t,e){return t[Ve].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ve].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[Ve].indexOf(e);if(r!==-1){let n=Ut.visit(Reflect.get(t,Hr),r);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[Ve].indexOf(e);return n!==-1?(ee.visit(Reflect.get(t,Hr),n,r),Reflect.set(t,e,r)):Reflect.has(t,e)?Reflect.set(t,e,r):!1}};Object.defineProperties(ci.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ve]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hr]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function Fj(i,t,e){let r=i.length,n=t>-1?t:r+t%r;return e?e(i,n):n}var Lh;function vn(i,t,e,r){let{length:n=0}=i,o=typeof t!="number"?0:t,c=typeof e!="number"?n:e;return o<0&&(o=(o%n+n)%n),c<0&&(c=(c%n+n)%n),c<o&&(Lh=o,o=c,c=Lh),c>n&&(c=n),r?r(i,o,c):[o,c]}var Ph=i=>i!==i;function qi(i){if(typeof i!=="object"||i===null)return Ph(i)?Ph: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?ba(i,e):!1:i instanceof Map?Tj(i):Array.isArray(i)?Bj(i):i instanceof G?Dj(i):Ej(i,!0)}function Bj(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=qi(i[e]);return to(t)}function Tj(i){let t=-1,e=[];for(let r of i.values())e[++t]=qi(r);return to(e)}function Dj(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=qi(i.get(e));return to(t)}function Ej(i,t=!1){let e=Object.keys(i);if(!t&&e.length===0)return()=>!1;let r=[];for(let n=-1,o=e.length;++n<o;)r[n]=qi(i[e[n]]);return to(r,e)}function to(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return kj(i,e);case Map:return Vh(i,e,e.keys());case ci:case Ki:case Object:case void 0:return Vh(i,e,t||Object.keys(e))}return e instanceof G?Oj(i,e):!1}}function kj(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 Oj(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 Vh(i,t,e){let r=e[Symbol.iterator](),n=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),c=0,h=i.length,m=o.next(),v=r.next(),C=n.next();for(;c<h&&!v.done&&!C.done&&!m.done&&!(v.value!==C.value||!i[c](m.value));++c,v=r.next(),C=n.next(),m=o.next());return c===h&&v.done&&C.done&&m.done?!0:(r.return&&r.return(),n.return&&n.return(),o.return&&o.return(),!1)}var La={};hr(La,{BitIterator:()=>_r,getBit:()=>Hh,getBool:()=>io,packBools:()=>mr,popcnt_array:()=>zh,popcnt_bit_range:()=>wn,popcnt_uint32:()=>eo,setBool:()=>Mj,truncateBitmap:()=>zr});function io(i,t,e,r){return(e&1<<r)!==0}function Hh(i,t,e,r){return(e&1<<r)>>r}function Mj(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function zr(i,t,e){let r=e.byteLength+7&-8;if(i>0||e.byteLength<r){let n=new Uint8Array(r);return n.set(i%8===0?e.subarray(i>>3):mr(new _r(e,i,t,null,io)).subarray(0,r)),n}return e}function mr(i){let t=[],e=0,r=0,n=0;for(let c of i)c&&(n|=1<<r),++r===8&&(t[e++]=n,n=r=0);(e===0||r>0)&&(t[e++]=n);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var _r=class{constructor(t,e,r,n,o){this.bytes=t,this.length=r,this.context=n,this.get=o,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 wn(i,t,e){if(e-t<=0)return 0;if(e-t<8){let o=0;for(let c of new _r(i,t,e-t,i,Hh))o+=c;return o}let r=e>>3<<3,n=t+(t%8===0?0:8-t%8);return wn(i,t,n)+wn(i,r,e)+zh(i,n>>3,r-n>>3)}function zh(i,t,e){let r=0,n=Math.trunc(t),o=new DataView(i.buffer,i.byteOffset,i.byteLength),c=e===void 0?i.byteLength:n+e;for(;c-n>=4;)r+=eo(o.getUint32(n)),n+=4;for(;c-n>=2;)r+=eo(o.getUint16(n)),n+=2;for(;c-n>=1;)r+=eo(o.getUint8(n)),n+=1;return r}function eo(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 Rj=-1,ft=class{constructor(t,e,r,n,o,c=[],h){this.type=t,this.children=c,this.dictionary=h,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let m;o instanceof ft?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=De(t),o&&((m=o[0])&&(this.valueOffsets=m),(m=o[1])&&(this.values=m),(m=o[2])&&(this.nullBitmap=m),(m=o[3])&&(this.typeIds=m))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:n,typeIds:o}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),this.children.reduce((c,h)=>c+h.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=Rj&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-wn(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){let e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){let{nullBitmap:m}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:m,_nullCount:0})}let{nullBitmap:r,offset:n}=this,o=n+t>>3,c=(n+t)%8,h=r[o]>>c&1;return e?h===0&&(r[o]|=1<<c,this._nullCount=this.nullCount+1):h===1&&(r[o]&=~(1<<c),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,r=this.length,n=this._nullCount,o=this,c=this.children){return new ft(t,e,r,n,o,c,this.dictionary)}slice(t,e){let{stride:r,typeId:n,children:o}=this,c=+(this._nullCount===0)-1,h=n===16?r:1,m=this._sliceBuffers(t,e,r,n);return this.clone(this.type,this.offset+t,e,c,m,o.length===0||this.valueOffsets?o:this._sliceChildren(o,h*t,h*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===A.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:r}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<<e-(e&-8))-1,r>0&&n.set(zr(this.offset,e,this.nullBitmap),0);let o=this.buffers;return o[Pe.VALIDITY]=n,this.clone(this.type,0,t,r+(t-e),o)}_sliceBuffers(t,e,r,n){let o,{buffers:c}=this;return(o=c[Pe.TYPE])&&(c[Pe.TYPE]=o.subarray(t,t+e)),(o=c[Pe.OFFSET])&&(c[Pe.OFFSET]=o.subarray(t,t+e+1))||(o=c[Pe.DATA])&&(c[Pe.DATA]=n===6?o:o.subarray(r*t,r*(t+e))),c}_sliceChildren(t,e,r){return t.map(n=>n.slice(e,r))}};ft.prototype.children=Object.freeze([]);var br=class extends V{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:r=0,["length"]:n=0}=t;return new ft(e,r,n,0)}visitBool(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length>>3,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitInt(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitFloat(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitUtf8(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),c=pr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,n,o])}visitBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),c=pr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,n,o])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitDate(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitTimestamp(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitTime(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitDecimal(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitList(t){let{["type"]:e,["offset"]:r=0,["child"]:n}=t,o=Y(t.nullBitmap),c=pr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,void 0,o],[n])}visitStruct(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),{length:c=n.reduce((m,{length:v})=>Math.max(m,v),0),nullCount:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,void 0,o],n)}visitUnion(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),c=rt(e.ArrayType,t.typeIds),{["length"]:h=c.length,["nullCount"]:m=t.nullBitmap?-1:0}=t;if(R.isSparseUnion(e))return new ft(e,r,h,m,[void 0,void 0,o,c],n);let v=pr(t.valueOffsets);return new ft(e,r,h,m,[v,void 0,o,c],n)}visitDictionary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.indices.ArrayType,t.data),{["dictionary"]:c=new G([new br().visit({type:e.dictionary})])}=t,{["length"]:h=o.length,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[void 0,o,n],[],c)}visitInterval(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,o,n])}visitFixedSizeList(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new br().visit({type:e.valueType})}=t,o=Y(t.nullBitmap),{["length"]:c=n.length/De(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ft(e,r,c,h,[void 0,void 0,o],[n])}visitMap(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new br().visit({type:e.childType})}=t,o=Y(t.nullBitmap),c=pr(t.valueOffsets),{["length"]:h=c.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ft(e,r,h,m,[c,void 0,o],[n])}};function J(i){return new br().visit(i)}var jn=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 ro(i){return i.reduce((t,e)=>t+e.nullCount,0)}function no(i){return i.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(i.length+1))}function so(i,t,e,r){let n=[];for(let o=-1,c=i.length;++o<c;){let h=i[o],m=t[o],{length:v}=h;if(m>=r)break;if(e>=m+v)continue;if(m>=e&&m+v<=r){n.push(h);continue}let C=Math.max(0,e-m),B=Math.min(r-m,v);n.push(h.slice(C,B-C))}return n.length===0&&n.push(i[0].slice(0,0)),n}function Pa(i,t,e,r){let n=0,o=0,c=t.length-1;do{if(n>=c-1)return e<t[c]?r(i,n,e-t[n]):null;o=n+Math.trunc((c-n)*.5),e<t[o]?c=o:n=o}while(n<c)}function Sn(i,t){return i.getValid(t)}function Zi(i){function t(e,r,n){return i(e[r],n)}return function(e){let r=this.data;return Pa(r,this._offsets,e,t)}}function oo(i){let t;function e(r,n,o){return i(r[n],o,t)}return function(r,n){let o=this.data;t=n;let c=Pa(o,this._offsets,r,e);return t=void 0,c}}function ao(i){let t;function e(r,n,o){let c=o,h=0,m=0;for(let v=n-1,C=r.length;++v<C;){let B=r[v];if(~(h=i(B,t,c)))return m+h;c=0,m+=B.length}return-1}return function(r,n){t=r;let o=this.data,c=typeof n!="number"?e(o,0,0):Pa(o,this._offsets,n,e);return t=void 0,c}}var z=class extends V{};function Uj(i,t){return t===null&&i.length>0?0:-1}function Nj(i,t){let{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let r=0;for(let n of new _r(e,i.offset+(t||0),i.length,e,io)){if(!n)return r;++r}return-1}function nt(i,t,e){if(t===void 0)return-1;if(t===null)return Nj(i,e);let r=Ut.getVisitFn(i),n=qi(t);for(let o=(e||0)-1,c=i.length;++o<c;)if(n(r(i,o)))return o;return-1}function Wh(i,t,e){let r=Ut.getVisitFn(i),n=qi(t);for(let o=(e||0)-1,c=i.length;++o<c;)if(n(r(i,o)))return o;return-1}z.prototype.visitNull=Uj;z.prototype.visitBool=nt;z.prototype.visitInt=nt;z.prototype.visitInt8=nt;z.prototype.visitInt16=nt;z.prototype.visitInt32=nt;z.prototype.visitInt64=nt;z.prototype.visitUint8=nt;z.prototype.visitUint16=nt;z.prototype.visitUint32=nt;z.prototype.visitUint64=nt;z.prototype.visitFloat=nt;z.prototype.visitFloat16=nt;z.prototype.visitFloat32=nt;z.prototype.visitFloat64=nt;z.prototype.visitUtf8=nt;z.prototype.visitBinary=nt;z.prototype.visitFixedSizeBinary=nt;z.prototype.visitDate=nt;z.prototype.visitDateDay=nt;z.prototype.visitDateMillisecond=nt;z.prototype.visitTimestamp=nt;z.prototype.visitTimestampSecond=nt;z.prototype.visitTimestampMillisecond=nt;z.prototype.visitTimestampMicrosecond=nt;z.prototype.visitTimestampNanosecond=nt;z.prototype.visitTime=nt;z.prototype.visitTimeSecond=nt;z.prototype.visitTimeMillisecond=nt;z.prototype.visitTimeMicrosecond=nt;z.prototype.visitTimeNanosecond=nt;z.prototype.visitDecimal=nt;z.prototype.visitList=nt;z.prototype.visitStruct=nt;z.prototype.visitUnion=nt;z.prototype.visitDenseUnion=Wh;z.prototype.visitSparseUnion=Wh;z.prototype.visitDictionary=nt;z.prototype.visitInterval=nt;z.prototype.visitIntervalDayTime=nt;z.prototype.visitIntervalYearMonth=nt;z.prototype.visitFixedSizeList=nt;z.prototype.visitMap=nt;var gr=new z;var W=class extends V{};function Z(i){let{type:t}=i;if(i.nullCount===0&&i.stride===1&&(t.typeId===A.Timestamp||t instanceof Ot&&t.bitWidth!==64||t instanceof Je&&t.bitWidth!==64||t instanceof me&&t.precision!==It.HALF))return new jn(i.data.length,r=>{let n=i.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new jn(i.data.length,r=>{let o=i.data[r].length,c=i.slice(e,e+o);return e+=o,new Va(c)})}var Va=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}};W.prototype.visitNull=Z;W.prototype.visitBool=Z;W.prototype.visitInt=Z;W.prototype.visitInt8=Z;W.prototype.visitInt16=Z;W.prototype.visitInt32=Z;W.prototype.visitInt64=Z;W.prototype.visitUint8=Z;W.prototype.visitUint16=Z;W.prototype.visitUint32=Z;W.prototype.visitUint64=Z;W.prototype.visitFloat=Z;W.prototype.visitFloat16=Z;W.prototype.visitFloat32=Z;W.prototype.visitFloat64=Z;W.prototype.visitUtf8=Z;W.prototype.visitBinary=Z;W.prototype.visitFixedSizeBinary=Z;W.prototype.visitDate=Z;W.prototype.visitDateDay=Z;W.prototype.visitDateMillisecond=Z;W.prototype.visitTimestamp=Z;W.prototype.visitTimestampSecond=Z;W.prototype.visitTimestampMillisecond=Z;W.prototype.visitTimestampMicrosecond=Z;W.prototype.visitTimestampNanosecond=Z;W.prototype.visitTime=Z;W.prototype.visitTimeSecond=Z;W.prototype.visitTimeMillisecond=Z;W.prototype.visitTimeMicrosecond=Z;W.prototype.visitTimeNanosecond=Z;W.prototype.visitDecimal=Z;W.prototype.visitList=Z;W.prototype.visitStruct=Z;W.prototype.visitUnion=Z;W.prototype.visitDenseUnion=Z;W.prototype.visitSparseUnion=Z;W.prototype.visitDictionary=Z;W.prototype.visitInterval=Z;W.prototype.visitIntervalDayTime=Z;W.prototype.visitIntervalYearMonth=Z;W.prototype.visitFixedSizeList=Z;W.prototype.visitMap=Z;var Wr=new W;var Lj=(i,t)=>i+t,ui=class extends V{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===ot.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((r,n)=>r+Ee.visit(n,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((r,n)=>r+Ee.visit(n,e),0)}visitDictionary(t,e){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[e]))||0)}},Pj=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),Vj=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),Hj=({valueOffsets:i,stride:t,children:e},r)=>{let n=e[0],{[r*t]:o}=i,{[r*t+1]:c}=i,h=Ee.getVisitFn(n.type),m=n.slice(o,c-o),v=8;for(let C=-1,B=c-o;++C<B;)v+=h(m,C);return v},zj=({stride:i,children:t},e)=>{let r=t[0],n=r.slice(e*i,i),o=Ee.getVisitFn(r.type),c=0;for(let h=-1,m=n.length;++h<m;)c+=o(n,h);return c},Wj=(i,t)=>i.type.mode===Ft.Dense?$h(i,t):Yh(i,t),$h=({type:i,children:t,typeIds:e,valueOffsets:r},n)=>{let o=i.typeIdToChildIndex[e[n]];return 8+Ee.visit(t[o],r[n])},Yh=({children:i},t)=>4+Ee.visitMany(i,i.map(()=>t)).reduce(Lj,0);ui.prototype.visitUtf8=Pj;ui.prototype.visitBinary=Vj;ui.prototype.visitList=Hj;ui.prototype.visitFixedSizeList=zj;ui.prototype.visitUnion=Wj;ui.prototype.visitDenseUnion=$h;ui.prototype.visitSparseUnion=Yh;var Ee=new ui;var Xh,Gh={},Kh={},G=class{constructor(t){var e,r,n;let o=t[0]instanceof G?t.flatMap(h=>h.data):t;if(o.length===0||o.some(h=>!(h instanceof ft)))throw new TypeError("Vector constructor expects an Array of Data instances.");let c=(e=o[0])===null||e===void 0?void 0:e.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:h,set:m,indexOf:v,byteLength:C}=Gh[c.typeId],B=o[0];this.isValid=F=>Sn(B,F),this.get=F=>h(B,F),this.set=(F,k)=>m(B,F,k),this.indexOf=F=>v(B,F),this.getByteLength=F=>C(B,F),this._offsets=[0,B.length];break}default:Object.setPrototypeOf(this,Kh[c.typeId]),this._offsets=no(o);break}this.data=o,this.type=c,this.stride=De(c),this.numChildren=(n=(r=c.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=ro(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${A[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return Wr.visit(this)}concat(...t){return new G(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new G(vn(this,t,e,({data:r,_offsets:n},o,c)=>so(r,n,o,c)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:n,ArrayType:o}=this;switch(t.typeId){case A.Int:case A.Float:case A.Decimal:case A.Time:case A.Timestamp:switch(e.length){case 0:return new o;case 1:return e[0].values.subarray(0,r*n);default:return e.reduce((c,{values:h})=>(c.array.set(h,c.offset),c.offset+=h.length,c),{array:new o(r*n),offset:0}).array}}return[...this]}toString(){return`[${[...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 G(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return R.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(R.isDictionary(this.type)){let t=new $r(this.data[0].dictionary),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return new $r(this)}unmemoize(){if(R.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return this}};Xh=Symbol.toStringTag;G[Xh]=(i=>{i.type=R.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._nullCount=-1,i._byteLength=-1,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;let t=Object.keys(A).map(e=>A[e]).filter(e=>typeof e=="number"&&e!==A.NONE);for(let e of t){let r=Ut.getVisitFnByTypeId(e),n=ee.getVisitFnByTypeId(e),o=gr.getVisitFnByTypeId(e),c=Ee.getVisitFnByTypeId(e);Gh[e]={get:r,set:n,indexOf:o,byteLength:c},Kh[e]=Object.create(i,{isValid:{value:Zi(Sn)},get:{value:Zi(Ut.getVisitFnByTypeId(e))},set:{value:oo(ee.getVisitFnByTypeId(e))},indexOf:{value:ao(gr.getVisitFnByTypeId(e))},getByteLength:{value:Zi(Ee.getVisitFnByTypeId(e))}})}return"Vector"})(G.prototype);var $r=class extends G{constructor(t){super(t.data);let e=this.get,r=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(c){let h=o[c];if(h!==void 0)return h;let m=e.call(this,c);return o[c]=m,m}}),Object.defineProperty(this,"set",{value(c,h){r.call(this,c,h),o[c]=h}}),Object.defineProperty(this,"slice",{value:(c,h)=>new $r(n.call(this,c,h))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new G(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Jh(i){if(!i||i.length<=0)return function(n){return!0};let t="",e=i.filter(r=>r===r);return e.length>0&&(t=`
2
2
  switch (x) {${e.map(r=>`
3
- case ${Vj(r)}:`).join("")}
3
+ case ${$j(r)}:`).join("")}
4
4
  return false;
5
5
  }`),i.length!==e.length&&(t=`if (x !== x) return false;
6
6
  ${t}`),new Function("x",`${t}
7
- return true;`)}function Vj(i){return typeof i!="bigint"?Ge(i):Is?`${Ge(i)}n`:`"${Ge(i)}"`}var za=(i,t)=>(i*t+63&-64||64)/t,Hj=(i,t=0)=>i.length>=t?i.subarray(0,t):Ur(new i.constructor(t),i,0),tr=class{constructor(t,e=1){this.buffer=t,this.stride=e,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.trunc(t.length/e))}get byteLength(){return Math.trunc(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,n=this.buffer.length;r>=n&&this._resize(n===0?za(r*1,this.BYTES_PER_ELEMENT):za(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=za(t*this.stride,this.BYTES_PER_ELEMENT);let e=Hj(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Ur(new this.ArrayType(t),this.buffer)}};tr.prototype.offset=0;var Ui=class extends tr{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}},Xr=class extends Ui{constructor(t=new Uint8Array(0)){super(t,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),n=t>>3,o=t%8,c=r[n]>>o&1;return e?c===0&&(r[n]|=1<<o,++this.numValid):c===1&&(r[n]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Gr=class extends Ui{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,e){let r=this.length-1,n=this.reserve(t-r+1).buffer;return r<t++&&n.fill(n[r],r,t),n[t]=n[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}};var xt=class{constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=De(t),this._nulls=new Xr,e&&e.length>0&&(this._isValid=Gh(e))}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}toVector(){return new G([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:n,_typeIds:o,children:c}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),c.reduce((h,m)=>h+m.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=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,e,r,n,{type:o,length:c,nullCount:h,_typeIds:m,_offsets:g,_values:x,_nulls:T}=this;(e=m==null?void 0:m.flush(c))?n=g==null?void 0:g.flush(c):(n=g==null?void 0:g.flush(c))?t=x==null?void 0:x.flush(g.last()):t=x==null?void 0:x.flush(c),h>0&&(r=T==null?void 0:T.flush(c));let C=this.children.map(k=>k.flush());return this.clear(),J({type:o,length:c,nullCount:h,children:C,child:C[0],data:t,typeIds:e,nullBitmap:r,valueOffsets:n})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,r,n;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(),(n=this._typeIds)===null||n===void 0||n.clear();for(let o of this.children)o.clear();return this}};xt.prototype.length=1;xt.prototype.stride=1;xt.prototype.children=null;xt.prototype.finished=!1;xt.prototype.nullValues=null;xt.prototype._isValid=()=>!0;var Yt=class extends xt{constructor(t){super(t),this._values=new Ui(new this.ArrayType(0),this.stride)}setValue(t,e){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}},di=class extends xt{constructor(t){super(t),this._pendingLength=0,this._offsets=new Gr}setValue(t,e){let r=this._pending||(this._pending=new Map),n=r.get(t);n&&(this._pendingLength-=n.length),this._pendingLength+=e instanceof ci?e[Ve].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 Sr=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,n){return t.prep(8,24),t.writeInt64(n),t.pad(4),t.writeInt32(r),t.writeInt64(e),t.offset()}};var fi=new Int32Array(2),uo=new Float32Array(fi.buffer),fo=new Float64Array(fi.buffer),Kr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Lt=class{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Lt.ZERO:new Lt(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};Lt.ZERO=new Lt(0,0);var Cn;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(Cn||(Cn={}));var fe=class{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new fe(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 new Lt(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new Lt(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return fi[0]=this.readInt32(t),uo[0]}readFloat64(t){return fi[Kr?0:1]=this.readInt32(t),fi[Kr?1:0]=this.readInt32(t+4),fo[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,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){uo[0]=e,this.writeInt32(t,fi[0])}writeFloat64(t,e){fo[0]=e,this.writeInt32(t,fi[Kr?0:1]),this.writeInt32(t+4,fi[Kr?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),n="",o=0;if(t+=4,e===Cn.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){let c,h=this.readUint8(t+o++);if(h<192)c=h;else{let m=this.readUint8(t+o++);if(h<224)c=(h&31)<<6|m&63;else{let g=this.readUint8(t+o++);if(h<240)c=(h&15)<<12|(m&63)<<6|g&63;else{let x=this.readUint8(t+o++);c=(h&7)<<18|(m&63)<<12|(g&63)<<6|x&63}}}c<65536?n+=String.fromCharCode(c):(c-=65536,n+=String.fromCharCode((c>>10)+55296,(c&(1<<10)-1)+56320))}return n}__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}createLong(t,e){return Lt.create(t,e)}createScalarList(t,e){let r=[];for(let n=0;n<e;++n)t(n)!==null&&r.push(t(n));return r}createObjList(t,e){let r=[];for(let n=0;n<e;++n){let o=t(n);o!==null&&r.push(o.unpack())}return r}};var Ni=class{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;let e;t?e=t:e=1024,this.bb=fe.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 n=this.bb.capacity();this.bb=Ni.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}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.equals(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 Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("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,n=fe.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n}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 n=2;this.addInt16(t-this.object_start);let o=(r+n)*2;this.addInt16(o);let c=0,h=this.space;t:for(e=0;e<this.vtables.length;e++){let m=this.bb.capacity()-this.vtables[e];if(o==this.bb.readInt16(m)){for(let g=2;g<o;g+=2)if(this.bb.readInt16(h+g)!=this.bb.readInt16(m+g))continue t;c=this.vtables[e];break}}return c?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,c-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 n=r?4:0;if(e){let o=e;if(this.prep(this.minalign,4+4+n),o.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let c=4-1;c>=0;c--)this.writeInt8(o.charCodeAt(c))}this.prep(this.minalign,4+n),this.addOffset(t),n&&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,n=r-this.bb.readInt32(r);if(!(this.bb.readInt16(n+e)!=0))throw new Error("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)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let r=0;for(;r<t.length;){let n,o=t.charCodeAt(r++);if(o<55296||o>=56320)n=o;else{let c=t.charCodeAt(r++);n=(o<<10)+c+(65536-(55296<<10)-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let r=0,n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()}createLong(t,e){return Lt.create(t,e)}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 n=t[r];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}};var jt=class{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 jt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new jt).__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 jt.startKeyValue(t),jt.addKey(t,e),jt.addValue(t,r),jt.endKeyValue(t)}};var er;(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"})(er||(er={}));var ir;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(ir||(ir={}));var Bn;(function(i){i[i.DenseArray=0]="DenseArray"})(Bn||(Bn={}));var Xt=class{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 Xt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new Xt).__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 Xt.startInt(t),Xt.addBitWidth(t,e),Xt.addIsSigned(t,r),Xt.endInt(t)}};var ke=class{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 ke).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new ke).__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):this.bb.createLong(0,0)}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Xt).__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):Bn.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,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,Bn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var hi=class{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 hi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new hi).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return hi.startBinary(t),hi.endBinary(t)}};var pi=class{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 pi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new pi).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return pi.startBool(t),pi.endBool(t)}};var Tn;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(Tn||(Tn={}));var be=class{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 be).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new be).__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):Tn.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Tn.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return be.startDate(t),be.addUnit(t,e),be.endDate(t)}};var Gt=class{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 Gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new Gt).__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,n){return Gt.startDecimal(t),Gt.addPrecision(t,e),Gt.addScale(t,r),Gt.addBitWidth(t,n),Gt.endDecimal(t)}};var rr;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(rr||(rr={}));var ve=class{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 ve).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new ve).__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 ve.startFixedSizeBinary(t),ve.addByteWidth(t,e),ve.endFixedSizeBinary(t)}};var ge=class{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 ge).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new ge).__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 ge.startFixedSizeList(t),ge.addListSize(t,e),ge.endFixedSizeList(t)}};var Dn;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(Dn||(Dn={}));var we=class{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 we).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new we).__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):Dn.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Dn.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return we.startFloatingPoint(t),we.addPrecision(t,e),we.endFloatingPoint(t)}};var En;(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"})(En||(En={}));var je=class{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 je).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new je).__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):En.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,En.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return je.startInterval(t),je.addUnit(t,e),je.endInterval(t)}};var yi=class{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 yi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new yi).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return yi.startList(t),yi.endList(t)}};var Se=class{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 Se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new Se).__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 Se.startMap(t),Se.addKeysSorted(t,e),Se.endMap(t)}};var _i=class{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 mi=class{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 mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new mi).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return mi.startStruct_(t),mi.endStruct_(t)}};var re=class{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 re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new re).__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):rr.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,rr.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return re.startTime(t),re.addUnit(t,e),re.addBitWidth(t,r),re.endTime(t)}};var ne=class{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 ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new ne).__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):rr.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,rr.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return ne.startTimestamp(t),ne.addUnit(t,e),ne.addTimezone(t,r),ne.endTimestamp(t)}};var kn;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(kn||(kn={}));var Kt=class{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 Kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new Kt).__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):kn.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,kn.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 Kt.startUnion(t),Kt.addMode(t,e),Kt.addTypeIds(t,r),Kt.endUnion(t)}};var bi=class{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 bi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new bi).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return bi.startUtf8(t),bi.endUtf8(t)}};var Ft;(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"})(Ft||(Ft={}));var Pt=class{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 Pt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new Pt).__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):Ft.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 ke).__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 Pt).__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,Ft.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 Dt=class{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 Dt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new Dt).__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):ir.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Pt).__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):this.bb.createLong(0,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,ir.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,n,o){return Dt.startSchema(t),Dt.addEndianness(t,e),Dt.addFields(t,r),Dt.addCustomMetadata(t,n),Dt.addFeatures(t,o),Dt.endSchema(t)}};var se=class{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 se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new se).__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):er.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Dt).__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 Sr).__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 Sr).__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,er.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{constructor(t=[],e,r){this.fields=t||[],this.metadata=e||new Map,r||(r=Wa(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){let e=new Set(t),r=this.fields.filter(n=>e.has(n.name));return new at(r,this.metadata)}selectAt(t){let e=t.map(r=>this.fields[r]).filter(Boolean);return new at(e,this.metadata)}assign(...t){let e=t[0]instanceof at?t[0]:Array.isArray(t[0])?new at(t[0]):new at(t),r=[...this.fields],n=po(po(new Map,this.metadata),e.metadata),o=e.fields.filter(h=>{let m=r.findIndex(g=>g.name===h.name);return~m?(r[m]=h.clone({metadata:po(po(new Map,r[m].metadata),h.metadata)}))&&!1:!0}),c=Wa(o,new Map);return new at([...r,...o],n,new Map([...this.dictionaries,...c]))}};at.prototype.fields=null;at.prototype.metadata=null;at.prototype.dictionaries=null;var tt=class{constructor(t,e,r=!1,n){this.name=t,this.type=e,this.nullable=r,this.metadata=n||new Map}static new(...t){let[e,r,n,o]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),n===void 0&&(n=t[0].nullable),o===void 0&&(o=t[0].metadata)),new tt(`${e}`,r,n,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,r,n,o]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,n=this.nullable,o=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:n=this.nullable,metadata:o=this.metadata}=t[0],tt.new(e,r,n,o)}};tt.prototype.type=null;tt.prototype.name=null;tt.prototype.nullable=null;tt.prototype.metadata=null;function po(i,t){return new Map([...i||new Map,...t||new Map])}function Wa(i,t=new Map){for(let e=-1,r=i.length;++e<r;){let o=i[e].type;if(U.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&Wa(o.children,t)}return t}var Kh=Lt,zj=Ni,Wj=fe,Li=class{constructor(t,e=$t.V4,r,n){this.schema=t,this.version=e,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}static decode(t){t=new Wj(Y(t));let e=se.getRootAsFooter(t),r=at.decode(e.schema());return new $a(r,e)}static encode(t){let e=new zj,r=at.encode(e,t.schema);se.startRecordBatchesVector(e,t.numRecordBatches);for(let c of[...t.recordBatches()].slice().reverse())ri.encode(e,c);let n=e.endVector();se.startDictionariesVector(e,t.numDictionaries);for(let c of[...t.dictionaryBatches()].slice().reverse())ri.encode(e,c);let o=e.endVector();return se.startFooter(e),se.addSchema(e,r),se.addVersion(e,$t.V4),se.addRecordBatches(e,n),se.addDictionaries(e,o),se.finishFooterBuffer(e,se.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*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 $a=class extends Li{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let e=this._footer.recordBatches(t);if(e)return ri.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return ri.decode(e)}return null}},ri=class{constructor(t,e,r){this.metaDataLength=t,this.offset=typeof r=="number"?r:r.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new ri(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:r}=e,n=new Kh(e.offset,0),o=new Kh(e.bodyLength,0);return Sr.createBlock(t,n,r,o)}};var St=Object.freeze({done:!0,value:void 0}),On=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Ir=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())}},yo=class extends Ir{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return O(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(St);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Qt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Qt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return O(this,void 0,void 0,function*(){return yield this.abort(t),St})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),St})}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(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(St)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var vi=class extends yo{write(t){if((t=Y(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?Be(this._values)[0]:(()=>O(this,void 0,void 0,function*(){var e,r;let n=[],o=0;try{for(var c=Ne(this),h;h=yield c.next(),!h.done;){let m=h.value;n.push(m),o+=m.byteLength}}catch(m){e={error:m}}finally{try{h&&!h.done&&(r=c.return)&&(yield r.call(c))}finally{if(e)throw e.error}}return Be(n,o)[0]}))()}},gi=class{constructor(t){t&&(this.source=new Ya(Qt.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)}},Ie=class{constructor(t){t instanceof Ie?this.source=t.source:t instanceof vi?this.source=new Pi(Qt.fromAsyncIterable(t)):Ts(t)?this.source=new Pi(Qt.fromNodeStream(t)):gn(t)?this.source=new Pi(Qt.fromDOMStream(t)):Cs(t)?this.source=new Pi(Qt.fromDOMStream(t.body)):Ye(t)?this.source=new Pi(Qt.fromIterable(t)):$e(t)?this.source=new Pi(Qt.fromAsyncIterable(t)):Le(t)&&(this.source=new Pi(Qt.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)}},Ya=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)||St)}return(t){return Object.create(this.source.return&&this.source.return(t)||St)}},Pi=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return O(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return O(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return O(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return O(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Mn=class extends gi{constructor(t,e){super(),this.position=0,this.buffer=Y(t),this.size=typeof e>"u"?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:n}=this;return e&&n<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,n+Math.min(r-n,t)),e.subarray(n,this.position)):null}readAt(t,e){let r=this.buffer,n=Math.min(this.size,t+e);return r?r.subarray(t,n):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 Ie{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=(()=>O(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending}))()}readInt32(t){return O(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 O(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 O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:r,position:n}=this;if(e&&n<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=n,c=0,h=0,m=Math.min(r,o+Math.min(r-o,t)),g=new Uint8Array(Math.max(0,(this.position=m)-o));for(;(o+=h)<m&&(c+=h)<g.byteLength;)({bytesRead:h}=yield e.read(g,c,g.byteLength-c,o));return g}return null})}readAt(t,e){return O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n}=this;if(r&&t+e<n){let o=Math.min(n,t+e),c=new Uint8Array(o-t);return(yield r.read(c,0,e,t)).buffer}return new Uint8Array(e)})}close(){return O(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var Ga={};_r(Ga,{BaseInt64:()=>Rn,Int128:()=>Ae,Int64:()=>Jt,Uint64:()=>ht});function Jr(i){return i<0&&(i=4294967295+i+1),`0x${i.toString(16)}`}var qr=8,Xa=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Rn=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]),n=e[3]*r[3];this.buffer[0]=n&65535;let o=n>>>16;return n=e[2]*r[3],o+=n,n=e[3]*r[2]>>>0,o+=n,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<n?65536:0,this.buffer[1]+=o>>>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`${Jr(this.buffer[1])} ${Jr(this.buffer[0])}`}},ht=class extends Rn{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return ht.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return ht.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.length,n=new ht(e);for(let o=0;o<r;){let c=qr<r-o?qr:r-o,h=new ht(new Uint32Array([Number.parseInt(t.slice(o,o+c),10),0])),m=new ht(new Uint32Array([Xa[c],0]));n.times(m),n.plus(h),o+=c}return n}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)ht.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new ht(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ht(new Uint32Array(t.buffer)).plus(e)}},Jt=class extends Rn{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 Jt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Jt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.startsWith("-"),n=t.length,o=new Jt(e);for(let c=r?1:0;c<n;){let h=qr<n-c?qr:n-c,m=new Jt(new Uint32Array([Number.parseInt(t.slice(c,c+h),10),0])),g=new Jt(new Uint32Array([Xa[h],0]));o.times(g),o.plus(m),c+=h}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)Jt.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new Jt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Jt(new Uint32Array(t.buffer)).plus(e)}},Ae=class{constructor(t){this.buffer=t}high(){return new Jt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Jt(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 ht(new Uint32Array([this.buffer[3],0])),r=new ht(new Uint32Array([this.buffer[2],0])),n=new ht(new Uint32Array([this.buffer[1],0])),o=new ht(new Uint32Array([this.buffer[0],0])),c=new ht(new Uint32Array([t.buffer[3],0])),h=new ht(new Uint32Array([t.buffer[2],0])),m=new ht(new Uint32Array([t.buffer[1],0])),g=new ht(new Uint32Array([t.buffer[0],0])),x=ht.multiply(o,g);this.buffer[0]=x.low();let T=new ht(new Uint32Array([x.high(),0]));return x=ht.multiply(n,g),T.plus(x),x=ht.multiply(o,m),T.plus(x),this.buffer[1]=T.low(),this.buffer[3]=T.lessThan(x)?1:0,this.buffer[2]=T.high(),new ht(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ht.multiply(r,g)).plus(ht.multiply(n,m)).plus(ht.multiply(o,h)),this.buffer[3]+=ht.multiply(e,g).plus(ht.multiply(r,m)).plus(ht.multiply(n,h)).plus(ht.multiply(o,c)).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`${Jr(this.buffer[3])} ${Jr(this.buffer[2])} ${Jr(this.buffer[1])} ${Jr(this.buffer[0])}`}static multiply(t,e){return new Ae(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ae(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ae.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ae.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let r=t.startsWith("-"),n=t.length,o=new Ae(e);for(let c=r?1:0;c<n;){let h=qr<n-c?qr:n-c,m=new Ae(new Uint32Array([Number.parseInt(t.slice(c,c+h),10),0,0,0])),g=new Ae(new Uint32Array([Xa[h],0,0,0]));o.times(g),o.plus(m),c+=h}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*4);for(let r=-1,n=t.length;++r<n;)Ae.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}};var Un=class extends V{constructor(t,e,r,n){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=n}visit(t){return super.visit(t instanceof tt?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return J({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===Tt.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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)}},_o=class extends Un{constructor(t,e,r,n){super(new Uint8Array(0),e,r,n),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):gr(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return nt(Uint8Array,nt(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return nt(Uint8Array,nt(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;return U.isTimestamp(t)?nt(Uint8Array,Jt.convertArray(r[e])):(U.isInt(t)||U.isTime(t))&&t.bitWidth===64?nt(Uint8Array,Jt.convertArray(r[e])):U.isDate(t)&&t.unit===te.MILLISECOND?nt(Uint8Array,Jt.convertArray(r[e])):U.isDecimal(t)?nt(Uint8Array,Ae.convertArray(r[e])):U.isBinary(t)||U.isFixedSizeBinary(t)?$j(r[e]):U.isBool(t)?gr(r[e]):U.isUtf8(t)?Gi(r[e].join("")):nt(Uint8Array,nt(t.ArrayType,r[e].map(n=>+n)))}};function $j(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 Zr=class extends di{constructor(t){super(t),this._values=new tr(new Uint8Array(0))}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,Y(e))}_flushPending(t,e){let r=this._offsets,n=this._values.reserve(e).buffer,o=0;for(let[c,h]of t)if(h===void 0)r.set(c,0);else{let m=h.length;n.set(h,o),r.set(c,m),o+=m}}};var mo=class extends xt{constructor(t){super(t),this._values=new Xr}setValue(t,e){this._values.set(t,+e)}};var Ar=class extends Yt{};Ar.prototype._setValue=Ba;var Nn=class extends Ar{};Nn.prototype._setValue=Ws;var Ln=class extends Ar{};Ln.prototype._setValue=$s;var Pn=class extends Yt{};Pn.prototype._setValue=Ea;var bo=class extends xt{constructor({type:t,nullValues:e,dictionaryHashFunction:r}){super({type:new Te(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=xr({type:this.type.indices,nullValues:e}),this.dictionary=xr({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,n=this.valueToKey(e),o=r[n];return o===void 0&&(r[n]=o=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,e=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(t);return n.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}};var Vn=class extends Yt{};Vn.prototype._setValue=Ca;var vo=class extends xt{setValue(t,e){let[r]=this.children,n=t*this.stride;for(let o=-1,c=e.length;++o<c;)r.set(n+o,e[o])}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 Qe(this.type.listSize,new tt(e,t.type,!0)),r}};var Fr=class extends Yt{setValue(t,e){this._values.set(t,e)}},go=class extends Fr{setValue(t,e){super.setValue(t,Sn(e))}},wo=class extends Fr{},jo=class extends Fr{};var Cr=class extends Yt{};Cr.prototype._setValue=ka;var Hn=class extends Cr{};Hn.prototype._setValue=to;var zn=class extends Cr{};zn.prototype._setValue=eo;var ze=class extends Yt{setValue(t,e){this._values.set(t,e)}},So=class extends ze{},Io=class extends ze{},Ao=class extends ze{},xo=class extends ze{},Fo=class extends ze{},Co=class extends ze{},Bo=class extends ze{},To=class extends ze{};var Do=class extends di{constructor(t){super(t),this._offsets=new Gr}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 qe(new tt(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let c=o.length,h=e.set(n,c).buffer[n];for(let m=-1;++m<c;)r.set(h+m,o[m])}}};var Eo=class extends di{set(t,e){return super.set(t,e)}setValue(t,e){let r=e instanceof Map?e:new Map(Object.entries(e)),n=this._pending||(this._pending=new Map),o=n.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=r.size,n.set(t,r)}addChild(t,e=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ti(new tt(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let{[n]:c,[n+1]:h}=e.set(n,o.size).buffer;for(let m of o.entries())if(r.set(c,m),++c>=h)break}}};var ko=class extends xt{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var Oo=class extends xt{setValue(t,e){let{children:r,type:n}=this;switch(Array.isArray(e)||e.constructor){case!0:return n.children.forEach((o,c)=>r[c].set(t,e[c]));case Map:return n.children.forEach((o,c)=>r[c].set(t,e.get(o.name)));default:return n.children.forEach((o,c)=>r[c].set(t,e[o.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(r=>r.setValid(t,e)),e}addChild(t,e=`${this.numChildren}`){let r=this.children.push(t);return this.type=new wt([...this.type.children,new tt(e,t.type,!0)]),r}};var Vi=class extends Yt{};Vi.prototype._setValue=Ta;var Wn=class extends Vi{};Wn.prototype._setValue=Ys;var $n=class extends Vi{};$n.prototype._setValue=Xs;var Yn=class extends Vi{};Yn.prototype._setValue=Gs;var Xn=class extends Vi{};Xn.prototype._setValue=Ks;var Hi=class extends Yt{};Hi.prototype._setValue=Da;var Gn=class extends Hi{};Gn.prototype._setValue=Js;var Kn=class extends Hi{};Kn.prototype._setValue=qs;var Jn=class extends Hi{};Jn.prototype._setValue=Zs;var qn=class extends Hi{};qn.prototype._setValue=Qs;var Qr=class extends xt{constructor(t){super(t),this._typeIds=new Ui(new 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.setValid(t,this.isValid(e))&&this.setValue(t,e,r),this}setValue(t,e,r){this._typeIds.set(t,r);let n=this.type.typeIdToChildIndex[r],o=this.children[n];o==null||o.set(t,e)}addChild(t,e=`${this.children.length}`){let r=this.children.push(t),{type:{children:n,mode:o,typeIds:c}}=this,h=[...n,new tt(e,t.type)];return this.type=new Ze(o,[...c,r],h),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.")}},Mo=class extends Qr{},Ro=class extends Qr{constructor(t){super(t),this._offsets=new Ui(new Int32Array(0))}setValue(t,e,r){let n=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[n]),c=this._offsets.set(t,o.length).buffer[t];o==null||o.set(c,e)}};var Zn=class extends di{constructor(t){super(t),this._values=new tr(new Uint8Array(0))}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,Gi(e))}_flushPending(t,e){}};Zn.prototype._flushPending=Zr.prototype._flushPending;var Ka=class extends V{visitNull(){return ko}visitBool(){return mo}visitInt(){return ze}visitInt8(){return So}visitInt16(){return Io}visitInt32(){return Ao}visitInt64(){return xo}visitUint8(){return Fo}visitUint16(){return Co}visitUint32(){return Bo}visitUint64(){return To}visitFloat(){return Fr}visitFloat16(){return go}visitFloat32(){return wo}visitFloat64(){return jo}visitUtf8(){return Zn}visitBinary(){return Zr}visitFixedSizeBinary(){return Vn}visitDate(){return Ar}visitDateDay(){return Nn}visitDateMillisecond(){return Ln}visitTimestamp(){return Vi}visitTimestampSecond(){return Wn}visitTimestampMillisecond(){return $n}visitTimestampMicrosecond(){return Yn}visitTimestampNanosecond(){return Xn}visitTime(){return Hi}visitTimeSecond(){return Gn}visitTimeMillisecond(){return Kn}visitTimeMicrosecond(){return Jn}visitTimeNanosecond(){return qn}visitDecimal(){return Pn}visitList(){return Do}visitStruct(){return Oo}visitUnion(){return Qr}visitDenseUnion(){return Ro}visitSparseUnion(){return Mo}visitDictionary(){return bo}visitInterval(){return Cr}visitIntervalDayTime(){return Hn}visitIntervalYearMonth(){return zn}visitFixedSizeList(){return vo}visitMap(){return Eo}},Jh=new Ka;var $=class extends V{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,n)=>this.compareFields(r,e[n]))}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 xe(i,t){return t instanceof i.constructor}function Qn(i,t){return i===t||xe(i,t)}function zi(i,t){return i===t||xe(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function Uo(i,t){return i===t||xe(i,t)&&i.precision===t.precision}function Yj(i,t){return i===t||xe(i,t)&&i.byteWidth===t.byteWidth}function Ja(i,t){return i===t||xe(i,t)&&i.unit===t.unit}function ts(i,t){return i===t||xe(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function es(i,t){return i===t||xe(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function Xj(i,t){return i===t||xe(i,t)&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}function Gj(i,t){return i===t||xe(i,t)&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}function qa(i,t){return i===t||xe(i,t)&&i.mode===t.mode&&i.typeIds.every((e,r)=>e===t.typeIds[r])&&wi.compareManyFields(i.children,t.children)}function Kj(i,t){return i===t||xe(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&wi.visit(i.indices,t.indices)&&wi.visit(i.dictionary,t.dictionary)}function Za(i,t){return i===t||xe(i,t)&&i.unit===t.unit}function Jj(i,t){return i===t||xe(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}function qj(i,t){return i===t||xe(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}$.prototype.visitNull=Qn;$.prototype.visitBool=Qn;$.prototype.visitInt=zi;$.prototype.visitInt8=zi;$.prototype.visitInt16=zi;$.prototype.visitInt32=zi;$.prototype.visitInt64=zi;$.prototype.visitUint8=zi;$.prototype.visitUint16=zi;$.prototype.visitUint32=zi;$.prototype.visitUint64=zi;$.prototype.visitFloat=Uo;$.prototype.visitFloat16=Uo;$.prototype.visitFloat32=Uo;$.prototype.visitFloat64=Uo;$.prototype.visitUtf8=Qn;$.prototype.visitBinary=Qn;$.prototype.visitFixedSizeBinary=Yj;$.prototype.visitDate=Ja;$.prototype.visitDateDay=Ja;$.prototype.visitDateMillisecond=Ja;$.prototype.visitTimestamp=ts;$.prototype.visitTimestampSecond=ts;$.prototype.visitTimestampMillisecond=ts;$.prototype.visitTimestampMicrosecond=ts;$.prototype.visitTimestampNanosecond=ts;$.prototype.visitTime=es;$.prototype.visitTimeSecond=es;$.prototype.visitTimeMillisecond=es;$.prototype.visitTimeMicrosecond=es;$.prototype.visitTimeNanosecond=es;$.prototype.visitDecimal=Qn;$.prototype.visitList=Xj;$.prototype.visitStruct=Gj;$.prototype.visitUnion=qa;$.prototype.visitDenseUnion=qa;$.prototype.visitSparseUnion=qa;$.prototype.visitDictionary=Kj;$.prototype.visitInterval=Za;$.prototype.visitIntervalDayTime=Za;$.prototype.visitIntervalYearMonth=Za;$.prototype.visitFixedSizeList=Jj;$.prototype.visitMap=qj;var wi=new $;function Br(i,t){return wi.compareSchemas(i,t)}function qh(i,t){return wi.compareFields(i,t)}function Zh(i,t){return wi.visit(i,t)}function xr(i){let t=i.type,e=new(Jh.getVisitFn(t)())(i);if(t.children&&t.children.length>0){let r=i.children||[],n={nullValues:i.nullValues},o=Array.isArray(r)?(c,h)=>r[h]||n:({name:c})=>r[c]||n;for(let[c,h]of t.children.entries()){let{type:m}=h,g=o(h,c);e.children.push(xr(Object.assign(Object.assign({},g),{type:m})))}}return e}function No(i,t){return Zj(i,t.map(e=>e.data.concat()))}function Zj(i,t){let e=[...i.fields],r=[],n={numBatches:t.reduce((T,C)=>Math.max(T,C.length),0)},o=0,c=0,h=-1,m=t.length,g,x=[];for(;n.numBatches-- >0;){for(c=Number.POSITIVE_INFINITY,h=-1;++h<m;)x[h]=g=t[h].shift(),c=Math.min(c,g?g.length:c);Number.isFinite(c)&&(x=Qj(e,c,x,t,n),c>0&&(r[o++]=J({type:new wt(e),length:c,nullCount:0,children:x.slice()})))}return[i=i.assign(e),r.map(T=>new vt(i,T))]}function Qj(i,t,e,r,n){var o;let c=(t+63&-64)>>3;for(let h=-1,m=r.length;++h<m;){let g=e[h],x=g==null?void 0:g.length;if(x>=t)x===t?e[h]=g:(e[h]=g.slice(0,t),n.numBatches=Math.max(n.numBatches,r[h].unshift(g.slice(t,x-t))));else{let T=i[h];i[h]=T.clone({nullable:!0}),e[h]=(o=g==null?void 0:g._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:J({type:T.type,length:t,nullCount:t,nullBitmap:new Uint8Array(c)})}}return e}var Qh,Ot=class{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new at([]),this._offsets=[0],this;let n,o;t[0]instanceof at&&(n=t.shift()),t[t.length-1]instanceof Uint32Array&&(o=t.pop());let c=m=>{if(m){if(m instanceof vt)return[m];if(m instanceof Ot)return m.batches;if(m instanceof ft){if(m.type instanceof wt)return[new vt(new at(m.type.children),m)]}else{if(Array.isArray(m))return m.flatMap(g=>c(g));if(typeof m[Symbol.iterator]=="function")return[...m].flatMap(g=>c(g));if(typeof m=="object"){let g=Object.keys(m),x=g.map(k=>new G([m[k]])),T=new at(g.map((k,lt)=>new tt(String(k),x[lt].type))),[,C]=No(T,x);return C.length===0?[new vt(m)]:C}}}return[]},h=t.flatMap(m=>c(m));if(n=(r=n!=null?n:(e=h[0])===null||e===void 0?void 0:e.schema)!==null&&r!==void 0?r:new at([]),!(n instanceof at))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let m of h){if(!(m instanceof vt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Br(n,m.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=h,this._offsets=o!=null?o:oo(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=so(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return $r.visit(new G(this.data))}toArray(){return[...this]}toString(){return`[
7
+ return true;`)}function $j(i){return typeof i!="bigint"?Ge(i):js?`${Ge(i)}n`:`"${Ge(i)}"`}var Ha=(i,t)=>(i*t+63&-64||64)/t,Yj=(i,t=0)=>i.length>=t?i.subarray(0,t):Rr(new i.constructor(t),i,0),Qi=class{constructor(t,e=1){this.buffer=t,this.stride=e,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.trunc(t.length/e))}get byteLength(){return Math.trunc(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,n=this.buffer.length;r>=n&&this._resize(n===0?Ha(r*1,this.BYTES_PER_ELEMENT):Ha(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Ha(t*this.stride,this.BYTES_PER_ELEMENT);let e=Yj(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Rr(new this.ArrayType(t),this.buffer)}};Qi.prototype.offset=0;var Ri=class extends Qi{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}},Yr=class extends Ri{constructor(t=new Uint8Array(0)){super(t,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),n=t>>3,o=t%8,c=r[n]>>o&1;return e?c===0&&(r[n]|=1<<o,++this.numValid):c===1&&(r[n]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Xr=class extends Ri{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,e){let r=this.length-1,n=this.reserve(t-r+1).buffer;return r<t++&&n.fill(n[r],r,t),n[t]=n[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}};var At=class{constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=De(t),this._nulls=new Yr,e&&e.length>0&&(this._isValid=Jh(e))}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}toVector(){return new G([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:n,_typeIds:o,children:c}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),c.reduce((h,m)=>h+m.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=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,e,r,n,{type:o,length:c,nullCount:h,_typeIds:m,_offsets:v,_values:C,_nulls:B}=this;(e=m==null?void 0:m.flush(c))?n=v==null?void 0:v.flush(c):(n=v==null?void 0:v.flush(c))?t=C==null?void 0:C.flush(v.last()):t=C==null?void 0:C.flush(c),h>0&&(r=B==null?void 0:B.flush(c));let F=this.children.map(k=>k.flush());return this.clear(),J({type:o,length:c,nullCount:h,children:F,child:F[0],data:t,typeIds:e,nullBitmap:r,valueOffsets:n})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,r,n;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(),(n=this._typeIds)===null||n===void 0||n.clear();for(let o of this.children)o.clear();return this}};At.prototype.length=1;At.prototype.stride=1;At.prototype.children=null;At.prototype.finished=!1;At.prototype.nullValues=null;At.prototype._isValid=()=>!0;var $t=class extends At{constructor(t){super(t),this._values=new Ri(new this.ArrayType(0),this.stride)}setValue(t,e){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}},di=class extends At{constructor(t){super(t),this._pendingLength=0,this._offsets=new Xr}setValue(t,e){let r=this._pending||(this._pending=new Map),n=r.get(t);n&&(this._pendingLength-=n.length),this._pendingLength+=e instanceof ci?e[Ve].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 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)}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,n){return t.prep(8,24),t.writeInt64(n),t.pad(4),t.writeInt32(r),t.writeInt64(e),t.offset()}};var fi=new Int32Array(2),lo=new Float32Array(fi.buffer),co=new Float64Array(fi.buffer),Gr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Nt=class{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Nt.ZERO:new Nt(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};Nt.ZERO=new Nt(0,0);var In;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(In||(In={}));var fe=class{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new fe(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 new Nt(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new Nt(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return fi[0]=this.readInt32(t),lo[0]}readFloat64(t){return fi[Gr?0:1]=this.readInt32(t),fi[Gr?1:0]=this.readInt32(t+4),co[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,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){lo[0]=e,this.writeInt32(t,fi[0])}writeFloat64(t,e){co[0]=e,this.writeInt32(t,fi[Gr?0:1]),this.writeInt32(t+4,fi[Gr?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),n="",o=0;if(t+=4,e===In.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){let c,h=this.readUint8(t+o++);if(h<192)c=h;else{let m=this.readUint8(t+o++);if(h<224)c=(h&31)<<6|m&63;else{let v=this.readUint8(t+o++);if(h<240)c=(h&15)<<12|(m&63)<<6|v&63;else{let C=this.readUint8(t+o++);c=(h&7)<<18|(m&63)<<12|(v&63)<<6|C&63}}}c<65536?n+=String.fromCharCode(c):(c-=65536,n+=String.fromCharCode((c>>10)+55296,(c&(1<<10)-1)+56320))}return n}__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}createLong(t,e){return Nt.create(t,e)}createScalarList(t,e){let r=[];for(let n=0;n<e;++n)t(n)!==null&&r.push(t(n));return r}createObjList(t,e){let r=[];for(let n=0;n<e;++n){let o=t(n);o!==null&&r.push(o.unpack())}return r}};var Ui=class{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;let e;t?e=t:e=1024,this.bb=fe.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 n=this.bb.capacity();this.bb=Ui.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}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.equals(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 Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("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,n=fe.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n}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 n=2;this.addInt16(t-this.object_start);let o=(r+n)*2;this.addInt16(o);let c=0,h=this.space;t:for(e=0;e<this.vtables.length;e++){let m=this.bb.capacity()-this.vtables[e];if(o==this.bb.readInt16(m)){for(let v=2;v<o;v+=2)if(this.bb.readInt16(h+v)!=this.bb.readInt16(m+v))continue t;c=this.vtables[e];break}}return c?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,c-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 n=r?4:0;if(e){let o=e;if(this.prep(this.minalign,4+4+n),o.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let c=4-1;c>=0;c--)this.writeInt8(o.charCodeAt(c))}this.prep(this.minalign,4+n),this.addOffset(t),n&&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,n=r-this.bb.readInt32(r);if(!(this.bb.readInt16(n+e)!=0))throw new Error("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)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let r=0;for(;r<t.length;){let n,o=t.charCodeAt(r++);if(o<55296||o>=56320)n=o;else{let c=t.charCodeAt(r++);n=(o<<10)+c+(65536-(55296<<10)-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let r=0,n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()}createLong(t,e){return Nt.create(t,e)}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 n=t[r];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}};var wt=class{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 wt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new wt).__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 wt.startKeyValue(t),wt.addKey(t,e),wt.addValue(t,r),wt.endKeyValue(t)}};var tr;(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"})(tr||(tr={}));var er;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(er||(er={}));var An;(function(i){i[i.DenseArray=0]="DenseArray"})(An||(An={}));var Yt=class{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 Yt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new Yt).__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 Yt.startInt(t),Yt.addBitWidth(t,e),Yt.addIsSigned(t,r),Yt.endInt(t)}};var ke=class{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 ke).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new ke).__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):this.bb.createLong(0,0)}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Yt).__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):An.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,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,An.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var hi=class{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 hi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new hi).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return hi.startBinary(t),hi.endBinary(t)}};var pi=class{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 pi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new pi).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return pi.startBool(t),pi.endBool(t)}};var Cn;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(Cn||(Cn={}));var be=class{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 be).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new be).__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):Cn.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Cn.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return be.startDate(t),be.addUnit(t,e),be.endDate(t)}};var Xt=class{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 Xt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new Xt).__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,n){return Xt.startDecimal(t),Xt.addPrecision(t,e),Xt.addScale(t,r),Xt.addBitWidth(t,n),Xt.endDecimal(t)}};var ir;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(ir||(ir={}));var ge=class{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 ge).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new ge).__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 ge.startFixedSizeBinary(t),ge.addByteWidth(t,e),ge.endFixedSizeBinary(t)}};var ve=class{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 ve).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new ve).__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 ve.startFixedSizeList(t),ve.addListSize(t,e),ve.endFixedSizeList(t)}};var xn;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(xn||(xn={}));var we=class{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 we).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new we).__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):xn.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,xn.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return we.startFloatingPoint(t),we.addPrecision(t,e),we.endFloatingPoint(t)}};var Fn;(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"})(Fn||(Fn={}));var je=class{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 je).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new je).__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):Fn.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Fn.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return je.startInterval(t),je.addUnit(t,e),je.endInterval(t)}};var yi=class{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 yi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new yi).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return yi.startList(t),yi.endList(t)}};var Se=class{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 Se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new Se).__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 Se.startMap(t),Se.addKeysSorted(t,e),Se.endMap(t)}};var _i=class{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 mi=class{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 mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new mi).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return mi.startStruct_(t),mi.endStruct_(t)}};var re=class{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 re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new re).__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):ir.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,ir.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return re.startTime(t),re.addUnit(t,e),re.addBitWidth(t,r),re.endTime(t)}};var ne=class{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 ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new ne).__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):ir.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,ir.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return ne.startTimestamp(t),ne.addUnit(t,e),ne.addTimezone(t,r),ne.endTimestamp(t)}};var Bn;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Bn||(Bn={}));var Gt=class{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 Gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new Gt).__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):Bn.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,Bn.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 Gt.startUnion(t),Gt.addMode(t,e),Gt.addTypeIds(t,r),Gt.endUnion(t)}};var bi=class{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 bi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new bi).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return bi.startUtf8(t),bi.endUtf8(t)}};var Ct;(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"})(Ct||(Ct={}));var Lt=class{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 Lt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new Lt).__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):Ct.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 ke).__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 Lt).__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 wt).__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,Ct.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 Bt=class{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 Bt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new Bt).__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):er.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Lt).__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 wt).__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):this.bb.createLong(0,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,er.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,n,o){return Bt.startSchema(t),Bt.addEndianness(t,e),Bt.addFields(t,r),Bt.addCustomMetadata(t,n),Bt.addFeatures(t,o),Bt.endSchema(t)}};var se=class{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 se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new se).__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):tr.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Bt).__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 vr).__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 vr).__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 wt).__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,tr.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{constructor(t=[],e,r){this.fields=t||[],this.metadata=e||new Map,r||(r=za(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){let e=new Set(t),r=this.fields.filter(n=>e.has(n.name));return new at(r,this.metadata)}selectAt(t){let e=t.map(r=>this.fields[r]).filter(Boolean);return new at(e,this.metadata)}assign(...t){let e=t[0]instanceof at?t[0]:Array.isArray(t[0])?new at(t[0]):new at(t),r=[...this.fields],n=fo(fo(new Map,this.metadata),e.metadata),o=e.fields.filter(h=>{let m=r.findIndex(v=>v.name===h.name);return~m?(r[m]=h.clone({metadata:fo(fo(new Map,r[m].metadata),h.metadata)}))&&!1:!0}),c=za(o,new Map);return new at([...r,...o],n,new Map([...this.dictionaries,...c]))}};at.prototype.fields=null;at.prototype.metadata=null;at.prototype.dictionaries=null;var Q=class{constructor(t,e,r=!1,n){this.name=t,this.type=e,this.nullable=r,this.metadata=n||new Map}static new(...t){let[e,r,n,o]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),n===void 0&&(n=t[0].nullable),o===void 0&&(o=t[0].metadata)),new Q(`${e}`,r,n,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,r,n,o]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,n=this.nullable,o=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:n=this.nullable,metadata:o=this.metadata}=t[0],Q.new(e,r,n,o)}};Q.prototype.type=null;Q.prototype.name=null;Q.prototype.nullable=null;Q.prototype.metadata=null;function fo(i,t){return new Map([...i||new Map,...t||new Map])}function za(i,t=new Map){for(let e=-1,r=i.length;++e<r;){let o=i[e].type;if(R.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&za(o.children,t)}return t}var qh=Nt,Xj=Ui,Gj=fe,Ni=class{constructor(t,e=Wt.V4,r,n){this.schema=t,this.version=e,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}static decode(t){t=new Gj(Y(t));let e=se.getRootAsFooter(t),r=at.decode(e.schema());return new Wa(r,e)}static encode(t){let e=new Xj,r=at.encode(e,t.schema);se.startRecordBatchesVector(e,t.numRecordBatches);for(let c of[...t.recordBatches()].slice().reverse())ri.encode(e,c);let n=e.endVector();se.startDictionariesVector(e,t.numDictionaries);for(let c of[...t.dictionaryBatches()].slice().reverse())ri.encode(e,c);let o=e.endVector();return se.startFooter(e),se.addSchema(e,r),se.addVersion(e,Wt.V4),se.addRecordBatches(e,n),se.addDictionaries(e,o),se.finishFooterBuffer(e,se.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*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 Wa=class extends Ni{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let e=this._footer.recordBatches(t);if(e)return ri.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return ri.decode(e)}return null}},ri=class{constructor(t,e,r){this.metaDataLength=t,this.offset=typeof r=="number"?r:r.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new ri(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:r}=e,n=new qh(e.offset,0),o=new qh(e.bodyLength,0);return vr.createBlock(t,n,r,o)}};var jt=Object.freeze({done:!0,value:void 0}),Tn=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},wr=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())}},ho=class extends wr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return O(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(jt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Qt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Qt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return O(this,void 0,void 0,function*(){return yield this.abort(t),jt})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),jt})}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(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(jt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var gi=class extends ho{write(t){if((t=Y(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?pn(this.toUint8Array(!0)):this.toUint8Array(!1).then(pn)}toUint8Array(t=!1){return t?Be(this._values)[0]:(()=>O(this,void 0,void 0,function*(){var e,r;let n=[],o=0;try{for(var c=Ne(this),h;h=yield c.next(),!h.done;){let m=h.value;n.push(m),o+=m.byteLength}}catch(m){e={error:m}}finally{try{h&&!h.done&&(r=c.return)&&(yield r.call(c))}finally{if(e)throw e.error}}return Be(n,o)[0]}))()}},vi=class{constructor(t){t&&(this.source=new $a(Qt.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)}},Ie=class{constructor(t){t instanceof Ie?this.source=t.source:t instanceof gi?this.source=new Li(Qt.fromAsyncIterable(t)):Fs(t)?this.source=new Li(Qt.fromNodeStream(t)):_n(t)?this.source=new Li(Qt.fromDOMStream(t)):Cs(t)?this.source=new Li(Qt.fromDOMStream(t.body)):Ye(t)?this.source=new Li(Qt.fromIterable(t)):$e(t)?this.source=new Li(Qt.fromAsyncIterable(t)):Le(t)&&(this.source=new Li(Qt.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)}},$a=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)||jt)}return(t){return Object.create(this.source.return&&this.source.return(t)||jt)}},Li=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return O(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return O(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return O(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||jt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return O(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||jt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Dn=class extends vi{constructor(t,e){super(),this.position=0,this.buffer=Y(t),this.size=typeof e>"u"?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:n}=this;return e&&n<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,n+Math.min(r-n,t)),e.subarray(n,this.position)):null}readAt(t,e){let r=this.buffer,n=Math.min(this.size,t+e);return r?r.subarray(t,n):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}}},rr=class extends Ie{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=(()=>O(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending}))()}readInt32(t){return O(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 O(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 O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:r,position:n}=this;if(e&&n<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=n,c=0,h=0,m=Math.min(r,o+Math.min(r-o,t)),v=new Uint8Array(Math.max(0,(this.position=m)-o));for(;(o+=h)<m&&(c+=h)<v.byteLength;)({bytesRead:h}=yield e.read(v,c,v.byteLength-c,o));return v}return null})}readAt(t,e){return O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n}=this;if(r&&t+e<n){let o=Math.min(n,t+e),c=new Uint8Array(o-t);return(yield r.read(c,0,e,t)).buffer}return new Uint8Array(e)})}close(){return O(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var Xa={};hr(Xa,{BaseInt64:()=>En,Int128:()=>Ae,Int64:()=>Kt,Uint64:()=>ht});function Kr(i){return i<0&&(i=4294967295+i+1),`0x${i.toString(16)}`}var Jr=8,Ya=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],En=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]),n=e[3]*r[3];this.buffer[0]=n&65535;let o=n>>>16;return n=e[2]*r[3],o+=n,n=e[3]*r[2]>>>0,o+=n,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<n?65536:0,this.buffer[1]+=o>>>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`${Kr(this.buffer[1])} ${Kr(this.buffer[0])}`}},ht=class extends En{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return ht.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return ht.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.length,n=new ht(e);for(let o=0;o<r;){let c=Jr<r-o?Jr:r-o,h=new ht(new Uint32Array([Number.parseInt(t.slice(o,o+c),10),0])),m=new ht(new Uint32Array([Ya[c],0]));n.times(m),n.plus(h),o+=c}return n}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)ht.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new ht(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ht(new Uint32Array(t.buffer)).plus(e)}},Kt=class extends En{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 Kt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Kt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.startsWith("-"),n=t.length,o=new Kt(e);for(let c=r?1:0;c<n;){let h=Jr<n-c?Jr:n-c,m=new Kt(new Uint32Array([Number.parseInt(t.slice(c,c+h),10),0])),v=new Kt(new Uint32Array([Ya[h],0]));o.times(v),o.plus(m),c+=h}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)Kt.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new Kt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Kt(new Uint32Array(t.buffer)).plus(e)}},Ae=class{constructor(t){this.buffer=t}high(){return new Kt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Kt(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 ht(new Uint32Array([this.buffer[3],0])),r=new ht(new Uint32Array([this.buffer[2],0])),n=new ht(new Uint32Array([this.buffer[1],0])),o=new ht(new Uint32Array([this.buffer[0],0])),c=new ht(new Uint32Array([t.buffer[3],0])),h=new ht(new Uint32Array([t.buffer[2],0])),m=new ht(new Uint32Array([t.buffer[1],0])),v=new ht(new Uint32Array([t.buffer[0],0])),C=ht.multiply(o,v);this.buffer[0]=C.low();let B=new ht(new Uint32Array([C.high(),0]));return C=ht.multiply(n,v),B.plus(C),C=ht.multiply(o,m),B.plus(C),this.buffer[1]=B.low(),this.buffer[3]=B.lessThan(C)?1:0,this.buffer[2]=B.high(),new ht(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ht.multiply(r,v)).plus(ht.multiply(n,m)).plus(ht.multiply(o,h)),this.buffer[3]+=ht.multiply(e,v).plus(ht.multiply(r,m)).plus(ht.multiply(n,h)).plus(ht.multiply(o,c)).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`${Kr(this.buffer[3])} ${Kr(this.buffer[2])} ${Kr(this.buffer[1])} ${Kr(this.buffer[0])}`}static multiply(t,e){return new Ae(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ae(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ae.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ae.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let r=t.startsWith("-"),n=t.length,o=new Ae(e);for(let c=r?1:0;c<n;){let h=Jr<n-c?Jr:n-c,m=new Ae(new Uint32Array([Number.parseInt(t.slice(c,c+h),10),0,0,0])),v=new Ae(new Uint32Array([Ya[h],0,0,0]));o.times(v),o.plus(m),c+=h}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*4);for(let r=-1,n=t.length;++r<n;)Ae.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}};var kn=class extends V{constructor(t,e,r,n){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=n}visit(t){return super.visit(t instanceof Q?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return J({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===Ft.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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)}},po=class extends kn{constructor(t,e,r,n){super(new Uint8Array(0),e,r,n),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):mr(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return rt(Uint8Array,rt(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return rt(Uint8Array,rt(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;return R.isTimestamp(t)?rt(Uint8Array,Kt.convertArray(r[e])):(R.isInt(t)||R.isTime(t))&&t.bitWidth===64?rt(Uint8Array,Kt.convertArray(r[e])):R.isDate(t)&&t.unit===te.MILLISECOND?rt(Uint8Array,Kt.convertArray(r[e])):R.isDecimal(t)?rt(Uint8Array,Ae.convertArray(r[e])):R.isBinary(t)||R.isFixedSizeBinary(t)?Kj(r[e]):R.isBool(t)?mr(r[e]):R.isUtf8(t)?Xi(r[e].join("")):rt(Uint8Array,rt(t.ArrayType,r[e].map(n=>+n)))}};function Kj(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 qr=class extends di{constructor(t){super(t),this._values=new Qi(new Uint8Array(0))}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,Y(e))}_flushPending(t,e){let r=this._offsets,n=this._values.reserve(e).buffer,o=0;for(let[c,h]of t)if(h===void 0)r.set(c,0);else{let m=h.length;n.set(h,o),r.set(c,m),o+=m}}};var yo=class extends At{constructor(t){super(t),this._values=new Yr}setValue(t,e){this._values.set(t,+e)}};var jr=class extends $t{};jr.prototype._setValue=Fa;var On=class extends jr{};On.prototype._setValue=Hs;var Mn=class extends jr{};Mn.prototype._setValue=zs;var Rn=class extends $t{};Rn.prototype._setValue=Da;var _o=class extends At{constructor({type:t,nullValues:e,dictionaryHashFunction:r}){super({type:new Te(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Sr({type:this.type.indices,nullValues:e}),this.dictionary=Sr({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,n=this.valueToKey(e),o=r[n];return o===void 0&&(r[n]=o=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,e=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(t);return n.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}};var Un=class extends $t{};Un.prototype._setValue=xa;var mo=class extends At{setValue(t,e){let[r]=this.children,n=t*this.stride;for(let o=-1,c=e.length;++o<c;)r.set(n+o,e[o])}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 Qe(this.type.listSize,new Q(e,t.type,!0)),r}};var Ir=class extends $t{setValue(t,e){this._values.set(t,e)}},bo=class extends Ir{setValue(t,e){super.setValue(t,gn(e))}},go=class extends Ir{},vo=class extends Ir{};var Ar=class extends $t{};Ar.prototype._setValue=Ea;var Nn=class extends Ar{};Nn.prototype._setValue=Zs;var Ln=class extends Ar{};Ln.prototype._setValue=Qs;var ze=class extends $t{setValue(t,e){this._values.set(t,e)}},wo=class extends ze{},jo=class extends ze{},So=class extends ze{},Io=class extends ze{},Ao=class extends ze{},Co=class extends ze{},xo=class extends ze{},Fo=class extends ze{};var Bo=class extends di{constructor(t){super(t),this._offsets=new Xr}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 qe(new Q(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let c=o.length,h=e.set(n,c).buffer[n];for(let m=-1;++m<c;)r.set(h+m,o[m])}}};var To=class extends di{set(t,e){return super.set(t,e)}setValue(t,e){let r=e instanceof Map?e:new Map(Object.entries(e)),n=this._pending||(this._pending=new Map),o=n.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=r.size,n.set(t,r)}addChild(t,e=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ti(new Q(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let{[n]:c,[n+1]:h}=e.set(n,o.size).buffer;for(let m of o.entries())if(r.set(c,m),++c>=h)break}}};var Do=class extends At{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var Eo=class extends At{setValue(t,e){let{children:r,type:n}=this;switch(Array.isArray(e)||e.constructor){case!0:return n.children.forEach((o,c)=>r[c].set(t,e[c]));case Map:return n.children.forEach((o,c)=>r[c].set(t,e.get(o.name)));default:return n.children.forEach((o,c)=>r[c].set(t,e[o.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(r=>r.setValid(t,e)),e}addChild(t,e=`${this.numChildren}`){let r=this.children.push(t);return this.type=new vt([...this.type.children,new Q(e,t.type,!0)]),r}};var Pi=class extends $t{};Pi.prototype._setValue=Ba;var Pn=class extends Pi{};Pn.prototype._setValue=Ws;var Vn=class extends Pi{};Vn.prototype._setValue=$s;var Hn=class extends Pi{};Hn.prototype._setValue=Ys;var zn=class extends Pi{};zn.prototype._setValue=Xs;var Vi=class extends $t{};Vi.prototype._setValue=Ta;var Wn=class extends Vi{};Wn.prototype._setValue=Gs;var $n=class extends Vi{};$n.prototype._setValue=Ks;var Yn=class extends Vi{};Yn.prototype._setValue=Js;var Xn=class extends Vi{};Xn.prototype._setValue=qs;var Zr=class extends At{constructor(t){super(t),this._typeIds=new Ri(new 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.setValid(t,this.isValid(e))&&this.setValue(t,e,r),this}setValue(t,e,r){this._typeIds.set(t,r);let n=this.type.typeIdToChildIndex[r],o=this.children[n];o==null||o.set(t,e)}addChild(t,e=`${this.children.length}`){let r=this.children.push(t),{type:{children:n,mode:o,typeIds:c}}=this,h=[...n,new Q(e,t.type)];return this.type=new Ze(o,[...c,r],h),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.")}},ko=class extends Zr{},Oo=class extends Zr{constructor(t){super(t),this._offsets=new Ri(new Int32Array(0))}setValue(t,e,r){let n=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[n]),c=this._offsets.set(t,o.length).buffer[t];o==null||o.set(c,e)}};var Gn=class extends di{constructor(t){super(t),this._values=new Qi(new Uint8Array(0))}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,Xi(e))}_flushPending(t,e){}};Gn.prototype._flushPending=qr.prototype._flushPending;var Ga=class extends V{visitNull(){return Do}visitBool(){return yo}visitInt(){return ze}visitInt8(){return wo}visitInt16(){return jo}visitInt32(){return So}visitInt64(){return Io}visitUint8(){return Ao}visitUint16(){return Co}visitUint32(){return xo}visitUint64(){return Fo}visitFloat(){return Ir}visitFloat16(){return bo}visitFloat32(){return go}visitFloat64(){return vo}visitUtf8(){return Gn}visitBinary(){return qr}visitFixedSizeBinary(){return Un}visitDate(){return jr}visitDateDay(){return On}visitDateMillisecond(){return Mn}visitTimestamp(){return Pi}visitTimestampSecond(){return Pn}visitTimestampMillisecond(){return Vn}visitTimestampMicrosecond(){return Hn}visitTimestampNanosecond(){return zn}visitTime(){return Vi}visitTimeSecond(){return Wn}visitTimeMillisecond(){return $n}visitTimeMicrosecond(){return Yn}visitTimeNanosecond(){return Xn}visitDecimal(){return Rn}visitList(){return Bo}visitStruct(){return Eo}visitUnion(){return Zr}visitDenseUnion(){return Oo}visitSparseUnion(){return ko}visitDictionary(){return _o}visitInterval(){return Ar}visitIntervalDayTime(){return Nn}visitIntervalYearMonth(){return Ln}visitFixedSizeList(){return mo}visitMap(){return To}},Zh=new Ga;var $=class extends V{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,n)=>this.compareFields(r,e[n]))}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 Kn(i,t){return i===t||Ce(i,t)}function Hi(i,t){return i===t||Ce(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function Mo(i,t){return i===t||Ce(i,t)&&i.precision===t.precision}function Jj(i,t){return i===t||Ce(i,t)&&i.byteWidth===t.byteWidth}function Ka(i,t){return i===t||Ce(i,t)&&i.unit===t.unit}function Jn(i,t){return i===t||Ce(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function qn(i,t){return i===t||Ce(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function qj(i,t){return i===t||Ce(i,t)&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}function Zj(i,t){return i===t||Ce(i,t)&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}function Ja(i,t){return i===t||Ce(i,t)&&i.mode===t.mode&&i.typeIds.every((e,r)=>e===t.typeIds[r])&&wi.compareManyFields(i.children,t.children)}function Qj(i,t){return i===t||Ce(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&wi.visit(i.indices,t.indices)&&wi.visit(i.dictionary,t.dictionary)}function qa(i,t){return i===t||Ce(i,t)&&i.unit===t.unit}function tS(i,t){return i===t||Ce(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}function eS(i,t){return i===t||Ce(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&wi.compareManyFields(i.children,t.children)}$.prototype.visitNull=Kn;$.prototype.visitBool=Kn;$.prototype.visitInt=Hi;$.prototype.visitInt8=Hi;$.prototype.visitInt16=Hi;$.prototype.visitInt32=Hi;$.prototype.visitInt64=Hi;$.prototype.visitUint8=Hi;$.prototype.visitUint16=Hi;$.prototype.visitUint32=Hi;$.prototype.visitUint64=Hi;$.prototype.visitFloat=Mo;$.prototype.visitFloat16=Mo;$.prototype.visitFloat32=Mo;$.prototype.visitFloat64=Mo;$.prototype.visitUtf8=Kn;$.prototype.visitBinary=Kn;$.prototype.visitFixedSizeBinary=Jj;$.prototype.visitDate=Ka;$.prototype.visitDateDay=Ka;$.prototype.visitDateMillisecond=Ka;$.prototype.visitTimestamp=Jn;$.prototype.visitTimestampSecond=Jn;$.prototype.visitTimestampMillisecond=Jn;$.prototype.visitTimestampMicrosecond=Jn;$.prototype.visitTimestampNanosecond=Jn;$.prototype.visitTime=qn;$.prototype.visitTimeSecond=qn;$.prototype.visitTimeMillisecond=qn;$.prototype.visitTimeMicrosecond=qn;$.prototype.visitTimeNanosecond=qn;$.prototype.visitDecimal=Kn;$.prototype.visitList=qj;$.prototype.visitStruct=Zj;$.prototype.visitUnion=Ja;$.prototype.visitDenseUnion=Ja;$.prototype.visitSparseUnion=Ja;$.prototype.visitDictionary=Qj;$.prototype.visitInterval=qa;$.prototype.visitIntervalDayTime=qa;$.prototype.visitIntervalYearMonth=qa;$.prototype.visitFixedSizeList=tS;$.prototype.visitMap=eS;var wi=new $;function Cr(i,t){return wi.compareSchemas(i,t)}function Qh(i,t){return wi.compareFields(i,t)}function tp(i,t){return wi.visit(i,t)}function Sr(i){let t=i.type,e=new(Zh.getVisitFn(t)())(i);if(t.children&&t.children.length>0){let r=i.children||[],n={nullValues:i.nullValues},o=Array.isArray(r)?(c,h)=>r[h]||n:({name:c})=>r[c]||n;for(let[c,h]of t.children.entries()){let{type:m}=h,v=o(h,c);e.children.push(Sr(Object.assign(Object.assign({},v),{type:m})))}}return e}function Ro(i,t){return iS(i,t.map(e=>e.data.concat()))}function iS(i,t){let e=[...i.fields],r=[],n={numBatches:t.reduce((B,F)=>Math.max(B,F.length),0)},o=0,c=0,h=-1,m=t.length,v,C=[];for(;n.numBatches-- >0;){for(c=Number.POSITIVE_INFINITY,h=-1;++h<m;)C[h]=v=t[h].shift(),c=Math.min(c,v?v.length:c);Number.isFinite(c)&&(C=rS(e,c,C,t,n),c>0&&(r[o++]=J({type:new vt(e),length:c,nullCount:0,children:C.slice()})))}return[i=i.assign(e),r.map(B=>new bt(i,B))]}function rS(i,t,e,r,n){var o;let c=(t+63&-64)>>3;for(let h=-1,m=r.length;++h<m;){let v=e[h],C=v==null?void 0:v.length;if(C>=t)C===t?e[h]=v:(e[h]=v.slice(0,t),n.numBatches=Math.max(n.numBatches,r[h].unshift(v.slice(t,C-t))));else{let B=i[h];i[h]=B.clone({nullable:!0}),e[h]=(o=v==null?void 0:v._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:J({type:B.type,length:t,nullCount:t,nullBitmap:new Uint8Array(c)})}}return e}var ep,Et=class{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new at([]),this._offsets=[0],this;let n,o;t[0]instanceof at&&(n=t.shift()),t[t.length-1]instanceof Uint32Array&&(o=t.pop());let c=m=>{if(m){if(m instanceof bt)return[m];if(m instanceof Et)return m.batches;if(m instanceof ft){if(m.type instanceof vt)return[new bt(new at(m.type.children),m)]}else{if(Array.isArray(m))return m.flatMap(v=>c(v));if(typeof m[Symbol.iterator]=="function")return[...m].flatMap(v=>c(v));if(typeof m=="object"){let v=Object.keys(m),C=v.map(k=>new G([m[k]])),B=new at(v.map((k,lt)=>new Q(String(k),C[lt].type))),[,F]=Ro(B,C);return F.length===0?[new bt(m)]:F}}}return[]},h=t.flatMap(m=>c(m));if(n=(r=n!=null?n:(e=h[0])===null||e===void 0?void 0:e.schema)!==null&&r!==void 0?r:new at([]),!(n instanceof at))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let m of h){if(!(m instanceof bt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Cr(n,m.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=h,this._offsets=o!=null?o:no(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=ro(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?Wr.visit(new G(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
8
8
  ${this.toArray().join(`,
9
9
  `)}
10
- ]`}concat(...t){let e=this.schema,r=this.data.concat(t.flatMap(({data:n})=>n));return new Ot(e,r.map(n=>new vt(e,n)))}slice(t,e){let r=this.schema;[t,e]=In({length:this.numRows},t,e);let n=ao(this.data,this._offsets,t,e);return new Ot(r,n.map(o=>new vt(r,o)))}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],n=J({type:r,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new G(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new G([J({type:new de,length:this.numRows})]));let o=r.fields.slice(),c=o[t].clone({type:e.type}),h=this.schema.fields.map((m,g)=>this.getChildAt(g));[o[t],h[t]]=[c,e],[r,n]=No(r,h)}return new Ot(r,n)}select(t){let e=this.schema.fields.reduce((r,n,o)=>r.set(n.name,o),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(n=>n.selectAt(t));return new Ot(e,r)}assign(t){let e=this.schema.fields,[r,n]=t.schema.fields.reduce((h,m,g)=>{let[x,T]=h,C=e.findIndex(k=>k.name===m.name);return~C?T[C]=g:x.push(g),h},[[],[]]),o=this.schema.assign(t.schema),c=[...e.map((h,m)=>[m,n[m]]).map(([h,m])=>m===void 0?this.getChildAt(h):t.getChildAt(m)),...r.map(h=>t.getChildAt(h))].filter(Boolean);return new Ot(...No(o,c))}};Qh=Symbol.toStringTag;Ot[Qh]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Qi(Fn),i.get=Qi(Nt.getVisitFn(A.Struct)),i.set=lo(ee.getVisitFn(A.Struct)),i.indexOf=co(jr.getVisitFn(A.Struct)),i.getByteLength=Qi(Ee.getVisitFn(A.Struct)),"Table"))(Ot.prototype);var ep,vt=class{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=J({nullCount:0,type:new wt(this.schema.fields),children:this.schema.fields.map(e=>J({type:e.type,nullCount:0}))})]=t,!(this.data instanceof ft))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=tp(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:r,children:n,length:o}=Object.keys(e).reduce((m,g,x)=>(m.children[x]=e[g],m.length=Math.max(m.length,e[g].length),m.fields[x]=tt.new({name:g,type:e[g].type,nullable:!0}),m),{length:0,fields:new Array,children:new Array}),c=new at(r),h=J({type:new wt(r),length:o,children:n,nullCount:0});[this.schema,this.data]=tp(c,h.children,o);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=ip(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 Nt.visit(this.data,t)}set(t,e){return ee.visit(this.data,t,e)}indexOf(t,e){return jr.visit(this.data,t,e)}getByteLength(t){return Ee.visit(this.data,t)}[Symbol.iterator](){return $r.visit(new G([this.data]))}toArray(){return[...this]}concat(...t){return new Ot(this.schema,[this,...t])}slice(t,e){let[r]=new G([this.data]).slice(t,e).data;return new vt(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 G([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(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=this.data;if(t>-1&&t<this.numCols){e||(e=new G([J({type:new de,length:this.numRows})]));let o=r.fields.slice(),c=n.children.slice(),h=o[t].clone({type:e.type});[o[t],c[t]]=[h,e.data[0]],r=new at(o,new Map(this.schema.metadata)),n=J({type:new wt(o),children:c})}return new vt(r,n)}select(t){let e=this.schema.select(t),r=new wt(e.fields),n=[];for(let o of t){let c=this.schema.fields.findIndex(h=>h.name===o);~c&&(n[c]=this.data.children[c])}return new vt(e,J({type:r,length:this.numRows,children:n}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(o=>this.data.children[o]).filter(Boolean),n=J({type:new wt(e.fields),length:this.numRows,children:r});return new vt(e,n)}};ep=Symbol.toStringTag;vt[ep]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(vt.prototype);function tp(i,t,e=t.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...i.fields],o=[...t],c=(e+63&-64)>>3;for(let[h,m]of i.fields.entries()){let g=t[h];(!g||g.length!==e)&&(n[h]=m.clone({nullable:!0}),o[h]=(r=g==null?void 0:g._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:J({type:m.type,length:e,nullCount:e,nullBitmap:new Uint8Array(c)}))}return[i.assign(n),J({type:new wt(n),length:e,children:o})]}function ip(i,t,e=new Map){for(let r=-1,n=i.length;++r<n;){let c=i[r].type,h=t[r];if(U.isDictionary(c)){if(!e.has(c.id))h.dictionary&&e.set(c.id,h.dictionary);else if(e.get(c.id)!==h.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}c.children&&c.children.length>0&&ip(c.children,h.children,e)}return e}var Tr=class extends vt{constructor(t){let e=t.fields.map(n=>J({type:n.type})),r=J({type:new wt(t.fields),nullCount:0,children:e});super(t,r)}};var is;(function(i){i[i.BUFFER=0]="BUFFER"})(is||(is={}));var rs;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(rs||(rs={}));var ni=class{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 ni).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new ni).__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):rs.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):is.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,rs.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,is.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return ni.startBodyCompression(t),ni.addCodec(t,e),ni.addMethod(t,r),ni.endBodyCompression(t)}};var tn=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(r),t.writeInt64(e),t.offset()}};var en=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(r),t.writeInt64(e),t.offset()}};var oe=class{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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new oe).__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):this.bb.createLong(0,0)}nodes(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new en).__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 tn).__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 ni).__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,t.createLong(0,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 We=class{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 We).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new We).__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):this.bb.createLong(0,0)}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new oe).__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,t.createLong(0,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 rn;(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"})(rn||(rn={}));var Rt=class{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 Rt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new Rt).__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):er.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):rn.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):this.bb.createLong(0,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,er.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,rn.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,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,n,o,c){return Rt.startMessage(t),Rt.addVersion(t,e),Rt.addHeaderType(t,r),Rt.addHeader(t,n),Rt.addBodyLength(t,o),Rt.addCustomMetadata(t,c),Rt.endMessage(t)}};var eS=Lt,Qa=class extends V{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return _i.startNull(e),_i.endNull(e)}visitInt(t,e){return Xt.startInt(e),Xt.addBitWidth(e,t.bitWidth),Xt.addIsSigned(e,t.isSigned),Xt.endInt(e)}visitFloat(t,e){return we.startFloatingPoint(e),we.addPrecision(e,t.precision),we.endFloatingPoint(e)}visitBinary(t,e){return hi.startBinary(e),hi.endBinary(e)}visitBool(t,e){return pi.startBool(e),pi.endBool(e)}visitUtf8(t,e){return bi.startUtf8(e),bi.endUtf8(e)}visitDecimal(t,e){return Gt.startDecimal(e),Gt.addScale(e,t.scale),Gt.addPrecision(e,t.precision),Gt.addBitWidth(e,t.bitWidth),Gt.endDecimal(e)}visitDate(t,e){return be.startDate(e),be.addUnit(e,t.unit),be.endDate(e)}visitTime(t,e){return re.startTime(e),re.addUnit(e,t.unit),re.addBitWidth(e,t.bitWidth),re.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return ne.startTimestamp(e),ne.addUnit(e,t.unit),r!==void 0&&ne.addTimezone(e,r),ne.endTimestamp(e)}visitInterval(t,e){return je.startInterval(e),je.addUnit(e,t.unit),je.endInterval(e)}visitList(t,e){return yi.startList(e),yi.endList(e)}visitStruct(t,e){return mi.startStruct_(e),mi.endStruct_(e)}visitUnion(t,e){Kt.startTypeIdsVector(e,t.typeIds.length);let r=Kt.createTypeIdsVector(e,t.typeIds);return Kt.startUnion(e),Kt.addMode(e,t.mode),Kt.addTypeIds(e,r),Kt.endUnion(e)}visitDictionary(t,e){let r=this.visit(t.indices,e);return ke.startDictionaryEncoding(e),ke.addId(e,new eS(t.id,0)),ke.addIsOrdered(e,t.isOrdered),r!==void 0&&ke.addIndexType(e,r),ke.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ve.startFixedSizeBinary(e),ve.addByteWidth(e,t.byteWidth),ve.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return ge.startFixedSizeList(e),ge.addListSize(e,t.listSize),ge.endFixedSizeList(e)}visitMap(t,e){return Se.startMap(e),Se.addKeysSorted(e,t.keysSorted),Se.endMap(e)}},Lo=new Qa;function op(i,t=new Map){return new at(iS(i,t),Po(i.customMetadata),t)}function tl(i){return new ie(i.count,lp(i.columns),cp(i.columns))}function ap(i){return new Ce(tl(i.data),i.id,i.isDelta)}function iS(i,t){return(i.fields||[]).filter(Boolean).map(e=>tt.fromJSON(e,t))}function rp(i,t){return(i.children||[]).filter(Boolean).map(e=>tt.fromJSON(e,t))}function lp(i){return(i||[]).reduce((t,e)=>[...t,new si(e.count,rS(e.VALIDITY)),...lp(e.children)],[])}function cp(i,t=[]){for(let e=-1,r=(i||[]).length;++e<r;){let n=i[e];n.VALIDITY&&t.push(new Fe(t.length,n.VALIDITY.length)),n.TYPE&&t.push(new Fe(t.length,n.TYPE.length)),n.OFFSET&&t.push(new Fe(t.length,n.OFFSET.length)),n.DATA&&t.push(new Fe(t.length,n.DATA.length)),t=cp(n.children,t)}return t}function rS(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function up(i,t){let e,r,n,o,c,h;return!t||!(o=i.dictionary)?(c=sp(i,rp(i,t)),n=new tt(i.name,c,i.nullable,Po(i.customMetadata))):t.has(e=o.id)?(r=(r=o.indexType)?np(r):new li,h=new Te(t.get(e),r,e,o.isOrdered),n=new tt(i.name,h,i.nullable,Po(i.customMetadata))):(r=(r=o.indexType)?np(r):new li,t.set(e,c=sp(i,rp(i,t))),h=new Te(c,r,e,o.isOrdered),n=new tt(i.name,h,i.nullable,Po(i.customMetadata))),n||null}function Po(i){return new Map(Object.entries(i||{}))}function np(i){return new Mt(i.isSigned,i.bitWidth)}function sp(i,t){let e=i.type.name;switch(e){case"NONE":return new de;case"null":return new de;case"binary":return new Ci;case"utf8":return new Bi;case"bool":return new Ti;case"list":return new qe((t||[])[0]);case"struct":return new wt(t||[]);case"struct_":return new wt(t||[])}switch(e){case"int":{let r=i.type;return new Mt(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=i.type;return new me(At[r.precision])}case"decimal":{let r=i.type;return new Di(r.scale,r.precision,r.bitWidth)}case"date":{let r=i.type;return new Ei(te[r.unit])}case"time":{let r=i.type;return new Je(ot[r.unit],r.bitWidth)}case"timestamp":{let r=i.type;return new ki(ot[r.unit],r.timezone)}case"interval":{let r=i.type;return new Oi(ue[r.unit])}case"union":{let r=i.type;return new Ze(Tt[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=i.type;return new Mi(r.byteWidth)}case"fixedsizelist":{let r=i.type;return new Qe(r.listSize,(t||[])[0])}case"map":{let r=i.type;return new ti((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var Dr=Lt,nS=Ni,sS=fe,Vt=class{constructor(t,e,r,n){this._version=e,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){let r=new Vt(0,$t.V4,e);return r._createHeader=oS(t,e),r}static decode(t){t=new sS(Y(t));let e=Rt.getRootAsMessage(t),r=e.bodyLength(),n=e.version(),o=e.headerType(),c=new Vt(r,n,o);return c._createHeader=aS(e,o),c}static encode(t){let e=new nS,r=-1;return t.isSchema()?r=at.encode(e,t.header()):t.isRecordBatch()?r=ie.encode(e,t.header()):t.isDictionaryBatch()&&(r=Ce.encode(e,t.header())),Rt.startMessage(e),Rt.addVersion(e,$t.V4),Rt.addHeader(e,r),Rt.addHeaderType(e,t.headerType),Rt.addBodyLength(e,new Dr(t.bodyLength,0)),Rt.finishMessageBuffer(e,Rt.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof at)return new Vt(0,$t.V4,dt.Schema,t);if(t instanceof ie)return new Vt(e,$t.V4,dt.RecordBatch,t);if(t instanceof Ce)return new Vt(e,$t.V4,dt.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${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===dt.Schema}isRecordBatch(){return this.headerType===dt.RecordBatch}isDictionaryBatch(){return this.headerType===dt.DictionaryBatch}},ie=class{constructor(t,e,r){this._nodes=e,this._buffers=r,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}},Ce=class{constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id=typeof e=="number"?e:e.low}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}},Fe=class{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}},si=class{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}};function oS(i,t){return()=>{switch(t){case dt.Schema:return at.fromJSON(i);case dt.RecordBatch:return ie.fromJSON(i);case dt.DictionaryBatch:return Ce.fromJSON(i)}throw new Error(`Unrecognized Message type: { name: ${dt[t]}, type: ${t} }`)}}function aS(i,t){return()=>{switch(t){case dt.Schema:return at.decode(i.header(new Dt));case dt.RecordBatch:return ie.decode(i.header(new oe),i.version());case dt.DictionaryBatch:return Ce.decode(i.header(new We),i.version())}throw new Error(`Unrecognized Message type: { name: ${dt[t]}, type: ${t} }`)}}tt.encode=bS;tt.decode=_S;tt.fromJSON=up;at.encode=mS;at.decode=lS;at.fromJSON=op;ie.encode=vS;ie.decode=cS;ie.fromJSON=tl;Ce.encode=gS;Ce.decode=uS;Ce.fromJSON=ap;si.encode=wS;si.decode=fS;Fe.encode=jS;Fe.decode=dS;function lS(i,t=new Map){let e=yS(i,t);return new at(e,Vo(i),t)}function cS(i,t=$t.V4){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new ie(i.length(),hS(i),pS(i,t))}function uS(i,t=$t.V4){return new Ce(ie.decode(i.data(),t),i.id(),i.isDelta())}function dS(i){return new Fe(i.offset(),i.length())}function fS(i){return new si(i.length(),i.nullCount())}function hS(i){let t=[];for(let e,r=-1,n=-1,o=i.nodesLength();++r<o;)(e=i.nodes(r))&&(t[++n]=si.decode(e));return t}function pS(i,t){let e=[];for(let r,n=-1,o=-1,c=i.buffersLength();++n<c;)(r=i.buffers(n))&&(t<$t.V4&&(r.bb_pos+=8*(n+1)),e[++o]=Fe.decode(r));return e}function yS(i,t){let e=[];for(let r,n=-1,o=-1,c=i.fieldsLength();++n<c;)(r=i.fields(n))&&(e[++o]=tt.decode(r,t));return e}function dp(i,t){let e=[];for(let r,n=-1,o=-1,c=i.childrenLength();++n<c;)(r=i.children(n))&&(e[++o]=tt.decode(r,t));return e}function _S(i,t){let e,r,n,o,c,h;return!t||!(h=i.dictionary())?(n=hp(i,dp(i,t)),r=new tt(i.name(),n,i.nullable(),Vo(i))):t.has(e=h.id().low)?(o=(o=h.indexType())?fp(o):new li,c=new Te(t.get(e),o,e,h.isOrdered()),r=new tt(i.name(),c,i.nullable(),Vo(i))):(o=(o=h.indexType())?fp(o):new li,t.set(e,n=hp(i,dp(i,t))),c=new Te(n,o,e,h.isOrdered()),r=new tt(i.name(),c,i.nullable(),Vo(i))),r||null}function Vo(i){let t=new Map;if(i)for(let e,r,n=-1,o=Math.trunc(i.customMetadataLength());++n<o;)(e=i.customMetadata(n))&&(r=e.key())!=null&&t.set(r,e.value());return t}function fp(i){return new Mt(i.isSigned(),i.bitWidth())}function hp(i,t){let e=i.typeType();switch(e){case Ft.NONE:return new de;case Ft.Null:return new de;case Ft.Binary:return new Ci;case Ft.Utf8:return new Bi;case Ft.Bool:return new Ti;case Ft.List:return new qe((t||[])[0]);case Ft.Struct_:return new wt(t||[])}switch(e){case Ft.Int:{let r=i.type(new Xt);return new Mt(r.isSigned(),r.bitWidth())}case Ft.FloatingPoint:{let r=i.type(new we);return new me(r.precision())}case Ft.Decimal:{let r=i.type(new Gt);return new Di(r.scale(),r.precision(),r.bitWidth())}case Ft.Date:{let r=i.type(new be);return new Ei(r.unit())}case Ft.Time:{let r=i.type(new re);return new Je(r.unit(),r.bitWidth())}case Ft.Timestamp:{let r=i.type(new ne);return new ki(r.unit(),r.timezone())}case Ft.Interval:{let r=i.type(new je);return new Oi(r.unit())}case Ft.Union:{let r=i.type(new Kt);return new Ze(r.mode(),r.typeIdsArray()||[],t||[])}case Ft.FixedSizeBinary:{let r=i.type(new ve);return new Mi(r.byteWidth())}case Ft.FixedSizeList:{let r=i.type(new ge);return new Qe(r.listSize(),(t||[])[0])}case Ft.Map:{let r=i.type(new Se);return new ti((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${Ft[e]}" (${e})`)}function mS(i,t){let e=t.fields.map(o=>tt.encode(i,o));Dt.startFieldsVector(i,e.length);let r=Dt.createFieldsVector(i,e),n=t.metadata&&t.metadata.size>0?Dt.createCustomMetadataVector(i,[...t.metadata].map(([o,c])=>{let h=i.createString(`${o}`),m=i.createString(`${c}`);return jt.startKeyValue(i),jt.addKey(i,h),jt.addValue(i,m),jt.endKeyValue(i)})):-1;return Dt.startSchema(i),Dt.addFields(i,r),Dt.addEndianness(i,SS?ir.Little:ir.Big),n!==-1&&Dt.addCustomMetadata(i,n),Dt.endSchema(i)}function bS(i,t){let e=-1,r=-1,n=-1,o=t.type,c=t.typeId;U.isDictionary(o)?(c=o.dictionary.typeId,n=Lo.visit(o,i),r=Lo.visit(o.dictionary,i)):r=Lo.visit(o,i);let h=(o.children||[]).map(x=>tt.encode(i,x)),m=Pt.createChildrenVector(i,h),g=t.metadata&&t.metadata.size>0?Pt.createCustomMetadataVector(i,[...t.metadata].map(([x,T])=>{let C=i.createString(`${x}`),k=i.createString(`${T}`);return jt.startKeyValue(i),jt.addKey(i,C),jt.addValue(i,k),jt.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),Pt.startField(i),Pt.addType(i,r),Pt.addTypeType(i,c),Pt.addChildren(i,m),Pt.addNullable(i,!!t.nullable),e!==-1&&Pt.addName(i,e),n!==-1&&Pt.addDictionary(i,n),g!==-1&&Pt.addCustomMetadata(i,g),Pt.endField(i)}function vS(i,t){let e=t.nodes||[],r=t.buffers||[];oe.startNodesVector(i,e.length);for(let c of e.slice().reverse())si.encode(i,c);let n=i.endVector();oe.startBuffersVector(i,r.length);for(let c of r.slice().reverse())Fe.encode(i,c);let o=i.endVector();return oe.startRecordBatch(i),oe.addLength(i,new Dr(t.length,0)),oe.addNodes(i,n),oe.addBuffers(i,o),oe.endRecordBatch(i)}function gS(i,t){let e=ie.encode(i,t.data);return We.startDictionaryBatch(i),We.addId(i,new Dr(t.id,0)),We.addIsDelta(i,t.isDelta),We.addData(i,e),We.endDictionaryBatch(i)}function wS(i,t){return en.createFieldNode(i,new Dr(t.length,0),new Dr(t.nullCount,0))}function jS(i,t){return tn.createBuffer(i,new Dr(t.offset,0),new Dr(t.length,0))}var SS=(()=>{let i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})();var il=i=>`Expected ${dt[i]} Message in stream, but was null or length 0.`,rl=i=>`Header pointer of flatbuffer-encoded ${dt[i]} Message is null or length 0.`,pp=(i,t)=>`Expected to read ${i} metadata bytes, but only read ${t}.`,yp=(i,t)=>`Expected to read ${i} bytes for message body, but only read ${t}.`,nn=class{constructor(t){this.source=t instanceof gi?t:new gi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?St:t.value===-1&&(t=this.readMetadataLength()).done?St:(t=this.readMetadata(t.value)).done?St: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(il(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=Y(this.source.read(t));if(e.byteLength<t)throw new Error(yp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=dt.Schema,r=this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(rl(e));return n}readMetadataLength(){let t=this.source.read(Ho),e=t&&new fe(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 St;if(e.byteLength<t)throw new Error(pp(t,e.byteLength));return{done:!1,value:Vt.decode(e)}}},ns=class{constructor(t,e){this.source=t instanceof Ie?t:Fs(t)?new nr(t,e):new Ie(t)}[Symbol.asyncIterator](){return this}next(){return O(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?St:t.value===-1&&(t=yield this.readMetadataLength()).done?St:(t=yield this.readMetadata(t.value)).done?St:t})}throw(t){return O(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return O(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return O(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(il(t));return e.value})}readMessageBody(t){return O(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=Y(yield this.source.read(t));if(e.byteLength<t)throw new Error(yp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return O(this,void 0,void 0,function*(){let e=dt.Schema,r=yield this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(rl(e));return n})}readMetadataLength(){return O(this,void 0,void 0,function*(){let t=yield this.source.read(Ho),e=t&&new fe(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return O(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return St;if(e.byteLength<t)throw new Error(pp(t,e.byteLength));return{done:!1,value:Vt.decode(e)}})}},ss=class extends nn{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof On?t:new On(t)}next(){let{_json:t}=this;if(!this._schema){this._schema=!0;let e=Vt.fromJSON(t.schema,dt.Schema);return{done:!1,value:e}}if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];this._body=e.data.columns;let r=Vt.fromJSON(e,dt.DictionaryBatch);return{done:!1,value:r}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];this._body=e.columns;let r=Vt.fromJSON(e,dt.RecordBatch);return{done:!1,value:r}}return this._body=[],St}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...e(o.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(il(t));return e.value}readSchema(){let t=dt.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(rl(t));return r}},Ho=4,el="ARROW1",sn=new Uint8Array(el.length);for(let i=0;i<el.length;i+=1)sn[i]=el.codePointAt(i);function zo(i,t=0){for(let e=-1,r=sn.length;++e<r;)if(sn[e]!==i[t+e])return!1;return!0}var on=sn.length,nl=on+Ho,_p=on*2+Ho;var Ut=class extends Ir{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 $e(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 Qt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Qt.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 Ut?t:As(t)?AS(t):Fs(t)?CS(t):$e(t)?(()=>O(this,void 0,void 0,function*(){return yield Ut.from(yield t)}))():Cs(t)||gn(t)||Ts(t)||Le(t)?FS(new Ie(t)):xS(new gi(t))}static readAll(t){return t instanceof Ut?t.isSync()?mp(t):bp(t):As(t)||ArrayBuffer.isView(t)||Ye(t)||xs(t)?mp(t):bp(t)}},ji=class extends Ut{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return _e(this,arguments,function*(){yield rt(yield*Mr(Ne(this[Symbol.iterator]())))})}},sr=class extends Ut{constructor(t){super(t),this._impl=t}readAll(){var t,e;return O(this,void 0,void 0,function*(){let r=new Array;try{for(var n=Ne(this),o;o=yield n.next(),!o.done;){let c=o.value;r.push(c)}}catch(c){t={error:c}}finally{try{o&&!o.done&&(e=n.return)&&(yield e.call(n))}finally{if(t)throw t.error}}return r})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},or=class extends ji{constructor(t){super(t),this._impl=t}},os=class extends sr{constructor(t){super(t),this._impl=t}},Wo=class{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}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),n=J({type:new wt(this.schema.fields),length:t.length,children:r});return new vt(this.schema,n)}_loadDictionaryBatch(t,e){let{id:r,isDelta:n}=t,{dictionaries:o,schema:c}=this,h=o.get(r);if(n||!h){let m=c.dictionaries.get(r),g=this._loadVectors(t.data,e,[m]);return(h&&n?h.concat(new G(g)):new G(g)).memoize()}return h.memoize()}_loadVectors(t,e,r){return new Un(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}},an=class extends Wo{constructor(t,e){super(e),this._reader=As(t)?new ss(this._handle=t):new nn(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=vp(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):St}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):St}next(){if(this.closed)return St;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(),n=e.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,n);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Tr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},ln=class extends Wo{constructor(t,e){super(e),this._reader=new ns(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return O(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 O(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=vp(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):St})}return(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):St})}next(){return O(this,void 0,void 0,function*(){if(this.closed)return St;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(),n=yield e.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,n);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=yield e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Tr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return O(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},$o=class extends an{constructor(t,e){super(t instanceof Mn?t:new Mn(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}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 n=this._reader.readMessage(dt.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),c=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,c)}}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 n=this._reader.readMessage(dt.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),c=this._reader.readMessageBody(n.bodyLength),h=this._loadDictionaryBatch(o,c);this.dictionaries.set(o.id,h)}}}_readFooter(){let{_handle:t}=this,e=t.size-nl,r=t.readInt32(e),n=t.readAt(e-r,r);return Li.decode(n)}_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}},sl=class extends ln{constructor(t,...e){let r=typeof e[0]!="number"?e.shift():void 0,n=e[0]instanceof Map?e.shift():void 0;super(t instanceof nr?t:new nr(t,r),n)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return O(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){var e;return O(this,void 0,void 0,function*(){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 n=yield this._reader.readMessage(dt.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),c=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,c)}}return null})}_readDictionaryBatch(t){var e;return O(this,void 0,void 0,function*(){let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(dt.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),c=yield this._reader.readMessageBody(n.bodyLength),h=this._loadDictionaryBatch(o,c);this.dictionaries.set(o.id,h)}}})}_readFooter(){return O(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-nl,r=yield t.readInt32(e),n=yield t.readAt(e-r,r);return Li.decode(n)})}_readNextMessageAndValidate(t){return O(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})}},ol=class extends an{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new _o(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}};function vp(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*mp(i){let t=Ut.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function bp(i){return _e(this,arguments,function*(){let e=yield rt(Ut.from(i));try{if(!(yield rt(e.open({autoDestroy:!1}))).closed)do yield yield rt(e);while(!(yield rt(e.reset().open())).closed)}finally{yield rt(e.cancel())}})}function AS(i){return new ji(new ol(i))}function xS(i){let t=i.peek(on+7&-8);return t&&t.byteLength>=4?zo(t)?new or(new $o(i.read())):new ji(new an(i)):new ji(new an(function*(){}()))}function FS(i){return O(this,void 0,void 0,function*(){let t=yield i.peek(on+7&-8);return t&&t.byteLength>=4?zo(t)?new or(new $o(yield i.read())):new sr(new ln(i)):new sr(new ln(function(){return _e(this,arguments,function*(){})}()))})}function CS(i){return O(this,void 0,void 0,function*(){let{size:t}=yield i.stat(),e=new nr(i,t);return t>=_p&&zo(yield e.readAt(0,on+7&-8))?new os(new sl(e)):new sr(new ln(e))})}var Et=class extends V{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){let e=n=>n.flatMap(o=>Array.isArray(o)?e(o):o instanceof vt?o.data.children:o.data),r=new Et;return r.visitMany(e(t)),r}visit(t){if(t instanceof G)return this.visitMany(t.data),this;let{type:e}=t;if(!U.isDictionary(e)){let{length:r,nullCount:n}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");U.isNull(e)||oi.call(this,n<=0?new Uint8Array(0):Wr(t.offset,r,t.nullBitmap)),this.nodes.push(new si(r,n))}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 oi(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 BS(i){let{type:t,length:e,typeIds:r,valueOffsets:n}=i;if(oi.call(this,r),t.mode===Tt.Sparse)return al.call(this,i);if(t.mode===Tt.Dense){if(i.offset<=0)return oi.call(this,n),al.call(this,i);{let o=r.reduce((x,T)=>Math.max(x,T),r[0]),c=new Int32Array(o+1),h=new Int32Array(o+1).fill(-1),m=new Int32Array(e),g=wn(-n[0],e,n);for(let x,T,C=-1;++C<e;)(T=h[x=r[C]])===-1&&(T=h[x]=g[x]),m[C]=g[C]-T,++c[x];oi.call(this,m);for(let x,T=-1,C=t.children.length;++T<C;)if(x=i.children[T]){let k=t.typeIds[T],lt=Math.min(e,c[k]);this.visit(x.slice(h[k],lt))}}}return this}function TS(i){let t;return i.nullCount>=i.length?oi.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?oi.call(this,Wr(i.offset,i.length,t)):oi.call(this,gr(i.values))}function ar(i){return oi.call(this,i.values.subarray(0,i.length*i.stride))}function gp(i){let{length:t,values:e,valueOffsets:r}=i,n=r[0],o=r[t],c=Math.min(o-n,e.byteLength-n);return oi.call(this,wn(-r[0],t,r)),oi.call(this,e.subarray(n,n+c)),this}function ll(i){let{length:t,valueOffsets:e}=i;return e&&oi.call(this,wn(e[0],t,e)),this.visit(i.children[0])}function al(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}Et.prototype.visitBool=TS;Et.prototype.visitInt=ar;Et.prototype.visitFloat=ar;Et.prototype.visitUtf8=gp;Et.prototype.visitBinary=gp;Et.prototype.visitFixedSizeBinary=ar;Et.prototype.visitDate=ar;Et.prototype.visitTimestamp=ar;Et.prototype.visitTime=ar;Et.prototype.visitDecimal=ar;Et.prototype.visitList=ll;Et.prototype.visitStruct=al;Et.prototype.visitUnion=BS;Et.prototype.visitInterval=ar;Et.prototype.visitFixedSizeList=ll;Et.prototype.visitMap=ll;var lr=class extends Ir{constructor(t){super(),this._position=0,this._started=!1,this._sink=new vi,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,ce(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}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')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return $e(t)?t.then(e=>this.writeAll(e)):Le(t)?ul(this,t):cl(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 vi?this._sink=t:(this._sink=new vi,t&&Wf(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&$f(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!Br(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 Ot&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof vt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Br(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof vt?t instanceof Tr||this._writeRecordBatch(t):t instanceof Ot?this.writeAll(t.batches):Ye(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,n=Vt.encode(t),o=n.byteLength,c=this._writeLegacyIpcFormat?4:8,h=o+c+r&~r,m=h-o-c;return t.headerType===dt.RecordBatch?this._recordBatchBlocks.push(new ri(h,t.bodyLength,this._position)):t.headerType===dt.DictionaryBatch&&this._dictionaryBlocks.push(new ri(h,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(h-c)),o>0&&this._write(n),this._writePadding(m)}_write(t){if(this._started){let e=Y(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Vt.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(sn)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:n,buffers:o}=Et.assemble(t),c=new ie(t.numRows,r,n),h=Vt.from(c,e);return this._writeDictionaries(t)._writeMessage(h)._writeBodyBuffers(o)}_writeDictionaryBatch(t,e,r=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));let{byteLength:n,nodes:o,bufferRegions:c,buffers:h}=Et.assemble(new G([t])),m=new ie(t.length,o,c),g=new Ce(m,e,r),x=Vt.from(g,n);return this._writeMessage(x)._writeBodyBuffers(h)}_writeBodyBuffers(t){let e,r,n;for(let o=-1,c=t.length;++o<c;)(e=t[o])&&(r=e.byteLength)>0&&(this._write(e),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(t){for(let[e,r]of t.dictionaries){let n=this._dictionaryDeltaOffsets.get(e)||0;if(n===0||(r=r==null?void 0:r.slice(n)).length>0)for(let o of r.data)this._writeDictionaryBatch(o,e,n>0),n+=o.length}return this}},Si=class extends lr{static writeAll(t,e){let r=new Si(e);return $e(t)?t.then(n=>r.writeAll(n)):Le(t)?ul(r,t):cl(r,t)}},cr=class extends lr{static writeAll(t){let e=new cr;return $e(t)?t.then(r=>e.writeAll(r)):Le(t)?ul(e,t):cl(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let e=Li.encode(new Li(t,$t.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function cl(i,t){let e=t;t instanceof Ot&&(e=t.batches,i.reset(void 0,t.schema));for(let r of e)i.write(r);return i.finish()}function ul(i,t){var e,r,n,o;return O(this,void 0,void 0,function*(){try{for(e=Ne(t);r=yield e.next(),!r.done;){let c=r.value;i.write(c)}}catch(c){n={error:c}}finally{try{r&&!r.done&&(o=e.return)&&(yield o.call(e))}finally{if(n)throw n.error}}return i.finish()})}function wp(i,t){if(Le(i))return ES(i,t);if(Ye(i))return DS(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function DS(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(c){o(c,e||(e=i[Symbol.iterator]()))},pull(c){e?o(c,e):c.close()},cancel(){((e==null?void 0:e.return)&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:r?n:void 0},t));function o(c,h){let m,g=null,x=c.desiredSize||null;for(;!(g=h.next(r?x:null)).done;)if(ArrayBuffer.isView(g.value)&&(m=Y(g.value))&&(x!=null&&r&&(x=x-m.byteLength+1),g.value=m),c.enqueue(g.value),x!=null&&--x<=0)return;c.close()}}function ES(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(c){return O(this,void 0,void 0,function*(){yield o(c,e||(e=i[Symbol.asyncIterator]()))})},pull(c){return O(this,void 0,void 0,function*(){e?yield o(c,e):c.close()})},cancel(){return O(this,void 0,void 0,function*(){((e==null?void 0:e.return)&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:r?n:void 0},t));function o(c,h){return O(this,void 0,void 0,function*(){let m,g=null,x=c.desiredSize||null;for(;!(g=yield h.next(r?x:null)).done;)if(ArrayBuffer.isView(g.value)&&(m=Y(g.value))&&(x!=null&&r&&(x=x-m.byteLength+1),g.value=m),c.enqueue(g.value),x!=null&&--x<=0)return;c.close()})}}function Ip(i){return new dl(i)}var dl=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=t,o=Hf(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=xr(o),this._getSize=n!=="bytes"?jp:Sp;let{["highWaterMark"]:c=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:h=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:m=>{this._maybeFlush(this._builder,this._controller=m)},start:m=>{this._maybeFlush(this._builder,this._controller=m)}},{highWaterMark:c,size:n!=="bytes"?jp:Sp}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:h,size:m=>this._writeValueAndReturnChunkSize(m)})}_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)}},jp=i=>{var t;return(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0},Sp=i=>{var t;return(t=i==null?void 0:i.byteLength)!==null&&t!==void 0?t:0};function Yo(i,t){let e=new vi,r=null,n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield e.close()})},start(h){return O(this,void 0,void 0,function*(){yield c(h,r||(r=yield o()))})},pull(h){return O(this,void 0,void 0,function*(){r?yield c(h,r):h.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},i)),readable:n};function o(){return O(this,void 0,void 0,function*(){return yield(yield Ut.from(e)).open(t)})}function c(h,m){return O(this,void 0,void 0,function*(){let g=h.desiredSize,x=null;for(;!(x=yield m.next()).done;)if(h.enqueue(x.value),g!=null&&--g<=0)return;h.close()})}}function Xo(i,t){let e=new this(i),r=new Ie(e),n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield r.cancel()})},pull(c){return O(this,void 0,void 0,function*(){yield o(c)})},start(c){return O(this,void 0,void 0,function*(){yield o(c)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:n};function o(c){return O(this,void 0,void 0,function*(){let h=null,m=c.desiredSize;for(;h=yield r.read(m||null);)if(c.enqueue(h),m!=null&&(m-=h.byteLength)<=0)return;c.close()})}}var RS=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ia),Ga),Pa),Aa),ga),La),{compareSchemas:Br,compareFields:qh,compareTypes:Zh});Qt.toDOMStream=wp;xt.throughDOM=Ip;Ut.throughDOM=Yo;or.throughDOM=Yo;ji.throughDOM=Yo;lr.throughDOM=Xo;cr.throughDOM=Xo;Si.throughDOM=Xo;function cn(i){switch(i.typeId){case A.Binary:return{sqlType:"binary"};case A.Bool:return{sqlType:"bool"};case A.Date:return{sqlType:"date"};case A.DateDay:return{sqlType:"date32[d]"};case A.DateMillisecond:return{sqlType:"date64[ms]"};case A.Decimal:{let t=i;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case A.Float:return{sqlType:"float"};case A.Float16:return{sqlType:"float16"};case A.Float32:return{sqlType:"float32"};case A.Float64:return{sqlType:"float64"};case A.Int:return{sqlType:"int32"};case A.Int16:return{sqlType:"int16"};case A.Int32:return{sqlType:"int32"};case A.Int64:return{sqlType:"int64"};case A.Uint16:return{sqlType:"uint16"};case A.Uint32:return{sqlType:"uint32"};case A.Uint64:return{sqlType:"uint64"};case A.Uint8:return{sqlType:"uint8"};case A.IntervalDayTime:return{sqlType:"interval[dt]"};case A.IntervalYearMonth:return{sqlType:"interval[m]"};case A.List:return{sqlType:"list",valueType:cn(i.valueType)};case A.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:i.byteWidth};case A.Null:return{sqlType:"null"};case A.Utf8:return{sqlType:"utf8"};case A.Struct:return{sqlType:"struct",fields:i.children.map(e=>Go(e.name,e.type))};case A.Map:{let t=i;return{sqlType:"map",keyType:cn(t.keyType),valueType:cn(t.valueType)}}case A.Time:return{sqlType:"time[s]"};case A.TimeMicrosecond:return{sqlType:"time[us]"};case A.TimeMillisecond:return{sqlType:"time[ms]"};case A.TimeNanosecond:return{sqlType:"time[ns]"};case A.TimeSecond:return{sqlType:"time[s]"};case A.Timestamp:return{sqlType:"timestamp",timezone:i.timezone||void 0};case A.TimestampSecond:return{sqlType:"timestamp[s]",timezone:i.timezone||void 0};case A.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:i.timezone||void 0};case A.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:i.timezone||void 0};case A.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:i.timezone||void 0}}throw new Error(`unsupported arrow type: ${i.toString()}`)}function Go(i,t){let e=cn(t);return e.name=i,e}var Ko=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){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":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(),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,n)=>n)},[]);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_START",data:e},[e.buffer]);break}case"SEND_QUERY":{let e=this._bindings.sendQuery(t.data[0],t.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_START",data:e},[e.buffer]);break}case"FETCH_QUERY_RESULTS":{let e=this._bindings.fetchQueryResults(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_CHUNK",data:e},[e.buffer]);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]),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":this._bindings.registerFileHandle(t.data[0],t.data[1]),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"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 this.failWith(t,e)}}};var Fp={},US=(()=>{var i=Fp.url;return function(t){t=t||{};var e=typeof t<"u"?t:{},r,n;e.ready=new Promise(function(s,a){r=s,n=a});var o=Object.assign({},e),c=[],h="./this.program",m=(s,a)=>{throw a},g=typeof window=="object",x=typeof importScripts=="function",T=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",C="";function k(s){return e.locateFile?e.locateFile(s,C):C+s}var lt,ct,mt,kt;function ae(s){if(s instanceof vs)return;Oe("exiting due to exception: "+s)}var he,Wi,hr;T?(x?C=fl().dirname(C)+"/":C=__dirname+"/",hr=()=>{Wi||(he=xp(),Wi=fl())},lt=function(a,l){return hr(),a=Wi.normalize(a),he.readFileSync(a,l?void 0:"utf8")},mt=s=>{var a=lt(s,!0);return a.buffer||(a=new Uint8Array(a)),a},ct=(s,a,l)=>{hr(),s=Wi.normalize(s),he.readFile(s,function(u,d){u?l(u):a(d.buffer)})},process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),c=process.argv.slice(2),process.on("uncaughtException",function(s){if(!(s instanceof vs))throw s}),process.on("unhandledRejection",function(s){throw s}),m=(s,a)=>{if(Bl())throw process.exitCode=s,a;ae(a),process.exit(s)},e.inspect=function(){return"[Emscripten Module object]"}):(g||x)&&(x?C=self.location.href:typeof document<"u"&&document.currentScript&&(C=document.currentScript.src),i&&(C=i),C.indexOf("blob:")!==0?C=C.substr(0,C.replace(/[?#].*/,"").lastIndexOf("/")+1):C="",lt=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.send(null),a.responseText},x&&(mt=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.responseType="arraybuffer",a.send(null),new Uint8Array(a.response)}),ct=(s,a,l)=>{var u=new XMLHttpRequest;u.open("GET",s,!0),u.responseType="arraybuffer",u.onload=()=>{if(u.status==200||u.status==0&&u.response){a(u.response);return}l()},u.onerror=l,u.send(null)},kt=s=>document.title=s);var ra=e.print||console.log.bind(console),Oe=e.printErr||console.warn.bind(console);Object.assign(e,o),o=null,e.arguments&&(c=e.arguments),e.thisProgram&&(h=e.thisProgram),e.quit&&(m=e.quit);var Er=0,P=s=>{Er=s},le=()=>Er,qt;e.wasmBinary&&(qt=e.wasmBinary);var pe=e.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var Ht,zt=!1,pt;function ye(s,a){s||Me(a)}function kr(s){var a=e["_"+s];return a}function Up(s,a,l,u,d){var f={string:function(E){var q=0;if(E!=null&&E!==0){var ut=(E.length<<2)+1;q=fa(ut),na(E,q,ut)}return q},array:function(E){var q=fa(E.length);return wl(E,q),q}};function p(E){return a==="string"?Ai(E):a==="boolean"?Boolean(E):E}var y=kr(s),_=[],b=0;if(u)for(var v=0;v<u.length;v++){var I=f[l[v]];I?(b===0&&(b=j()),_[v]=I(u[v])):_[v]=u[v]}var F=y.apply(null,_);function D(E){return b!==0&&S(b),p(E)}return F=D(F),F}var bl=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function vl(s,a,l){for(var u=a+l,d=a;s[d]&&!(d>=u);)++d;if(d-a>16&&s.buffer&&bl)return bl.decode(s.subarray(a,d));for(var f="";a<d;){var p=s[a++];if(!(p&128)){f+=String.fromCharCode(p);continue}var y=s[a++]&63;if((p&224)==192){f+=String.fromCharCode((p&31)<<6|y);continue}var _=s[a++]&63;if((p&240)==224?p=(p&15)<<12|y<<6|_:p=(p&7)<<18|y<<12|_<<6|s[a++]&63,p<65536)f+=String.fromCharCode(p);else{var b=p-65536;f+=String.fromCharCode(55296|b>>10,56320|b&1023)}}return f}function Ai(s,a){return s?vl($i,s,a):""}function gl(s,a,l,u){if(!(u>0))return 0;for(var d=l,f=l+u-1,p=0;p<s.length;++p){var y=s.charCodeAt(p);if(y>=55296&&y<=57343){var _=s.charCodeAt(++p);y=65536+((y&1023)<<10)|_&1023}if(y<=127){if(l>=f)break;a[l++]=y}else if(y<=2047){if(l+1>=f)break;a[l++]=192|y>>6,a[l++]=128|y&63}else if(y<=65535){if(l+2>=f)break;a[l++]=224|y>>12,a[l++]=128|y>>6&63,a[l++]=128|y&63}else{if(l+3>=f)break;a[l++]=240|y>>18,a[l++]=128|y>>12&63,a[l++]=128|y>>6&63,a[l++]=128|y&63}}return a[l]=0,l-d}function na(s,a,l){return gl(s,$i,a,l)}function Np(s){for(var a=0,l=0;l<s.length;++l){var u=s.charCodeAt(l);u>=55296&&u<=57343&&(u=65536+((u&1023)<<10)|s.charCodeAt(++l)&1023),u<=127?++a:u<=2047?a+=2:u<=65535?a+=3:a+=4}return a}function wl(s,a){xi.set(s,a)}function Lp(s,a,l){for(var u=0;u<s.length;++u)xi[a++>>0]=s.charCodeAt(u);l||(xi[a>>0]=0)}var jl,xi,$i,dn,Sl,M,Pp,Vp,Hp;function Il(s){jl=s,e.HEAP8=xi=new Int8Array(s),e.HEAP16=dn=new Int16Array(s),e.HEAP32=M=new Int32Array(s),e.HEAPU8=$i=new Uint8Array(s),e.HEAPU16=Sl=new Uint16Array(s),e.HEAPU32=Pp=new Uint32Array(s),e.HEAPF32=Vp=new Float32Array(s),e.HEAPF64=Hp=new Float64Array(s)}var XS=e.INITIAL_MEMORY||16777216,Al,xl=[],Fl=[],zp=[],Cl=[],Wp=!1;function Bl(){return pe}function $p(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)Kp(e.preRun.shift());as(xl)}function Yp(){Wp=!0,as(Fl)}function Xp(){as(zp)}function Gp(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)qp(e.postRun.shift());as(Cl)}function Kp(s){xl.unshift(s)}function Jp(s){Fl.unshift(s)}function qp(s){Cl.unshift(s)}var pr=0,sa=null,fn=null;function Zp(s){pr++,e.monitorRunDependencies&&e.monitorRunDependencies(pr)}function Qp(s){if(pr--,e.monitorRunDependencies&&e.monitorRunDependencies(pr),pr==0&&(sa!==null&&(clearInterval(sa),sa=null),fn)){var a=fn;fn=null,a()}}function Me(s){e.onAbort&&e.onAbort(s),s="Aborted("+s+")",Oe(s),zt=!0,pt=1,s+=". Build with -sASSERTIONS for more info.";var a=new WebAssembly.RuntimeError(s);throw n(a),a}var ty="data:application/octet-stream;base64,";function Tl(s){return s.startsWith(ty)}var Re;e.locateFile?(Re="./duckdb-mvp.wasm",Tl(Re)||(Re=k(Re))):Re=new URL("./duckdb-mvp.wasm",Fp.url).toString();function Dl(s){try{if(s==Re&&qt)return new Uint8Array(qt);if(mt)return mt(s);throw"both async and sync fetching of the wasm failed"}catch(a){Me(a)}}function ey(){return!qt&&(g||x)&&typeof fetch=="function"?fetch(Re,{credentials:"same-origin"}).then(function(s){if(!s.ok)throw"failed to load wasm binary file at '"+Re+"'";return s.arrayBuffer()}).catch(function(){return Dl(Re)}):Promise.resolve().then(function(){return Dl(Re)})}function iy(){var s={a:k_};function a(p,y){var _=p.exports;e.asm=_,Ht=e.asm.Te,Il(Ht.buffer),Al=e.asm.Rf,Jp(e.asm.Ue),Qp("wasm-instantiate")}Zp("wasm-instantiate");function l(p){a(p.instance)}function u(p){return ey().then(function(y){return WebAssembly.instantiate(y,s)}).then(function(y){return y}).then(p,function(y){Oe("failed to asynchronously prepare wasm: "+y),Me(y)})}function d(){return!qt&&typeof WebAssembly.instantiateStreaming=="function"&&!Tl(Re)&&typeof fetch=="function"?fetch(Re,{credentials:"same-origin"}).then(function(p){var y=WebAssembly.instantiateStreaming(p,s);return y.then(l,function(_){return Oe("wasm streaming compile failed: "+_),Oe("falling back to ArrayBuffer instantiation"),u(l)})}):u(l)}if(e.instantiateWasm)try{var f=e.instantiateWasm(s,a);return f}catch(p){return Oe("Module.instantiateWasm callback failed with error: "+p),!1}return d().catch(n),{}}function as(s){for(;s.length>0;){var a=s.shift();if(typeof a=="function"){a(e);continue}var l=a.func;typeof l=="number"?a.arg===void 0?R(l)():R(l)(a.arg):l(a.arg===void 0?null:a.arg)}}var ls=[];function R(s){var a=ls[s];return a||(s>=ls.length&&(ls.length=s+1),ls[s]=a=Al.get(s)),a}function ry(s){if(s instanceof vs||s=="unwind")return pt;m(1,s)}function ny(s,a,l,u){Me("Assertion failed: "+Ai(s)+", at: "+[a?Ai(a):"unknown filename",l,u?Ai(u):"unknown function"])}function sy(s){return ms(s+24)+24}var cs=[];function oy(s){s.add_ref()}var us=0;function ay(s){var a=new yr(s);return a.get_caught()||(a.set_caught(!0),us--),a.set_rethrown(!1),cs.push(a),oy(a),a.get_exception_ptr()}var Fi=0;function yr(s){this.excPtr=s,this.ptr=s-24,this.set_type=function(a){M[this.ptr+4>>2]=a},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(a){M[this.ptr+8>>2]=a},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_refcount=function(a){M[this.ptr>>2]=a},this.set_caught=function(a){a=a?1:0,xi[this.ptr+12>>0]=a},this.get_caught=function(){return xi[this.ptr+12>>0]!=0},this.set_rethrown=function(a){a=a?1:0,xi[this.ptr+13>>0]=a},this.get_rethrown=function(){return xi[this.ptr+13>>0]!=0},this.init=function(a,l){this.set_adjusted_ptr(0),this.set_type(a),this.set_destructor(l),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var a=M[this.ptr>>2];M[this.ptr>>2]=a+1},this.release_ref=function(){var a=M[this.ptr>>2];return M[this.ptr>>2]=a-1,a===1},this.set_adjusted_ptr=function(a){M[this.ptr+16>>2]=a},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){var a=zl(this.get_type());if(a)return M[this.excPtr>>2];var l=this.get_adjusted_ptr();return l!==0?l:this.excPtr}}function El(s){return Hl(new yr(s).ptr)}function ly(s){if(s.release_ref()&&!s.get_rethrown()){var a=s.get_destructor();a&&R(a)(s.excPtr),El(s.excPtr)}}function cy(){w(0);var s=cs.pop();ly(s),Fi=0}function uy(s){throw Fi||(Fi=s),s}function dy(){var s=Fi;if(!s)return P(0),0;var a=new yr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return P(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(yn(f,l,p))return P(f),s|0}return P(l),s|0}function fy(){var s=Fi;if(!s)return P(0),0;var a=new yr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return P(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(yn(f,l,p))return P(f),s|0}return P(l),s|0}function hy(){var s=Fi;if(!s)return P(0),0;var a=new yr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return P(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(yn(f,l,p))return P(f),s|0}return P(l),s|0}function py(){var s=Fi;if(!s)return P(0),0;var a=new yr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return P(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(yn(f,l,p))return P(f),s|0}return P(l),s|0}function yy(){var s=cs.pop();s||Me("no exception to throw");var a=s.excPtr;throw s.get_rethrown()||(cs.push(s),s.set_rethrown(!0),s.set_caught(!1),us++),Fi=a,a}function _y(s,a,l){var u=new yr(s);throw u.init(a,l),Fi=s,us++,s}function my(){return us}var Zt={buffers:[null,[],[]],printChar:function(s,a){var l=Zt.buffers[s];a===0||a===10?((s===1?ra:Oe)(vl(l,0)),l.length=0):l.push(a)},varargs:void 0,get:function(){Zt.varargs+=4;var s=M[Zt.varargs-4>>2];return s},getStr:function(s){var a=Ai(s);return a}};function by(s,a,l,u,d){}function vy(){Oe("missing function: $SOCKFS"),Me(-1)}function kl(){Oe("missing function: $FS"),Me(-1)}function hn(s){var a=vy.getSocket(s);if(!a)throw new kl.ErrnoError(8);return a}function oa(s){return(s&255)+"."+(s>>8&255)+"."+(s>>16&255)+"."+(s>>24&255)}function Ol(s){var a="",l=0,u=0,d=0,f=0,p=0,y=0,_=[s[0]&65535,s[0]>>16,s[1]&65535,s[1]>>16,s[2]&65535,s[2]>>16,s[3]&65535,s[3]>>16],b=!0,v="";for(y=0;y<5;y++)if(_[y]!==0){b=!1;break}if(b){if(v=oa(_[6]|_[7]<<16),_[5]===-1)return a="::ffff:",a+=v,a;if(_[5]===0)return a="::",v==="0.0.0.0"&&(v=""),v==="0.0.0.1"&&(v="1"),a+=v,a}for(l=0;l<8;l++)_[l]===0&&(l-d>1&&(p=0),d=l,p++),p>u&&(u=p,f=l-u+1);for(l=0;l<8;l++){if(u>1&&_[l]===0&&l>=f&&l<f+u){l===f&&(a+=":",f===0&&(a+=":"));continue}a+=Number(da(_[l]&65535)).toString(16),a+=l<7?":":""}return a}function Ml(s,a){var l=dn[s>>1],u=da(Sl[s+2>>1]),d;switch(l){case 2:if(a!==16)return{errno:28};d=M[s+4>>2],d=oa(d);break;case 10:if(a!==28)return{errno:28};d=[M[s+8>>2],M[s+12>>2],M[s+16>>2],M[s+20>>2]],d=Ol(d);break;default:return{errno:5}}return{family:l,addr:d,port:u}}function ds(s){for(var a=s.split("."),l=0;l<4;l++){var u=Number(a[l]);if(isNaN(u))return null;a[l]=u}return(a[0]|a[1]<<8|a[2]<<16|a[3]<<24)>>>0}function fs(s){return parseInt(s)}function aa(s){var a,l,u,d,f=/^((?=.*::)(?!.*::.+::)(::)?([\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,p=[];if(!f.test(s))return null;if(s==="::")return[0,0,0,0,0,0,0,0];for(s.startsWith("::")?s=s.replace("::","Z:"):s=s.replace("::",":Z:"),s.indexOf(".")>0?(s=s.replace(new RegExp("[.]","g"),":"),a=s.split(":"),a[a.length-4]=fs(a[a.length-4])+fs(a[a.length-3])*256,a[a.length-3]=fs(a[a.length-2])+fs(a[a.length-1])*256,a=a.slice(0,a.length-2)):a=s.split(":"),u=0,d=0,l=0;l<a.length;l++)if(typeof a[l]=="string")if(a[l]==="Z"){for(d=0;d<8-a.length+1;d++)p[l+d]=0;u=d-1}else p[l+u]=_s(parseInt(a[l],16));else p[l+u]=a[l];return[p[1]<<16|p[0],p[3]<<16|p[2],p[5]<<16|p[4],p[7]<<16|p[6]]}var Ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(s){var a=ds(s);if(a!==null||(a=aa(s),a!==null))return s;var l;if(Ue.address_map.addrs[s])l=Ue.address_map.addrs[s];else{var u=Ue.address_map.id++;ye(u<65535,"exceeded max address mappings of 65535"),l="172.29."+(u&255)+"."+(u&65280),Ue.address_map.names[l]=s,Ue.address_map.addrs[s]=l}return l},lookup_addr:function(s){return Ue.address_map.names[s]?Ue.address_map.names[s]:null}};function Rl(s,a,l){if(l&&s===0)return null;var u=Ml(s,a);if(u.errno)throw new kl.ErrnoError(u.errno);return u.addr=Ue.lookup_addr(u.addr)||u.addr,u}function gy(s,a,l){var u=hn(s),d=Rl(a,l);return u.sock_ops.bind(u,d.addr,d.port),0}function wy(s,a,l){var u=hn(s),d=Rl(a,l);return u.sock_ops.connect(u,d.addr,d.port),0}function jy(s,a,l,u){return a=Zt.getStr(a),a=Zt.calculateAt(s,a),Zt.doAccess(a,l)}function Sy(s,a,l){return Zt.varargs=l,0}function Iy(s,a){}function Ay(s,a,l){}function xy(s,a,l){}function Ul(s,a){$i.fill(0,s,s+a)}function la(s,a,l,u,d){switch(a){case 2:l=ds(l),Ul(s,16),d&&(M[d>>2]=16),dn[s>>1]=a,M[s+4>>2]=l,dn[s+2>>1]=_s(u);break;case 10:l=aa(l),Ul(s,28),d&&(M[d>>2]=28),M[s>>2]=a,M[s+8>>2]=l[0],M[s+12>>2]=l[1],M[s+16>>2]=l[2],M[s+20>>2]=l[3],dn[s+2>>1]=_s(u);break;default:return 5}return 0}function Fy(s,a,l){var u=hn(s);if(!u.daddr)return-53;var d=la(a,u.family,Ue.lookup_name(u.daddr),u.dport,l);return 0}function Cy(s,a,l,u,d){var f=hn(s);return a===1&&l===4?(M[u>>2]=f.error,M[d>>2]=4,f.error=null,0):-50}function By(s,a,l){return Zt.varargs=l,0}function Ty(s,a){}function Dy(s,a,l){}function Ey(s,a,l,u){}function ky(s,a,l,u){Zt.varargs=u}function Oy(s,a,l,u,d,f){var p=hn(s),y=p.sock_ops.recvmsg(p,l);if(!y)return 0;if(d)var _=la(d,p.family,Ue.lookup_name(y.addr),y.port,f);return $i.set(y.buffer,a),y.buffer.byteLength}function My(s,a,l,u){}function Ry(s){}function Uy(s,a,l,u,d,f){}function Ny(s,a,l){}function Ly(s,a){}function Py(s,a,l){}function Vy(s){}var Nl="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Hy(s,a){Me(Nl)}function zy(s,a){Me(Nl)}function Wy(){return Date.now()}var $y=!0;function Yy(){return $y}function Xy(){Me("")}function Gy(s,a){return globalThis.DUCKDB_RUNTIME.createDirectory(e,s,a)}function Ky(s,a){return globalThis.DUCKDB_RUNTIME.checkDirectory(e,s,a)}function Jy(s,a){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(e,s,a)}function qy(s,a){return globalThis.DUCKDB_RUNTIME.removeDirectory(e,s,a)}function Zy(s){return globalThis.DUCKDB_RUNTIME.closeFile(e,s)}function Qy(s,a){return globalThis.DUCKDB_RUNTIME.checkFile(e,s,a)}function t_(s){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(e,s)}function e_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.moveFile(e,s,a,l,u)}function i_(s,a){return globalThis.DUCKDB_RUNTIME.openFile(e,s,a)}function r_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.readFile(e,s,a,l,u)}function n_(s,a){return globalThis.DUCKDB_RUNTIME.truncateFile(e,s,a)}function s_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.writeFile(e,s,a,l,u)}function o_(s,a){return globalThis.DUCKDB_RUNTIME.glob(e,s,a)}function a_(s){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(e,s)}function l_(s,a,l,u,d,f){return globalThis.DUCKDB_RUNTIME.callScalarUDF(e,s,a,l,u,d,f)}function Ll(){return 2147483648}var ca;T?ca=()=>{var s=process.hrtime();return s[0]*1e3+s[1]/1e6}:ca=()=>performance.now();function c_(s,a,l){$i.copyWithin(s,a,a+l)}function u_(s){try{return Ht.grow(s-jl.byteLength+65535>>>16),Il(Ht.buffer),1}catch(a){}}function d_(s){var a=$i.length;s=s>>>0;var l=Ll();if(s>l)return!1;let u=(_,b)=>_+(b-_%b)%b;for(var d=1;d<=4;d*=2){var f=a*(1+.2/d);f=Math.min(f,s+100663296);var p=Math.min(l,u(Math.max(s,f),65536)),y=u_(p);if(y)return!0}return!1}var ua={};function f_(){return h||"./this.program"}function pn(){if(!pn.strings){var s=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:s,_:f_()};for(var l in ua)ua[l]===void 0?delete a[l]:a[l]=ua[l];var u=[];for(var l in a)u.push(l+"="+a[l]);pn.strings=u}return pn.strings}function h_(s,a){var l=0;return pn().forEach(function(u,d){var f=a+l;M[s+d*4>>2]=f,Lp(u,f),l+=u.length+1}),0}function p_(s,a){var l=pn();M[s>>2]=l.length;var u=0;return l.forEach(function(d){u+=d.length+1}),M[a>>2]=u,0}function y_(s){return 0}function __(s,a,l,u,d,f){var p=Zt.getStreamFromFD(s),y=Zt.doReadv(p,a,l,u);return M[f>>2]=y,0}function m_(s,a,l,u,d,f){var p=Zt.getStreamFromFD(s),y=Zt.doWritev(p,a,l,u);return M[f>>2]=y,0}function b_(s,a,l,u){var d=Zt.getStreamFromFD(s),f=Zt.doReadv(d,a,l);return M[u>>2]=f,0}function v_(s,a,l,u,d){}function g_(s){var a=Zt.getStreamFromFD(s);return a.stream_ops&&a.stream_ops.fsync?-a.stream_ops.fsync(a):0}function w_(s,a,l,u){for(var d=0,f=0;f<l;f++){var p=M[a>>2],y=M[a+4>>2];a+=8;for(var _=0;_<y;_++)Zt.printChar(s,$i[p+_]);d+=y}return M[u>>2]=d,0}function j_(){return le()}function S_(s,a,l,u){var d=0,f=0,p=0,y=0,_=0,b=0,v;function I(F,D,E,q,ut,It){var B,N,bt,Bt;return N=F===10?28:16,ut=F===10?Ol(ut):oa(ut),B=ms(N),Bt=la(B,F,ut,It),ye(!Bt),bt=ms(32),M[bt+4>>2]=F,M[bt+8>>2]=D,M[bt+12>>2]=E,M[bt+24>>2]=q,M[bt+20>>2]=B,F===10?M[bt+16>>2]=28:M[bt+16>>2]=16,M[bt+28>>2]=0,bt}if(l&&(p=M[l>>2],y=M[l+4>>2],_=M[l+8>>2],b=M[l+12>>2]),_&&!b&&(b=_===2?17:6),!_&&b&&(_=b===17?2:1),b===0&&(b=6),_===0&&(_=1),!s&&!a)return-2;if(p&-1088||l!==0&&M[l>>2]&2&&!s)return-1;if(p&32)return-2;if(_!==0&&_!==1&&_!==2)return-7;if(y!==0&&y!==2&&y!==10)return-6;if(a&&(a=Ai(a),f=parseInt(a,10),isNaN(f)))return p&1024?-2:-8;if(!s)return y===0&&(y=2),(p&1)===0&&(y===2?d=ys(2130706433):d=[0,0,0,1]),v=I(y,_,b,null,d,f),M[u>>2]=v,0;if(s=Ai(s),d=ds(s),d!==null)if(y===0||y===2)y=2;else if(y===10&&p&8)d=[0,0,ys(65535),d],y=10;else return-2;else if(d=aa(s),d!==null)if(y===0||y===10)y=10;else return-2;return d!=null?(v=I(y,_,b,s,d,f),M[u>>2]=v,0):p&4?-2:(s=Ue.lookup_name(s),d=ds(s),y===0?y=2:y===10&&(d=[0,0,ys(65535),d]),v=I(y,_,b,null,d,f),M[u>>2]=v,0)}function I_(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var s=new Uint8Array(1);return function(){return crypto.getRandomValues(s),s[0]}}else if(T)try{var a=tw("crypto");return function(){return a.randomBytes(1)[0]}}catch(l){}return function(){Me("randomDevice")}}function hs(s,a){hs.randomDevice||(hs.randomDevice=I_());for(var l=0;l<a;l++)xi[s+l>>0]=hs.randomDevice();return 0}function A_(s,a,l,u,d,f,p){var y=Ml(s,a);if(y.errno)return-6;var _=y.port,b=y.addr,v=!1;if(l&&u){var I;if(p&1||!(I=Ue.lookup_addr(b))){if(p&8)return-2}else b=I;var F=na(b,l,u);F+1>=u&&(v=!0)}if(d&&f){_=""+_;var F=na(_,d,f);F+1>=f&&(v=!0)}return v?-12:0}function x_(s){return s}function F_(s){P(s)}function ps(s){return s%4===0&&(s%100!==0||s%400===0)}function C_(s,a){for(var l=0,u=0;u<=a;l+=s[u++]);return l}var Pl=[31,29,31,30,31,30,31,31,30,31,30,31],Vl=[31,28,31,30,31,30,31,31,30,31,30,31];function B_(s,a){for(var l=new Date(s.getTime());a>0;){var u=ps(l.getFullYear()),d=l.getMonth(),f=(u?Pl:Vl)[d];if(a>f-l.getDate())a-=f-l.getDate()+1,l.setDate(1),d<11?l.setMonth(d+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else return l.setDate(l.getDate()+a),l}return l}function T_(s,a,l,u){var d=M[u+40>>2],f={tm_sec:M[u>>2],tm_min:M[u+4>>2],tm_hour:M[u+8>>2],tm_mday:M[u+12>>2],tm_mon:M[u+16>>2],tm_year:M[u+20>>2],tm_wday:M[u+24>>2],tm_yday:M[u+28>>2],tm_isdst:M[u+32>>2],tm_gmtoff:M[u+36>>2],tm_zone:d?Ai(d):""},p=Ai(l),y={"%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 _ in y)p=p.replace(new RegExp(_,"g"),y[_]);var b=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"];function I(B,N,bt){for(var Bt=typeof B=="number"?B.toString():B||"";Bt.length<N;)Bt=bt[0]+Bt;return Bt}function F(B,N){return I(B,N,"0")}function D(B,N){function bt(Yi){return Yi<0?-1:Yi>0?1:0}var Bt;return(Bt=bt(B.getFullYear()-N.getFullYear()))===0&&(Bt=bt(B.getMonth()-N.getMonth()))===0&&(Bt=bt(B.getDate()-N.getDate())),Bt}function E(B){switch(B.getDay()){case 0:return new Date(B.getFullYear()-1,11,29);case 1:return B;case 2:return new Date(B.getFullYear(),0,3);case 3:return new Date(B.getFullYear(),0,2);case 4:return new Date(B.getFullYear(),0,1);case 5:return new Date(B.getFullYear()-1,11,31);case 6:return new Date(B.getFullYear()-1,11,30)}}function q(B){var N=B_(new Date(B.tm_year+1900,0,1),B.tm_yday),bt=new Date(N.getFullYear(),0,4),Bt=new Date(N.getFullYear()+1,0,4),Yi=E(bt),Y0=E(Bt);return D(Yi,N)<=0?D(Y0,N)<=0?N.getFullYear()+1:N.getFullYear():N.getFullYear()-1}var ut={"%a":function(B){return b[B.tm_wday].substring(0,3)},"%A":function(B){return b[B.tm_wday]},"%b":function(B){return v[B.tm_mon].substring(0,3)},"%B":function(B){return v[B.tm_mon]},"%C":function(B){var N=B.tm_year+1900;return F(N/100|0,2)},"%d":function(B){return F(B.tm_mday,2)},"%e":function(B){return I(B.tm_mday,2," ")},"%g":function(B){return q(B).toString().substring(2)},"%G":function(B){return q(B)},"%H":function(B){return F(B.tm_hour,2)},"%I":function(B){var N=B.tm_hour;return N==0?N=12:N>12&&(N-=12),F(N,2)},"%j":function(B){return F(B.tm_mday+C_(ps(B.tm_year+1900)?Pl:Vl,B.tm_mon-1),3)},"%m":function(B){return F(B.tm_mon+1,2)},"%M":function(B){return F(B.tm_min,2)},"%n":function(){return`
11
- `},"%p":function(B){return B.tm_hour>=0&&B.tm_hour<12?"AM":"PM"},"%S":function(B){return F(B.tm_sec,2)},"%t":function(){return" "},"%u":function(B){return B.tm_wday||7},"%U":function(B){var N=B.tm_yday+7-B.tm_wday;return F(Math.floor(N/7),2)},"%V":function(B){var N=Math.floor((B.tm_yday+7-(B.tm_wday+6)%7)/7);if((B.tm_wday+371-B.tm_yday-2)%7<=2&&N++,N){if(N==53){var Bt=(B.tm_wday+371-B.tm_yday)%7;Bt!=4&&(Bt!=3||!ps(B.tm_year))&&(N=1)}}else{N=52;var bt=(B.tm_wday+7-B.tm_yday-1)%7;(bt==4||bt==5&&ps(B.tm_year%400-1))&&N++}return F(N,2)},"%w":function(B){return B.tm_wday},"%W":function(B){var N=B.tm_yday+7-(B.tm_wday+6)%7;return F(Math.floor(N/7),2)},"%y":function(B){return(B.tm_year+1900).toString().substring(2)},"%Y":function(B){return B.tm_year+1900},"%z":function(B){var N=B.tm_gmtoff,bt=N>=0;return N=Math.abs(N)/60,N=N/60*100+N%60,(bt?"+":"-")+String("0000"+N).slice(-4)},"%Z":function(B){return B.tm_zone},"%%":function(){return"%"}};p=p.replace(/%%/g,"\0\0");for(var _ in ut)p.includes(_)&&(p=p.replace(new RegExp(_,"g"),ut[_](f)));p=p.replace(/\0\0/g,"%");var It=E_(p,!1);return It.length>a?0:(wl(It,s),It.length-1)}function D_(s,a,l,u){return T_(s,a,l,u)}function E_(s,a,l){var u=l>0?l:Np(s)+1,d=new Array(u),f=gl(s,d,0,d.length);return a&&(d.length=f),d}var k_={p:ny,j:sy,C:ay,H:cy,b:dy,n:fy,K:hy,$:py,i:El,ha:yy,w:_y,G:my,e:uy,Ca:by,Ea:gy,Da:wy,Se:jy,V:Sy,Qa:Iy,se:Ay,Ma:xy,ya:Fy,Ba:Cy,Sa:By,Na:Ty,Ra:Dy,Oa:Ey,na:ky,za:Oy,Qe:My,la:Ry,Aa:Uy,ka:Ny,Pa:Ly,ma:Py,Ga:Vy,Ia:Hy,Ha:zy,Ua:Wy,Ta:Yy,da:Xy,Ie:Gy,Je:Ky,Ge:Jy,He:qy,ua:Zy,Ee:Qy,Le:t_,Fe:e_,Me:i_,ja:r_,Ke:n_,va:s_,De:o_,ta:a_,Ne:l_,Va:Ll,oe:ca,nb:c_,hd:d_,Xa:h_,Ya:p_,_:y_,re:__,ub:m_,pa:b_,Ae:v_,Re:g_,ia:w_,a:j_,Fa:S_,La:hs,xa:A_,ra:bb,S:eb,Z:Bm,Yb:$g,sa:mb,aa:rb,qa:Cm,Zb:Wg,x:Rm,Ka:lb,q:Xm,ba:Jm,r:Ym,d:wm,ea:fb,F:qm,Qb:Qg,c:jm,X:ib,h:Im,Ob:e0,m:Fm,oa:zm,o:Am,y:Nm,B:km,P:Km,W:Gm,cb:Om,z:Lm,A:Mm,T:pb,u:ab,U:db,L:ub,ic:kg,pc:xg,sc:Sg,yc:bg,jc:Eg,Pb:t0,Xb:Yg,qc:Ag,zc:mg,db:R0,we:Ib,Qd:ev,Kd:av,lc:Tg,ve:Ab,Vb:Gg,jd:Ov,_a:P0,Za:V0,Wd:Kb,Pd:iv,Bb:p0,Xc:Xv,ae:zb,Gc:ug,Wb:Xg,Nb:i0,ge:Ub,Ud:qb,_b:zg,Ld:ov,vd:jv,Td:Zb,rb:S0,Vd:Jb,me:Db,Rd:tv,id:Mv,Db:f0,lb:C0,bb:U0,ue:xb,$d:Wb,yd:vv,Ab:y0,zd:bv,mb:F0,Jb:o0,Sd:Qb,Fd:fv,Id:cv,Hd:uv,Gd:dv,Cd:yv,wc:gg,fc:Rg,ee:Lb,Ac:_g,_d:$b,pe:Bb,Dc:hg,Cc:pg,ze:wb,ye:jb,Od:rv,Ce:vb,qd:Fv,Bc:yg,kc:Dg,Hc:cg,mc:Bg,Kb:s0,Tc:qv,zb:_0,Mb:r0,sd:Av,md:Dv,Nc:rg,Lb:n0,Cb:h0,oc:Fg,gc:Mg,od:Bv,dd:Lv,Oc:ig,td:Iv,ad:Hv,$a:L0,sb:j0,_c:Wv,Ec:fg,Gb:c0,bc:Pg,Hb:l0,$b:Hg,v:vm,k:Sm,E:tb,fa:ob,wb:v0,M:Qm,ga:sb,xb:b0,f:gm,Q:Dm,Y:Zm,uc:Tm,g:Em,l:xm,Pe:yb,t:$m,s:Hm,wa:hb,D:Um,N:Wm,R:nb,O:Pm,Oe:_b,Ja:cb,ca:Vm,Ed:hv,vb:g0,kd:kv,hc:Og,cc:Lg,xc:vg,Rb:Zg,pb:A0,je:Ob,Fc:dg,wd:wv,jb:T0,Ad:mv,Bd:_v,dc:Ng,Uc:Jv,Yc:Yv,Tb:Jg,Sb:qg,Pc:eg,ie:Mb,Yd:Xb,Dd:pv,Wc:Gv,Kc:og,Eb:d0,ab:N0,Fb:u0,ob:x0,ce:Vb,ud:Sv,Ub:Kg,Ic:lg,Sc:Zv,he:Rb,kb:B0,qe:Cb,te:Fb,xe:Sb,Jd:lv,ib:D0,cd:Pv,Mc:ng,Lc:sg,bd:Vv,Zc:$v,nd:Tv,qb:I0,gd:Rv,hb:E0,Jc:ag,nc:Cg,Be:gb,le:Eb,ed:Nv,Qc:tg,be:Hb,rc:Ig,ke:kb,de:Pb,fd:Uv,Nd:nv,Md:sv,$c:zv,yb:m0,ld:Ev,vc:wg,fe:Nb,gb:k0,Rc:Qv,tb:w0,Zd:Yb,Vc:Kv,eb:M0,fb:O0,tc:jg,ne:Tb,rd:xv,Xd:Gb,ac:Vg,ec:Ug,Ib:a0,xd:gv,pd:Cv,I:x_,J:F_,Wa:D_},GS=iy(),O_=e.___wasm_call_ctors=function(){return(O_=e.___wasm_call_ctors=e.asm.Ue).apply(null,arguments)},M_=e._main=function(){return(M_=e._main=e.asm.Ve).apply(null,arguments)},R_=e._duckdb_web_fs_glob_add_path=function(){return(R_=e._duckdb_web_fs_glob_add_path=e.asm.We).apply(null,arguments)},U_=e._duckdb_web_clear_response=function(){return(U_=e._duckdb_web_clear_response=e.asm.Xe).apply(null,arguments)},N_=e._duckdb_web_fail_with=function(){return(N_=e._duckdb_web_fail_with=e.asm.Ye).apply(null,arguments)},L_=e._duckdb_web_reset=function(){return(L_=e._duckdb_web_reset=e.asm.Ze).apply(null,arguments)},P_=e._duckdb_web_connect=function(){return(P_=e._duckdb_web_connect=e.asm._e).apply(null,arguments)},V_=e._duckdb_web_disconnect=function(){return(V_=e._duckdb_web_disconnect=e.asm.$e).apply(null,arguments)},H_=e._duckdb_web_flush_files=function(){return(H_=e._duckdb_web_flush_files=e.asm.af).apply(null,arguments)},z_=e._duckdb_web_flush_file=function(){return(z_=e._duckdb_web_flush_file=e.asm.bf).apply(null,arguments)},W_=e._duckdb_web_open=function(){return(W_=e._duckdb_web_open=e.asm.cf).apply(null,arguments)},$_=e._duckdb_web_get_global_file_info=function(){return($_=e._duckdb_web_get_global_file_info=e.asm.df).apply(null,arguments)},Y_=e._duckdb_web_collect_file_stats=function(){return(Y_=e._duckdb_web_collect_file_stats=e.asm.ef).apply(null,arguments)},X_=e._duckdb_web_export_file_stats=function(){return(X_=e._duckdb_web_export_file_stats=e.asm.ff).apply(null,arguments)},G_=e._duckdb_web_fs_drop_file=function(){return(G_=e._duckdb_web_fs_drop_file=e.asm.gf).apply(null,arguments)},K_=e._duckdb_web_fs_drop_files=function(){return(K_=e._duckdb_web_fs_drop_files=e.asm.hf).apply(null,arguments)},J_=e._duckdb_web_fs_glob_file_infos=function(){return(J_=e._duckdb_web_fs_glob_file_infos=e.asm.jf).apply(null,arguments)},q_=e._duckdb_web_fs_get_file_info_by_id=function(){return(q_=e._duckdb_web_fs_get_file_info_by_id=e.asm.kf).apply(null,arguments)},Z_=e._duckdb_web_fs_get_file_info_by_name=function(){return(Z_=e._duckdb_web_fs_get_file_info_by_name=e.asm.lf).apply(null,arguments)},Q_=e._duckdb_web_fs_set_file_descriptor=function(){return(Q_=e._duckdb_web_fs_set_file_descriptor=e.asm.mf).apply(null,arguments)},tm=e._duckdb_web_fs_register_file_url=function(){return(tm=e._duckdb_web_fs_register_file_url=e.asm.nf).apply(null,arguments)},em=e._duckdb_web_fs_register_file_buffer=function(){return(em=e._duckdb_web_fs_register_file_buffer=e.asm.of).apply(null,arguments)},im=e._duckdb_web_copy_file_to_buffer=function(){return(im=e._duckdb_web_copy_file_to_buffer=e.asm.pf).apply(null,arguments)},rm=e._duckdb_web_copy_file_to_path=function(){return(rm=e._duckdb_web_copy_file_to_path=e.asm.qf).apply(null,arguments)},nm=e._duckdb_web_get_version=function(){return(nm=e._duckdb_web_get_version=e.asm.rf).apply(null,arguments)},sm=e._duckdb_web_get_feature_flags=function(){return(sm=e._duckdb_web_get_feature_flags=e.asm.sf).apply(null,arguments)},om=e._duckdb_web_tokenize=function(){return(om=e._duckdb_web_tokenize=e.asm.tf).apply(null,arguments)},am=e._duckdb_web_udf_scalar_create=function(){return(am=e._duckdb_web_udf_scalar_create=e.asm.uf).apply(null,arguments)},lm=e._duckdb_web_prepared_create=function(){return(lm=e._duckdb_web_prepared_create=e.asm.vf).apply(null,arguments)},cm=e._duckdb_web_prepared_close=function(){return(cm=e._duckdb_web_prepared_close=e.asm.wf).apply(null,arguments)},um=e._duckdb_web_prepared_run=function(){return(um=e._duckdb_web_prepared_run=e.asm.xf).apply(null,arguments)},dm=e._duckdb_web_prepared_send=function(){return(dm=e._duckdb_web_prepared_send=e.asm.yf).apply(null,arguments)},fm=e._duckdb_web_query_run=function(){return(fm=e._duckdb_web_query_run=e.asm.zf).apply(null,arguments)},hm=e._duckdb_web_query_send=function(){return(hm=e._duckdb_web_query_send=e.asm.Af).apply(null,arguments)},pm=e._duckdb_web_query_fetch_results=function(){return(pm=e._duckdb_web_query_fetch_results=e.asm.Bf).apply(null,arguments)},ym=e._duckdb_web_get_tablenames=function(){return(ym=e._duckdb_web_get_tablenames=e.asm.Cf).apply(null,arguments)},_m=e._duckdb_web_insert_arrow_from_ipc_stream=function(){return(_m=e._duckdb_web_insert_arrow_from_ipc_stream=e.asm.Df).apply(null,arguments)},mm=e._duckdb_web_insert_csv_from_path=function(){return(mm=e._duckdb_web_insert_csv_from_path=e.asm.Ef).apply(null,arguments)},bm=e._duckdb_web_insert_json_from_path=function(){return(bm=e._duckdb_web_insert_json_from_path=e.asm.Ff).apply(null,arguments)},ys=e._htonl=function(){return(ys=e._htonl=e.asm.Gf).apply(null,arguments)},_s=e._htons=function(){return(_s=e._htons=e.asm.Hf).apply(null,arguments)},da=e._ntohs=function(){return(da=e._ntohs=e.asm.If).apply(null,arguments)},ms=e._malloc=function(){return(ms=e._malloc=e.asm.Jf).apply(null,arguments)},Hl=e._free=function(){return(Hl=e._free=e.asm.Kf).apply(null,arguments)},w=e._setThrew=function(){return(w=e._setThrew=e.asm.Lf).apply(null,arguments)},j=e.stackSave=function(){return(j=e.stackSave=e.asm.Mf).apply(null,arguments)},S=e.stackRestore=function(){return(S=e.stackRestore=e.asm.Nf).apply(null,arguments)},fa=e.stackAlloc=function(){return(fa=e.stackAlloc=e.asm.Of).apply(null,arguments)},yn=e.___cxa_can_catch=function(){return(yn=e.___cxa_can_catch=e.asm.Pf).apply(null,arguments)},zl=e.___cxa_is_pointer_type=function(){return(zl=e.___cxa_is_pointer_type=e.asm.Qf).apply(null,arguments)},Wl=e.dynCall_jiiii=function(){return(Wl=e.dynCall_jiiii=e.asm.Sf).apply(null,arguments)},$l=e.dynCall_iiiiij=function(){return($l=e.dynCall_iiiiij=e.asm.Tf).apply(null,arguments)},Yl=e.dynCall_iiiiijj=function(){return(Yl=e.dynCall_iiiiijj=e.asm.Uf).apply(null,arguments)},Xl=e.dynCall_viijii=function(){return(Xl=e.dynCall_viijii=e.asm.Vf).apply(null,arguments)},Gl=e.dynCall_j=function(){return(Gl=e.dynCall_j=e.asm.Wf).apply(null,arguments)},Kl=e.dynCall_ji=function(){return(Kl=e.dynCall_ji=e.asm.Xf).apply(null,arguments)},Jl=e.dynCall_iij=function(){return(Jl=e.dynCall_iij=e.asm.Yf).apply(null,arguments)},ql=e.dynCall_viij=function(){return(ql=e.dynCall_viij=e.asm.Zf).apply(null,arguments)},Zl=e.dynCall_viijji=function(){return(Zl=e.dynCall_viijji=e.asm._f).apply(null,arguments)},Ql=e.dynCall_viijj=function(){return(Ql=e.dynCall_viijj=e.asm.$f).apply(null,arguments)},tc=e.dynCall_viiijj=function(){return(tc=e.dynCall_viiijj=e.asm.ag).apply(null,arguments)},ec=e.dynCall_viiji=function(){return(ec=e.dynCall_viiji=e.asm.bg).apply(null,arguments)},ic=e.dynCall_vijjj=function(){return(ic=e.dynCall_vijjj=e.asm.cg).apply(null,arguments)},rc=e.dynCall_iiijj=function(){return(rc=e.dynCall_iiijj=e.asm.dg).apply(null,arguments)},nc=e.dynCall_viiij=function(){return(nc=e.dynCall_viiij=e.asm.eg).apply(null,arguments)},sc=e.dynCall_viijij=function(){return(sc=e.dynCall_viijij=e.asm.fg).apply(null,arguments)},oc=e.dynCall_viiijjj=function(){return(oc=e.dynCall_viiijjj=e.asm.gg).apply(null,arguments)},ac=e.dynCall_iiij=function(){return(ac=e.dynCall_iiij=e.asm.hg).apply(null,arguments)},lc=e.dynCall_vijijj=function(){return(lc=e.dynCall_vijijj=e.asm.ig).apply(null,arguments)},cc=e.dynCall_iji=function(){return(cc=e.dynCall_iji=e.asm.jg).apply(null,arguments)},uc=e.dynCall_viji=function(){return(uc=e.dynCall_viji=e.asm.kg).apply(null,arguments)},dc=e.dynCall_vij=function(){return(dc=e.dynCall_vij=e.asm.lg).apply(null,arguments)},fc=e.dynCall_iiji=function(){return(fc=e.dynCall_iiji=e.asm.mg).apply(null,arguments)},hc=e.dynCall_viiiij=function(){return(hc=e.dynCall_viiiij=e.asm.ng).apply(null,arguments)},pc=e.dynCall_jii=function(){return(pc=e.dynCall_jii=e.asm.og).apply(null,arguments)},yc=e.dynCall_viiiji=function(){return(yc=e.dynCall_viiiji=e.asm.pg).apply(null,arguments)},_c=e.dynCall_vijj=function(){return(_c=e.dynCall_vijj=e.asm.qg).apply(null,arguments)},mc=e.dynCall_vj=function(){return(mc=e.dynCall_vj=e.asm.rg).apply(null,arguments)},bc=e.dynCall_iiiij=function(){return(bc=e.dynCall_iiiij=e.asm.sg).apply(null,arguments)},vc=e.dynCall_iiiiiji=function(){return(vc=e.dynCall_iiiiiji=e.asm.tg).apply(null,arguments)},gc=e.dynCall_iiiji=function(){return(gc=e.dynCall_iiiji=e.asm.ug).apply(null,arguments)},wc=e.dynCall_iiiiji=function(){return(wc=e.dynCall_iiiiji=e.asm.vg).apply(null,arguments)},jc=e.dynCall_jiii=function(){return(jc=e.dynCall_jiii=e.asm.wg).apply(null,arguments)},Sc=e.dynCall_jij=function(){return(Sc=e.dynCall_jij=e.asm.xg).apply(null,arguments)},Ic=e.dynCall_iijjijj=function(){return(Ic=e.dynCall_iijjijj=e.asm.yg).apply(null,arguments)},Ac=e.dynCall_viiiijiiiii=function(){return(Ac=e.dynCall_viiiijiiiii=e.asm.zg).apply(null,arguments)},xc=e.dynCall_viiiijiiii=function(){return(xc=e.dynCall_viiiijiiii=e.asm.Ag).apply(null,arguments)},Fc=e.dynCall_viiijii=function(){return(Fc=e.dynCall_viiijii=e.asm.Bg).apply(null,arguments)},Cc=e.dynCall_viiiiiij=function(){return(Cc=e.dynCall_viiiiiij=e.asm.Cg).apply(null,arguments)},Bc=e.dynCall_iiijiii=function(){return(Bc=e.dynCall_iiijiii=e.asm.Dg).apply(null,arguments)},Tc=e.dynCall_iiiiijii=function(){return(Tc=e.dynCall_iiiiijii=e.asm.Eg).apply(null,arguments)},Dc=e.dynCall_viijiii=function(){return(Dc=e.dynCall_viijiii=e.asm.Fg).apply(null,arguments)},Ec=e.dynCall_iiijiij=function(){return(Ec=e.dynCall_iiijiij=e.asm.Gg).apply(null,arguments)},kc=e.dynCall_vijiii=function(){return(kc=e.dynCall_vijiii=e.asm.Hg).apply(null,arguments)},Oc=e.dynCall_iijjii=function(){return(Oc=e.dynCall_iijjii=e.asm.Ig).apply(null,arguments)},Mc=e.dynCall_iijjiii=function(){return(Mc=e.dynCall_iijjiii=e.asm.Jg).apply(null,arguments)},Rc=e.dynCall_iijjiiii=function(){return(Rc=e.dynCall_iijjiiii=e.asm.Kg).apply(null,arguments)},Uc=e.dynCall_iijji=function(){return(Uc=e.dynCall_iijji=e.asm.Lg).apply(null,arguments)},Nc=e.dynCall_vijiiii=function(){return(Nc=e.dynCall_vijiiii=e.asm.Mg).apply(null,arguments)},Lc=e.dynCall_iijiiii=function(){return(Lc=e.dynCall_iijiiii=e.asm.Ng).apply(null,arguments)},Pc=e.dynCall_iijii=function(){return(Pc=e.dynCall_iijii=e.asm.Og).apply(null,arguments)},Vc=e.dynCall_vijij=function(){return(Vc=e.dynCall_vijij=e.asm.Pg).apply(null,arguments)},Hc=e.dynCall_iiijiiii=function(){return(Hc=e.dynCall_iiijiiii=e.asm.Qg).apply(null,arguments)},zc=e.dynCall_jiiij=function(){return(zc=e.dynCall_jiiij=e.asm.Rg).apply(null,arguments)},Wc=e.dynCall_jiiiii=function(){return(Wc=e.dynCall_jiiiii=e.asm.Sg).apply(null,arguments)},$c=e.dynCall_iiiiijjiijj=function(){return($c=e.dynCall_iiiiijjiijj=e.asm.Tg).apply(null,arguments)},Yc=e.dynCall_viijiiji=function(){return(Yc=e.dynCall_viijiiji=e.asm.Ug).apply(null,arguments)},Xc=e.dynCall_iijj=function(){return(Xc=e.dynCall_iijj=e.asm.Vg).apply(null,arguments)},Gc=e.dynCall_iiijjii=function(){return(Gc=e.dynCall_iiijjii=e.asm.Wg).apply(null,arguments)},Kc=e.dynCall_iiijji=function(){return(Kc=e.dynCall_iiijji=e.asm.Xg).apply(null,arguments)},Jc=e.dynCall_vijii=function(){return(Jc=e.dynCall_vijii=e.asm.Yg).apply(null,arguments)},qc=e.dynCall_vjjijij=function(){return(qc=e.dynCall_vjjijij=e.asm.Zg).apply(null,arguments)},Zc=e.dynCall_vijjji=function(){return(Zc=e.dynCall_vijjji=e.asm._g).apply(null,arguments)},Qc=e.dynCall_vjjii=function(){return(Qc=e.dynCall_vjjii=e.asm.$g).apply(null,arguments)},tu=e.dynCall_viiiiiji=function(){return(tu=e.dynCall_viiiiiji=e.asm.ah).apply(null,arguments)},eu=e.dynCall_jiiiji=function(){return(eu=e.dynCall_jiiiji=e.asm.bh).apply(null,arguments)},iu=e.dynCall_viijjii=function(){return(iu=e.dynCall_viijjii=e.asm.ch).apply(null,arguments)},ru=e.dynCall_iiiijj=function(){return(ru=e.dynCall_iiiijj=e.asm.dh).apply(null,arguments)},nu=e.dynCall_viiiijj=function(){return(nu=e.dynCall_viiiijj=e.asm.eh).apply(null,arguments)},su=e.dynCall_jijjij=function(){return(su=e.dynCall_jijjij=e.asm.fh).apply(null,arguments)},ou=e.dynCall_jiijii=function(){return(ou=e.dynCall_jiijii=e.asm.gh).apply(null,arguments)},au=e.dynCall_jijiii=function(){return(au=e.dynCall_jijiii=e.asm.hh).apply(null,arguments)},lu=e.dynCall_viijiiiii=function(){return(lu=e.dynCall_viijiiiii=e.asm.ih).apply(null,arguments)},cu=e.dynCall_viijiiij=function(){return(cu=e.dynCall_viijiiij=e.asm.jh).apply(null,arguments)},uu=e.dynCall_vijiiiji=function(){return(uu=e.dynCall_vijiiiji=e.asm.kh).apply(null,arguments)},du=e.dynCall_jiiji=function(){return(du=e.dynCall_jiiji=e.asm.lh).apply(null,arguments)},fu=e.dynCall_viiijij=function(){return(fu=e.dynCall_viiijij=e.asm.mh).apply(null,arguments)},hu=e.dynCall_viijiij=function(){return(hu=e.dynCall_viijiij=e.asm.nh).apply(null,arguments)},pu=e.dynCall_viiiiijj=function(){return(pu=e.dynCall_viiiiijj=e.asm.oh).apply(null,arguments)},yu=e.dynCall_viiijji=function(){return(yu=e.dynCall_viiijji=e.asm.ph).apply(null,arguments)},_u=e.dynCall_viiiijii=function(){return(_u=e.dynCall_viiiijii=e.asm.qh).apply(null,arguments)},mu=e.dynCall_iiiijiii=function(){return(mu=e.dynCall_iiiijiii=e.asm.rh).apply(null,arguments)},bu=e.dynCall_iiijij=function(){return(bu=e.dynCall_iiijij=e.asm.sh).apply(null,arguments)},vu=e.dynCall_viiijiii=function(){return(vu=e.dynCall_viiijiii=e.asm.th).apply(null,arguments)},gu=e.dynCall_vijji=function(){return(gu=e.dynCall_vijji=e.asm.uh).apply(null,arguments)},wu=e.dynCall_viiiijij=function(){return(wu=e.dynCall_viiiijij=e.asm.vh).apply(null,arguments)},ju=e.dynCall_jiiiij=function(){return(ju=e.dynCall_jiiiij=e.asm.wh).apply(null,arguments)},Su=e.dynCall_jiiijii=function(){return(Su=e.dynCall_jiiijii=e.asm.xh).apply(null,arguments)},Iu=e.dynCall_jiijiii=function(){return(Iu=e.dynCall_jiijiii=e.asm.yh).apply(null,arguments)},Au=e.dynCall_viiijjij=function(){return(Au=e.dynCall_viiijjij=e.asm.zh).apply(null,arguments)},xu=e.dynCall_vijijjiij=function(){return(xu=e.dynCall_vijijjiij=e.asm.Ah).apply(null,arguments)},Fu=e.dynCall_viijjij=function(){return(Fu=e.dynCall_viijjij=e.asm.Bh).apply(null,arguments)},Cu=e.dynCall_viiijjiij=function(){return(Cu=e.dynCall_viiijjiij=e.asm.Ch).apply(null,arguments)},Bu=e.dynCall_viiiijjjj=function(){return(Bu=e.dynCall_viiiijjjj=e.asm.Dh).apply(null,arguments)},Tu=e.dynCall_viijiiiiij=function(){return(Tu=e.dynCall_viijiiiiij=e.asm.Eh).apply(null,arguments)},Du=e.dynCall_viijiiiijj=function(){return(Du=e.dynCall_viijiiiijj=e.asm.Fh).apply(null,arguments)},Eu=e.dynCall_viiijiiiijjj=function(){return(Eu=e.dynCall_viiijiiiijjj=e.asm.Gh).apply(null,arguments)},ku=e.dynCall_viijijiiiijjj=function(){return(ku=e.dynCall_viijijiiiijjj=e.asm.Hh).apply(null,arguments)},Ou=e.dynCall_jj=function(){return(Ou=e.dynCall_jj=e.asm.Ih).apply(null,arguments)},Mu=e.dynCall_jd=function(){return(Mu=e.dynCall_jd=e.asm.Jh).apply(null,arguments)},Ru=e.dynCall_jf=function(){return(Ru=e.dynCall_jf=e.asm.Kh).apply(null,arguments)},Uu=e.dynCall_iijjj=function(){return(Uu=e.dynCall_iijjj=e.asm.Lh).apply(null,arguments)},Nu=e.dynCall_vijijiiiijjj=function(){return(Nu=e.dynCall_vijijiiiijjj=e.asm.Mh).apply(null,arguments)},Lu=e.dynCall_iiiiiiji=function(){return(Lu=e.dynCall_iiiiiiji=e.asm.Nh).apply(null,arguments)},Pu=e.dynCall_iiiiiiiiji=function(){return(Pu=e.dynCall_iiiiiiiiji=e.asm.Oh).apply(null,arguments)},Vu=e.dynCall_viijjj=function(){return(Vu=e.dynCall_viijjj=e.asm.Ph).apply(null,arguments)},Hu=e.dynCall_vijjij=function(){return(Hu=e.dynCall_vijjij=e.asm.Qh).apply(null,arguments)},zu=e.dynCall_viijjji=function(){return(zu=e.dynCall_viijjji=e.asm.Rh).apply(null,arguments)},Wu=e.dynCall_iiiiiij=function(){return(Wu=e.dynCall_iiiiiij=e.asm.Sh).apply(null,arguments)},$u=e.dynCall_iiiiiiiiiiji=function(){return($u=e.dynCall_iiiiiiiiiiji=e.asm.Th).apply(null,arguments)},Yu=e.dynCall_jiiijjj=function(){return(Yu=e.dynCall_jiiijjj=e.asm.Uh).apply(null,arguments)},Xu=e.dynCall_viijijj=function(){return(Xu=e.dynCall_viijijj=e.asm.Vh).apply(null,arguments)},Gu=e.dynCall_jiiiiij=function(){return(Gu=e.dynCall_jiiiiij=e.asm.Wh).apply(null,arguments)},Ku=e.dynCall_iiiiijij=function(){return(Ku=e.dynCall_iiiiijij=e.asm.Xh).apply(null,arguments)},Ju=e.dynCall_jiiiiiii=function(){return(Ju=e.dynCall_jiiiiiii=e.asm.Yh).apply(null,arguments)},qu=e.dynCall_jijj=function(){return(qu=e.dynCall_jijj=e.asm.Zh).apply(null,arguments)},Zu=e.dynCall_viiiijiiiiiiii=function(){return(Zu=e.dynCall_viiiijiiiiiiii=e.asm._h).apply(null,arguments)},Qu=e.dynCall_ij=function(){return(Qu=e.dynCall_ij=e.asm.$h).apply(null,arguments)},td=e.dynCall_jjj=function(){return(td=e.dynCall_jjj=e.asm.ai).apply(null,arguments)},ed=e.dynCall_vjii=function(){return(ed=e.dynCall_vjii=e.asm.bi).apply(null,arguments)},id=e.dynCall_jjjjjjd=function(){return(id=e.dynCall_jjjjjjd=e.asm.ci).apply(null,arguments)},rd=e.dynCall_viiiiijiiii=function(){return(rd=e.dynCall_viiiiijiiii=e.asm.di).apply(null,arguments)},nd=e.dynCall_vjiiii=function(){return(nd=e.dynCall_vjiiii=e.asm.ei).apply(null,arguments)},sd=e.dynCall_iiijii=function(){return(sd=e.dynCall_iiijii=e.asm.fi).apply(null,arguments)},od=e.dynCall_fiijii=function(){return(od=e.dynCall_fiijii=e.asm.gi).apply(null,arguments)},ad=e.dynCall_diijii=function(){return(ad=e.dynCall_diijii=e.asm.hi).apply(null,arguments)},ld=e.dynCall_iiiiiiijii=function(){return(ld=e.dynCall_iiiiiiijii=e.asm.ii).apply(null,arguments)},cd=e.dynCall_viiiiijiii=function(){return(cd=e.dynCall_viiiiijiii=e.asm.ji).apply(null,arguments)},ud=e.dynCall_jiij=function(){return(ud=e.dynCall_jiij=e.asm.ki).apply(null,arguments)},dd=e.dynCall_iiiijjii=function(){return(dd=e.dynCall_iiiijjii=e.asm.li).apply(null,arguments)},fd=e.dynCall_iiiiijji=function(){return(fd=e.dynCall_iiiiijji=e.asm.mi).apply(null,arguments)},hd=e.dynCall_viiiiji=function(){return(hd=e.dynCall_viiiiji=e.asm.ni).apply(null,arguments)},pd=e.dynCall_viiijjii=function(){return(pd=e.dynCall_viiijjii=e.asm.oi).apply(null,arguments)},yd=e.dynCall_viiiijji=function(){return(yd=e.dynCall_viiiijji=e.asm.pi).apply(null,arguments)},_d=e.dynCall_viiiijjii=function(){return(_d=e.dynCall_viiiijjii=e.asm.qi).apply(null,arguments)},md=e.dynCall_viiiiijji=function(){return(md=e.dynCall_viiiiijji=e.asm.ri).apply(null,arguments)},bd=e.dynCall_iidj=function(){return(bd=e.dynCall_iidj=e.asm.si).apply(null,arguments)},vd=e.dynCall_ijji=function(){return(vd=e.dynCall_ijji=e.asm.ti).apply(null,arguments)},gd=e.dynCall_iiiiiiiij=function(){return(gd=e.dynCall_iiiiiiiij=e.asm.ui).apply(null,arguments)},wd=e.dynCall_iiiiiiij=function(){return(wd=e.dynCall_iiiiiiij=e.asm.vi).apply(null,arguments)},jd=e.dynCall_iiiiiiiiiiiij=function(){return(jd=e.dynCall_iiiiiiiiiiiij=e.asm.wi).apply(null,arguments)},Sd=e.dynCall_iiiiiiiji=function(){return(Sd=e.dynCall_iiiiiiiji=e.asm.xi).apply(null,arguments)},Id=e.dynCall_iiiidjj=function(){return(Id=e.dynCall_iiiidjj=e.asm.yi).apply(null,arguments)},Ad=e.dynCall_iiiijjj=function(){return(Ad=e.dynCall_iiiijjj=e.asm.zi).apply(null,arguments)},xd=e.dynCall_jiiiiiijii=function(){return(xd=e.dynCall_jiiiiiijii=e.asm.Ai).apply(null,arguments)},Fd=e.dynCall_iiiijji=function(){return(Fd=e.dynCall_iiiijji=e.asm.Bi).apply(null,arguments)},Cd=e.dynCall_jiiiiii=function(){return(Cd=e.dynCall_jiiiiii=e.asm.Ci).apply(null,arguments)},Bd=e.dynCall_jiiiijii=function(){return(Bd=e.dynCall_jiiiijii=e.asm.Di).apply(null,arguments)},Td=e.dynCall_jiiijiii=function(){return(Td=e.dynCall_jiiijiii=e.asm.Ei).apply(null,arguments)},Dd=e.dynCall_jiiiiijiiii=function(){return(Dd=e.dynCall_jiiiiijiiii=e.asm.Fi).apply(null,arguments)},Ed=e.dynCall_iijiji=function(){return(Ed=e.dynCall_iijiji=e.asm.Gi).apply(null,arguments)},kd=e.dynCall_vjiiiji=function(){return(kd=e.dynCall_vjiiiji=e.asm.Hi).apply(null,arguments)},Od=e.dynCall_jjjii=function(){return(Od=e.dynCall_jjjii=e.asm.Ii).apply(null,arguments)},Md=e.dynCall_jji=function(){return(Md=e.dynCall_jji=e.asm.Ji).apply(null,arguments)},Rd=e.dynCall_viiijijiji=function(){return(Rd=e.dynCall_viiijijiji=e.asm.Ki).apply(null,arguments)},Ud=e.dynCall_iiijjj=function(){return(Ud=e.dynCall_iiijjj=e.asm.Li).apply(null,arguments)},Nd=e.dynCall_jiiijj=function(){return(Nd=e.dynCall_jiiijj=e.asm.Mi).apply(null,arguments)},Ld=e.dynCall_iiiijii=function(){return(Ld=e.dynCall_iiiijii=e.asm.Ni).apply(null,arguments)},Pd=e.dynCall_iijiii=function(){return(Pd=e.dynCall_iijiii=e.asm.Oi).apply(null,arguments)},Vd=e.dynCall_jiiiiji=function(){return(Vd=e.dynCall_jiiiiji=e.asm.Pi).apply(null,arguments)},Hd=e.dynCall_vijiijj=function(){return(Hd=e.dynCall_vijiijj=e.asm.Qi).apply(null,arguments)},zd=e.dynCall_vifiijj=function(){return(zd=e.dynCall_vifiijj=e.asm.Ri).apply(null,arguments)},Wd=e.dynCall_vidiijj=function(){return(Wd=e.dynCall_vidiijj=e.asm.Si).apply(null,arguments)},$d=e.dynCall_viiiiij=function(){return($d=e.dynCall_viiiiij=e.asm.Ti).apply(null,arguments)},Yd=e.dynCall_ijjiii=function(){return(Yd=e.dynCall_ijjiii=e.asm.Ui).apply(null,arguments)},Xd=e.dynCall_vijijjji=function(){return(Xd=e.dynCall_vijijjji=e.asm.Vi).apply(null,arguments)},Gd=e.dynCall_viijiijj=function(){return(Gd=e.dynCall_viijiijj=e.asm.Wi).apply(null,arguments)},Kd=e.dynCall_viiiiijjji=function(){return(Kd=e.dynCall_viiiiijjji=e.asm.Xi).apply(null,arguments)},Jd=e.dynCall_iiijiijj=function(){return(Jd=e.dynCall_iiijiijj=e.asm.Yi).apply(null,arguments)},qd=e.dynCall_viiijijjj=function(){return(qd=e.dynCall_viiijijjj=e.asm.Zi).apply(null,arguments)},Zd=e.dynCall_iijiijj=function(){return(Zd=e.dynCall_iijiijj=e.asm._i).apply(null,arguments)},Qd=e.dynCall_viiijjjji=function(){return(Qd=e.dynCall_viiijjjji=e.asm.$i).apply(null,arguments)},tf=e.dynCall_viiiijiii=function(){return(tf=e.dynCall_viiiijiii=e.asm.aj).apply(null,arguments)},ef=e.dynCall_viijiiii=function(){return(ef=e.dynCall_viijiiii=e.asm.bj).apply(null,arguments)},rf=e.dynCall_vijjiiii=function(){return(rf=e.dynCall_vijjiiii=e.asm.cj).apply(null,arguments)},nf=e.dynCall_vijijjiiiii=function(){return(nf=e.dynCall_vijijjiiiii=e.asm.dj).apply(null,arguments)},sf=e.dynCall_vijjiiiii=function(){return(sf=e.dynCall_vijjiiiii=e.asm.ej).apply(null,arguments)},of=e.dynCall_iiijjji=function(){return(of=e.dynCall_iiijjji=e.asm.fj).apply(null,arguments)},af=e.dynCall_iiiiiijji=function(){return(af=e.dynCall_iiiiiijji=e.asm.gj).apply(null,arguments)},lf=e.dynCall_iiiiijjj=function(){return(lf=e.dynCall_iiiiijjj=e.asm.hj).apply(null,arguments)},cf=e.dynCall_jijiiii=function(){return(cf=e.dynCall_jijiiii=e.asm.ij).apply(null,arguments)},uf=e.dynCall_viiijiji=function(){return(uf=e.dynCall_viiijiji=e.asm.jj).apply(null,arguments)},df=e.dynCall_iiijjjii=function(){return(df=e.dynCall_iiijjjii=e.asm.kj).apply(null,arguments)},ff=e.dynCall_iiiiijjji=function(){return(ff=e.dynCall_iiiiijjji=e.asm.lj).apply(null,arguments)},hf=e.dynCall_viijiji=function(){return(hf=e.dynCall_viijiji=e.asm.mj).apply(null,arguments)};function vm(s){var a=j();try{R(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function gm(s,a,l){var u=j();try{R(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function wm(s,a){var l=j();try{return R(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function jm(s,a,l){var u=j();try{return R(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Sm(s,a){var l=j();try{R(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Im(s,a,l,u){var d=j();try{return R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Am(s,a,l,u,d,f){var p=j();try{return R(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function xm(s,a,l,u,d){var f=j();try{R(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Fm(s,a,l,u,d){var f=j();try{return R(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Cm(s,a,l,u){var d=j();try{return R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Bm(s,a,l,u){var d=j();try{return R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Tm(s,a,l,u){var d=j();try{R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Dm(s,a,l,u){var d=j();try{R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Em(s,a,l,u){var d=j();try{R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function km(s,a,l,u,d,f,p,y){var _=j();try{return R(s)(a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Om(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return R(s)(a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Mm(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{return R(s)(a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function Rm(s){var a=j();try{return R(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Um(s,a,l,u,d,f,p,y){var _=j();try{R(s)(a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Nm(s,a,l,u,d,f,p){var y=j();try{return R(s)(a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Lm(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{return R(s)(a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function Pm(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{R(s)(a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Vm(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q){var ut=j();try{R(s)(a,l,u,d,f,p,y,_,b,v,I,F,D,E,q)}catch(It){if(S(ut),It!==It+0)throw It;w(1,0)}}function Hm(s,a,l,u,d,f,p){var y=j();try{R(s)(a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function zm(s,a,l,u,d,f){var p=j();try{return R(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Wm(s,a,l,u,d,f,p,y,_){var b=j();try{R(s)(a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function $m(s,a,l,u,d,f){var p=j();try{R(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Ym(s,a,l){var u=j();try{return R(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Xm(s,a,l){var u=j();try{return R(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Gm(s,a,l,u,d,f,p,y,_,b){var v=j();try{return R(s)(a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Km(s,a,l,u,d,f,p,y,_){var b=j();try{return R(s)(a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Jm(s,a,l,u,d){var f=j();try{return R(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function qm(s,a,l,u,d){var f=j();try{return R(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Zm(s,a,l,u,d,f){var p=j();try{R(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Qm(s,a,l){var u=j();try{R(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function tb(s,a,l){var u=j();try{R(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function eb(s,a){var l=j();try{return R(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function ib(s,a,l,u){var d=j();try{return R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function rb(s,a){var l=j();try{return R(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function nb(s,a,l,u,d,f,p,y,_,b){var v=j();try{R(s)(a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function sb(s,a,l,u){var d=j();try{R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function ob(s,a,l,u){var d=j();try{R(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function ab(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q){var ut=j();try{return R(s)(a,l,u,d,f,p,y,_,b,v,I,F,D,E,q)}catch(It){if(S(ut),It!==It+0)throw It;w(1,0)}}function lb(s,a){var l=j();try{return R(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function cb(s,a,l,u,d,f,p,y,_,b,v,I,F,D){var E=j();try{R(s)(a,l,u,d,f,p,y,_,b,v,I,F,D)}catch(q){if(S(E),q!==q+0)throw q;w(1,0)}}function ub(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut,It,B,N,bt){var Bt=j();try{return R(s)(a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut,It,B,N,bt)}catch(Yi){if(S(Bt),Yi!==Yi+0)throw Yi;w(1,0)}}function db(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut,It,B,N){var bt=j();try{return R(s)(a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut,It,B,N)}catch(Bt){if(S(bt),Bt!==Bt+0)throw Bt;w(1,0)}}function fb(s,a,l){var u=j();try{return R(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function hb(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{R(s)(a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function pb(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E){var q=j();try{return R(s)(a,l,u,d,f,p,y,_,b,v,I,F,D,E)}catch(ut){if(S(q),ut!==ut+0)throw ut;w(1,0)}}function yb(s,a,l,u,d,f,p,y,_,b){var v=j();try{R(s)(a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function _b(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{R(s)(a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function mb(s){var a=j();try{return R(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function bb(s){var a=j();try{return R(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function vb(s,a,l,u,d){var f=j();try{return Wl(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function gb(s,a,l,u,d,f,p){var y=j();try{Ql(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function wb(s,a){var l=j();try{return Kl(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function jb(s,a,l){var u=j();try{return pc(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Sb(s,a,l,u,d,f,p){var y=j();try{Xl(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ib(s,a,l,u,d,f,p){var y=j();try{return $l(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ab(s,a,l,u,d,f,p,y,_){var b=j();try{return Yl(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function xb(s,a,l,u){var d=j();try{return Jl(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Fb(s,a,l,u,d,f){var p=j();try{ec(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Cb(s,a,l,u,d){var f=j();try{ql(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Bb(s){var a=j();try{return Gl(s)}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Tb(s,a,l,u,d,f,p,y){var _=j();try{ic(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Db(s,a,l,u,d,f,p){var y=j();try{return rc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Eb(s,a,l,u,d,f,p,y){var _=j();try{Zl(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function kb(s,a,l,u){var d=j();try{dc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Ob(s,a,l,u,d,f,p){var y=j();try{hc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Mb(s,a,l,u,d,f){var p=j();try{nc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Rb(s,a,l,u,d,f,p,y,_,b){var v=j();try{oc(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Ub(s,a,l,u,d){var f=j();try{return ac(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Nb(s,a,l,u,d,f,p,y,_){var b=j();try{lc(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Lb(s,a,l,u){var d=j();try{return cc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Pb(s,a,l,u,d){var f=j();try{uc(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Vb(s,a,l,u,d,f,p,y){var _=j();try{tc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Hb(s,a,l,u,d,f,p,y,_){var b=j();try{Vu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function zb(s,a,l,u,d,f,p,y){var _=j();try{return ru(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Wb(s,a,l,u,d){var f=j();try{return fc(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function $b(s,a,l,u,d,f,p,y){var _=j();try{return Yd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Yb(s,a,l,u,d,f){var p=j();try{_c(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Xb(s,a,l,u,d,f,p){var y=j();try{yc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Gb(s,a,l){var u=j();try{mc(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Kb(s,a,l,u,d,f){var p=j();try{return bc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Jb(s,a,l,u,d,f,p,y){var _=j();try{return bu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function qb(s,a,l,u,d,f){var p=j();try{return gc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Zb(s,a,l,u,d,f,p,y,_){var b=j();try{return Ec(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Qb(s,a,l,u,d,f){var p=j();try{return Xc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function tv(s,a,l,u,d,f,p,y){var _=j();try{return Kc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ev(s,a,l,u,d,f,p,y){var _=j();try{return vc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function iv(s,a,l,u,d,f,p){var y=j();try{return wc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function rv(s,a,l,u){var d=j();try{return jc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function nv(s,a,l,u,d,f,p){var y=j();try{kc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function sv(s,a,l,u,d,f,p,y){var _=j();try{Nc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ov(s,a,l,u,d,f,p,y){var _=j();try{return Bc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function av(s,a,l,u,d,f,p,y,_){var b=j();try{return Tc(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function lv(s,a,l,u,d,f,p,y){var _=j();try{Dc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function cv(s,a,l,u,d,f,p,y){var _=j();try{return Oc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function uv(s,a,l,u,d,f,p,y,_){var b=j();try{return Mc(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function dv(s,a,l,u,d,f,p,y,_,b){var v=j();try{return Rc(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function fv(s,a,l,u,d,f,p){var y=j();try{return Uc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function hv(s,a,l,u,d,f,p,y,_){var b=j();try{Cc(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function pv(s,a,l,u,d,f,p,y){var _=j();try{Fc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function yv(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return Ic(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function _v(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{Ac(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function mv(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{xc(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function bv(s,a,l,u,d,f,p,y){var _=j();try{return Lc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function vv(s,a,l,u,d,f){var p=j();try{return Pc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function gv(s,a,l,u,d,f,p){var y=j();try{Qc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function wv(s,a,l,u,d,f,p,y,_){var b=j();try{_u(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function jv(s,a,l,u,d,f,p,y,_){var b=j();try{return Hc(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Sv(s,a,l,u,d,f,p,y,_){var b=j();try{yu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Iv(s,a,l,u){var d=j();try{return Sc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Av(s,a,l,u,d,f){var p=j();try{return zc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function xv(s,a,l,u,d,f,p,y,_){var b=j();try{Zc(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Fv(s,a,l,u,d,f){var p=j();try{return Wc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Cv(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{qc(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Bv(s,a,l,u,d,f){var p=j();try{return du(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Tv(s,a,l,u,d,f,p,y,_,b){var v=j();try{Yc(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Dv(s,a,l,u,d,f,p){var y=j();try{return eu(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ev(s,a,l,u,d,f,p){var y=j();try{Vc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function kv(s,a,l,u,d,f,p,y,_){var b=j();try{tu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Ov(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E){var q=j();try{return $c(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E)}catch(ut){if(S(q),ut!==ut+0)throw ut;w(1,0)}}function Mv(s,a,l,u,d,f,p,y,_){var b=j();try{return Gc(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Rv(s,a,l,u,d,f,p,y){var _=j();try{sc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Uv(s,a,l,u,d,f){var p=j();try{Jc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Nv(s,a,l,u,d,f,p,y,_){var b=j();try{iu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Lv(s,a,l,u,d,f,p){var y=j();try{return ou(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Pv(s,a,l,u,d,f,p,y,_,b){var v=j();try{lu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Vv(s,a,l,u,d,f,p,y,_,b){var v=j();try{cu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Hv(s,a,l,u,d,f,p){var y=j();try{return au(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function zv(s,a,l,u,d,f,p,y,_,b){var v=j();try{uu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Wv(s,a,l,u,d,f,p,y,_){var b=j();try{return su(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function $v(s,a,l,u,d,f,p,y,_){var b=j();try{hu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Yv(s,a,l,u,d,f,p,y,_){var b=j();try{nu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Xv(s,a,l,u,d,f,p,y,_){var b=j();try{return mu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Gv(s,a,l,u,d,f,p,y,_){var b=j();try{vu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Kv(s,a,l,u,d,f,p){var y=j();try{gu(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Jv(s,a,l,u,d,f,p,y,_,b){var v=j();try{wu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function qv(s,a,l,u,d,f,p){var y=j();try{return ju(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Zv(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{Au(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Qv(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{xu(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function tg(s,a,l,u,d,f,p,y,_,b){var v=j();try{Fu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function eg(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{Bu(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function ig(s,a,l,u,d,f,p,y){var _=j();try{return Iu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function rg(s,a,l,u,d,f,p,y){var _=j();try{return Su(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ng(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{Tu(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function sg(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{Du(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function og(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q){var ut=j();try{Eu(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q)}catch(It){if(S(ut),It!==It+0)throw It;w(1,0)}}function ag(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut,It){var B=j();try{ku(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut,It)}catch(N){if(S(B),N!==N+0)throw N;w(1,0)}}function lg(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{Cu(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function cg(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return xd(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function ug(s,a,l,u,d,f,p,y,_){var b=j();try{return Fd(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function dg(s,a,l,u,d,f,p,y){var _=j();try{hd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function fg(s,a,l){var u=j();try{return Ou(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function hg(s,a){var l=j();try{return Mu(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function pg(s,a){var l=j();try{return Ru(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function yg(s,a,l,u,d,f,p){var y=j();try{return Cd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function _g(s,a,l,u,d,f){var p=j();try{return vd(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function mg(s,a,l,u,d,f,p,y,_){var b=j();try{return Lu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function bg(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return Pu(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function vg(s,a,l,u,d,f,p,y,_,b){var v=j();try{pu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function gg(s,a,l,u,d,f,p,y){var _=j();try{return Uu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function wg(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut){var It=j();try{Nu(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E,q,ut)}catch(B){if(S(It),B!==B+0)throw B;w(1,0)}}function jg(s,a,l,u,d,f,p,y,_){var b=j();try{Hu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Sg(s,a,l,u,d,f,p,y,_,b){var v=j();try{return gd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Ig(s,a,l,u,d,f,p,y,_,b){var v=j();try{zu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Ag(s,a,l,u,d,f,p,y){var _=j();try{return Wu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function xg(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{return $u(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function Fg(s,a,l,u,d,f,p,y,_,b){var v=j();try{return Yu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Cg(s,a,l,u,d,f,p,y,_,b){var v=j();try{Xu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Bg(s,a,l,u,d,f,p,y){var _=j();try{return Gu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Tg(s,a,l,u,d,f,p,y,_,b){var v=j();try{return Ku(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Dg(s,a,l,u,d,f,p,y){var _=j();try{return Ju(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Eg(s,a,l,u,d,f,p,y,_){var b=j();try{return wd(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function kg(s,a,l,u,d,f,p,y,_,b,v,I,F,D){var E=j();try{return jd(s,a,l,u,d,f,p,y,_,b,v,I,F,D)}catch(q){if(S(E),q!==q+0)throw q;w(1,0)}}function Og(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{cd(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Mg(s,a,l,u,d){var f=j();try{return ud(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Rg(s,a,l){var u=j();try{return Qu(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Ug(s,a,l,u,d,f,p){var y=j();try{nd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ng(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E){var q=j();try{Zu(s,a,l,u,d,f,p,y,_,b,v,I,F,D,E)}catch(ut){if(S(q),ut!==ut+0)throw ut;w(1,0)}}function Lg(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{rd(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function Pg(s,a,l,u,d){var f=j();try{return td(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Vg(s,a,l,u,d){var f=j();try{ed(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Hg(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{return id(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function zg(s,a,l,u,d,f,p){var y=j();try{return sd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Wg(s,a,l,u,d,f,p){var y=j();try{return od(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function $g(s,a,l,u,d,f,p){var y=j();try{return ad(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Yg(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return ld(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Xg(s,a,l,u,d,f,p,y,_,b){var v=j();try{return dd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Gg(s,a,l,u,d,f,p,y,_,b){var v=j();try{return fd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Kg(s,a,l,u,d,f,p,y,_,b){var v=j();try{pd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Jg(s,a,l,u,d,f,p,y,_,b){var v=j();try{yd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function qg(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{_d(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Zg(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{md(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function Qg(s,a,l,u,d){var f=j();try{return bd(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function t0(s,a,l,u,d,f,p,y,_,b){var v=j();try{return Sd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function e0(s,a,l,u,d,f,p,y,_){var b=j();try{return Id(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function i0(s,a,l,u,d,f,p,y,_,b){var v=j();try{return Ad(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function r0(s,a,l,u,d,f,p,y,_){var b=j();try{return Bd(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function n0(s,a,l,u,d,f,p,y,_){var b=j();try{return Td(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function s0(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{return Dd(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function o0(s,a,l,u,d,f,p,y){var _=j();try{return Ed(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function a0(s,a,l,u,d,f,p,y,_){var b=j();try{kd(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function l0(s,a,l,u,d,f,p){var y=j();try{return Od(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function c0(s,a,l,u){var d=j();try{return Md(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function u0(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{Rd(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function d0(s,a,l,u,d,f,p,y,_){var b=j();try{fu(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function f0(s,a,l,u,d,f,p,y,_){var b=j();try{return Ud(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function h0(s,a,l,u,d,f,p,y){var _=j();try{return Nd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function p0(s,a,l,u,d,f,p,y){var _=j();try{return Ld(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function y0(s,a,l,u,d,f,p){var y=j();try{return Pd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function _0(s,a,l,u,d,f,p,y){var _=j();try{return Vd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function m0(s,a,l,u,d,f,p,y,_,b){var v=j();try{Hd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function b0(s,a,l,u,d,f,p,y,_){var b=j();try{zd(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function v0(s,a,l,u,d,f,p,y,_){var b=j();try{Wd(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function g0(s,a,l,u,d,f,p,y){var _=j();try{$d(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function w0(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{Xd(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}function j0(s,a,l,u,d,f){var p=j();try{return qu(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function S0(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return Jd(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function I0(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{Gd(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function A0(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{Kd(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function x0(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{qd(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function F0(s,a,l,u,d,f,p,y,_,b){var v=j();try{return Zd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function C0(s,a,l,u,d,f,p,y,_,b){var v=j();try{return of(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function B0(s,a,l,u,d,f,p,y,_,b,v,I,F){var D=j();try{Qd(s,a,l,u,d,f,p,y,_,b,v,I,F)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function T0(s,a,l,u,d,f,p,y,_,b){var v=j();try{tf(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function D0(s,a,l,u,d,f,p,y,_){var b=j();try{ef(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function E0(s,a,l,u,d,f,p,y,_){var b=j();try{hf(s,a,l,u,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function k0(s,a,l,u,d,f,p,y,_,b,v,I,F,D){var E=j();try{nf(s,a,l,u,d,f,p,y,_,b,v,I,F,D)}catch(q){if(S(E),q!==q+0)throw q;w(1,0)}}function O0(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{sf(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function M0(s,a,l,u,d,f,p,y,_,b){var v=j();try{rf(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function R0(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return af(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function U0(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return df(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function N0(s,a,l,u,d,f,p,y,_,b){var v=j();try{uf(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function L0(s,a,l,u,d,f,p,y){var _=j();try{return cf(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function P0(s,a,l,u,d,f,p,y,_,b,v){var I=j();try{return lf(s,a,l,u,d,f,p,y,_,b,v)}catch(F){if(S(I),F!==F+0)throw F;w(1,0)}}function V0(s,a,l,u,d,f,p,y,_,b,v,I){var F=j();try{return ff(s,a,l,u,d,f,p,y,_,b,v,I)}catch(D){if(S(F),D!==D+0)throw D;w(1,0)}}e.ccall=Up;var bs;function vs(s){this.name="ExitStatus",this.message="Program terminated with exit("+s+")",this.status=s}var H0=!1;fn=function s(){bs||ha(),bs||(fn=s)};function z0(s){var a=e._main,l=0,u=0;try{var d=a(l,u);return W0(d,!0),d}catch(f){return ry(f)}finally{H0=!0}}function ha(s){if(s=s||c,pr>0||($p(),pr>0))return;function a(){bs||(bs=!0,e.calledRun=!0,!zt&&(Yp(),Xp(),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),pf&&z0(s),Gp()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),a()},1)):a()}e.run=ha;function W0(s,a){pt=s,$0(s)}function $0(s){pt=s,Bl()||(e.onExit&&e.onExit(s),zt=!0),m(s,new vs(s))}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();var pf=!0;return e.noInitialRun&&(pf=!1),ha(),t.ready}})(),Cp=US;var Jo=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=Ut.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Ot(r)}send(t){let e=this._bindings.sendQuery(this._conn,t),r=new qo(this._bindings,this._conn,e),n=Ut.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}getTableNames(t){return this._bindings.getTableNames(this._conn,t)}prepare(t){let e=this._bindings.createPrepared(this._conn,t);return new hl(this._bindings,this._conn,e)}createScalarFunction(t,e,r){this._bindings.createScalarFunction(this._conn,t,e,r)}insertArrowTable(t,e){let r=new Si;r.writeAll(t);let n=r.toUint8Array(!0);this.insertArrowFromIPCStream(n,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)}},qo=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=this.bindings.fetchQueryResults(this.conn);return this._depleted=t.length==0,{done:this._depleted,value:t}}[Symbol.iterator](){return this}},hl=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=Ut.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Ot(r)}send(...t){let e=this.bindings.sendPrepared(this.connectionId,this.statementId,t),r=new qo(this.bindings,this.connectionId,e),n=Ut.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};var Dp=new TextEncoder,Bp=new TextDecoder("utf-8");function pl(i,t,e){let r=Dp.encode(e),n=i._malloc(r.byteLength),o=i.HEAPU8.subarray(n,n+r.byteLength);o.set(r),i.HEAPF64[(t>>3)+0]=1,i.HEAPF64[(t>>3)+1]=n,i.HEAPF64[(t>>3)+2]=o.byteLength}function _l(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 yl(i,t,e,r){let n=i.HEAPU8.subarray(t,t+r*_l(e));switch(e){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function Tp(i,t,e){let r=i.HEAPU8.subarray(t,t+e);return new Uint8Array(r.buffer,r.byteOffset,e)}function Zo(i,t,e){let r=i.HEAPU8.subarray(t,t+e*8);return new Float64Array(r.buffer,r.byteOffset,e)}function Ep(i,t,e,r,n,o,c,h){try{let m=i._udfFunctions.get(r);if(!m){pl(t,e,"Unknown UDF with id: "+r);return}let g=Bp.decode(t.HEAPU8.subarray(n,n+o)),x=JSON.parse(g),T=Zo(t,c,h/8),C=P=>{var qt;let le=null;switch(P.validityBuffer!==void 0&&(le=Tp(t,T[P.validityBuffer],x.rows)),P.physicalType){case"VARCHAR":{if(P.dataBuffer===null||P.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(P.lengthBuffer===null||P.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let pe=yl(t,T[P.dataBuffer],P.physicalType,x.rows),Ht=[],zt=Zo(t,T[P.lengthBuffer],x.rows);for(let pt=0;pt<x.rows;++pt){if(le!=null&&!le[pt]){Ht.push(null);continue}let ye=t.HEAPU8.subarray(pe[pt],pe[pt]+zt[pt]),kr=Bp.decode(ye);Ht.push(kr)}return pt=>Ht[pt]}case"STRUCT<?>":{let pe={},Ht=[];for(let zt=0;zt<(((qt=P.children)==null?void 0:qt.length)||0);++zt){let pt=P.children[zt],ye=C(pt);Ht.push(kr=>{pe[pt.name]=ye(kr)})}return le!=null?zt=>{if(!le[zt])return null;for(let pt of Ht)pt(zt);return pe}:zt=>{for(let pt of Ht)pt(zt);return pe}}default:{if(P.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+P.physicalType);let pe=yl(t,T[P.dataBuffer],P.physicalType,x.rows);return le!=null?Ht=>le[Ht]?pe[Ht]:null:Ht=>pe[Ht]}}},k=[];for(let P=0;P<x.args.length;++P)k.push(C(x.args[P]));let lt=x.rows*_l(x.ret.physicalType),ct=t._malloc(lt),mt=yl(t,ct,x.ret.physicalType,x.rows),kt=t._malloc(x.rows),ae=Tp(t,kt,x.rows);if(mt.length==0||ae.length==0){pl(t,e,"Can't create physical arrays for result");return}let he=mt;x.ret.physicalType=="VARCHAR"&&(he=new Array(x.rows));let Wi=[];for(let P=0;P<x.args.length;++P)Wi.push(null);for(let P=0;P<x.rows;++P){for(let qt=0;qt<x.args.length;++qt)Wi[qt]=k[qt](P);let le=m.func(...Wi);he[P]=le,ae[P]=le==null?0:1}let hr=0;switch(x.ret.physicalType){case"VARCHAR":{let P=new Array(0);hr=t._malloc(x.rows*_l("DOUBLE"));let le=Zo(t,hr,x.rows),qt=0;for(let pt=0;pt<x.rows;++pt){let ye=Dp.encode(he[pt]||"");P.push(ye),le[pt]=ye.length,qt+=ye.length}let pe=t._malloc(qt),Ht=t.HEAPU8.subarray(pe,pe+qt),zt=0;for(let pt=0;pt<x.rows;++pt){mt[pt]=zt;let ye=P[pt];Ht.subarray(zt,zt+ye.length).set(ye),zt+=ye.length}}}let ra=3*8,Oe=t._malloc(ra),Er=Zo(t,Oe,3);Er[0]=ct,Er[1]=kt,Er[2]=hr,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=Oe,t.HEAPF64[(e>>3)+2]=0}catch(m){pl(t,e,m.toString())}}function LS(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}var PS=LS();function Ii(i,t){i.ccall("duckdb_web_fail_with",null,["string"],[t])}function un(i,t,e){let r=i.HEAPU8.subarray(t,t+e),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function it(i,t,e){return PS(i.HEAPU8.subarray(t,t+e))}function yt(i,t,e,r){let n=i.stackSave(),o=i.stackAlloc(3*8);e.unshift("number"),r.unshift(o),i.ccall(t,null,e,r);let c=i.HEAPF64[(o>>3)+0],h=i.HEAPF64[(o>>3)+1],m=i.HEAPF64[(o>>3)+2];return i.stackRestore(n),[c,h,m]}function Ct(i){i.ccall("duckdb_web_clear_response",null,[],[])}var Qo=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 VS=new TextEncoder;var ta=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),this)}open(t){let[e,r,n]=yt(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(it(this.mod,r,n));Ct(this.mod)}reset(){let[t,e,r]=yt(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(it(this.mod,e,r));Ct(this.mod)}getVersion(){let[t,e,r]=yt(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(it(this.mod,e,r));let n=it(this.mod,e,r);return Ct(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let[e,r,n]=yt(this.mod,"duckdb_web_tokenize",["string"],[t]);if(e!==0)throw new Error(it(this.mod,r,n));let o=it(this.mod,r,n);return Ct(this.mod),JSON.parse(o)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Jo(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,n,o]=yt(this.mod,"duckdb_web_query_run",["number","string"],[t,e]);if(r!==0)throw new Error(it(this.mod,n,o));let c=un(this.mod,n,o);return Ct(this.mod),c}sendQuery(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_query_send",["number","string"],[t,e]);if(r!==0)throw new Error(it(this.mod,n,o));let c=un(this.mod,n,o);return Ct(this.mod),c}fetchQueryResults(t){let[e,r,n]=yt(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(e!==0)throw new Error(it(this.mod,r,n));let o=un(this.mod,r,n);return Ct(this.mod),o}getTableNames(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_get_tablenames",["number","string"],[t,e]);if(r!==0)throw new Error(it(this.mod,n,o));let c=it(this.mod,n,o);return Ct(this.mod),JSON.parse(c)}createScalarFunction(t,e,r,n){let o={functionId:this._nextUDFId,name:e,returnType:cn(r)},c={functionId:o.functionId,connectionId:t,name:e,returnType:r,func:n};this._nextUDFId+=1;let[h,m,g]=yt(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(o)]);if(h!==0)throw new Error(it(this.mod,m,g));if(Ct(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(c.functionId,c),this.pthread)for(let x of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])x.postMessage({cmd:"registerUDFFunction",udf:c})}createPrepared(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_prepared_create",["number","string"],[t,e]);if(r!==0)throw new Error(it(this.mod,n,o));return Ct(this.mod),n}closePrepared(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(r!==0)throw new Error(it(this.mod,n,o));Ct(this.mod)}runPrepared(t,e,r){let[n,o,c]=yt(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(it(this.mod,o,c));let h=un(this.mod,o,c);return Ct(this.mod),h}sendPrepared(t,e,r){let[n,o,c]=yt(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(it(this.mod,o,c));let h=un(this.mod,o,c);return Ct(this.mod),h}insertArrowFromIPCStream(t,e,r){if(e.length==0)return;let n=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(n,n+e.length).set(e);let c=r?JSON.stringify(r):"",[h,m,g]=yt(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,n,e.length,c]);if(h!==0)throw new Error(it(this.mod,m,g))}insertCSVFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let g in r.columns)r.columnsFlat.push(Go(g,r.columns[g]))}let n=Xi({},r);n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[c,h,m]=yt(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,o]);if(c!==0)throw new Error(it(this.mod,h,m))}insertJSONFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let g in r.columns)r.columnsFlat.push(Go(g,r.columns[g]))}let n=Xi({},r);n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[c,h,m]=yt(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,o]);if(c!==0)throw new Error(it(this.mod,h,m))}globFiles(t){let[e,r,n]=yt(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(it(this.mod,r,n));let o=it(this.mod,r,n);Ct(this.mod);let c=JSON.parse(o);return c==null?[]:c}registerFileURL(t,e){e===void 0&&(e=t);let[r,n,o]=yt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,e,-1]);if(r!==0)throw new Error(it(this.mod,n,o));Ct(this.mod)}registerFileText(t,e){let r=VS.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[o,c,h]=yt(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,r,e.length]);if(o!==0)throw new Error(it(this.mod,c,h));Ct(this.mod)}registerFileHandle(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,t,-1]);if(r!==0)throw new Error(it(this.mod,n,o));if(Ct(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),this.pthread){for(let c of this.pthread.runningWorkers)c.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e});for(let c of this.pthread.unusedWorkers)c.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,r,n]=yt(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(it(this.mod,r,n));Ct(this.mod)}dropFiles(){let[t,e,r]=yt(this.mod,"duckdb_web_fs_drop_files",[],[]);if(t!==0)throw new Error(it(this.mod,e,r));Ct(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(r!==0)throw new Error(it(this.mod,n,o));Ct(this.mod)}copyFileToBuffer(t){let[e,r,n]=yt(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(it(this.mod,r,n));let o=this.mod.HEAPU8.subarray(r,r+n),c=new Uint8Array(o.length);return c.set(o),Ct(this.mod),c}collectFileStatistics(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(r!==0)throw new Error(it(this.mod,n,o))}exportFileStatistics(t){let[e,r,n]=yt(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(it(this.mod,r,n));return new Qo(this.mod.HEAPU8.subarray(r,r+n))}};var ea=class extends ta{constructor(e,r,n,o){super(e,r);this.mainModuleURL=n,this.pthreadWorkerURL=o}locateFile(e,r){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error(`WASM instantiation requested unexpected file: prefix=${r} path=${e}`)}instantiateWasm(e,r){globalThis.DUCKDB_RUNTIME=this._runtime;let n=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"&&ReadableStream.prototype.pipeThrough){let c=(async()=>{var ct;let h=new Request(this.mainModuleURL),m=await fetch(h),g=m.headers.get("content-length"),x=g&&parseInt(g,10)||0,T=new Date,C={startedAt:T,updatedAt:T,bytesTotal:x||0,bytesLoaded:0},k={transform(mt,kt){C.bytesLoaded+=mt.byteLength;let ae=new Date;if(ae.getTime()-C.updatedAt.getTime()<20){C.updatedAt=ae,kt.enqueue(mt);return}for(let he of n)he(C);kt.enqueue(mt)}},lt=new TransformStream(k);return new Response((ct=m.body)==null?void 0:ct.pipeThrough(lt),m)})();WebAssembly.instantiateStreaming(c,e).then(h=>{r(h.instance,h.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let o=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(o),e).then(c=>{r(c.instance,c.module)})}else if(typeof XMLHttpRequest=="function"){let o=new XMLHttpRequest,c=this.mainModuleURL,h=new Date,m={startedAt:h,updatedAt:h,bytesTotal:0,bytesLoaded:0};o.open("GET",c),o.responseType="arraybuffer",o.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())},o.onprogress=g=>{m.bytesTotal=g.total,m.bytesLoaded=g.loaded;let x=new Date;if(x.getTime()-m.updatedAt.getTime()<20){m.updatedAt=x;return}for(let T of n)T(m)},o.onload=()=>{WebAssembly.instantiate(o.response,e).then(g=>{r(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)})},o.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let c=new Request(this.mainModuleURL),m=await(await fetch(c)).arrayBuffer();WebAssembly.instantiate(m,e).then(g=>{r(g.instance,g.module)})})();return[]}};var ia=class extends ea{constructor(t,e,r,n=null){super(t,e,r,n)}instantiateImpl(t){return Cp(mn(Xi({},t),{instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)}))}};var ur=vf(kp()),Op=function(i,t,e){var r;if((r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")){let n=`${i==null?void 0:i.endpoint}`,o=n.indexOf("://")+3;return n.substring(o)}else return i!=null&&i.endpoint?`${e}.${i==null?void 0:i.endpoint}`:`${e}.s3.amazonaws.com`};function HS(i,t,e){var n,o,c,h;let r=Mp(t);return{url:r.path,query:"",host:Op(i,t,r.bucket),region:(n=i==null?void 0:i.region)!=null?n:"",service:"s3",method:e,accessKeyId:(o=i==null?void 0:i.accessKeyId)!=null?o:"",secretAccessKey:(c=i==null?void 0:i.secretAccessKey)!=null?c:"",sessionToken:(h=i==null?void 0:i.sessionToken)!=null?h:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function zS(i,t=!1){let e="0123456789ABCDEF",r="";for(let n=0;n<i.length;n++){let o=i[n];o>="A"&&o<="Z"||o>="a"&&o<="z"||o>="0"&&o<="9"||o=="_"||o=="-"||o=="~"||o=="."?r+=o:o=="/"?t?r+="%2F":r+=o:(r+="%",r+=e[o.charCodeAt(0)>>4],r+=e[o.charCodeAt(0)&15])}return r}function WS(i,t=null){var lt;let e=(lt=t==null?void 0:t.contentHash)!=null?lt:"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 n="";t!=null&&t.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",i.sessionToken&&(n+=";x-amz-security-token");let o=i.method+`
12
- `+zS(i.url)+`
10
+ ]`}concat(...t){let e=this.schema,r=this.data.concat(t.flatMap(({data:n})=>n));return new Et(e,r.map(n=>new bt(e,n)))}slice(t,e){let r=this.schema;[t,e]=vn({length:this.numRows},t,e);let n=so(this.data,this._offsets,t,e);return new Et(r,n.map(o=>new bt(r,o)))}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],n=J({type:r,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new G(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new G([J({type:new de,length:this.numRows})]));let o=r.fields.slice(),c=o[t].clone({type:e.type}),h=this.schema.fields.map((m,v)=>this.getChildAt(v));[o[t],h[t]]=[c,e],[r,n]=Ro(r,h)}return new Et(r,n)}select(t){let e=this.schema.fields.reduce((r,n,o)=>r.set(n.name,o),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(n=>n.selectAt(t));return new Et(e,r)}assign(t){let e=this.schema.fields,[r,n]=t.schema.fields.reduce((h,m,v)=>{let[C,B]=h,F=e.findIndex(k=>k.name===m.name);return~F?B[F]=v:C.push(v),h},[[],[]]),o=this.schema.assign(t.schema),c=[...e.map((h,m)=>[m,n[m]]).map(([h,m])=>m===void 0?this.getChildAt(h):t.getChildAt(m)),...r.map(h=>t.getChildAt(h))].filter(Boolean);return new Et(...Ro(o,c))}};ep=Symbol.toStringTag;Et[ep]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Zi(Sn),i.get=Zi(Ut.getVisitFn(A.Struct)),i.set=oo(ee.getVisitFn(A.Struct)),i.indexOf=ao(gr.getVisitFn(A.Struct)),i.getByteLength=Zi(Ee.getVisitFn(A.Struct)),"Table"))(Et.prototype);var rp,bt=class{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=J({nullCount:0,type:new vt(this.schema.fields),children:this.schema.fields.map(e=>J({type:e.type,nullCount:0}))})]=t,!(this.data instanceof ft))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=ip(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:r,children:n,length:o}=Object.keys(e).reduce((m,v,C)=>(m.children[C]=e[v],m.length=Math.max(m.length,e[v].length),m.fields[C]=Q.new({name:v,type:e[v].type,nullable:!0}),m),{length:0,fields:new Array,children:new Array}),c=new at(r),h=J({type:new vt(r),length:o,children:n,nullCount:0});[this.schema,this.data]=ip(c,h.children,o);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=np(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 Ut.visit(this.data,t)}set(t,e){return ee.visit(this.data,t,e)}indexOf(t,e){return gr.visit(this.data,t,e)}getByteLength(t){return Ee.visit(this.data,t)}[Symbol.iterator](){return Wr.visit(new G([this.data]))}toArray(){return[...this]}concat(...t){return new Et(this.schema,[this,...t])}slice(t,e){let[r]=new G([this.data]).slice(t,e).data;return new bt(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 G([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(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=this.data;if(t>-1&&t<this.numCols){e||(e=new G([J({type:new de,length:this.numRows})]));let o=r.fields.slice(),c=n.children.slice(),h=o[t].clone({type:e.type});[o[t],c[t]]=[h,e.data[0]],r=new at(o,new Map(this.schema.metadata)),n=J({type:new vt(o),children:c})}return new bt(r,n)}select(t){let e=this.schema.select(t),r=new vt(e.fields),n=[];for(let o of t){let c=this.schema.fields.findIndex(h=>h.name===o);~c&&(n[c]=this.data.children[c])}return new bt(e,J({type:r,length:this.numRows,children:n}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(o=>this.data.children[o]).filter(Boolean),n=J({type:new vt(e.fields),length:this.numRows,children:r});return new bt(e,n)}};rp=Symbol.toStringTag;bt[rp]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(bt.prototype);function ip(i,t,e=t.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...i.fields],o=[...t],c=(e+63&-64)>>3;for(let[h,m]of i.fields.entries()){let v=t[h];(!v||v.length!==e)&&(n[h]=m.clone({nullable:!0}),o[h]=(r=v==null?void 0:v._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:J({type:m.type,length:e,nullCount:e,nullBitmap:new Uint8Array(c)}))}return[i.assign(n),J({type:new vt(n),length:e,children:o})]}function np(i,t,e=new Map){for(let r=-1,n=i.length;++r<n;){let c=i[r].type,h=t[r];if(R.isDictionary(c)){if(!e.has(c.id))h.dictionary&&e.set(c.id,h.dictionary);else if(e.get(c.id)!==h.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}c.children&&c.children.length>0&&np(c.children,h.children,e)}return e}var xr=class extends bt{constructor(t){let e=t.fields.map(n=>J({type:n.type})),r=J({type:new vt(t.fields),nullCount:0,children:e});super(t,r)}};var Zn;(function(i){i[i.BUFFER=0]="BUFFER"})(Zn||(Zn={}));var Qn;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(Qn||(Qn={}));var ni=class{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 ni).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new ni).__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):Qn.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Zn.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Qn.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Zn.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return ni.startBodyCompression(t),ni.addCodec(t,e),ni.addMethod(t,r),ni.endBodyCompression(t)}};var Qr=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(r),t.writeInt64(e),t.offset()}};var tn=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(r),t.writeInt64(e),t.offset()}};var oe=class{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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new oe).__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):this.bb.createLong(0,0)}nodes(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new tn).__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 Qr).__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 ni).__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,t.createLong(0,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 We=class{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 We).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new We).__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):this.bb.createLong(0,0)}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new oe).__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,t.createLong(0,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 en;(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"})(en||(en={}));var Mt=class{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 Mt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new Mt).__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):tr.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):en.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):this.bb.createLong(0,0)}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new wt).__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,tr.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,en.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,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,n,o,c){return Mt.startMessage(t),Mt.addVersion(t,e),Mt.addHeaderType(t,r),Mt.addHeader(t,n),Mt.addBodyLength(t,o),Mt.addCustomMetadata(t,c),Mt.endMessage(t)}};var sS=Nt,Za=class extends V{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return _i.startNull(e),_i.endNull(e)}visitInt(t,e){return Yt.startInt(e),Yt.addBitWidth(e,t.bitWidth),Yt.addIsSigned(e,t.isSigned),Yt.endInt(e)}visitFloat(t,e){return we.startFloatingPoint(e),we.addPrecision(e,t.precision),we.endFloatingPoint(e)}visitBinary(t,e){return hi.startBinary(e),hi.endBinary(e)}visitBool(t,e){return pi.startBool(e),pi.endBool(e)}visitUtf8(t,e){return bi.startUtf8(e),bi.endUtf8(e)}visitDecimal(t,e){return Xt.startDecimal(e),Xt.addScale(e,t.scale),Xt.addPrecision(e,t.precision),Xt.addBitWidth(e,t.bitWidth),Xt.endDecimal(e)}visitDate(t,e){return be.startDate(e),be.addUnit(e,t.unit),be.endDate(e)}visitTime(t,e){return re.startTime(e),re.addUnit(e,t.unit),re.addBitWidth(e,t.bitWidth),re.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return ne.startTimestamp(e),ne.addUnit(e,t.unit),r!==void 0&&ne.addTimezone(e,r),ne.endTimestamp(e)}visitInterval(t,e){return je.startInterval(e),je.addUnit(e,t.unit),je.endInterval(e)}visitList(t,e){return yi.startList(e),yi.endList(e)}visitStruct(t,e){return mi.startStruct_(e),mi.endStruct_(e)}visitUnion(t,e){Gt.startTypeIdsVector(e,t.typeIds.length);let r=Gt.createTypeIdsVector(e,t.typeIds);return Gt.startUnion(e),Gt.addMode(e,t.mode),Gt.addTypeIds(e,r),Gt.endUnion(e)}visitDictionary(t,e){let r=this.visit(t.indices,e);return ke.startDictionaryEncoding(e),ke.addId(e,new sS(t.id,0)),ke.addIsOrdered(e,t.isOrdered),r!==void 0&&ke.addIndexType(e,r),ke.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ge.startFixedSizeBinary(e),ge.addByteWidth(e,t.byteWidth),ge.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return ve.startFixedSizeList(e),ve.addListSize(e,t.listSize),ve.endFixedSizeList(e)}visitMap(t,e){return Se.startMap(e),Se.addKeysSorted(e,t.keysSorted),Se.endMap(e)}},Uo=new Za;function lp(i,t=new Map){return new at(oS(i,t),No(i.customMetadata),t)}function Qa(i){return new ie(i.count,up(i.columns),dp(i.columns))}function cp(i){return new Fe(Qa(i.data),i.id,i.isDelta)}function oS(i,t){return(i.fields||[]).filter(Boolean).map(e=>Q.fromJSON(e,t))}function sp(i,t){return(i.children||[]).filter(Boolean).map(e=>Q.fromJSON(e,t))}function up(i){return(i||[]).reduce((t,e)=>[...t,new si(e.count,aS(e.VALIDITY)),...up(e.children)],[])}function dp(i,t=[]){for(let e=-1,r=(i||[]).length;++e<r;){let n=i[e];n.VALIDITY&&t.push(new xe(t.length,n.VALIDITY.length)),n.TYPE&&t.push(new xe(t.length,n.TYPE.length)),n.OFFSET&&t.push(new xe(t.length,n.OFFSET.length)),n.DATA&&t.push(new xe(t.length,n.DATA.length)),t=dp(n.children,t)}return t}function aS(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function fp(i,t){let e,r,n,o,c,h;return!t||!(o=i.dictionary)?(c=ap(i,sp(i,t)),n=new Q(i.name,c,i.nullable,No(i.customMetadata))):t.has(e=o.id)?(r=(r=o.indexType)?op(r):new li,h=new Te(t.get(e),r,e,o.isOrdered),n=new Q(i.name,h,i.nullable,No(i.customMetadata))):(r=(r=o.indexType)?op(r):new li,t.set(e,c=ap(i,sp(i,t))),h=new Te(c,r,e,o.isOrdered),n=new Q(i.name,h,i.nullable,No(i.customMetadata))),n||null}function No(i){return new Map(Object.entries(i||{}))}function op(i){return new Ot(i.isSigned,i.bitWidth)}function ap(i,t){let e=i.type.name;switch(e){case"NONE":return new de;case"null":return new de;case"binary":return new xi;case"utf8":return new Fi;case"bool":return new Bi;case"list":return new qe((t||[])[0]);case"struct":return new vt(t||[]);case"struct_":return new vt(t||[])}switch(e){case"int":{let r=i.type;return new Ot(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=i.type;return new me(It[r.precision])}case"decimal":{let r=i.type;return new Ti(r.scale,r.precision,r.bitWidth)}case"date":{let r=i.type;return new Di(te[r.unit])}case"time":{let r=i.type;return new Je(ot[r.unit],r.bitWidth)}case"timestamp":{let r=i.type;return new Ei(ot[r.unit],r.timezone)}case"interval":{let r=i.type;return new ki(ue[r.unit])}case"union":{let r=i.type;return new Ze(Ft[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=i.type;return new Oi(r.byteWidth)}case"fixedsizelist":{let r=i.type;return new Qe(r.listSize,(t||[])[0])}case"map":{let r=i.type;return new ti((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var Fr=Nt,lS=Ui,cS=fe,Pt=class{constructor(t,e,r,n){this._version=e,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){let r=new Pt(0,Wt.V4,e);return r._createHeader=uS(t,e),r}static decode(t){t=new cS(Y(t));let e=Mt.getRootAsMessage(t),r=e.bodyLength(),n=e.version(),o=e.headerType(),c=new Pt(r,n,o);return c._createHeader=dS(e,o),c}static encode(t){let e=new lS,r=-1;return t.isSchema()?r=at.encode(e,t.header()):t.isRecordBatch()?r=ie.encode(e,t.header()):t.isDictionaryBatch()&&(r=Fe.encode(e,t.header())),Mt.startMessage(e),Mt.addVersion(e,Wt.V4),Mt.addHeader(e,r),Mt.addHeaderType(e,t.headerType),Mt.addBodyLength(e,new Fr(t.bodyLength,0)),Mt.finishMessageBuffer(e,Mt.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof at)return new Pt(0,Wt.V4,ut.Schema,t);if(t instanceof ie)return new Pt(e,Wt.V4,ut.RecordBatch,t);if(t instanceof Fe)return new Pt(e,Wt.V4,ut.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${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===ut.Schema}isRecordBatch(){return this.headerType===ut.RecordBatch}isDictionaryBatch(){return this.headerType===ut.DictionaryBatch}},ie=class{constructor(t,e,r){this._nodes=e,this._buffers=r,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}},Fe=class{constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id=typeof e=="number"?e:e.low}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}},xe=class{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}},si=class{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}};function uS(i,t){return()=>{switch(t){case ut.Schema:return at.fromJSON(i);case ut.RecordBatch:return ie.fromJSON(i);case ut.DictionaryBatch:return Fe.fromJSON(i)}throw new Error(`Unrecognized Message type: { name: ${ut[t]}, type: ${t} }`)}}function dS(i,t){return()=>{switch(t){case ut.Schema:return at.decode(i.header(new Bt));case ut.RecordBatch:return ie.decode(i.header(new oe),i.version());case ut.DictionaryBatch:return Fe.decode(i.header(new We),i.version())}throw new Error(`Unrecognized Message type: { name: ${ut[t]}, type: ${t} }`)}}Q.encode=jS;Q.decode=vS;Q.fromJSON=fp;at.encode=wS;at.decode=fS;at.fromJSON=lp;ie.encode=SS;ie.decode=hS;ie.fromJSON=Qa;Fe.encode=IS;Fe.decode=pS;Fe.fromJSON=cp;si.encode=AS;si.decode=_S;xe.encode=CS;xe.decode=yS;function fS(i,t=new Map){let e=gS(i,t);return new at(e,Lo(i),t)}function hS(i,t=Wt.V4){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new ie(i.length(),mS(i),bS(i,t))}function pS(i,t=Wt.V4){return new Fe(ie.decode(i.data(),t),i.id(),i.isDelta())}function yS(i){return new xe(i.offset(),i.length())}function _S(i){return new si(i.length(),i.nullCount())}function mS(i){let t=[];for(let e,r=-1,n=-1,o=i.nodesLength();++r<o;)(e=i.nodes(r))&&(t[++n]=si.decode(e));return t}function bS(i,t){let e=[];for(let r,n=-1,o=-1,c=i.buffersLength();++n<c;)(r=i.buffers(n))&&(t<Wt.V4&&(r.bb_pos+=8*(n+1)),e[++o]=xe.decode(r));return e}function gS(i,t){let e=[];for(let r,n=-1,o=-1,c=i.fieldsLength();++n<c;)(r=i.fields(n))&&(e[++o]=Q.decode(r,t));return e}function hp(i,t){let e=[];for(let r,n=-1,o=-1,c=i.childrenLength();++n<c;)(r=i.children(n))&&(e[++o]=Q.decode(r,t));return e}function vS(i,t){let e,r,n,o,c,h;return!t||!(h=i.dictionary())?(n=yp(i,hp(i,t)),r=new Q(i.name(),n,i.nullable(),Lo(i))):t.has(e=h.id().low)?(o=(o=h.indexType())?pp(o):new li,c=new Te(t.get(e),o,e,h.isOrdered()),r=new Q(i.name(),c,i.nullable(),Lo(i))):(o=(o=h.indexType())?pp(o):new li,t.set(e,n=yp(i,hp(i,t))),c=new Te(n,o,e,h.isOrdered()),r=new Q(i.name(),c,i.nullable(),Lo(i))),r||null}function Lo(i){let t=new Map;if(i)for(let e,r,n=-1,o=Math.trunc(i.customMetadataLength());++n<o;)(e=i.customMetadata(n))&&(r=e.key())!=null&&t.set(r,e.value());return t}function pp(i){return new Ot(i.isSigned(),i.bitWidth())}function yp(i,t){let e=i.typeType();switch(e){case Ct.NONE:return new de;case Ct.Null:return new de;case Ct.Binary:return new xi;case Ct.Utf8:return new Fi;case Ct.Bool:return new Bi;case Ct.List:return new qe((t||[])[0]);case Ct.Struct_:return new vt(t||[])}switch(e){case Ct.Int:{let r=i.type(new Yt);return new Ot(r.isSigned(),r.bitWidth())}case Ct.FloatingPoint:{let r=i.type(new we);return new me(r.precision())}case Ct.Decimal:{let r=i.type(new Xt);return new Ti(r.scale(),r.precision(),r.bitWidth())}case Ct.Date:{let r=i.type(new be);return new Di(r.unit())}case Ct.Time:{let r=i.type(new re);return new Je(r.unit(),r.bitWidth())}case Ct.Timestamp:{let r=i.type(new ne);return new Ei(r.unit(),r.timezone())}case Ct.Interval:{let r=i.type(new je);return new ki(r.unit())}case Ct.Union:{let r=i.type(new Gt);return new Ze(r.mode(),r.typeIdsArray()||[],t||[])}case Ct.FixedSizeBinary:{let r=i.type(new ge);return new Oi(r.byteWidth())}case Ct.FixedSizeList:{let r=i.type(new ve);return new Qe(r.listSize(),(t||[])[0])}case Ct.Map:{let r=i.type(new Se);return new ti((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${Ct[e]}" (${e})`)}function wS(i,t){let e=t.fields.map(o=>Q.encode(i,o));Bt.startFieldsVector(i,e.length);let r=Bt.createFieldsVector(i,e),n=t.metadata&&t.metadata.size>0?Bt.createCustomMetadataVector(i,[...t.metadata].map(([o,c])=>{let h=i.createString(`${o}`),m=i.createString(`${c}`);return wt.startKeyValue(i),wt.addKey(i,h),wt.addValue(i,m),wt.endKeyValue(i)})):-1;return Bt.startSchema(i),Bt.addFields(i,r),Bt.addEndianness(i,xS?er.Little:er.Big),n!==-1&&Bt.addCustomMetadata(i,n),Bt.endSchema(i)}function jS(i,t){let e=-1,r=-1,n=-1,o=t.type,c=t.typeId;R.isDictionary(o)?(c=o.dictionary.typeId,n=Uo.visit(o,i),r=Uo.visit(o.dictionary,i)):r=Uo.visit(o,i);let h=(o.children||[]).map(C=>Q.encode(i,C)),m=Lt.createChildrenVector(i,h),v=t.metadata&&t.metadata.size>0?Lt.createCustomMetadataVector(i,[...t.metadata].map(([C,B])=>{let F=i.createString(`${C}`),k=i.createString(`${B}`);return wt.startKeyValue(i),wt.addKey(i,F),wt.addValue(i,k),wt.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),Lt.startField(i),Lt.addType(i,r),Lt.addTypeType(i,c),Lt.addChildren(i,m),Lt.addNullable(i,!!t.nullable),e!==-1&&Lt.addName(i,e),n!==-1&&Lt.addDictionary(i,n),v!==-1&&Lt.addCustomMetadata(i,v),Lt.endField(i)}function SS(i,t){let e=t.nodes||[],r=t.buffers||[];oe.startNodesVector(i,e.length);for(let c of e.slice().reverse())si.encode(i,c);let n=i.endVector();oe.startBuffersVector(i,r.length);for(let c of r.slice().reverse())xe.encode(i,c);let o=i.endVector();return oe.startRecordBatch(i),oe.addLength(i,new Fr(t.length,0)),oe.addNodes(i,n),oe.addBuffers(i,o),oe.endRecordBatch(i)}function IS(i,t){let e=ie.encode(i,t.data);return We.startDictionaryBatch(i),We.addId(i,new Fr(t.id,0)),We.addIsDelta(i,t.isDelta),We.addData(i,e),We.endDictionaryBatch(i)}function AS(i,t){return tn.createFieldNode(i,new Fr(t.length,0),new Fr(t.nullCount,0))}function CS(i,t){return Qr.createBuffer(i,new Fr(t.offset,0),new Fr(t.length,0))}var xS=(()=>{let i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})();var el=i=>`Expected ${ut[i]} Message in stream, but was null or length 0.`,il=i=>`Header pointer of flatbuffer-encoded ${ut[i]} Message is null or length 0.`,_p=(i,t)=>`Expected to read ${i} metadata bytes, but only read ${t}.`,mp=(i,t)=>`Expected to read ${i} bytes for message body, but only read ${t}.`,rn=class{constructor(t){this.source=t instanceof vi?t:new vi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?jt:t.value===-1&&(t=this.readMetadataLength()).done?jt:(t=this.readMetadata(t.value)).done?jt: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(el(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=Y(this.source.read(t));if(e.byteLength<t)throw new Error(mp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=ut.Schema,r=this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(il(e));return n}readMetadataLength(){let t=this.source.read(Po),e=t&&new fe(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 jt;if(e.byteLength<t)throw new Error(_p(t,e.byteLength));return{done:!1,value:Pt.decode(e)}}},ts=class{constructor(t,e){this.source=t instanceof Ie?t:As(t)?new rr(t,e):new Ie(t)}[Symbol.asyncIterator](){return this}next(){return O(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?jt:t.value===-1&&(t=yield this.readMetadataLength()).done?jt:(t=yield this.readMetadata(t.value)).done?jt:t})}throw(t){return O(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return O(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return O(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(el(t));return e.value})}readMessageBody(t){return O(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=Y(yield this.source.read(t));if(e.byteLength<t)throw new Error(mp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return O(this,void 0,void 0,function*(){let e=ut.Schema,r=yield this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(il(e));return n})}readMetadataLength(){return O(this,void 0,void 0,function*(){let t=yield this.source.read(Po),e=t&&new fe(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return O(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return jt;if(e.byteLength<t)throw new Error(_p(t,e.byteLength));return{done:!1,value:Pt.decode(e)}})}},es=class extends rn{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Tn?t:new Tn(t)}next(){let{_json:t}=this;if(!this._schema){this._schema=!0;let e=Pt.fromJSON(t.schema,ut.Schema);return{done:!1,value:e}}if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];this._body=e.data.columns;let r=Pt.fromJSON(e,ut.DictionaryBatch);return{done:!1,value:r}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];this._body=e.columns;let r=Pt.fromJSON(e,ut.RecordBatch);return{done:!1,value:r}}return this._body=[],jt}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...e(o.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(el(t));return e.value}readSchema(){let t=ut.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(il(t));return r}},Po=4,tl="ARROW1",nn=new Uint8Array(tl.length);for(let i=0;i<tl.length;i+=1)nn[i]=tl.codePointAt(i);function Vo(i,t=0){for(let e=-1,r=nn.length;++e<r;)if(nn[e]!==i[t+e])return!1;return!0}var sn=nn.length,rl=sn+Po,bp=sn*2+Po;var Rt=class extends wr{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 $e(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 Qt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Qt.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 Rt?t:Ss(t)?BS(t):As(t)?ES(t):$e(t)?(()=>O(this,void 0,void 0,function*(){return yield Rt.from(yield t)}))():Cs(t)||_n(t)||Fs(t)||Le(t)?DS(new Ie(t)):TS(new vi(t))}static readAll(t){return t instanceof Rt?t.isSync()?gp(t):vp(t):Ss(t)||ArrayBuffer.isView(t)||Ye(t)||Is(t)?gp(t):vp(t)}},ji=class extends Rt{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return _e(this,arguments,function*(){yield it(yield*Or(Ne(this[Symbol.iterator]())))})}},nr=class extends Rt{constructor(t){super(t),this._impl=t}readAll(){var t,e;return O(this,void 0,void 0,function*(){let r=new Array;try{for(var n=Ne(this),o;o=yield n.next(),!o.done;){let c=o.value;r.push(c)}}catch(c){t={error:c}}finally{try{o&&!o.done&&(e=n.return)&&(yield e.call(n))}finally{if(t)throw t.error}}return r})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},sr=class extends ji{constructor(t){super(t),this._impl=t}},is=class extends nr{constructor(t){super(t),this._impl=t}},Ho=class{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}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),n=J({type:new vt(this.schema.fields),length:t.length,children:r});return new bt(this.schema,n)}_loadDictionaryBatch(t,e){let{id:r,isDelta:n}=t,{dictionaries:o,schema:c}=this,h=o.get(r);if(n||!h){let m=c.dictionaries.get(r),v=this._loadVectors(t.data,e,[m]);return(h&&n?h.concat(new G(v)):new G(v)).memoize()}return h.memoize()}_loadVectors(t,e,r){return new kn(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}},on=class extends Ho{constructor(t,e){super(e),this._reader=Ss(t)?new es(this._handle=t):new rn(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=wp(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):jt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):jt}next(){if(this.closed)return jt;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(),n=e.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,n);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new xr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},an=class extends Ho{constructor(t,e){super(e),this._reader=new ts(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return O(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 O(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=wp(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):jt})}return(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):jt})}next(){return O(this,void 0,void 0,function*(){if(this.closed)return jt;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(),n=yield e.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,n);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=yield e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new xr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return O(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},zo=class extends on{constructor(t,e){super(t instanceof Dn?t:new Dn(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}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 n=this._reader.readMessage(ut.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),c=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,c)}}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 n=this._reader.readMessage(ut.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),c=this._reader.readMessageBody(n.bodyLength),h=this._loadDictionaryBatch(o,c);this.dictionaries.set(o.id,h)}}}_readFooter(){let{_handle:t}=this,e=t.size-rl,r=t.readInt32(e),n=t.readAt(e-r,r);return Ni.decode(n)}_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}},nl=class extends an{constructor(t,...e){let r=typeof e[0]!="number"?e.shift():void 0,n=e[0]instanceof Map?e.shift():void 0;super(t instanceof rr?t:new rr(t,r),n)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return O(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){var e;return O(this,void 0,void 0,function*(){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 n=yield this._reader.readMessage(ut.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),c=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,c)}}return null})}_readDictionaryBatch(t){var e;return O(this,void 0,void 0,function*(){let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ut.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),c=yield this._reader.readMessageBody(n.bodyLength),h=this._loadDictionaryBatch(o,c);this.dictionaries.set(o.id,h)}}})}_readFooter(){return O(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-rl,r=yield t.readInt32(e),n=yield t.readAt(e-r,r);return Ni.decode(n)})}_readNextMessageAndValidate(t){return O(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})}},sl=class extends on{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new po(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}};function wp(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*gp(i){let t=Rt.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function vp(i){return _e(this,arguments,function*(){let e=yield it(Rt.from(i));try{if(!(yield it(e.open({autoDestroy:!1}))).closed)do yield yield it(e);while(!(yield it(e.reset().open())).closed)}finally{yield it(e.cancel())}})}function BS(i){return new ji(new sl(i))}function TS(i){let t=i.peek(sn+7&-8);return t&&t.byteLength>=4?Vo(t)?new sr(new zo(i.read())):new ji(new on(i)):new ji(new on(function*(){}()))}function DS(i){return O(this,void 0,void 0,function*(){let t=yield i.peek(sn+7&-8);return t&&t.byteLength>=4?Vo(t)?new sr(new zo(yield i.read())):new nr(new an(i)):new nr(new an(function(){return _e(this,arguments,function*(){})}()))})}function ES(i){return O(this,void 0,void 0,function*(){let{size:t}=yield i.stat(),e=new rr(i,t);return t>=bp&&Vo(yield e.readAt(0,sn+7&-8))?new is(new nl(e)):new nr(new an(e))})}var Tt=class extends V{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){let e=n=>n.flatMap(o=>Array.isArray(o)?e(o):o instanceof bt?o.data.children:o.data),r=new Tt;return r.visitMany(e(t)),r}visit(t){if(t instanceof G)return this.visitMany(t.data),this;let{type:e}=t;if(!R.isDictionary(e)){let{length:r,nullCount:n}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");R.isNull(e)||oi.call(this,n<=0?new Uint8Array(0):zr(t.offset,r,t.nullBitmap)),this.nodes.push(new si(r,n))}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 oi(i){let t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new xe(this._byteLength,t)),this._byteLength+=t,this}function kS(i){let{type:t,length:e,typeIds:r,valueOffsets:n}=i;if(oi.call(this,r),t.mode===Ft.Sparse)return ol.call(this,i);if(t.mode===Ft.Dense){if(i.offset<=0)return oi.call(this,n),ol.call(this,i);{let o=r.reduce((C,B)=>Math.max(C,B),r[0]),c=new Int32Array(o+1),h=new Int32Array(o+1).fill(-1),m=new Int32Array(e),v=mn(-n[0],e,n);for(let C,B,F=-1;++F<e;)(B=h[C=r[F]])===-1&&(B=h[C]=v[C]),m[F]=v[F]-B,++c[C];oi.call(this,m);for(let C,B=-1,F=t.children.length;++B<F;)if(C=i.children[B]){let k=t.typeIds[B],lt=Math.min(e,c[k]);this.visit(C.slice(h[k],lt))}}}return this}function OS(i){let t;return i.nullCount>=i.length?oi.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?oi.call(this,zr(i.offset,i.length,t)):oi.call(this,mr(i.values))}function or(i){return oi.call(this,i.values.subarray(0,i.length*i.stride))}function jp(i){let{length:t,values:e,valueOffsets:r}=i,n=r[0],o=r[t],c=Math.min(o-n,e.byteLength-n);return oi.call(this,mn(-r[0],t,r)),oi.call(this,e.subarray(n,n+c)),this}function al(i){let{length:t,valueOffsets:e}=i;return e&&oi.call(this,mn(e[0],t,e)),this.visit(i.children[0])}function ol(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}Tt.prototype.visitBool=OS;Tt.prototype.visitInt=or;Tt.prototype.visitFloat=or;Tt.prototype.visitUtf8=jp;Tt.prototype.visitBinary=jp;Tt.prototype.visitFixedSizeBinary=or;Tt.prototype.visitDate=or;Tt.prototype.visitTimestamp=or;Tt.prototype.visitTime=or;Tt.prototype.visitDecimal=or;Tt.prototype.visitList=al;Tt.prototype.visitStruct=ol;Tt.prototype.visitUnion=kS;Tt.prototype.visitInterval=or;Tt.prototype.visitFixedSizeList=al;Tt.prototype.visitMap=al;var Br=class extends wr{constructor(t){super(),this._position=0,this._started=!1,this._sink=new gi,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,ce(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}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')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return $e(t)?t.then(e=>this.writeAll(e)):Le(t)?cl(this,t):ll(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 gi?this._sink=t:(this._sink=new gi,t&&Yf(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Xf(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!Cr(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 Et&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof bt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Cr(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof bt?t instanceof xr||this._writeRecordBatch(t):t instanceof Et?this.writeAll(t.batches):Ye(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,n=Pt.encode(t),o=n.byteLength,c=this._writeLegacyIpcFormat?4:8,h=o+c+r&~r,m=h-o-c;return t.headerType===ut.RecordBatch?this._recordBatchBlocks.push(new ri(h,t.bodyLength,this._position)):t.headerType===ut.DictionaryBatch&&this._dictionaryBlocks.push(new ri(h,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(h-c)),o>0&&this._write(n),this._writePadding(m)}_write(t){if(this._started){let e=Y(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Pt.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(nn)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:n,buffers:o}=Tt.assemble(t),c=new ie(t.numRows,r,n),h=Pt.from(c,e);return this._writeDictionaries(t)._writeMessage(h)._writeBodyBuffers(o)}_writeDictionaryBatch(t,e,r=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));let{byteLength:n,nodes:o,bufferRegions:c,buffers:h}=Tt.assemble(new G([t])),m=new ie(t.length,o,c),v=new Fe(m,e,r),C=Pt.from(v,n);return this._writeMessage(C)._writeBodyBuffers(h)}_writeBodyBuffers(t){let e,r,n;for(let o=-1,c=t.length;++o<c;)(e=t[o])&&(r=e.byteLength)>0&&(this._write(e),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(t){for(let[e,r]of t.dictionaries){let n=this._dictionaryDeltaOffsets.get(e)||0;if(n===0||(r=r==null?void 0:r.slice(n)).length>0)for(let o of r.data)this._writeDictionaryBatch(o,e,n>0),n+=o.length}return this}},zi=class extends Br{static writeAll(t,e){let r=new zi(e);return $e(t)?t.then(n=>r.writeAll(n)):Le(t)?cl(r,t):ll(r,t)}},Wi=class extends Br{static writeAll(t){let e=new Wi;return $e(t)?t.then(r=>e.writeAll(r)):Le(t)?cl(e,t):ll(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let e=Ni.encode(new Ni(t,Wt.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function ll(i,t){let e=t;t instanceof Et&&(e=t.batches,i.reset(void 0,t.schema));for(let r of e)i.write(r);return i.finish()}function cl(i,t){var e,r,n,o;return O(this,void 0,void 0,function*(){try{for(e=Ne(t);r=yield e.next(),!r.done;){let c=r.value;i.write(c)}}catch(c){n={error:c}}finally{try{r&&!r.done&&(o=e.return)&&(yield o.call(e))}finally{if(n)throw n.error}}return i.finish()})}function Sp(i,t){if(Le(i))return RS(i,t);if(Ye(i))return MS(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function MS(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(c){o(c,e||(e=i[Symbol.iterator]()))},pull(c){e?o(c,e):c.close()},cancel(){((e==null?void 0:e.return)&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:r?n:void 0},t));function o(c,h){let m,v=null,C=c.desiredSize||null;for(;!(v=h.next(r?C:null)).done;)if(ArrayBuffer.isView(v.value)&&(m=Y(v.value))&&(C!=null&&r&&(C=C-m.byteLength+1),v.value=m),c.enqueue(v.value),C!=null&&--C<=0)return;c.close()}}function RS(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(c){return O(this,void 0,void 0,function*(){yield o(c,e||(e=i[Symbol.asyncIterator]()))})},pull(c){return O(this,void 0,void 0,function*(){e?yield o(c,e):c.close()})},cancel(){return O(this,void 0,void 0,function*(){((e==null?void 0:e.return)&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:r?n:void 0},t));function o(c,h){return O(this,void 0,void 0,function*(){let m,v=null,C=c.desiredSize||null;for(;!(v=yield h.next(r?C:null)).done;)if(ArrayBuffer.isView(v.value)&&(m=Y(v.value))&&(C!=null&&r&&(C=C-m.byteLength+1),v.value=m),c.enqueue(v.value),C!=null&&--C<=0)return;c.close()})}}function Cp(i){return new ul(i)}var ul=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=t,o=Wf(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Sr(o),this._getSize=n!=="bytes"?Ip:Ap;let{["highWaterMark"]:c=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:h=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:m=>{this._maybeFlush(this._builder,this._controller=m)},start:m=>{this._maybeFlush(this._builder,this._controller=m)}},{highWaterMark:c,size:n!=="bytes"?Ip:Ap}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:h,size:m=>this._writeValueAndReturnChunkSize(m)})}_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)}},Ip=i=>{var t;return(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0},Ap=i=>{var t;return(t=i==null?void 0:i.byteLength)!==null&&t!==void 0?t:0};function Wo(i,t){let e=new gi,r=null,n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield e.close()})},start(h){return O(this,void 0,void 0,function*(){yield c(h,r||(r=yield o()))})},pull(h){return O(this,void 0,void 0,function*(){r?yield c(h,r):h.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},i)),readable:n};function o(){return O(this,void 0,void 0,function*(){return yield(yield Rt.from(e)).open(t)})}function c(h,m){return O(this,void 0,void 0,function*(){let v=h.desiredSize,C=null;for(;!(C=yield m.next()).done;)if(h.enqueue(C.value),v!=null&&--v<=0)return;h.close()})}}function $o(i,t){let e=new this(i),r=new Ie(e),n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield r.cancel()})},pull(c){return O(this,void 0,void 0,function*(){yield o(c)})},start(c){return O(this,void 0,void 0,function*(){yield o(c)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:n};function o(c){return O(this,void 0,void 0,function*(){let h=null,m=c.desiredSize;for(;h=yield r.read(m||null);)if(c.enqueue(h),m!=null&&(m-=h.byteLength)<=0)return;c.close()})}}function Yo(i,t="stream"){return(t==="stream"?zi:Wi).writeAll(i).toUint8Array(!0)}var PS=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Sa),Xa),La),Ia),ga),Na),{compareSchemas:Cr,compareFields:Qh,compareTypes:tp});Qt.toDOMStream=Sp;At.throughDOM=Cp;Rt.throughDOM=Wo;sr.throughDOM=Wo;ji.throughDOM=Wo;Br.throughDOM=$o;Wi.throughDOM=$o;zi.throughDOM=$o;function ln(i){switch(i.typeId){case A.Binary:return{sqlType:"binary"};case A.Bool:return{sqlType:"bool"};case A.Date:return{sqlType:"date"};case A.DateDay:return{sqlType:"date32[d]"};case A.DateMillisecond:return{sqlType:"date64[ms]"};case A.Decimal:{let t=i;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case A.Float:return{sqlType:"float"};case A.Float16:return{sqlType:"float16"};case A.Float32:return{sqlType:"float32"};case A.Float64:return{sqlType:"float64"};case A.Int:return{sqlType:"int32"};case A.Int16:return{sqlType:"int16"};case A.Int32:return{sqlType:"int32"};case A.Int64:return{sqlType:"int64"};case A.Uint16:return{sqlType:"uint16"};case A.Uint32:return{sqlType:"uint32"};case A.Uint64:return{sqlType:"uint64"};case A.Uint8:return{sqlType:"uint8"};case A.IntervalDayTime:return{sqlType:"interval[dt]"};case A.IntervalYearMonth:return{sqlType:"interval[m]"};case A.List:return{sqlType:"list",valueType:ln(i.valueType)};case A.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:i.byteWidth};case A.Null:return{sqlType:"null"};case A.Utf8:return{sqlType:"utf8"};case A.Struct:return{sqlType:"struct",fields:i.children.map(e=>Xo(e.name,e.type))};case A.Map:{let t=i;return{sqlType:"map",keyType:ln(t.keyType),valueType:ln(t.valueType)}}case A.Time:return{sqlType:"time[s]"};case A.TimeMicrosecond:return{sqlType:"time[us]"};case A.TimeMillisecond:return{sqlType:"time[ms]"};case A.TimeNanosecond:return{sqlType:"time[ns]"};case A.TimeSecond:return{sqlType:"time[s]"};case A.Timestamp:return{sqlType:"timestamp",timezone:i.timezone||void 0};case A.TimestampSecond:return{sqlType:"timestamp[s]",timezone:i.timezone||void 0};case A.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:i.timezone||void 0};case A.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:i.timezone||void 0};case A.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:i.timezone||void 0}}throw new Error(`unsupported arrow type: ${i.toString()}`)}function Xo(i,t){let e=ln(t);return e.name=i,e}var Go=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){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":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(),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,n)=>n)},[]);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]),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);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_CHUNK",data:e},[e.buffer]);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]),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":this._bindings.registerFileHandle(t.data[0],t.data[1]),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"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 this.failWith(t,e)}}};var Bp={},VS=(()=>{var i=Bp.url;return function(t){t=t||{};var e=typeof t<"u"?t:{},r,n;e.ready=new Promise(function(s,a){r=s,n=a});var o=Object.assign({},e),c=[],h="./this.program",m=(s,a)=>{throw a},v=typeof window=="object",C=typeof importScripts=="function",B=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",F="";function k(s){return e.locateFile?e.locateFile(s,F):F+s}var lt,ct,mt,Dt;function ae(s){if(s instanceof ys)return;Oe("exiting due to exception: "+s)}var he,$i,ur;B?(C?F=dl().dirname(F)+"/":F=__dirname+"/",ur=()=>{$i||(he=Fp(),$i=dl())},lt=function(a,l){return ur(),a=$i.normalize(a),he.readFileSync(a,l?void 0:"utf8")},mt=s=>{var a=lt(s,!0);return a.buffer||(a=new Uint8Array(a)),a},ct=(s,a,l)=>{ur(),s=$i.normalize(s),he.readFile(s,function(u,d){u?l(u):a(d.buffer)})},process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),c=process.argv.slice(2),process.on("uncaughtException",function(s){if(!(s instanceof ys))throw s}),process.on("unhandledRejection",function(s){throw s}),m=(s,a)=>{if(Fl())throw process.exitCode=s,a;ae(a),process.exit(s)},e.inspect=function(){return"[Emscripten Module object]"}):(v||C)&&(C?F=self.location.href:typeof document<"u"&&document.currentScript&&(F=document.currentScript.src),i&&(F=i),F.indexOf("blob:")!==0?F=F.substr(0,F.replace(/[?#].*/,"").lastIndexOf("/")+1):F="",lt=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.send(null),a.responseText},C&&(mt=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.responseType="arraybuffer",a.send(null),new Uint8Array(a.response)}),ct=(s,a,l)=>{var u=new XMLHttpRequest;u.open("GET",s,!0),u.responseType="arraybuffer",u.onload=()=>{if(u.status==200||u.status==0&&u.response){a(u.response);return}l()},u.onerror=l,u.send(null)},Dt=s=>document.title=s);var ia=e.print||console.log.bind(console),Oe=e.printErr||console.warn.bind(console);Object.assign(e,o),o=null,e.arguments&&(c=e.arguments),e.thisProgram&&(h=e.thisProgram),e.quit&&(m=e.quit);var Dr=0,L=s=>{Dr=s},le=()=>Dr,Jt;e.wasmBinary&&(Jt=e.wasmBinary);var pe=e.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var Vt,Ht=!1,yt;function ye(s,a){s||Me(a)}function Er(s){var a=e["_"+s];return a}function Lp(s,a,l,u,d){var f={string:function(E){var st=0;if(E!=null&&E!==0){var dt=(E.length<<2)+1;st=da(dt),ra(E,st,dt)}return st},array:function(E){var st=da(E.length);return vl(E,st),st}};function p(E){return a==="string"?Ii(E):a==="boolean"?Boolean(E):E}var y=Er(s),_=[],b=0;if(u)for(var g=0;g<u.length;g++){var I=f[l[g]];I?(b===0&&(b=j()),_[g]=I(u[g])):_[g]=u[g]}var x=y.apply(null,_);function D(E){return b!==0&&S(b),p(E)}return x=D(x),x}var ml=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function bl(s,a,l){a>>>=0;for(var u=a+l,d=a;s[d]&&!(d>=u);)++d;if(d-a>16&&s.buffer&&ml)return ml.decode(s.subarray(a,d));for(var f="";a<d;){var p=s[a++];if(!(p&128)){f+=String.fromCharCode(p);continue}var y=s[a++]&63;if((p&224)==192){f+=String.fromCharCode((p&31)<<6|y);continue}var _=s[a++]&63;if((p&240)==224?p=(p&15)<<12|y<<6|_:p=(p&7)<<18|y<<12|_<<6|s[a++]&63,p<65536)f+=String.fromCharCode(p);else{var b=p-65536;f+=String.fromCharCode(55296|b>>10,56320|b&1023)}}return f}function Ii(s,a){return s>>>=0,s?bl(Yi,s,a):""}function gl(s,a,l,u){if(l>>>=0,!(u>0))return 0;for(var d=l,f=l+u-1,p=0;p<s.length;++p){var y=s.charCodeAt(p);if(y>=55296&&y<=57343){var _=s.charCodeAt(++p);y=65536+((y&1023)<<10)|_&1023}if(y<=127){if(l>=f)break;a[l++>>>0]=y}else if(y<=2047){if(l+1>=f)break;a[l++>>>0]=192|y>>6,a[l++>>>0]=128|y&63}else if(y<=65535){if(l+2>=f)break;a[l++>>>0]=224|y>>12,a[l++>>>0]=128|y>>6&63,a[l++>>>0]=128|y&63}else{if(l+3>=f)break;a[l++>>>0]=240|y>>18,a[l++>>>0]=128|y>>12&63,a[l++>>>0]=128|y>>6&63,a[l++>>>0]=128|y&63}}return a[l>>>0]=0,l-d}function ra(s,a,l){return gl(s,Yi,a,l)}function Pp(s){for(var a=0,l=0;l<s.length;++l){var u=s.charCodeAt(l);u>=55296&&u<=57343&&(u=65536+((u&1023)<<10)|s.charCodeAt(++l)&1023),u<=127?++a:u<=2047?a+=2:u<=65535?a+=3:a+=4}return a}function vl(s,a){Ai.set(s,a>>>0)}function Vp(s,a,l){for(var u=0;u<s.length;++u)Ai[a++>>>0]=s.charCodeAt(u);l||(Ai[a>>>0]=0)}var wl,Ai,Yi,cn,jl,M,Hp,zp,Wp;function Sl(s){wl=s,e.HEAP8=Ai=new Int8Array(s),e.HEAP16=cn=new Int16Array(s),e.HEAP32=M=new Int32Array(s),e.HEAPU8=Yi=new Uint8Array(s),e.HEAPU16=jl=new Uint16Array(s),e.HEAPU32=Hp=new Uint32Array(s),e.HEAPF32=zp=new Float32Array(s),e.HEAPF64=Wp=new Float64Array(s)}var qS=e.INITIAL_MEMORY||16777216,Il,Al=[],Cl=[],$p=[],xl=[],Yp=!1;function Fl(){return pe}function Xp(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)qp(e.preRun.shift());rs(Al)}function Gp(){Yp=!0,rs(Cl)}function Kp(){rs($p)}function Jp(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)Qp(e.postRun.shift());rs(xl)}function qp(s){Al.unshift(s)}function Zp(s){Cl.unshift(s)}function Qp(s){xl.unshift(s)}var dr=0,na=null,un=null;function ty(s){dr++,e.monitorRunDependencies&&e.monitorRunDependencies(dr)}function ey(s){if(dr--,e.monitorRunDependencies&&e.monitorRunDependencies(dr),dr==0&&(na!==null&&(clearInterval(na),na=null),un)){var a=un;un=null,a()}}function Me(s){e.onAbort&&e.onAbort(s),s="Aborted("+s+")",Oe(s),Ht=!0,yt=1,s+=". Build with -sASSERTIONS for more info.";var a=new WebAssembly.RuntimeError(s);throw n(a),a}var iy="data:application/octet-stream;base64,";function Bl(s){return s.startsWith(iy)}var Re;e.locateFile?(Re="./duckdb-mvp.wasm",Bl(Re)||(Re=k(Re))):Re=new URL("./duckdb-mvp.wasm",Bp.url).toString();function Tl(s){try{if(s==Re&&Jt)return new Uint8Array(Jt);if(mt)return mt(s);throw"both async and sync fetching of the wasm failed"}catch(a){Me(a)}}function ry(){return!Jt&&(v||C)&&typeof fetch=="function"?fetch(Re,{credentials:"same-origin"}).then(function(s){if(!s.ok)throw"failed to load wasm binary file at '"+Re+"'";return s.arrayBuffer()}).catch(function(){return Tl(Re)}):Promise.resolve().then(function(){return Tl(Re)})}function ny(){var s={a:M_};function a(p,y){var _=p.exports;e.asm=_,Vt=e.asm.Ve,Sl(Vt.buffer),Il=e.asm.Vf,Zp(e.asm.We),ey("wasm-instantiate")}ty("wasm-instantiate");function l(p){a(p.instance)}function u(p){return ry().then(function(y){return WebAssembly.instantiate(y,s)}).then(function(y){return y}).then(p,function(y){Oe("failed to asynchronously prepare wasm: "+y),Me(y)})}function d(){return!Jt&&typeof WebAssembly.instantiateStreaming=="function"&&!Bl(Re)&&typeof fetch=="function"?fetch(Re,{credentials:"same-origin"}).then(function(p){var y=WebAssembly.instantiateStreaming(p,s);return y.then(l,function(_){return Oe("wasm streaming compile failed: "+_),Oe("falling back to ArrayBuffer instantiation"),u(l)})}):u(l)}if(e.instantiateWasm)try{var f=e.instantiateWasm(s,a);return f}catch(p){return Oe("Module.instantiateWasm callback failed with error: "+p),!1}return d().catch(n),{}}function rs(s){for(;s.length>0;){var a=s.shift();if(typeof a=="function"){a(e);continue}var l=a.func;typeof l=="number"?a.arg===void 0?U(l)():U(l)(a.arg):l(a.arg===void 0?null:a.arg)}}var ns=[];function U(s){var a=ns[s];return a||(s>=ns.length&&(ns.length=s+1),ns[s]=a=Il.get(s)),a}function sy(s){if(s instanceof ys||s=="unwind")return yt;m(1,s)}function oy(s,a,l,u){Me("Assertion failed: "+Ii(s)+", at: "+[a?Ii(a):"unknown filename",l,u?Ii(u):"unknown function"])}function ay(s){return hs(s+24)+24}var ss=[];function ly(s){s.add_ref()}var os=0;function cy(s){var a=new fr(s);return a.get_caught()||(a.set_caught(!0),os--),a.set_rethrown(!1),ss.push(a),ly(a),a.get_exception_ptr()}var Ci=0;function fr(s){this.excPtr=s,this.ptr=s-24,this.set_type=function(a){M[this.ptr+4>>>2]=a},this.get_type=function(){return M[this.ptr+4>>>2]},this.set_destructor=function(a){M[this.ptr+8>>>2]=a},this.get_destructor=function(){return M[this.ptr+8>>>2]},this.set_refcount=function(a){M[this.ptr>>>2]=a},this.set_caught=function(a){a=a?1:0,Ai[this.ptr+12>>>0]=a},this.get_caught=function(){return Ai[this.ptr+12>>>0]!=0},this.set_rethrown=function(a){a=a?1:0,Ai[this.ptr+13>>>0]=a},this.get_rethrown=function(){return Ai[this.ptr+13>>>0]!=0},this.init=function(a,l){this.set_adjusted_ptr(0),this.set_type(a),this.set_destructor(l),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var a=M[this.ptr>>>2];M[this.ptr>>>2]=a+1},this.release_ref=function(){var a=M[this.ptr>>>2];return M[this.ptr>>>2]=a-1,a===1},this.set_adjusted_ptr=function(a){M[this.ptr+16>>>2]=a},this.get_adjusted_ptr=function(){return M[this.ptr+16>>>2]},this.get_exception_ptr=function(){var a=Hl(this.get_type());if(a)return M[this.excPtr>>>2];var l=this.get_adjusted_ptr();return l!==0?l:this.excPtr}}function Dl(s){return Vl(new fr(s).ptr)}function uy(s){if(s.release_ref()&&!s.get_rethrown()){var a=s.get_destructor();a&&U(a)(s.excPtr),Dl(s.excPtr)}}function dy(){w(0);var s=ss.pop();uy(s),Ci=0}function fy(s){throw Ci||(Ci=s),s}function hy(){var s=Ci;if(!s)return L(0),0;var a=new fr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return L(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(hn(f,l,p))return L(f),s|0}return L(l),s|0}function py(){var s=Ci;if(!s)return L(0),0;var a=new fr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return L(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(hn(f,l,p))return L(f),s|0}return L(l),s|0}function yy(){var s=Ci;if(!s)return L(0),0;var a=new fr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return L(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(hn(f,l,p))return L(f),s|0}return L(l),s|0}function _y(){var s=Ci;if(!s)return L(0),0;var a=new fr(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return L(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var p=a.ptr+16;if(hn(f,l,p))return L(f),s|0}return L(l),s|0}function my(){var s=ss.pop();s||Me("no exception to throw");var a=s.excPtr;throw s.get_rethrown()||(ss.push(s),s.set_rethrown(!0),s.set_caught(!1),os++),Ci=a,a}function by(s,a,l){var u=new fr(s);throw u.init(a,l),Ci=s,os++,s}function gy(){return os}var qt={buffers:[null,[],[]],printChar:function(s,a){var l=qt.buffers[s];a===0||a===10?((s===1?ia:Oe)(bl(l,0)),l.length=0):l.push(a)},varargs:void 0,get:function(){qt.varargs+=4;var s=M[qt.varargs-4>>>2];return s},getStr:function(s){var a=Ii(s);return a}};function vy(s,a,l,u,d){}function wy(){Oe("missing function: $SOCKFS"),Me(-1)}function El(){Oe("missing function: $FS"),Me(-1)}function dn(s){var a=wy.getSocket(s);if(!a)throw new El.ErrnoError(8);return a}function sa(s){return(s&255)+"."+(s>>8&255)+"."+(s>>16&255)+"."+(s>>24&255)}function kl(s){var a="",l=0,u=0,d=0,f=0,p=0,y=0,_=[s[0]&65535,s[0]>>16,s[1]&65535,s[1]>>16,s[2]&65535,s[2]>>16,s[3]&65535,s[3]>>16],b=!0,g="";for(y=0;y<5;y++)if(_[y]!==0){b=!1;break}if(b){if(g=sa(_[6]|_[7]<<16),_[5]===-1)return a="::ffff:",a+=g,a;if(_[5]===0)return a="::",g==="0.0.0.0"&&(g=""),g==="0.0.0.1"&&(g="1"),a+=g,a}for(l=0;l<8;l++)_[l]===0&&(l-d>1&&(p=0),d=l,p++),p>u&&(u=p,f=l-u+1);for(l=0;l<8;l++){if(u>1&&_[l]===0&&l>=f&&l<f+u){l===f&&(a+=":",f===0&&(a+=":"));continue}a+=Number(ua(_[l]&65535)).toString(16),a+=l<7?":":""}return a}function Ol(s,a){var l=cn[s>>>1],u=ua(jl[s+2>>>1]),d;switch(l){case 2:if(a!==16)return{errno:28};d=M[s+4>>>2],d=sa(d);break;case 10:if(a!==28)return{errno:28};d=[M[s+8>>>2],M[s+12>>>2],M[s+16>>>2],M[s+20>>>2]],d=kl(d);break;default:return{errno:5}}return{family:l,addr:d,port:u}}function as(s){for(var a=s.split("."),l=0;l<4;l++){var u=Number(a[l]);if(isNaN(u))return null;a[l]=u}return(a[0]|a[1]<<8|a[2]<<16|a[3]<<24)>>>0}function ls(s){return parseInt(s)}function oa(s){var a,l,u,d,f=/^((?=.*::)(?!.*::.+::)(::)?([\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,p=[];if(!f.test(s))return null;if(s==="::")return[0,0,0,0,0,0,0,0];for(s.startsWith("::")?s=s.replace("::","Z:"):s=s.replace("::",":Z:"),s.indexOf(".")>0?(s=s.replace(new RegExp("[.]","g"),":"),a=s.split(":"),a[a.length-4]=ls(a[a.length-4])+ls(a[a.length-3])*256,a[a.length-3]=ls(a[a.length-2])+ls(a[a.length-1])*256,a=a.slice(0,a.length-2)):a=s.split(":"),u=0,d=0,l=0;l<a.length;l++)if(typeof a[l]=="string")if(a[l]==="Z"){for(d=0;d<8-a.length+1;d++)p[l+d]=0;u=d-1}else p[l+u]=fs(parseInt(a[l],16));else p[l+u]=a[l];return[p[1]<<16|p[0],p[3]<<16|p[2],p[5]<<16|p[4],p[7]<<16|p[6]]}var Ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(s){var a=as(s);if(a!==null||(a=oa(s),a!==null))return s;var l;if(Ue.address_map.addrs[s])l=Ue.address_map.addrs[s];else{var u=Ue.address_map.id++;ye(u<65535,"exceeded max address mappings of 65535"),l="172.29."+(u&255)+"."+(u&65280),Ue.address_map.names[l]=s,Ue.address_map.addrs[s]=l}return l},lookup_addr:function(s){return Ue.address_map.names[s]?Ue.address_map.names[s]:null}};function Ml(s,a,l){if(l&&s===0)return null;var u=Ol(s,a);if(u.errno)throw new El.ErrnoError(u.errno);return u.addr=Ue.lookup_addr(u.addr)||u.addr,u}function jy(s,a,l){var u=dn(s),d=Ml(a,l);return u.sock_ops.bind(u,d.addr,d.port),0}function Sy(s,a,l){var u=dn(s),d=Ml(a,l);return u.sock_ops.connect(u,d.addr,d.port),0}function Iy(s,a,l,u){return a=qt.getStr(a),a=qt.calculateAt(s,a),qt.doAccess(a,l)}function Ay(s,a,l){return qt.varargs=l,0}function Cy(s,a){}function xy(s,a,l){}function Fy(s,a,l){}function Rl(s,a){Yi.fill(0,s,s+a)}function aa(s,a,l,u,d){switch(a){case 2:l=as(l),Rl(s,16),d&&(M[d>>>2]=16),cn[s>>>1]=a,M[s+4>>>2]=l,cn[s+2>>>1]=fs(u);break;case 10:l=oa(l),Rl(s,28),d&&(M[d>>>2]=28),M[s>>>2]=a,M[s+8>>>2]=l[0],M[s+12>>>2]=l[1],M[s+16>>>2]=l[2],M[s+20>>>2]=l[3],cn[s+2>>>1]=fs(u);break;default:return 5}return 0}function By(s,a,l){var u=dn(s);if(!u.daddr)return-53;var d=aa(a,u.family,Ue.lookup_name(u.daddr),u.dport,l);return 0}function Ty(s,a,l,u,d){var f=dn(s);return a===1&&l===4?(M[u>>>2]=f.error,M[d>>>2]=4,f.error=null,0):-50}function Dy(s,a,l){return qt.varargs=l,0}function Ey(s,a){}function ky(s,a,l){}function Oy(s,a,l,u){}function My(s,a,l,u){qt.varargs=u}function Ry(s,a,l,u,d,f){var p=dn(s),y=p.sock_ops.recvmsg(p,l);if(!y)return 0;if(d)var _=aa(d,p.family,Ue.lookup_name(y.addr),y.port,f);return Yi.set(y.buffer,a>>>0),y.buffer.byteLength}function Uy(s,a,l,u){}function Ny(s){}function Ly(s,a,l,u,d,f){}function Py(s,a,l){}function Vy(s,a){}function Hy(s,a,l){}function zy(s){}var Ul="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Wy(s,a){Me(Ul)}function $y(s,a){Me(Ul)}function Yy(){return Date.now()}var Xy=!0;function Gy(){return Xy}function Ky(){Me("")}function Jy(s,a){return globalThis.DUCKDB_RUNTIME.createDirectory(e,s,a)}function qy(s,a){return globalThis.DUCKDB_RUNTIME.checkDirectory(e,s,a)}function Zy(s,a){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(e,s,a)}function Qy(s,a){return globalThis.DUCKDB_RUNTIME.removeDirectory(e,s,a)}function t_(s){return globalThis.DUCKDB_RUNTIME.closeFile(e,s)}function e_(s,a){return globalThis.DUCKDB_RUNTIME.checkFile(e,s,a)}function i_(s){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(e,s)}function r_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.moveFile(e,s,a,l,u)}function n_(s,a){return globalThis.DUCKDB_RUNTIME.openFile(e,s,a)}function s_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.readFile(e,s,a,l,u)}function o_(s,a){return globalThis.DUCKDB_RUNTIME.truncateFile(e,s,a)}function a_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.writeFile(e,s,a,l,u)}function l_(s,a){return globalThis.DUCKDB_RUNTIME.glob(e,s,a)}function c_(s){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(e,s)}function u_(s,a,l,u,d,f){return globalThis.DUCKDB_RUNTIME.callScalarUDF(e,s,a,l,u,d,f)}function Nl(){return 4294901760}var la;B?la=()=>{var s=process.hrtime();return s[0]*1e3+s[1]/1e6}:la=()=>performance.now();function d_(s,a,l){Yi.copyWithin(s>>>0,a>>>0,a+l>>>0)}function f_(s){try{return Vt.grow(s-wl.byteLength+65535>>>16),Sl(Vt.buffer),1}catch(a){}}function h_(s){var a=Yi.length;s=s>>>0;var l=Nl();if(s>l)return!1;let u=(_,b)=>_+(b-_%b)%b;for(var d=1;d<=4;d*=2){var f=a*(1+.2/d);f=Math.min(f,s+100663296);var p=Math.min(l,u(Math.max(s,f),65536)),y=f_(p);if(y)return!0}return!1}var ca={};function p_(){return h||"./this.program"}function fn(){if(!fn.strings){var s=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:s,_:p_()};for(var l in ca)ca[l]===void 0?delete a[l]:a[l]=ca[l];var u=[];for(var l in a)u.push(l+"="+a[l]);fn.strings=u}return fn.strings}function y_(s,a){var l=0;return fn().forEach(function(u,d){var f=a+l;M[s+d*4>>>2]=f,Vp(u,f),l+=u.length+1}),0}function __(s,a){var l=fn();M[s>>>2]=l.length;var u=0;return l.forEach(function(d){u+=d.length+1}),M[a>>>2]=u,0}function m_(s){return 0}function b_(s,a,l,u,d,f){var p=qt.getStreamFromFD(s),y=qt.doReadv(p,a,l,u);return M[f>>>2]=y,0}function g_(s,a,l,u,d,f){var p=qt.getStreamFromFD(s),y=qt.doWritev(p,a,l,u);return M[f>>>2]=y,0}function v_(s,a,l,u){var d=qt.getStreamFromFD(s),f=qt.doReadv(d,a,l);return M[u>>>2]=f,0}function w_(s,a,l,u,d){}function j_(s){var a=qt.getStreamFromFD(s);return a.stream_ops&&a.stream_ops.fsync?-a.stream_ops.fsync(a):0}function S_(s,a,l,u){for(var d=0,f=0;f<l;f++){var p=M[a>>>2],y=M[a+4>>>2];a+=8;for(var _=0;_<y;_++)qt.printChar(s,Yi[p+_>>>0]);d+=y}return M[u>>>2]=d,0}function I_(){return le()}function A_(s,a,l,u){var d=0,f=0,p=0,y=0,_=0,b=0,g;function I(x,D,E,st,dt,kt){var T,P,xt,Zt;return P=x===10?28:16,dt=x===10?kl(dt):sa(dt),T=hs(P),Zt=aa(T,x,dt,kt),ye(!Zt),xt=hs(32),M[xt+4>>>2]=x,M[xt+8>>>2]=D,M[xt+12>>>2]=E,M[xt+24>>>2]=st,M[xt+20>>>2]=T,x===10?M[xt+16>>>2]=28:M[xt+16>>>2]=16,M[xt+28>>>2]=0,xt}if(l&&(p=M[l>>>2],y=M[l+4>>>2],_=M[l+8>>>2],b=M[l+12>>>2]),_&&!b&&(b=_===2?17:6),!_&&b&&(_=b===17?2:1),b===0&&(b=6),_===0&&(_=1),!s&&!a)return-2;if(p&-1088||l!==0&&M[l>>>2]&2&&!s)return-1;if(p&32)return-2;if(_!==0&&_!==1&&_!==2)return-7;if(y!==0&&y!==2&&y!==10)return-6;if(a&&(a=Ii(a),f=parseInt(a,10),isNaN(f)))return p&1024?-2:-8;if(!s)return y===0&&(y=2),(p&1)===0&&(y===2?d=ds(2130706433):d=[0,0,0,1]),g=I(y,_,b,null,d,f),M[u>>>2]=g,0;if(s=Ii(s),d=as(s),d!==null)if(y===0||y===2)y=2;else if(y===10&&p&8)d=[0,0,ds(65535),d],y=10;else return-2;else if(d=oa(s),d!==null)if(y===0||y===10)y=10;else return-2;return d!=null?(g=I(y,_,b,s,d,f),M[u>>>2]=g,0):p&4?-2:(s=Ue.lookup_name(s),d=as(s),y===0?y=2:y===10&&(d=[0,0,ds(65535),d]),g=I(y,_,b,null,d,f),M[u>>>2]=g,0)}function C_(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var s=new Uint8Array(1);return function(){return crypto.getRandomValues(s),s[0]}}else if(B)try{var a=nw("crypto");return function(){return a.randomBytes(1)[0]}}catch(l){}return function(){Me("randomDevice")}}function cs(s,a){cs.randomDevice||(cs.randomDevice=C_());for(var l=0;l<a;l++)Ai[s+l>>>0]=cs.randomDevice();return 0}function x_(s,a,l,u,d,f,p){var y=Ol(s,a);if(y.errno)return-6;var _=y.port,b=y.addr,g=!1;if(l&&u){var I;if(p&1||!(I=Ue.lookup_addr(b))){if(p&8)return-2}else b=I;var x=ra(b,l,u);x+1>=u&&(g=!0)}if(d&&f){_=""+_;var x=ra(_,d,f);x+1>=f&&(g=!0)}return g?-12:0}function F_(s){return s}function B_(s){L(s)}function us(s){return s%4===0&&(s%100!==0||s%400===0)}function T_(s,a){for(var l=0,u=0;u<=a;l+=s[u++]);return l}var Ll=[31,29,31,30,31,30,31,31,30,31,30,31],Pl=[31,28,31,30,31,30,31,31,30,31,30,31];function D_(s,a){for(var l=new Date(s.getTime());a>0;){var u=us(l.getFullYear()),d=l.getMonth(),f=(u?Ll:Pl)[d];if(a>f-l.getDate())a-=f-l.getDate()+1,l.setDate(1),d<11?l.setMonth(d+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else return l.setDate(l.getDate()+a),l}return l}function E_(s,a,l,u){var d=M[u+40>>>2],f={tm_sec:M[u>>>2],tm_min:M[u+4>>>2],tm_hour:M[u+8>>>2],tm_mday:M[u+12>>>2],tm_mon:M[u+16>>>2],tm_year:M[u+20>>>2],tm_wday:M[u+24>>>2],tm_yday:M[u+28>>>2],tm_isdst:M[u+32>>>2],tm_gmtoff:M[u+36>>>2],tm_zone:d?Ii(d):""},p=Ii(l),y={"%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 _ in y)p=p.replace(new RegExp(_,"g"),y[_]);var b=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],g=["January","February","March","April","May","June","July","August","September","October","November","December"];function I(T,P,xt){for(var Zt=typeof T=="number"?T.toString():T||"";Zt.length<P;)Zt=xt[0]+Zt;return Zt}function x(T,P){return I(T,P,"0")}function D(T,P){function xt(_s){return _s<0?-1:_s>0?1:0}var Zt;return(Zt=xt(T.getFullYear()-P.getFullYear()))===0&&(Zt=xt(T.getMonth()-P.getMonth()))===0&&(Zt=xt(T.getDate()-P.getDate())),Zt}function E(T){switch(T.getDay()){case 0:return new Date(T.getFullYear()-1,11,29);case 1:return T;case 2:return new Date(T.getFullYear(),0,3);case 3:return new Date(T.getFullYear(),0,2);case 4:return new Date(T.getFullYear(),0,1);case 5:return new Date(T.getFullYear()-1,11,31);case 6:return new Date(T.getFullYear()-1,11,30)}}function st(T){var P=D_(new Date(T.tm_year+1900,0,1),T.tm_yday),xt=new Date(P.getFullYear(),0,4),Zt=new Date(P.getFullYear()+1,0,4),_s=E(xt),Z0=E(Zt);return D(_s,P)<=0?D(Z0,P)<=0?P.getFullYear()+1:P.getFullYear():P.getFullYear()-1}var dt={"%a":function(T){return b[T.tm_wday].substring(0,3)},"%A":function(T){return b[T.tm_wday]},"%b":function(T){return g[T.tm_mon].substring(0,3)},"%B":function(T){return g[T.tm_mon]},"%C":function(T){var P=T.tm_year+1900;return x(P/100|0,2)},"%d":function(T){return x(T.tm_mday,2)},"%e":function(T){return I(T.tm_mday,2," ")},"%g":function(T){return st(T).toString().substring(2)},"%G":function(T){return st(T)},"%H":function(T){return x(T.tm_hour,2)},"%I":function(T){var P=T.tm_hour;return P==0?P=12:P>12&&(P-=12),x(P,2)},"%j":function(T){return x(T.tm_mday+T_(us(T.tm_year+1900)?Ll:Pl,T.tm_mon-1),3)},"%m":function(T){return x(T.tm_mon+1,2)},"%M":function(T){return x(T.tm_min,2)},"%n":function(){return`
11
+ `},"%p":function(T){return T.tm_hour>=0&&T.tm_hour<12?"AM":"PM"},"%S":function(T){return x(T.tm_sec,2)},"%t":function(){return" "},"%u":function(T){return T.tm_wday||7},"%U":function(T){var P=T.tm_yday+7-T.tm_wday;return x(Math.floor(P/7),2)},"%V":function(T){var P=Math.floor((T.tm_yday+7-(T.tm_wday+6)%7)/7);if((T.tm_wday+371-T.tm_yday-2)%7<=2&&P++,P){if(P==53){var Zt=(T.tm_wday+371-T.tm_yday)%7;Zt!=4&&(Zt!=3||!us(T.tm_year))&&(P=1)}}else{P=52;var xt=(T.tm_wday+7-T.tm_yday-1)%7;(xt==4||xt==5&&us(T.tm_year%400-1))&&P++}return x(P,2)},"%w":function(T){return T.tm_wday},"%W":function(T){var P=T.tm_yday+7-(T.tm_wday+6)%7;return x(Math.floor(P/7),2)},"%y":function(T){return(T.tm_year+1900).toString().substring(2)},"%Y":function(T){return T.tm_year+1900},"%z":function(T){var P=T.tm_gmtoff,xt=P>=0;return P=Math.abs(P)/60,P=P/60*100+P%60,(xt?"+":"-")+String("0000"+P).slice(-4)},"%Z":function(T){return T.tm_zone},"%%":function(){return"%"}};p=p.replace(/%%/g,"\0\0");for(var _ in dt)p.includes(_)&&(p=p.replace(new RegExp(_,"g"),dt[_](f)));p=p.replace(/\0\0/g,"%");var kt=O_(p,!1);return kt.length>a?0:(vl(kt,s),kt.length-1)}function k_(s,a,l,u){return E_(s,a,l,u)}function O_(s,a,l){var u=l>0?l:Pp(s)+1,d=new Array(u),f=gl(s,d,0,d.length);return a&&(d.length=f),d}var M_={p:oy,j:ay,C:cy,G:dy,b:hy,n:py,J:yy,_:_y,i:Dl,fa:my,w:by,F:gy,e:fy,Ba:vy,Da:jy,Ca:Sy,va:Iy,T:Ay,Oa:Cy,ve:xy,Ka:Fy,xa:By,Aa:Ty,Qa:Dy,La:Ey,Pa:ky,Ma:Oy,ma:My,ya:Ry,Te:Uy,ka:Ny,za:Ly,ja:Py,Na:Vy,la:Hy,Fa:zy,Ha:Wy,Ga:$y,Sa:Yy,Ra:Gy,ba:Ky,Le:Jy,Me:qy,Je:Zy,Ke:Qy,ta:t_,He:e_,Oe:i_,Ie:r_,Pe:n_,ha:s_,Ne:o_,ua:a_,Ge:l_,sa:c_,Qe:u_,Ta:Nl,oe:la,nb:d_,hd:h_,Va:y_,Wa:__,Y:m_,ue:b_,rb:g_,oa:v_,De:w_,Ue:j_,ga:S_,a:I_,Ea:A_,Ja:cs,wa:x_,qa:gb,P:ob,X:km,Cd:gg,ra:bb,Z:sb,pa:Em,Dd:bg,x:Pm,da:ib,t:qm,$:tb,ea:eb,u:Jm,d:Am,ca:fb,O:ub,mc:kv,c:Cm,W:db,h:Fm,ic:Uv,m:Dm,na:Xm,o:Bm,y:Hm,A:Um,Q:Qm,U:Zm,cb:Nm,z:zm,B:Lm,L:pb,r:cb,Nc:av,Yc:Jg,$c:Xg,ed:Hg,Oc:ov,jc:Rv,Bd:vg,Zc:Kg,fd:Vg,ab:H0,ze:Ab,Td:ig,ec:Vv,Rc:rv,ye:Cb,sc:xv,Pb:n0,Ya:Y0,Xa:X0,Ud:eg,Sd:rg,xb:j0,Xb:Jv,de:Wb,nd:Og,tc:Cv,hc:Nv,ke:Ub,Yd:qb,Hd:pg,fc:Pv,Ub:Qv,Xd:Zb,pb:B0,Zd:Jb,qe:Eb,Vd:tg,Ob:s0,kc:Mv,lc:Ov,zb:v0,jb:O0,$a:z0,xe:xb,ce:$b,_b:Xv,wb:S0,$b:Yv,kb:k0,Ab:g0,Wd:Qb,ac:$v,dc:Hv,cc:zv,bc:Wv,Xc:qg,cd:Wg,Fc:yv,he:Pb,Cc:bv,gd:Pg,be:Yb,se:Tb,ld:Rg,kd:Ug,Ce:jb,Be:Sb,Pd:og,Fe:vb,qd:Dg,jd:Ng,Pc:sv,od:kg,yd:Sg,pc:Tv,Sc:iv,Id:hg,Jc:dv,Qb:r0,zd:jg,xd:Ig,Gc:pv,Uc:tv,wc:Iv,Lc:cv,Gd:yg,Ad:wg,Dc:mv,Lb:l0,Za:$0,Ic:fv,Hc:hv,Jb:u0,md:Mg,Bb:b0,Kc:uv,yc:jv,Cb:m0,Db:_0,xc:Sv,v:Sm,k:xm,D:nb,tb:C0,K:rb,ub:A0,f:Im,R:Mm,V:yb,uc:Om,g:Rm,l:Tm,Se:_b,s:Km,q:Ym,ia:hb,E:Vm,N:Gm,S:lb,M:Wm,Re:mb,Ia:ab,aa:$m,pd:Eg,sb:x0,Qc:nv,Ac:vv,wd:Ag,dd:zg,nc:Ev,mb:D0,me:Mb,Jd:fg,Yb:Kv,hb:R0,Vc:Qg,Wc:Zg,zc:wv,Vb:Zv,Hb:f0,qc:Bv,oc:Dv,vd:Cg,le:Rb,id:Lg,Fd:_g,Wb:qv,td:Fg,_d:Kb,_a:W0,$d:Gb,lb:E0,fe:Hb,ae:Xb,rc:Fv,rd:Tg,Nd:lg,ie:Lb,ib:M0,te:Bb,we:Fb,Ae:Ib,Md:cg,gb:U0,Kd:dg,Eb:y0,ud:xg,Mb:a0,Ib:d0,Rb:i0,ob:T0,Od:ag,fb:N0,sd:Bg,Tc:ev,Ee:wb,pe:kb,Nb:o0,ee:zb,_c:Gg,ne:Ob,ge:Vb,gc:Lv,Rd:ng,Qd:sg,Kb:c0,vb:I0,Gb:h0,Mc:lv,bd:$g,je:Nb,eb:L0,Ld:ug,qb:F0,Ed:mg,vc:Av,bb:V0,db:P0,ad:Yg,re:Db,Tb:t0,yb:w0,Bc:gv,Ec:_v,Fb:p0,Zb:Gv,Sb:e0,I:F_,H:B_,Ua:k_},ZS=ny(),R_=e.___wasm_call_ctors=function(){return(R_=e.___wasm_call_ctors=e.asm.We).apply(null,arguments)},U_=e._main=function(){return(U_=e._main=e.asm.Xe).apply(null,arguments)},N_=e._duckdb_web_fs_glob_add_path=function(){return(N_=e._duckdb_web_fs_glob_add_path=e.asm.Ye).apply(null,arguments)},L_=e._duckdb_web_clear_response=function(){return(L_=e._duckdb_web_clear_response=e.asm.Ze).apply(null,arguments)},P_=e._duckdb_web_fail_with=function(){return(P_=e._duckdb_web_fail_with=e.asm._e).apply(null,arguments)},V_=e._duckdb_web_reset=function(){return(V_=e._duckdb_web_reset=e.asm.$e).apply(null,arguments)},H_=e._duckdb_web_connect=function(){return(H_=e._duckdb_web_connect=e.asm.af).apply(null,arguments)},z_=e._duckdb_web_disconnect=function(){return(z_=e._duckdb_web_disconnect=e.asm.bf).apply(null,arguments)},W_=e._duckdb_web_flush_files=function(){return(W_=e._duckdb_web_flush_files=e.asm.cf).apply(null,arguments)},$_=e._duckdb_web_flush_file=function(){return($_=e._duckdb_web_flush_file=e.asm.df).apply(null,arguments)},Y_=e._duckdb_web_open=function(){return(Y_=e._duckdb_web_open=e.asm.ef).apply(null,arguments)},X_=e._duckdb_web_get_global_file_info=function(){return(X_=e._duckdb_web_get_global_file_info=e.asm.ff).apply(null,arguments)},G_=e._duckdb_web_collect_file_stats=function(){return(G_=e._duckdb_web_collect_file_stats=e.asm.gf).apply(null,arguments)},K_=e._duckdb_web_export_file_stats=function(){return(K_=e._duckdb_web_export_file_stats=e.asm.hf).apply(null,arguments)},J_=e._duckdb_web_fs_drop_file=function(){return(J_=e._duckdb_web_fs_drop_file=e.asm.jf).apply(null,arguments)},q_=e._duckdb_web_fs_drop_files=function(){return(q_=e._duckdb_web_fs_drop_files=e.asm.kf).apply(null,arguments)},Z_=e._duckdb_web_fs_glob_file_infos=function(){return(Z_=e._duckdb_web_fs_glob_file_infos=e.asm.lf).apply(null,arguments)},Q_=e._duckdb_web_fs_get_file_info_by_id=function(){return(Q_=e._duckdb_web_fs_get_file_info_by_id=e.asm.mf).apply(null,arguments)},tm=e._duckdb_web_fs_get_file_info_by_name=function(){return(tm=e._duckdb_web_fs_get_file_info_by_name=e.asm.nf).apply(null,arguments)},em=e._duckdb_web_fs_set_file_descriptor=function(){return(em=e._duckdb_web_fs_set_file_descriptor=e.asm.of).apply(null,arguments)},im=e._duckdb_web_fs_register_file_url=function(){return(im=e._duckdb_web_fs_register_file_url=e.asm.pf).apply(null,arguments)},rm=e._duckdb_web_fs_register_file_buffer=function(){return(rm=e._duckdb_web_fs_register_file_buffer=e.asm.qf).apply(null,arguments)},nm=e._duckdb_web_copy_file_to_buffer=function(){return(nm=e._duckdb_web_copy_file_to_buffer=e.asm.rf).apply(null,arguments)},sm=e._duckdb_web_copy_file_to_path=function(){return(sm=e._duckdb_web_copy_file_to_path=e.asm.sf).apply(null,arguments)},om=e._duckdb_web_get_version=function(){return(om=e._duckdb_web_get_version=e.asm.tf).apply(null,arguments)},am=e._duckdb_web_get_feature_flags=function(){return(am=e._duckdb_web_get_feature_flags=e.asm.uf).apply(null,arguments)},lm=e._duckdb_web_tokenize=function(){return(lm=e._duckdb_web_tokenize=e.asm.vf).apply(null,arguments)},cm=e._duckdb_web_udf_scalar_create=function(){return(cm=e._duckdb_web_udf_scalar_create=e.asm.wf).apply(null,arguments)},um=e._duckdb_web_prepared_create=function(){return(um=e._duckdb_web_prepared_create=e.asm.xf).apply(null,arguments)},dm=e._duckdb_web_prepared_close=function(){return(dm=e._duckdb_web_prepared_close=e.asm.yf).apply(null,arguments)},fm=e._duckdb_web_prepared_run=function(){return(fm=e._duckdb_web_prepared_run=e.asm.zf).apply(null,arguments)},hm=e._duckdb_web_prepared_send=function(){return(hm=e._duckdb_web_prepared_send=e.asm.Af).apply(null,arguments)},pm=e._duckdb_web_query_run=function(){return(pm=e._duckdb_web_query_run=e.asm.Bf).apply(null,arguments)},ym=e._duckdb_web_pending_query_start=function(){return(ym=e._duckdb_web_pending_query_start=e.asm.Cf).apply(null,arguments)},_m=e._duckdb_web_pending_query_poll=function(){return(_m=e._duckdb_web_pending_query_poll=e.asm.Df).apply(null,arguments)},mm=e._duckdb_web_pending_query_cancel=function(){return(mm=e._duckdb_web_pending_query_cancel=e.asm.Ef).apply(null,arguments)},bm=e._duckdb_web_query_fetch_results=function(){return(bm=e._duckdb_web_query_fetch_results=e.asm.Ff).apply(null,arguments)},gm=e._duckdb_web_get_tablenames=function(){return(gm=e._duckdb_web_get_tablenames=e.asm.Gf).apply(null,arguments)},vm=e._duckdb_web_insert_arrow_from_ipc_stream=function(){return(vm=e._duckdb_web_insert_arrow_from_ipc_stream=e.asm.Hf).apply(null,arguments)},wm=e._duckdb_web_insert_csv_from_path=function(){return(wm=e._duckdb_web_insert_csv_from_path=e.asm.If).apply(null,arguments)},jm=e._duckdb_web_insert_json_from_path=function(){return(jm=e._duckdb_web_insert_json_from_path=e.asm.Jf).apply(null,arguments)},ds=e._htonl=function(){return(ds=e._htonl=e.asm.Kf).apply(null,arguments)},fs=e._htons=function(){return(fs=e._htons=e.asm.Lf).apply(null,arguments)},ua=e._ntohs=function(){return(ua=e._ntohs=e.asm.Mf).apply(null,arguments)},hs=e._malloc=function(){return(hs=e._malloc=e.asm.Nf).apply(null,arguments)},Vl=e._free=function(){return(Vl=e._free=e.asm.Of).apply(null,arguments)},w=e._setThrew=function(){return(w=e._setThrew=e.asm.Pf).apply(null,arguments)},j=e.stackSave=function(){return(j=e.stackSave=e.asm.Qf).apply(null,arguments)},S=e.stackRestore=function(){return(S=e.stackRestore=e.asm.Rf).apply(null,arguments)},da=e.stackAlloc=function(){return(da=e.stackAlloc=e.asm.Sf).apply(null,arguments)},hn=e.___cxa_can_catch=function(){return(hn=e.___cxa_can_catch=e.asm.Tf).apply(null,arguments)},Hl=e.___cxa_is_pointer_type=function(){return(Hl=e.___cxa_is_pointer_type=e.asm.Uf).apply(null,arguments)},zl=e.dynCall_jiiii=function(){return(zl=e.dynCall_jiiii=e.asm.Wf).apply(null,arguments)},Wl=e.dynCall_iiiiij=function(){return(Wl=e.dynCall_iiiiij=e.asm.Xf).apply(null,arguments)},$l=e.dynCall_iiiiijj=function(){return($l=e.dynCall_iiiiijj=e.asm.Yf).apply(null,arguments)},Yl=e.dynCall_viijii=function(){return(Yl=e.dynCall_viijii=e.asm.Zf).apply(null,arguments)},Xl=e.dynCall_j=function(){return(Xl=e.dynCall_j=e.asm._f).apply(null,arguments)},Gl=e.dynCall_ji=function(){return(Gl=e.dynCall_ji=e.asm.$f).apply(null,arguments)},Kl=e.dynCall_iij=function(){return(Kl=e.dynCall_iij=e.asm.ag).apply(null,arguments)},Jl=e.dynCall_viij=function(){return(Jl=e.dynCall_viij=e.asm.bg).apply(null,arguments)},ql=e.dynCall_viijji=function(){return(ql=e.dynCall_viijji=e.asm.cg).apply(null,arguments)},Zl=e.dynCall_viijj=function(){return(Zl=e.dynCall_viijj=e.asm.dg).apply(null,arguments)},Ql=e.dynCall_viiijj=function(){return(Ql=e.dynCall_viiijj=e.asm.eg).apply(null,arguments)},tc=e.dynCall_viiji=function(){return(tc=e.dynCall_viiji=e.asm.fg).apply(null,arguments)},ec=e.dynCall_vijjj=function(){return(ec=e.dynCall_vijjj=e.asm.gg).apply(null,arguments)},ic=e.dynCall_iiijj=function(){return(ic=e.dynCall_iiijj=e.asm.hg).apply(null,arguments)},rc=e.dynCall_viiij=function(){return(rc=e.dynCall_viiij=e.asm.ig).apply(null,arguments)},nc=e.dynCall_viijij=function(){return(nc=e.dynCall_viijij=e.asm.jg).apply(null,arguments)},sc=e.dynCall_iiij=function(){return(sc=e.dynCall_iiij=e.asm.kg).apply(null,arguments)},oc=e.dynCall_vijijj=function(){return(oc=e.dynCall_vijijj=e.asm.lg).apply(null,arguments)},ac=e.dynCall_viiijjj=function(){return(ac=e.dynCall_viiijjj=e.asm.mg).apply(null,arguments)},lc=e.dynCall_iji=function(){return(lc=e.dynCall_iji=e.asm.ng).apply(null,arguments)},cc=e.dynCall_viji=function(){return(cc=e.dynCall_viji=e.asm.og).apply(null,arguments)},uc=e.dynCall_vij=function(){return(uc=e.dynCall_vij=e.asm.pg).apply(null,arguments)},dc=e.dynCall_viiiij=function(){return(dc=e.dynCall_viiiij=e.asm.qg).apply(null,arguments)},fc=e.dynCall_jii=function(){return(fc=e.dynCall_jii=e.asm.rg).apply(null,arguments)},hc=e.dynCall_iiji=function(){return(hc=e.dynCall_iiji=e.asm.sg).apply(null,arguments)},pc=e.dynCall_iiiij=function(){return(pc=e.dynCall_iiiij=e.asm.tg).apply(null,arguments)},yc=e.dynCall_iiiiiji=function(){return(yc=e.dynCall_iiiiiji=e.asm.ug).apply(null,arguments)},_c=e.dynCall_iiiji=function(){return(_c=e.dynCall_iiiji=e.asm.vg).apply(null,arguments)},mc=e.dynCall_iiiiji=function(){return(mc=e.dynCall_iiiiji=e.asm.wg).apply(null,arguments)},bc=e.dynCall_jiii=function(){return(bc=e.dynCall_jiii=e.asm.xg).apply(null,arguments)},gc=e.dynCall_jij=function(){return(gc=e.dynCall_jij=e.asm.yg).apply(null,arguments)},vc=e.dynCall_viijiiiii=function(){return(vc=e.dynCall_viijiiiii=e.asm.zg).apply(null,arguments)},wc=e.dynCall_iiijii=function(){return(wc=e.dynCall_iiijii=e.asm.Ag).apply(null,arguments)},jc=e.dynCall_jiijii=function(){return(jc=e.dynCall_jiijii=e.asm.Bg).apply(null,arguments)},Sc=e.dynCall_viiijii=function(){return(Sc=e.dynCall_viiijii=e.asm.Cg).apply(null,arguments)},Ic=e.dynCall_fiijii=function(){return(Ic=e.dynCall_fiijii=e.asm.Dg).apply(null,arguments)},Ac=e.dynCall_diijii=function(){return(Ac=e.dynCall_diijii=e.asm.Eg).apply(null,arguments)},Cc=e.dynCall_iiiiiiijii=function(){return(Cc=e.dynCall_iiiiiiijii=e.asm.Fg).apply(null,arguments)},xc=e.dynCall_vijj=function(){return(xc=e.dynCall_vijj=e.asm.Gg).apply(null,arguments)},Fc=e.dynCall_jiiijii=function(){return(Fc=e.dynCall_jiiijii=e.asm.Hg).apply(null,arguments)},Bc=e.dynCall_jiijiii=function(){return(Bc=e.dynCall_jiijiii=e.asm.Ig).apply(null,arguments)},Tc=e.dynCall_viiiiji=function(){return(Tc=e.dynCall_viiiiji=e.asm.Jg).apply(null,arguments)},Dc=e.dynCall_jiiiijii=function(){return(Dc=e.dynCall_jiiiijii=e.asm.Kg).apply(null,arguments)},Ec=e.dynCall_jiiiiijiiii=function(){return(Ec=e.dynCall_jiiiiijiiii=e.asm.Lg).apply(null,arguments)},kc=e.dynCall_jiiijiii=function(){return(kc=e.dynCall_jiiijiii=e.asm.Mg).apply(null,arguments)},Oc=e.dynCall_viiiiijiiii=function(){return(Oc=e.dynCall_viiiiijiiii=e.asm.Ng).apply(null,arguments)},Mc=e.dynCall_viiijjij=function(){return(Mc=e.dynCall_viiijjij=e.asm.Og).apply(null,arguments)},Rc=e.dynCall_viijiii=function(){return(Rc=e.dynCall_viijiii=e.asm.Pg).apply(null,arguments)},Uc=e.dynCall_vijijjiij=function(){return(Uc=e.dynCall_vijijjiij=e.asm.Qg).apply(null,arguments)},Nc=e.dynCall_viiijjiij=function(){return(Nc=e.dynCall_viiijjiij=e.asm.Rg).apply(null,arguments)},Lc=e.dynCall_viiiijjjj=function(){return(Lc=e.dynCall_viiiijjjj=e.asm.Sg).apply(null,arguments)},Pc=e.dynCall_viijiiiiij=function(){return(Pc=e.dynCall_viijiiiiij=e.asm.Tg).apply(null,arguments)},Vc=e.dynCall_viiijiiiijjj=function(){return(Vc=e.dynCall_viiijiiiijjj=e.asm.Ug).apply(null,arguments)},Hc=e.dynCall_viijijiiiijjj=function(){return(Hc=e.dynCall_viijijiiiijjj=e.asm.Vg).apply(null,arguments)},zc=e.dynCall_jj=function(){return(zc=e.dynCall_jj=e.asm.Wg).apply(null,arguments)},Wc=e.dynCall_jd=function(){return(Wc=e.dynCall_jd=e.asm.Xg).apply(null,arguments)},$c=e.dynCall_jf=function(){return($c=e.dynCall_jf=e.asm.Yg).apply(null,arguments)},Yc=e.dynCall_iijjj=function(){return(Yc=e.dynCall_iijjj=e.asm.Zg).apply(null,arguments)},Xc=e.dynCall_iiijji=function(){return(Xc=e.dynCall_iiijji=e.asm._g).apply(null,arguments)},Gc=e.dynCall_vijijiiiijjj=function(){return(Gc=e.dynCall_vijijiiiijjj=e.asm.$g).apply(null,arguments)},Kc=e.dynCall_viiiiiij=function(){return(Kc=e.dynCall_viiiiiij=e.asm.ah).apply(null,arguments)},Jc=e.dynCall_iiiiiiji=function(){return(Jc=e.dynCall_iiiiiiji=e.asm.bh).apply(null,arguments)},qc=e.dynCall_iiiiiiiiji=function(){return(qc=e.dynCall_iiiiiiiiji=e.asm.ch).apply(null,arguments)},Zc=e.dynCall_viiiiijj=function(){return(Zc=e.dynCall_viiiiijj=e.asm.dh).apply(null,arguments)},Qc=e.dynCall_vijiii=function(){return(Qc=e.dynCall_vijiii=e.asm.eh).apply(null,arguments)},tu=e.dynCall_viijjj=function(){return(tu=e.dynCall_viijjj=e.asm.fh).apply(null,arguments)},eu=e.dynCall_vijjij=function(){return(eu=e.dynCall_vijjij=e.asm.gh).apply(null,arguments)},iu=e.dynCall_jiiiii=function(){return(iu=e.dynCall_jiiiii=e.asm.hh).apply(null,arguments)},ru=e.dynCall_viijjji=function(){return(ru=e.dynCall_viijjji=e.asm.ih).apply(null,arguments)},nu=e.dynCall_vijiiii=function(){return(nu=e.dynCall_vijiiii=e.asm.jh).apply(null,arguments)},su=e.dynCall_iijjijj=function(){return(su=e.dynCall_iijjijj=e.asm.kh).apply(null,arguments)},ou=e.dynCall_viiiijiiiii=function(){return(ou=e.dynCall_viiiijiiiii=e.asm.lh).apply(null,arguments)},au=e.dynCall_viiiijiiii=function(){return(au=e.dynCall_viiiijiiii=e.asm.mh).apply(null,arguments)},lu=e.dynCall_iiiiiij=function(){return(lu=e.dynCall_iiiiiij=e.asm.nh).apply(null,arguments)},cu=e.dynCall_iiiiiiiiiiji=function(){return(cu=e.dynCall_iiiiiiiiiiji=e.asm.oh).apply(null,arguments)},uu=e.dynCall_iiiiiiiij=function(){return(uu=e.dynCall_iiiiiiiij=e.asm.ph).apply(null,arguments)},du=e.dynCall_jiiijjj=function(){return(du=e.dynCall_jiiijjj=e.asm.qh).apply(null,arguments)},fu=e.dynCall_viijijj=function(){return(fu=e.dynCall_viijijj=e.asm.rh).apply(null,arguments)},hu=e.dynCall_jiiiiji=function(){return(hu=e.dynCall_jiiiiji=e.asm.sh).apply(null,arguments)},pu=e.dynCall_iiiiijij=function(){return(pu=e.dynCall_iiiiijij=e.asm.th).apply(null,arguments)},yu=e.dynCall_viiiiiji=function(){return(yu=e.dynCall_viiiiiji=e.asm.uh).apply(null,arguments)},_u=e.dynCall_jiiiiiii=function(){return(_u=e.dynCall_jiiiiiii=e.asm.vh).apply(null,arguments)},mu=e.dynCall_vijiji=function(){return(mu=e.dynCall_vijiji=e.asm.wh).apply(null,arguments)},bu=e.dynCall_jiiiij=function(){return(bu=e.dynCall_jiiiij=e.asm.xh).apply(null,arguments)},gu=e.dynCall_jijjij=function(){return(gu=e.dynCall_jijjij=e.asm.yh).apply(null,arguments)},vu=e.dynCall_viiiijiiiiiiii=function(){return(vu=e.dynCall_viiiijiiiiiiii=e.asm.zh).apply(null,arguments)},wu=e.dynCall_ij=function(){return(wu=e.dynCall_ij=e.asm.Ah).apply(null,arguments)},ju=e.dynCall_jjj=function(){return(ju=e.dynCall_jjj=e.asm.Bh).apply(null,arguments)},Su=e.dynCall_jiiji=function(){return(Su=e.dynCall_jiiji=e.asm.Ch).apply(null,arguments)},Iu=e.dynCall_jjiji=function(){return(Iu=e.dynCall_jjiji=e.asm.Dh).apply(null,arguments)},Au=e.dynCall_jiiij=function(){return(Au=e.dynCall_jiiij=e.asm.Eh).apply(null,arguments)},Cu=e.dynCall_jijij=function(){return(Cu=e.dynCall_jijij=e.asm.Fh).apply(null,arguments)},xu=e.dynCall_jijj=function(){return(xu=e.dynCall_jijj=e.asm.Gh).apply(null,arguments)},Fu=e.dynCall_jiiijj=function(){return(Fu=e.dynCall_jiiijj=e.asm.Hh).apply(null,arguments)},Bu=e.dynCall_vjii=function(){return(Bu=e.dynCall_vjii=e.asm.Ih).apply(null,arguments)},Tu=e.dynCall_jjjjjjd=function(){return(Tu=e.dynCall_jjjjjjd=e.asm.Jh).apply(null,arguments)},Du=e.dynCall_viiiji=function(){return(Du=e.dynCall_viiiji=e.asm.Kh).apply(null,arguments)},Eu=e.dynCall_ijii=function(){return(Eu=e.dynCall_ijii=e.asm.Lh).apply(null,arguments)},ku=e.dynCall_vjiiii=function(){return(ku=e.dynCall_vjiiii=e.asm.Mh).apply(null,arguments)},Ou=e.dynCall_viiiiijiii=function(){return(Ou=e.dynCall_viiiiijiii=e.asm.Nh).apply(null,arguments)},Mu=e.dynCall_jiij=function(){return(Mu=e.dynCall_jiij=e.asm.Oh).apply(null,arguments)},Ru=e.dynCall_vijji=function(){return(Ru=e.dynCall_vijji=e.asm.Ph).apply(null,arguments)},Uu=e.dynCall_iiiijjii=function(){return(Uu=e.dynCall_iiiijjii=e.asm.Qh).apply(null,arguments)},Nu=e.dynCall_iiiiijji=function(){return(Nu=e.dynCall_iiiiijji=e.asm.Rh).apply(null,arguments)},Lu=e.dynCall_viiijjii=function(){return(Lu=e.dynCall_viiijjii=e.asm.Sh).apply(null,arguments)},Pu=e.dynCall_viiiijji=function(){return(Pu=e.dynCall_viiiijji=e.asm.Th).apply(null,arguments)},Vu=e.dynCall_viiiijjii=function(){return(Vu=e.dynCall_viiiijjii=e.asm.Uh).apply(null,arguments)},Hu=e.dynCall_viiiiijji=function(){return(Hu=e.dynCall_viiiiijji=e.asm.Vh).apply(null,arguments)},zu=e.dynCall_iidj=function(){return(zu=e.dynCall_iidj=e.asm.Wh).apply(null,arguments)},Wu=e.dynCall_ijji=function(){return(Wu=e.dynCall_ijji=e.asm.Xh).apply(null,arguments)},$u=e.dynCall_iiiiiiij=function(){return($u=e.dynCall_iiiiiiij=e.asm.Yh).apply(null,arguments)},Yu=e.dynCall_iiiiiiiiiiiij=function(){return(Yu=e.dynCall_iiiiiiiiiiiij=e.asm.Zh).apply(null,arguments)},Xu=e.dynCall_iiijjiiji=function(){return(Xu=e.dynCall_iiijjiiji=e.asm._h).apply(null,arguments)},Gu=e.dynCall_iiijjiij=function(){return(Gu=e.dynCall_iiijjiij=e.asm.$h).apply(null,arguments)},Ku=e.dynCall_iiiiiiiji=function(){return(Ku=e.dynCall_iiiiiiiji=e.asm.ai).apply(null,arguments)},Ju=e.dynCall_iiiidjj=function(){return(Ju=e.dynCall_iiiidjj=e.asm.bi).apply(null,arguments)},qu=e.dynCall_iiiijjj=function(){return(qu=e.dynCall_iiiijjj=e.asm.ci).apply(null,arguments)},Zu=e.dynCall_vijii=function(){return(Zu=e.dynCall_vijii=e.asm.di).apply(null,arguments)},Qu=e.dynCall_jiiiiiijii=function(){return(Qu=e.dynCall_jiiiiiijii=e.asm.ei).apply(null,arguments)},td=e.dynCall_iiiijji=function(){return(td=e.dynCall_iiiijji=e.asm.fi).apply(null,arguments)},ed=e.dynCall_viiijji=function(){return(ed=e.dynCall_viiijji=e.asm.gi).apply(null,arguments)},id=e.dynCall_jiiiiii=function(){return(id=e.dynCall_jiiiiii=e.asm.hi).apply(null,arguments)},rd=e.dynCall_iiijiii=function(){return(rd=e.dynCall_iiijiii=e.asm.ii).apply(null,arguments)},nd=e.dynCall_iiiiijii=function(){return(nd=e.dynCall_iiiiijii=e.asm.ji).apply(null,arguments)},sd=e.dynCall_iiijiij=function(){return(sd=e.dynCall_iiijiij=e.asm.ki).apply(null,arguments)},od=e.dynCall_iijjii=function(){return(od=e.dynCall_iijjii=e.asm.li).apply(null,arguments)},ad=e.dynCall_iijjiii=function(){return(ad=e.dynCall_iijjiii=e.asm.mi).apply(null,arguments)},ld=e.dynCall_iijjiiii=function(){return(ld=e.dynCall_iijjiiii=e.asm.ni).apply(null,arguments)},cd=e.dynCall_iijji=function(){return(cd=e.dynCall_iijji=e.asm.oi).apply(null,arguments)},ud=e.dynCall_iijiiii=function(){return(ud=e.dynCall_iijiiii=e.asm.pi).apply(null,arguments)},dd=e.dynCall_iijii=function(){return(dd=e.dynCall_iijii=e.asm.qi).apply(null,arguments)},fd=e.dynCall_vjjii=function(){return(fd=e.dynCall_vjjii=e.asm.ri).apply(null,arguments)},hd=e.dynCall_viiiijii=function(){return(hd=e.dynCall_viiiijii=e.asm.si).apply(null,arguments)},pd=e.dynCall_iiiijiii=function(){return(pd=e.dynCall_iiiijiii=e.asm.ti).apply(null,arguments)},yd=e.dynCall_iiijij=function(){return(yd=e.dynCall_iiijij=e.asm.ui).apply(null,arguments)},_d=e.dynCall_iijj=function(){return(_d=e.dynCall_iijj=e.asm.vi).apply(null,arguments)},md=e.dynCall_iiiijj=function(){return(md=e.dynCall_iiiijj=e.asm.wi).apply(null,arguments)},bd=e.dynCall_viiijiii=function(){return(bd=e.dynCall_viiijiii=e.asm.xi).apply(null,arguments)},gd=e.dynCall_viiiijij=function(){return(gd=e.dynCall_viiiijij=e.asm.yi).apply(null,arguments)},vd=e.dynCall_iiijiiii=function(){return(vd=e.dynCall_iiijiiii=e.asm.zi).apply(null,arguments)},wd=e.dynCall_iiiiijjiijj=function(){return(wd=e.dynCall_iiiiijjiijj=e.asm.Ai).apply(null,arguments)},jd=e.dynCall_viijiiji=function(){return(jd=e.dynCall_viijiiji=e.asm.Bi).apply(null,arguments)},Sd=e.dynCall_iiijjii=function(){return(Sd=e.dynCall_iiijjii=e.asm.Ci).apply(null,arguments)},Id=e.dynCall_vjjijij=function(){return(Id=e.dynCall_vjjijij=e.asm.Di).apply(null,arguments)},Ad=e.dynCall_vijjji=function(){return(Ad=e.dynCall_vijjji=e.asm.Ei).apply(null,arguments)},Cd=e.dynCall_jiiiji=function(){return(Cd=e.dynCall_jiiiji=e.asm.Fi).apply(null,arguments)},xd=e.dynCall_viijjii=function(){return(xd=e.dynCall_viijjii=e.asm.Gi).apply(null,arguments)},Fd=e.dynCall_viiiijj=function(){return(Fd=e.dynCall_viiiijj=e.asm.Hi).apply(null,arguments)},Bd=e.dynCall_jijiii=function(){return(Bd=e.dynCall_jijiii=e.asm.Ii).apply(null,arguments)},Td=e.dynCall_viijiiij=function(){return(Td=e.dynCall_viijiiij=e.asm.Ji).apply(null,arguments)},Dd=e.dynCall_vijiiiji=function(){return(Dd=e.dynCall_vijiiiji=e.asm.Ki).apply(null,arguments)},Ed=e.dynCall_viiijij=function(){return(Ed=e.dynCall_viiijij=e.asm.Li).apply(null,arguments)},kd=e.dynCall_viijiij=function(){return(kd=e.dynCall_viijiij=e.asm.Mi).apply(null,arguments)},Od=e.dynCall_vijij=function(){return(Od=e.dynCall_vijij=e.asm.Ni).apply(null,arguments)},Md=e.dynCall_vjiiiji=function(){return(Md=e.dynCall_vjiiiji=e.asm.Oi).apply(null,arguments)},Rd=e.dynCall_viijiiiiii=function(){return(Rd=e.dynCall_viijiiiiii=e.asm.Pi).apply(null,arguments)},Ud=e.dynCall_jjjji=function(){return(Ud=e.dynCall_jjjji=e.asm.Qi).apply(null,arguments)},Nd=e.dynCall_jjjii=function(){return(Nd=e.dynCall_jjjii=e.asm.Ri).apply(null,arguments)},Ld=e.dynCall_jji=function(){return(Ld=e.dynCall_jji=e.asm.Si).apply(null,arguments)},Pd=e.dynCall_iijiji=function(){return(Pd=e.dynCall_iijiji=e.asm.Ti).apply(null,arguments)},Vd=e.dynCall_viiijijiji=function(){return(Vd=e.dynCall_viiijijiji=e.asm.Ui).apply(null,arguments)},Hd=e.dynCall_iiijjj=function(){return(Hd=e.dynCall_iiijjj=e.asm.Vi).apply(null,arguments)},zd=e.dynCall_vj=function(){return(zd=e.dynCall_vj=e.asm.Wi).apply(null,arguments)},Wd=e.dynCall_iiiijii=function(){return(Wd=e.dynCall_iiiijii=e.asm.Xi).apply(null,arguments)},$d=e.dynCall_iijiii=function(){return($d=e.dynCall_iijiii=e.asm.Yi).apply(null,arguments)},Yd=e.dynCall_vijiijj=function(){return(Yd=e.dynCall_vijiijj=e.asm.Zi).apply(null,arguments)},Xd=e.dynCall_vifiijj=function(){return(Xd=e.dynCall_vifiijj=e.asm._i).apply(null,arguments)},Gd=e.dynCall_vidiijj=function(){return(Gd=e.dynCall_vidiijj=e.asm.$i).apply(null,arguments)},Kd=e.dynCall_viiiiij=function(){return(Kd=e.dynCall_viiiiij=e.asm.aj).apply(null,arguments)},Jd=e.dynCall_ijjiii=function(){return(Jd=e.dynCall_ijjiii=e.asm.bj).apply(null,arguments)},qd=e.dynCall_vijijjji=function(){return(qd=e.dynCall_vijijjji=e.asm.cj).apply(null,arguments)},Zd=e.dynCall_viijiijj=function(){return(Zd=e.dynCall_viijiijj=e.asm.dj).apply(null,arguments)},Qd=e.dynCall_viiiiijjji=function(){return(Qd=e.dynCall_viiiiijjji=e.asm.ej).apply(null,arguments)},tf=e.dynCall_iiijiijj=function(){return(tf=e.dynCall_iiijiijj=e.asm.fj).apply(null,arguments)},ef=e.dynCall_viiijijjj=function(){return(ef=e.dynCall_viiijijjj=e.asm.gj).apply(null,arguments)},rf=e.dynCall_iijiijj=function(){return(rf=e.dynCall_iijiijj=e.asm.hj).apply(null,arguments)},nf=e.dynCall_viiijjjji=function(){return(nf=e.dynCall_viiijjjji=e.asm.ij).apply(null,arguments)},sf=e.dynCall_viiiijiii=function(){return(sf=e.dynCall_viiiijiii=e.asm.jj).apply(null,arguments)},of=e.dynCall_viijiiii=function(){return(of=e.dynCall_viijiiii=e.asm.kj).apply(null,arguments)},af=e.dynCall_vijjiiii=function(){return(af=e.dynCall_vijjiiii=e.asm.lj).apply(null,arguments)},lf=e.dynCall_vijijjiiiii=function(){return(lf=e.dynCall_vijijjiiiii=e.asm.mj).apply(null,arguments)},cf=e.dynCall_vijjiiiii=function(){return(cf=e.dynCall_vijjiiiii=e.asm.nj).apply(null,arguments)},uf=e.dynCall_iiijjji=function(){return(uf=e.dynCall_iiijjji=e.asm.oj).apply(null,arguments)},df=e.dynCall_iiiiiijji=function(){return(df=e.dynCall_iiiiiijji=e.asm.pj).apply(null,arguments)},ff=e.dynCall_iiiiijjj=function(){return(ff=e.dynCall_iiiiijjj=e.asm.qj).apply(null,arguments)},hf=e.dynCall_jijiiii=function(){return(hf=e.dynCall_jijiiii=e.asm.rj).apply(null,arguments)},pf=e.dynCall_viiijiji=function(){return(pf=e.dynCall_viiijiji=e.asm.sj).apply(null,arguments)},yf=e.dynCall_iiijjjii=function(){return(yf=e.dynCall_iiijjjii=e.asm.tj).apply(null,arguments)},_f=e.dynCall_iiiiijjji=function(){return(_f=e.dynCall_iiiiijjji=e.asm.uj).apply(null,arguments)},mf=e.dynCall_viijiji=function(){return(mf=e.dynCall_viijiji=e.asm.vj).apply(null,arguments)};function Sm(s){var a=j();try{U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Im(s,a,l){var u=j();try{U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Am(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Cm(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function xm(s,a){var l=j();try{U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Fm(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Bm(s,a,l,u,d,f){var p=j();try{return U(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Tm(s,a,l,u,d){var f=j();try{U(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Dm(s,a,l,u,d){var f=j();try{return U(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Em(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function km(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Om(s,a,l,u){var d=j();try{U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Mm(s,a,l,u){var d=j();try{U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Rm(s,a,l,u){var d=j();try{U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Um(s,a,l,u,d,f,p,y){var _=j();try{return U(s)(a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Nm(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return U(s)(a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Lm(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{return U(s)(a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function Pm(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Vm(s,a,l,u,d,f,p,y){var _=j();try{U(s)(a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Hm(s,a,l,u,d,f,p){var y=j();try{return U(s)(a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function zm(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{return U(s)(a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Wm(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{U(s)(a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function $m(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st){var dt=j();try{U(s)(a,l,u,d,f,p,y,_,b,g,I,x,D,E,st)}catch(kt){if(S(dt),kt!==kt+0)throw kt;w(1,0)}}function Ym(s,a,l,u,d,f,p){var y=j();try{U(s)(a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Xm(s,a,l,u,d,f){var p=j();try{return U(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Gm(s,a,l,u,d,f,p,y,_){var b=j();try{U(s)(a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Km(s,a,l,u,d,f){var p=j();try{U(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Jm(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function qm(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Zm(s,a,l,u,d,f,p,y,_,b){var g=j();try{return U(s)(a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Qm(s,a,l,u,d,f,p,y,_){var b=j();try{return U(s)(a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function tb(s,a,l,u,d){var f=j();try{return U(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function eb(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function ib(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function rb(s,a,l){var u=j();try{U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function nb(s,a,l){var u=j();try{U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function sb(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function ob(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function ab(s,a,l,u,d,f,p,y,_,b,g,I,x,D){var E=j();try{U(s)(a,l,u,d,f,p,y,_,b,g,I,x,D)}catch(st){if(S(E),st!==st+0)throw st;w(1,0)}}function lb(s,a,l,u,d,f,p,y,_,b){var g=j();try{U(s)(a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function cb(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st){var dt=j();try{return U(s)(a,l,u,d,f,p,y,_,b,g,I,x,D,E,st)}catch(kt){if(S(dt),kt!==kt+0)throw kt;w(1,0)}}function ub(s,a,l,u,d){var f=j();try{return U(s)(a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function db(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function fb(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function hb(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{U(s)(a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function pb(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E){var st=j();try{return U(s)(a,l,u,d,f,p,y,_,b,g,I,x,D,E)}catch(dt){if(S(st),dt!==dt+0)throw dt;w(1,0)}}function yb(s,a,l,u,d,f){var p=j();try{U(s)(a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function _b(s,a,l,u,d,f,p,y,_,b){var g=j();try{U(s)(a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function mb(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{U(s)(a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function bb(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function gb(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function vb(s,a,l,u,d){var f=j();try{return zl(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function wb(s,a,l,u,d,f,p){var y=j();try{Zl(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function jb(s,a){var l=j();try{return Gl(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Sb(s,a,l){var u=j();try{return fc(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Ib(s,a,l,u,d,f,p){var y=j();try{Yl(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ab(s,a,l,u,d,f,p){var y=j();try{return Wl(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Cb(s,a,l,u,d,f,p,y,_){var b=j();try{return $l(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function xb(s,a,l,u){var d=j();try{return Kl(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Fb(s,a,l,u,d,f){var p=j();try{tc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Bb(s,a,l,u,d){var f=j();try{Jl(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Tb(s){var a=j();try{return Xl(s)}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Db(s,a,l,u,d,f,p,y){var _=j();try{ec(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Eb(s,a,l,u,d,f,p){var y=j();try{return ic(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function kb(s,a,l,u,d,f,p,y){var _=j();try{ql(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Ob(s,a,l,u){var d=j();try{uc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Mb(s,a,l,u,d,f,p){var y=j();try{dc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Rb(s,a,l,u,d,f){var p=j();try{rc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Ub(s,a,l,u,d){var f=j();try{return sc(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Nb(s,a,l,u,d,f,p,y,_){var b=j();try{oc(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Lb(s,a,l,u,d,f,p,y,_,b){var g=j();try{ac(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Pb(s,a,l,u){var d=j();try{return lc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Vb(s,a,l,u,d){var f=j();try{cc(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Hb(s,a,l,u,d,f,p,y){var _=j();try{Ql(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function zb(s,a,l,u,d,f,p,y,_){var b=j();try{tu(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Wb(s,a,l,u,d,f,p,y){var _=j();try{return md(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function $b(s,a,l,u,d){var f=j();try{return hc(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Yb(s,a,l,u,d,f,p,y){var _=j();try{return Jd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Xb(s,a,l,u,d,f,p,y,_){var b=j();try{ed(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Gb(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{Vd(s,a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function Kb(s,a,l,u,d,f,p,y,_){var b=j();try{Ed(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Jb(s,a,l,u,d,f,p,y){var _=j();try{return yd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function qb(s,a,l,u,d,f){var p=j();try{return _c(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Zb(s,a,l,u,d,f,p,y,_){var b=j();try{return sd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Qb(s,a,l,u,d,f){var p=j();try{return _d(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function tg(s,a,l,u,d,f,p,y){var _=j();try{return Xc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function eg(s,a,l,u,d,f){var p=j();try{return pc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function ig(s,a,l,u,d,f,p,y){var _=j();try{return yc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function rg(s,a,l,u,d,f,p){var y=j();try{return mc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function ng(s,a,l,u,d,f,p){var y=j();try{Qc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function sg(s,a,l,u,d,f,p,y){var _=j();try{nu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function og(s,a,l,u){var d=j();try{return bc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function ag(s,a,l,u,d,f,p,y){var _=j();try{nc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function lg(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{Mc(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function cg(s,a,l,u,d,f,p,y){var _=j();try{Rc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ug(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{Uc(s,a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function dg(s,a,l,u,d,f,p,y,_,b){var g=j();try{vc(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function fg(s,a,l,u,d,f,p,y){var _=j();try{Tc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function hg(s,a,l,u,d,f,p,y,_){var b=j();try{return Dc(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function pg(s,a,l,u,d,f,p){var y=j();try{return wc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function yg(s,a,l,u,d,f,p){var y=j();try{return jc(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function _g(s,a,l,u,d,f,p,y){var _=j();try{Sc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function mg(s,a,l,u,d,f){var p=j();try{xc(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function bg(s,a,l,u,d,f,p){var y=j();try{return Ic(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function gg(s,a,l,u,d,f,p){var y=j();try{return Ac(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function vg(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return Cc(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function wg(s,a,l,u,d,f,p,y){var _=j();try{return Bc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function jg(s,a,l,u,d,f,p,y){var _=j();try{return Fc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Sg(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{return Ec(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Ig(s,a,l,u,d,f,p,y,_){var b=j();try{return kc(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Ag(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{Oc(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Cg(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{Lc(s,a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function xg(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{Pc(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Fg(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st){var dt=j();try{Vc(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st)}catch(kt){if(S(dt),kt!==kt+0)throw kt;w(1,0)}}function Bg(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st,dt,kt){var T=j();try{Hc(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st,dt,kt)}catch(P){if(S(T),P!==P+0)throw P;w(1,0)}}function Tg(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{Nc(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Dg(s,a,l,u,d,f){var p=j();try{return iu(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Eg(s,a,l,u,d,f,p,y,_){var b=j();try{Kc(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function kg(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return Qu(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Og(s,a,l,u,d,f,p,y,_){var b=j();try{return td(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Mg(s,a,l){var u=j();try{return zc(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Rg(s,a){var l=j();try{return Wc(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Ug(s,a){var l=j();try{return $c(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Ng(s,a,l,u,d,f,p){var y=j();try{return id(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Lg(s,a,l,u,d,f,p){var y=j();try{Du(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Pg(s,a,l,u,d,f){var p=j();try{return Wu(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Vg(s,a,l,u,d,f,p,y,_){var b=j();try{return Jc(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Hg(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return qc(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function zg(s,a,l,u,d,f,p,y,_,b){var g=j();try{Zc(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Wg(s,a,l,u,d,f,p,y){var _=j();try{return Yc(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function $g(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st,dt){var kt=j();try{Gc(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E,st,dt)}catch(T){if(S(kt),T!==T+0)throw T;w(1,0)}}function Yg(s,a,l,u,d,f,p,y,_){var b=j();try{eu(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Xg(s,a,l,u,d,f,p,y,_,b){var g=j();try{return uu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Gg(s,a,l,u,d,f,p,y,_,b){var g=j();try{ru(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Kg(s,a,l,u,d,f,p,y){var _=j();try{return lu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Jg(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{return cu(s,a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function qg(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return su(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Zg(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{ou(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Qg(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{au(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function tv(s,a,l,u,d,f,p,y,_,b){var g=j();try{return du(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function ev(s,a,l,u,d,f,p,y,_,b){var g=j();try{fu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function iv(s,a,l,u,d,f,p,y){var _=j();try{return hu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function rv(s,a,l,u,d,f,p,y,_,b){var g=j();try{return pu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function nv(s,a,l,u,d,f,p,y,_){var b=j();try{yu(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function sv(s,a,l,u,d,f,p,y){var _=j();try{return _u(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ov(s,a,l,u,d,f,p,y,_){var b=j();try{return $u(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function av(s,a,l,u,d,f,p,y,_,b,g,I,x,D){var E=j();try{return Yu(s,a,l,u,d,f,p,y,_,b,g,I,x,D)}catch(st){if(S(E),st!==st+0)throw st;w(1,0)}}function lv(s,a,l,u,d,f,p,y){var _=j();try{mu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function cv(s,a,l,u,d,f){var p=j();try{return Su(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function uv(s,a,l,u,d,f,p){var y=j();try{return Iu(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function dv(s,a,l,u,d,f){var p=j();try{return Au(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function fv(s,a,l,u,d,f,p){var y=j();try{return Cu(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function hv(s,a,l,u,d,f){var p=j();try{return xu(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function pv(s,a,l,u,d,f,p,y){var _=j();try{return Fu(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function yv(s,a,l){var u=j();try{return wu(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function _v(s,a,l,u,d,f,p){var y=j();try{ku(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function mv(s,a,l,u){var d=j();try{return gc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function bv(s,a,l,u,d){var f=j();try{return Eu(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function gv(s,a,l,u,d){var f=j();try{Bu(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function vv(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{Ou(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function wv(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E){var st=j();try{vu(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E)}catch(dt){if(S(st),dt!==dt+0)throw dt;w(1,0)}}function jv(s,a,l,u,d){var f=j();try{return ju(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Sv(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{return Tu(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Iv(s,a,l,u,d){var f=j();try{return Mu(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Av(s,a,l,u,d,f,p){var y=j();try{Ru(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Cv(s,a,l,u,d,f,p,y,_,b){var g=j();try{return Uu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function xv(s,a,l,u,d,f,p,y,_,b){var g=j();try{return Nu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Fv(s,a,l,u,d,f,p,y,_,b){var g=j();try{Lu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Bv(s,a,l,u,d,f,p,y,_,b){var g=j();try{Pu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Tv(s,a,l,u,d,f,p){var y=j();try{return bu(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Dv(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{Vu(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Ev(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{Hu(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function kv(s,a,l,u,d){var f=j();try{return zu(s,a,l,u,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Ov(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{return Xu(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Mv(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return Gu(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Rv(s,a,l,u,d,f,p,y,_,b){var g=j();try{return Ku(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Uv(s,a,l,u,d,f,p,y,_){var b=j();try{return Ju(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Nv(s,a,l,u,d,f,p,y,_,b){var g=j();try{return qu(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Lv(s,a,l,u,d,f){var p=j();try{Zu(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Pv(s,a,l,u,d,f,p,y){var _=j();try{return rd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Vv(s,a,l,u,d,f,p,y,_){var b=j();try{return nd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Hv(s,a,l,u,d,f,p,y){var _=j();try{return od(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function zv(s,a,l,u,d,f,p,y,_){var b=j();try{return ad(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Wv(s,a,l,u,d,f,p,y,_,b){var g=j();try{return ld(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function $v(s,a,l,u,d,f,p){var y=j();try{return cd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Yv(s,a,l,u,d,f,p,y){var _=j();try{return ud(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Xv(s,a,l,u,d,f){var p=j();try{return dd(s,a,l,u,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Gv(s,a,l,u,d,f,p){var y=j();try{fd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Kv(s,a,l,u,d,f,p,y,_){var b=j();try{hd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Jv(s,a,l,u,d,f,p,y,_){var b=j();try{return pd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function qv(s,a,l,u,d,f,p,y,_){var b=j();try{bd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function Zv(s,a,l,u,d,f,p,y,_,b){var g=j();try{gd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function Qv(s,a,l,u,d,f,p,y,_){var b=j();try{return vd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function t0(s,a,l,u,d,f,p,y,_){var b=j();try{Ad(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function e0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{Id(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function i0(s,a,l,u,d,f,p,y,_,b){var g=j();try{jd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function r0(s,a,l,u,d,f,p){var y=j();try{return Cd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function n0(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E){var st=j();try{return wd(s,a,l,u,d,f,p,y,_,b,g,I,x,D,E)}catch(dt){if(S(st),dt!==dt+0)throw dt;w(1,0)}}function s0(s,a,l,u,d,f,p,y,_){var b=j();try{return Sd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function o0(s,a,l,u,d,f,p,y,_){var b=j();try{xd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function a0(s,a,l,u,d,f,p,y,_,b){var g=j();try{Td(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function l0(s,a,l,u,d,f,p){var y=j();try{return Bd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function c0(s,a,l,u,d,f,p,y,_,b){var g=j();try{Dd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function u0(s,a,l,u,d,f,p,y,_){var b=j();try{return gu(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function d0(s,a,l,u,d,f,p,y,_){var b=j();try{kd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function f0(s,a,l,u,d,f,p,y,_){var b=j();try{Fd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function h0(s,a,l,u,d,f,p){var y=j();try{Od(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function p0(s,a,l,u,d,f,p,y,_){var b=j();try{Md(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function y0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{Rd(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function _0(s,a,l,u,d,f,p,y){var _=j();try{return Ud(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function m0(s,a,l,u,d,f,p){var y=j();try{return Nd(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function b0(s,a,l,u){var d=j();try{return Ld(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function g0(s,a,l,u,d,f,p,y){var _=j();try{return Pd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function v0(s,a,l,u,d,f,p,y,_){var b=j();try{return Hd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function w0(s,a,l){var u=j();try{zd(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function j0(s,a,l,u,d,f,p,y){var _=j();try{return Wd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function S0(s,a,l,u,d,f,p){var y=j();try{return $d(s,a,l,u,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function I0(s,a,l,u,d,f,p,y,_,b){var g=j();try{Yd(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function A0(s,a,l,u,d,f,p,y,_){var b=j();try{Xd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function C0(s,a,l,u,d,f,p,y,_){var b=j();try{Gd(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function x0(s,a,l,u,d,f,p,y){var _=j();try{Kd(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function F0(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{qd(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function B0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return tf(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function T0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{Zd(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function D0(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{Qd(s,a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function E0(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{ef(s,a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function k0(s,a,l,u,d,f,p,y,_,b){var g=j();try{return rf(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function O0(s,a,l,u,d,f,p,y,_,b){var g=j();try{return uf(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function M0(s,a,l,u,d,f,p,y,_,b,g,I,x){var D=j();try{nf(s,a,l,u,d,f,p,y,_,b,g,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function R0(s,a,l,u,d,f,p,y,_,b){var g=j();try{sf(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function U0(s,a,l,u,d,f,p,y,_){var b=j();try{of(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function N0(s,a,l,u,d,f,p,y,_){var b=j();try{mf(s,a,l,u,d,f,p,y,_)}catch(g){if(S(b),g!==g+0)throw g;w(1,0)}}function L0(s,a,l,u,d,f,p,y,_,b,g,I,x,D){var E=j();try{lf(s,a,l,u,d,f,p,y,_,b,g,I,x,D)}catch(st){if(S(E),st!==st+0)throw st;w(1,0)}}function P0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{cf(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function V0(s,a,l,u,d,f,p,y,_,b){var g=j();try{af(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function H0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return df(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function z0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return yf(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function W0(s,a,l,u,d,f,p,y,_,b){var g=j();try{pf(s,a,l,u,d,f,p,y,_,b)}catch(I){if(S(g),I!==I+0)throw I;w(1,0)}}function $0(s,a,l,u,d,f,p,y){var _=j();try{return hf(s,a,l,u,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Y0(s,a,l,u,d,f,p,y,_,b,g){var I=j();try{return ff(s,a,l,u,d,f,p,y,_,b,g)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function X0(s,a,l,u,d,f,p,y,_,b,g,I){var x=j();try{return _f(s,a,l,u,d,f,p,y,_,b,g,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}e.ccall=Lp;var ps;function ys(s){this.name="ExitStatus",this.message="Program terminated with exit("+s+")",this.status=s}var G0=!1;un=function s(){ps||fa(),ps||(un=s)};function K0(s){var a=e._main,l=0,u=0;try{var d=a(l,u);return J0(d,!0),d}catch(f){return sy(f)}finally{G0=!0}}function fa(s){if(s=s||c,dr>0||(Xp(),dr>0))return;function a(){ps||(ps=!0,e.calledRun=!0,!Ht&&(Gp(),Kp(),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),bf&&K0(s),Jp()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),a()},1)):a()}e.run=fa;function J0(s,a){yt=s,q0(s)}function q0(s){yt=s,Fl()||(e.onExit&&e.onExit(s),Ht=!0),m(s,new ys(s))}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();var bf=!0;return e.noInitialRun&&(bf=!1),fa(),t.ready}})(),Tp=VS;var Ko=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=Rt.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Et(r)}async send(t){let e=this._bindings.startPendingQuery(this._conn,t);for(;e==null;)e=await new Promise((o,c)=>{try{o(this._bindings.pollPendingQuery(this._conn))}catch(h){c(h)}});let r=new Jo(this._bindings,this._conn,e),n=Rt.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}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 fl(this._bindings,this._conn,e)}createScalarFunction(t,e,r){this._bindings.createScalarFunction(this._conn,t,e,r)}insertArrowTable(t,e){let r=Yo(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)}},Jo=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=this.bindings.fetchQueryResults(this.conn);return this._depleted=t.length==0,{done:this._depleted,value:t}}[Symbol.iterator](){return this}},fl=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=Rt.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Et(r)}send(...t){let e=this.bindings.sendPrepared(this.connectionId,this.statementId,t),r=new Jo(this.bindings,this.connectionId,e),n=Rt.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};var kp=new TextEncoder,Dp=new TextDecoder("utf-8");function hl(i,t,e){let r=kp.encode(e),n=i._malloc(r.byteLength),o=i.HEAPU8.subarray(n,n+r.byteLength);o.set(r),i.HEAPF64[(t>>3)+0]=1,i.HEAPF64[(t>>3)+1]=n,i.HEAPF64[(t>>3)+2]=o.byteLength}function yl(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 pl(i,t,e,r){let n=i.HEAPU8.subarray(t,t+r*yl(e));switch(e){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function Ep(i,t,e){let r=i.HEAPU8.subarray(t,t+e);return new Uint8Array(r.buffer,r.byteOffset,e)}function qo(i,t,e){let r=i.HEAPU8.subarray(t,t+e*8);return new Float64Array(r.buffer,r.byteOffset,e)}function Op(i,t,e,r,n,o,c,h){try{let m=i._udfFunctions.get(r);if(!m){hl(t,e,"Unknown UDF with id: "+r);return}let v=Dp.decode(t.HEAPU8.subarray(n,n+o)),C=JSON.parse(v),B=qo(t,c,h/8),F=L=>{var Jt;let le=null;switch(L.validityBuffer!==void 0&&(le=Ep(t,B[L.validityBuffer],C.rows)),L.physicalType){case"VARCHAR":{if(L.dataBuffer===null||L.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(L.lengthBuffer===null||L.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let pe=pl(t,B[L.dataBuffer],L.physicalType,C.rows),Vt=[],Ht=qo(t,B[L.lengthBuffer],C.rows);for(let yt=0;yt<C.rows;++yt){if(le!=null&&!le[yt]){Vt.push(null);continue}let ye=t.HEAPU8.subarray(pe[yt],pe[yt]+Ht[yt]),Er=Dp.decode(ye);Vt.push(Er)}return yt=>Vt[yt]}case"STRUCT":{let pe={},Vt=[];for(let Ht=0;Ht<(((Jt=L.children)==null?void 0:Jt.length)||0);++Ht){let yt=L.children[Ht],ye=F(yt);Vt.push(Er=>{pe[yt.name]=ye(Er)})}return le!=null?Ht=>{if(!le[Ht])return null;for(let yt of Vt)yt(Ht);return pe}:Ht=>{for(let yt of Vt)yt(Ht);return pe}}default:{if(L.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+L.physicalType);let pe=pl(t,B[L.dataBuffer],L.physicalType,C.rows);return le!=null?Vt=>le[Vt]?pe[Vt]:null:Vt=>pe[Vt]}}},k=[];for(let L=0;L<C.args.length;++L)k.push(F(C.args[L]));let lt=C.rows*yl(C.ret.physicalType),ct=t._malloc(lt),mt=pl(t,ct,C.ret.physicalType,C.rows),Dt=t._malloc(C.rows),ae=Ep(t,Dt,C.rows);if(mt.length==0||ae.length==0){hl(t,e,"Can't create physical arrays for result");return}let he=mt;C.ret.physicalType=="VARCHAR"&&(he=new Array(C.rows));let $i=[];for(let L=0;L<C.args.length;++L)$i.push(null);for(let L=0;L<C.rows;++L){for(let Jt=0;Jt<C.args.length;++Jt)$i[Jt]=k[Jt](L);let le=m.func(...$i);he[L]=le,ae[L]=le==null?0:1}let ur=0;switch(C.ret.physicalType){case"VARCHAR":{let L=new Array(0);ur=t._malloc(C.rows*yl("DOUBLE"));let le=qo(t,ur,C.rows),Jt=0;for(let yt=0;yt<C.rows;++yt){let ye=kp.encode(he[yt]||"");L.push(ye),le[yt]=ye.length,Jt+=ye.length}let pe=t._malloc(Jt),Vt=t.HEAPU8.subarray(pe,pe+Jt),Ht=0;for(let yt=0;yt<C.rows;++yt){mt[yt]=Ht;let ye=L[yt];Vt.subarray(Ht,Ht+ye.length).set(ye),Ht+=ye.length}}}let ia=3*8,Oe=t._malloc(ia),Dr=qo(t,Oe,3);Dr[0]=ct,Dr[1]=Dt,Dr[2]=ur,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=Oe,t.HEAPF64[(e>>3)+2]=0}catch(m){hl(t,e,m.toString())}}function zS(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}var WS=zS();function Si(i,t){i.ccall("duckdb_web_fail_with",null,["string"],[t])}function Tr(i,t,e){let r=i.HEAPU8.subarray(t,t+e),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function tt(i,t,e){return WS(i.HEAPU8.subarray(t,t+e))}function pt(i,t,e,r){let n=i.stackSave(),o=i.stackAlloc(3*8);e.unshift("number"),r.unshift(o),i.ccall(t,null,e,r);let c=i.HEAPF64[(o>>3)+0],h=i.HEAPF64[(o>>3)+1],m=i.HEAPF64[(o>>3)+2];return i.stackRestore(n),[c,h,m]}function St(i){i.ccall("duckdb_web_clear_response",null,[],[])}var Zo=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 $S=new TextEncoder;var Qo=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),this)}open(t){let[e,r,n]=pt(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(tt(this.mod,r,n));St(this.mod)}reset(){let[t,e,r]=pt(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));St(this.mod)}getVersion(){let[t,e,r]=pt(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));let n=tt(this.mod,e,r);return St(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let[e,r,n]=pt(this.mod,"duckdb_web_tokenize",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=tt(this.mod,r,n);return St(this.mod),JSON.parse(o)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Ko(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,n,o]=pt(this.mod,"duckdb_web_query_run",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));let c=Tr(this.mod,n,o);return St(this.mod),c}startPendingQuery(t,e){let[r,n,o]=pt(this.mod,"duckdb_web_pending_query_start",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));if(n==0)return null;let c=Tr(this.mod,n,o);return St(this.mod),c}pollPendingQuery(t){let[e,r,n]=pt(this.mod,"duckdb_web_pending_query_poll",["number"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));if(r==0)return null;let o=Tr(this.mod,r,n);return St(this.mod),o}cancelPendingQuery(t){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[t])}fetchQueryResults(t){let[e,r,n]=pt(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=Tr(this.mod,r,n);return St(this.mod),o}getTableNames(t,e){let[r,n,o]=pt(this.mod,"duckdb_web_get_tablenames",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));let c=tt(this.mod,n,o);return St(this.mod),JSON.parse(c)}createScalarFunction(t,e,r,n){let o={functionId:this._nextUDFId,name:e,returnType:ln(r)},c={functionId:o.functionId,connectionId:t,name:e,returnType:r,func:n};this._nextUDFId+=1;let[h,m,v]=pt(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(o)]);if(h!==0)throw new Error(tt(this.mod,m,v));if(St(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(c.functionId,c),this.pthread)for(let C of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])C.postMessage({cmd:"registerUDFFunction",udf:c})}createPrepared(t,e){let[r,n,o]=pt(this.mod,"duckdb_web_prepared_create",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));return St(this.mod),n}closePrepared(t,e){let[r,n,o]=pt(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));St(this.mod)}runPrepared(t,e,r){let[n,o,c]=pt(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(tt(this.mod,o,c));let h=Tr(this.mod,o,c);return St(this.mod),h}sendPrepared(t,e,r){let[n,o,c]=pt(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(tt(this.mod,o,c));let h=Tr(this.mod,o,c);return St(this.mod),h}insertArrowFromIPCStream(t,e,r){if(e.length==0)return;let n=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(n,n+e.length).set(e);let c=r?JSON.stringify(r):"",[h,m,v]=pt(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,n,e.length,c]);if(h!==0)throw new Error(tt(this.mod,m,v))}insertCSVFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let v in r.columns)r.columnsFlat.push(Xo(v,r.columns[v]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[c,h,m]=pt(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,o]);if(c!==0)throw new Error(tt(this.mod,h,m))}insertJSONFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let v in r.columns)r.columnsFlat.push(Xo(v,r.columns[v]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[c,h,m]=pt(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,o]);if(c!==0)throw new Error(tt(this.mod,h,m))}globFiles(t){let[e,r,n]=pt(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=tt(this.mod,r,n);St(this.mod);let c=JSON.parse(o);return c==null?[]:c}registerFileURL(t,e){e===void 0&&(e=t);let[r,n,o]=pt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,e,-1]);if(r!==0)throw new Error(tt(this.mod,n,o));St(this.mod)}registerFileText(t,e){let r=$S.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[o,c,h]=pt(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,r,e.length]);if(o!==0)throw new Error(tt(this.mod,c,h));St(this.mod)}registerFileHandle(t,e){let[r,n,o]=pt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,t,-1]);if(r!==0)throw new Error(tt(this.mod,n,o));if(St(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),this.pthread){for(let c of this.pthread.runningWorkers)c.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e});for(let c of this.pthread.unusedWorkers)c.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,r,n]=pt(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));St(this.mod)}dropFiles(){let[t,e,r]=pt(this.mod,"duckdb_web_fs_drop_files",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));St(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[r,n,o]=pt(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));St(this.mod)}copyFileToBuffer(t){let[e,r,n]=pt(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=this.mod.HEAPU8.subarray(r,r+n),c=new Uint8Array(o.length);return c.set(o),St(this.mod),c}collectFileStatistics(t,e){let[r,n,o]=pt(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o))}exportFileStatistics(t){let[e,r,n]=pt(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));return new Zo(this.mod.HEAPU8.subarray(r,r+n))}};var ta=class extends Qo{constructor(e,r,n,o){super(e,r);this.mainModuleURL=n,this.pthreadWorkerURL=o}locateFile(e,r){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error(`WASM instantiation requested unexpected file: prefix=${r} path=${e}`)}instantiateWasm(e,r){globalThis.DUCKDB_RUNTIME=this._runtime;let n=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let c=(async()=>{var ct;let h=new Request(this.mainModuleURL),m=await fetch(h),v=m.headers.get("content-length"),C=v&&parseInt(v,10)||0,B=new Date,F={startedAt:B,updatedAt:B,bytesTotal:C||0,bytesLoaded:0},k={transform(mt,Dt){F.bytesLoaded+=mt.byteLength;let ae=new Date;if(ae.getTime()-F.updatedAt.getTime()<20){F.updatedAt=ae,Dt.enqueue(mt);return}for(let he of n)he(F);Dt.enqueue(mt)}},lt=new TransformStream(k);return new Response((ct=m.body)==null?void 0:ct.pipeThrough(lt),m)})();WebAssembly.instantiateStreaming(c,e).then(h=>{r(h.instance,h.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let o=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(o),e).then(c=>{r(c.instance,c.module)})}else if(typeof XMLHttpRequest=="function"){let o=new XMLHttpRequest,c=this.mainModuleURL,h=new Date,m={startedAt:h,updatedAt:h,bytesTotal:0,bytesLoaded:0};o.open("GET",c),o.responseType="arraybuffer",o.onerror=v=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+v}),new Error(v.toString())},o.onprogress=v=>{m.bytesTotal=v.total,m.bytesLoaded=v.loaded;let C=new Date;if(C.getTime()-m.updatedAt.getTime()<20){m.updatedAt=C;return}for(let B of n)B(m)},o.onload=()=>{WebAssembly.instantiate(o.response,e).then(v=>{r(v.instance,v.module)}).catch(v=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+v}),new Error(v)})},o.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let c=new Request(this.mainModuleURL),m=await(await fetch(c)).arrayBuffer();WebAssembly.instantiate(m,e).then(v=>{r(v.instance,v.module)})})();return[]}};var ea=class extends ta{constructor(t,e,r,n=null){super(t,e,r,n)}instantiateImpl(t){return Tp({...t,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var ar=vf(Mp()),Rp=function(i,t,e){var r;if((r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")){let n=`${i==null?void 0:i.endpoint}`,o=n.indexOf("://")+3;return n.substring(o)}else return i!=null&&i.endpoint?`${e}.${i==null?void 0:i.endpoint}`:`${e}.s3.amazonaws.com`};function YS(i,t,e){var n,o,c,h;let r=Up(t);return{url:r.path,query:"",host:Rp(i,t,r.bucket),region:(n=i==null?void 0:i.region)!=null?n:"",service:"s3",method:e,accessKeyId:(o=i==null?void 0:i.accessKeyId)!=null?o:"",secretAccessKey:(c=i==null?void 0:i.secretAccessKey)!=null?c:"",sessionToken:(h=i==null?void 0:i.sessionToken)!=null?h:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function XS(i,t=!1){let e="0123456789ABCDEF",r="";for(let n=0;n<i.length;n++){let o=i[n];o>="A"&&o<="Z"||o>="a"&&o<="z"||o>="0"&&o<="9"||o=="_"||o=="-"||o=="~"||o=="."?r+=o:o=="/"?t?r+="%2F":r+=o:(r+="%",r+=e[o.charCodeAt(0)>>4],r+=e[o.charCodeAt(0)&15])}return r}function GS(i,t=null){var lt;let e=(lt=t==null?void 0:t.contentHash)!=null?lt:"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 n="";t!=null&&t.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",i.sessionToken&&(n+=";x-amz-security-token");let o=i.method+`
12
+ `+XS(i.url)+`
13
13
  `+i.query;t!=null&&t.contentType&&(o+=`
14
14
  content-type:`+(t==null?void 0:t.contentType)),o+=`
15
15
  host:`+i.host+`
@@ -18,24 +18,10 @@ x-amz-date:`+i.datetimeNow,i.sessionToken&&i.sessionToken.length>0&&(o+=`
18
18
  x-amz-security-token:`+i.sessionToken),o+=`
19
19
 
20
20
  `+n+`
21
- `+e;let c=(0,ur.sha256)(o),h=`AWS4-HMAC-SHA256
21
+ `+e;let c=(0,ar.sha256)(o),h=`AWS4-HMAC-SHA256
22
22
  `+i.datetimeNow+`
23
23
  `+i.dateNow+"/"+i.region+"/"+i.service+`/aws4_request
24
- `+c,m="AWS4"+i.secretAccessKey,g=ur.sha256.hmac.arrayBuffer(m,i.dateNow),x=ur.sha256.hmac.arrayBuffer(g,i.region),T=ur.sha256.hmac.arrayBuffer(x,i.service),C=ur.sha256.hmac.arrayBuffer(T,"aws4_request"),k=ur.sha256.hmac(C,h);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+i.accessKeyId+"/"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request, SignedHeaders="+n+", Signature="+k),r}var $S=function(i,t,e,r=null,n=null){let o=HS(i,t,e),c={contentType:r,contentHash:n?ur.sha256.hex(n):null};return WS(o,c)};function dr(i,t,e,r,n=null,o=null){((t==null?void 0:t.accessKeyId)||(t==null?void 0:t.sessionToken))&&($S(t,e,r,n,o).forEach((h,m)=>{i.setRequestHeader(m,h)}),n&&i.setRequestHeader("content-type",n))}function Mp(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 fr(i,t){var r;let e=Mp(t);return(r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")?`${i==null?void 0:i.endpoint}/${e.bucket}`+e.path:"https://"+Op(i,t,e.bucket)+e.path}var gt={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(i,t){try{let e=gt._fileInfoCache.get(t),[r,n,o]=yt(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(o===0)return e;let c=it(i,n,o);Ct(i);let h=JSON.parse(c);if(h==null)return null;let m=mn(Xi({},h),{blob:null});return gt._fileInfoCache.set(t,m),m}catch(e){return null}},getGlobalFileInfo(i){var t;try{let[e,r,n]=yt(i,"duckdb_web_get_global_file_info",["number"],[((t=gt._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(n===0)return gt._globalFileInfo;let o=it(i,r,n);Ct(i);let c=JSON.parse(o);return c==null?null:(gt._globalFileInfo=mn(Xi({},c),{blob:null}),gt._globalFileInfo)}catch(e){return null}},testPlatformFeature:(i,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn(`test for unknown feature: ${t}`),!1}},openFile:(i,t,e)=>{var r;try{gt._fileInfoCache.delete(t);let n=gt.getFileInfo(i,t);switch(n==null?void 0:n.dataProtocol){case 3:case 4:{if(e&1&&e&2)throw new Error(`Opening file ${n.fileName} failed: cannot open file with both read and write flags set`);if(e&32)throw new Error(`Opening file ${n.fileName} failed: appending to HTTP/S3 files is not supported`);if(e&2){let c=new XMLHttpRequest;if(n.dataProtocol==4?(c.open("HEAD",fr(n.s3Config,n.dataUrl),!1),dr(c,n.s3Config,n.dataUrl,"HEAD")):c.open("HEAD",n.dataUrl,!1),c.send(null),c.status!=200&&c.status!=404)throw new Error(`Opening file ${n.fileName} failed: Unexpected return status from server (${c.status})`);if(c.status==404&&!(e&8||e&16))throw new Error(`Opening file ${n.fileName} failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag.`);let h=i._malloc(1),m=new Uint8Array;i.HEAPU8.set(m,h);let g=i._malloc(2*8);return i.HEAPF64[(g>>3)+0]=1,i.HEAPF64[(g>>3)+1]=h,g}else if(e!=1)throw new Error(`Opening file ${n.fileName} failed: unsupported file flags: ${e}`);let o=null;try{let c=new XMLHttpRequest;n.dataProtocol==4?(c.open("HEAD",fr(n.s3Config,n.dataUrl),!1),dr(c,n.s3Config,n.dataUrl,"HEAD")):c.open("HEAD",n.dataUrl,!1),c.setRequestHeader("Range","bytes=0-"),c.send(null);let h=c.getResponseHeader("Content-Length");if(c.status==206&&h!==null){let m=i._malloc(16);return i.HEAPF64[(m>>3)+0]=+h,i.HEAPF64[(m>>3)+1]=0,m}}catch(c){o=c,console.warn(`HEAD request with range header failed: ${c}`)}if(n.allowFullHttpReads){console.warn(`falling back to full HTTP read for: ${n.dataUrl}`);let c=new XMLHttpRequest;if(n.dataProtocol==4?(c.open("GET",fr(n.s3Config,n.dataUrl),!1),dr(c,n.s3Config,n.dataUrl,"GET")):c.open("GET",n.dataUrl,!1),c.responseType="arraybuffer",c.send(null),c.status==200){let h=i._malloc(c.response.byteLength),m=new Uint8Array(c.response,0,c.response.byteLength);i.HEAPU8.set(m,h);let g=i._malloc(2*8);return i.HEAPF64[(g>>3)+0]=c.response.byteLength,i.HEAPF64[(g>>3)+1]=h,g}}if(o!=null)throw new Error(`Reading file ${n.fileName} failed with error: ${o}`);return 0}case 1:{let o=(r=gt._files)==null?void 0:r.get(n.fileName);if(o){let m=i._malloc(16);return i.HEAPF64[(m>>3)+0]=o.size,i.HEAPF64[(m>>3)+1]=0,m}console.warn(`Buffering missing file: ${n.fileName}`);let c=i._malloc(2*8),h=i._malloc(1);return i.HEAPF64[(c>>3)+0]=1,i.HEAPF64[(c>>3)+1]=h,c}}}catch(n){console.error(n.toString()),Ii(i,n.toString())}return 0},glob:(i,t,e)=>{try{let r=it(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=gt.getGlobalFileInfo(i);n.open("HEAD",fr(o==null?void 0:o.s3Config,r),!1),dr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);if(n.send(null),n.status!=200&&n.status!==206){Ii(i,`HEAD request failed: ${r}`);return}i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[r])}}catch(r){return Ii(i,r.toString()),0}},checkFile:(i,t,e)=>{try{let r=it(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=gt.getGlobalFileInfo(i);n.open("HEAD",fr(o==null?void 0:o.s3Config,r),!1),dr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}}catch(r){return!1}return!1},syncFile:(i,t)=>{},closeFile:(i,t)=>{let e=gt.getFileInfo(i,t);switch(gt._fileInfoCache.delete(t),e==null?void 0:e.dataProtocol){case 3:case 4:break;case 1:return}},truncateFile:(i,t,e)=>{let r=gt.getFileInfo(i,t);switch(r==null?void 0:r.dataProtocol){case 3:Ii(i,"Cannot truncate a http file");return;case 4:Ii(i,"Cannot truncate an s3 file");return;case 1:Ii(i,"truncateFile not implemented");return}return 0},readFile(i,t,e,r,n){var o;try{let c=gt.getFileInfo(i,t);switch(c==null?void 0:c.dataProtocol){case 3:case 4:{if(!c.dataUrl)throw new Error(`Missing data URL for file ${t}`);try{let h=new XMLHttpRequest;if(c.dataProtocol==4?(h.open("GET",fr(c==null?void 0:c.s3Config,c.dataUrl),!1),dr(h,c==null?void 0:c.s3Config,c.dataUrl,"GET")):h.open("GET",c.dataUrl,!1),h.responseType="arraybuffer",h.setRequestHeader("Range",`bytes=${n}-${n+r-1}`),h.send(null),h.status==206||h.status==200&&r==h.response.byteLength&&n==0){let m=new Uint8Array(h.response,0,Math.min(h.response.byteLength,r));return i.HEAPU8.set(m,e),m.byteLength}else throw h.status==200?new Error(`Range request for ${c.dataUrl} did not return a partial response: ${h.status} "${h.statusText}"`):new Error(`Range request for ${c.dataUrl} did returned non-success status: ${h.status} "${h.statusText}"`)}catch(h){throw new Error(`Range request for ${c.dataUrl} failed with error: ${h}"`)}}case 1:{let h=(o=gt._files)==null?void 0:o.get(c.fileName);if(!h)throw new Error(`No handle available for file: ${c.fileName}`);let m=h.slice(n,n+r),g=new Uint8Array(new FileReaderSync().readAsArrayBuffer(m));return i.HEAPU8.set(g,e),g.byteLength}}return 0}catch(c){return Ii(i,c.toString()),0}},writeFile:(i,t,e,r,n)=>{let o=gt.getFileInfo(i,t);switch(o==null?void 0:o.dataProtocol){case 3:return Ii(i,"Cannot write to HTTP file"),0;case 4:{let c=i.HEAPU8.subarray(e,e+r),h=new XMLHttpRequest;return h.open("PUT",fr(o==null?void 0:o.s3Config,o.dataUrl),!1),dr(h,o==null?void 0:o.s3Config,o.dataUrl,"PUT","",c),h.send(c),r}case 1:return Ii(i,"writefile not implemented"),0}return 0},getLastFileModificationTime:(i,t)=>{var r;let e=gt.getFileInfo(i,t);switch(e==null?void 0:e.dataProtocol){case 1:{if(!((r=gt._files)==null?void 0:r.get(e.fileName)))throw Error(`No handle available for file: ${e.fileName}`);return 0}case 3:case 4:return new Date().getTime()}return 0},checkDirectory:(i,t,e)=>{let r=it(i,t,e);return console.log(`checkDirectory: ${r}`),!1},createDirectory:(i,t,e)=>{let r=it(i,t,e);console.log(`createDirectory: ${r}`)},removeDirectory:(i,t,e)=>{let r=it(i,t,e);console.log(`removeDirectory: ${r}`)},listDirectoryEntries:(i,t,e)=>{let r=it(i,t,e);return console.log(`listDirectoryEntries: ${r}`),!1},moveFile:(i,t,e,r,n)=>{var m,g;let o=it(i,t,e),c=it(i,r,n),h=(m=gt._files)==null?void 0:m.get(o);h!==void 0&&(gt._files.delete(h),gt._files.set(c,h));for(let[x,T]of((g=gt._fileInfoCache)==null?void 0:g.entries())||[])if(T.dataUrl==o){gt._fileInfoCache.delete(x);break}return!0},removeFile:(i,t,e)=>{},callScalarUDF:(i,t,e,r,n,o,c)=>{Ep(gt,i,t,e,r,n,o,c)}};var ml=class extends Ko{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,r){return await new ia(this,gt,t,e).instantiate(r)}};function Rp(){let i=new ml;globalThis.onmessage=async t=>{await i.onMessage(t.data)}}Rp();return ew(YS);})();
25
- /*! *****************************************************************************
26
- Copyright (c) Microsoft Corporation.
27
-
28
- Permission to use, copy, modify, and/or distribute this software for any
29
- purpose with or without fee is hereby granted.
30
-
31
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
32
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
33
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
34
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
35
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
36
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
37
- PERFORMANCE OF THIS SOFTWARE.
38
- ***************************************************************************** */
24
+ `+c,m="AWS4"+i.secretAccessKey,v=ar.sha256.hmac.arrayBuffer(m,i.dateNow),C=ar.sha256.hmac.arrayBuffer(v,i.region),B=ar.sha256.hmac.arrayBuffer(C,i.service),F=ar.sha256.hmac.arrayBuffer(B,"aws4_request"),k=ar.sha256.hmac(F,h);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+i.accessKeyId+"/"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request, SignedHeaders="+n+", Signature="+k),r}var KS=function(i,t,e,r=null,n=null){let o=YS(i,t,e),c={contentType:r,contentHash:n?ar.sha256.hex(n):null};return GS(o,c)};function lr(i,t,e,r,n=null,o=null){((t==null?void 0:t.accessKeyId)||(t==null?void 0:t.sessionToken))&&(KS(t,e,r,n,o).forEach((h,m)=>{i.setRequestHeader(m,h)}),n&&i.setRequestHeader("content-type",n))}function Up(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 cr(i,t){var r;let e=Up(t);return(r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")?`${i==null?void 0:i.endpoint}/${e.bucket}`+e.path:"https://"+Rp(i,t,e.bucket)+e.path}var gt={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(i,t){try{let e=gt._fileInfoCache.get(t),[r,n,o]=pt(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(o===0)return e;let c=tt(i,n,o);St(i);let h=JSON.parse(c);if(h==null)return null;let m={...h,blob:null};return gt._fileInfoCache.set(t,m),m}catch(e){return null}},getGlobalFileInfo(i){var t;try{let[e,r,n]=pt(i,"duckdb_web_get_global_file_info",["number"],[((t=gt._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(n===0)return gt._globalFileInfo;let o=tt(i,r,n);St(i);let c=JSON.parse(o);return c==null?null:(gt._globalFileInfo={...c,blob:null},gt._globalFileInfo)}catch(e){return null}},testPlatformFeature:(i,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn(`test for unknown feature: ${t}`),!1}},openFile:(i,t,e)=>{var r;try{gt._fileInfoCache.delete(t);let n=gt.getFileInfo(i,t);switch(n==null?void 0:n.dataProtocol){case 3:case 4:{if(e&1&&e&2)throw new Error(`Opening file ${n.fileName} failed: cannot open file with both read and write flags set`);if(e&32)throw new Error(`Opening file ${n.fileName} failed: appending to HTTP/S3 files is not supported`);if(e&2){let c=new XMLHttpRequest;if(n.dataProtocol==4?(c.open("HEAD",cr(n.s3Config,n.dataUrl),!1),lr(c,n.s3Config,n.dataUrl,"HEAD")):c.open("HEAD",n.dataUrl,!1),c.send(null),c.status!=200&&c.status!=404)throw new Error(`Opening file ${n.fileName} failed: Unexpected return status from server (${c.status})`);if(c.status==404&&!(e&8||e&16))throw new Error(`Opening file ${n.fileName} failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag.`);let h=i._malloc(1),m=new Uint8Array;i.HEAPU8.set(m,h);let v=i._malloc(2*8);return i.HEAPF64[(v>>3)+0]=1,i.HEAPF64[(v>>3)+1]=h,v}else if(e!=1)throw new Error(`Opening file ${n.fileName} failed: unsupported file flags: ${e}`);let o=null;try{let c=new XMLHttpRequest;n.dataProtocol==4?(c.open("HEAD",cr(n.s3Config,n.dataUrl),!1),lr(c,n.s3Config,n.dataUrl,"HEAD")):c.open("HEAD",n.dataUrl,!1),c.setRequestHeader("Range","bytes=0-"),c.send(null);let h=c.getResponseHeader("Content-Length");if(c.status==206&&h!==null){let m=i._malloc(16);return i.HEAPF64[(m>>3)+0]=+h,i.HEAPF64[(m>>3)+1]=0,m}}catch(c){o=c,console.warn(`HEAD request with range header failed: ${c}`)}if(n.allowFullHttpReads){console.warn(`falling back to full HTTP read for: ${n.dataUrl}`);let c=new XMLHttpRequest;if(n.dataProtocol==4?(c.open("GET",cr(n.s3Config,n.dataUrl),!1),lr(c,n.s3Config,n.dataUrl,"GET")):c.open("GET",n.dataUrl,!1),c.responseType="arraybuffer",c.send(null),c.status==200){let h=i._malloc(c.response.byteLength),m=new Uint8Array(c.response,0,c.response.byteLength);i.HEAPU8.set(m,h);let v=i._malloc(2*8);return i.HEAPF64[(v>>3)+0]=c.response.byteLength,i.HEAPF64[(v>>3)+1]=h,v}}if(o!=null)throw new Error(`Reading file ${n.fileName} failed with error: ${o}`);return 0}case 1:{let o=(r=gt._files)==null?void 0:r.get(n.fileName);if(o){let m=i._malloc(16);return i.HEAPF64[(m>>3)+0]=o.size,i.HEAPF64[(m>>3)+1]=0,m}console.warn(`Buffering missing file: ${n.fileName}`);let c=i._malloc(2*8),h=i._malloc(1);return i.HEAPF64[(c>>3)+0]=1,i.HEAPF64[(c>>3)+1]=h,c}}}catch(n){console.error(n.toString()),Si(i,n.toString())}return 0},glob:(i,t,e)=>{try{let r=tt(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=gt.getGlobalFileInfo(i);n.open("HEAD",cr(o==null?void 0:o.s3Config,r),!1),lr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);if(n.send(null),n.status!=200&&n.status!==206){Si(i,`HEAD request failed: ${r}`);return}i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[r])}}catch(r){return Si(i,r.toString()),0}},checkFile:(i,t,e)=>{try{let r=tt(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=gt.getGlobalFileInfo(i);n.open("HEAD",cr(o==null?void 0:o.s3Config,r),!1),lr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}}catch(r){return!1}return!1},syncFile:(i,t)=>{},closeFile:(i,t)=>{let e=gt.getFileInfo(i,t);switch(gt._fileInfoCache.delete(t),e==null?void 0:e.dataProtocol){case 3:case 4:break;case 1:return}},truncateFile:(i,t,e)=>{let r=gt.getFileInfo(i,t);switch(r==null?void 0:r.dataProtocol){case 3:Si(i,"Cannot truncate a http file");return;case 4:Si(i,"Cannot truncate an s3 file");return;case 1:Si(i,"truncateFile not implemented");return}return 0},readFile(i,t,e,r,n){var o;try{let c=gt.getFileInfo(i,t);switch(c==null?void 0:c.dataProtocol){case 3:case 4:{if(!c.dataUrl)throw new Error(`Missing data URL for file ${t}`);try{let h=new XMLHttpRequest;if(c.dataProtocol==4?(h.open("GET",cr(c==null?void 0:c.s3Config,c.dataUrl),!1),lr(h,c==null?void 0:c.s3Config,c.dataUrl,"GET")):h.open("GET",c.dataUrl,!1),h.responseType="arraybuffer",h.setRequestHeader("Range",`bytes=${n}-${n+r-1}`),h.send(null),h.status==206||h.status==200&&r==h.response.byteLength&&n==0){let m=new Uint8Array(h.response,0,Math.min(h.response.byteLength,r));return i.HEAPU8.set(m,e),m.byteLength}else throw h.status==200?new Error(`Range request for ${c.dataUrl} did not return a partial response: ${h.status} "${h.statusText}"`):new Error(`Range request for ${c.dataUrl} did returned non-success status: ${h.status} "${h.statusText}"`)}catch(h){throw new Error(`Range request for ${c.dataUrl} failed with error: ${h}"`)}}case 1:{let h=(o=gt._files)==null?void 0:o.get(c.fileName);if(!h)throw new Error(`No handle available for file: ${c.fileName}`);let m=h.slice(n,n+r),v=new Uint8Array(new FileReaderSync().readAsArrayBuffer(m));return i.HEAPU8.set(v,e),v.byteLength}}return 0}catch(c){return Si(i,c.toString()),0}},writeFile:(i,t,e,r,n)=>{let o=gt.getFileInfo(i,t);switch(o==null?void 0:o.dataProtocol){case 3:return Si(i,"Cannot write to HTTP file"),0;case 4:{let c=i.HEAPU8.subarray(e,e+r),h=new XMLHttpRequest;return h.open("PUT",cr(o==null?void 0:o.s3Config,o.dataUrl),!1),lr(h,o==null?void 0:o.s3Config,o.dataUrl,"PUT","",c),h.send(c),r}case 1:return Si(i,"writefile not implemented"),0}return 0},getLastFileModificationTime:(i,t)=>{var r;let e=gt.getFileInfo(i,t);switch(e==null?void 0:e.dataProtocol){case 1:{if(!((r=gt._files)==null?void 0:r.get(e.fileName)))throw Error(`No handle available for file: ${e.fileName}`);return 0}case 3:case 4:return new Date().getTime()}return 0},checkDirectory:(i,t,e)=>{let r=tt(i,t,e);return console.log(`checkDirectory: ${r}`),!1},createDirectory:(i,t,e)=>{let r=tt(i,t,e);console.log(`createDirectory: ${r}`)},removeDirectory:(i,t,e)=>{let r=tt(i,t,e);console.log(`removeDirectory: ${r}`)},listDirectoryEntries:(i,t,e)=>{let r=tt(i,t,e);return console.log(`listDirectoryEntries: ${r}`),!1},moveFile:(i,t,e,r,n)=>{var m,v;let o=tt(i,t,e),c=tt(i,r,n),h=(m=gt._files)==null?void 0:m.get(o);h!==void 0&&(gt._files.delete(h),gt._files.set(c,h));for(let[C,B]of((v=gt._fileInfoCache)==null?void 0:v.entries())||[])if(B.dataUrl==o){gt._fileInfoCache.delete(C);break}return!0},removeFile:(i,t,e)=>{},callScalarUDF:(i,t,e,r,n,o,c)=>{Op(gt,i,t,e,r,n,o,c)}};var _l=class extends Go{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,r){return await new ea(this,gt,t,e).instantiate(r)}};function Np(){let i=new _l;globalThis.onmessage=async t=>{await i.onMessage(t.data)}}Np();return sw(JS);})();
39
25
  /**
40
26
  * [js-sha256]{@link https://github.com/emn178/js-sha256}
41
27
  *