@duckdb/duckdb-wasm 1.13.1-dev98.0 → 1.14.2
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.
- package/README.md +68 -4
- package/dist/duckdb-browser-blocking.cjs +15 -45
- package/dist/duckdb-browser-blocking.cjs.map +3 -3
- package/dist/duckdb-browser-blocking.mjs +15 -45
- package/dist/duckdb-browser-blocking.mjs.map +3 -3
- package/dist/duckdb-browser-coi.pthread.worker.js +14 -43
- package/dist/duckdb-browser-coi.pthread.worker.js.map +3 -3
- package/dist/duckdb-browser-coi.worker.js +18 -25
- package/dist/duckdb-browser-coi.worker.js.map +3 -3
- package/dist/duckdb-browser-eh.worker.js +16 -23
- package/dist/duckdb-browser-eh.worker.js.map +3 -3
- package/dist/duckdb-browser-mvp.worker.js +18 -25
- package/dist/duckdb-browser-mvp.worker.js.map +3 -3
- package/dist/duckdb-browser.cjs +1 -31
- package/dist/duckdb-browser.cjs.map +3 -3
- package/dist/duckdb-browser.mjs +1 -31
- package/dist/duckdb-browser.mjs.map +3 -3
- package/dist/duckdb-coi.wasm +0 -0
- package/dist/duckdb-eh.wasm +0 -0
- package/dist/duckdb-mvp.wasm +0 -0
- package/dist/duckdb-node-blocking.cjs +4 -4
- package/dist/duckdb-node-blocking.cjs.map +3 -3
- package/dist/duckdb-node-eh.worker.cjs +4 -4
- package/dist/duckdb-node-eh.worker.cjs.map +3 -3
- package/dist/duckdb-node-mvp.worker.cjs +3 -3
- package/dist/duckdb-node-mvp.worker.cjs.map +3 -3
- package/dist/duckdb-node.cjs +1 -1
- package/dist/duckdb-node.cjs.map +3 -3
- package/dist/img/duckdb.svg +8 -0
- package/dist/img/duckdb_version_badge.svg +1 -1
- package/dist/tests-browser.js +12905 -16221
- package/dist/tests-browser.js.map +3 -3
- package/dist/tests-node.cjs +1820 -1588
- package/dist/tests-node.cjs.map +3 -3
- package/dist/types/src/bindings/config.d.ts +0 -2
- package/dist/types/src/bindings/insert_options.d.ts +3 -3
- package/dist/types/src/bindings/progress.d.ts +1 -0
- package/dist/types/src/bindings/runtime.d.ts +1 -1
- package/dist/types/src/bindings/udf_function.d.ts +2 -2
- package/dist/types/src/bindings/udf_runtime.d.ts +1 -1
- package/dist/types/src/json_typedef.d.ts +17 -0
- package/dist/types/src/log.d.ts +2 -0
- package/dist/types/src/platform.d.ts +3 -0
- package/dist/types/src/targets/duckdb-browser-blocking.d.ts +1 -0
- package/dist/types/src/targets/duckdb-node-blocking.d.ts +1 -0
- package/dist/types/src/targets/duckdb.d.ts +1 -0
- package/dist/types/src/utils/s3_helper.d.ts +1 -0
- package/package.json +24 -24
- package/dist/types/src/flat_arrow.d.ts +0 -15
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
var duckdb=(()=>{var x0=Object.create;var us=Object.defineProperty,P0=Object.defineProperties,N0=Object.getOwnPropertyDescriptor,L0=Object.getOwnPropertyDescriptors,k0=Object.getOwnPropertyNames,Uf=Object.getOwnPropertySymbols,C0=Object.getPrototypeOf,Ef=Object.prototype.hasOwnProperty,j0=Object.prototype.propertyIsEnumerable;var Rf=(r,e,t)=>e in r?us(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kr=(r,e)=>{for(var t in e||(e={}))Ef.call(e,t)&&Rf(r,t,e[t]);if(Uf)for(var t of Uf(e))j0.call(e,t)&&Rf(r,t,e[t]);return r},ls=(r,e)=>P0(r,L0(e)),Vf=r=>us(r,"__esModule",{value:!0});var q0=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var g=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),H0=(r,e)=>{for(var t in e)us(r,t,{get:e[t],enumerable:!0})},xf=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of k0(e))!Ef.call(r,i)&&(t||i!=="default")&&us(r,i,{get:()=>e[i],enumerable:!(n=N0(e,i))||n.enumerable});return r},Kt=(r,e)=>xf(Vf(us(r!=null?x0(C0(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),z0=(r=>(e,t)=>r&&r.get(e)||(t=xf(Vf({}),e,1),r&&r.set(e,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var et=g((HA,mo)=>{var Pf,Nf,Lf,kf,Cf,jf,qf,Hf,zf,yo,Uc,Wf,Yf,Gf,ei,$f,Kf,Jf,Xf,Zf,Qf,eh,th,_o;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof mo=="object"&&typeof mo.exports=="object"?r(t(e,t(mo.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,o){return n[s]=i?i(s,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};Pf=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Nf=Object.assign||function(n){for(var i,s=1,o=arguments.length;s<o;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])}return n},Lf=function(n,i){var s={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.indexOf(o)<0&&(s[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)i.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(s[o[a]]=n[o[a]]);return s},kf=function(n,i,s,o){var a=arguments.length,c=a<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,s):o,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(n,i,s,o);else for(var y=n.length-1;y>=0;y--)(f=n[y])&&(c=(a<3?f(c):a>3?f(i,s,c):f(i,s))||c);return a>3&&c&&Object.defineProperty(i,s,c),c},Cf=function(n,i){return function(s,o){i(s,o,n)}},jf=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},qf=function(n,i,s,o){function a(c){return c instanceof s?c:new s(function(f){f(c)})}return new(s||(s=Promise))(function(c,f){function y(A){try{D(o.next(A))}catch(J){f(J)}}function B(A){try{D(o.throw(A))}catch(J){f(J)}}function D(A){A.done?c(A.value):a(A.value).then(y,B)}D((o=o.apply(n,i||[])).next())})},Hf=function(n,i){var s={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,a,c,f;return f={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function y(D){return function(A){return B([D,A])}}function B(D){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,a&&(c=D[0]&2?a.return:D[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,D[1])).done)return c;switch(a=0,c&&(D=[D[0]&2,c.value]),D[0]){case 0:case 1:c=D;break;case 4:return s.label++,{value:D[1],done:!1};case 5:s.label++,a=D[1],D=[0];continue;case 7:D=s.ops.pop(),s.trys.pop();continue;default:if(c=s.trys,!(c=c.length>0&&c[c.length-1])&&(D[0]===6||D[0]===2)){s=0;continue}if(D[0]===3&&(!c||D[1]>c[0]&&D[1]<c[3])){s.label=D[1];break}if(D[0]===6&&s.label<c[1]){s.label=c[1],c=D;break}if(c&&s.label<c[2]){s.label=c[2],s.ops.push(D);break}c[2]&&s.ops.pop(),s.trys.pop();continue}D=i.call(n,s)}catch(A){D=[6,A],a=0}finally{o=c=0}if(D[0]&5)throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}},zf=function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&_o(i,n,s)},_o=Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]},yo=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],o=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Uc=function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var o=s.call(n),a,c=[],f;try{for(;(i===void 0||i-- >0)&&!(a=o.next()).done;)c.push(a.value)}catch(y){f={error:y}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(f)throw f.error}}return c},Wf=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(Uc(arguments[i]));return n},Yf=function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var o=Array(n),a=0,i=0;i<s;i++)for(var c=arguments[i],f=0,y=c.length;f<y;f++,a++)o[a]=c[f];return o},Gf=function(n,i,s){if(s||arguments.length===2)for(var o=0,a=i.length,c;o<a;o++)(c||!(o in i))&&(c||(c=Array.prototype.slice.call(i,0,o)),c[o]=i[o]);return n.concat(c||Array.prototype.slice.call(i))},ei=function(n){return this instanceof ei?(this.v=n,this):new ei(n)},$f=function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=s.apply(n,i||[]),a,c=[];return a={},f("next"),f("throw"),f("return"),a[Symbol.asyncIterator]=function(){return this},a;function f(te){o[te]&&(a[te]=function(ae){return new Promise(function(fe,at){c.push([te,ae,fe,at])>1||y(te,ae)})})}function y(te,ae){try{B(o[te](ae))}catch(fe){J(c[0][3],fe)}}function B(te){te.value instanceof ei?Promise.resolve(te.value.v).then(D,A):J(c[0][2],te)}function D(te){y("next",te)}function A(te){y("throw",te)}function J(te,ae){te(ae),c.shift(),c.length&&y(c[0][0],c[0][1])}},Kf=function(n){var i,s;return i={},o("next"),o("throw",function(a){throw a}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(a,c){i[a]=n[a]?function(f){return(s=!s)?{value:ei(n[a](f)),done:a==="return"}:c?c(f):f}:c}},Jf=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof yo=="function"?yo(n):n[Symbol.iterator](),s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s);function o(c){s[c]=n[c]&&function(f){return new Promise(function(y,B){f=n[c](f),a(y,B,f.done,f.value)})}}function a(c,f,y,B){Promise.resolve(B).then(function(D){c({value:D,done:y})},f)}},Xf=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};Zf=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&_o(i,n,s);return t(i,n),i},Qf=function(n){return n&&n.__esModule?n:{default:n}},eh=function(n,i,s,o){if(s==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!o:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?o:s==="a"?o.call(n):o?o.value:i.get(n)},th=function(n,i,s,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(n,s):a?a.value=s:i.set(n,s),s},r("__extends",Pf),r("__assign",Nf),r("__rest",Lf),r("__decorate",kf),r("__param",Cf),r("__metadata",jf),r("__awaiter",qf),r("__generator",Hf),r("__exportStar",zf),r("__createBinding",_o),r("__values",yo),r("__read",Uc),r("__spread",Wf),r("__spreadArrays",Yf),r("__spreadArray",Gf),r("__await",ei),r("__asyncGenerator",$f),r("__asyncDelegator",Kf),r("__asyncValues",Jf),r("__makeTemplateObject",Xf),r("__importStar",Zf),r("__importDefault",Qf),r("__classPrivateFieldGet",eh),r("__classPrivateFieldSet",th)})});var wr=g(rh=>{var m={};m.Offset;m.Table;m.SIZEOF_SHORT=2;m.SIZEOF_INT=4;m.FILE_IDENTIFIER_LENGTH=4;m.SIZE_PREFIX_LENGTH=4;m.Encoding={UTF8_BYTES:1,UTF16_STRING:2};m.int32=new Int32Array(2);m.float32=new Float32Array(m.int32.buffer);m.float64=new Float64Array(m.int32.buffer);m.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;m.Long=function(r,e){this.low=r|0,this.high=e|0};m.Long.create=function(r,e){return r==0&&e==0?m.Long.ZERO:new m.Long(r,e)};m.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};m.Long.prototype.equals=function(r){return this.low==r.low&&this.high==r.high};m.Long.ZERO=new m.Long(0,0);m.Builder=function(r){if(r)var e=r;else var e=1024;this.bb=m.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1};m.Builder.prototype.clear=function(){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};m.Builder.prototype.forceDefaults=function(r){this.force_defaults=r};m.Builder.prototype.dataBuffer=function(){return this.bb};m.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};m.Builder.prototype.prep=function(r,e){r>this.minalign&&(this.minalign=r);for(var t=~(this.bb.capacity()-this.space+e)+1&r-1;this.space<t+r+e;){var n=this.bb.capacity();this.bb=m.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(t)};m.Builder.prototype.pad=function(r){for(var e=0;e<r;e++)this.bb.writeInt8(--this.space,0)};m.Builder.prototype.writeInt8=function(r){this.bb.writeInt8(this.space-=1,r)};m.Builder.prototype.writeInt16=function(r){this.bb.writeInt16(this.space-=2,r)};m.Builder.prototype.writeInt32=function(r){this.bb.writeInt32(this.space-=4,r)};m.Builder.prototype.writeInt64=function(r){this.bb.writeInt64(this.space-=8,r)};m.Builder.prototype.writeFloat32=function(r){this.bb.writeFloat32(this.space-=4,r)};m.Builder.prototype.writeFloat64=function(r){this.bb.writeFloat64(this.space-=8,r)};m.Builder.prototype.addInt8=function(r){this.prep(1,0),this.writeInt8(r)};m.Builder.prototype.addInt16=function(r){this.prep(2,0),this.writeInt16(r)};m.Builder.prototype.addInt32=function(r){this.prep(4,0),this.writeInt32(r)};m.Builder.prototype.addInt64=function(r){this.prep(8,0),this.writeInt64(r)};m.Builder.prototype.addFloat32=function(r){this.prep(4,0),this.writeFloat32(r)};m.Builder.prototype.addFloat64=function(r){this.prep(8,0),this.writeFloat64(r)};m.Builder.prototype.addFieldInt8=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt8(e),this.slot(r))};m.Builder.prototype.addFieldInt16=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt16(e),this.slot(r))};m.Builder.prototype.addFieldInt32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt32(e),this.slot(r))};m.Builder.prototype.addFieldInt64=function(r,e,t){(this.force_defaults||!e.equals(t))&&(this.addInt64(e),this.slot(r))};m.Builder.prototype.addFieldFloat32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat32(e),this.slot(r))};m.Builder.prototype.addFieldFloat64=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat64(e),this.slot(r))};m.Builder.prototype.addFieldOffset=function(r,e,t){(this.force_defaults||e!=t)&&(this.addOffset(e),this.slot(r))};m.Builder.prototype.addFieldStruct=function(r,e,t){e!=t&&(this.nested(e),this.slot(r))};m.Builder.prototype.nested=function(r){if(r!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};m.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};m.Builder.prototype.slot=function(r){this.vtable[r]=this.offset()};m.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};m.Builder.growByteBuffer=function(r){var e=r.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var t=e<<1,n=m.ByteBuffer.allocate(t);return n.setPosition(t-e),n.bytes().set(r.bytes(),t-e),n};m.Builder.prototype.addOffset=function(r){this.prep(m.SIZEOF_INT,0),this.writeInt32(this.offset()-r+m.SIZEOF_INT)};m.Builder.prototype.startObject=function(r){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=r;for(var e=0;e<r;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()};m.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var r=this.offset(),e=this.vtable_in_use-1;e>=0&&this.vtable[e]==0;e--);for(var t=e+1;e>=0;e--)this.addInt16(this.vtable[e]!=0?r-this.vtable[e]:0);var n=2;this.addInt16(r-this.object_start);var i=(t+n)*m.SIZEOF_SHORT;this.addInt16(i);var s=0,o=this.space;e:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(a)){for(var c=m.SIZEOF_SHORT;c<i;c+=m.SIZEOF_SHORT)if(this.bb.readInt16(o+c)!=this.bb.readInt16(a+c))continue e;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-r,this.bb.writeInt32(this.space,s-r)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-r,this.offset()-r)),this.isNested=!1,r};m.Builder.prototype.finish=function(r,e,t){var n=t?m.SIZE_PREFIX_LENGTH:0;if(e){var i=e;if(this.prep(this.minalign,m.SIZEOF_INT+m.FILE_IDENTIFIER_LENGTH+n),i.length!=m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+m.FILE_IDENTIFIER_LENGTH);for(var s=m.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(i.charCodeAt(s))}this.prep(this.minalign,m.SIZEOF_INT+n),this.addOffset(r),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)};m.Builder.prototype.finishSizePrefixed=function(r,e){this.finish(r,e,!0)};m.Builder.prototype.requiredField=function(r,e){var t=this.bb.capacity()-r,n=t-this.bb.readInt32(t),i=this.bb.readInt16(n+e)!=0;if(!i)throw new Error("FlatBuffers: field "+e+" must be set")};m.Builder.prototype.startVector=function(r,e,t){this.notNested(),this.vector_num_elems=e,this.prep(m.SIZEOF_INT,r*e),this.prep(t,r*e)};m.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};m.Builder.prototype.createString=function(r){if(r instanceof Uint8Array)var e=r;else for(var e=[],t=0;t<r.length;){var n,i=r.charCodeAt(t++);if(i<55296||i>=56320)n=i;else{var s=r.charCodeAt(t++);n=(i<<10)+s+(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(var t=0,o=this.space,a=this.bb.bytes();t<e.length;t++)a[o++]=e[t];return this.endVector()};m.Builder.prototype.createLong=function(r,e){return m.Long.create(r,e)};m.ByteBuffer=function(r){this.bytes_=r,this.position_=0};m.ByteBuffer.allocate=function(r){return new m.ByteBuffer(new Uint8Array(r))};m.ByteBuffer.prototype.clear=function(){this.position_=0};m.ByteBuffer.prototype.bytes=function(){return this.bytes_};m.ByteBuffer.prototype.position=function(){return this.position_};m.ByteBuffer.prototype.setPosition=function(r){this.position_=r};m.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};m.ByteBuffer.prototype.readInt8=function(r){return this.readUint8(r)<<24>>24};m.ByteBuffer.prototype.readUint8=function(r){return this.bytes_[r]};m.ByteBuffer.prototype.readInt16=function(r){return this.readUint16(r)<<16>>16};m.ByteBuffer.prototype.readUint16=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8};m.ByteBuffer.prototype.readInt32=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8|this.bytes_[r+2]<<16|this.bytes_[r+3]<<24};m.ByteBuffer.prototype.readUint32=function(r){return this.readInt32(r)>>>0};m.ByteBuffer.prototype.readInt64=function(r){return new m.Long(this.readInt32(r),this.readInt32(r+4))};m.ByteBuffer.prototype.readUint64=function(r){return new m.Long(this.readUint32(r),this.readUint32(r+4))};m.ByteBuffer.prototype.readFloat32=function(r){return m.int32[0]=this.readInt32(r),m.float32[0]};m.ByteBuffer.prototype.readFloat64=function(r){return m.int32[m.isLittleEndian?0:1]=this.readInt32(r),m.int32[m.isLittleEndian?1:0]=this.readInt32(r+4),m.float64[0]};m.ByteBuffer.prototype.writeInt8=function(r,e){this.bytes_[r]=e};m.ByteBuffer.prototype.writeUint8=function(r,e){this.bytes_[r]=e};m.ByteBuffer.prototype.writeInt16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};m.ByteBuffer.prototype.writeUint16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};m.ByteBuffer.prototype.writeInt32=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8,this.bytes_[r+2]=e>>16,this.bytes_[r+3]=e>>24};m.ByteBuffer.prototype.writeUint32=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8,this.bytes_[r+2]=e>>16,this.bytes_[r+3]=e>>24};m.ByteBuffer.prototype.writeInt64=function(r,e){this.writeInt32(r,e.low),this.writeInt32(r+4,e.high)};m.ByteBuffer.prototype.writeUint64=function(r,e){this.writeUint32(r,e.low),this.writeUint32(r+4,e.high)};m.ByteBuffer.prototype.writeFloat32=function(r,e){m.float32[0]=e,this.writeInt32(r,m.int32[0])};m.ByteBuffer.prototype.writeFloat64=function(r,e){m.float64[0]=e,this.writeInt32(r,m.int32[m.isLittleEndian?0:1]),this.writeInt32(r+4,m.int32[m.isLittleEndian?1:0])};m.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+m.SIZEOF_INT+m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var r="",e=0;e<m.FILE_IDENTIFIER_LENGTH;e++)r+=String.fromCharCode(this.readInt8(this.position_+m.SIZEOF_INT+e));return r};m.ByteBuffer.prototype.__offset=function(r,e){var t=r-this.readInt32(r);return e<this.readInt16(t)?this.readInt16(t+e):0};m.ByteBuffer.prototype.__union=function(r,e){return r.bb_pos=e+this.readInt32(e),r.bb=this,r};m.ByteBuffer.prototype.__string=function(r,e){r+=this.readInt32(r);var t=this.readInt32(r),n="",i=0;if(r+=m.SIZEOF_INT,e===m.Encoding.UTF8_BYTES)return this.bytes_.subarray(r,r+t);for(;i<t;){var s,o=this.readUint8(r+i++);if(o<192)s=o;else{var a=this.readUint8(r+i++);if(o<224)s=(o&31)<<6|a&63;else{var c=this.readUint8(r+i++);if(o<240)s=(o&15)<<12|(a&63)<<6|c&63;else{var f=this.readUint8(r+i++);s=(o&7)<<18|(a&63)<<12|(c&63)<<6|f&63}}}s<65536?n+=String.fromCharCode(s):(s-=65536,n+=String.fromCharCode((s>>10)+55296,(s&(1<<10)-1)+56320))}return n};m.ByteBuffer.prototype.__indirect=function(r){return r+this.readInt32(r)};m.ByteBuffer.prototype.__vector=function(r){return r+this.readInt32(r)+m.SIZEOF_INT};m.ByteBuffer.prototype.__vector_len=function(r){return this.readInt32(r+this.readInt32(r))};m.ByteBuffer.prototype.__has_identifier=function(r){if(r.length!=m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+m.FILE_IDENTIFIER_LENGTH);for(var e=0;e<m.FILE_IDENTIFIER_LENGTH;e++)if(r.charCodeAt(e)!=this.readInt8(this.position_+m.SIZEOF_INT+e))return!1;return!0};m.ByteBuffer.prototype.createLong=function(r,e){return m.Long.create(r,e)};rh.flatbuffers=m});var On=g(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.encodeUtf8=ti.decodeUtf8=void 0;var W0=new TextDecoder("utf-8");ti.decodeUtf8=r=>W0.decode(r);var Y0=new TextEncoder;ti.encodeUtf8=r=>Y0.encode(r)});var ri=g(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.AsyncQueue=st.ReadableInterop=st.ArrowJSON=st.ITERATOR_DONE=void 0;var ds=et(),nh=fs();st.ITERATOR_DONE=Object.freeze({done:!0,value:void 0});var ih=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}};st.ArrowJSON=ih;var Ec=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}};st.ReadableInterop=Ec;var sh=class extends Ec{constructor(){super();this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return ds.__awaiter(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(st.ITERATOR_DONE);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return nh.default.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return nh.default.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return ds.__awaiter(this,void 0,void 0,function*(){return yield this.abort(e),st.ITERATOR_DONE})}return(e){return ds.__awaiter(this,void 0,void 0,function*(){return yield this.close(),st.ITERATOR_DONE})}read(e){return ds.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return ds.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(st.ITERATOR_DONE)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};st.AsyncQueue=sh});var tt=g(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.isReadableNodeStream=V.isWritableNodeStream=V.isReadableDOMStream=V.isWritableDOMStream=V.isFetchResponse=V.isFSReadStream=V.isFileHandle=V.isUnderlyingSink=V.isIteratorResult=V.isArrayLike=V.isArrowJSON=V.isAsyncIterable=V.isIterable=V.isObservable=V.isPromise=V.isObject=V.BigUint64ArrayAvailable=V.BigUint64Array=V.BigInt64ArrayAvailable=V.BigInt64Array=V.BigIntAvailable=V.BigInt=void 0;var bo=ri(),[G0,$0]=(()=>{let r=()=>{throw new Error("BigInt is not available in this environment")};function e(){throw r()}return e.asIntN=()=>{throw r()},e.asUintN=()=>{throw r()},typeof BigInt!="undefined"?[BigInt,!0]:[e,!1]})();V.BigInt=G0;V.BigIntAvailable=$0;var[K0,J0]=(()=>{let r=()=>{throw new Error("BigInt64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigInt64Array!="undefined"?[BigInt64Array,!0]:[e,!1]})();V.BigInt64Array=K0;V.BigInt64ArrayAvailable=J0;var[X0,Z0]=(()=>{let r=()=>{throw new Error("BigUint64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigUint64Array!="undefined"?[BigUint64Array,!0]:[e,!1]})();V.BigUint64Array=X0;V.BigUint64ArrayAvailable=Z0;var Rc=r=>typeof r=="number",oh=r=>typeof r=="boolean",Je=r=>typeof r=="function";V.isObject=r=>r!=null&&Object(r)===r;V.isPromise=r=>V.isObject(r)&&Je(r.then);V.isObservable=r=>V.isObject(r)&&Je(r.subscribe);V.isIterable=r=>V.isObject(r)&&Je(r[Symbol.iterator]);V.isAsyncIterable=r=>V.isObject(r)&&Je(r[Symbol.asyncIterator]);V.isArrowJSON=r=>V.isObject(r)&&V.isObject(r.schema);V.isArrayLike=r=>V.isObject(r)&&Rc(r.length);V.isIteratorResult=r=>V.isObject(r)&&"done"in r&&"value"in r;V.isUnderlyingSink=r=>V.isObject(r)&&Je(r.abort)&&Je(r.close)&&Je(r.start)&&Je(r.write);V.isFileHandle=r=>V.isObject(r)&&Je(r.stat)&&Rc(r.fd);V.isFSReadStream=r=>V.isReadableNodeStream(r)&&Rc(r.bytesRead);V.isFetchResponse=r=>V.isObject(r)&&V.isReadableDOMStream(r.body);V.isWritableDOMStream=r=>V.isObject(r)&&Je(r.abort)&&Je(r.getWriter)&&!(r instanceof bo.ReadableInterop);V.isReadableDOMStream=r=>V.isObject(r)&&Je(r.cancel)&&Je(r.getReader)&&!(r instanceof bo.ReadableInterop);V.isWritableNodeStream=r=>V.isObject(r)&&Je(r.end)&&Je(r.write)&&oh(r.writable)&&!(r instanceof bo.ReadableInterop);V.isReadableNodeStream=r=>V.isObject(r)&&Je(r.read)&&Je(r.pipe)&&oh(r.readable)&&!(r instanceof bo.ReadableInterop)});var qe=g(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.compareArrayLike=U.rebaseValueOffsets=U.toUint8ClampedArrayAsyncIterator=U.toFloat64ArrayAsyncIterator=U.toFloat32ArrayAsyncIterator=U.toUint32ArrayAsyncIterator=U.toUint16ArrayAsyncIterator=U.toUint8ArrayAsyncIterator=U.toInt32ArrayAsyncIterator=U.toInt16ArrayAsyncIterator=U.toInt8ArrayAsyncIterator=U.toArrayBufferViewAsyncIterator=U.toUint8ClampedArrayIterator=U.toFloat64ArrayIterator=U.toFloat32ArrayIterator=U.toUint32ArrayIterator=U.toUint16ArrayIterator=U.toUint8ArrayIterator=U.toInt32ArrayIterator=U.toInt16ArrayIterator=U.toInt8ArrayIterator=U.toArrayBufferViewIterator=U.toUint8ClampedArray=U.toFloat64Array=U.toFloat32Array=U.toBigUint64Array=U.toUint32Array=U.toUint16Array=U.toUint8Array=U.toBigInt64Array=U.toInt32Array=U.toInt16Array=U.toInt8Array=U.toArrayBufferView=U.joinUint8Arrays=U.memcpy=void 0;var Ne=et(),Q0=wr(),ev=On(),tv=Q0.flatbuffers.ByteBuffer,Mn=tt(),Vc=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:ArrayBuffer;function rv(r){let e=r[0]?[r[0]]:[],t,n,i,s;for(let o,a,c=0,f=0,y=r.length;++c<y;){if(o=e[f],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(e[++f]=a);continue}if({byteOffset:t,byteLength:i}=o,{byteOffset:n,byteLength:s}=a,t+i<n||n+s<t){a&&(e[++f]=a);continue}e[f]=new Uint8Array(o.buffer,t,n-t+s)}return e}function xc(r,e,t=0,n=e.byteLength){let i=r.byteLength,s=new Uint8Array(r.buffer,r.byteOffset,i),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return s.set(o,t),r}U.memcpy=xc;function nv(r,e){let t=rv(r),n=t.reduce((y,B)=>y+B.byteLength,0),i,s,o,a=0,c=-1,f=Math.min(e||1/0,n);for(let y=t.length;++c<y;){if(i=t[c],s=i.subarray(0,Math.min(i.length,f-a)),f<=a+s.length){s.length<i.length?t[c]=i.subarray(s.length):s.length===i.length&&c++,o?xc(o,s,a):o=s;break}xc(o||(o=new Uint8Array(f)),s,a),a+=s.length}return[o||new Uint8Array(0),t.slice(c),n-(o?o.byteLength:0)]}U.joinUint8Arrays=nv;function nt(r,e){let t=Mn.isIteratorResult(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=ev.encodeUtf8(t)),t instanceof ArrayBuffer?new r(t):t instanceof Vc?new r(t):t instanceof tv?nt(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}U.toArrayBufferView=nt;U.toInt8Array=r=>nt(Int8Array,r);U.toInt16Array=r=>nt(Int16Array,r);U.toInt32Array=r=>nt(Int32Array,r);U.toBigInt64Array=r=>nt(Mn.BigInt64Array,r);U.toUint8Array=r=>nt(Uint8Array,r);U.toUint16Array=r=>nt(Uint16Array,r);U.toUint32Array=r=>nt(Uint32Array,r);U.toBigUint64Array=r=>nt(Mn.BigUint64Array,r);U.toFloat32Array=r=>nt(Float32Array,r);U.toFloat64Array=r=>nt(Float64Array,r);U.toUint8ClampedArray=r=>nt(Uint8ClampedArray,r);var Pc=r=>(r.next(),r);function*Jt(r,e){let t=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Vc?t(e):Mn.isIterable(e)?e:t(e);return yield*Pc(function*(i){let s=null;do s=i.next(yield nt(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}U.toArrayBufferViewIterator=Jt;U.toInt8ArrayIterator=r=>Jt(Int8Array,r);U.toInt16ArrayIterator=r=>Jt(Int16Array,r);U.toInt32ArrayIterator=r=>Jt(Int32Array,r);U.toUint8ArrayIterator=r=>Jt(Uint8Array,r);U.toUint16ArrayIterator=r=>Jt(Uint16Array,r);U.toUint32ArrayIterator=r=>Jt(Uint32Array,r);U.toFloat32ArrayIterator=r=>Jt(Float32Array,r);U.toFloat64ArrayIterator=r=>Jt(Float64Array,r);U.toUint8ClampedArrayIterator=r=>Jt(Uint8ClampedArray,r);function Lt(r,e){return Ne.__asyncGenerator(this,arguments,function*(){if(Mn.isPromise(e))return yield Ne.__await(yield Ne.__await(yield*Ne.__asyncDelegator(Ne.__asyncValues(Lt(r,yield Ne.__await(e))))));let n=function(o){return Ne.__asyncGenerator(this,arguments,function*(){yield yield Ne.__await(yield Ne.__await(o))})},i=function(o){return Ne.__asyncGenerator(this,arguments,function*(){yield Ne.__await(yield*Ne.__asyncDelegator(Ne.__asyncValues(Pc(function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)}(o[Symbol.iterator]())))))})},s=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Vc?n(e):Mn.isIterable(e)?i(e):Mn.isAsyncIterable(e)?e:n(e);return yield Ne.__await(yield*Ne.__asyncDelegator(Ne.__asyncValues(Pc(function(o){return Ne.__asyncGenerator(this,arguments,function*(){let a=null;do a=yield Ne.__await(o.next(yield yield Ne.__await(nt(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Ne.__await(new r)})}U.toArrayBufferViewAsyncIterator=Lt;U.toInt8ArrayAsyncIterator=r=>Lt(Int8Array,r);U.toInt16ArrayAsyncIterator=r=>Lt(Int16Array,r);U.toInt32ArrayAsyncIterator=r=>Lt(Int32Array,r);U.toUint8ArrayAsyncIterator=r=>Lt(Uint8Array,r);U.toUint16ArrayAsyncIterator=r=>Lt(Uint16Array,r);U.toUint32ArrayAsyncIterator=r=>Lt(Uint32Array,r);U.toFloat32ArrayAsyncIterator=r=>Lt(Float32Array,r);U.toFloat64ArrayAsyncIterator=r=>Lt(Float64Array,r);U.toUint8ClampedArrayAsyncIterator=r=>Lt(Uint8ClampedArray,r);function iv(r,e,t){if(r!==0){t=t.slice(0,e+1);for(let n=-1;++n<=e;)t[n]+=r}return t}U.rebaseValueOffsets=iv;function sv(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}U.compareArrayLike=sv});var fs=g(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});var _e=et(),it=qe();Lc.default={fromIterable(r){return go(ov(r))},fromAsyncIterable(r){return go(av(r))},fromDOMStream(r){return go(cv(r))},fromNodeStream(r){return go(uv(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}};var go=r=>(r.next(),r);function*ov(r){let e,t=!1,n=[],i,s,o,a=0;function c(){return s==="peek"?it.joinUint8Arrays(n,o)[0]:([i,n,a]=it.joinUint8Arrays(n,o),i)}({cmd:s,size:o}=yield null);let f=it.toUint8ArrayIterator(r)[Symbol.iterator]();try{do if({done:e,value:i}=isNaN(o-a)?f.next(void 0):f.next(o-a),!e&&i.byteLength>0&&(n.push(i),a+=i.byteLength),e||o<=a)do({cmd:s,size:o}=yield c());while(o<a);while(!e)}catch(y){(t=!0)&&typeof f.throw=="function"&&f.throw(y)}finally{t===!1&&typeof f.return=="function"&&f.return(null)}return null}function av(r){return _e.__asyncGenerator(this,arguments,function*(){let t,n=!1,i=[],s,o,a,c=0;function f(){return o==="peek"?it.joinUint8Arrays(i,a)[0]:([s,i,c]=it.joinUint8Arrays(i,a),s)}({cmd:o,size:a}=yield yield _e.__await(null));let y=it.toUint8ArrayAsyncIterator(r)[Symbol.asyncIterator]();try{do if({done:t,value:s}=isNaN(a-c)?yield _e.__await(y.next(void 0)):yield _e.__await(y.next(a-c)),!t&&s.byteLength>0&&(i.push(s),c+=s.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield _e.__await(f()));while(a<c);while(!t)}catch(B){(n=!0)&&typeof y.throw=="function"&&(yield _e.__await(y.throw(B)))}finally{n===!1&&typeof y.return=="function"&&(yield _e.__await(y.return(new Uint8Array(0))))}return yield _e.__await(null)})}function cv(r){return _e.__asyncGenerator(this,arguments,function*(){let t=!1,n=!1,i=[],s,o,a,c=0;function f(){return o==="peek"?it.joinUint8Arrays(i,a)[0]:([s,i,c]=it.joinUint8Arrays(i,a),s)}({cmd:o,size:a}=yield yield _e.__await(null));let y=new ah(r);try{do if({done:t,value:s}=isNaN(a-c)?yield _e.__await(y.read(void 0)):yield _e.__await(y.read(a-c)),!t&&s.byteLength>0&&(i.push(it.toUint8Array(s)),c+=s.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield _e.__await(f()));while(a<c);while(!t)}catch(B){(n=!0)&&(yield _e.__await(y.cancel(B)))}finally{n===!1?yield _e.__await(y.cancel()):r.locked&&y.releaseLock()}return yield _e.__await(null)})}var ah=class{constructor(e){this.source=e,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch(t){this.supportsBYOB=!(this.reader=this.getDefaultReader())}}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}cancel(e){return _e.__awaiter(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return _e.__awaiter(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=!this.supportsBYOB||typeof e!="number"?yield this.getDefaultReader().read():yield this.readFromBYOBReader(e);return!t.done&&(t.value=it.toUint8Array(t)),t})}getDefaultReader(){return this.byobReader&&this.releaseLock(),this.defaultReader||(this.defaultReader=this.source.getReader(),this.defaultReader.closed.catch(()=>{})),this.reader=this.defaultReader}getBYOBReader(){return this.defaultReader&&this.releaseLock(),this.byobReader||(this.byobReader=this.source.getReader({mode:"byob"}),this.byobReader.closed.catch(()=>{})),this.reader=this.byobReader}readFromBYOBReader(e){return _e.__awaiter(this,void 0,void 0,function*(){return yield ch(this.getBYOBReader(),new ArrayBuffer(e),0,e)})}};function ch(r,e,t,n){return _e.__awaiter(this,void 0,void 0,function*(){if(t>=n)return{done:!1,value:new Uint8Array(e,0,n)};let{done:i,value:s}=yield r.read(new Uint8Array(e,t,n-t));return(t+=s.byteLength)<n&&!i?yield ch(r,s.buffer,t,n):{done:i,value:new Uint8Array(s.buffer,0,t)}})}var Nc=(r,e)=>{let t=i=>n([e,i]),n;return[e,t,new Promise(i=>(n=i)&&r.once(e,t))]};function uv(r){return _e.__asyncGenerator(this,arguments,function*(){let t=[],n="error",i=!1,s=null,o,a,c=0,f=[],y;function B(){return o==="peek"?it.joinUint8Arrays(f,a)[0]:([y,f,c]=it.joinUint8Arrays(f,a),y)}if({cmd:o,size:a}=yield yield _e.__await(null),r.isTTY)return yield yield _e.__await(new Uint8Array(0)),yield _e.__await(null);try{t[0]=Nc(r,"end"),t[1]=Nc(r,"error");do{if(t[2]=Nc(r,"readable"),[n,s]=yield _e.__await(Promise.race(t.map(A=>A[2]))),n==="error")break;if((i=n==="end")||(isFinite(a-c)?(y=it.toUint8Array(r.read(a-c)),y.byteLength<a-c&&(y=it.toUint8Array(r.read(void 0)))):y=it.toUint8Array(r.read(void 0)),y.byteLength>0&&(f.push(y),c+=y.byteLength)),i||a<=c)do({cmd:o,size:a}=yield yield _e.__await(B()));while(a<c)}while(!i)}finally{yield _e.__await(D(t,n==="error"?s:null))}return yield _e.__await(null);function D(A,J){return y=f=null,new Promise((te,ae)=>{for(let[fe,at]of A)r.off(fe,at);try{let fe=r.destroy;fe&&fe.call(r,J),J=void 0}catch(fe){J=fe||J}finally{J!=null?ae(J):te()}})}})}});var Ve=g(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Vector=ni.AbstractVector=void 0;var vo=class{};ni.AbstractVector=vo;ni.Vector=vo;vo.prototype.data=null});var Gr=g(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.Schema=F.Buffer=F.Field=F.DictionaryEncoding=F.KeyValue=F.Duration=F.Interval=F.Timestamp=F.Time=F.Date=F.Decimal=F.Bool=F.FixedSizeBinary=F.LargeBinary=F.LargeUtf8=F.Binary=F.Utf8=F.FloatingPoint=F.Int=F.Union=F.Map=F.FixedSizeList=F.LargeList=F.List=F.Struct_=F.Null=F.Endianness=F.DictionaryKind=F.Type=F.IntervalUnit=F.TimeUnit=F.DateUnit=F.Precision=F.UnionMode=F.Feature=F.MetadataVersion=void 0;var ve=wr(),lv;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(lv=F.MetadataVersion||(F.MetadataVersion={}));var dv;(function(r){r[r.UNUSED=0]="UNUSED",r[r.DICTIONARY_REPLACEMENT=1]="DICTIONARY_REPLACEMENT",r[r.COMPRESSED_BODY=2]="COMPRESSED_BODY"})(dv=F.Feature||(F.Feature={}));var kc;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(kc=F.UnionMode||(F.UnionMode={}));var Cc;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(Cc=F.Precision||(F.Precision={}));var jc;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(jc=F.DateUnit||(F.DateUnit={}));var Un;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(Un=F.TimeUnit||(F.TimeUnit={}));var qc;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME"})(qc=F.IntervalUnit||(F.IntervalUnit={}));var Hc;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList"})(Hc=F.Type||(F.Type={}));var zc;(function(r){r[r.DenseArray=0]="DenseArray"})(zc=F.DictionaryKind||(F.DictionaryKind={}));var Wc;(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Wc=F.Endianness||(F.Endianness={}));var En=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new En).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new En).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return En.startNull(e),En.endNull(e)}};F.Null=En;var Rn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new Rn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Rn).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return Rn.startStruct_(e),Rn.endStruct_(e)}};F.Struct_=Rn;var Vn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return Vn.startList(e),Vn.endList(e)}};F.List=Vn;var xn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new xn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new xn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return xn.startLargeList(e),xn.endLargeList(e)}};F.LargeList=xn;var Cr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new Cr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Cr).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return Cr.startFixedSizeList(e),Cr.addListSize(e,t),Cr.endFixedSizeList(e)}};F.FixedSizeList=Cr;var jr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new jr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new jr).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return jr.startMap(e),jr.addKeysSorted(e,t),jr.endMap(e)}};F.Map=jr;var Br=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new Br).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Br).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):kc.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,kc.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return Br.startUnion(e),Br.addMode(e,t),Br.addTypeIds(e,n),Br.endUnion(e)}};F.Union=Br;var Xt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new Xt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Xt).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return Xt.startInt(e),Xt.addBitWidth(e,t),Xt.addIsSigned(e,n),Xt.endInt(e)}};F.Int=Xt;var qr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new qr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new qr).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Cc.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,Cc.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return qr.startFloatingPoint(e),qr.addPrecision(e,t),qr.endFloatingPoint(e)}};F.FloatingPoint=qr;var Pn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new Pn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Pn).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return Pn.startUtf8(e),Pn.endUtf8(e)}};F.Utf8=Pn;var Nn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new Nn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Nn).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return Nn.startBinary(e),Nn.endBinary(e)}};F.Binary=Nn;var Ln=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new Ln).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ln).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return Ln.startLargeUtf8(e),Ln.endLargeUtf8(e)}};F.LargeUtf8=Ln;var kn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return kn.startLargeBinary(e),kn.endLargeBinary(e)}};F.LargeBinary=kn;var Hr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return Hr.startFixedSizeBinary(e),Hr.addByteWidth(e,t),Hr.endFixedSizeBinary(e)}};F.FixedSizeBinary=Hr;var Cn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new Cn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Cn).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return Cn.startBool(e),Cn.endBool(e)}};F.Bool=Cn;var Zt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new Zt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Zt).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,i){return Zt.startDecimal(e),Zt.addPrecision(e,t),Zt.addScale(e,n),Zt.addBitWidth(e,i),Zt.endDecimal(e)}};F.Decimal=Zt;var zr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new zr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new zr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):jc.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,jc.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return zr.startDate(e),zr.addUnit(e,t),zr.endDate(e)}};F.Date=zr;var Ir=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new Ir).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ir).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Un.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Un.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return Ir.startTime(e),Ir.addUnit(e,t),Ir.addBitWidth(e,n),Ir.endTime(e)}};F.Time=Ir;var Sr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new Sr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Sr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Un.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Un.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return Sr.startTimestamp(e),Sr.addUnit(e,t),Sr.addTimezone(e,n),Sr.endTimestamp(e)}};F.Timestamp=Sr;var Wr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):qc.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,qc.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return Wr.startInterval(e),Wr.addUnit(e,t),Wr.endInterval(e)}};F.Interval=Wr;var Yr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new Yr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Yr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Un.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Un.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return Yr.startDuration(e),Yr.addUnit(e,t),Yr.endDuration(e)}};F.Duration=Yr;var kt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new kt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new kt).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return kt.startKeyValue(e),kt.addKey(e,t),kt.addValue(e,n),kt.endKeyValue(e)}};F.KeyValue=kt;var yt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new yt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new yt).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Xt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):zc.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,zc.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}static createDictionaryEncoding(e,t,n,i,s){return yt.startDictionaryEncoding(e),yt.addId(e,t),yt.addIndexType(e,n),yt.addIsOrdered(e,i),yt.addDictionaryKind(e,s),yt.endDictionaryEncoding(e)}};F.DictionaryEncoding=yt;var rt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new rt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new rt).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Hc.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new yt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new rt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new kt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,Hc.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}static createField(e,t,n,i,s,o,a,c){return rt.startField(e),rt.addName(e,t),rt.addNullable(e,n),rt.addTypeType(e,i),rt.addType(e,s),rt.addDictionary(e,o),rt.addChildren(e,a),rt.addCustomMetadata(e,c),rt.endField(e)}};F.Field=rt;var uh=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(n),e.writeInt64(t),e.offset()}};F.Buffer=uh;var Ct=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new Ct).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+ve.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ct).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Wc.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new rt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new kt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):this.bb.createLong(0,0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,Wc.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,n,i,s){return Ct.startSchema(e),Ct.addEndianness(e,t),Ct.addFields(e,n),Ct.addCustomMetadata(e,i),Ct.addFeatures(e,s),Ct.endSchema(e)}};F.Schema=Ct});var Io=g(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.Message=xe.DictionaryBatch=xe.RecordBatch=xe.BodyCompression=xe.FieldNode=xe.MessageHeader=xe.BodyCompressionMethod=xe.CompressionType=void 0;var wo=wr(),Bo=Gr(),Yc;(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(Yc=xe.CompressionType||(xe.CompressionType={}));var Gc;(function(r){r[r.BUFFER=0]="BUFFER"})(Gc=xe.BodyCompressionMethod||(xe.BodyCompressionMethod={}));var $c;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})($c=xe.MessageHeader||(xe.MessageHeader={}));var Kc=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(n),e.writeInt64(t),e.offset()}};xe.FieldNode=Kc;var Qt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new Qt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+wo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Qt).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Yc.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Gc.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,Yc.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,Gc.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return Qt.startBodyCompression(e),Qt.addCodec(e,t),Qt.addMethod(e,n),Qt.endBodyCompression(e)}};xe.BodyCompression=Qt;var _t=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new _t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+wo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new _t).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new Kc).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Bo.Buffer).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new Qt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static endRecordBatch(e){return e.endObject()}static createRecordBatch(e,t,n,i,s){return _t.startRecordBatch(e),_t.addLength(e,t),_t.addNodes(e,n),_t.addBuffers(e,i),_t.addCompression(e,s),_t.endRecordBatch(e)}};xe.RecordBatch=_t;var er=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new er).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+wo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new er).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new _t).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}static createDictionaryBatch(e,t,n,i){return er.startDictionaryBatch(e),er.addId(e,t),er.addData(e,n),er.addIsDelta(e,i),er.endDictionaryBatch(e)}};xe.DictionaryBatch=er;var mt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new mt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+wo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new mt).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Bo.MetadataVersion.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):$c.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Bo.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Bo.MetadataVersion.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,$c.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,e.createLong(0,0))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,n,i,s,o){return mt.startMessage(e),mt.addVersion(e,t),mt.addHeaderType(e,n),mt.addHeader(e,i),mt.addBodyLength(e,s),mt.addCustomMetadata(e,o),mt.endMessage(e)}};xe.Message=mt});var be=g(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.BufferType=Ae.Type=Ae.MessageHeader=Ae.MetadataVersion=Ae.IntervalUnit=Ae.UnionMode=Ae.Precision=Ae.TimeUnit=Ae.DateUnit=void 0;var ii=Gr();Object.defineProperty(Ae,"DateUnit",{enumerable:!0,get:function(){return ii.DateUnit}});Object.defineProperty(Ae,"TimeUnit",{enumerable:!0,get:function(){return ii.TimeUnit}});Object.defineProperty(Ae,"Precision",{enumerable:!0,get:function(){return ii.Precision}});Object.defineProperty(Ae,"UnionMode",{enumerable:!0,get:function(){return ii.UnionMode}});Object.defineProperty(Ae,"IntervalUnit",{enumerable:!0,get:function(){return ii.IntervalUnit}});Object.defineProperty(Ae,"MetadataVersion",{enumerable:!0,get:function(){return ii.MetadataVersion}});var fv=Io();Object.defineProperty(Ae,"MessageHeader",{enumerable:!0,get:function(){return fv.MessageHeader}});var hv;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth"})(hv=Ae.Type||(Ae.Type={}));var pv;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(pv=Ae.BufferType||(Ae.BufferType={}))});var tr=g(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.popcnt_uint32=Le.popcnt_array=Le.popcnt_bit_range=Le.BitIterator=Le.packBools=Le.truncateBitmap=Le.setBool=Le.getBit=Le.getBool=void 0;function lh(r,e,t,n){return(t&1<<n)!==0}Le.getBool=lh;function dh(r,e,t,n){return(t&1<<n)>>n}Le.getBit=dh;function yv(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}Le.setBool=yv;function _v(r,e,t){let n=t.byteLength+7&~7;if(r>0||t.byteLength<n){let i=new Uint8Array(n);return i.set(r%8===0?t.subarray(r>>3):fh(new So(t,r,e,null,lh)).subarray(0,n)),i}return t}Le.truncateBitmap=_v;function fh(r){let e=[],t=0,n=0,i=0;for(let o of r)o&&(i|=1<<n),++n===8&&(e[t++]=i,i=n=0);(t===0||n>0)&&(e[t++]=i);let s=new Uint8Array(e.length+7&~7);return s.set(e),s}Le.packBools=fh;var So=class{constructor(e,t,n,i,s){this.bytes=e,this.length=n,this.context=i,this.get=s,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};Le.BitIterator=So;function Jc(r,e,t){if(t-e<=0)return 0;if(t-e<8){let s=0;for(let o of new So(r,e,t-e,r,dh))s+=o;return s}let n=t>>3<<3,i=e+(e%8===0?0:8-e%8);return Jc(r,e,i)+Jc(r,n,t)+hh(r,i>>3,n-i>>3)}Le.popcnt_bit_range=Jc;function hh(r,e,t){let n=0,i=e|0,s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=t===void 0?r.byteLength:i+t;for(;o-i>=4;)n+=To(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=To(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=To(s.getUint8(i)),i+=1;return n}Le.popcnt_array=hh;function To(r){let e=r|0;return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}Le.popcnt_uint32=To});var ce=g(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.strideForType=I.Dictionary=I.Map_=I.FixedSizeList=I.FixedSizeBinary=I.SparseUnion=I.DenseUnion=I.Union=I.Struct=I.List=I.IntervalYearMonth=I.IntervalDayTime=I.Interval=I.TimestampNanosecond=I.TimestampMicrosecond=I.TimestampMillisecond=I.TimestampSecond=I.Timestamp=I.TimeNanosecond=I.TimeMicrosecond=I.TimeMillisecond=I.TimeSecond=I.Time=I.DateMillisecond=I.DateDay=I.Date_=I.Decimal=I.Bool=I.Utf8=I.Binary=I.Float64=I.Float32=I.Float16=I.Float=I.Uint64=I.Uint32=I.Uint16=I.Uint8=I.Int64=I.Int32=I.Int16=I.Int8=I.Int=I.Null=I.DataType=void 0;var E=be(),Fe=class{static isNull(e){return(e==null?void 0:e.typeId)===E.Type.Null}static isInt(e){return(e==null?void 0:e.typeId)===E.Type.Int}static isFloat(e){return(e==null?void 0:e.typeId)===E.Type.Float}static isBinary(e){return(e==null?void 0:e.typeId)===E.Type.Binary}static isUtf8(e){return(e==null?void 0:e.typeId)===E.Type.Utf8}static isBool(e){return(e==null?void 0:e.typeId)===E.Type.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===E.Type.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===E.Type.Date}static isTime(e){return(e==null?void 0:e.typeId)===E.Type.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===E.Type.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===E.Type.Interval}static isList(e){return(e==null?void 0:e.typeId)===E.Type.List}static isStruct(e){return(e==null?void 0:e.typeId)===E.Type.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===E.Type.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===E.Type.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===E.Type.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===E.Type.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===E.Type.Dictionary}get typeId(){return E.Type.NONE}};I.DataType=Fe;Fe[Symbol.toStringTag]=(r=>(r.children=null,r.ArrayType=Array,r[Symbol.toStringTag]="DataType"))(Fe.prototype);var Ao=class extends Fe{toString(){return"Null"}get typeId(){return E.Type.Null}};I.Null=Ao;Ao[Symbol.toStringTag]=(r=>r[Symbol.toStringTag]="Null")(Ao.prototype);var bt=class extends Fe{constructor(e,t){super();this.isSigned=e,this.bitWidth=t}get typeId(){return E.Type.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?Int32Array:Uint32Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};I.Int=bt;bt[Symbol.toStringTag]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(bt.prototype);var Xc=class extends bt{constructor(){super(!0,8)}};I.Int8=Xc;var Zc=class extends bt{constructor(){super(!0,16)}};I.Int16=Zc;var Qc=class extends bt{constructor(){super(!0,32)}};I.Int32=Qc;var eu=class extends bt{constructor(){super(!0,64)}};I.Int64=eu;var tu=class extends bt{constructor(){super(!1,8)}};I.Uint8=tu;var ru=class extends bt{constructor(){super(!1,16)}};I.Uint16=ru;var nu=class extends bt{constructor(){super(!1,32)}};I.Uint32=nu;var iu=class extends bt{constructor(){super(!1,64)}};I.Uint64=iu;Object.defineProperty(Xc.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Zc.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Qc.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(eu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(tu.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(ru.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(nu.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(iu.prototype,"ArrayType",{value:Uint32Array});var jn=class extends Fe{constructor(e){super();this.precision=e}get typeId(){return E.Type.Float}get ArrayType(){switch(this.precision){case E.Precision.HALF:return Uint16Array;case E.Precision.SINGLE:return Float32Array;case E.Precision.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};I.Float=jn;jn[Symbol.toStringTag]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(jn.prototype);var su=class extends jn{constructor(){super(E.Precision.HALF)}};I.Float16=su;var ou=class extends jn{constructor(){super(E.Precision.SINGLE)}};I.Float32=ou;var au=class extends jn{constructor(){super(E.Precision.DOUBLE)}};I.Float64=au;Object.defineProperty(su.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(ou.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(au.prototype,"ArrayType",{value:Float64Array});var Fo=class extends Fe{constructor(){super()}get typeId(){return E.Type.Binary}toString(){return"Binary"}};I.Binary=Fo;Fo[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Fo.prototype);var Do=class extends Fe{constructor(){super()}get typeId(){return E.Type.Utf8}toString(){return"Utf8"}};I.Utf8=Do;Do[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Do.prototype);var Oo=class extends Fe{constructor(){super()}get typeId(){return E.Type.Bool}toString(){return"Bool"}};I.Bool=Oo;Oo[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Oo.prototype);var Mo=class extends Fe{constructor(e,t){super();this.scale=e,this.precision=t}get typeId(){return E.Type.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};I.Decimal=Mo;Mo[Symbol.toStringTag]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Mo.prototype);var si=class extends Fe{constructor(e){super();this.unit=e}get typeId(){return E.Type.Date}toString(){return`Date${(this.unit+1)*32}<${E.DateUnit[this.unit]}>`}};I.Date_=si;si[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Date"))(si.prototype);var ph=class extends si{constructor(){super(E.DateUnit.DAY)}};I.DateDay=ph;var yh=class extends si{constructor(){super(E.DateUnit.MILLISECOND)}};I.DateMillisecond=yh;var $r=class extends Fe{constructor(e,t){super();this.unit=e,this.bitWidth=t}get typeId(){return E.Type.Time}toString(){return`Time${this.bitWidth}<${E.TimeUnit[this.unit]}>`}};I.Time=$r;$r[Symbol.toStringTag]=(r=>(r.unit=null,r.bitWidth=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Time"))($r.prototype);var _h=class extends $r{constructor(){super(E.TimeUnit.SECOND,32)}};I.TimeSecond=_h;var mh=class extends $r{constructor(){super(E.TimeUnit.MILLISECOND,32)}};I.TimeMillisecond=mh;var bh=class extends $r{constructor(){super(E.TimeUnit.MICROSECOND,64)}};I.TimeMicrosecond=bh;var gh=class extends $r{constructor(){super(E.TimeUnit.NANOSECOND,64)}};I.TimeNanosecond=gh;var Kr=class extends Fe{constructor(e,t){super();this.unit=e,this.timezone=t}get typeId(){return E.Type.Timestamp}toString(){return`Timestamp<${E.TimeUnit[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};I.Timestamp=Kr;Kr[Symbol.toStringTag]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Timestamp"))(Kr.prototype);var vh=class extends Kr{constructor(e){super(E.TimeUnit.SECOND,e)}};I.TimestampSecond=vh;var wh=class extends Kr{constructor(e){super(E.TimeUnit.MILLISECOND,e)}};I.TimestampMillisecond=wh;var Bh=class extends Kr{constructor(e){super(E.TimeUnit.MICROSECOND,e)}};I.TimestampMicrosecond=Bh;var Ih=class extends Kr{constructor(e){super(E.TimeUnit.NANOSECOND,e)}};I.TimestampNanosecond=Ih;var oi=class extends Fe{constructor(e){super();this.unit=e}get typeId(){return E.Type.Interval}toString(){return`Interval<${E.IntervalUnit[this.unit]}>`}};I.Interval=oi;oi[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(oi.prototype);var Sh=class extends oi{constructor(){super(E.IntervalUnit.DAY_TIME)}};I.IntervalDayTime=Sh;var Th=class extends oi{constructor(){super(E.IntervalUnit.YEAR_MONTH)}};I.IntervalYearMonth=Th;var Uo=class extends Fe{constructor(e){super();this.children=[e]}get typeId(){return E.Type.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}};I.List=Uo;Uo[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Uo.prototype);var Eo=class extends Fe{constructor(e){super();this.children=e}get typeId(){return E.Type.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};I.Struct=Eo;Eo[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Eo.prototype);var ai=class extends Fe{constructor(e,t,n){super();this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}get typeId(){return E.Type.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};I.Union=ai;ai[Symbol.toStringTag]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(ai.prototype);var Ah=class extends ai{constructor(e,t){super(E.UnionMode.Dense,e,t)}};I.DenseUnion=Ah;var Fh=class extends ai{constructor(e,t){super(E.UnionMode.Sparse,e,t)}};I.SparseUnion=Fh;var Ro=class extends Fe{constructor(e){super();this.byteWidth=e}get typeId(){return E.Type.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};I.FixedSizeBinary=Ro;Ro[Symbol.toStringTag]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Ro.prototype);var Vo=class extends Fe{constructor(e,t){super();this.listSize=e,this.children=[t]}get typeId(){return E.Type.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}>`}};I.FixedSizeList=Vo;Vo[Symbol.toStringTag]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Vo.prototype);var xo=class extends Fe{constructor(e,t=!1){super();this.children=[e],this.keysSorted=t}get typeId(){return E.Type.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};I.Map_=xo;xo[Symbol.toStringTag]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(xo.prototype);var mv=(r=>()=>++r)(-1),Po=class extends Fe{constructor(e,t,n,i){super();this.indices=t,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?mv():typeof n=="number"?n:n.low}get typeId(){return E.Type.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}>`}};I.Dictionary=Po;Po[Symbol.toStringTag]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Po.prototype);function bv(r){let e=r;switch(r.typeId){case E.Type.Decimal:return 4;case E.Type.Timestamp:return 2;case E.Type.Date:return 1+e.unit;case E.Type.Interval:return 1+e.unit;case E.Type.Int:return 1+ +(e.bitWidth>32);case E.Type.Time:return 1+ +(e.bitWidth>32);case E.Type.FixedSizeList:return e.listSize;case E.Type.FixedSizeBinary:return e.byteWidth;default:return 1}}I.strideForType=bv});var jt=g(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.Data=qn.kUnknownNullCount=void 0;var gv=tr(),vv=tr(),x=be(),wv=ce(),se=qe();qn.kUnknownNullCount=-1;var G=class{constructor(e,t,n,i,s,o,a){this.type=e,this.dictionary=a,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1)),this.childData=(o||[]).map(f=>f instanceof G?f:f.data);let c;s instanceof G?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=wv.strideForType(e),s&&((c=s[0])&&(this.valueOffsets=c),(c=s[1])&&(this.values=c),(c=s[2])&&(this.nullBitmap=c),(c=s[3])&&(this.typeIds=c)))}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 e=0,{valueOffsets:t,values:n,nullBitmap:i,typeIds:s}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),s&&(e+=s.byteLength),this.childData.reduce((o,a)=>o+a.byteLength,e)}get nullCount(){let e=this._nullCount,t;return e<=qn.kUnknownNullCount&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-vv.popcnt_bit_range(t,this.offset,this.offset+this.length)),e}clone(e,t=this.offset,n=this.length,i=this._nullCount,s=this,o=this.childData){return new G(e,t,n,i,s,o,this.dictionary)}slice(e,t){let{stride:n,typeId:i,childData:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(e,t,n,i);return this.clone(this.type,this.offset+e,t,o,c,!s.length||this.valueOffsets?s:this._sliceChildren(s,a*e,a*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===x.Type.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,i=new Uint8Array((e+63&~63)>>3).fill(255,0,t>>3);i[t>>3]=(1<<t-(t&~7))-1,n>0&&i.set(gv.truncateBitmap(this.offset,t,this.nullBitmap),0);let s=this.buffers;return s[x.BufferType.VALIDITY]=i,this.clone(this.type,0,e,n+(e-t),s)}_sliceBuffers(e,t,n,i){let s,{buffers:o}=this;return(s=o[x.BufferType.TYPE])&&(o[x.BufferType.TYPE]=s.subarray(e,e+t)),(s=o[x.BufferType.OFFSET])&&(o[x.BufferType.OFFSET]=s.subarray(e,e+t+1))||(s=o[x.BufferType.DATA])&&(o[x.BufferType.DATA]=i===6?s:s.subarray(n*e,n*(e+t))),o}_sliceChildren(e,t,n){return e.map(i=>i.slice(t,n))}static new(e,t,n,i,s,o,a){switch(s instanceof G?s=s.buffers:s||(s=[]),e.typeId){case x.Type.Null:return G.Null(e,t,n);case x.Type.Int:return G.Int(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Dictionary:return G.Dictionary(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[],a);case x.Type.Float:return G.Float(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Bool:return G.Bool(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Decimal:return G.Decimal(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Date:return G.Date(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Time:return G.Time(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Timestamp:return G.Timestamp(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Interval:return G.Interval(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.FixedSizeBinary:return G.FixedSizeBinary(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.DATA]||[]);case x.Type.Binary:return G.Binary(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.OFFSET]||[],s[x.BufferType.DATA]||[]);case x.Type.Utf8:return G.Utf8(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.OFFSET]||[],s[x.BufferType.DATA]||[]);case x.Type.List:return G.List(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.OFFSET]||[],(o||[])[0]);case x.Type.FixedSizeList:return G.FixedSizeList(e,t,n,i||0,s[x.BufferType.VALIDITY],(o||[])[0]);case x.Type.Struct:return G.Struct(e,t,n,i||0,s[x.BufferType.VALIDITY],o||[]);case x.Type.Map:return G.Map(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.OFFSET]||[],(o||[])[0]);case x.Type.Union:return G.Union(e,t,n,i||0,s[x.BufferType.VALIDITY],s[x.BufferType.TYPE]||[],s[x.BufferType.OFFSET]||o,o)}throw new Error(`Unrecognized typeId ${e.typeId}`)}static Null(e,t,n){return new G(e,t,n,0)}static Int(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Dictionary(e,t,n,i,s,o,a){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.indices.ArrayType,o),se.toUint8Array(s)],[],a)}static Float(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Bool(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Decimal(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Date(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Time(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Timestamp(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Interval(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static FixedSizeBinary(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,se.toArrayBufferView(e.ArrayType,o),se.toUint8Array(s)])}static Binary(e,t,n,i,s,o,a){return new G(e,t,n,i,[se.toInt32Array(o),se.toUint8Array(a),se.toUint8Array(s)])}static Utf8(e,t,n,i,s,o,a){return new G(e,t,n,i,[se.toInt32Array(o),se.toUint8Array(a),se.toUint8Array(s)])}static List(e,t,n,i,s,o,a){return new G(e,t,n,i,[se.toInt32Array(o),void 0,se.toUint8Array(s)],a?[a]:[])}static FixedSizeList(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,void 0,se.toUint8Array(s)],o?[o]:[])}static Struct(e,t,n,i,s,o){return new G(e,t,n,i,[void 0,void 0,se.toUint8Array(s)],o)}static Map(e,t,n,i,s,o,a){return new G(e,t,n,i,[se.toInt32Array(o),void 0,se.toUint8Array(s)],a?[a]:[])}static Union(e,t,n,i,s,o,a,c){let f=[void 0,void 0,se.toUint8Array(s),se.toArrayBufferView(e.ArrayType,o)];return e.mode===x.UnionMode.Sparse?new G(e,t,n,i,f,a):(f[x.BufferType.OFFSET]=se.toInt32Array(a),new G(e,t,n,i,f,c))}};qn.Data=G;G.prototype.childData=Object.freeze([])});var cu=g(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.valueToString=void 0;var Bv=void 0;function Iv(r){if(r===null)return"null";if(r===Bv)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r)}No.valueToString=Iv});var Dh=g(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.createIsValidFunction=void 0;var uu=cu(),Sv=tt();function Tv(r){if(!r||r.length<=0)return function(i){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
|
|
2
|
-
switch (x) {${
|
|
3
|
-
case ${
|
|
1
|
+
var duckdb=(()=>{var Th=Object.create;var ci=Object.defineProperty,Dh=Object.defineProperties,Eh=Object.getOwnPropertyDescriptor,Oh=Object.getOwnPropertyDescriptors,Mh=Object.getOwnPropertyNames,Uc=Object.getOwnPropertySymbols,Rh=Object.getPrototypeOf,kc=Object.prototype.hasOwnProperty,Uh=Object.prototype.propertyIsEnumerable;var Nc=(r,t,e)=>t in r?ci(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Pr=(r,t)=>{for(var e in t||(t={}))kc.call(t,e)&&Nc(r,e,t[e]);if(Uc)for(var e of Uc(t))Uh.call(t,e)&&Nc(r,e,t[e]);return r},li=(r,t)=>Dh(r,Oh(t));var Nh=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(t,e)=>(typeof require!="undefined"?require:t)[e]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var us=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ln=(r,t)=>{for(var e in t)ci(r,e,{get:t[e],enumerable:!0})},Lc=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mh(t))!kc.call(r,i)&&i!==e&&ci(r,i,{get:()=>t[i],enumerable:!(n=Eh(t,i))||n.enumerable});return r};var Cc=(r,t,e)=>(e=r!=null?Th(Rh(r)):{},Lc(t||!r||!r.__esModule?ci(e,"default",{value:r,enumerable:!0}):e,r)),kh=r=>Lc(ci({},"__esModule",{value:!0}),r);var sl=us((Oy,hs)=>{var Pc,Vc,Hc,zc,jc,Wc,$c,Yc,Xc,ds,sa,Gc,Kc,Jc,xn,qc,Zc,Qc,tl,el,rl,nl,il,fs;(function(r){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(e(t,e(n)))}):typeof hs=="object"&&typeof hs.exports=="object"?r(e(t,e(hs.exports))):r(e(t));function e(n,i){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,o){return n[s]=i?i(s,o):o}}})(function(r){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};Pc=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Vc=Object.assign||function(n){for(var i,s=1,o=arguments.length;s<o;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])}return n},Hc=function(n,i){var s={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.indexOf(o)<0&&(s[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)i.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(s[o[a]]=n[o[a]]);return s},zc=function(n,i,s,o){var a=arguments.length,c=a<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,s):o,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(n,i,s,o);else for(var p=n.length-1;p>=0;p--)(d=n[p])&&(c=(a<3?d(c):a>3?d(i,s,c):d(i,s))||c);return a>3&&c&&Object.defineProperty(i,s,c),c},jc=function(n,i){return function(s,o){i(s,o,n)}},Wc=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},$c=function(n,i,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}return new(s||(s=Promise))(function(c,d){function p(S){try{y(o.next(S))}catch(J){d(J)}}function b(S){try{y(o.throw(S))}catch(J){d(J)}}function y(S){S.done?c(S.value):a(S.value).then(p,b)}y((o=o.apply(n,i||[])).next())})},Yc=function(n,i){var s={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,a,c,d;return d={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function p(y){return function(S){return b([y,S])}}function b(y){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,a&&(c=y[0]&2?a.return:y[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,y[1])).done)return c;switch(a=0,c&&(y=[y[0]&2,c.value]),y[0]){case 0:case 1:c=y;break;case 4:return s.label++,{value:y[1],done:!1};case 5:s.label++,a=y[1],y=[0];continue;case 7:y=s.ops.pop(),s.trys.pop();continue;default:if(c=s.trys,!(c=c.length>0&&c[c.length-1])&&(y[0]===6||y[0]===2)){s=0;continue}if(y[0]===3&&(!c||y[1]>c[0]&&y[1]<c[3])){s.label=y[1];break}if(y[0]===6&&s.label<c[1]){s.label=c[1],c=y;break}if(c&&s.label<c[2]){s.label=c[2],s.ops.push(y);break}c[2]&&s.ops.pop(),s.trys.pop();continue}y=i.call(n,s)}catch(S){y=[6,S],a=0}finally{o=c=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},Xc=function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&fs(i,n,s)},fs=Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]},ds=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],o=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},sa=function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var o=s.call(n),a,c=[],d;try{for(;(i===void 0||i-- >0)&&!(a=o.next()).done;)c.push(a.value)}catch(p){d={error:p}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(d)throw d.error}}return c},Gc=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(sa(arguments[i]));return n},Kc=function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var o=Array(n),a=0,i=0;i<s;i++)for(var c=arguments[i],d=0,p=c.length;d<p;d++,a++)o[a]=c[d];return o},Jc=function(n,i,s){if(s||arguments.length===2)for(var o=0,a=i.length,c;o<a;o++)(c||!(o in i))&&(c||(c=Array.prototype.slice.call(i,0,o)),c[o]=i[o]);return n.concat(c||Array.prototype.slice.call(i))},xn=function(n){return this instanceof xn?(this.v=n,this):new xn(n)},qc=function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=s.apply(n,i||[]),a,c=[];return a={},d("next"),d("throw"),d("return"),a[Symbol.asyncIterator]=function(){return this},a;function d(q){o[q]&&(a[q]=function(ot){return new Promise(function(St,Qt){c.push([q,ot,St,Qt])>1||p(q,ot)})})}function p(q,ot){try{b(o[q](ot))}catch(St){J(c[0][3],St)}}function b(q){q.value instanceof xn?Promise.resolve(q.value.v).then(y,S):J(c[0][2],q)}function y(q){p("next",q)}function S(q){p("throw",q)}function J(q,ot){q(ot),c.shift(),c.length&&p(c[0][0],c[0][1])}},Zc=function(n){var i,s;return i={},o("next"),o("throw",function(a){throw a}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(a,c){i[a]=n[a]?function(d){return(s=!s)?{value:xn(n[a](d)),done:a==="return"}:c?c(d):d}:c}},Qc=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof ds=="function"?ds(n):n[Symbol.iterator](),s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s);function o(c){s[c]=n[c]&&function(d){return new Promise(function(p,b){d=n[c](d),a(p,b,d.done,d.value)})}}function a(c,d,p,b){Promise.resolve(b).then(function(y){c({value:y,done:p})},d)}},tl=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var e=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};el=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&fs(i,n,s);return e(i,n),i},rl=function(n){return n&&n.__esModule?n:{default:n}},nl=function(n,i,s,o){if(s==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!o:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?o:s==="a"?o.call(n):o?o.value:i.get(n)},il=function(n,i,s,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(n,s):a?a.value=s:i.set(n,s),s},r("__extends",Pc),r("__assign",Vc),r("__rest",Hc),r("__decorate",zc),r("__param",jc),r("__metadata",Wc),r("__awaiter",$c),r("__generator",Yc),r("__exportStar",Xc),r("__createBinding",fs),r("__values",ds),r("__read",sa),r("__spread",Gc),r("__spreadArrays",Kc),r("__spreadArray",Jc),r("__await",xn),r("__asyncGenerator",qc),r("__asyncDelegator",Zc),r("__asyncValues",Qc),r("__makeTemplateObject",tl),r("__importStar",el),r("__importDefault",rl),r("__classPrivateFieldGet",nl),r("__classPrivateFieldSet",il)})});var nc=us(()=>{});var $u=us(()=>{});var Zu=us((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(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(r,t){return function(e){return new Sha256(t,!0).update(e)[r]()}},createMethod=function(r){var t=createOutputMethod("hex",r);NODE_JS&&(t=nodeWrap(t,r)),t.create=function(){return new Sha256(r)},t.update=function(i){return t.create().update(i)};for(var e=0;e<OUTPUT_TYPES.length;++e){var n=OUTPUT_TYPES[e];t[n]=createOutputMethod(n,r)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(r){if(typeof r=="string")return crypto.createHash(algorithm).update(r,"utf8").digest("hex");if(r==null)throw new Error(ERROR);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(r)).digest("hex"):method(r)};return nodeMethod},createHmacOutputMethod=function(r,t){return function(e,n){return new HmacSha256(e,t,!0).update(n)[r]()}},createHmacMethod=function(r){var t=createHmacOutputMethod("hex",r);t.create=function(i){return new HmacSha256(i,r)},t.update=function(i,s){return t.create(i).update(s)};for(var e=0;e<OUTPUT_TYPES.length;++e){var n=OUTPUT_TYPES[e];t[n]=createHmacOutputMethod(n,r)}return t};function Sha256(r,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],r?(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=r}Sha256.prototype.update=function(r){if(!this.finalized){var t,e=typeof r;if(e!=="string"){if(e==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var n,i=0,s,o=r.length,a=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(s=this.start;i<o&&s<64;++i)a[s>>2]|=r[i]<<SHIFT[s++&3];else for(s=this.start;i<o&&s<64;++i)n=r.charCodeAt(i),n<128?a[s>>2]|=n<<SHIFT[s++&3]:n<2048?(a[s>>2]|=(192|n>>6)<<SHIFT[s++&3],a[s>>2]|=(128|n&63)<<SHIFT[s++&3]):n<55296||n>=57344?(a[s>>2]|=(224|n>>12)<<SHIFT[s++&3],a[s>>2]|=(128|n>>6&63)<<SHIFT[s++&3],a[s>>2]|=(128|n&63)<<SHIFT[s++&3]):(n=65536+((n&1023)<<10|r.charCodeAt(++i)&1023),a[s>>2]|=(240|n>>18)<<SHIFT[s++&3],a[s>>2]|=(128|n>>12&63)<<SHIFT[s++&3],a[s>>2]|=(128|n>>6&63)<<SHIFT[s++&3],a[s>>2]|=(128|n&63)<<SHIFT[s++&3]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=a[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}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 r=this.blocks,t=this.lastByteIndex;r[16]=this.block,r[t>>2]|=EXTRA[t&3],this.block=r[16],t>=56&&(this.hashed||this.hash(),r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.hBytes<<3|this.bytes>>>29,r[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var r=this.h0,t=this.h1,e=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,a=this.h7,c=this.blocks,d,p,b,y,S,J,q,ot,St,Qt,se;for(d=16;d<64;++d)S=c[d-15],p=(S>>>7|S<<25)^(S>>>18|S<<14)^S>>>3,S=c[d-2],b=(S>>>17|S<<15)^(S>>>19|S<<13)^S>>>10,c[d]=c[d-16]+p+c[d-7]+b<<0;for(se=t&e,d=0;d<64;d+=4)this.first?(this.is224?(ot=300032,S=c[0]-1413257819,a=S-150054599<<0,n=S+24177077<<0):(ot=704751109,S=c[0]-210244248,a=S-1521486534<<0,n=S+143694565<<0),this.first=!1):(p=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),b=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),ot=r&t,y=ot^r&e^se,q=i&s^~i&o,S=a+b+q+K[d]+c[d],J=p+y,a=n+S<<0,n=S+J<<0),p=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),b=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),St=n&r,y=St^n&t^ot,q=a&i^~a&s,S=o+b+q+K[d+1]+c[d+1],J=p+y,o=e+S<<0,e=S+J<<0,p=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),b=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),Qt=e&n,y=Qt^e&r^St,q=o&a^~o&i,S=s+b+q+K[d+2]+c[d+2],J=p+y,s=t+S<<0,t=S+J<<0,p=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),b=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),se=t&e,y=se^t&n^Qt,q=s&o^~s&a,S=i+b+q+K[d+3]+c[d+3],J=p+y,i=r+S<<0,r=S+J<<0;this.h0=this.h0+r<<0,this.h1=this.h1+t<<0,this.h2=this.h2+e<<0,this.h3=this.h3+n<<0,this.h4=this.h4+i<<0,this.h5=this.h5+s<<0,this.h6=this.h6+o<<0,this.h7=this.h7+a<<0},Sha256.prototype.hex=function(){this.finalize();var r=this.h0,t=this.h1,e=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,a=this.h7,c=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[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[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[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[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&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];return this.is224||(c+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var r=this.h0,t=this.h1,e=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,a=this.h7,c=[r>>24&255,r>>16&255,r>>8&255,r&255,t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,i>>24&255,i>>16&255,i>>8&255,i&255,s>>24&255,s>>16&255,s>>8&255,s&255,o>>24&255,o>>16&255,o>>8&255,o&255];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,a&255),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(this.is224?28:32),t=new DataView(r);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),r};function HmacSha256(r,t,e){var n,i=typeof r;if(i==="string"){var s=[],o=r.length,a=0,c;for(n=0;n<o;++n)c=r.charCodeAt(n),c<128?s[a++]=c:c<2048?(s[a++]=192|c>>6,s[a++]=128|c&63):c<55296||c>=57344?(s[a++]=224|c>>12,s[a++]=128|c>>6&63,s[a++]=128|c&63):(c=65536+((c&1023)<<10|r.charCodeAt(++n)&1023),s[a++]=240|c>>18,s[a++]=128|c>>12&63,s[a++]=128|c>>6&63,s[a++]=128|c&63);r=s}else if(i==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);r.length>64&&(r=new Sha256(t,!0).update(r).array());var d=[],p=[];for(n=0;n<64;++n){var b=r[n]||0;d[n]=92^b,p[n]=54^b}Sha256.call(this,t,e),this.update(p),this.oKeyPad=d,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 r=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(r),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 By={};ln(By,{registerWorker:()=>ed});var ol=Cc(sl(),1),{__extends:My,__assign:Ry,__rest:al,__decorate:Uy,__param:Ny,__metadata:ky,__awaiter:I,__generator:Ly,__exportStar:Cy,__createBinding:Py,__values:Vy,__read:Hy,__spread:zy,__spreadArrays:jy,__spreadArray:Wy,__await:W,__asyncGenerator:ae,__asyncDelegator:Bn,__asyncValues:De,__makeTemplateObject:$y,__importStar:Yy,__importDefault:Xy,__classPrivateFieldGet:Gy,__classPrivateFieldSet:Ky}=ol.default;var da={};ln(da,{compareArrayLike:()=>ua,joinUint8Arrays:()=>we,memcpy:()=>Dn,rebaseValueOffsets:()=>hi,toArrayBufferView:()=>$,toArrayBufferViewAsyncIterator:()=>Ve,toArrayBufferViewIterator:()=>er,toBigInt64Array:()=>jh,toBigUint64Array:()=>Yh,toFloat32Array:()=>Xh,toFloat32ArrayAsyncIterator:()=>lp,toFloat32ArrayIterator:()=>ep,toFloat64Array:()=>Gh,toFloat64ArrayAsyncIterator:()=>up,toFloat64ArrayIterator:()=>rp,toInt16Array:()=>zh,toInt16ArrayAsyncIterator:()=>sp,toInt16ArrayIterator:()=>qh,toInt32Array:()=>un,toInt32ArrayAsyncIterator:()=>op,toInt32ArrayIterator:()=>Zh,toInt8Array:()=>Hh,toInt8ArrayAsyncIterator:()=>ip,toInt8ArrayIterator:()=>Jh,toUint16Array:()=>Wh,toUint16ArrayAsyncIterator:()=>ap,toUint16ArrayIterator:()=>Qh,toUint32Array:()=>$h,toUint32ArrayAsyncIterator:()=>cp,toUint32ArrayIterator:()=>tp,toUint8Array:()=>N,toUint8ArrayAsyncIterator:()=>la,toUint8ArrayIterator:()=>ca,toUint8ClampedArray:()=>Kh,toUint8ClampedArrayAsyncIterator:()=>dp,toUint8ClampedArrayIterator:()=>np});var Lh=new TextDecoder("utf-8"),ui=r=>Lh.decode(r),Ch=new TextEncoder,Vr=r=>Ch.encode(r);var[Zy,ps]=(()=>{let r=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw r()}return t.asIntN=()=>{throw r()},t.asUintN=()=>{throw r()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[di,Qy]=(()=>{let r=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Tn,t_]=(()=>{let r=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})();var Ph=r=>typeof r=="number",cl=r=>typeof r=="boolean",Mt=r=>typeof r=="function",ee=r=>r!=null&&Object(r)===r,Ce=r=>ee(r)&&Mt(r.then);var Pe=r=>ee(r)&&Mt(r[Symbol.iterator]),Ee=r=>ee(r)&&Mt(r[Symbol.asyncIterator]),ms=r=>ee(r)&&ee(r.schema);var ys=r=>ee(r)&&"done"in r&&"value"in r;var _s=r=>ee(r)&&Mt(r.stat)&&Ph(r.fd);var bs=r=>ee(r)&&fi(r.body),gs=r=>"_getDOMStream"in r&&"_getNodeStream"in r,ll=r=>ee(r)&&Mt(r.abort)&&Mt(r.getWriter)&&!gs(r),fi=r=>ee(r)&&Mt(r.cancel)&&Mt(r.getReader)&&!gs(r),ul=r=>ee(r)&&Mt(r.end)&&Mt(r.write)&&cl(r.writable)&&!gs(r),ws=r=>ee(r)&&Mt(r.read)&&Mt(r.pipe)&&cl(r.readable)&&!gs(r),dl=r=>ee(r)&&Mt(r.clear)&&Mt(r.bytes)&&Mt(r.position)&&Mt(r.setPosition)&&Mt(r.capacity)&&Mt(r.getBufferIdentifier)&&Mt(r.createLong);var aa=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Vh(r){let t=r[0]?[r[0]]:[],e,n,i,s;for(let o,a,c=0,d=0,p=r.length;++c<p;){if(o=t[d],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++d]=a);continue}if({byteOffset:e,byteLength:i}=o,{byteOffset:n,byteLength:s}=a,e+i<n||n+s<e){a&&(t[++d]=a);continue}t[d]=new Uint8Array(o.buffer,e,n-e+s)}return t}function Dn(r,t,e=0,n=t.byteLength){let i=r.byteLength,s=new Uint8Array(r.buffer,r.byteOffset,i),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return s.set(o,e),r}function we(r,t){let e=Vh(r),n=e.reduce((p,b)=>p+b.byteLength,0),i,s,o,a=0,c=-1,d=Math.min(t||Number.POSITIVE_INFINITY,n);for(let p=e.length;++c<p;){if(i=e[c],s=i.subarray(0,Math.min(i.length,d-a)),d<=a+s.length){s.length<i.length?e[c]=i.subarray(s.length):s.length===i.length&&c++,o?Dn(o,s,a):o=s;break}Dn(o||(o=new Uint8Array(d)),s,a),a+=s.length}return[o||new Uint8Array(0),e.slice(c),n-(o?o.byteLength:0)]}function $(r,t){let e=ys(t)?t.value:t;return e instanceof r?r===Uint8Array?new r(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Vr(e)),e instanceof ArrayBuffer?new r(e):e instanceof aa?new r(e):dl(e)?$(r,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new r(0):new r(e.buffer,e.byteOffset,e.byteLength/r.BYTES_PER_ELEMENT):r.from(e)):new r(0)}var Hh=r=>$(Int8Array,r),zh=r=>$(Int16Array,r),un=r=>$(Int32Array,r),jh=r=>$(di,r),N=r=>$(Uint8Array,r),Wh=r=>$(Uint16Array,r),$h=r=>$(Uint32Array,r),Yh=r=>$(Tn,r),Xh=r=>$(Float32Array,r),Gh=r=>$(Float64Array,r),Kh=r=>$(Uint8ClampedArray,r),oa=r=>(r.next(),r);function*er(r,t){let e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof aa?e(t):Pe(t)?t:e(t);return yield*oa(function*(i){let s=null;do s=i.next(yield $(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}var Jh=r=>er(Int8Array,r),qh=r=>er(Int16Array,r),Zh=r=>er(Int32Array,r),ca=r=>er(Uint8Array,r),Qh=r=>er(Uint16Array,r),tp=r=>er(Uint32Array,r),ep=r=>er(Float32Array,r),rp=r=>er(Float64Array,r),np=r=>er(Uint8ClampedArray,r);function Ve(r,t){return ae(this,arguments,function*(){if(Ce(t))return yield W(yield W(yield*Bn(De(Ve(r,yield W(t))))));let n=function(o){return ae(this,arguments,function*(){yield yield W(yield W(o))})},i=function(o){return ae(this,arguments,function*(){yield W(yield*Bn(De(oa(function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof aa?n(t):Pe(t)?i(t):Ee(t)?t:n(t);return yield W(yield*Bn(De(oa(function(o){return ae(this,arguments,function*(){let a=null;do a=yield W(o.next(yield yield W($(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield W(new r)})}var ip=r=>Ve(Int8Array,r),sp=r=>Ve(Int16Array,r),op=r=>Ve(Int32Array,r),la=r=>Ve(Uint8Array,r),ap=r=>Ve(Uint16Array,r),cp=r=>Ve(Uint32Array,r),lp=r=>Ve(Float32Array,r),up=r=>Ve(Float64Array,r),dp=r=>Ve(Uint8ClampedArray,r);function hi(r,t,e){if(r!==0){e=e.slice(0,t+1);for(let n=-1;++n<=t;)e[n]+=r}return e}function ua(r,t){let e=0,n=r.length;if(n!==t.length)return!1;if(n>0)do if(r[e]!==t[e])return!1;while(++e<n);return!0}var $t={fromIterable(r){return vs(fp(r))},fromAsyncIterable(r){return vs(hp(r))},fromDOMStream(r){return vs(pp(r))},fromNodeStream(r){return vs(mp(r))},toDOMStream(r,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,t){throw new Error('"toNodeStream" not available in this environment')}},vs=r=>(r.next(),r);function*fp(r){let t,e=!1,n=[],i,s,o,a=0;function c(){return s==="peek"?we(n,o)[0]:([i,n,a]=we(n,o),i)}({cmd:s,size:o}=yield null);let d=ca(r)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-a)?d.next():d.next(o-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||o<=a)do({cmd:s,size:o}=yield c());while(o<a);while(!t)}catch(p){(e=!0)&&typeof d.throw=="function"&&d.throw(p)}finally{e===!1&&typeof d.return=="function"&&d.return(null)}return null}function hp(r){return ae(this,arguments,function*(){let e,n=!1,i=[],s,o,a,c=0;function d(){return o==="peek"?we(i,a)[0]:([s,i,c]=we(i,a),s)}({cmd:o,size:a}=yield yield W(null));let p=la(r)[Symbol.asyncIterator]();try{do if({done:e,value:s}=Number.isNaN(a-c)?yield W(p.next()):yield W(p.next(a-c)),!e&&s.byteLength>0&&(i.push(s),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield W(d()));while(a<c);while(!e)}catch(b){(n=!0)&&typeof p.throw=="function"&&(yield W(p.throw(b)))}finally{n===!1&&typeof p.return=="function"&&(yield W(p.return(new Uint8Array(0))))}return yield W(null)})}function pp(r){return ae(this,arguments,function*(){let e=!1,n=!1,i=[],s,o,a,c=0;function d(){return o==="peek"?we(i,a)[0]:([s,i,c]=we(i,a),s)}({cmd:o,size:a}=yield yield W(null));let p=new ha(r);try{do if({done:e,value:s}=Number.isNaN(a-c)?yield W(p.read()):yield W(p.read(a-c)),!e&&s.byteLength>0&&(i.push(N(s)),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield W(d()));while(a<c);while(!e)}catch(b){(n=!0)&&(yield W(p.cancel(b)))}finally{n===!1?yield W(p.cancel()):r.locked&&p.releaseLock()}return yield W(null)})}var ha=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 I(this,void 0,void 0,function*(){let{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return I(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=N(e)),e})}},fa=(r,t)=>{let e=i=>n([t,i]),n;return[t,e,new Promise(i=>(n=i)&&r.once(t,e))]};function mp(r){return ae(this,arguments,function*(){let e=[],n="error",i=!1,s=null,o,a,c=0,d=[],p;function b(){return o==="peek"?we(d,a)[0]:([p,d,c]=we(d,a),p)}if({cmd:o,size:a}=yield yield W(null),r.isTTY)return yield yield W(new Uint8Array(0)),yield W(null);try{e[0]=fa(r,"end"),e[1]=fa(r,"error");do{if(e[2]=fa(r,"readable"),[n,s]=yield W(Promise.race(e.map(S=>S[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-c)?(p=N(r.read(a-c)),p.byteLength<a-c&&(p=N(r.read()))):p=N(r.read()),p.byteLength>0&&(d.push(p),c+=p.byteLength)),i||a<=c)do({cmd:o,size:a}=yield yield W(b()));while(a<c)}while(!i)}finally{yield W(y(e,n==="error"?s:null))}return yield W(null);function y(S,J){return p=d=null,new Promise((q,ot)=>{for(let[St,Qt]of S)r.off(St,Qt);try{let St=r.destroy;St&&St.call(r,J),J=void 0}catch(St){J=St||J}finally{J!=null?ot(J):q()}})}})}var Ut;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(Ut||(Ut={}));var gt;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(gt||(gt={}));var pt;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(pt||(pt={}));var Yt;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Yt||(Yt={}));var X;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(X||(X={}));var re;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(re||(re={}));var Q;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(Q||(Q={}));var f;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth"})(f||(f={}));var Oe;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(Oe||(Oe={}));var Ea={};ln(Ea,{clampIndex:()=>sm,clampRange:()=>yi,createElementComparator:()=>Wr});function He(r){if(r===null)return"null";if(r===void 0)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(t=>He(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}var ma={};ln(ma,{BN:()=>dn,bignumToBigInt:()=>Ss,bignumToString:()=>Hr,isArrowBigNumSymbol:()=>fl});var fl=Symbol.for("isArrowBigNum");function ze(r,...t){return t.length===0?Object.setPrototypeOf($(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ze.prototype[fl]=!0;ze.prototype.toJSON=function(){return`"${Hr(this)}"`};ze.prototype.valueOf=function(){return hl(this)};ze.prototype.toString=function(){return Hr(this)};ze.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return hl(this);case"string":return Hr(this);case"default":return Ss(this)}return Hr(this)};function En(...r){return ze.apply(this,r)}function On(...r){return ze.apply(this,r)}function pi(...r){return ze.apply(this,r)}Object.setPrototypeOf(En.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(On.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(pi.prototype,Object.create(Uint32Array.prototype));Object.assign(En.prototype,ze.prototype,{constructor:En,signed:!0,TypedArray:Int32Array,BigIntArray:di});Object.assign(On.prototype,ze.prototype,{constructor:On,signed:!1,TypedArray:Uint32Array,BigIntArray:Tn});Object.assign(pi.prototype,ze.prototype,{constructor:pi,signed:!0,TypedArray:Uint32Array,BigIntArray:Tn});function hl(r){let{buffer:t,byteOffset:e,length:n,signed:i}=r,s=new Tn(t,e,n),o=i&&s[s.length-1]&BigInt(1)<<BigInt(63),a=BigInt(o?1:0),c=BigInt(0);if(o){for(let d of s)a+=~d*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(let d of s)a+=d*(BigInt(1)<<BigInt(32)*c++);return a}var Hr,Ss;ps?(Ss=r=>r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:pa(r),Hr=r=>r.byteLength===8?`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`:pa(r)):(Hr=pa,Ss=Hr);function pa(r){let t="",e=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),s=-1,o=n.length-1;do{for(e[0]=n[s=0];s<o;)n[s++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+n[s];n[s]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t||"0"}var dn=class{static new(t,e){switch(e){case!0:return new En(t);case!1:return new On(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case di:return new En(t)}return t.byteLength===16?new pi(t):new On(t)}static signed(t){return new En(t)}static unsigned(t){return new On(t)}static decimal(t){return new pi(t)}constructor(t,e){return dn.new(t,e)}};var pl,ml,yl,_l,bl,gl,wl,vl,Sl,Il,Al,Fl,xl,Bl,Tl,Dl,El,Ol,Ml,F=class{static isNull(t){return(t==null?void 0:t.typeId)===f.Null}static isInt(t){return(t==null?void 0:t.typeId)===f.Int}static isFloat(t){return(t==null?void 0:t.typeId)===f.Float}static isBinary(t){return(t==null?void 0:t.typeId)===f.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===f.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===f.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===f.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===f.Date}static isTime(t){return(t==null?void 0:t.typeId)===f.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===f.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===f.Interval}static isList(t){return(t==null?void 0:t.typeId)===f.List}static isStruct(t){return(t==null?void 0:t.typeId)===f.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===f.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===f.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===f.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===f.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===f.Dictionary}static isDenseUnion(t){return F.isUnion(t)&&t.mode===gt.Dense}static isSparseUnion(t){return F.isUnion(t)&&t.mode===gt.Sparse}get typeId(){return f.NONE}};pl=Symbol.toStringTag;F[pl]=(r=>(r.children=null,r.ArrayType=Array,r[Symbol.toStringTag]="DataType"))(F.prototype);var ne=class extends F{toString(){return"Null"}get typeId(){return f.Null}};ml=Symbol.toStringTag;ne[ml]=(r=>r[Symbol.toStringTag]="Null")(ne.prototype);var At=class extends F{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return f.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}`}};yl=Symbol.toStringTag;At[yl]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(At.prototype);var Is=class extends At{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},As=class extends At{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},rr=class extends At{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Fs=class extends At{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},xs=class extends At{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Bs=class extends At{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Ts=class extends At{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Ds=class extends At{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Is.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(As.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(rr.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Fs.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(xs.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Bs.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ts.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Ds.prototype,"ArrayType",{value:BigUint64Array});var ce=class extends F{constructor(t){super(),this.precision=t}get typeId(){return f.Float}get ArrayType(){switch(this.precision){case pt.HALF:return Uint16Array;case pt.SINGLE:return Float32Array;case pt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};_l=Symbol.toStringTag;ce[_l]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ce.prototype);var Es=class extends ce{constructor(){super(pt.HALF)}},Os=class extends ce{constructor(){super(pt.SINGLE)}},Ms=class extends ce{constructor(){super(pt.DOUBLE)}};Object.defineProperty(Es.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Os.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ms.prototype,"ArrayType",{value:Float64Array});var vr=class extends F{constructor(){super()}get typeId(){return f.Binary}toString(){return"Binary"}};bl=Symbol.toStringTag;vr[bl]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(vr.prototype);var Sr=class extends F{constructor(){super()}get typeId(){return f.Utf8}toString(){return"Utf8"}};gl=Symbol.toStringTag;Sr[gl]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Sr.prototype);var Ir=class extends F{constructor(){super()}get typeId(){return f.Bool}toString(){return"Bool"}};wl=Symbol.toStringTag;Ir[wl]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Ir.prototype);var Ar=class extends F{constructor(t,e,n=128){super(),this.scale=t,this.precision=e,this.bitWidth=n}get typeId(){return f.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};vl=Symbol.toStringTag;Ar[vl]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ar.prototype);var Fr=class extends F{constructor(t){super(),this.unit=t}get typeId(){return f.Date}toString(){return`Date${(this.unit+1)*32}<${Yt[this.unit]}>`}};Sl=Symbol.toStringTag;Fr[Sl]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Date"))(Fr.prototype);var je=class extends F{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return f.Time}toString(){return`Time${this.bitWidth}<${X[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Il=Symbol.toStringTag;je[Il]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(je.prototype);var xr=class extends F{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return f.Timestamp}toString(){return`Timestamp<${X[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Al=Symbol.toStringTag;xr[Al]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Timestamp"))(xr.prototype);var Br=class extends F{constructor(t){super(),this.unit=t}get typeId(){return f.Interval}toString(){return`Interval<${re[this.unit]}>`}};Fl=Symbol.toStringTag;Br[Fl]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Br.prototype);var We=class extends F{constructor(t){super(),this.children=[t]}get typeId(){return f.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}};xl=Symbol.toStringTag;We[xl]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(We.prototype);var ut=class extends F{constructor(t){super(),this.children=t}get typeId(){return f.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Bl=Symbol.toStringTag;ut[Bl]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(ut.prototype);var $e=class extends F{constructor(t,e,n){super(),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}get typeId(){return f.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};Tl=Symbol.toStringTag;$e[Tl]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))($e.prototype);var Tr=class extends F{constructor(t){super(),this.byteWidth=t}get typeId(){return f.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Dl=Symbol.toStringTag;Tr[Dl]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Tr.prototype);var Ye=class extends F{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return f.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}>`}};El=Symbol.toStringTag;Ye[El]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Ye.prototype);var Xe=class extends F{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return f.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(", ")}}>`}};Ol=Symbol.toStringTag;Xe[Ol]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Xe.prototype);var yp=(r=>()=>++r)(-1),ve=class extends F{constructor(t,e,n,i){super(),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?yp():typeof n=="number"?n:n.low}get typeId(){return f.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}>`}};Ml=Symbol.toStringTag;ve[Ml]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(ve.prototype);function Se(r){let t=r;switch(r.typeId){case f.Decimal:return r.bitWidth/32;case f.Timestamp:return 2;case f.Date:return 1+t.unit;case f.Interval:return 1+t.unit;case f.FixedSizeList:return t.listSize;case f.FixedSizeBinary:return t.byteWidth;default:return 1}}var D=class{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return _p(this,t,e)}getVisitFnByTypeId(t,e=!0){return Mn(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 _p(r,t,e=!0){return typeof t=="number"?Mn(r,t,e):typeof t=="string"&&t in f?Mn(r,f[t],e):t&&t instanceof F?Mn(r,Rl(t),e):(t==null?void 0:t.type)&&t.type instanceof F?Mn(r,Rl(t.type),e):Mn(r,f.NONE,e)}function Mn(r,t,e=!0){let n=null;switch(t){case f.Null:n=r.visitNull;break;case f.Bool:n=r.visitBool;break;case f.Int:n=r.visitInt;break;case f.Int8:n=r.visitInt8||r.visitInt;break;case f.Int16:n=r.visitInt16||r.visitInt;break;case f.Int32:n=r.visitInt32||r.visitInt;break;case f.Int64:n=r.visitInt64||r.visitInt;break;case f.Uint8:n=r.visitUint8||r.visitInt;break;case f.Uint16:n=r.visitUint16||r.visitInt;break;case f.Uint32:n=r.visitUint32||r.visitInt;break;case f.Uint64:n=r.visitUint64||r.visitInt;break;case f.Float:n=r.visitFloat;break;case f.Float16:n=r.visitFloat16||r.visitFloat;break;case f.Float32:n=r.visitFloat32||r.visitFloat;break;case f.Float64:n=r.visitFloat64||r.visitFloat;break;case f.Utf8:n=r.visitUtf8;break;case f.Binary:n=r.visitBinary;break;case f.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case f.Date:n=r.visitDate;break;case f.DateDay:n=r.visitDateDay||r.visitDate;break;case f.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case f.Timestamp:n=r.visitTimestamp;break;case f.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case f.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case f.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case f.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case f.Time:n=r.visitTime;break;case f.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case f.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case f.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case f.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case f.Decimal:n=r.visitDecimal;break;case f.List:n=r.visitList;break;case f.Struct:n=r.visitStruct;break;case f.Union:n=r.visitUnion;break;case f.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case f.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case f.Dictionary:n=r.visitDictionary;break;case f.Interval:n=r.visitInterval;break;case f.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case f.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case f.FixedSizeList:n=r.visitFixedSizeList;break;case f.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${f[t]}'`)}function Rl(r){switch(r.typeId){case f.Null:return f.Null;case f.Int:{let{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?f.Int8:f.Uint8;case 16:return e?f.Int16:f.Uint16;case 32:return e?f.Int32:f.Uint32;case 64:return e?f.Int64:f.Uint64}return f.Int}case f.Float:switch(r.precision){case pt.HALF:return f.Float16;case pt.SINGLE:return f.Float32;case pt.DOUBLE:return f.Float64}return f.Float;case f.Binary:return f.Binary;case f.Utf8:return f.Utf8;case f.Bool:return f.Bool;case f.Decimal:return f.Decimal;case f.Time:switch(r.unit){case X.SECOND:return f.TimeSecond;case X.MILLISECOND:return f.TimeMillisecond;case X.MICROSECOND:return f.TimeMicrosecond;case X.NANOSECOND:return f.TimeNanosecond}return f.Time;case f.Timestamp:switch(r.unit){case X.SECOND:return f.TimestampSecond;case X.MILLISECOND:return f.TimestampMillisecond;case X.MICROSECOND:return f.TimestampMicrosecond;case X.NANOSECOND:return f.TimestampNanosecond}return f.Timestamp;case f.Date:switch(r.unit){case Yt.DAY:return f.DateDay;case Yt.MILLISECOND:return f.DateMillisecond}return f.Date;case f.Interval:switch(r.unit){case re.DAY_TIME:return f.IntervalDayTime;case re.YEAR_MONTH:return f.IntervalYearMonth}return f.Interval;case f.Map:return f.Map;case f.List:return f.List;case f.Struct:return f.Struct;case f.Union:switch(r.mode){case gt.Dense:return f.DenseUnion;case gt.Sparse:return f.SparseUnion}return f.Union;case f.FixedSizeBinary:return f.FixedSizeBinary;case f.FixedSizeList:return f.FixedSizeList;case f.Dictionary:return f.Dictionary}throw new Error(`Unrecognized type '${f[r.typeId]}'`)}D.prototype.visitInt8=null;D.prototype.visitInt16=null;D.prototype.visitInt32=null;D.prototype.visitInt64=null;D.prototype.visitUint8=null;D.prototype.visitUint16=null;D.prototype.visitUint32=null;D.prototype.visitUint64=null;D.prototype.visitFloat16=null;D.prototype.visitFloat32=null;D.prototype.visitFloat64=null;D.prototype.visitDateDay=null;D.prototype.visitDateMillisecond=null;D.prototype.visitTimestampSecond=null;D.prototype.visitTimestampMillisecond=null;D.prototype.visitTimestampMicrosecond=null;D.prototype.visitTimestampNanosecond=null;D.prototype.visitTimeSecond=null;D.prototype.visitTimeMillisecond=null;D.prototype.visitTimeMicrosecond=null;D.prototype.visitTimeNanosecond=null;D.prototype.visitDenseUnion=null;D.prototype.visitSparseUnion=null;D.prototype.visitIntervalDayTime=null;D.prototype.visitIntervalYearMonth=null;var ya={};ln(ya,{float64ToUint16:()=>mi,uint16ToFloat64:()=>Rs});var Ul=new Float64Array(1),Rn=new Uint32Array(Ul.buffer);function Rs(r){let t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function mi(r){if(r!==r)return 32256;Ul[0]=r;let t=(Rn[1]&2147483648)>>16&65535,e=Rn[1]&2146435072,n=0;return e>=1089470464?Rn[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Rn[1]&1048575)>>10):e<=1056964608?(n=1048576+(Rn[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Rn[1]&1048575)+512>>10),t|e|n&65535}var k=class extends D{};function z(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}var bp=(r,t,e)=>{r[t]=Math.trunc(e/864e5)},_a=(r,t,e)=>{r[t]=Math.trunc(e%4294967296),r[t+1]=Math.trunc(e/4294967296)},gp=(r,t,e)=>{r[t]=Math.trunc(e*1e3%4294967296),r[t+1]=Math.trunc(e*1e3/4294967296)},wp=(r,t,e)=>{r[t]=Math.trunc(e*1e6%4294967296),r[t+1]=Math.trunc(e*1e6/4294967296)},Nl=(r,t,e,n)=>{if(e+1<t.length){let{[e]:i,[e+1]:s}=t;r.set(n.subarray(0,s-i),i)}},vp=({offset:r,values:t},e,n)=>{let i=r+e;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},Dr=({values:r},t,e)=>{r[t]=e},ba=({values:r},t,e)=>{r[t]=e},kl=({values:r},t,e)=>{r[t]=mi(e)},Sp=(r,t,e)=>{switch(r.type.precision){case pt.HALF:return kl(r,t,e);case pt.SINGLE:case pt.DOUBLE:return ba(r,t,e)}},Us=({values:r},t,e)=>{bp(r,t,e.valueOf())},Ns=({values:r},t,e)=>{_a(r,t*2,e.valueOf())},ga=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},Ip=({values:r,valueOffsets:t},e,n)=>Nl(r,t,e,n),Ap=({values:r,valueOffsets:t},e,n)=>{Nl(r,t,e,Vr(n))},wa=(r,t,e)=>{r.type.unit===Yt.DAY?Us(r,t,e):Ns(r,t,e)},ks=({values:r},t,e)=>_a(r,t*2,e/1e3),Ls=({values:r},t,e)=>_a(r,t*2,e),Cs=({values:r},t,e)=>gp(r,t*2,e),Ps=({values:r},t,e)=>wp(r,t*2,e),va=(r,t,e)=>{switch(r.type.unit){case X.SECOND:return ks(r,t,e);case X.MILLISECOND:return Ls(r,t,e);case X.MICROSECOND:return Cs(r,t,e);case X.NANOSECOND:return Ps(r,t,e)}},Vs=({values:r},t,e)=>{r[t]=e},Hs=({values:r},t,e)=>{r[t]=e},zs=({values:r},t,e)=>{r[t]=e},js=({values:r},t,e)=>{r[t]=e},Sa=(r,t,e)=>{switch(r.type.unit){case X.SECOND:return Vs(r,t,e);case X.MILLISECOND:return Hs(r,t,e);case X.MICROSECOND:return zs(r,t,e);case X.NANOSECOND:return js(r,t,e)}},Ia=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},Fp=(r,t,e)=>{let n=r.children[0],i=r.valueOffsets,s=Xt.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],c=i[t+1];a<c;)s(n,a++,e[++o]);else for(let o=-1,a=i[t],c=i[t+1];a<c;)s(n,a++,e.get(++o))},xp=(r,t,e)=>{let n=r.children[0],{valueOffsets:i}=r,s=Xt.getVisitFn(n),{[t]:o,[t+1]:a}=i,c=e instanceof Map?e.entries():Object.entries(e);for(let d of c)if(s(n,o,d),++o>=a)break},Bp=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),Tp=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),Dp=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),Ep=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),Op=(r,t,e)=>{let n=r.type.children.map(s=>Xt.getVisitFn(s.type)),i=e instanceof Map?Dp(t,e):e instanceof L?Tp(t,e):Array.isArray(e)?Bp(t,e):Ep(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},Mp=(r,t,e)=>{r.type.mode===gt.Dense?Ll(r,t,e):Cl(r,t,e)},Ll=(r,t,e)=>{let n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Xt.visit(i,r.valueOffsets[t],e)},Cl=(r,t,e)=>{let n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Xt.visit(i,t,e)},Rp=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},Aa=(r,t,e)=>{r.type.unit===re.DAY_TIME?Ws(r,t,e):$s(r,t,e)},Ws=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},$s=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Up=(r,t,e)=>{let{stride:n}=r,i=r.children[0],s=Xt.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o<n;)s(i,a+o,e[o]);else for(let o=-1,a=t*n;++o<n;)s(i,a+o,e.get(o))};k.prototype.visitBool=z(vp);k.prototype.visitInt=z(Dr);k.prototype.visitInt8=z(Dr);k.prototype.visitInt16=z(Dr);k.prototype.visitInt32=z(Dr);k.prototype.visitInt64=z(Dr);k.prototype.visitUint8=z(Dr);k.prototype.visitUint16=z(Dr);k.prototype.visitUint32=z(Dr);k.prototype.visitUint64=z(Dr);k.prototype.visitFloat=z(Sp);k.prototype.visitFloat16=z(kl);k.prototype.visitFloat32=z(ba);k.prototype.visitFloat64=z(ba);k.prototype.visitUtf8=z(Ap);k.prototype.visitBinary=z(Ip);k.prototype.visitFixedSizeBinary=z(ga);k.prototype.visitDate=z(wa);k.prototype.visitDateDay=z(Us);k.prototype.visitDateMillisecond=z(Ns);k.prototype.visitTimestamp=z(va);k.prototype.visitTimestampSecond=z(ks);k.prototype.visitTimestampMillisecond=z(Ls);k.prototype.visitTimestampMicrosecond=z(Cs);k.prototype.visitTimestampNanosecond=z(Ps);k.prototype.visitTime=z(Sa);k.prototype.visitTimeSecond=z(Vs);k.prototype.visitTimeMillisecond=z(Hs);k.prototype.visitTimeMicrosecond=z(zs);k.prototype.visitTimeNanosecond=z(js);k.prototype.visitDecimal=z(Ia);k.prototype.visitList=z(Fp);k.prototype.visitStruct=z(Op);k.prototype.visitUnion=z(Mp);k.prototype.visitDenseUnion=z(Ll);k.prototype.visitSparseUnion=z(Cl);k.prototype.visitDictionary=z(Rp);k.prototype.visitInterval=z(Aa);k.prototype.visitIntervalDayTime=z(Ws);k.prototype.visitIntervalYearMonth=z($s);k.prototype.visitFixedSizeList=z(Up);k.prototype.visitMap=z(xp);var Xt=new k;var Ge=Symbol.for("parent"),Un=Symbol.for("rowIndex"),zr=class{constructor(t,e){return this[Ge]=t,this[Un]=e,new Proxy(this,new xa)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Un],e=this[Ge],n=e.type.children,i={};for(let s=-1,o=n.length;++s<o;)i[n[s].name]=Bt.visit(e.children[s],t);return i}toString(){return`{${[...this].map(([t,e])=>`${He(t)}: ${He(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Fa(this[Ge],this[Un])}},Fa=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,Bt.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(zr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ge]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Un]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var xa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ge].type.children.map(e=>e.name)}has(t,e){return t[Ge].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Ge].type.children.findIndex(n=>n.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let n=t[Ge].type.children.findIndex(i=>i.name===e);if(n!==-1){let i=Bt.visit(t[Ge].children[n],t[Un]);return Reflect.set(t,e,i),i}}set(t,e,n){let i=t[Ge].type.children.findIndex(s=>s.name===e);return i!==-1?(Xt.visit(t[Ge].children[i],t[Un],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}};var O=class extends D{};function P(r){return(t,e)=>t.getValid(e)?r(t,e):null}var Np=(r,t)=>864e5*r[t],Ba=(r,t)=>4294967296*r[t+1]+(r[t]>>>0),kp=(r,t)=>4294967296*(r[t+1]/1e3)+(r[t]>>>0)/1e3,Lp=(r,t)=>4294967296*(r[t+1]/1e6)+(r[t]>>>0)/1e6,Pl=r=>new Date(r),Cp=(r,t)=>Pl(Np(r,t)),Pp=(r,t)=>Pl(Ba(r,t)),Vp=(r,t)=>null,Vl=(r,t,e)=>{if(e+1>=t.length)return null;let n=t[e],i=t[e+1];return r.subarray(n,i)},Hp=({offset:r,values:t},e)=>{let n=r+e;return(t[n>>3]&1<<n%8)!==0},Hl=({values:r},t)=>Cp(r,t),zl=({values:r},t)=>Pp(r,t*2),jr=({stride:r,values:t},e)=>t[r*e],zp=({stride:r,values:t},e)=>Rs(t[r*e]),jl=({values:r},t)=>r[t],jp=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Wp=({values:r,valueOffsets:t},e)=>Vl(r,t,e),$p=({values:r,valueOffsets:t},e)=>{let n=Vl(r,t,e);return n!==null?ui(n):null},Yp=({values:r},t)=>r[t],Xp=({type:r,values:t},e)=>r.precision!==pt.HALF?t[e]:Rs(t[e]),Gp=(r,t)=>r.type.unit===Yt.DAY?Hl(r,t):zl(r,t),Wl=({values:r},t)=>1e3*Ba(r,t*2),$l=({values:r},t)=>Ba(r,t*2),Yl=({values:r},t)=>kp(r,t*2),Xl=({values:r},t)=>Lp(r,t*2),Kp=(r,t)=>{switch(r.type.unit){case X.SECOND:return Wl(r,t);case X.MILLISECOND:return $l(r,t);case X.MICROSECOND:return Yl(r,t);case X.NANOSECOND:return Xl(r,t)}},Gl=({values:r},t)=>r[t],Kl=({values:r},t)=>r[t],Jl=({values:r},t)=>r[t],ql=({values:r},t)=>r[t],Jp=(r,t)=>{switch(r.type.unit){case X.SECOND:return Gl(r,t);case X.MILLISECOND:return Kl(r,t);case X.MICROSECOND:return Jl(r,t);case X.NANOSECOND:return ql(r,t)}},qp=({values:r,stride:t},e)=>dn.decimal(r.subarray(t*e,t*(e+1))),Zp=(r,t)=>{let{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,c=i[0].slice(s,o-s);return new L([c])},Qp=(r,t)=>{let{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new nr(o.slice(i,s-i))},tm=(r,t)=>new zr(r,t),em=(r,t)=>r.type.mode===gt.Dense?Zl(r,t):Ql(r,t),Zl=(r,t)=>{let e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return Bt.visit(n,r.valueOffsets[t])},Ql=(r,t)=>{let e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return Bt.visit(n,t)},rm=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},nm=(r,t)=>r.type.unit===re.DAY_TIME?tu(r,t):eu(r,t),tu=({values:r},t)=>r.subarray(2*t,2*(t+1)),eu=({values:r},t)=>{let e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},im=(r,t)=>{let{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new L([s])};O.prototype.visitNull=P(Vp);O.prototype.visitBool=P(Hp);O.prototype.visitInt=P(Yp);O.prototype.visitInt8=P(jr);O.prototype.visitInt16=P(jr);O.prototype.visitInt32=P(jr);O.prototype.visitInt64=P(jl);O.prototype.visitUint8=P(jr);O.prototype.visitUint16=P(jr);O.prototype.visitUint32=P(jr);O.prototype.visitUint64=P(jl);O.prototype.visitFloat=P(Xp);O.prototype.visitFloat16=P(zp);O.prototype.visitFloat32=P(jr);O.prototype.visitFloat64=P(jr);O.prototype.visitUtf8=P($p);O.prototype.visitBinary=P(Wp);O.prototype.visitFixedSizeBinary=P(jp);O.prototype.visitDate=P(Gp);O.prototype.visitDateDay=P(Hl);O.prototype.visitDateMillisecond=P(zl);O.prototype.visitTimestamp=P(Kp);O.prototype.visitTimestampSecond=P(Wl);O.prototype.visitTimestampMillisecond=P($l);O.prototype.visitTimestampMicrosecond=P(Yl);O.prototype.visitTimestampNanosecond=P(Xl);O.prototype.visitTime=P(Jp);O.prototype.visitTimeSecond=P(Gl);O.prototype.visitTimeMillisecond=P(Kl);O.prototype.visitTimeMicrosecond=P(Jl);O.prototype.visitTimeNanosecond=P(ql);O.prototype.visitDecimal=P(qp);O.prototype.visitList=P(Zp);O.prototype.visitStruct=P(tm);O.prototype.visitUnion=P(em);O.prototype.visitDenseUnion=P(Zl);O.prototype.visitSparseUnion=P(Ql);O.prototype.visitDictionary=P(rm);O.prototype.visitInterval=P(nm);O.prototype.visitIntervalDayTime=P(tu);O.prototype.visitIntervalYearMonth=P(eu);O.prototype.visitFixedSizeList=P(im);O.prototype.visitMap=P(Qp);var Bt=new O;var Me=Symbol.for("keys"),Nn=Symbol.for("vals"),nr=class{constructor(t){return this[Me]=new L([t.children[0]]).memoize(),this[Nn]=t.children[1],new Proxy(this,new Da)}[Symbol.iterator](){return new Ta(this[Me],this[Nn])}get size(){return this[Me].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Me],e=this[Nn],n={};for(let i=-1,s=t.length;++i<s;)n[t.get(i)]=Bt.visit(e,i);return n}toString(){return`{${[...this].map(([t,e])=>`${He(t)}: ${He(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Ta=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),Bt.visit(this.vals,t)]})}},Da=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Me].toArray().map(String)}has(t,e){return t[Me].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Me].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let n=t[Me].indexOf(e);if(n!==-1){let i=Bt.visit(Reflect.get(t,Nn),n);return Reflect.set(t,e,i),i}}set(t,e,n){let i=t[Me].indexOf(e);return i!==-1?(Xt.visit(Reflect.get(t,Nn),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}};Object.defineProperties(nr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Me]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Nn]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function sm(r,t,e){let n=r.length,i=t>-1?t:n+t%n;return e?e(r,i):i}var ru;function yi(r,t,e,n){let{length:i=0}=r,s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),o<s&&(ru=s,s=o,o=ru),o>i&&(o=i),n?n(r,s,o):[s,o]}var nu=r=>r!==r;function Wr(r){if(typeof r!=="object"||r===null)return nu(r)?nu:e=>e===r;if(r instanceof Date){let e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?ua(r,e):!1:r instanceof Map?am(r):Array.isArray(r)?om(r):r instanceof L?cm(r):lm(r,!0)}function om(r){let t=[];for(let e=-1,n=r.length;++e<n;)t[e]=Wr(r[e]);return Ys(t)}function am(r){let t=-1,e=[];for(let n of r.values())e[++t]=Wr(n);return Ys(e)}function cm(r){let t=[];for(let e=-1,n=r.length;++e<n;)t[e]=Wr(r.get(e));return Ys(t)}function lm(r,t=!1){let e=Object.keys(r);if(!t&&e.length===0)return()=>!1;let n=[];for(let i=-1,s=e.length;++i<s;)n[i]=Wr(r[e[i]]);return Ys(n,e)}function Ys(r,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return um(r,e);case Map:return iu(r,e,e.keys());case nr:case zr:case Object:case void 0:return iu(r,e,t||Object.keys(e))}return e instanceof L?dm(r,e):!1}}function um(r,t){let e=r.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!r[n](t[n]))return!1;return!0}function dm(r,t){let e=r.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!r[n](t.get(n)))return!1;return!0}function iu(r,t,e){let n=e[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),s=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),o=0,a=r.length,c=s.next(),d=n.next(),p=i.next();for(;o<a&&!d.done&&!p.done&&!c.done&&!(d.value!==p.value||!r[o](c.value));++o,d=n.next(),p=i.next(),c=s.next());return o===a&&d.done&&p.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),s.return&&s.return(),!1)}var Oa={};ln(Oa,{BitIterator:()=>fn,getBit:()=>su,getBool:()=>Gs,packBools:()=>hn,popcnt_array:()=>ou,popcnt_bit_range:()=>_i,popcnt_uint32:()=>Xs,setBool:()=>fm,truncateBitmap:()=>kn});function Gs(r,t,e,n){return(e&1<<n)!==0}function su(r,t,e,n){return(e&1<<n)>>n}function fm(r,t,e){return e?!!(r[t>>3]|=1<<t%8)||!0:!(r[t>>3]&=~(1<<t%8))&&!1}function kn(r,t,e){let n=e.byteLength+7&-8;if(r>0||e.byteLength<n){let i=new Uint8Array(n);return i.set(r%8===0?e.subarray(r>>3):hn(new fn(e,r,t,null,Gs)).subarray(0,n)),i}return e}function hn(r){let t=[],e=0,n=0,i=0;for(let o of r)o&&(i|=1<<n),++n===8&&(t[e++]=i,i=n=0);(e===0||n>0)&&(t[e++]=i);let s=new Uint8Array(t.length+7&-8);return s.set(t),s}var fn=class{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,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 _i(r,t,e){if(e-t<=0)return 0;if(e-t<8){let s=0;for(let o of new fn(r,t,e-t,r,su))s+=o;return s}let n=e>>3<<3,i=t+(t%8===0?0:8-t%8);return _i(r,t,i)+_i(r,n,e)+ou(r,i>>3,n-i>>3)}function ou(r,t,e){let n=0,i=Math.trunc(t),s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Xs(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Xs(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Xs(s.getUint8(i)),i+=1;return n}function Xs(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var hm=-1,et=class{constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;s instanceof et?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Se(t),s&&((c=s[0])&&(this.valueOffsets=c),(c=s[1])&&(this.values=c),(c=s[2])&&(this.nullBitmap=c),(c=s[3])&&(this.typeIds=c))),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:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=hm&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-_i(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:c}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:c,_nullCount:0})}let{nullBitmap:n,offset:i}=this,s=i+t>>3,o=(i+t)%8,a=n[s]>>o&1;return e?a===0&&(n[s]|=1<<o,this._nullCount=this.nullCount+1):a===1&&(n[s]&=~(1<<o),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new et(t,e,n,i,s,o,this.dictionary)}slice(t,e){let{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,c,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===f.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<<e-(e&-8))-1,n>0&&i.set(kn(this.offset,e,this.nullBitmap),0);let s=this.buffers;return s[Oe.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s,{buffers:o}=this;return(s=o[Oe.TYPE])&&(o[Oe.TYPE]=s.subarray(t,t+e)),(s=o[Oe.OFFSET])&&(o[Oe.OFFSET]=s.subarray(t,t+e+1))||(s=o[Oe.DATA])&&(o[Oe.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}};et.prototype.children=Object.freeze([]);var pn=class extends D{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:n=0,["length"]:i=0}=t;return new et(e,n,i,0)}visitBool(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitInt(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitFloat(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitUtf8(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.data),s=N(t.nullBitmap),o=un(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new et(e,n,a,c,[o,i,s])}visitBinary(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.data),s=N(t.nullBitmap),o=un(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new et(e,n,a,c,[o,i,s])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length/Se(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitDate(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length/Se(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitTimestamp(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length/Se(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitTime(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length/Se(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitDecimal(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length/Se(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitList(t){let{["type"]:e,["offset"]:n=0,["child"]:i}=t,s=N(t.nullBitmap),o=un(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new et(e,n,a,c,[o,void 0,s],[i])}visitStruct(t){let{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=N(t.nullBitmap),{length:o=i.reduce((c,{length:d})=>Math.max(c,d),0),nullCount:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,void 0,s],i)}visitUnion(t){let{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=N(t.nullBitmap),o=$(e.ArrayType,t.typeIds),{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;if(F.isSparseUnion(e))return new et(e,n,a,c,[void 0,void 0,s,o],i);let d=un(t.valueOffsets);return new et(e,n,a,c,[d,void 0,s,o],i)}visitDictionary(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.indices.ArrayType,t.data),{["dictionary"]:o=new L([new pn().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new et(e,n,a,c,[void 0,s,i],[],o)}visitInterval(t){let{["type"]:e,["offset"]:n=0}=t,i=N(t.nullBitmap),s=$(e.ArrayType,t.data),{["length"]:o=s.length/Se(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,s,i])}visitFixedSizeList(t){let{["type"]:e,["offset"]:n=0,["child"]:i=new pn().visit({type:e.valueType})}=t,s=N(t.nullBitmap),{["length"]:o=i.length/Se(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new et(e,n,o,a,[void 0,void 0,s],[i])}visitMap(t){let{["type"]:e,["offset"]:n=0,["child"]:i=new pn().visit({type:e.childType})}=t,s=N(t.nullBitmap),o=un(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new et(e,n,a,c,[o,void 0,s],[i])}};function C(r){return new pn().visit(r)}var bi=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 Ks(r){return r.reduce((t,e)=>t+e.nullCount,0)}function Js(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function qs(r,t,e,n){let i=[];for(let s=-1,o=r.length;++s<o;){let a=r[s],c=t[s],{length:d}=a;if(c>=n)break;if(e>=c+d)continue;if(c>=e&&c+d<=n){i.push(a);continue}let p=Math.max(0,e-c),b=Math.min(n-c,d);i.push(a.slice(p,b-p))}return i.length===0&&i.push(r[0].slice(0,0)),i}function Ma(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e<t[o]?n(r,i,e-t[i]):null;s=i+Math.trunc((o-i)*.5),e<t[s]?o=s:i=s}while(i<o)}function gi(r,t){return r.getValid(t)}function $r(r){function t(e,n,i){return r(e[n],i)}return function(e){let n=this.data;return Ma(n,this._offsets,e,t)}}function Zs(r){let t;function e(n,i,s){return r(n[i],s,t)}return function(n,i){let s=this.data;t=i;let o=Ma(s,this._offsets,n,e);return t=void 0,o}}function Qs(r){let t;function e(n,i,s){let o=s,a=0,c=0;for(let d=i-1,p=n.length;++d<p;){let b=n[d];if(~(a=r(b,t,o)))return c+a;o=0,c+=b.length}return-1}return function(n,i){t=n;let s=this.data,o=typeof i!="number"?e(s,0,0):Ma(s,this._offsets,i,e);return t=void 0,o}}var M=class extends D{};function pm(r,t){return t===null&&r.length>0?0:-1}function mm(r,t){let{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(let i of new fn(e,r.offset+(t||0),r.length,e,Gs)){if(!i)return n;++n}return-1}function Y(r,t,e){if(t===void 0)return-1;if(t===null)return mm(r,e);let n=Bt.getVisitFn(r),i=Wr(t);for(let s=(e||0)-1,o=r.length;++s<o;)if(i(n(r,s)))return s;return-1}function au(r,t,e){let n=Bt.getVisitFn(r),i=Wr(t);for(let s=(e||0)-1,o=r.length;++s<o;)if(i(n(r,s)))return s;return-1}M.prototype.visitNull=pm;M.prototype.visitBool=Y;M.prototype.visitInt=Y;M.prototype.visitInt8=Y;M.prototype.visitInt16=Y;M.prototype.visitInt32=Y;M.prototype.visitInt64=Y;M.prototype.visitUint8=Y;M.prototype.visitUint16=Y;M.prototype.visitUint32=Y;M.prototype.visitUint64=Y;M.prototype.visitFloat=Y;M.prototype.visitFloat16=Y;M.prototype.visitFloat32=Y;M.prototype.visitFloat64=Y;M.prototype.visitUtf8=Y;M.prototype.visitBinary=Y;M.prototype.visitFixedSizeBinary=Y;M.prototype.visitDate=Y;M.prototype.visitDateDay=Y;M.prototype.visitDateMillisecond=Y;M.prototype.visitTimestamp=Y;M.prototype.visitTimestampSecond=Y;M.prototype.visitTimestampMillisecond=Y;M.prototype.visitTimestampMicrosecond=Y;M.prototype.visitTimestampNanosecond=Y;M.prototype.visitTime=Y;M.prototype.visitTimeSecond=Y;M.prototype.visitTimeMillisecond=Y;M.prototype.visitTimeMicrosecond=Y;M.prototype.visitTimeNanosecond=Y;M.prototype.visitDecimal=Y;M.prototype.visitList=Y;M.prototype.visitStruct=Y;M.prototype.visitUnion=Y;M.prototype.visitDenseUnion=au;M.prototype.visitSparseUnion=au;M.prototype.visitDictionary=Y;M.prototype.visitInterval=Y;M.prototype.visitIntervalDayTime=Y;M.prototype.visitIntervalYearMonth=Y;M.prototype.visitFixedSizeList=Y;M.prototype.visitMap=Y;var mn=new M;var R=class extends D{};function V(r){let{type:t}=r;if(r.nullCount===0&&r.stride===1&&(t.typeId===f.Timestamp||t instanceof At&&t.bitWidth!==64||t instanceof je&&t.bitWidth!==64||t instanceof ce&&t.precision!==pt.HALF))return new bi(r.data.length,n=>{let i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new bi(r.data.length,n=>{let s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new Ra(o)})}var Ra=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}};R.prototype.visitNull=V;R.prototype.visitBool=V;R.prototype.visitInt=V;R.prototype.visitInt8=V;R.prototype.visitInt16=V;R.prototype.visitInt32=V;R.prototype.visitInt64=V;R.prototype.visitUint8=V;R.prototype.visitUint16=V;R.prototype.visitUint32=V;R.prototype.visitUint64=V;R.prototype.visitFloat=V;R.prototype.visitFloat16=V;R.prototype.visitFloat32=V;R.prototype.visitFloat64=V;R.prototype.visitUtf8=V;R.prototype.visitBinary=V;R.prototype.visitFixedSizeBinary=V;R.prototype.visitDate=V;R.prototype.visitDateDay=V;R.prototype.visitDateMillisecond=V;R.prototype.visitTimestamp=V;R.prototype.visitTimestampSecond=V;R.prototype.visitTimestampMillisecond=V;R.prototype.visitTimestampMicrosecond=V;R.prototype.visitTimestampNanosecond=V;R.prototype.visitTime=V;R.prototype.visitTimeSecond=V;R.prototype.visitTimeMillisecond=V;R.prototype.visitTimeMicrosecond=V;R.prototype.visitTimeNanosecond=V;R.prototype.visitDecimal=V;R.prototype.visitList=V;R.prototype.visitStruct=V;R.prototype.visitUnion=V;R.prototype.visitDenseUnion=V;R.prototype.visitSparseUnion=V;R.prototype.visitDictionary=V;R.prototype.visitInterval=V;R.prototype.visitIntervalDayTime=V;R.prototype.visitIntervalYearMonth=V;R.prototype.visitFixedSizeList=V;R.prototype.visitMap=V;var Ln=new R;var ym=(r,t)=>r+t,ir=class extends D{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===X.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((n,i)=>n+Ie.visit(i,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((n,i)=>n+Ie.visit(i,e),0)}visitDictionary(t,e){var n;return t.type.indices.bitWidth/8+(((n=t.dictionary)===null||n===void 0?void 0:n.getByteLength(t.values[e]))||0)}},_m=({valueOffsets:r},t)=>8+(r[t+1]-r[t]),bm=({valueOffsets:r},t)=>8+(r[t+1]-r[t]),gm=({valueOffsets:r,stride:t,children:e},n)=>{let i=e[0],{[n*t]:s}=r,{[n*t+1]:o}=r,a=Ie.getVisitFn(i.type),c=i.slice(s,o-s),d=8;for(let p=-1,b=o-s;++p<b;)d+=a(c,p);return d},wm=({stride:r,children:t},e)=>{let n=t[0],i=n.slice(e*r,r),s=Ie.getVisitFn(n.type),o=0;for(let a=-1,c=i.length;++a<c;)o+=s(i,a);return o},vm=(r,t)=>r.type.mode===gt.Dense?cu(r,t):lu(r,t),cu=({type:r,children:t,typeIds:e,valueOffsets:n},i)=>{let s=r.typeIdToChildIndex[e[i]];return 8+Ie.visit(t[s],n[i])},lu=({children:r},t)=>4+Ie.visitMany(r,r.map(()=>t)).reduce(ym,0);ir.prototype.visitUtf8=_m;ir.prototype.visitBinary=bm;ir.prototype.visitList=gm;ir.prototype.visitFixedSizeList=wm;ir.prototype.visitUnion=vm;ir.prototype.visitDenseUnion=cu;ir.prototype.visitSparseUnion=lu;var Ie=new ir;var uu,du={},fu={},L=class{constructor(t){var e,n,i;let s=t[0]instanceof L?t.flatMap(a=>a.data):t;if(s.some(a=>!(a instanceof et)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:d,byteLength:p}=du[o.typeId],b=s[0];this.isValid=y=>gi(b,y),this.get=y=>a(b,y),this.set=(y,S)=>c(b,y,S),this.indexOf=y=>d(b,y),this.getByteLength=y=>p(b,y),this._offsets=[0,b.length];break}default:Object.setPrototypeOf(this,fu[o.typeId]),this._offsets=Js(s);break}this.data=s,this.type=o,this.stride=Se(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i: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=Ks(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${f[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 Ln.visit(this)}concat(...t){return new L(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new L(yi(this,t,e,({data:n,_offsets:i},s,o)=>qs(n,i,s,o)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case f.Int:case f.Float:case f.Decimal:case f.Time:case f.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a})=>(o.array.set(a,o.offset),o.offset+=a.length,o),{array:new s(n*i),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(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new L(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return F.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(F.isDictionary(this.type)){let t=new Cn(this.data[0].dictionary),e=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new L(e)}return new Cn(this)}unmemoize(){if(F.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new L(e)}return this}};uu=Symbol.toStringTag;L[uu]=(r=>{r.type=F.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._nullCount=-1,r._byteLength=-1,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;let t=Object.keys(f).map(e=>f[e]).filter(e=>typeof e=="number"&&e!==f.NONE);for(let e of t){let n=Bt.getVisitFnByTypeId(e),i=Xt.getVisitFnByTypeId(e),s=mn.getVisitFnByTypeId(e),o=Ie.getVisitFnByTypeId(e);du[e]={get:n,set:i,indexOf:s,byteLength:o},fu[e]=Object.create(r,{isValid:{value:$r(gi)},get:{value:$r(Bt.getVisitFnByTypeId(e))},set:{value:Zs(Xt.getVisitFnByTypeId(e))},indexOf:{value:Qs(mn.getVisitFnByTypeId(e))},getByteLength:{value:$r(Ie.getVisitFnByTypeId(e))}})}return"Vector"})(L.prototype);var Cn=class extends L{constructor(t){super(t.data);let e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=s[o];if(a!==void 0)return a;let c=e.call(this,o);return s[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Cn(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new L(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function hu(r){if(!r||r.length<=0)return function(i){return!0};let t="",e=r.filter(n=>n===n);return e.length>0&&(t=`
|
|
2
|
+
switch (x) {${e.map(n=>`
|
|
3
|
+
case ${Sm(n)}:`).join("")}
|
|
4
4
|
return false;
|
|
5
|
-
}`),r.length!==
|
|
6
|
-
${
|
|
7
|
-
return true;`)}Lo.createIsValidFunction=Tv;function Av(r){return typeof r!="bigint"?uu.valueToString(r):Sv.BigIntAvailable?`${uu.valueToString(r)}n`:`"${uu.valueToString(r)}"`}});var Jr=g(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.WideBufferBuilder=gt.OffsetsBufferBuilder=gt.BitmapBufferBuilder=gt.DataBufferBuilder=gt.BufferBuilder=void 0;var Oh=qe(),lu=tt(),du=(r,e)=>(r*e+63&~63||64)/e,Fv=(r,e=0)=>r.length>=e?r.subarray(0,e):Oh.memcpy(new r.constructor(e),r,0),hs=class{constructor(e,t=1){this.buffer=e,this.stride=t,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e.constructor,this._resize(this.length=e.length/t|0)}get byteLength(){return this.length*this.stride*this.BYTES_PER_ELEMENT|0}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,n=this.length*t,i=this.buffer.length;n>=i&&this._resize(i===0?du(n*1,this.BYTES_PER_ELEMENT):du(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=du(e*this.stride,this.BYTES_PER_ELEMENT);let t=Fv(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this._resize(0),this}_resize(e){return this.buffer=Oh.memcpy(new this.ArrayType(e),this.buffer)}};gt.BufferBuilder=hs;hs.prototype.offset=0;var ko=class extends hs{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}};gt.DataBufferBuilder=ko;var Mh=class extends ko{constructor(e=new Uint8Array(0)){super(e,1/8);this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:n}=this.reserve(e-this.length+1),i=e>>3,s=e%8,o=n[i]>>s&1;return t?o===0&&(n[i]|=1<<s,++this.numValid):o===1&&(n[i]&=~(1<<s),--this.numValid),this}clear(){return this.numValid=0,super.clear()}};gt.BitmapBufferBuilder=Mh;var Uh=class extends ko{constructor(e=new Int32Array(1)){super(e,1)}append(e){return this.set(this.length-1,e)}set(e,t){let n=this.length-1,i=this.reserve(e-n+1).buffer;return n<e++&&i.fill(i[n],n,e),i[e]=i[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,0),super.flush(e+1)}};gt.OffsetsBufferBuilder=Uh;var Eh=class extends hs{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?lu.BigInt64Array:lu.BigUint64Array)}set(e,t){switch(this.reserve(e-this.length+1),typeof t){case"bigint":this.buffer64[e]=t;break;case"number":this.buffer[e*this.stride]=t;break;default:this.buffer.set(t,e*this.stride)}return this}_resize(e){let t=super._resize(e),n=t.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return lu.BigIntAvailable&&(this.buffer64=new this.ArrayType64(t.buffer,t.byteOffset,n)),t}};gt.WideBufferBuilder=Eh});var De=g(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.VariableWidthBuilder=Xr.FixedWidthBuilder=Xr.Builder=void 0;var ci=et(),Dv=Ve(),ui=be(),Ov=jt(),Mv=Dh(),fu=Jr(),Uv=ce(),vt=class{constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=Uv.strideForType(e),this._nulls=new fu.BitmapBufferBuilder,t&&t.length>0&&(this._isValid=Mv.createIsValidFunction(t))}static new(e){}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}static throughIterable(e){return Ev(e)}static throughAsyncIterable(e){return Rv(e)}toVector(){return Dv.Vector.new(this.flush())}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),this._typeIds&&(e+=this._typeIds.byteLength),this.children.reduce((t,n)=>t+n.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,n)=>t+n.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e=[],t=this._values,n=this._offsets,i=this._typeIds,{length:s,nullCount:o}=this;i?(e[ui.BufferType.TYPE]=i.flush(s),n&&(e[ui.BufferType.OFFSET]=n.flush(s))):n?(t&&(e[ui.BufferType.DATA]=t.flush(n.last())),e[ui.BufferType.OFFSET]=n.flush(s)):t&&(e[ui.BufferType.DATA]=t.flush(s)),o>0&&(e[ui.BufferType.VALIDITY]=this._nulls.flush(s));let a=Ov.Data.new(this.type,0,s,o,e,this.children.map(c=>c.flush()));return this.clear(),a}finish(){return this.finished=!0,this.children.forEach(e=>e.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(e=>e.clear()),this}};Xr.Builder=vt;vt.prototype.length=1;vt.prototype.stride=1;vt.prototype.children=null;vt.prototype.finished=!1;vt.prototype.nullValues=null;vt.prototype._isValid=()=>!0;var Rh=class extends vt{constructor(e){super(e);this._values=new fu.DataBufferBuilder(new this.ArrayType(0),this.stride)}setValue(e,t){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,t)}};Xr.FixedWidthBuilder=Rh;var Vh=class extends vt{constructor(e){super(e);this._pendingLength=0,this._offsets=new fu.OffsetsBufferBuilder}setValue(e,t){let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.length),this._pendingLength+=t.length,n.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}};Xr.VariableWidthBuilder=Vh;function Ev(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function*(i){let s=0,o=vt.new(r);for(let a of i)o.append(a)[n]>=t&&++s&&(yield o.toVector());(o.finish().length>0||s===0)&&(yield o.toVector())}}function Rv(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function(i){return ci.__asyncGenerator(this,arguments,function*(){var s,o;let a=0,c=vt.new(r);try{for(var f=ci.__asyncValues(i),y;y=yield ci.__await(f.next()),!y.done;){let B=y.value;c.append(B)[n]>=t&&++a&&(yield yield ci.__await(c.toVector()))}}catch(B){s={error:B}}finally{try{y&&!y.done&&(o=f.return)&&(yield ci.__await(o.call(f)))}finally{if(s)throw s.error}}(c.finish().length>0||a===0)&&(yield yield ci.__await(c.toVector()))})}}});var hu=g(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.BoolBuilder=void 0;var Vv=Jr(),xv=De(),xh=class extends xv.Builder{constructor(e){super(e);this._values=new Vv.BitmapBufferBuilder}setValue(e,t){this._values.set(e,+t)}};Co.BoolBuilder=xh});var pu=g(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.NullBuilder=void 0;var Pv=De(),Ph=class extends Pv.Builder{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};jo.NullBuilder=Ph});var yu=g(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.DateMillisecondBuilder=Zr.DateDayBuilder=Zr.DateBuilder=void 0;var Nv=De(),qo=class extends Nv.FixedWidthBuilder{};Zr.DateBuilder=qo;var Nh=class extends qo{};Zr.DateDayBuilder=Nh;var Lh=class extends qo{};Zr.DateMillisecondBuilder=Lh});var _u=g(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.DecimalBuilder=void 0;var Lv=De(),kh=class extends Lv.FixedWidthBuilder{};Ho.DecimalBuilder=kh});var bu=g(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.DictionaryBuilder=void 0;var kv=ce(),mu=De(),Ch=class extends mu.Builder{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new kv.Dictionary(e.dictionary,e.indices,e.id,e.isOrdered)});this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=mu.Builder.new({type:this.type.indices,nullValues:t}),this.dictionary=mu.Builder.new({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let n=this.indices;return t=n.setValid(e,t),this.length=n.length,t}setValue(e,t){let n=this._keysToIndices,i=this.valueToKey(t),s=n[i];return s===void 0&&(n[i]=s=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,s)}flush(){let e=this.type,t=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(e);return i.dictionary=t?t.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}};zo.DictionaryBuilder=Ch});var gu=g(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.FixedSizeBinaryBuilder=void 0;var Cv=De(),jh=class extends Cv.FixedWidthBuilder{};Wo.FixedSizeBinaryBuilder=jh});var ps=g(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.float64ToUint16=di.uint16ToFloat64=void 0;var qh=new Float64Array(1),li=new Uint32Array(qh.buffer);function jv(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(e){case 31:return n*(t?NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*Math.pow(2,e-15)*(1+t)}di.uint16ToFloat64=jv;function qv(r){if(r!==r)return 32256;qh[0]=r;let e=(li[1]&2147483648)>>16&65535,t=li[1]&2146435072,n=0;return t>=1089470464?li[0]>0?t=31744:(t=(t&2080374784)>>16,n=(li[1]&1048575)>>10):t<=1056964608?(n=1048576+(li[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(li[1]&1048575)+512>>10),e|t|n&65535}di.float64ToUint16=qv});var vu=g(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.Float64Builder=rr.Float32Builder=rr.Float16Builder=rr.FloatBuilder=void 0;var Hv=ps(),zv=De(),ys=class extends zv.FixedWidthBuilder{};rr.FloatBuilder=ys;var Hh=class extends ys{setValue(e,t){this._values.set(e,Hv.float64ToUint16(t))}};rr.Float16Builder=Hh;var zh=class extends ys{setValue(e,t){this._values.set(e,t)}};rr.Float32Builder=zh;var Wh=class extends ys{setValue(e,t){this._values.set(e,t)}};rr.Float64Builder=Wh});var bs=g(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.BN=He.bignumToBigInt=He.bignumToString=He.isArrowBigNumSymbol=void 0;var Wv=qe(),_s=tt();He.isArrowBigNumSymbol=Symbol.for("isArrowBigNum");function qt(r,...e){return e.length===0?Object.setPrototypeOf(Wv.toArrayBufferView(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}qt.prototype[He.isArrowBigNumSymbol]=!0;qt.prototype.toJSON=function(){return`"${He.bignumToString(this)}"`};qt.prototype.valueOf=function(){return Yh(this)};qt.prototype.toString=function(){return He.bignumToString(this)};qt.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Yh(this);case"string":return He.bignumToString(this);case"default":return He.bignumToBigInt(this)}return He.bignumToString(this)};function fi(...r){return qt.apply(this,r)}function hi(...r){return qt.apply(this,r)}function ms(...r){return qt.apply(this,r)}Object.setPrototypeOf(fi.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(hi.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ms.prototype,Object.create(Uint32Array.prototype));Object.assign(fi.prototype,qt.prototype,{constructor:fi,signed:!0,TypedArray:Int32Array,BigIntArray:_s.BigInt64Array});Object.assign(hi.prototype,qt.prototype,{constructor:hi,signed:!1,TypedArray:Uint32Array,BigIntArray:_s.BigUint64Array});Object.assign(ms.prototype,qt.prototype,{constructor:ms,signed:!0,TypedArray:Uint32Array,BigIntArray:_s.BigUint64Array});function Yh(r){let{buffer:e,byteOffset:t,length:n,signed:i}=r,s=new Int32Array(e,t,n),o=0,a=0,c=s.length,f,y;for(;a<c;)y=s[a++],f=s[a++],i||(f=f>>>0),o+=(y>>>0)+f*Math.pow(a,32);return o}_s.BigIntAvailable?(He.bignumToBigInt=r=>r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:wu(r),He.bignumToString=r=>r.byteLength===8?`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`:wu(r)):(He.bignumToString=wu,He.bignumToBigInt=He.bignumToString);function wu(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),s=-1,o=n.length-1;do{for(t[0]=n[s=0];s<o;)n[s++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[s];n[s]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(i[0]||i[1]||i[2]||i[3]);return e||"0"}var Yo=class{static new(e,t){switch(t){case!0:return new fi(e);case!1:return new hi(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case _s.BigInt64Array:return new fi(e)}return e.byteLength===16?new ms(e):new hi(e)}static signed(e){return new fi(e)}static unsigned(e){return new hi(e)}static decimal(e){return new ms(e)}constructor(e,t){return Yo.new(e,t)}};He.BN=Yo});var Bu=g(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.Uint64Builder=ke.Uint32Builder=ke.Uint16Builder=ke.Uint8Builder=ke.Int64Builder=ke.Int32Builder=ke.Int16Builder=ke.Int8Builder=ke.IntBuilder=void 0;var Yv=bs(),Gh=Jr(),Gv=tt(),$v=De(),nr=class extends $v.FixedWidthBuilder{setValue(e,t){this._values.set(e,t)}};ke.IntBuilder=nr;var $h=class extends nr{};ke.Int8Builder=$h;var Kh=class extends nr{};ke.Int16Builder=Kh;var Jh=class extends nr{};ke.Int32Builder=Jh;var Xh=class extends nr{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(Go));super(e);this._values=new Gh.WideBufferBuilder(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(Go(e))}};ke.Int64Builder=Xh;var Zh=class extends nr{};ke.Uint8Builder=Zh;var Qh=class extends nr{};ke.Uint16Builder=Qh;var ep=class extends nr{};ke.Uint32Builder=ep;var tp=class extends nr{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(Go));super(e);this._values=new Gh.WideBufferBuilder(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(Go(e))}};ke.Uint64Builder=tp;var Go=(r=>e=>(ArrayBuffer.isView(e)&&(r.buffer=e.buffer,r.byteOffset=e.byteOffset,r.byteLength=e.byteLength,e=Yv.bignumToBigInt(r),r.buffer=null),e))({BigIntArray:Gv.BigInt64Array})});var Iu=g(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.TimeNanosecondBuilder=wt.TimeMicrosecondBuilder=wt.TimeMillisecondBuilder=wt.TimeSecondBuilder=wt.TimeBuilder=void 0;var Kv=De(),pi=class extends Kv.FixedWidthBuilder{};wt.TimeBuilder=pi;var rp=class extends pi{};wt.TimeSecondBuilder=rp;var np=class extends pi{};wt.TimeMillisecondBuilder=np;var ip=class extends pi{};wt.TimeMicrosecondBuilder=ip;var sp=class extends pi{};wt.TimeNanosecondBuilder=sp});var Su=g(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.TimestampNanosecondBuilder=Bt.TimestampMicrosecondBuilder=Bt.TimestampMillisecondBuilder=Bt.TimestampSecondBuilder=Bt.TimestampBuilder=void 0;var Jv=De(),yi=class extends Jv.FixedWidthBuilder{};Bt.TimestampBuilder=yi;var op=class extends yi{};Bt.TimestampSecondBuilder=op;var ap=class extends yi{};Bt.TimestampMillisecondBuilder=ap;var cp=class extends yi{};Bt.TimestampMicrosecondBuilder=cp;var up=class extends yi{};Bt.TimestampNanosecondBuilder=up});var Tu=g(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.IntervalYearMonthBuilder=Qr.IntervalDayTimeBuilder=Qr.IntervalBuilder=void 0;var Xv=De(),$o=class extends Xv.FixedWidthBuilder{};Qr.IntervalBuilder=$o;var lp=class extends $o{};Qr.IntervalDayTimeBuilder=lp;var dp=class extends $o{};Qr.IntervalYearMonthBuilder=dp});var Jo=g(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.BinaryBuilder=void 0;var Zv=qe(),Qv=Jr(),ew=De(),fp=class extends ew.VariableWidthBuilder{constructor(e){super(e);this._values=new Qv.BufferBuilder(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Zv.toUint8Array(t))}_flushPending(e,t){let n=this._offsets,i=this._values.reserve(t).buffer,s=0,o=0,a=0,c;for([s,c]of e)c===void 0?n.set(s,0):(o=c.length,i.set(c,a),n.set(s,o),a+=o)}};Ko.BinaryBuilder=fp});var Zo=g(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Utf8Builder=void 0;var tw=On(),rw=Jo(),nw=Jr(),iw=De(),Au=class extends iw.VariableWidthBuilder{constructor(e){super(e);this._values=new nw.BufferBuilder(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,tw.encodeUtf8(t))}_flushPending(e,t){}};Xo.Utf8Builder=Au;Au.prototype._flushPending=rw.BinaryBuilder.prototype._flushPending});var Fu=g(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.Run=void 0;var sw=Ve(),hp=class{get length(){return this._values.length}get(e){return this._values[e]}clear(){return this._values=null,this}bind(e){return e instanceof sw.Vector?e:(this._values=e,this)}};Qo.Run=hp});var Ge=g(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.Field=_i.Schema=void 0;var ow=ce(),It=class{constructor(e=[],t,n){this.fields=e||[],this.metadata=t||new Map,n||(n=Du(e)),this.dictionaries=n}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(...e){let t=e.reduce((n,i)=>(n[i]=!0)&&n,Object.create(null));return new It(this.fields.filter(n=>t[n.name]),this.metadata)}selectAt(...e){return new It(e.map(t=>this.fields[t]).filter(Boolean),this.metadata)}assign(...e){let t=e[0]instanceof It?e[0]:Array.isArray(e[0])?new It(e[0]):new It(e),n=[...this.fields],i=ea(ea(new Map,this.metadata),t.metadata),s=t.fields.filter(a=>{let c=n.findIndex(f=>f.name===a.name);return~c?(n[c]=a.clone({metadata:ea(ea(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=Du(s,new Map);return new It([...n,...s],i,new Map([...this.dictionaries,...o]))}};_i.Schema=It;var Tr=class{constructor(e,t,n=!1,i){this.name=e,this.type=t,this.nullable=n,this.metadata=i||new Map}static new(...e){let[t,n,i,s]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],n===void 0&&(n=e[0].type),i===void 0&&(i=e[0].nullable),s===void 0&&(s=e[0].metadata)),new Tr(`${t}`,n,i,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,n,i,s]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,i=this.nullable,s=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=e[0],Tr.new(t,n,i,s)}};_i.Field=Tr;function ea(r,e){return new Map([...r||new Map,...e||new Map])}function Du(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let s=r[t].type;if(ow.DataType.isDictionary(s)){if(!e.has(s.id))e.set(s.id,s.dictionary);else if(e.get(s.id)!==s.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}s.children&&s.children.length>0&&Du(s.children,e)}return e}It.prototype.fields=null;It.prototype.metadata=null;It.prototype.dictionaries=null;Tr.prototype.type=null;Tr.prototype.name=null;Tr.prototype.nullable=null;Tr.prototype.metadata=null});var Ou=g(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.ListBuilder=void 0;var aw=Fu(),cw=Ge(),uw=ce(),lw=Jr(),dw=De(),pp=class extends dw.VariableWidthBuilder{constructor(e){super(e);this._run=new aw.Run,this._offsets=new lw.OffsetsBufferBuilder}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new uw.List(new cw.Field(t,e.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(e){let t=this._run,n=this._offsets,i=this._setValue,s=0,o;for([s,o]of e)o===void 0?n.set(s,0):(n.set(s,o.length),i(this,s,t.bind(o)))}};ta.ListBuilder=pp});var Mu=g(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.FixedSizeListBuilder=void 0;var fw=Fu(),hw=Ge(),pw=De(),yw=ce(),yp=class extends pw.Builder{constructor(){super(...arguments);this._run=new fw.Run}setValue(e,t){super.setValue(e,this._run.bind(t))}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new yw.FixedSizeList(this.type.listSize,new hw.Field(t,e.type,!0)),n}clear(){return this._run.clear(),super.clear()}};ra.FixedSizeListBuilder=yp});var Uu=g(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.MapBuilder=void 0;var _w=Ge(),mw=ce(),bw=De(),_p=class extends bw.VariableWidthBuilder{set(e,t){return super.set(e,t)}setValue(e,t){t=t instanceof Map?t:new Map(Object.entries(t));let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=t.size,n.set(e,t)}addChild(e,t=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new mw.Map_(new _w.Field(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,n=this._setValue;e.forEach((i,s)=>{i===void 0?t.set(s,0):(t.set(s,i.size),n(this,s,i))})}};na.MapBuilder=_p});var Eu=g(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.StructBuilder=void 0;var gw=Ge(),vw=De(),ww=ce(),mp=class extends vw.Builder{addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new ww.Struct([...this.type.children,new gw.Field(t,e.type,!0)]),n}};ia.StructBuilder=mp});var Ru=g(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.DenseUnionBuilder=en.SparseUnionBuilder=en.UnionBuilder=void 0;var Bw=Ge(),bp=Jr(),Iw=De(),Sw=ce(),sa=class extends Iw.Builder{constructor(e){super(e);this._typeIds=new bp.DataBufferBuilder(new Int8Array(0),1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,n){return n===void 0&&(n=this._valueToChildTypeId(this,t,e)),this.setValid(e,this.isValid(t))&&this.setValue(e,t,n),this}setValue(e,t,n){this._typeIds.set(e,n),super.setValue(e,t)}addChild(e,t=`${this.children.length}`){let n=this.children.push(e),{type:{children:i,mode:s,typeIds:o}}=this,a=[...i,new Bw.Field(t,e.type)];return this.type=new Sw.Union(s,[...o,n],a),n}_valueToChildTypeId(e,t,n){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.")}};en.UnionBuilder=sa;var gp=class extends sa{};en.SparseUnionBuilder=gp;var vp=class extends sa{constructor(e){super(e);this._offsets=new bp.DataBufferBuilder(new Int32Array(0))}setValue(e,t,n){let i=this.type.typeIdToChildIndex[n];return this._offsets.set(e,this.getChildAt(i).length),super.setValue(e,t,n)}};en.DenseUnionBuilder=vp});var Xe=g(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.Visitor=void 0;var Tw=jt(),Aw=Ve(),b=be(),Fw=ce(),me=class{visitMany(e,...t){return e.map((n,i)=>this.visit(n,...t.map(s=>s[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Dw(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};oa.Visitor=me;function Dw(r,e,t=!0){let n=null,i=b.Type.NONE;switch(e instanceof Tw.Data||e instanceof Aw.Vector?i=Vu(e.type):e instanceof Fw.DataType?i=Vu(e):typeof(i=e)!="number"&&(i=b.Type[e]),i){case b.Type.Null:n=r.visitNull;break;case b.Type.Bool:n=r.visitBool;break;case b.Type.Int:n=r.visitInt;break;case b.Type.Int8:n=r.visitInt8||r.visitInt;break;case b.Type.Int16:n=r.visitInt16||r.visitInt;break;case b.Type.Int32:n=r.visitInt32||r.visitInt;break;case b.Type.Int64:n=r.visitInt64||r.visitInt;break;case b.Type.Uint8:n=r.visitUint8||r.visitInt;break;case b.Type.Uint16:n=r.visitUint16||r.visitInt;break;case b.Type.Uint32:n=r.visitUint32||r.visitInt;break;case b.Type.Uint64:n=r.visitUint64||r.visitInt;break;case b.Type.Float:n=r.visitFloat;break;case b.Type.Float16:n=r.visitFloat16||r.visitFloat;break;case b.Type.Float32:n=r.visitFloat32||r.visitFloat;break;case b.Type.Float64:n=r.visitFloat64||r.visitFloat;break;case b.Type.Utf8:n=r.visitUtf8;break;case b.Type.Binary:n=r.visitBinary;break;case b.Type.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case b.Type.Date:n=r.visitDate;break;case b.Type.DateDay:n=r.visitDateDay||r.visitDate;break;case b.Type.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case b.Type.Timestamp:n=r.visitTimestamp;break;case b.Type.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case b.Type.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case b.Type.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case b.Type.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case b.Type.Time:n=r.visitTime;break;case b.Type.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case b.Type.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case b.Type.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case b.Type.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case b.Type.Decimal:n=r.visitDecimal;break;case b.Type.List:n=r.visitList;break;case b.Type.Struct:n=r.visitStruct;break;case b.Type.Union:n=r.visitUnion;break;case b.Type.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case b.Type.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case b.Type.Dictionary:n=r.visitDictionary;break;case b.Type.Interval:n=r.visitInterval;break;case b.Type.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case b.Type.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case b.Type.FixedSizeList:n=r.visitFixedSizeList;break;case b.Type.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${b.Type[i]}'`)}function Vu(r){switch(r.typeId){case b.Type.Null:return b.Type.Null;case b.Type.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?b.Type.Int8:b.Type.Uint8;case 16:return t?b.Type.Int16:b.Type.Uint16;case 32:return t?b.Type.Int32:b.Type.Uint32;case 64:return t?b.Type.Int64:b.Type.Uint64}return b.Type.Int}case b.Type.Float:switch(r.precision){case b.Precision.HALF:return b.Type.Float16;case b.Precision.SINGLE:return b.Type.Float32;case b.Precision.DOUBLE:return b.Type.Float64}return b.Type.Float;case b.Type.Binary:return b.Type.Binary;case b.Type.Utf8:return b.Type.Utf8;case b.Type.Bool:return b.Type.Bool;case b.Type.Decimal:return b.Type.Decimal;case b.Type.Time:switch(r.unit){case b.TimeUnit.SECOND:return b.Type.TimeSecond;case b.TimeUnit.MILLISECOND:return b.Type.TimeMillisecond;case b.TimeUnit.MICROSECOND:return b.Type.TimeMicrosecond;case b.TimeUnit.NANOSECOND:return b.Type.TimeNanosecond}return b.Type.Time;case b.Type.Timestamp:switch(r.unit){case b.TimeUnit.SECOND:return b.Type.TimestampSecond;case b.TimeUnit.MILLISECOND:return b.Type.TimestampMillisecond;case b.TimeUnit.MICROSECOND:return b.Type.TimestampMicrosecond;case b.TimeUnit.NANOSECOND:return b.Type.TimestampNanosecond}return b.Type.Timestamp;case b.Type.Date:switch(r.unit){case b.DateUnit.DAY:return b.Type.DateDay;case b.DateUnit.MILLISECOND:return b.Type.DateMillisecond}return b.Type.Date;case b.Type.Interval:switch(r.unit){case b.IntervalUnit.DAY_TIME:return b.Type.IntervalDayTime;case b.IntervalUnit.YEAR_MONTH:return b.Type.IntervalYearMonth}return b.Type.Interval;case b.Type.Map:return b.Type.Map;case b.Type.List:return b.Type.List;case b.Type.Struct:return b.Type.Struct;case b.Type.Union:switch(r.mode){case b.UnionMode.Dense:return b.Type.DenseUnion;case b.UnionMode.Sparse:return b.Type.SparseUnion}return b.Type.Union;case b.Type.FixedSizeBinary:return b.Type.FixedSizeBinary;case b.Type.FixedSizeList:return b.Type.FixedSizeList;case b.Type.Dictionary:return b.Type.Dictionary}throw new Error(`Unrecognized type '${b.Type[r.typeId]}'`)}me.prototype.visitInt8=null;me.prototype.visitInt16=null;me.prototype.visitInt32=null;me.prototype.visitInt64=null;me.prototype.visitUint8=null;me.prototype.visitUint16=null;me.prototype.visitUint32=null;me.prototype.visitUint64=null;me.prototype.visitFloat16=null;me.prototype.visitFloat32=null;me.prototype.visitFloat64=null;me.prototype.visitDateDay=null;me.prototype.visitDateMillisecond=null;me.prototype.visitTimestampSecond=null;me.prototype.visitTimestampMillisecond=null;me.prototype.visitTimestampMicrosecond=null;me.prototype.visitTimestampNanosecond=null;me.prototype.visitTimeSecond=null;me.prototype.visitTimeMillisecond=null;me.prototype.visitTimeMicrosecond=null;me.prototype.visitTimeNanosecond=null;me.prototype.visitDenseUnion=null;me.prototype.visitSparseUnion=null;me.prototype.visitIntervalDayTime=null;me.prototype.visitIntervalYearMonth=null});var Nu=g(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.instance=mi.SetVisitor=void 0;var Ow=Ve(),Mw=Xe(),Uw=On(),Ew=ps(),Rw=qe(),St=be(),$=class extends Mw.Visitor{};mi.SetVisitor=$;var Vw=(r,e,t)=>{r[e]=t/864e5|0},xu=(r,e,t)=>{r[e]=t%4294967296|0,r[e+1]=t/4294967296|0},xw=(r,e,t)=>{r[e]=t*1e3%4294967296|0,r[e+1]=t*1e3/4294967296|0},Pw=(r,e,t)=>{r[e]=t*1e6%4294967296|0,r[e+1]=t*1e6/4294967296|0},wp=(r,e,t,n)=>{let{[t]:i,[t+1]:s}=e;i!=null&&s!=null&&r.set(n.subarray(0,s-i),i)},Nw=({offset:r,values:e},t,n)=>{let i=r+t;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},Bp=({values:r},e,t)=>{Vw(r,e,t.valueOf())},Ip=({values:r},e,t)=>{xu(r,e*2,t.valueOf())},ir=({stride:r,values:e},t,n)=>{e[r*t]=n},Sp=({stride:r,values:e},t,n)=>{e[r*t]=Ew.float64ToUint16(n)},Pu=(r,e,t)=>{switch(typeof t){case"bigint":r.values64[e]=t;break;case"number":r.values[e*r.stride]=t;break;default:{let n=t,{stride:i,ArrayType:s}=r,o=Rw.toArrayBufferView(s,n);r.values.set(o.subarray(0,i),i*e)}}},Lw=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},kw=({values:r,valueOffsets:e},t,n)=>wp(r,e,t,n),Cw=({values:r,valueOffsets:e},t,n)=>{wp(r,e,t,Uw.encodeUtf8(n))},jw=(r,e,t)=>{r.type.bitWidth<64?ir(r,e,t):Pu(r,e,t)},qw=(r,e,t)=>{r.type.precision!==St.Precision.HALF?ir(r,e,t):Sp(r,e,t)},Hw=(r,e,t)=>{r.type.unit===St.DateUnit.DAY?Bp(r,e,t):Ip(r,e,t)},Tp=({values:r},e,t)=>xu(r,e*2,t/1e3),Ap=({values:r},e,t)=>xu(r,e*2,t),Fp=({values:r},e,t)=>xw(r,e*2,t),Dp=({values:r},e,t)=>Pw(r,e*2,t),zw=(r,e,t)=>{switch(r.type.unit){case St.TimeUnit.SECOND:return Tp(r,e,t);case St.TimeUnit.MILLISECOND:return Ap(r,e,t);case St.TimeUnit.MICROSECOND:return Fp(r,e,t);case St.TimeUnit.NANOSECOND:return Dp(r,e,t)}},Op=({values:r,stride:e},t,n)=>{r[e*t]=n},Mp=({values:r,stride:e},t,n)=>{r[e*t]=n},Up=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Ep=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Ww=(r,e,t)=>{switch(r.type.unit){case St.TimeUnit.SECOND:return Op(r,e,t);case St.TimeUnit.MILLISECOND:return Mp(r,e,t);case St.TimeUnit.MICROSECOND:return Up(r,e,t);case St.TimeUnit.NANOSECOND:return Ep(r,e,t)}},Yw=({values:r},e,t)=>{r.set(t.subarray(0,4),4*e)},Gw=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets;for(let s=-1,o=i[e],a=i[e+1];o<a;)n.set(o++,t.get(++s))},$w=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets,s=t instanceof Map?[...t]:Object.entries(t);for(let o=-1,a=i[e],c=i[e+1];a<c;)n.set(a++,s[++o])},Kw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e[i]),Jw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e.get(i)),Xw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e.get(n.name)),Zw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e[n.name]),Qw=(r,e,t)=>{let n=t instanceof Map?Xw(e,t):t instanceof Ow.Vector?Jw(e,t):Array.isArray(t)?Kw(e,t):Zw(e,t);r.type.children.forEach((i,s)=>n(r.getChildAt(s),i,s))},eB=(r,e,t)=>{r.type.mode===St.UnionMode.Dense?Rp(r,e,t):Vp(r,e,t)},Rp=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(r.valueOffsets[e],t)},Vp=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(e,t)},tB=(r,e,t)=>{let n=r.getKey(e);n!==null&&r.setValue(n,t)},rB=(r,e,t)=>{r.type.unit===St.IntervalUnit.DAY_TIME?xp(r,e,t):Pp(r,e,t)},xp=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Pp=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},nB=(r,e,t)=>{let n=r.getChildAt(0),{stride:i}=r;for(let s=-1,o=e*i;++s<i;)n.set(o+s,t.get(s))};$.prototype.visitBool=Nw;$.prototype.visitInt=jw;$.prototype.visitInt8=ir;$.prototype.visitInt16=ir;$.prototype.visitInt32=ir;$.prototype.visitInt64=Pu;$.prototype.visitUint8=ir;$.prototype.visitUint16=ir;$.prototype.visitUint32=ir;$.prototype.visitUint64=Pu;$.prototype.visitFloat=qw;$.prototype.visitFloat16=Sp;$.prototype.visitFloat32=ir;$.prototype.visitFloat64=ir;$.prototype.visitUtf8=Cw;$.prototype.visitBinary=kw;$.prototype.visitFixedSizeBinary=Lw;$.prototype.visitDate=Hw;$.prototype.visitDateDay=Bp;$.prototype.visitDateMillisecond=Ip;$.prototype.visitTimestamp=zw;$.prototype.visitTimestampSecond=Tp;$.prototype.visitTimestampMillisecond=Ap;$.prototype.visitTimestampMicrosecond=Fp;$.prototype.visitTimestampNanosecond=Dp;$.prototype.visitTime=Ww;$.prototype.visitTimeSecond=Op;$.prototype.visitTimeMillisecond=Mp;$.prototype.visitTimeMicrosecond=Up;$.prototype.visitTimeNanosecond=Ep;$.prototype.visitDecimal=Yw;$.prototype.visitList=Gw;$.prototype.visitStruct=Qw;$.prototype.visitUnion=eB;$.prototype.visitDenseUnion=Rp;$.prototype.visitSparseUnion=Vp;$.prototype.visitDictionary=tB;$.prototype.visitInterval=rB;$.prototype.visitIntervalDayTime=xp;$.prototype.visitIntervalYearMonth=Pp;$.prototype.visitFixedSizeList=nB;$.prototype.visitMap=$w;mi.instance=new $});var Np=g(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.instance=bi.GetBuilderCtor=void 0;var iB=Xe(),sB=Jo(),oB=hu(),Lu=yu(),aB=_u(),cB=bu(),uB=gu(),lB=Mu(),aa=vu(),ku=Tu(),Ar=Bu(),dB=Ou(),fB=Uu(),hB=pu(),pB=Eu(),gs=Su(),vs=Iu(),Cu=Ru(),yB=Zo(),ju=class extends iB.Visitor{visitNull(){return hB.NullBuilder}visitBool(){return oB.BoolBuilder}visitInt(){return Ar.IntBuilder}visitInt8(){return Ar.Int8Builder}visitInt16(){return Ar.Int16Builder}visitInt32(){return Ar.Int32Builder}visitInt64(){return Ar.Int64Builder}visitUint8(){return Ar.Uint8Builder}visitUint16(){return Ar.Uint16Builder}visitUint32(){return Ar.Uint32Builder}visitUint64(){return Ar.Uint64Builder}visitFloat(){return aa.FloatBuilder}visitFloat16(){return aa.Float16Builder}visitFloat32(){return aa.Float32Builder}visitFloat64(){return aa.Float64Builder}visitUtf8(){return yB.Utf8Builder}visitBinary(){return sB.BinaryBuilder}visitFixedSizeBinary(){return uB.FixedSizeBinaryBuilder}visitDate(){return Lu.DateBuilder}visitDateDay(){return Lu.DateDayBuilder}visitDateMillisecond(){return Lu.DateMillisecondBuilder}visitTimestamp(){return gs.TimestampBuilder}visitTimestampSecond(){return gs.TimestampSecondBuilder}visitTimestampMillisecond(){return gs.TimestampMillisecondBuilder}visitTimestampMicrosecond(){return gs.TimestampMicrosecondBuilder}visitTimestampNanosecond(){return gs.TimestampNanosecondBuilder}visitTime(){return vs.TimeBuilder}visitTimeSecond(){return vs.TimeSecondBuilder}visitTimeMillisecond(){return vs.TimeMillisecondBuilder}visitTimeMicrosecond(){return vs.TimeMicrosecondBuilder}visitTimeNanosecond(){return vs.TimeNanosecondBuilder}visitDecimal(){return aB.DecimalBuilder}visitList(){return dB.ListBuilder}visitStruct(){return pB.StructBuilder}visitUnion(){return Cu.UnionBuilder}visitDenseUnion(){return Cu.DenseUnionBuilder}visitSparseUnion(){return Cu.SparseUnionBuilder}visitDictionary(){return cB.DictionaryBuilder}visitInterval(){return ku.IntervalBuilder}visitIntervalDayTime(){return ku.IntervalDayTimeBuilder}visitIntervalYearMonth(){return ku.IntervalYearMonthBuilder}visitFixedSizeList(){return lB.FixedSizeListBuilder}visitMap(){return fB.MapBuilder}};bi.GetBuilderCtor=ju;bi.instance=new ju});var ua=g(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.DenseUnionBuilder=T.SparseUnionBuilder=T.UnionBuilder=T.StructBuilder=T.MapBuilder=T.FixedSizeListBuilder=T.ListBuilder=T.BinaryBuilder=T.Utf8Builder=T.IntervalYearMonthBuilder=T.IntervalDayTimeBuilder=T.IntervalBuilder=T.TimestampNanosecondBuilder=T.TimestampMicrosecondBuilder=T.TimestampMillisecondBuilder=T.TimestampSecondBuilder=T.TimestampBuilder=T.TimeNanosecondBuilder=T.TimeMicrosecondBuilder=T.TimeMillisecondBuilder=T.TimeSecondBuilder=T.TimeBuilder=T.Uint64Builder=T.Uint32Builder=T.Uint16Builder=T.Uint8Builder=T.Int64Builder=T.Int32Builder=T.Int16Builder=T.Int8Builder=T.IntBuilder=T.Float64Builder=T.Float32Builder=T.Float16Builder=T.FloatBuilder=T.FixedSizeBinaryBuilder=T.DictionaryBuilder=T.DecimalBuilder=T.DateMillisecondBuilder=T.DateDayBuilder=T.DateBuilder=T.NullBuilder=T.BoolBuilder=T.Builder=void 0;var _B=De();Object.defineProperty(T,"Builder",{enumerable:!0,get:function(){return _B.Builder}});var mB=hu();Object.defineProperty(T,"BoolBuilder",{enumerable:!0,get:function(){return mB.BoolBuilder}});var bB=pu();Object.defineProperty(T,"NullBuilder",{enumerable:!0,get:function(){return bB.NullBuilder}});var qu=yu();Object.defineProperty(T,"DateBuilder",{enumerable:!0,get:function(){return qu.DateBuilder}});Object.defineProperty(T,"DateDayBuilder",{enumerable:!0,get:function(){return qu.DateDayBuilder}});Object.defineProperty(T,"DateMillisecondBuilder",{enumerable:!0,get:function(){return qu.DateMillisecondBuilder}});var gB=_u();Object.defineProperty(T,"DecimalBuilder",{enumerable:!0,get:function(){return gB.DecimalBuilder}});var vB=bu();Object.defineProperty(T,"DictionaryBuilder",{enumerable:!0,get:function(){return vB.DictionaryBuilder}});var wB=gu();Object.defineProperty(T,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return wB.FixedSizeBinaryBuilder}});var ca=vu();Object.defineProperty(T,"FloatBuilder",{enumerable:!0,get:function(){return ca.FloatBuilder}});Object.defineProperty(T,"Float16Builder",{enumerable:!0,get:function(){return ca.Float16Builder}});Object.defineProperty(T,"Float32Builder",{enumerable:!0,get:function(){return ca.Float32Builder}});Object.defineProperty(T,"Float64Builder",{enumerable:!0,get:function(){return ca.Float64Builder}});var Fr=Bu();Object.defineProperty(T,"IntBuilder",{enumerable:!0,get:function(){return Fr.IntBuilder}});Object.defineProperty(T,"Int8Builder",{enumerable:!0,get:function(){return Fr.Int8Builder}});Object.defineProperty(T,"Int16Builder",{enumerable:!0,get:function(){return Fr.Int16Builder}});Object.defineProperty(T,"Int32Builder",{enumerable:!0,get:function(){return Fr.Int32Builder}});Object.defineProperty(T,"Int64Builder",{enumerable:!0,get:function(){return Fr.Int64Builder}});Object.defineProperty(T,"Uint8Builder",{enumerable:!0,get:function(){return Fr.Uint8Builder}});Object.defineProperty(T,"Uint16Builder",{enumerable:!0,get:function(){return Fr.Uint16Builder}});Object.defineProperty(T,"Uint32Builder",{enumerable:!0,get:function(){return Fr.Uint32Builder}});Object.defineProperty(T,"Uint64Builder",{enumerable:!0,get:function(){return Fr.Uint64Builder}});var ws=Iu();Object.defineProperty(T,"TimeBuilder",{enumerable:!0,get:function(){return ws.TimeBuilder}});Object.defineProperty(T,"TimeSecondBuilder",{enumerable:!0,get:function(){return ws.TimeSecondBuilder}});Object.defineProperty(T,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return ws.TimeMillisecondBuilder}});Object.defineProperty(T,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return ws.TimeMicrosecondBuilder}});Object.defineProperty(T,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return ws.TimeNanosecondBuilder}});var Bs=Su();Object.defineProperty(T,"TimestampBuilder",{enumerable:!0,get:function(){return Bs.TimestampBuilder}});Object.defineProperty(T,"TimestampSecondBuilder",{enumerable:!0,get:function(){return Bs.TimestampSecondBuilder}});Object.defineProperty(T,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return Bs.TimestampMillisecondBuilder}});Object.defineProperty(T,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return Bs.TimestampMicrosecondBuilder}});Object.defineProperty(T,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return Bs.TimestampNanosecondBuilder}});var Hu=Tu();Object.defineProperty(T,"IntervalBuilder",{enumerable:!0,get:function(){return Hu.IntervalBuilder}});Object.defineProperty(T,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Hu.IntervalDayTimeBuilder}});Object.defineProperty(T,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Hu.IntervalYearMonthBuilder}});var BB=Zo();Object.defineProperty(T,"Utf8Builder",{enumerable:!0,get:function(){return BB.Utf8Builder}});var IB=Jo();Object.defineProperty(T,"BinaryBuilder",{enumerable:!0,get:function(){return IB.BinaryBuilder}});var SB=Ou();Object.defineProperty(T,"ListBuilder",{enumerable:!0,get:function(){return SB.ListBuilder}});var TB=Mu();Object.defineProperty(T,"FixedSizeListBuilder",{enumerable:!0,get:function(){return TB.FixedSizeListBuilder}});var AB=Uu();Object.defineProperty(T,"MapBuilder",{enumerable:!0,get:function(){return AB.MapBuilder}});var FB=Eu();Object.defineProperty(T,"StructBuilder",{enumerable:!0,get:function(){return FB.StructBuilder}});var zu=Ru();Object.defineProperty(T,"UnionBuilder",{enumerable:!0,get:function(){return zu.UnionBuilder}});Object.defineProperty(T,"SparseUnionBuilder",{enumerable:!0,get:function(){return zu.SparseUnionBuilder}});Object.defineProperty(T,"DenseUnionBuilder",{enumerable:!0,get:function(){return zu.DenseUnionBuilder}});var Wu=be(),DB=Zo(),OB=De(),Lp=Nu(),kp=Np();OB.Builder.new=Cp;function Cp(r){let e=r.type,t=new(kp.instance.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],i={nullValues:r.nullValues},s=Array.isArray(n)?(o,a)=>n[a]||i:({name:o})=>n[o]||i;e.children.forEach((o,a)=>{let{type:c}=o,f=s(o,a);t.children.push(Cp(Object.assign(Object.assign({},f),{type:c})))})}return t}Object.keys(Wu.Type).map(r=>Wu.Type[r]).filter(r=>typeof r=="number"&&r!==Wu.Type.NONE).forEach(r=>{let e=kp.instance.visit(r);e.prototype._setValue=Lp.instance.getVisitFn(r)});DB.Utf8Builder.prototype._setValue=Lp.instance.visitBinary});var jp=g(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.Block=gi.Footer=void 0;var MB=wr(),la=Gr(),Tt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new Tt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+MB.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Tt).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):la.MetadataVersion.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new la.Schema).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new da).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new da).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new la.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,la.MetadataVersion.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}static createFooter(e,t,n,i,s,o){return Tt.startFooter(e),Tt.addVersion(e,t),Tt.addSchema(e,n),Tt.addDictionaries(e,i),Tt.addRecordBatches(e,s),Tt.addCustomMetadata(e,o),Tt.endFooter(e)}};gi.Footer=Tt;var da=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(e,t,n,i){return e.prep(8,24),e.writeInt64(i),e.pad(4),e.writeInt32(n),e.writeInt64(t),e.offset()}};gi.Block=da});var $u=g(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.FileBlock=vi.Footer=void 0;var Ht=jp(),Yu=wr(),qp=Yu.flatbuffers.Long,UB=Yu.flatbuffers.Builder,EB=Yu.flatbuffers.ByteBuffer,Hp=Ge(),zp=be(),RB=qe(),Gu=class{constructor(e,t=zp.MetadataVersion.V4,n,i){this.schema=e,this.version=t,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}static decode(e){e=new EB(RB.toUint8Array(e));let t=Ht.Footer.getRootAsFooter(e),n=Hp.Schema.decode(t.schema());return new Wp(n,t)}static encode(e){let t=new UB,n=Hp.Schema.encode(t,e.schema);Ht.Footer.startRecordBatchesVector(t,e.numRecordBatches),[...e.recordBatches()].slice().reverse().forEach(o=>tn.encode(t,o));let i=t.endVector();Ht.Footer.startDictionariesVector(t,e.numDictionaries),[...e.dictionaryBatches()].slice().reverse().forEach(o=>tn.encode(t,o));let s=t.endVector();return Ht.Footer.startFooter(t),Ht.Footer.addSchema(t,n),Ht.Footer.addVersion(t,zp.MetadataVersion.V4),Ht.Footer.addRecordBatches(t,i),Ht.Footer.addDictionaries(t,s),Ht.Footer.finishFooterBuffer(t,Ht.Footer.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t<n;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,n=this.numDictionaries;++t<n;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}};vi.Footer=Gu;var Wp=class extends Gu{constructor(e,t){super(e,t.version());this._footer=t}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return tn.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return tn.decode(t)}return null}},tn=class{constructor(e,t,n){this.metaDataLength=e,this.offset=typeof n=="number"?n:n.low,this.bodyLength=typeof t=="number"?t:t.low}static decode(e){return new tn(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,i=new qp(t.offset,0),s=new qp(t.bodyLength,0);return Ht.Block.createBlock(e,i,n,s)}};vi.FileBlock=tn});var an=g(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.AsyncByteStream=on.ByteStream=on.AsyncByteQueue=void 0;var rn=et(),nn=fs(),Yp=On(),Is=ri(),Ku=qe(),wi=tt(),Ju=class extends Is.AsyncQueue{write(e){if((e=Ku.toUint8Array(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Yp.decodeUtf8(this.toUint8Array(!0)):this.toUint8Array(!1).then(Yp.decodeUtf8)}toUint8Array(e=!1){return e?Ku.joinUint8Arrays(this._values)[0]:(()=>rn.__awaiter(this,void 0,void 0,function*(){var t,n;let i=[],s=0;try{for(var o=rn.__asyncValues(this),a;a=yield o.next(),!a.done;){let c=a.value;i.push(c),s+=c.byteLength}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return Ku.joinUint8Arrays(i,s)[0]}))()}};on.AsyncByteQueue=Ju;var Gp=class{constructor(e){e&&(this.source=new $p(nn.default.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}};on.ByteStream=Gp;var fa=class{constructor(e){e instanceof fa?this.source=e.source:e instanceof Ju?this.source=new sn(nn.default.fromAsyncIterable(e)):wi.isReadableNodeStream(e)?this.source=new sn(nn.default.fromNodeStream(e)):wi.isReadableDOMStream(e)?this.source=new sn(nn.default.fromDOMStream(e)):wi.isFetchResponse(e)?this.source=new sn(nn.default.fromDOMStream(e.body)):wi.isIterable(e)?this.source=new sn(nn.default.fromIterable(e)):wi.isPromise(e)?this.source=new sn(nn.default.fromAsyncIterable(e)):wi.isAsyncIterable(e)&&(this.source=new sn(nn.default.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}};on.AsyncByteStream=fa;var $p=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Is.ITERATOR_DONE)}return(e){return Object.create(this.source.return&&this.source.return(e)||Is.ITERATOR_DONE)}},sn=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return rn.__awaiter(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return rn.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return rn.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e,t="read"){return rn.__awaiter(this,void 0,void 0,function*(){return yield this.source.next({cmd:t,size:e})})}throw(e){return rn.__awaiter(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Is.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return rn.__awaiter(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Is.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}});var Xu=g(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.AsyncRandomAccessFile=Bi.RandomAccessFile=void 0;var cn=et(),Kp=an(),VB=qe(),Jp=class extends Kp.ByteStream{constructor(e,t){super();this.position=0,this.buffer=VB.toUint8Array(e),this.size=typeof t=="undefined"?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:t,size:n,position:i}=this;return t&&i<n?(typeof e!="number"&&(e=1/0),this.position=Math.min(n,i+Math.min(n-i,e)),t.subarray(i,this.position)):null}readAt(e,t){let n=this.buffer,i=Math.min(this.size,e+t);return n?n.subarray(e,i):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}};Bi.RandomAccessFile=Jp;var Xp=class extends Kp.AsyncByteStream{constructor(e,t){super();this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=(()=>cn.__awaiter(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return cn.__awaiter(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return cn.__awaiter(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return cn.__awaiter(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:n,position:i}=this;if(t&&i<n){typeof e!="number"&&(e=1/0);let s=i,o=0,a=0,c=Math.min(n,s+Math.min(n-s,e)),f=new Uint8Array(Math.max(0,(this.position=c)-s));for(;(s+=a)<c&&(o+=a)<f.byteLength;)({bytesRead:a}=yield t.read(f,o,f.byteLength-o,s));return f}return null})}readAt(e,t){return cn.__awaiter(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&e+t<i){let s=Math.min(i,e+t),o=new Uint8Array(s-e);return(yield n.read(o,0,t,e)).buffer}return new Uint8Array(t)})}close(){return cn.__awaiter(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return cn.__awaiter(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return cn.__awaiter(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}};Bi.AsyncRandomAccessFile=Xp});var Qu=g(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.Int128=sr.Int64=sr.Uint64=sr.BaseInt64=void 0;var xB=1<<16;function Ii(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var Si=8,Zu=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],ha=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),i=t[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=t[2]*n[3],s+=i,i=t[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<i?xB:0,this.buffer[1]+=s>>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${Ii(this.buffer[1])} ${Ii(this.buffer[0])}`}};sr.BaseInt64=ha;var ue=class extends ha{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return ue.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return ue.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,i=new ue(t);for(let s=0;s<n;){let o=Si<n-s?Si:n-s,a=new ue(new Uint32Array([parseInt(e.substr(s,o),10),0])),c=new ue(new Uint32Array([Zu[o],0]));i.times(c),i.plus(a),s+=o}return i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)ue.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new ue(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new ue(new Uint32Array(e.buffer)).plus(t)}};sr.Uint64=ue;var ct=class extends ha{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let t=this.buffer[1]<<0,n=e.buffer[1]<<0;return t<n||t===n&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return ct.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return ct.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,s=new ct(t);for(let o=n?1:0;o<i;){let a=Si<i-o?Si:i-o,c=new ct(new Uint32Array([parseInt(e.substr(o,a),10),0])),f=new ct(new Uint32Array([Zu[a],0]));s.times(f),s.plus(c),o+=a}return n?s.negate():s}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)ct.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new ct(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new ct(new Uint32Array(e.buffer)).plus(t)}};sr.Int64=ct;var zt=class{constructor(e){this.buffer=e}high(){return new ct(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new ct(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let t=new ue(new Uint32Array([this.buffer[3],0])),n=new ue(new Uint32Array([this.buffer[2],0])),i=new ue(new Uint32Array([this.buffer[1],0])),s=new ue(new Uint32Array([this.buffer[0],0])),o=new ue(new Uint32Array([e.buffer[3],0])),a=new ue(new Uint32Array([e.buffer[2],0])),c=new ue(new Uint32Array([e.buffer[1],0])),f=new ue(new Uint32Array([e.buffer[0],0])),y=ue.multiply(s,f);this.buffer[0]=y.low();let B=new ue(new Uint32Array([y.high(),0]));return y=ue.multiply(i,f),B.plus(y),y=ue.multiply(s,c),B.plus(y),this.buffer[1]=B.low(),this.buffer[3]=B.lessThan(y)?1:0,this.buffer[2]=B.high(),new ue(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ue.multiply(n,f)).plus(ue.multiply(i,c)).plus(ue.multiply(s,a)),this.buffer[3]+=ue.multiply(t,f).plus(ue.multiply(n,c)).plus(ue.multiply(i,a)).plus(ue.multiply(s,o)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${Ii(this.buffer[3])} ${Ii(this.buffer[2])} ${Ii(this.buffer[1])} ${Ii(this.buffer[0])}`}static multiply(e,t){return new zt(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new zt(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return zt.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return zt.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,s=new zt(t);for(let o=n?1:0;o<i;){let a=Si<i-o?Si:i-o,c=new zt(new Uint32Array([parseInt(e.substr(o,a),10),0,0,0])),f=new zt(new Uint32Array([Zu[a],0,0,0]));s.times(f),s.plus(c),o+=a}return n?s.negate():s}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)zt.from(e[n],new Uint32Array(t.buffer,t.byteOffset+4*4*n,4));return t}};sr.Int128=zt});var ty=g(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.JSONVectorLoader=Ti.VectorLoader=void 0;var ze=jt(),PB=Ge(),Dr=ce(),NB=Xe(),Zp=tr(),LB=On(),pa=Qu(),Qp=be(),or=qe(),el=class extends NB.Visitor{constructor(e,t,n,i){super();this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=t,this.buffers=n,this.dictionaries=i}visit(e){return super.visit(e instanceof PB.Field?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return ze.Data.Null(e,0,t)}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Bool(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Int(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Float(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Utf8(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Binary(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitFixedSizeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.FixedSizeBinary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Date(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Timestamp(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Time(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Decimal(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.List(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.visit(e.children[0]))}visitStruct(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Struct(e,0,t,n,this.readNullBitmap(e,n),this.visitMany(e.children))}visitUnion(e){return e.mode===Qp.UnionMode.Sparse?this.visitSparseUnion(e):this.visitDenseUnion(e)}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Union(e,0,t,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.readOffsets(e),this.visitMany(e.children))}visitSparseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Union(e,0,t,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.visitMany(e.children))}visitDictionary(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Dictionary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e.indices),this.readDictionary(e))}visitInterval(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Interval(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.FixedSizeList(e,0,t,n,this.readNullBitmap(e,n),this.visit(e.children[0]))}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return ze.Data.Map(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.visit(e.children[0]))}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,n=this.nextBufferRange()){return t>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}};Ti.VectorLoader=el;var ey=class extends el{constructor(e,t,n,i){super(new Uint8Array(0),t,n,i);this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array(0):Zp.packBools(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return or.toArrayBufferView(Uint8Array,or.toArrayBufferView(Int32Array,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return or.toArrayBufferView(Uint8Array,or.toArrayBufferView(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return Dr.DataType.isTimestamp(e)||(Dr.DataType.isInt(e)||Dr.DataType.isTime(e))&&e.bitWidth===64||Dr.DataType.isDate(e)&&e.unit===Qp.DateUnit.MILLISECOND?or.toArrayBufferView(Uint8Array,pa.Int64.convertArray(n[t])):Dr.DataType.isDecimal(e)?or.toArrayBufferView(Uint8Array,pa.Int128.convertArray(n[t])):Dr.DataType.isBinary(e)||Dr.DataType.isFixedSizeBinary(e)?kB(n[t]):Dr.DataType.isBool(e)?Zp.packBools(n[t]):Dr.DataType.isUtf8(e)?LB.encodeUtf8(n[t].join("")):or.toArrayBufferView(Uint8Array,or.toArrayBufferView(e.ArrayType,n[t].map(i=>+i)))}};Ti.JSONVectorLoader=ey;function kB(r){let e=r.join(""),t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=parseInt(e.substr(n,2),16);return t}});var Ss=g(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.StructRow=Fi.MapRow=void 0;var ry=cu(),Ze=Symbol.for("parent"),Ai=Symbol.for("rowIndex"),ut=Symbol.for("keyToIdx"),lt=Symbol.for("idxToVal"),tl=Symbol.for("nodejs.util.inspect.custom"),ar=class{constructor(e,t){this[Ze]=e,this.size=t}entries(){return this[Symbol.iterator]()}has(e){return this.get(e)!==void 0}get(e){let t;if(e!=null){let n=this[ut]||(this[ut]=new Map),i=n.get(e);if(i!==void 0){let s=this[lt]||(this[lt]=new Array(this.size));(t=s[i])!==void 0||(s[i]=t=this.getValue(i))}else if((i=this.getIndex(e))>-1){n.set(e,i);let s=this[lt]||(this[lt]=new Array(this.size));(t=s[i])!==void 0||(s[i]=t=this.getValue(i))}}return t}set(e,t){if(e!=null){let n=this[ut]||(this[ut]=new Map),i=n.get(e);if(i===void 0&&n.set(e,i=this.getIndex(e)),i>-1){let s=this[lt]||(this[lt]=new Array(this.size));s[i]=this.setValue(i,t)}}return this}clear(){throw new Error(`Clearing ${this[Symbol.toStringTag]} not supported.`)}delete(e){throw new Error(`Deleting ${this[Symbol.toStringTag]} values not supported.`)}*[Symbol.iterator](){let e=this.keys(),t=this.values(),n=this[ut]||(this[ut]=new Map),i=this[lt]||(this[lt]=new Array(this.size));for(let s,o,a=0,c,f;!((c=e.next()).done||(f=t.next()).done);++a)s=c.value,o=f.value,i[a]=o,n.has(s)||n.set(s,a),yield[s,o]}forEach(e,t){let n=this.keys(),i=this.values(),s=t===void 0?e:(c,f,y)=>e.call(t,c,f,y),o=this[ut]||(this[ut]=new Map),a=this[lt]||(this[lt]=new Array(this.size));for(let c,f,y=0,B,D;!((B=n.next()).done||(D=i.next()).done);++y)c=B.value,f=D.value,a[y]=f,o.has(c)||o.set(c,y),s(f,c,this)}toArray(){return[...this.values()]}toJSON(){let e={};return this.forEach((t,n)=>e[n]=t),e}inspect(){return this.toString()}[tl](){return this.toString()}toString(){let e=[];return this.forEach((t,n)=>{n=ry.valueToString(n),t=ry.valueToString(t),e.push(`${n}: ${t}`)}),`{ ${e.join(", ")} }`}};ar[Symbol.toStringTag]=(r=>(Object.defineProperties(r,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[Ze]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ai]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),r[Symbol.toStringTag]="Row"))(ar.prototype);var ny=class extends ar{constructor(e){super(e,e.length);return CB(this)}keys(){return this[Ze].getChildAt(0)[Symbol.iterator]()}values(){return this[Ze].getChildAt(1)[Symbol.iterator]()}getKey(e){return this[Ze].getChildAt(0).get(e)}getIndex(e){return this[Ze].getChildAt(0).indexOf(e)}getValue(e){return this[Ze].getChildAt(1).get(e)}setValue(e,t){this[Ze].getChildAt(1).set(e,t)}};Fi.MapRow=ny;var iy=class extends ar{constructor(e){super(e,e.type.children.length);return sy(this)}*keys(){for(let e of this[Ze].type.children)yield e.name}*values(){for(let e of this[Ze].type.children)yield this[e.name]}getKey(e){return this[Ze].type.children[e].name}getIndex(e){return this[Ze].type.children.findIndex(t=>t.name===e)}getValue(e){return this[Ze].getChildAt(e).get(this[Ai])}setValue(e,t){return this[Ze].getChildAt(e).set(this[Ai],t)}};Fi.StructRow=iy;Object.setPrototypeOf(ar.prototype,Map.prototype);var sy=(()=>{let r={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let t=-1,n=e[ut]||(e[ut]=new Map),i=o=>function(){return this.get(o)},s=o=>function(a){return this.set(o,a)};for(let o of e.keys())n.set(o,++t),r.get=i(o),r.set=s(o),Object.prototype.hasOwnProperty.call(e,o)||(r.enumerable=!0,Object.defineProperty(e,o,r)),Object.prototype.hasOwnProperty.call(e,t)||(r.enumerable=!1,Object.defineProperty(e,t,r));return r.get=r.set=null,e}})(),CB=(()=>{if(typeof Proxy=="undefined")return sy;let r=ar.prototype.has,e=ar.prototype.get,t=ar.prototype.set,n=ar.prototype.getKey,i={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(s){return[...s.keys()].map(o=>`${o}`)},has(s,o){switch(o){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case Ze:case Ai:case lt:case ut:case tl:return!0}return typeof o=="number"&&!s.has(o)&&(o=s.getKey(o)),s.has(o)},get(s,o,a){switch(o){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case Ze:case Ai:case lt:case ut:case tl:return Reflect.get(s,o,a)}return typeof o=="number"&&!r.call(a,o)&&(o=n.call(a,o)),e.call(a,o)},set(s,o,a,c){switch(o){case Ze:case Ai:case lt:case ut:return Reflect.set(s,o,a,c);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return typeof o=="number"&&!r.call(c,o)&&(o=n.call(c,o)),r.call(c,o)?!!t.call(c,o,a):!1}};return s=>new Proxy(s,i)})()});var As=g(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.createElementComparator=un.clampRange=un.clampIndex=void 0;var oy=Ve(),ay=Ss(),jB=qe(),cy=tt();function qB(r,e,t){let n=r.length,i=e>-1?e:n+e%n;return t?t(r,i):i}un.clampIndex=qB;var uy;function HB(r,e,t,n){let{length:i=0}=r,s=typeof e!="number"?0:e,o=typeof t!="number"?i:t;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),o<s&&(uy=s,s=o,o=uy),o>i&&(o=i),n?n(r,s,o):[s,o]}un.clampRange=HB;var zB=cy.BigIntAvailable?cy.BigInt(0):0,ly=r=>r!==r;function Ts(r){let e=typeof r;if(e!=="object"||r===null)return ly(r)?ly:e!=="bigint"?t=>t===r:t=>zB+t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?jB.compareArrayLike(r,t):!1:r instanceof Map?YB(r):Array.isArray(r)?WB(r):r instanceof oy.Vector?GB(r):$B(r)}un.createElementComparator=Ts;function WB(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=Ts(r[t]);return ya(e)}function YB(r){let e=-1,t=[];return r.forEach(n=>t[++e]=Ts(n)),ya(t)}function GB(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=Ts(r.get(t));return ya(e)}function $B(r){let e=Object.keys(r);if(e.length===0)return()=>!1;let t=[];for(let n=-1,i=e.length;++n<i;)t[n]=Ts(r[e[n]]);return ya(t,e)}function ya(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return KB(r,t);case Map:case ay.MapRow:case ay.StructRow:return dy(r,t,t.keys());case Object:case void 0:return dy(r,t,e||Object.keys(t))}return t instanceof oy.Vector?JB(r,t):!1}}function KB(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function JB(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function dy(r,e,t){let n=t[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),s=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,a=r.length,c=s.next(),f=n.next(),y=i.next();for(;o<a&&!f.done&&!y.done&&!c.done&&!(f.value!==y.value||!r[o](c.value));++o,f=n.next(),y=i.next(),c=s.next());return o===a&&f.done&&y.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),s.return&&s.return(),!1)}});var Hn=g($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.selectColumnChildrenArgs=$e.selectVectorChildrenArgs=$e.selectChunkArgs=$e.selectFieldArgs=$e.selectColumnArgs=$e.selectArgs=$e.arrayTypeToDataType=$e.isTypedArray=void 0;var rl=jt(),fy=Ge(),Or=Oi(),Di=Ve(),At=ce(),XB=dn(),ln=Array.isArray;function nl(r){return ArrayBuffer.isView(r)&&"BYTES_PER_ELEMENT"in r}$e.isTypedArray=nl;function hy(r){switch(r){case Int8Array:return At.Int8;case Int16Array:return At.Int16;case Int32Array:return At.Int32;case BigInt64Array:return At.Int64;case Uint8Array:return At.Uint8;case Uint16Array:return At.Uint16;case Uint32Array:return At.Uint32;case BigUint64Array:return At.Uint64;case Float32Array:return At.Float32;case Float64Array:return At.Float64;default:return null}}$e.arrayTypeToDataType=hy;function ZB(r){let e=hy(r.constructor);if(!e)throw new TypeError("Unrecognized Array input");let t=new e,n=rl.Data.new(t,0,r.length,0,[void 0,r]);return Di.Vector.new(n)}$e.selectArgs=(r,e)=>_a(r,e,[],0);$e.selectColumnArgs=r=>{let[e,t]=sl(r,[[],[]]);return t.map((n,i)=>n instanceof Or.Column?Or.Column.new(n.field.clone(e[i]),n):n instanceof Di.Vector?Or.Column.new(e[i],n):nl(n)?Or.Column.new(e[i],ZB(n)):Or.Column.new(e[i],[]))};$e.selectFieldArgs=r=>sl(r,[[],[]]);$e.selectChunkArgs=(r,e)=>il(r,e,[],0);$e.selectVectorChildrenArgs=(r,e)=>py(r,e,[],0);$e.selectColumnChildrenArgs=(r,e)=>yy(r,e,[],0);function _a(r,e,t,n){let i,s=n,o=-1,a=e.length;for(;++o<a;)ln(i=e[o])?s=_a(r,i,t,s).length:i instanceof r&&(t[s++]=i);return t}function il(r,e,t,n){let i,s=n,o=-1,a=e.length;for(;++o<a;)ln(i=e[o])?s=il(r,i,t,s).length:i instanceof XB.Chunked?s=il(r,i.chunks,t,s).length:i instanceof r&&(t[s++]=i);return t}function py(r,e,t,n){let i,s=n,o=-1,a=e.length;for(;++o<a;)ln(i=e[o])?s=py(r,i,t,s).length:i instanceof r?s=_a(Di.Vector,i.schema.fields.map((c,f)=>i.getChildAt(f)),t,s).length:i instanceof Di.Vector&&(t[s++]=i);return t}function yy(r,e,t,n){let i,s=n,o=-1,a=e.length;for(;++o<a;)ln(i=e[o])?s=yy(r,i,t,s).length:i instanceof r?s=_a(Or.Column,i.schema.fields.map((c,f)=>Or.Column.new(c,i.getChildAt(f))),t,s).length:i instanceof Or.Column&&(t[s++]=i);return t}var QB=(r,[e,t],n)=>(r[0][n]=e,r[1][n]=t,r);function sl(r,e){let t,n;switch(n=r.length){case 0:return e;case 1:if(t=e[0],!r[0])return e;if(ln(r[0]))return sl(r[0],e);r[0]instanceof rl.Data||r[0]instanceof Di.Vector||nl(r[0])||r[0]instanceof At.DataType||([t,r]=Object.entries(r[0]).reduce(QB,e));break;default:ln(t=r[n-1])?r=ln(r[0])?r[0]:r.slice(0,n-1):(r=ln(r[0])?r[0]:r,t=[])}let i=-1,s=-1,o=-1,a=r.length,c,f,[y,B]=e;for(;++o<a;)f=r[o],f instanceof Or.Column&&(B[++s]=f)?y[++i]=f.field.clone(t[o],f.type,!0):({[o]:c=o}=t,f instanceof At.DataType&&(B[++s]=f)?y[++i]=fy.Field.new(c,f,!0):(f==null?void 0:f.type)&&(B[++s]=f)&&(f instanceof rl.Data&&(B[s]=f=Di.Vector.new(f)),y[++i]=fy.Field.new(c,f.type,!0)));return e}});var dn=g(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.Chunked=void 0;var eI=As(),_y=ce(),tI=Hn(),my=Ve(),by=class{constructor(e){this.chunks=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator()}next(){for(;this.chunkIndex<this.chunks.length;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.chunks.length&&(this.chunkIterator=this.getChunkIterator())}return{done:!0,value:null}}getChunkIterator(){return this.chunks[this.chunkIndex][Symbol.iterator]()}[Symbol.iterator](){return this}},Mr=class extends my.AbstractVector{constructor(e,t=[],n=rI(t)){super();this._nullCount=-1,this._type=e,this._chunks=t,this._chunkOffsets=n,this._length=n[n.length-1],this._numChildren=(this._type.children||[]).length}static flatten(...e){return tI.selectChunkArgs(my.Vector,e)}static concat(...e){let t=Mr.flatten(...e);return new Mr(t[0].type,t)}get type(){return this._type}get length(){return this._length}get chunks(){return this._chunks}get typeId(){return this._type.typeId}get VectorName(){return`Chunked<${this._type}>`}get data(){return this._chunks[0]?this._chunks[0].data:null}get ArrayType(){return this._type.ArrayType}get numChildren(){return this._numChildren}get stride(){return this._chunks[0]?this._chunks[0].stride:1}get byteLength(){return this._chunks.reduce((e,t)=>e+t.byteLength,0)}get nullCount(){let e=this._nullCount;return e<0&&(this._nullCount=e=this._chunks.reduce((t,{nullCount:n})=>t+n,0)),e}get indices(){if(_y.DataType.isDictionary(this._type)){if(!this._indices){let e=this._chunks;this._indices=e.length===1?e[0].indices:Mr.concat(...e.map(t=>t.indices))}return this._indices}return null}get dictionary(){return _y.DataType.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}[Symbol.iterator](){return new by(this._chunks)}clone(e=this._chunks){return new Mr(this._type,e)}concat(...e){return this.clone(Mr.flatten(this,...e))}slice(e,t){return eI.clampRange(this,e,t,this._sliceInternal)}getChildAt(e){if(e<0||e>=this._numChildren)return null;let t=this._children||(this._children=[]),n,i,s;return(n=t[e])?n:(i=(this._type.children||[])[e])&&(s=this._chunks.map(o=>o.getChildAt(e)).filter(o=>o!=null),s.length>0)?t[e]=new Mr(i.type,s):null}search(e,t){let n=e,i=this._chunkOffsets,s=i.length-1;if(n<0||n>=i[s])return null;if(s<=1)return t?t(this,0,n):[0,n];let o=0,a=0,c=0;do{if(o+1===s)return t?t(this,o,n-a):[o,n-a];c=o+(s-o)/2|0,n>=i[c]?o=c:s=c}while(n<i[s]&&n>=(a=i[o]));return null}isValid(e){return!!this.search(e,this.isValidInternal)}get(e){return this.search(e,this.getInternal)}set(e,t){this.search(e,({chunks:n},i,s)=>n[i].set(s,t))}indexOf(e,t){return t&&typeof t=="number"?this.search(t,(n,i,s)=>this.indexOfInternal(n,i,s,e)):this.indexOfInternal(this,0,Math.max(0,t||0),e)}toArray(){let{chunks:e}=this,t=e.length,n=this._type.ArrayType;if(t<=0)return new n(0);if(t<=1)return e[0].toArray();let i=0,s=new Array(t);for(let c=-1;++c<t;)i+=(s[c]=e[c].toArray()).length;n!==s[0].constructor&&(n=s[0].constructor);let o=new n(i),a=n===Array?iI:nI;for(let c=-1,f=0;++c<t;)f=a(s[c],o,f);return o}getInternal({_chunks:e},t,n){return e[t].get(n)}isValidInternal({_chunks:e},t,n){return e[t].isValid(n)}indexOfInternal({_chunks:e},t,n,i){let s=t-1,o=e.length,a=n,c=0,f=-1;for(;++s<o;){if(~(f=e[s].indexOf(i,a)))return c+f;a=0,c+=e[s].length}return-1}_sliceInternal(e,t,n){let i=[],{chunks:s,_chunkOffsets:o}=e;for(let a=-1,c=s.length;++a<c;){let f=s[a],y=f.length,B=o[a];if(B>=n)break;if(t>=B+y)continue;if(B>=t&&B+y<=n){i.push(f);continue}let D=Math.max(0,t-B),A=Math.min(n-B,y);i.push(f.slice(D,A))}return e.clone(i)}};ma.Chunked=Mr;function rI(r){let e=new Uint32Array((r||[]).length+1),t=e[0]=0,n=e.length;for(let i=0;++i<n;)e[i]=t+=r[i-1].length;return e}var nI=(r,e,t)=>(e.set(r,t),t+r.length),iI=(r,e,t)=>{let n=t;for(let i=-1,s=r.length;++i<s;)e[n++]=r[i];return n}});var Oi=g(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.Column=void 0;var gy=Ge(),vy=Ve(),ol=dn(),zn=class extends ol.Chunked{constructor(e,t=[],n){t=ol.Chunked.flatten(...t);super(e.type,t,n);if(this._field=e,t.length===1&&!(this instanceof al))return new al(e,t[0],this._chunkOffsets)}static new(...e){let[t,n,...i]=e;typeof t!="string"&&!(t instanceof gy.Field)&&(n=t,t="");let s=ol.Chunked.flatten(Array.isArray(n)?[...n,...i]:n instanceof vy.Vector?[n,...i]:[vy.Vector.new(n,...i)]);if(typeof t=="string"){let o=s[0].data.type;t=new gy.Field(t,o,!0)}else!t.nullable&&s.some(({nullCount:o})=>o>0)&&(t=t.clone({nullable:!0}));return new zn(t,s)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(e=this._chunks){return new zn(this._field,e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t=this._children||(this._children=[]),n,i,s;return(n=t[e])?n:(i=(this.type.children||[])[e])&&(s=this._chunks.map(o=>o.getChildAt(e)).filter(o=>o!=null),s.length>0)?t[e]=new zn(i,s):null}};ba.Column=zn;var al=class extends zn{constructor(e,t,n){super(e,[t],n);this._chunk=t}search(e,t){return t?t(this,0,e):[0,e]}isValid(e){return this._chunk.isValid(e)}get(e){return this._chunk.get(e)}set(e,t){this._chunk.set(e,t)}indexOf(e,t){return this._chunk.indexOf(e,t)}}});var wy=g(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.instance=Mi.TypeAssembler=void 0;var sI=wr(),oI=sI.flatbuffers.Long,aI=Xe(),N=Gr(),cl=class extends aI.Visitor{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return N.Null.startNull(t),N.Null.endNull(t)}visitInt(e,t){return N.Int.startInt(t),N.Int.addBitWidth(t,e.bitWidth),N.Int.addIsSigned(t,e.isSigned),N.Int.endInt(t)}visitFloat(e,t){return N.FloatingPoint.startFloatingPoint(t),N.FloatingPoint.addPrecision(t,e.precision),N.FloatingPoint.endFloatingPoint(t)}visitBinary(e,t){return N.Binary.startBinary(t),N.Binary.endBinary(t)}visitBool(e,t){return N.Bool.startBool(t),N.Bool.endBool(t)}visitUtf8(e,t){return N.Utf8.startUtf8(t),N.Utf8.endUtf8(t)}visitDecimal(e,t){return N.Decimal.startDecimal(t),N.Decimal.addScale(t,e.scale),N.Decimal.addPrecision(t,e.precision),N.Decimal.endDecimal(t)}visitDate(e,t){return N.Date.startDate(t),N.Date.addUnit(t,e.unit),N.Date.endDate(t)}visitTime(e,t){return N.Time.startTime(t),N.Time.addUnit(t,e.unit),N.Time.addBitWidth(t,e.bitWidth),N.Time.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return N.Timestamp.startTimestamp(t),N.Timestamp.addUnit(t,e.unit),n!==void 0&&N.Timestamp.addTimezone(t,n),N.Timestamp.endTimestamp(t)}visitInterval(e,t){return N.Interval.startInterval(t),N.Interval.addUnit(t,e.unit),N.Interval.endInterval(t)}visitList(e,t){return N.List.startList(t),N.List.endList(t)}visitStruct(e,t){return N.Struct_.startStruct_(t),N.Struct_.endStruct_(t)}visitUnion(e,t){N.Union.startTypeIdsVector(t,e.typeIds.length);let n=N.Union.createTypeIdsVector(t,e.typeIds);return N.Union.startUnion(t),N.Union.addMode(t,e.mode),N.Union.addTypeIds(t,n),N.Union.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return N.DictionaryEncoding.startDictionaryEncoding(t),N.DictionaryEncoding.addId(t,new oI(e.id,0)),N.DictionaryEncoding.addIsOrdered(t,e.isOrdered),n!==void 0&&N.DictionaryEncoding.addIndexType(t,n),N.DictionaryEncoding.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return N.FixedSizeBinary.startFixedSizeBinary(t),N.FixedSizeBinary.addByteWidth(t,e.byteWidth),N.FixedSizeBinary.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return N.FixedSizeList.startFixedSizeList(t),N.FixedSizeList.addListSize(t,e.listSize),N.FixedSizeList.endFixedSizeList(t)}visitMap(e,t){return N.Map.startMap(t),N.Map.addKeysSorted(t,e.keysSorted),N.Map.endMap(t)}};Mi.TypeAssembler=cl;Mi.instance=new cl});var Dy=g(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.fieldFromJSON=cr.dictionaryBatchFromJSON=cr.recordBatchFromJSON=cr.schemaFromJSON=void 0;var Ui=Ge(),Ie=ce(),Wn=Yn(),Ei=be();function cI(r,e=new Map){return new Ui.Schema(lI(r,e),ga(r.customMetadata),e)}cr.schemaFromJSON=cI;function By(r){return new Wn.RecordBatch(r.count,Sy(r.columns),Ty(r.columns))}cr.recordBatchFromJSON=By;function uI(r){return new Wn.DictionaryBatch(By(r.data),r.id,r.isDelta)}cr.dictionaryBatchFromJSON=uI;function lI(r,e){return(r.fields||[]).filter(Boolean).map(t=>Ui.Field.fromJSON(t,e))}function Iy(r,e){return(r.children||[]).filter(Boolean).map(t=>Ui.Field.fromJSON(t,e))}function Sy(r){return(r||[]).reduce((e,t)=>[...e,new Wn.FieldNode(t.count,dI(t.VALIDITY)),...Sy(t.children)],[])}function Ty(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let i=r[t];i.VALIDITY&&e.push(new Wn.BufferRegion(e.length,i.VALIDITY.length)),i.TYPE&&e.push(new Wn.BufferRegion(e.length,i.TYPE.length)),i.OFFSET&&e.push(new Wn.BufferRegion(e.length,i.OFFSET.length)),i.DATA&&e.push(new Wn.BufferRegion(e.length,i.DATA.length)),e=Ty(i.children,e)}return e}function dI(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function fI(r,e){let t,n,i,s,o,a;return!e||!(s=r.dictionary)?(o=Fy(r,Iy(r,e)),i=new Ui.Field(r.name,o,r.nullable,ga(r.customMetadata))):e.has(t=s.id)?(n=(n=s.indexType)?Ay(n):new Ie.Int32,a=new Ie.Dictionary(e.get(t),n,t,s.isOrdered),i=new Ui.Field(r.name,a,r.nullable,ga(r.customMetadata))):(n=(n=s.indexType)?Ay(n):new Ie.Int32,e.set(t,o=Fy(r,Iy(r,e))),a=new Ie.Dictionary(o,n,t,s.isOrdered),i=new Ui.Field(r.name,a,r.nullable,ga(r.customMetadata))),i||null}cr.fieldFromJSON=fI;function ga(r){return new Map(Object.entries(r||{}))}function Ay(r){return new Ie.Int(r.isSigned,r.bitWidth)}function Fy(r,e){let t=r.type.name;switch(t){case"NONE":return new Ie.Null;case"null":return new Ie.Null;case"binary":return new Ie.Binary;case"utf8":return new Ie.Utf8;case"bool":return new Ie.Bool;case"list":return new Ie.List((e||[])[0]);case"struct":return new Ie.Struct(e||[]);case"struct_":return new Ie.Struct(e||[])}switch(t){case"int":{let n=r.type;return new Ie.Int(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new Ie.Float(Ei.Precision[n.precision])}case"decimal":{let n=r.type;return new Ie.Decimal(n.scale,n.precision)}case"date":{let n=r.type;return new Ie.Date_(Ei.DateUnit[n.unit])}case"time":{let n=r.type;return new Ie.Time(Ei.TimeUnit[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new Ie.Timestamp(Ei.TimeUnit[n.unit],n.timezone)}case"interval":{let n=r.type;return new Ie.Interval(Ei.IntervalUnit[n.unit])}case"union":{let n=r.type;return new Ie.Union(Ei.UnionMode[n.mode],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new Ie.FixedSizeBinary(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Ie.FixedSizeList(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new Ie.Map_((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}});var Yn=g(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.FieldNode=Dt.BufferRegion=Dt.DictionaryBatch=Dt.RecordBatch=Dt.Message=void 0;var ul=wr(),P=Gr(),Te=Io(),Ke=Ge(),hI=qe(),Oe=be(),ll=wy(),va=Dy(),Gn=ul.flatbuffers.Long,pI=ul.flatbuffers.Builder,yI=ul.flatbuffers.ByteBuffer,Se=ce(),fn=class{constructor(e,t,n,i){this._version=t,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof e=="number"?e:e.low}static fromJSON(e,t){let n=new fn(0,Oe.MetadataVersion.V4,t);return n._createHeader=_I(e,t),n}static decode(e){e=new yI(hI.toUint8Array(e));let t=Te.Message.getRootAsMessage(e),n=t.bodyLength(),i=t.version(),s=t.headerType(),o=new fn(n,i,s);return o._createHeader=mI(t,s),o}static encode(e){let t=new pI,n=-1;return e.isSchema()?n=Ke.Schema.encode(t,e.header()):e.isRecordBatch()?n=Ft.encode(t,e.header()):e.isDictionaryBatch()&&(n=ur.encode(t,e.header())),Te.Message.startMessage(t),Te.Message.addVersion(t,Oe.MetadataVersion.V4),Te.Message.addHeader(t,n),Te.Message.addHeaderType(t,e.headerType),Te.Message.addBodyLength(t,new Gn(e.bodyLength,0)),Te.Message.finishMessageBuffer(t,Te.Message.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof Ke.Schema)return new fn(0,Oe.MetadataVersion.V4,Oe.MessageHeader.Schema,e);if(e instanceof Ft)return new fn(t,Oe.MetadataVersion.V4,Oe.MessageHeader.RecordBatch,e);if(e instanceof ur)return new fn(t,Oe.MetadataVersion.V4,Oe.MessageHeader.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Oe.MessageHeader.Schema}isRecordBatch(){return this.headerType===Oe.MessageHeader.RecordBatch}isDictionaryBatch(){return this.headerType===Oe.MessageHeader.DictionaryBatch}};Dt.Message=fn;var Ft=class{constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=typeof e=="number"?e:e.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}};Dt.RecordBatch=Ft;var ur=class{constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=typeof t=="number"?t:t.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}};Dt.DictionaryBatch=ur;var $n=class{constructor(e,t){this.offset=typeof e=="number"?e:e.low,this.length=typeof t=="number"?t:t.low}};Dt.BufferRegion=$n;var Kn=class{constructor(e,t){this.length=typeof e=="number"?e:e.low,this.nullCount=typeof t=="number"?t:t.low}};Dt.FieldNode=Kn;function _I(r,e){return()=>{switch(e){case Oe.MessageHeader.Schema:return Ke.Schema.fromJSON(r);case Oe.MessageHeader.RecordBatch:return Ft.fromJSON(r);case Oe.MessageHeader.DictionaryBatch:return ur.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${Oe.MessageHeader[e]}, type: ${e} }`)}}function mI(r,e){return()=>{switch(e){case Oe.MessageHeader.Schema:return Ke.Schema.decode(r.header(new P.Schema));case Oe.MessageHeader.RecordBatch:return Ft.decode(r.header(new Te.RecordBatch),r.version());case Oe.MessageHeader.DictionaryBatch:return ur.decode(r.header(new Te.DictionaryBatch),r.version())}throw new Error(`Unrecognized Message type: { name: ${Oe.MessageHeader[e]}, type: ${e} }`)}}Ke.Field.encode=DI;Ke.Field.decode=AI;Ke.Field.fromJSON=va.fieldFromJSON;Ke.Schema.encode=FI;Ke.Schema.decode=bI;Ke.Schema.fromJSON=va.schemaFromJSON;Ft.encode=OI;Ft.decode=gI;Ft.fromJSON=va.recordBatchFromJSON;ur.encode=MI;ur.decode=vI;ur.fromJSON=va.dictionaryBatchFromJSON;Kn.encode=UI;Kn.decode=BI;$n.encode=EI;$n.decode=wI;function bI(r,e=new Map){let t=TI(r,e);return new Ke.Schema(t,wa(r),e)}function gI(r,e=Oe.MetadataVersion.V4){return new Ft(r.length(),II(r),SI(r,e))}function vI(r,e=Oe.MetadataVersion.V4){return new ur(Ft.decode(r.data(),e),r.id(),r.isDelta())}function wI(r){return new $n(r.offset(),r.length())}function BI(r){return new Kn(r.length(),r.nullCount())}function II(r){let e=[];for(let t,n=-1,i=-1,s=r.nodesLength();++n<s;)(t=r.nodes(n))&&(e[++i]=Kn.decode(t));return e}function SI(r,e){let t=[];for(let n,i=-1,s=-1,o=r.buffersLength();++i<o;)(n=r.buffers(i))&&(e<Oe.MetadataVersion.V4&&(n.bb_pos+=8*(i+1)),t[++s]=$n.decode(n));return t}function TI(r,e){let t=[];for(let n,i=-1,s=-1,o=r.fieldsLength();++i<o;)(n=r.fields(i))&&(t[++s]=Ke.Field.decode(n,e));return t}function Oy(r,e){let t=[];for(let n,i=-1,s=-1,o=r.childrenLength();++i<o;)(n=r.children(i))&&(t[++s]=Ke.Field.decode(n,e));return t}function AI(r,e){let t,n,i,s,o,a;return!e||!(a=r.dictionary())?(i=Uy(r,Oy(r,e)),n=new Ke.Field(r.name(),i,r.nullable(),wa(r))):e.has(t=a.id().low)?(s=(s=a.indexType())?My(s):new Se.Int32,o=new Se.Dictionary(e.get(t),s,t,a.isOrdered()),n=new Ke.Field(r.name(),o,r.nullable(),wa(r))):(s=(s=a.indexType())?My(s):new Se.Int32,e.set(t,i=Uy(r,Oy(r,e))),o=new Se.Dictionary(i,s,t,a.isOrdered()),n=new Ke.Field(r.name(),o,r.nullable(),wa(r))),n||null}function wa(r){let e=new Map;if(r)for(let t,n,i=-1,s=r.customMetadataLength()|0;++i<s;)(t=r.customMetadata(i))&&(n=t.key())!=null&&e.set(n,t.value());return e}function My(r){return new Se.Int(r.isSigned(),r.bitWidth())}function Uy(r,e){let t=r.typeType();switch(t){case P.Type.NONE:return new Se.Null;case P.Type.Null:return new Se.Null;case P.Type.Binary:return new Se.Binary;case P.Type.Utf8:return new Se.Utf8;case P.Type.Bool:return new Se.Bool;case P.Type.List:return new Se.List((e||[])[0]);case P.Type.Struct_:return new Se.Struct(e||[])}switch(t){case P.Type.Int:{let n=r.type(new P.Int);return new Se.Int(n.isSigned(),n.bitWidth())}case P.Type.FloatingPoint:{let n=r.type(new P.FloatingPoint);return new Se.Float(n.precision())}case P.Type.Decimal:{let n=r.type(new P.Decimal);return new Se.Decimal(n.scale(),n.precision())}case P.Type.Date:{let n=r.type(new P.Date);return new Se.Date_(n.unit())}case P.Type.Time:{let n=r.type(new P.Time);return new Se.Time(n.unit(),n.bitWidth())}case P.Type.Timestamp:{let n=r.type(new P.Timestamp);return new Se.Timestamp(n.unit(),n.timezone())}case P.Type.Interval:{let n=r.type(new P.Interval);return new Se.Interval(n.unit())}case P.Type.Union:{let n=r.type(new P.Union);return new Se.Union(n.mode(),n.typeIdsArray()||[],e||[])}case P.Type.FixedSizeBinary:{let n=r.type(new P.FixedSizeBinary);return new Se.FixedSizeBinary(n.byteWidth())}case P.Type.FixedSizeList:{let n=r.type(new P.FixedSizeList);return new Se.FixedSizeList(n.listSize(),(e||[])[0])}case P.Type.Map:{let n=r.type(new P.Map);return new Se.Map_((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${P.Type[t]}" (${t})`)}function FI(r,e){let t=e.fields.map(s=>Ke.Field.encode(r,s));P.Schema.startFieldsVector(r,t.length);let n=P.Schema.createFieldsVector(r,t),i=e.metadata&&e.metadata.size>0?P.Schema.createCustomMetadataVector(r,[...e.metadata].map(([s,o])=>{let a=r.createString(`${s}`),c=r.createString(`${o}`);return P.KeyValue.startKeyValue(r),P.KeyValue.addKey(r,a),P.KeyValue.addValue(r,c),P.KeyValue.endKeyValue(r)})):-1;return P.Schema.startSchema(r),P.Schema.addFields(r,n),P.Schema.addEndianness(r,RI?P.Endianness.Little:P.Endianness.Big),i!==-1&&P.Schema.addCustomMetadata(r,i),P.Schema.endSchema(r)}function DI(r,e){let t=-1,n=-1,i=-1,s=e.type,o=e.typeId;Se.DataType.isDictionary(s)?(o=s.dictionary.typeId,i=ll.instance.visit(s,r),n=ll.instance.visit(s.dictionary,r)):n=ll.instance.visit(s,r);let a=(s.children||[]).map(y=>Ke.Field.encode(r,y)),c=P.Field.createChildrenVector(r,a),f=e.metadata&&e.metadata.size>0?P.Field.createCustomMetadataVector(r,[...e.metadata].map(([y,B])=>{let D=r.createString(`${y}`),A=r.createString(`${B}`);return P.KeyValue.startKeyValue(r),P.KeyValue.addKey(r,D),P.KeyValue.addValue(r,A),P.KeyValue.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),P.Field.startField(r),P.Field.addType(r,n),P.Field.addTypeType(r,o),P.Field.addChildren(r,c),P.Field.addNullable(r,!!e.nullable),t!==-1&&P.Field.addName(r,t),i!==-1&&P.Field.addDictionary(r,i),f!==-1&&P.Field.addCustomMetadata(r,f),P.Field.endField(r)}function OI(r,e){let t=e.nodes||[],n=e.buffers||[];Te.RecordBatch.startNodesVector(r,t.length),t.slice().reverse().forEach(o=>Kn.encode(r,o));let i=r.endVector();Te.RecordBatch.startBuffersVector(r,n.length),n.slice().reverse().forEach(o=>$n.encode(r,o));let s=r.endVector();return Te.RecordBatch.startRecordBatch(r),Te.RecordBatch.addLength(r,new Gn(e.length,0)),Te.RecordBatch.addNodes(r,i),Te.RecordBatch.addBuffers(r,s),Te.RecordBatch.endRecordBatch(r)}function MI(r,e){let t=Ft.encode(r,e.data);return Te.DictionaryBatch.startDictionaryBatch(r),Te.DictionaryBatch.addId(r,new Gn(e.id,0)),Te.DictionaryBatch.addIsDelta(r,e.isDelta),Te.DictionaryBatch.addData(r,t),Te.DictionaryBatch.endDictionaryBatch(r)}function UI(r,e){return Te.FieldNode.createFieldNode(r,new Gn(e.length,0),new Gn(e.nullCount,0))}function EI(r,e){return P.Buffer.createBuffer(r,new Gn(e.offset,0),new Gn(e.length,0))}var RI=function(){let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256}()});var Ia=g(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.magicX2AndPadding=oe.magicAndPadding=oe.magicLength=oe.checkForMagicArrowString=oe.MAGIC=oe.MAGIC_STR=oe.PADDING=oe.JSONMessageReader=oe.AsyncMessageReader=oe.MessageReader=void 0;var hn=et(),pn=be(),VI=wr(),Ey=VI.flatbuffers.ByteBuffer,Fs=Yn(),xI=tt(),PI=Xu(),Ry=qe(),Ba=an(),Wt=ri(),dl=r=>`Expected ${pn.MessageHeader[r]} Message in stream, but was null or length 0.`,fl=r=>`Header pointer of flatbuffer-encoded ${pn.MessageHeader[r]} Message is null or length 0.`,Vy=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,xy=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,hl=class{constructor(e){this.source=e instanceof Ba.ByteStream?e:new Ba.ByteStream(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Wt.ITERATOR_DONE:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(dl(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=Ry.toUint8Array(this.source.read(e));if(t.byteLength<e)throw new Error(xy(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=pn.MessageHeader.Schema,n=this.readMessage(t),i=n==null?void 0:n.header();if(e&&!i)throw new Error(fl(t));return i}readMetadataLength(){let e=this.source.read(oe.PADDING),t=e&&new Ey(e),n=(t==null?void 0:t.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Wt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(Vy(e,t.byteLength));return{done:!1,value:Fs.Message.decode(t)}}};oe.MessageReader=hl;var Py=class{constructor(e,t){this.source=e instanceof Ba.AsyncByteStream?e:xI.isFileHandle(e)?new PI.AsyncRandomAccessFile(e,t):new Ba.AsyncByteStream(e)}[Symbol.asyncIterator](){return this}next(){return hn.__awaiter(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done||e.value===-1&&(e=yield this.readMetadataLength()).done||(e=yield this.readMetadata(e.value)).done?Wt.ITERATOR_DONE:e})}throw(e){return hn.__awaiter(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return hn.__awaiter(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return hn.__awaiter(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(dl(e));return t.value})}readMessageBody(e){return hn.__awaiter(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=Ry.toUint8Array(yield this.source.read(e));if(t.byteLength<e)throw new Error(xy(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(e=!1){return hn.__awaiter(this,void 0,void 0,function*(){let t=pn.MessageHeader.Schema,n=yield this.readMessage(t),i=n==null?void 0:n.header();if(e&&!i)throw new Error(fl(t));return i})}readMetadataLength(){return hn.__awaiter(this,void 0,void 0,function*(){let e=yield this.source.read(oe.PADDING),t=e&&new Ey(e),n=(t==null?void 0:t.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(e){return hn.__awaiter(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return Wt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(Vy(e,t.byteLength));return{done:!1,value:Fs.Message.decode(t)}})}};oe.AsyncMessageReader=Py;var Ny=class extends hl{constructor(e){super(new Uint8Array(0));this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Wt.ArrowJSON?e:new Wt.ArrowJSON(e)}next(){let{_json:e}=this;if(!this._schema){this._schema=!0;let t=Fs.Message.fromJSON(e.schema,pn.MessageHeader.Schema);return{done:!1,value:t}}if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];this._body=t.data.columns;let n=Fs.Message.fromJSON(t,pn.MessageHeader.DictionaryBatch);return{done:!1,value:n}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];this._body=t.columns;let n=Fs.Message.fromJSON(t,pn.MessageHeader.RecordBatch);return{done:!1,value:n}}return this._body=[],Wt.ITERATOR_DONE}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((i,s)=>[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE&&[s.TYPE]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...t(s.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(dl(e));return t.value}readSchema(){let e=pn.MessageHeader.Schema,t=this.readMessage(e),n=t==null?void 0:t.header();if(!t||!n)throw new Error(fl(e));return n}};oe.JSONMessageReader=Ny;oe.PADDING=4;oe.MAGIC_STR="ARROW1";oe.MAGIC=new Uint8Array(oe.MAGIC_STR.length);for(let r=0;r<oe.MAGIC_STR.length;r+=1|0)oe.MAGIC[r]=oe.MAGIC_STR.charCodeAt(r);function NI(r,e=0){for(let t=-1,n=oe.MAGIC.length;++t<n;)if(oe.MAGIC[t]!==r[e+t])return!1;return!0}oe.checkForMagicArrowString=NI;oe.magicLength=oe.MAGIC.length;oe.magicAndPadding=oe.magicLength+oe.PADDING;oe.magicX2AndPadding=oe.magicLength*2+oe.PADDING});var ml=g(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.compareTypes=Me.compareFields=Me.compareSchemas=Me.instance=Me.TypeComparator=void 0;var LI=Xe(),j=class extends LI.Visitor{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,i)=>this.compareFields(n,t[i]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};Me.TypeComparator=j;function ot(r,e){return e instanceof r.constructor}function Ds(r,e){return r===e||ot(r,e)}function Ur(r,e){return r===e||ot(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function Sa(r,e){return r===e||ot(r,e)&&r.precision===e.precision}function kI(r,e){return r===e||ot(r,e)&&r.byteWidth===e.byteWidth}function pl(r,e){return r===e||ot(r,e)&&r.unit===e.unit}function Os(r,e){return r===e||ot(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function Ms(r,e){return r===e||ot(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function CI(r,e){return r===e||ot(r,e)&&r.children.length===e.children.length&&Me.instance.compareManyFields(r.children,e.children)}function jI(r,e){return r===e||ot(r,e)&&r.children.length===e.children.length&&Me.instance.compareManyFields(r.children,e.children)}function yl(r,e){return r===e||ot(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&Me.instance.compareManyFields(r.children,e.children)}function qI(r,e){return r===e||ot(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&Me.instance.visit(r.indices,e.indices)&&Me.instance.visit(r.dictionary,e.dictionary)}function _l(r,e){return r===e||ot(r,e)&&r.unit===e.unit}function HI(r,e){return r===e||ot(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&Me.instance.compareManyFields(r.children,e.children)}function zI(r,e){return r===e||ot(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&Me.instance.compareManyFields(r.children,e.children)}j.prototype.visitNull=Ds;j.prototype.visitBool=Ds;j.prototype.visitInt=Ur;j.prototype.visitInt8=Ur;j.prototype.visitInt16=Ur;j.prototype.visitInt32=Ur;j.prototype.visitInt64=Ur;j.prototype.visitUint8=Ur;j.prototype.visitUint16=Ur;j.prototype.visitUint32=Ur;j.prototype.visitUint64=Ur;j.prototype.visitFloat=Sa;j.prototype.visitFloat16=Sa;j.prototype.visitFloat32=Sa;j.prototype.visitFloat64=Sa;j.prototype.visitUtf8=Ds;j.prototype.visitBinary=Ds;j.prototype.visitFixedSizeBinary=kI;j.prototype.visitDate=pl;j.prototype.visitDateDay=pl;j.prototype.visitDateMillisecond=pl;j.prototype.visitTimestamp=Os;j.prototype.visitTimestampSecond=Os;j.prototype.visitTimestampMillisecond=Os;j.prototype.visitTimestampMicrosecond=Os;j.prototype.visitTimestampNanosecond=Os;j.prototype.visitTime=Ms;j.prototype.visitTimeSecond=Ms;j.prototype.visitTimeMillisecond=Ms;j.prototype.visitTimeMicrosecond=Ms;j.prototype.visitTimeNanosecond=Ms;j.prototype.visitDecimal=Ds;j.prototype.visitList=CI;j.prototype.visitStruct=jI;j.prototype.visitUnion=yl;j.prototype.visitDenseUnion=yl;j.prototype.visitSparseUnion=yl;j.prototype.visitDictionary=qI;j.prototype.visitInterval=_l;j.prototype.visitIntervalDayTime=_l;j.prototype.visitIntervalYearMonth=_l;j.prototype.visitFixedSizeList=HI;j.prototype.visitMap=zI;Me.instance=new j;function WI(r,e){return Me.instance.compareSchemas(r,e)}Me.compareSchemas=WI;function YI(r,e){return Me.instance.compareFields(r,e)}Me.compareFields=YI;function GI(r,e){return Me.instance.visit(r,e)}Me.compareTypes=GI});var qy=g(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.VectorAssembler=void 0;var $I=Xe(),Ly=be(),KI=Er(),bl=qe(),gl=tr(),JI=Hn(),ky=Yn(),Cy=ce(),Ce=class extends $I.Visitor{constructor(){super();this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...e){let t=new Ce,n=JI.selectVectorChildrenArgs(KI.RecordBatch,e),[i=t]=t.visitMany(n);return i}visit(e){if(!Cy.DataType.isDictionary(e.type)){let{data:t,length:n,nullCount:i}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Cy.DataType.isNull(e.type)||Yt.call(this,i<=0?new Uint8Array(0):gl.truncateBitmap(t.offset,n,t.nullBitmap)),this.nodes.push(new ky.FieldNode(n,i))}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.indices)}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};Ta.VectorAssembler=Ce;function Yt(r){let e=r.byteLength+7&~7;return this.buffers.push(r),this.bufferRegions.push(new ky.BufferRegion(this._byteLength,e)),this._byteLength+=e,this}function XI(r){let{type:e,length:t,typeIds:n,valueOffsets:i}=r;if(Yt.call(this,n),e.mode===Ly.UnionMode.Sparse)return wl.call(this,r);if(e.mode===Ly.UnionMode.Dense){if(r.offset<=0)return Yt.call(this,i),wl.call(this,r);{let s=n.reduce((y,B)=>Math.max(y,B),n[0]),o=new Int32Array(s+1),a=new Int32Array(s+1).fill(-1),c=new Int32Array(t),f=bl.rebaseValueOffsets(-i[0],t,i);for(let y,B,D=-1;++D<t;)(B=a[y=n[D]])===-1&&(B=a[y]=f[y]),c[D]=f[D]-B,++o[y];Yt.call(this,c);for(let y,B=-1,D=e.children.length;++B<D;)if(y=r.getChildAt(B)){let A=e.typeIds[B],J=Math.min(t,o[A]);this.visit(y.slice(a[A],J))}}}return this}function ZI(r){let e;return r.nullCount>=r.length?Yt.call(this,new Uint8Array(0)):(e=r.values)instanceof Uint8Array?Yt.call(this,gl.truncateBitmap(r.offset,r.length,e)):Yt.call(this,gl.packBools(r))}function yn(r){return Yt.call(this,r.values.subarray(0,r.length*r.stride))}function jy(r){let{length:e,values:t,valueOffsets:n}=r,i=n[0],s=n[e],o=Math.min(s-i,t.byteLength-i);return Yt.call(this,bl.rebaseValueOffsets(-n[0],e,n)),Yt.call(this,t.subarray(i,i+o)),this}function vl(r){let{length:e,valueOffsets:t}=r;return t&&Yt.call(this,bl.rebaseValueOffsets(t[0],e,t)),this.visit(r.getChildAt(0))}function wl(r){return this.visitMany(r.type.children.map((e,t)=>r.getChildAt(t)).filter(Boolean))[0]}Ce.prototype.visitBool=ZI;Ce.prototype.visitInt=yn;Ce.prototype.visitFloat=yn;Ce.prototype.visitUtf8=jy;Ce.prototype.visitBinary=jy;Ce.prototype.visitFixedSizeBinary=yn;Ce.prototype.visitDate=yn;Ce.prototype.visitTimestamp=yn;Ce.prototype.visitTime=yn;Ce.prototype.visitDecimal=yn;Ce.prototype.visitList=vl;Ce.prototype.visitStruct=wl;Ce.prototype.visitUnion=XI;Ce.prototype.visitInterval=yn;Ce.prototype.visitFixedSizeList=vl;Ce.prototype.visitMap=vl});var zy=g(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.JSONTypeAssembler=void 0;var QI=Xe(),Qe=Gr(),Ri=be(),Hy=class extends QI.Visitor{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:Qe.Type[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:Qe.Type[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:Qe.Type[e].toLowerCase(),precision:Ri.Precision[t]}}visitBinary({typeId:e}){return{name:Qe.Type[e].toLowerCase()}}visitBool({typeId:e}){return{name:Qe.Type[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:Qe.Type[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n}){return{name:Qe.Type[e].toLowerCase(),scale:t,precision:n}}visitDate({typeId:e,unit:t}){return{name:Qe.Type[e].toLowerCase(),unit:Ri.DateUnit[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:Qe.Type[e].toLowerCase(),unit:Ri.TimeUnit[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:Qe.Type[e].toLowerCase(),unit:Ri.TimeUnit[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:Qe.Type[e].toLowerCase(),unit:Ri.IntervalUnit[t]}}visitList({typeId:e}){return{name:Qe.Type[e].toLowerCase()}}visitStruct({typeId:e}){return{name:Qe.Type[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:Qe.Type[e].toLowerCase(),mode:Ri.UnionMode[t],typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:Qe.Type[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:Qe.Type[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:Qe.Type[e].toLowerCase(),keysSorted:t}}};Aa.JSONTypeAssembler=Hy});var Gy=g(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.JSONVectorAssembler=void 0;var eS=bs(),Us=Oi(),tS=Ve(),rS=Xe(),nS=be(),iS=Er(),Bl=be(),Fa=tr(),sS=Hn(),Wy=ce(),Da=class extends rS.Visitor{static assemble(...e){return new Da().visitMany(sS.selectColumnChildrenArgs(iS.RecordBatch,e))}visit(e){let{data:t,name:n,length:i}=e,{offset:s,nullCount:o,nullBitmap:a}=t,c=Wy.DataType.isDictionary(e.type)?e.type.indices:e.type,f=Object.assign([],t.buffers,{[nS.BufferType.VALIDITY]:void 0});return Object.assign({name:n,count:i,VALIDITY:Wy.DataType.isNull(c)?void 0:o<=0?Array.from({length:i},()=>1):[...new Fa.BitIterator(a,s,i,null,Fa.getBit)]},super.visit(tS.Vector.new(t.clone(c,s,i,0,f))))}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...new Fa.BitIterator(e,t,n,null,Fa.getBool)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...Es(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...e],OFFSET:[...e.valueOffsets]}}visitBinary(e){return{DATA:[...Yy(e)],OFFSET:[...e.valueOffsets]}}visitFixedSizeBinary(e){return{DATA:[...Yy(e)]}}visitDate(e){return{DATA:e.type.unit===Bl.DateUnit.DAY?[...e.values]:[...Es(e.values,2)]}}visitTimestamp(e){return{DATA:[...Es(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<Bl.TimeUnit.MICROSECOND?[...e.values]:[...Es(e.values,2)]}}visitDecimal(e){return{DATA:[...Es(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new Us.Column(t,[e.getChildAt(n)])))}}visitStruct(e){return{children:e.type.children.map((t,n)=>this.visit(new Us.Column(t,[e.getChildAt(n)])))}}visitUnion(e){return{TYPE:[...e.typeIds],OFFSET:e.type.mode===Bl.UnionMode.Dense?[...e.valueOffsets]:void 0,children:e.type.children.map((t,n)=>this.visit(new Us.Column(t,[e.getChildAt(n)])))}}visitInterval(e){return{DATA:[...e.values]}}visitFixedSizeList(e){return{children:e.type.children.map((t,n)=>this.visit(new Us.Column(t,[e.getChildAt(n)])))}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new Us.Column(t,[e.getChildAt(n)])))}}};Oa.JSONVectorAssembler=Da;function*Yy(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Es(r,e){for(let t=-1,n=r.length/e;++t<n;)yield`${eS.BN.new(r.subarray((t+0)*e,(t+1)*e),!1)}`}});var Va=g(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.RecordBatchJSONWriter=dr.RecordBatchFileWriter=dr.RecordBatchStreamWriter=dr.RecordBatchWriter=void 0;var $y=et(),Il=Vs(),oS=Ia(),aS=Oi(),cS=ce(),uS=Ge(),Ma=Yn(),Sl=Yn(),Vi=$u(),Tl=be(),Ky=ml(),Al=an(),Jy=qy(),lS=zy(),Xy=Gy(),dS=qe(),Fl=Er(),fS=ri(),lr=tt(),Rs=class extends fS.ReadableInterop{constructor(e){super();this._position=0,this._started=!1,this._sink=new Al.AsyncByteQueue,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,lr.isObject(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return lr.isPromise(e)?e.then(t=>this.writeAll(t)):lr.isAsyncIterable(e)?Ol(this,e):Dl(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Al.AsyncByteQueue?this._sink=e:(this._sink=new Al.AsyncByteQueue,e&&lr.isWritableDOMStream(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&lr.isWritableNodeStream(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!t||!Ky.compareSchemas(t,this._schema))&&(t===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Il.Table&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof Fl.RecordBatch&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!Ky.compareSchemas(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Fl.RecordBatch?e instanceof Fl._InternalEmptyPlaceholderRecordBatch||this._writeRecordBatch(e):e instanceof Il.Table?this.writeAll(e.chunks):lr.isIterable(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,i=Ma.Message.encode(e),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,c=a-s-o;return e.headerType===Tl.MessageHeader.RecordBatch?this._recordBatchBlocks.push(new Vi.FileBlock(a,e.bodyLength,this._position)):e.headerType===Tl.MessageHeader.DictionaryBatch&&this._dictionaryBlocks.push(new Vi.FileBlock(a,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(c)}_write(e){if(this._started){let t=dS.toUint8Array(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Ma.Message.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(oS.MAGIC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:i,buffers:s}=Jy.VectorAssembler.assemble(e),o=new Sl.RecordBatch(e.length,n,i),a=Ma.Message.from(o,t);return this._writeDictionaries(e)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(e,t,n=!1){this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0));let{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=Jy.VectorAssembler.assemble(e),c=new Sl.RecordBatch(e.length,s,o),f=new Sl.DictionaryBatch(c,t,n),y=Ma.Message.from(f,i);return this._writeMessage(y)._writeBodyBuffers(a)}_writeBodyBuffers(e){let t,n,i;for(let s=-1,o=e.length;++s<o;)(t=e[s])&&(n=t.byteLength)>0&&(this._write(t),(i=(n+7&~7)-n)>0&&this._writePadding(i));return this}_writeDictionaries(e){for(let[t,n]of e.dictionaries){let i=this._dictionaryDeltaOffsets.get(t)||0;if(i===0||(n=n.slice(i)).length>0){let s="chunks"in n?n.chunks:[n];for(let o of s)this._writeDictionaryBatch(o,t,i>0),i+=o.length}}return this}};dr.RecordBatchWriter=Rs;var Ua=class extends Rs{static writeAll(e,t){let n=new Ua(t);return lr.isPromise(e)?e.then(i=>n.writeAll(i)):lr.isAsyncIterable(e)?Ol(n,e):Dl(n,e)}};dr.RecordBatchStreamWriter=Ua;var Ea=class extends Rs{static writeAll(e){let t=new Ea;return lr.isPromise(e)?e.then(n=>t.writeAll(n)):lr.isAsyncIterable(e)?Ol(t,e):Dl(t,e)}constructor(){super();this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeFooter(e){let t=Vi.Footer.encode(new Vi.Footer(e,Tl.MetadataVersion.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};dr.RecordBatchFileWriter=Ea;var Ra=class extends Rs{constructor(){super();this._autoDestroy=!0,this._recordBatches=[],this._dictionaries=[]}static writeAll(e){return new Ra().writeAll(e)}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"dictionaries": [
|
|
11
|
-
`);for(let e of this._dictionaries)super._writeDictionaries(e);this._write(`
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`),this._write(`${pS(this._recordBatches[e])}`),this._recordBatchBlocks.push(new Vi.FileBlock(0,0,0));this._write(`
|
|
16
|
-
]`)}return this._schema&&this._write(`
|
|
17
|
-
}`),this._dictionaries=[],this._recordBatches=[],super.close()}};dr.RecordBatchJSONWriter=Ra;function Dl(r,e){let t=e;e instanceof Il.Table&&(t=e.chunks,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function Ol(r,e){var t,n,i,s;return $y.__awaiter(this,void 0,void 0,function*(){try{for(t=$y.__asyncValues(e);n=yield t.next(),!n.done;){let o=n.value;r.write(o)}}catch(o){i={error:o}}finally{try{n&&!n.done&&(s=t.return)&&(yield s.call(t))}finally{if(i)throw i.error}}return r.finish()})}function Zy({name:r,type:e,nullable:t}){let n=new lS.JSONTypeAssembler;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(Zy),dictionary:cS.DataType.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function hS(r,e,t=!1){let n=new uS.Field(`${e}`,r.type,r.nullCount>0),i=Xy.JSONVectorAssembler.assemble(new aS.Column(n,[r]));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:i}},null,2)}function pS(r){return JSON.stringify({count:r.length,columns:Xy.JSONVectorAssembler.assemble(r)},null,2)}});var El=g(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.distributeVectorsIntoRecordBatches=_n.distributeColumnsIntoRecordBatches=_n.ensureSameLengthData=void 0;var Qy=jt(),Ml=Ge(),yS=dn(),_S=Er(),Ul=new Uint8Array(0),e_=r=>[Ul,Ul,new Uint8Array(r),Ul];function mS(r,e,t=e.reduce((n,i)=>Math.max(n,i.length),0)){let n,i,s=-1,o=e.length,a=[...r.fields],c=[],f=(t+63&~63)>>3;for(;++s<o;)(n=e[s])&&n.length===t?c[s]=n:((i=a[s]).nullable||(a[s]=a[s].clone({nullable:!0})),c[s]=n?n._changeLengthAndBackfillNullBitmap(t):Qy.Data.new(i.type,0,t,t,e_(f)));return[new Ml.Schema(a),t,c]}_n.ensureSameLengthData=mS;function bS(r){return t_(new Ml.Schema(r.map(({field:e})=>e)),r)}_n.distributeColumnsIntoRecordBatches=bS;function t_(r,e){return gS(r,e.map(t=>t instanceof yS.Chunked?t.chunks.map(n=>n.data):[t.data]))}_n.distributeVectorsIntoRecordBatches=t_;function gS(r,e){let t=[...r.fields],n=[],i={numBatches:e.reduce((B,D)=>Math.max(B,D.length),0)},s=0,o=0,a=-1,c=e.length,f,y=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)y[a]=f=e[a].shift(),o=Math.min(o,f?f.length:o);isFinite(o)&&(y=vS(t,o,y,e,i),o>0&&(n[s++]=[o,y.slice()]))}return[r=new Ml.Schema(t,r.metadata),n.map(B=>new _S.RecordBatch(r,...B))]}function vS(r,e,t,n,i){let s,o,a=0,c=-1,f=n.length,y=(e+63&~63)>>3;for(;++c<f;)(s=t[c])&&(a=s.length)>=e?a===e?t[c]=s:(t[c]=s.slice(0,e),s=s.slice(e,a-e),i.numBatches=Math.max(i.numBatches,n[c].unshift(s))):((o=r[c]).nullable||(r[c]=o.clone({nullable:!0})),t[c]=s?s._changeLengthAndBackfillNullBitmap(e):Qy.Data.new(o.type,0,e,e,e_(y)));return t}});var Pe=g(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.BaseVector=void 0;var wS=be(),BS=dn(),IS=As(),Rl=Ve(),Vl=class extends Rl.AbstractVector{constructor(e,t){super();this._children=t,this.numChildren=e.childData.length,this._bindDataAccessors(this.data=e)}get type(){return this.data.type}get typeId(){return this.data.typeId}get length(){return this.data.length}get offset(){return this.data.offset}get stride(){return this.data.stride}get nullCount(){return this.data.nullCount}get byteLength(){return this.data.byteLength}get VectorName(){return`${wS.Type[this.typeId]}Vector`}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}clone(e,t=this._children){return Rl.Vector.new(e,t)}concat(...e){return BS.Chunked.concat(this,...e)}slice(e,t){return IS.clampRange(this,e,t,this._sliceInternal)}isValid(e){if(this.nullCount>0){let t=this.offset+e;return(this.nullBitmap[t>>3]&1<<t%8)!==0}return!0}getChildAt(e){return e<0||e>=this.numChildren?null:(this._children||(this._children=[]))[e]||(this._children[e]=Rl.Vector.new(this.data.childData[e]))}toJSON(){return[...this]}_sliceInternal(e,t,n){return e.clone(e.data.slice(t,n-t),null)}_bindDataAccessors(e){}};xa.BaseVector=Vl;Vl.prototype[Symbol.isConcatSpreadable]=!0});var xl=g(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.BinaryVector=void 0;var SS=Ve(),TS=Pe(),AS=ce(),r_=class extends TS.BaseVector{asUtf8(){return SS.Vector.new(this.data.clone(new AS.Utf8))}};Pa.BinaryVector=r_});var Pl=g(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.BoolVector=void 0;var FS=ce(),DS=Pe(),OS=fr(),n_=class extends DS.BaseVector{static from(e){return OS.vectorFromValuesWithType(()=>new FS.Bool,e)}};Na.BoolVector=n_});var Ll=g(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.DateMillisecondVector=mn.DateDayVector=mn.DateVector=void 0;var MS=be(),US=Pe(),i_=fr(),Nl=ce(),La=class extends US.BaseVector{static from(...e){return e.length===2?i_.vectorFromValuesWithType(()=>e[1]===MS.DateUnit.DAY?new Nl.DateDay:new Nl.DateMillisecond,e[0]):i_.vectorFromValuesWithType(()=>new Nl.DateMillisecond,e[0])}};mn.DateVector=La;var s_=class extends La{};mn.DateDayVector=s_;var o_=class extends La{};mn.DateMillisecondVector=o_});var kl=g(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.DecimalVector=void 0;var ES=Pe(),a_=class extends ES.BaseVector{};ka.DecimalVector=a_});var ja=g(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.DictionaryVector=void 0;var RS=jt(),c_=Ve(),VS=Pe(),xS=fr(),PS=ce(),Cl=class extends VS.BaseVector{constructor(e){super(e);this.indices=c_.Vector.new(e.clone(this.type.indices))}static from(...e){if(e.length===3){let[t,n,i]=e,s=new PS.Dictionary(t.type,n,null,null);return c_.Vector.new(RS.Data.Dictionary(s,0,i.length,0,null,i,t))}return xS.vectorFromValuesWithType(()=>e[0].type,e[0])}get dictionary(){return this.data.dictionary}reverseLookup(e){return this.dictionary.indexOf(e)}getKey(e){return this.indices.get(e)}getValue(e){return this.dictionary.get(e)}setKey(e,t){return this.indices.set(e,t)}setValue(e,t){return this.dictionary.set(e,t)}};Ca.DictionaryVector=Cl;Cl.prototype.indices=null});var jl=g(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.FixedSizeBinaryVector=void 0;var NS=Pe(),u_=class extends NS.BaseVector{};qa.FixedSizeBinaryVector=u_});var ql=g(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.FixedSizeListVector=void 0;var LS=Pe(),l_=class extends LS.BaseVector{};Ha.FixedSizeListVector=l_});var Yl=g(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.Float64Vector=hr.Float32Vector=hr.Float16Vector=hr.FloatVector=void 0;var kS=jt(),CS=Ve(),jS=Pe(),qS=fr(),Jn=ce(),xs=class extends jS.BaseVector{static from(e){let t=WS(this);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){let n=zS(e.constructor)||t;if(t===null&&(t=n),t&&t===n){let i=new t,s=e.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!HS(t,e.constructor))return CS.Vector.new(kS.Data.Float(i,0,s,0,null,e))}}if(t)return qS.vectorFromValuesWithType(()=>new t,e);throw e instanceof DataView||e instanceof ArrayBuffer?new TypeError(`Cannot infer float type from instance of ${e.constructor.name}`):new TypeError("Unrecognized FloatVector input")}};hr.FloatVector=xs;var Hl=class extends xs{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}};hr.Float16Vector=Hl;var zl=class extends xs{};hr.Float32Vector=zl;var Wl=class extends xs{};hr.Float64Vector=Wl;var HS=(r,e)=>r===Jn.Float16&&e!==Uint16Array,zS=r=>{switch(r){case Uint16Array:return Jn.Float16;case Float32Array:return Jn.Float32;case Float64Array:return Jn.Float64;default:return null}},WS=r=>{switch(r){case Hl:return Jn.Float16;case zl:return Jn.Float32;case Wl:return Jn.Float64;default:return null}}});var Gl=g(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.IntervalYearMonthVector=bn.IntervalDayTimeVector=bn.IntervalVector=void 0;var YS=Pe(),za=class extends YS.BaseVector{};bn.IntervalVector=za;var d_=class extends za{};bn.IntervalDayTimeVector=d_;var f_=class extends za{};bn.IntervalYearMonthVector=f_});var Wa=g(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.Uint64Vector=je.Uint32Vector=je.Uint16Vector=je.Uint8Vector=je.Int64Vector=je.Int32Vector=je.Int16Vector=je.Int8Vector=je.IntVector=void 0;var GS=jt(),$S=Ve(),KS=Pe(),JS=fr(),h_=tt(),p_=qe(),Ue=ce(),pr=class extends KS.BaseVector{static from(...e){let[t,n=!1]=e,i=QS(this,n);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let s=ZS(t.constructor,n)||i;if(i===null&&(i=s),i&&i===s){let o=new i,a=t.byteLength/o.ArrayType.BYTES_PER_ELEMENT;return XS(i,t.constructor)&&(a*=.5),$S.Vector.new(GS.Data.Int(o,0,a,0,null,t))}}if(i)return JS.vectorFromValuesWithType(()=>new i,t);throw t instanceof DataView||t instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${t.constructor.name}`):new TypeError("Unrecognized IntVector input")}};je.IntVector=pr;var $l=class extends pr{};je.Int8Vector=$l;var Kl=class extends pr{};je.Int16Vector=Kl;var Jl=class extends pr{};je.Int32Vector=Jl;var Xl=class extends pr{toBigInt64Array(){return p_.toBigInt64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}};je.Int64Vector=Xl;var Zl=class extends pr{};je.Uint8Vector=Zl;var Ql=class extends pr{};je.Uint16Vector=Ql;var ed=class extends pr{};je.Uint32Vector=ed;var td=class extends pr{toBigUint64Array(){return p_.toBigUint64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}};je.Uint64Vector=td;var XS=(r,e)=>(r===Ue.Int64||r===Ue.Uint64)&&(e===Int32Array||e===Uint32Array),ZS=(r,e)=>{switch(r){case Int8Array:return Ue.Int8;case Int16Array:return Ue.Int16;case Int32Array:return e?Ue.Int64:Ue.Int32;case h_.BigInt64Array:return Ue.Int64;case Uint8Array:return Ue.Uint8;case Uint16Array:return Ue.Uint16;case Uint32Array:return e?Ue.Uint64:Ue.Uint32;case h_.BigUint64Array:return Ue.Uint64;default:return null}},QS=(r,e)=>{switch(r){case $l:return Ue.Int8;case Kl:return Ue.Int16;case Jl:return e?Ue.Int64:Ue.Int32;case Xl:return Ue.Int64;case Zl:return Ue.Uint8;case Ql:return Ue.Uint16;case ed:return e?Ue.Uint64:Ue.Uint32;case td:return Ue.Uint64;default:return null}}});var rd=g(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.ListVector=void 0;var eT=Pe(),y_=class extends eT.BaseVector{};Ya.ListVector=y_});var nd=g(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.MapVector=void 0;var tT=Ss(),rT=Ve(),nT=Pe(),iT=ce(),__=class extends nT.BaseVector{asList(){let e=this.type.children[0];return rT.Vector.new(this.data.clone(new iT.List(e)))}bind(e){let t=this.getChildAt(0),{[e]:n,[e+1]:i}=this.valueOffsets;return new tT.MapRow(t.slice(n,i))}};Ga.MapVector=__});var id=g($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.NullVector=void 0;var sT=Pe(),m_=class extends sT.BaseVector{};$a.NullVector=m_});var sd=g(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.StructVector=void 0;var oT=Ss(),aT=Pe(),cT=Symbol.for("rowIndex"),b_=class extends aT.BaseVector{bind(e){let t=this._row||(this._row=new oT.StructRow(this)),n=Object.create(t);return n[cT]=e,n}};Ka.StructVector=b_});var od=g(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.TimestampNanosecondVector=Ot.TimestampMicrosecondVector=Ot.TimestampMillisecondVector=Ot.TimestampSecondVector=Ot.TimestampVector=void 0;var uT=Pe(),xi=class extends uT.BaseVector{};Ot.TimestampVector=xi;var g_=class extends xi{};Ot.TimestampSecondVector=g_;var v_=class extends xi{};Ot.TimestampMillisecondVector=v_;var w_=class extends xi{};Ot.TimestampMicrosecondVector=w_;var B_=class extends xi{};Ot.TimestampNanosecondVector=B_});var ad=g(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.TimeNanosecondVector=Mt.TimeMicrosecondVector=Mt.TimeMillisecondVector=Mt.TimeSecondVector=Mt.TimeVector=void 0;var lT=Pe(),Pi=class extends lT.BaseVector{};Mt.TimeVector=Pi;var I_=class extends Pi{};Mt.TimeSecondVector=I_;var S_=class extends Pi{};Mt.TimeMillisecondVector=S_;var T_=class extends Pi{};Mt.TimeMicrosecondVector=T_;var A_=class extends Pi{};Mt.TimeNanosecondVector=A_});var cd=g(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.SparseUnionVector=gn.DenseUnionVector=gn.UnionVector=void 0;var dT=Pe(),Ja=class extends dT.BaseVector{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}};gn.UnionVector=Ja;var F_=class extends Ja{get valueOffsets(){return this.data.valueOffsets}};gn.DenseUnionVector=F_;var D_=class extends Ja{};gn.SparseUnionVector=D_});var ud=g(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.Utf8Vector=void 0;var fT=Ve(),hT=Pe(),O_=ce(),pT=fr(),M_=class extends hT.BaseVector{static from(e){return pT.vectorFromValuesWithType(()=>new O_.Utf8,e)}asBinary(){return fT.Vector.new(this.data.clone(new O_.Binary))}};Xa.Utf8Vector=M_});var U_=g(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.partial2=vn.partial1=vn.partial0=void 0;function yT(r){return function(){return r(this)}}vn.partial0=yT;function _T(r){return function(e){return r(this,e)}}vn.partial1=_T;function mT(r){return function(e,t){return r(this,e,t)}}vn.partial2=mT});var fd=g(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.instance=Ni.GetVisitor=void 0;var Za=bs(),bT=Xe(),gT=On(),vT=ps(),Ut=be(),q=class extends bT.Visitor{};Ni.GetVisitor=q;var wT=(r,e)=>864e5*r[e],ld=(r,e)=>4294967296*r[e+1]+(r[e]>>>0),BT=(r,e)=>4294967296*(r[e+1]/1e3)+(r[e]>>>0)/1e3,IT=(r,e)=>4294967296*(r[e+1]/1e6)+(r[e]>>>0)/1e6,E_=r=>new Date(r),ST=(r,e)=>E_(wT(r,e)),TT=(r,e)=>E_(ld(r,e)),AT=(r,e)=>null,R_=(r,e,t)=>{let{[t]:n,[t+1]:i}=e;return n!=null&&i!=null?r.subarray(n,i):null},FT=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},V_=({values:r},e)=>ST(r,e),x_=({values:r},e)=>TT(r,e*2),yr=({stride:r,values:e},t)=>e[r*t],P_=({stride:r,values:e},t)=>vT.uint16ToFloat64(e[r*t]),dd=({stride:r,values:e,type:t},n)=>Za.BN.new(e.subarray(r*n,r*(n+1)),t.isSigned),DT=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),OT=({values:r,valueOffsets:e},t)=>R_(r,e,t),MT=({values:r,valueOffsets:e},t)=>{let n=R_(r,e,t);return n!==null?gT.decodeUtf8(n):null},UT=(r,e)=>r.type.bitWidth<64?yr(r,e):dd(r,e),ET=(r,e)=>r.type.precision!==Ut.Precision.HALF?yr(r,e):P_(r,e),RT=(r,e)=>r.type.unit===Ut.DateUnit.DAY?V_(r,e):x_(r,e),N_=({values:r},e)=>1e3*ld(r,e*2),L_=({values:r},e)=>ld(r,e*2),k_=({values:r},e)=>BT(r,e*2),C_=({values:r},e)=>IT(r,e*2),VT=(r,e)=>{switch(r.type.unit){case Ut.TimeUnit.SECOND:return N_(r,e);case Ut.TimeUnit.MILLISECOND:return L_(r,e);case Ut.TimeUnit.MICROSECOND:return k_(r,e);case Ut.TimeUnit.NANOSECOND:return C_(r,e)}},j_=({values:r,stride:e},t)=>r[e*t],q_=({values:r,stride:e},t)=>r[e*t],H_=({values:r},e)=>Za.BN.signed(r.subarray(2*e,2*(e+1))),z_=({values:r},e)=>Za.BN.signed(r.subarray(2*e,2*(e+1))),xT=(r,e)=>{switch(r.type.unit){case Ut.TimeUnit.SECOND:return j_(r,e);case Ut.TimeUnit.MILLISECOND:return q_(r,e);case Ut.TimeUnit.MICROSECOND:return H_(r,e);case Ut.TimeUnit.NANOSECOND:return z_(r,e)}},PT=({values:r},e)=>Za.BN.decimal(r.subarray(4*e,4*(e+1))),NT=(r,e)=>{let t=r.getChildAt(0),{valueOffsets:n,stride:i}=r;return t.slice(n[e*i],n[e*i+1])},LT=(r,e)=>r.bind(e),kT=(r,e)=>r.bind(e),CT=(r,e)=>r.type.mode===Ut.UnionMode.Dense?W_(r,e):Y_(r,e),W_=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(r.valueOffsets[e]):null},Y_=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(e):null},jT=(r,e)=>r.getValue(r.getKey(e)),qT=(r,e)=>r.type.unit===Ut.IntervalUnit.DAY_TIME?G_(r,e):$_(r,e),G_=({values:r},e)=>r.subarray(2*e,2*(e+1)),$_=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=t/12|0,n[1]=t%12|0,n},HT=(r,e)=>{let t=r.getChildAt(0),{stride:n}=r;return t.slice(e*n,(e+1)*n)};q.prototype.visitNull=AT;q.prototype.visitBool=FT;q.prototype.visitInt=UT;q.prototype.visitInt8=yr;q.prototype.visitInt16=yr;q.prototype.visitInt32=yr;q.prototype.visitInt64=dd;q.prototype.visitUint8=yr;q.prototype.visitUint16=yr;q.prototype.visitUint32=yr;q.prototype.visitUint64=dd;q.prototype.visitFloat=ET;q.prototype.visitFloat16=P_;q.prototype.visitFloat32=yr;q.prototype.visitFloat64=yr;q.prototype.visitUtf8=MT;q.prototype.visitBinary=OT;q.prototype.visitFixedSizeBinary=DT;q.prototype.visitDate=RT;q.prototype.visitDateDay=V_;q.prototype.visitDateMillisecond=x_;q.prototype.visitTimestamp=VT;q.prototype.visitTimestampSecond=N_;q.prototype.visitTimestampMillisecond=L_;q.prototype.visitTimestampMicrosecond=k_;q.prototype.visitTimestampNanosecond=C_;q.prototype.visitTime=xT;q.prototype.visitTimeSecond=j_;q.prototype.visitTimeMillisecond=q_;q.prototype.visitTimeMicrosecond=H_;q.prototype.visitTimeNanosecond=z_;q.prototype.visitDecimal=PT;q.prototype.visitList=NT;q.prototype.visitStruct=kT;q.prototype.visitUnion=CT;q.prototype.visitDenseUnion=W_;q.prototype.visitSparseUnion=Y_;q.prototype.visitDictionary=jT;q.prototype.visitInterval=qT;q.prototype.visitIntervalDayTime=G_;q.prototype.visitIntervalYearMonth=$_;q.prototype.visitFixedSizeList=HT;q.prototype.visitMap=LT;Ni.instance=new q});var Z_=g(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.instance=Li.IndexOfVisitor=void 0;var zT=Xe(),K_=tr(),J_=As(),H=class extends zT.Visitor{};Li.IndexOfVisitor=H;function WT(r,e){return e===null&&r.length>0?0:-1}function YT(r,e){let{nullBitmap:t}=r.data;if(!t||r.nullCount<=0)return-1;let n=0;for(let i of new K_.BitIterator(t,r.data.offset+(e||0),r.length,t,K_.getBool)){if(!i)return n;++n}return-1}function re(r,e,t){if(e===void 0)return-1;if(e===null)return YT(r,t);let n=J_.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}function X_(r,e,t){let n=J_.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}H.prototype.visitNull=WT;H.prototype.visitBool=re;H.prototype.visitInt=re;H.prototype.visitInt8=re;H.prototype.visitInt16=re;H.prototype.visitInt32=re;H.prototype.visitInt64=re;H.prototype.visitUint8=re;H.prototype.visitUint16=re;H.prototype.visitUint32=re;H.prototype.visitUint64=re;H.prototype.visitFloat=re;H.prototype.visitFloat16=re;H.prototype.visitFloat32=re;H.prototype.visitFloat64=re;H.prototype.visitUtf8=re;H.prototype.visitBinary=re;H.prototype.visitFixedSizeBinary=re;H.prototype.visitDate=re;H.prototype.visitDateDay=re;H.prototype.visitDateMillisecond=re;H.prototype.visitTimestamp=re;H.prototype.visitTimestampSecond=re;H.prototype.visitTimestampMillisecond=re;H.prototype.visitTimestampMicrosecond=re;H.prototype.visitTimestampNanosecond=re;H.prototype.visitTime=re;H.prototype.visitTimeSecond=re;H.prototype.visitTimeMillisecond=re;H.prototype.visitTimeMicrosecond=re;H.prototype.visitTimeNanosecond=re;H.prototype.visitDecimal=re;H.prototype.visitList=re;H.prototype.visitStruct=re;H.prototype.visitUnion=re;H.prototype.visitDenseUnion=X_;H.prototype.visitSparseUnion=X_;H.prototype.visitDictionary=re;H.prototype.visitInterval=re;H.prototype.visitIntervalDayTime=re;H.prototype.visitIntervalYearMonth=re;H.prototype.visitFixedSizeList=re;H.prototype.visitMap=re;Li.instance=new H});var hd=g(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.instance=ki.IteratorVisitor=void 0;var Qa=be(),GT=Xe(),$T=tr(),Q_=fd(),z=class extends GT.Visitor{};ki.IteratorVisitor=z;function KT(r){let e=Q_.instance.getVisitFn(r);return new $T.BitIterator(r.data.nullBitmap,r.data.offset,r.length,r,(t,n,i,s)=>(i&1<<s)!==0?e(t,n):null)}var em=class{constructor(e,t){this.vector=e,this.getFn=t,this.index=0}next(){return this.index<this.vector.length?{value:this.getFn(this.vector,this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};function Q(r){if(r.nullCount>0)return KT(r);let{type:e,typeId:t,length:n}=r;return r.stride===1&&(t===Qa.Type.Timestamp||t===Qa.Type.Int&&e.bitWidth!==64||t===Qa.Type.Time&&e.bitWidth!==64||t===Qa.Type.Float&&e.precision>0)?r.data.values.subarray(0,n)[Symbol.iterator]():new em(r,Q_.instance.getVisitFn(r))}z.prototype.visitNull=Q;z.prototype.visitBool=Q;z.prototype.visitInt=Q;z.prototype.visitInt8=Q;z.prototype.visitInt16=Q;z.prototype.visitInt32=Q;z.prototype.visitInt64=Q;z.prototype.visitUint8=Q;z.prototype.visitUint16=Q;z.prototype.visitUint32=Q;z.prototype.visitUint64=Q;z.prototype.visitFloat=Q;z.prototype.visitFloat16=Q;z.prototype.visitFloat32=Q;z.prototype.visitFloat64=Q;z.prototype.visitUtf8=Q;z.prototype.visitBinary=Q;z.prototype.visitFixedSizeBinary=Q;z.prototype.visitDate=Q;z.prototype.visitDateDay=Q;z.prototype.visitDateMillisecond=Q;z.prototype.visitTimestamp=Q;z.prototype.visitTimestampSecond=Q;z.prototype.visitTimestampMillisecond=Q;z.prototype.visitTimestampMicrosecond=Q;z.prototype.visitTimestampNanosecond=Q;z.prototype.visitTime=Q;z.prototype.visitTimeSecond=Q;z.prototype.visitTimeMillisecond=Q;z.prototype.visitTimeMicrosecond=Q;z.prototype.visitTimeNanosecond=Q;z.prototype.visitDecimal=Q;z.prototype.visitList=Q;z.prototype.visitStruct=Q;z.prototype.visitUnion=Q;z.prototype.visitDenseUnion=Q;z.prototype.visitSparseUnion=Q;z.prototype.visitDictionary=Q;z.prototype.visitInterval=Q;z.prototype.visitIntervalDayTime=Q;z.prototype.visitIntervalYearMonth=Q;z.prototype.visitFixedSizeList=Q;z.prototype.visitMap=Q;ki.instance=new z});var tm=g(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.instance=Ci.ToArrayVisitor=void 0;var Ps=be(),JT=Xe(),XT=hd(),W=class extends JT.Visitor{};Ci.ToArrayVisitor=W;function ee(r){let{type:e,length:t,stride:n}=r;switch(e.typeId){case Ps.Type.Int:case Ps.Type.Float:case Ps.Type.Decimal:case Ps.Type.Time:case Ps.Type.Timestamp:return r.data.values.subarray(0,t*n)}return[...XT.instance.visit(r)]}W.prototype.visitNull=ee;W.prototype.visitBool=ee;W.prototype.visitInt=ee;W.prototype.visitInt8=ee;W.prototype.visitInt16=ee;W.prototype.visitInt32=ee;W.prototype.visitInt64=ee;W.prototype.visitUint8=ee;W.prototype.visitUint16=ee;W.prototype.visitUint32=ee;W.prototype.visitUint64=ee;W.prototype.visitFloat=ee;W.prototype.visitFloat16=ee;W.prototype.visitFloat32=ee;W.prototype.visitFloat64=ee;W.prototype.visitUtf8=ee;W.prototype.visitBinary=ee;W.prototype.visitFixedSizeBinary=ee;W.prototype.visitDate=ee;W.prototype.visitDateDay=ee;W.prototype.visitDateMillisecond=ee;W.prototype.visitTimestamp=ee;W.prototype.visitTimestampSecond=ee;W.prototype.visitTimestampMillisecond=ee;W.prototype.visitTimestampMicrosecond=ee;W.prototype.visitTimestampNanosecond=ee;W.prototype.visitTime=ee;W.prototype.visitTimeSecond=ee;W.prototype.visitTimeMillisecond=ee;W.prototype.visitTimeMicrosecond=ee;W.prototype.visitTimeNanosecond=ee;W.prototype.visitDecimal=ee;W.prototype.visitList=ee;W.prototype.visitStruct=ee;W.prototype.visitUnion=ee;W.prototype.visitDenseUnion=ee;W.prototype.visitSparseUnion=ee;W.prototype.visitDictionary=ee;W.prototype.visitInterval=ee;W.prototype.visitIntervalDayTime=ee;W.prototype.visitIntervalYearMonth=ee;W.prototype.visitFixedSizeList=ee;W.prototype.visitMap=ee;Ci.instance=new W});var rm=g(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.instance=ji.ByteWidthVisitor=void 0;var ZT=Xe(),QT=be(),Ns=(r,e)=>r+e,pd=r=>`Cannot compute the byte width of variable-width column ${r}`,yd=class extends ZT.Visitor{visitNull(e){return 0}visitInt(e){return e.bitWidth/8}visitFloat(e){return e.ArrayType.BYTES_PER_ELEMENT}visitBinary(e){throw new Error(pd(e))}visitUtf8(e){throw new Error(pd(e))}visitBool(e){return 1/8}visitDecimal(e){return 16}visitDate(e){return(e.unit+1)*4}visitTime(e){return e.bitWidth/8}visitTimestamp(e){return e.unit===QT.TimeUnit.SECOND?4:8}visitInterval(e){return(e.unit+1)*4}visitList(e){throw new Error(pd(e))}visitStruct(e){return this.visitFields(e.children).reduce(Ns,0)}visitUnion(e){return this.visitFields(e.children).reduce(Ns,0)}visitFixedSizeBinary(e){return e.byteWidth}visitFixedSizeList(e){return e.listSize*this.visitFields(e.children).reduce(Ns,0)}visitMap(e){return this.visitFields(e.children).reduce(Ns,0)}visitDictionary(e){return this.visit(e.indices)}visitFields(e){return(e||[]).map(t=>this.visit(t.type))}visitSchema(e){return this.visitFields(e.fields).reduce(Ns,0)}};ji.ByteWidthVisitor=yd;ji.instance=new yd});var nm=g(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.instance=qi.GetVectorConstructor=void 0;var e1=Xe(),t1=xl(),r1=Pl(),_d=Ll(),n1=kl(),i1=ja(),s1=jl(),o1=ql(),ec=Yl(),md=Gl(),Rr=Wa(),a1=rd(),c1=nd(),u1=id(),l1=sd(),Ls=od(),ks=ad(),bd=cd(),d1=ud(),gd=class extends e1.Visitor{visitNull(){return u1.NullVector}visitBool(){return r1.BoolVector}visitInt(){return Rr.IntVector}visitInt8(){return Rr.Int8Vector}visitInt16(){return Rr.Int16Vector}visitInt32(){return Rr.Int32Vector}visitInt64(){return Rr.Int64Vector}visitUint8(){return Rr.Uint8Vector}visitUint16(){return Rr.Uint16Vector}visitUint32(){return Rr.Uint32Vector}visitUint64(){return Rr.Uint64Vector}visitFloat(){return ec.FloatVector}visitFloat16(){return ec.Float16Vector}visitFloat32(){return ec.Float32Vector}visitFloat64(){return ec.Float64Vector}visitUtf8(){return d1.Utf8Vector}visitBinary(){return t1.BinaryVector}visitFixedSizeBinary(){return s1.FixedSizeBinaryVector}visitDate(){return _d.DateVector}visitDateDay(){return _d.DateDayVector}visitDateMillisecond(){return _d.DateMillisecondVector}visitTimestamp(){return Ls.TimestampVector}visitTimestampSecond(){return Ls.TimestampSecondVector}visitTimestampMillisecond(){return Ls.TimestampMillisecondVector}visitTimestampMicrosecond(){return Ls.TimestampMicrosecondVector}visitTimestampNanosecond(){return Ls.TimestampNanosecondVector}visitTime(){return ks.TimeVector}visitTimeSecond(){return ks.TimeSecondVector}visitTimeMillisecond(){return ks.TimeMillisecondVector}visitTimeMicrosecond(){return ks.TimeMicrosecondVector}visitTimeNanosecond(){return ks.TimeNanosecondVector}visitDecimal(){return n1.DecimalVector}visitList(){return a1.ListVector}visitStruct(){return l1.StructVector}visitUnion(){return bd.UnionVector}visitDenseUnion(){return bd.DenseUnionVector}visitSparseUnion(){return bd.SparseUnionVector}visitDictionary(){return i1.DictionaryVector}visitInterval(){return md.IntervalVector}visitIntervalDayTime(){return md.IntervalDayTimeVector}visitIntervalYearMonth(){return md.IntervalYearMonthVector}visitFixedSizeList(){return o1.FixedSizeListVector}visitMap(){return c1.MapVector}};qi.GetVectorConstructor=gd;qi.instance=new gd});var fr=g(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.vectorFromValuesWithType=w.StructRow=w.MapRow=w.Utf8Vector=w.SparseUnionVector=w.DenseUnionVector=w.UnionVector=w.TimeNanosecondVector=w.TimeMicrosecondVector=w.TimeMillisecondVector=w.TimeSecondVector=w.TimeVector=w.TimestampNanosecondVector=w.TimestampMicrosecondVector=w.TimestampMillisecondVector=w.TimestampSecondVector=w.TimestampVector=w.StructVector=w.NullVector=w.MapVector=w.ListVector=w.Uint64Vector=w.Uint32Vector=w.Uint16Vector=w.Uint8Vector=w.Int64Vector=w.Int32Vector=w.Int16Vector=w.Int8Vector=w.IntVector=w.IntervalYearMonthVector=w.IntervalDayTimeVector=w.IntervalVector=w.Float64Vector=w.Float32Vector=w.Float16Vector=w.FloatVector=w.FixedSizeListVector=w.FixedSizeBinaryVector=w.DictionaryVector=w.DecimalVector=w.DateMillisecondVector=w.DateDayVector=w.DateVector=w.Chunked=w.BoolVector=w.BinaryVector=w.BaseVector=w.Vector=void 0;var vd=et(),f1=Ve();Object.defineProperty(w,"Vector",{enumerable:!0,get:function(){return f1.Vector}});var h1=Pe();Object.defineProperty(w,"BaseVector",{enumerable:!0,get:function(){return h1.BaseVector}});var p1=xl();Object.defineProperty(w,"BinaryVector",{enumerable:!0,get:function(){return p1.BinaryVector}});var y1=Pl();Object.defineProperty(w,"BoolVector",{enumerable:!0,get:function(){return y1.BoolVector}});var _1=dn();Object.defineProperty(w,"Chunked",{enumerable:!0,get:function(){return _1.Chunked}});var wd=Ll();Object.defineProperty(w,"DateVector",{enumerable:!0,get:function(){return wd.DateVector}});Object.defineProperty(w,"DateDayVector",{enumerable:!0,get:function(){return wd.DateDayVector}});Object.defineProperty(w,"DateMillisecondVector",{enumerable:!0,get:function(){return wd.DateMillisecondVector}});var m1=kl();Object.defineProperty(w,"DecimalVector",{enumerable:!0,get:function(){return m1.DecimalVector}});var b1=ja();Object.defineProperty(w,"DictionaryVector",{enumerable:!0,get:function(){return b1.DictionaryVector}});var g1=jl();Object.defineProperty(w,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return g1.FixedSizeBinaryVector}});var v1=ql();Object.defineProperty(w,"FixedSizeListVector",{enumerable:!0,get:function(){return v1.FixedSizeListVector}});var tc=Yl();Object.defineProperty(w,"FloatVector",{enumerable:!0,get:function(){return tc.FloatVector}});Object.defineProperty(w,"Float16Vector",{enumerable:!0,get:function(){return tc.Float16Vector}});Object.defineProperty(w,"Float32Vector",{enumerable:!0,get:function(){return tc.Float32Vector}});Object.defineProperty(w,"Float64Vector",{enumerable:!0,get:function(){return tc.Float64Vector}});var Bd=Gl();Object.defineProperty(w,"IntervalVector",{enumerable:!0,get:function(){return Bd.IntervalVector}});Object.defineProperty(w,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Bd.IntervalDayTimeVector}});Object.defineProperty(w,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Bd.IntervalYearMonthVector}});var Vr=Wa();Object.defineProperty(w,"IntVector",{enumerable:!0,get:function(){return Vr.IntVector}});Object.defineProperty(w,"Int8Vector",{enumerable:!0,get:function(){return Vr.Int8Vector}});Object.defineProperty(w,"Int16Vector",{enumerable:!0,get:function(){return Vr.Int16Vector}});Object.defineProperty(w,"Int32Vector",{enumerable:!0,get:function(){return Vr.Int32Vector}});Object.defineProperty(w,"Int64Vector",{enumerable:!0,get:function(){return Vr.Int64Vector}});Object.defineProperty(w,"Uint8Vector",{enumerable:!0,get:function(){return Vr.Uint8Vector}});Object.defineProperty(w,"Uint16Vector",{enumerable:!0,get:function(){return Vr.Uint16Vector}});Object.defineProperty(w,"Uint32Vector",{enumerable:!0,get:function(){return Vr.Uint32Vector}});Object.defineProperty(w,"Uint64Vector",{enumerable:!0,get:function(){return Vr.Uint64Vector}});var w1=rd();Object.defineProperty(w,"ListVector",{enumerable:!0,get:function(){return w1.ListVector}});var B1=nd();Object.defineProperty(w,"MapVector",{enumerable:!0,get:function(){return B1.MapVector}});var I1=id();Object.defineProperty(w,"NullVector",{enumerable:!0,get:function(){return I1.NullVector}});var S1=sd();Object.defineProperty(w,"StructVector",{enumerable:!0,get:function(){return S1.StructVector}});var Cs=od();Object.defineProperty(w,"TimestampVector",{enumerable:!0,get:function(){return Cs.TimestampVector}});Object.defineProperty(w,"TimestampSecondVector",{enumerable:!0,get:function(){return Cs.TimestampSecondVector}});Object.defineProperty(w,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Cs.TimestampMillisecondVector}});Object.defineProperty(w,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Cs.TimestampMicrosecondVector}});Object.defineProperty(w,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Cs.TimestampNanosecondVector}});var js=ad();Object.defineProperty(w,"TimeVector",{enumerable:!0,get:function(){return js.TimeVector}});Object.defineProperty(w,"TimeSecondVector",{enumerable:!0,get:function(){return js.TimeSecondVector}});Object.defineProperty(w,"TimeMillisecondVector",{enumerable:!0,get:function(){return js.TimeMillisecondVector}});Object.defineProperty(w,"TimeMicrosecondVector",{enumerable:!0,get:function(){return js.TimeMicrosecondVector}});Object.defineProperty(w,"TimeNanosecondVector",{enumerable:!0,get:function(){return js.TimeNanosecondVector}});var Id=cd();Object.defineProperty(w,"UnionVector",{enumerable:!0,get:function(){return Id.UnionVector}});Object.defineProperty(w,"DenseUnionVector",{enumerable:!0,get:function(){return Id.DenseUnionVector}});Object.defineProperty(w,"SparseUnionVector",{enumerable:!0,get:function(){return Id.SparseUnionVector}});var T1=ud();Object.defineProperty(w,"Utf8Vector",{enumerable:!0,get:function(){return T1.Utf8Vector}});var im=Ss();Object.defineProperty(w,"MapRow",{enumerable:!0,get:function(){return im.MapRow}});Object.defineProperty(w,"StructRow",{enumerable:!0,get:function(){return im.StructRow}});var qs=U_(),Sd=be(),Hi=Ve(),sm=dn(),Xn=Pe(),A1=tr(),rc=tt(),om=De(),am=fd(),cm=Nu(),um=Z_(),lm=tm(),dm=hd(),fm=rm(),hm=nm();Hi.Vector.new=F1;Hi.Vector.from=O1;function F1(r,...e){return new(hm.instance.getVisitFn(r)())(r,...e)}function D1(r,e){if(rc.isIterable(e))return Hi.Vector.from({nullValues:[null,void 0],type:r(),values:e});if(rc.isAsyncIterable(e))return Hi.Vector.from({nullValues:[null,void 0],type:r(),values:e});let{values:t=[],type:n=r(),nullValues:i=[null,void 0]}=Object.assign({},e);return rc.isIterable(t)?Hi.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n})):Hi.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n}))}w.vectorFromValuesWithType=D1;function O1(r){let e=Object.assign({nullValues:[null,void 0]},r),{values:t=[]}=e,n=vd.__rest(e,["values"]);if(rc.isIterable(t)){let i=[...om.Builder.throughIterable(n)(t)];return i.length===1?i[0]:sm.Chunked.concat(i)}return(i=>vd.__awaiter(this,void 0,void 0,function*(){var s,o;let a=om.Builder.throughAsyncIterable(n);try{for(var c=vd.__asyncValues(a(t)),f;f=yield c.next(),!f.done;){let y=f.value;i.push(y)}}catch(y){s={error:y}}finally{try{f&&!f.done&&(o=c.return)&&(yield o.call(c))}finally{if(s)throw s.error}}return i.length===1?i[0]:sm.Chunked.concat(i)}))([])}Xn.BaseVector.prototype.get=function(e){return am.instance.visit(this,e)};Xn.BaseVector.prototype.set=function(e,t){return cm.instance.visit(this,e,t)};Xn.BaseVector.prototype.indexOf=function(e,t){return um.instance.visit(this,e,t)};Xn.BaseVector.prototype.toArray=function(){return lm.instance.visit(this)};Xn.BaseVector.prototype.getByteWidth=function(){return fm.instance.visit(this.type)};Xn.BaseVector.prototype[Symbol.iterator]=function(){return dm.instance.visit(this)};Xn.BaseVector.prototype._bindDataAccessors=R1;Object.keys(Sd.Type).map(r=>Sd.Type[r]).filter(r=>typeof r=="number").filter(r=>r!==Sd.Type.NONE).forEach(r=>{let e=hm.instance.visit(r);e.prototype.get=qs.partial1(am.instance.getVisitFn(r)),e.prototype.set=qs.partial2(cm.instance.getVisitFn(r)),e.prototype.indexOf=qs.partial2(um.instance.getVisitFn(r)),e.prototype.toArray=qs.partial0(lm.instance.getVisitFn(r)),e.prototype.getByteWidth=M1(fm.instance.getVisitFn(r)),e.prototype[Symbol.iterator]=qs.partial0(dm.instance.getVisitFn(r))});function M1(r){return function(){return r(this.type)}}function U1(r){return function(e){return this.isValid(e)?r.call(this,e):null}}function E1(r){return function(e,t){A1.setBool(this.nullBitmap,this.offset+e,t!=null)&&r.call(this,e,t)}}function R1(){let r=this.nullBitmap;r&&r.byteLength>0&&(this.get=U1(this.get),this.set=E1(this.set))}});var Vs=g(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.Table=void 0;var nc=et(),V1=Oi(),x1=Hs(),pm=Va(),Td=Er(),ym=Ge(),Ad=ce(),_m=Hn(),Fd=tt(),mm=El(),Dd=fr(),We=class extends Dd.Chunked{constructor(...e){var t;let n=null;e[0]instanceof ym.Schema&&(n=e[0]);let i=e[0]instanceof We?e[0].chunks:_m.selectArgs(Td.RecordBatch,e);if(!n&&!(n=(t=i[0])===null||t===void 0?void 0:t.schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");i[0]||(i[0]=new Td._InternalEmptyPlaceholderRecordBatch(n));super(new Ad.Struct(n.fields),i);this._schema=n,this._chunks=i}static empty(e=new ym.Schema([])){return new We(e,[])}static from(e){if(!e)return We.empty();if(typeof e=="object"){let n=Fd.isIterable(e.values)?P1(e):Fd.isAsyncIterable(e.values)?N1(e):null;if(n!==null)return n}let t=x1.RecordBatchReader.from(e);return Fd.isPromise(t)?(()=>nc.__awaiter(this,void 0,void 0,function*(){return yield We.from(yield t)}))():t.isSync()&&(t=t.open())?t.schema?new We(t.schema,[...t]):We.empty():(n=>nc.__awaiter(this,void 0,void 0,function*(){var i,s;let o=yield n,a=o.schema,c=[];if(a){try{for(var f=nc.__asyncValues(o),y;y=yield f.next(),!y.done;){let B=y.value;c.push(B)}}catch(B){i={error:B}}finally{try{y&&!y.done&&(s=f.return)&&(yield s.call(f))}finally{if(i)throw i.error}}return new We(a,c)}return We.empty()}))(t.open())}static fromAsync(e){return nc.__awaiter(this,void 0,void 0,function*(){return yield We.from(e)})}static fromStruct(e){return We.new(e.data.childData,e.type.children)}static new(...e){return new We(...mm.distributeColumnsIntoRecordBatches(_m.selectColumnArgs(e)))}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(e=this._chunks){return new We(this._schema,e)}getColumn(e){return this.getColumnAt(this.getColumnIndex(e))}getColumnAt(e){return this.getChildAt(e)}getColumnIndex(e){return this._schema.fields.findIndex(t=>t.name===e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t,n,i=this._schema.fields,s=this._children||(this._children=[]);if(n=s[e])return n;if(t=i[e]){let o=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null);if(o.length>0)return s[e]=new V1.Column(t,o)}return null}serialize(e="binary",t=!0){return(t?pm.RecordBatchStreamWriter:pm.RecordBatchFileWriter).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e);return new We(t,this._chunks.map(({length:n,data:{childData:i}})=>new Td.RecordBatch(t,n,e.map(s=>i[s]).filter(Boolean))))}assign(e){let t=this._schema.fields,[n,i]=e.schema.fields.reduce((a,c,f)=>{let[y,B]=a,D=t.findIndex(A=>A.name===c.name);return~D?B[D]=f:y.push(f),a},[[],[]]),s=this._schema.assign(e.schema),o=[...t.map((a,c,f,y=i[c])=>y===void 0?this.getColumnAt(c):e.getColumnAt(y)),...n.map(a=>e.getColumnAt(a))].filter(Boolean);return new We(...mm.distributeVectorsIntoRecordBatches(s,o))}};ic.Table=We;function P1(r){let{type:e}=r;return e instanceof Ad.Struct?We.fromStruct(Dd.StructVector.from(r)):null}function N1(r){let{type:e}=r;return e instanceof Ad.Struct?Dd.StructVector.from(r).then(t=>We.fromStruct(t)):null}});var Er=g(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi._InternalEmptyPlaceholderRecordBatch=zi.RecordBatch=void 0;var Od=jt(),Md=Vs(),L1=Ve(),k1=Xe(),C1=Ge(),j1=tt(),q1=dn(),H1=Hn(),Ud=ce(),z1=El(),W1=fr(),wn=class extends W1.StructVector{constructor(...e){let t,n=e[0],i;if(e[1]instanceof Od.Data)[,t,i]=e;else{let s=n.fields,[,o,a]=e;t=Od.Data.Struct(new Ud.Struct(s),0,o,0,null,a)}super(t,i);this._schema=n}static from(e){return j1.isIterable(e.values),Md.Table.from(e)}static new(...e){let[t,n]=H1.selectFieldArgs(e),i=n.filter(s=>s instanceof L1.Vector);return new wn(...z1.ensureSameLengthData(new C1.Schema(t),i.map(s=>s.data)))}clone(e,t=this._children){return new wn(this._schema,e,t)}concat(...e){let t=this._schema,n=q1.Chunked.flatten(this,...e);return new Md.Table(t,n.map(({data:i})=>new wn(t,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=sc.collect(this))}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e),n=e.map(i=>this.data.childData[i]).filter(Boolean);return new wn(t,this.length,n)}};zi.RecordBatch=wn;var bm=class extends wn{constructor(e){super(e,0,e.fields.map(t=>Od.Data.new(t.type,0,0,0)))}};zi._InternalEmptyPlaceholderRecordBatch=bm;var sc=class extends k1.Visitor{constructor(){super(...arguments);this.dictionaries=new Map}static collect(e){return new sc().visit(e.data,new Ud.Struct(e.schema.fields)).dictionaries}visit(e,t){return Ud.DataType.isDictionary(t)?this.visitDictionary(e,t):(e.childData.forEach((n,i)=>this.visit(n,t.children[i].type)),this)}visitDictionary(e,t){let n=e.dictionary;return n&&n.length>0&&this.dictionaries.set(t.id,n),this}}});var Hs=g(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.AsyncRecordBatchFileReader=Vt.RecordBatchFileReader=Vt.AsyncRecordBatchStreamReader=Vt.RecordBatchStreamReader=Vt.RecordBatchReader=void 0;var we=et(),gm=Ve(),oc=be(),vm=$u(),wm=fs(),Bm=an(),zs=Xu(),Im=ty(),Ed=Er(),Zn=ri(),Et=Ia(),Rt=tt(),_r=class extends Zn.ReadableInterop{constructor(e){super();this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return Rt.isPromise(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return wm.default.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return wm.default.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof _r?e:Rt.isArrowJSON(e)?Y1(e):Rt.isFileHandle(e)?K1(e):Rt.isPromise(e)?(()=>we.__awaiter(this,void 0,void 0,function*(){return yield _r.from(yield e)}))():Rt.isFetchResponse(e)||Rt.isReadableDOMStream(e)||Rt.isReadableNodeStream(e)||Rt.isAsyncIterable(e)?$1(new Bm.AsyncByteStream(e)):G1(new Bm.ByteStream(e))}static readAll(e){return e instanceof _r?e.isSync()?Fm(e):Dm(e):Rt.isArrowJSON(e)||ArrayBuffer.isView(e)||Rt.isIterable(e)||Rt.isIteratorResult(e)?Fm(e):Dm(e)}};Vt.RecordBatchReader=_r;var Wi=class extends _r{constructor(e){super(e);this._impl=e}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return we.__asyncGenerator(this,arguments,function*(){yield we.__await(yield*we.__asyncDelegator(we.__asyncValues(this[Symbol.iterator]())))})}};Vt.RecordBatchStreamReader=Wi;var Yi=class extends _r{constructor(e){super(e);this._impl=e}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}};Vt.AsyncRecordBatchStreamReader=Yi;var ac=class extends Wi{constructor(e){super(e);this._impl=e}};Vt.RecordBatchFileReader=ac;var Rd=class extends Yi{constructor(e){super(e);this._impl=e}};Vt.AsyncRecordBatchFileReader=Rd;var Vd=class{constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){return new Ed.RecordBatch(this.schema,e.length,this._loadVectors(e,t,this.schema.fields))}_loadDictionaryBatch(e,t){let{id:n,isDelta:i,data:s}=e,{dictionaries:o,schema:a}=this,c=o.get(n);if(i||!c){let f=a.dictionaries.get(n);return c&&i?c.concat(gm.Vector.new(this._loadVectors(s,t,[f])[0])):gm.Vector.new(this._loadVectors(s,t,[f])[0])}return c}_loadVectors(e,t,n){return new Im.VectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}},Ws=class extends Vd{constructor(e,t){super(t);this._reader=Rt.isArrowJSON(e)?new Et.JSONMessageReader(this._handle=e):new Et.MessageReader(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Am(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Zn.ITERATOR_DONE}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Zn.ITERATOR_DONE}next(){if(this.closed)return Zn.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ed._InternalEmptyPlaceholderRecordBatch(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Ys=class extends Vd{constructor(e,t){super(t);this._reader=new Et.AsyncMessageReader(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return we.__awaiter(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return we.__awaiter(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Am(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return we.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Zn.ITERATOR_DONE})}return(e){return we.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Zn.ITERATOR_DONE})}next(){return we.__awaiter(this,void 0,void 0,function*(){if(this.closed)return Zn.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ed._InternalEmptyPlaceholderRecordBatch(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return we.__awaiter(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},xd=class extends Ws{constructor(e,t){super(e instanceof zs.RandomAccessFile?e:new zs.RandomAccessFile(e),t)}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(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){if(this.closed)return null;this._footer||this.open();let t=this._footer&&this._footer.getRecordBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(oc.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null}_readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(oc.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength),o=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,o)}}}_readFooter(){let{_handle:e}=this,t=e.size-Et.magicAndPadding,n=e.readInt32(t),i=e.readAt(t-n,n);return vm.Footer.decode(i)}_readNextMessageAndValidate(e){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(t&&this._handle.seek(t.offset))return this._reader.readMessage(e)}return null}},Sm=class extends Ys{constructor(e,...t){let n=typeof t[0]!="number"?t.shift():void 0,i=t[0]instanceof Map?t.shift():void 0;super(e instanceof zs.AsyncRandomAccessFile?e:new zs.AsyncRandomAccessFile(e,n),i)}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(e){let t=Object.create(null,{open:{get:()=>super.open}});return we.__awaiter(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return we.__awaiter(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let t=this._footer&&this._footer.getRecordBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(oc.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null})}_readDictionaryBatch(e){return we.__awaiter(this,void 0,void 0,function*(){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(oc.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength),o=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,o)}}})}_readFooter(){return we.__awaiter(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Et.magicAndPadding,n=yield e.readInt32(t),i=yield e.readAt(t-n,n);return vm.Footer.decode(i)})}_readNextMessageAndValidate(e){return we.__awaiter(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},Tm=class extends Ws{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new Im.JSONVectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}};function Am(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*Fm(r){let e=_r.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function Dm(r){return we.__asyncGenerator(this,arguments,function*(){let t=yield we.__await(_r.from(r));try{if(!(yield we.__await(t.open({autoDestroy:!1}))).closed)do yield yield we.__await(t);while(!(yield we.__await(t.reset().open())).closed)}finally{yield we.__await(t.cancel())}})}function Y1(r){return new Wi(new Tm(r))}function G1(r){let e=r.peek(Et.magicLength+7&~7);return e&&e.byteLength>=4?Et.checkForMagicArrowString(e)?new ac(new xd(r.read())):new Wi(new Ws(r)):new Wi(new Ws(function*(){}()))}function $1(r){return we.__awaiter(this,void 0,void 0,function*(){let e=yield r.peek(Et.magicLength+7&~7);return e&&e.byteLength>=4?Et.checkForMagicArrowString(e)?new ac(new xd(yield r.read())):new Yi(new Ys(r)):new Yi(new Ys(function(){return we.__asyncGenerator(this,arguments,function*(){})}()))})}function K1(r){return we.__awaiter(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new zs.AsyncRandomAccessFile(r,e);return e>=Et.magicX2AndPadding&&Et.checkForMagicArrowString(yield t.readAt(0,Et.magicLength+7&~7))?new Rd(new Sm(t)):new Yi(new Ys(t))})}});var Um=g(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.toDOMStream=void 0;var cc=et(),Om=qe(),Mm=tt();function J1(r,e){if(Mm.isAsyncIterable(r))return Z1(r,e);if(Mm.isIterable(r))return X1(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}uc.toDOMStream=J1;function X1(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){s(o,t||(t=r[Symbol.iterator]()))},pull(o){t?s(o,t):o.close()},cancel(){((t==null?void 0:t.return)&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:n?i:void 0},e));function s(o,a){let c,f=null,y=o.desiredSize||null;for(;!(f=a.next(n?y:null)).done;)if(ArrayBuffer.isView(f.value)&&(c=Om.toUint8Array(f.value))&&(y!=null&&n&&(y=y-c.byteLength+1),f.value=c),o.enqueue(f.value),y!=null&&--y<=0)return;o.close()}}function Z1(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return cc.__awaiter(this,void 0,void 0,function*(){yield s(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return cc.__awaiter(this,void 0,void 0,function*(){t?yield s(o,t):o.close()})},cancel(){return cc.__awaiter(this,void 0,void 0,function*(){((t==null?void 0:t.return)&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:n?i:void 0},e));function s(o,a){return cc.__awaiter(this,void 0,void 0,function*(){let c,f=null,y=o.desiredSize||null;for(;!(f=yield a.next(n?y:null)).done;)if(ArrayBuffer.isView(f.value)&&(c=Om.toUint8Array(f.value))&&(y!=null&&n&&(y=y-c.byteLength+1),f.value=c),o.enqueue(f.value),y!=null&&--y<=0)return;o.close()})}}});var Vm=g(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.BuilderTransform=Gi.builderThroughDOMStream=void 0;var Q1=et(),eA=ua();function tA(r){return new Pd(r)}Gi.builderThroughDOMStream=tA;var Pd=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=e,s=Q1.__rest(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=eA.Builder.new(s),this._getSize=i!=="bytes"?Em:Rm;let{["highWaterMark"]:o=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:i!=="bytes"?Em:Rm}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!==null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t===null?e.close():e.enqueue(t)}};Gi.BuilderTransform=Pd;var Em=r=>r.length,Rm=r=>r.byteLength});var xm=g(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.recordBatchReaderThroughDOMStream=void 0;var Gs=et(),rA=an(),nA=Hs();function iA(r,e){let t=new rA.AsyncByteQueue,n=null,i=new ReadableStream({cancel(){return Gs.__awaiter(this,void 0,void 0,function*(){yield t.close()})},start(a){return Gs.__awaiter(this,void 0,void 0,function*(){yield o(a,n||(n=yield s()))})},pull(a){return Gs.__awaiter(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:i};function s(){return Gs.__awaiter(this,void 0,void 0,function*(){return yield(yield nA.RecordBatchReader.from(t)).open(e)})}function o(a,c){return Gs.__awaiter(this,void 0,void 0,function*(){let f=a.desiredSize,y=null;for(;!(y=yield c.next()).done;)if(a.enqueue(y.value),f!=null&&--f<=0)return;a.close()})}}lc.recordBatchReaderThroughDOMStream=iA});var Pm=g(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.recordBatchWriterThroughDOMStream=void 0;var dc=et(),sA=an();function oA(r,e){let t=new this(r),n=new sA.AsyncByteStream(t),i=new ReadableStream({type:"bytes",cancel(){return dc.__awaiter(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return dc.__awaiter(this,void 0,void 0,function*(){yield s(o)})},start(o){return dc.__awaiter(this,void 0,void 0,function*(){yield s(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:i};function s(o){return dc.__awaiter(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}fc.recordBatchWriterThroughDOMStream=oA});var qd=g(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.custom=ie.or=ie.and=ie.col=ie.lit=ie.CustomPredicate=ie.Not=ie.GTeq=ie.LTeq=ie.Equals=ie.Or=ie.And=ie.CombinationPredicate=ie.ComparisonPredicate=ie.Predicate=ie.Col=ie.Literal=ie.Value=void 0;var aA=ja(),Bn=class{eq(e){return e instanceof Bn||(e=new xr(e)),new Ld(this,e)}le(e){return e instanceof Bn||(e=new xr(e)),new kd(this,e)}ge(e){return e instanceof Bn||(e=new xr(e)),new Cd(this,e)}lt(e){return new Xi(this.ge(e))}gt(e){return new Xi(this.le(e))}ne(e){return new Xi(this.eq(e))}};ie.Value=Bn;var xr=class extends Bn{constructor(e){super();this.v=e}};ie.Literal=xr;var Nd=class extends Bn{constructor(e){super();this.name=e}bind(e){if(!this.colidx){this.colidx=-1;let n=e.schema.fields;for(let i=-1;++i<n.length;)if(n[i].name===this.name){this.colidx=i;break}if(this.colidx<0)throw new Error(`Failed to bind Col "${this.name}"`)}let t=this.vector=e.getChildAt(this.colidx);return n=>t.get(n)}};ie.Col=Nd;var $i=class{and(...e){return new Ki(this,...e)}or(...e){return new Ji(this,...e)}not(){return new Xi(this)}};ie.Predicate=$i;var $s=class extends $i{constructor(e,t){super();this.left=e,this.right=t}bind(e){return this.left instanceof xr?this.right instanceof xr?this._bindLitLit(e,this.left,this.right):this._bindLitCol(e,this.left,this.right):this.right instanceof xr?this._bindColLit(e,this.left,this.right):this._bindColCol(e,this.left,this.right)}};ie.ComparisonPredicate=$s;var Ks=class extends $i{constructor(...e){super();this.children=e}};ie.CombinationPredicate=Ks;Ks.prototype.children=Object.freeze([]);var Ki=class extends Ks{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof Ki?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.every(s=>s(n,i))}};ie.And=Ki;var Ji=class extends Ks{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof Ji?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.some(s=>s(n,i))}};ie.Or=Ji;var Ld=class extends $s{_bindLitLit(e,t,n){let i=t.v==n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(o,a)=>i(o,a)==s(o,a)}_bindColLit(e,t,n){let i=t.bind(e);if(t.vector instanceof aA.DictionaryVector){let s,o=t.vector;return o.dictionary!==this.lastDictionary?(s=o.reverseLookup(n.v),this.lastDictionary=o.dictionary,this.lastKey=s):s=this.lastKey,s===-1?()=>!1:a=>o.getKey(a)===s}else return(s,o)=>i(s,o)==n.v}_bindLitCol(e,t,n){return this._bindColLit(e,n,t)}};ie.Equals=Ld;var kd=class extends $s{_bindLitLit(e,t,n){let i=t.v<=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(o,a)=>i(o,a)<=s(o,a)}_bindColLit(e,t,n){let i=t.bind(e);return(s,o)=>i(s,o)<=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,o)=>t.v<=i(s,o)}};ie.LTeq=kd;var Cd=class extends $s{_bindLitLit(e,t,n){let i=t.v>=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(o,a)=>i(o,a)>=s(o,a)}_bindColLit(e,t,n){let i=t.bind(e);return(s,o)=>i(s,o)>=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,o)=>t.v>=i(s,o)}};ie.GTeq=Cd;var Xi=class extends $i{constructor(e){super();this.child=e}bind(e){let t=this.child.bind(e);return(n,i)=>!t(n,i)}};ie.Not=Xi;var jd=class extends $i{constructor(e,t){super();this.next=e,this.bind_=t}bind(e){return this.bind_(e),this.next}};ie.CustomPredicate=jd;function cA(r){return new xr(r)}ie.lit=cA;function uA(r){return new Nd(r)}ie.col=uA;function lA(...r){return new Ki(...r)}ie.and=lA;function dA(...r){return new Ji(...r)}ie.or=dA;function fA(r,e){return new jd(r,e)}ie.custom=fA});var qm=g(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.FilteredDataFrame=In.CountByResult=In.DataFrame=void 0;var Nm=Vs(),Lm=Wa(),Hd=Ge(),km=qd(),hA=Er(),Cm=ce(),zd=class extends Nm.Table{filter(e){return new Js(this.chunks,e)}scan(e,t){let n=this.chunks,i=n.length;for(let s=-1;++s<i;){let o=n[s];t&&t(o);for(let a=-1,c=o.length;++a<c;)e(a,o)}}scanReverse(e,t){let n=this.chunks,i=n.length;for(let s=i;--s>=0;){let o=n[s];t&&t(o);for(let a=o.length;--a>=0;)e(a,o)}}countBy(e){let t=this.chunks,n=t.length,i=typeof e=="string"?new km.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!Cm.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let o=Math.ceil(Math.log(s.length)/Math.log(256)),a=o==4?Uint32Array:o>=2?Uint16Array:Uint8Array,c=new a(s.dictionary.length);for(let f=-1;++f<n;){let y=t[f];i.bind(y);let B=i.vector.indices;for(let D=-1,A=y.length;++D<A;){let J=B.get(D);J!==null&&c[J]++}}return new hc(s.dictionary,Lm.IntVector.from(c))}};In.DataFrame=zd;var hc=class extends Nm.Table{constructor(e,t){let n=new Hd.Schema([new Hd.Field("values",e.type),new Hd.Field("counts",t.type)]);super(new hA.RecordBatch(n,t.length,[e,t]))}toJSON(){let e=this.getColumnAt(0),t=this.getColumnAt(1),n={};for(let i=-1;++i<this.length;)n[e.get(i)]=t.get(i);return n}};In.CountByResult=hc;var jm=class{constructor(e,t){this.batches=e,this.predicate=t,this.batchIndex=0,this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch)}next(){for(;this.batchIndex<this.batches.length;){for(;this.index<this.batch.length;){if(this.predicateFunc(this.index,this.batch))return{value:this.batch.get(this.index++)};this.index++}++this.batchIndex<this.batches.length&&(this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch))}return{done:!0,value:null}}[Symbol.iterator](){return this}},Js=class extends zd{constructor(e,t){super(e);this._predicate=t}scan(e,t){let n=this._chunks,i=n.length;for(let s=-1;++s<i;){let o=n[s],a=this._predicate.bind(o),c=!1;for(let f=-1,y=o.length;++f<y;)a(f,o)&&(t&&!c&&(t(o),c=!0),e(f,o))}}scanReverse(e,t){let n=this._chunks,i=n.length;for(let s=i;--s>=0;){let o=n[s],a=this._predicate.bind(o),c=!1;for(let f=o.length;--f>=0;)a(f,o)&&(t&&!c&&(t(o),c=!0),e(f,o))}}count(){let e=0,t=this._chunks,n=t.length;for(let i=-1;++i<n;){let s=t[i],o=this._predicate.bind(s);for(let a=-1,c=s.length;++a<c;)o(a,s)&&++e}return e}[Symbol.iterator](){return new jm(this._chunks,this._predicate)}filter(e){return new Js(this._chunks,this._predicate.and(e))}countBy(e){let t=this._chunks,n=t.length,i=typeof e=="string"?new km.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!Cm.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let o=Math.ceil(Math.log(s.length)/Math.log(256)),a=o==4?Uint32Array:o>=2?Uint16Array:Uint8Array,c=new a(s.dictionary.length);for(let f=-1;++f<n;){let y=t[f],B=this._predicate.bind(y);i.bind(y);let D=i.vector.indices;for(let A=-1,J=y.length;++A<J;){let te=D.get(A);te!==null&&B(A,y)&&c[te]++}}return new hc(s.dictionary,Lm.IntVector.from(c))}};In.FilteredDataFrame=Js});var Wm=g(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.isTypedArray=l.util=l.predicate=l.CountByResult=l.FilteredDataFrame=l.DataFrame=l.RecordBatch=l.Message=l.JSONMessageReader=l.AsyncMessageReader=l.MessageReader=l.RecordBatchJSONWriter=l.RecordBatchStreamWriter=l.RecordBatchFileWriter=l.RecordBatchWriter=l.AsyncRecordBatchStreamReader=l.AsyncRecordBatchFileReader=l.RecordBatchStreamReader=l.RecordBatchFileReader=l.RecordBatchReader=l.AsyncByteQueue=l.AsyncByteStream=l.ByteStream=l.Utf8Builder=l.SparseUnionBuilder=l.DenseUnionBuilder=l.UnionBuilder=l.TimeNanosecondBuilder=l.TimeMicrosecondBuilder=l.TimeMillisecondBuilder=l.TimeSecondBuilder=l.TimeBuilder=l.TimestampNanosecondBuilder=l.TimestampMicrosecondBuilder=l.TimestampMillisecondBuilder=l.TimestampSecondBuilder=l.TimestampBuilder=l.StructBuilder=l.NullBuilder=l.MapBuilder=l.ListBuilder=l.Uint64Builder=l.Uint32Builder=l.Uint16Builder=l.Uint8Builder=l.Int64Builder=l.Int32Builder=l.Int16Builder=l.Int8Builder=l.IntBuilder=l.IntervalYearMonthBuilder=l.IntervalDayTimeBuilder=l.IntervalBuilder=l.Float64Builder=l.Float32Builder=l.Float16Builder=l.FloatBuilder=l.FixedSizeListBuilder=l.FixedSizeBinaryBuilder=l.DictionaryBuilder=l.DecimalBuilder=l.DateMillisecondBuilder=l.DateDayBuilder=l.DateBuilder=l.BoolBuilder=l.BinaryBuilder=l.Builder=l.Utf8Vector=l.SparseUnionVector=l.DenseUnionVector=l.UnionVector=l.TimeNanosecondVector=l.TimeMicrosecondVector=l.TimeMillisecondVector=l.TimeSecondVector=l.TimeVector=l.TimestampNanosecondVector=l.TimestampMicrosecondVector=l.TimestampMillisecondVector=l.TimestampSecondVector=l.TimestampVector=l.StructVector=l.NullVector=l.MapVector=l.ListVector=l.Uint64Vector=l.Uint32Vector=l.Uint16Vector=l.Uint8Vector=l.Int64Vector=l.Int32Vector=l.Int16Vector=l.Int8Vector=l.IntVector=l.IntervalYearMonthVector=l.IntervalDayTimeVector=l.IntervalVector=l.Float64Vector=l.Float32Vector=l.Float16Vector=l.FloatVector=l.FixedSizeListVector=l.FixedSizeBinaryVector=l.DictionaryVector=l.DecimalVector=l.DateMillisecondVector=l.DateDayVector=l.DateVector=l.Chunked=l.BoolVector=l.BinaryVector=l.BaseVector=l.Vector=l.Field=l.Schema=l.Visitor=l.Column=l.Table=l.Map_=l.FixedSizeList=l.IntervalYearMonth=l.IntervalDayTime=l.Interval=l.Dictionary=l.SparseUnion=l.DenseUnion=l.Union=l.Struct=l.List=l.Decimal=l.TimeNanosecond=l.TimeMicrosecond=l.TimeMillisecond=l.TimeSecond=l.Time=l.TimestampNanosecond=l.TimestampMicrosecond=l.TimestampMillisecond=l.TimestampSecond=l.Timestamp=l.DateMillisecond=l.DateDay=l.Date_=l.FixedSizeBinary=l.Binary=l.Utf8=l.Float64=l.Float32=l.Float16=l.Float=l.Uint64=l.Uint32=l.Uint16=l.Uint8=l.Int64=l.Int32=l.Int16=l.Int8=l.Int=l.Bool=l.Null=l.DataType=l.Data=l.BufferType=l.Type=l.MessageHeader=l.MetadataVersion=l.IntervalUnit=l.UnionMode=l.Precision=l.TimeUnit=l.DateUnit=void 0;var Zi=Gr();Object.defineProperty(l,"DateUnit",{enumerable:!0,get:function(){return Zi.DateUnit}});Object.defineProperty(l,"TimeUnit",{enumerable:!0,get:function(){return Zi.TimeUnit}});Object.defineProperty(l,"Precision",{enumerable:!0,get:function(){return Zi.Precision}});Object.defineProperty(l,"UnionMode",{enumerable:!0,get:function(){return Zi.UnionMode}});Object.defineProperty(l,"IntervalUnit",{enumerable:!0,get:function(){return Zi.IntervalUnit}});Object.defineProperty(l,"MetadataVersion",{enumerable:!0,get:function(){return Zi.MetadataVersion}});var pA=Io();Object.defineProperty(l,"MessageHeader",{enumerable:!0,get:function(){return pA.MessageHeader}});var Hm=be();Object.defineProperty(l,"Type",{enumerable:!0,get:function(){return Hm.Type}});Object.defineProperty(l,"BufferType",{enumerable:!0,get:function(){return Hm.BufferType}});var yA=jt();Object.defineProperty(l,"Data",{enumerable:!0,get:function(){return yA.Data}});var X=ce();Object.defineProperty(l,"DataType",{enumerable:!0,get:function(){return X.DataType}});Object.defineProperty(l,"Null",{enumerable:!0,get:function(){return X.Null}});Object.defineProperty(l,"Bool",{enumerable:!0,get:function(){return X.Bool}});Object.defineProperty(l,"Int",{enumerable:!0,get:function(){return X.Int}});Object.defineProperty(l,"Int8",{enumerable:!0,get:function(){return X.Int8}});Object.defineProperty(l,"Int16",{enumerable:!0,get:function(){return X.Int16}});Object.defineProperty(l,"Int32",{enumerable:!0,get:function(){return X.Int32}});Object.defineProperty(l,"Int64",{enumerable:!0,get:function(){return X.Int64}});Object.defineProperty(l,"Uint8",{enumerable:!0,get:function(){return X.Uint8}});Object.defineProperty(l,"Uint16",{enumerable:!0,get:function(){return X.Uint16}});Object.defineProperty(l,"Uint32",{enumerable:!0,get:function(){return X.Uint32}});Object.defineProperty(l,"Uint64",{enumerable:!0,get:function(){return X.Uint64}});Object.defineProperty(l,"Float",{enumerable:!0,get:function(){return X.Float}});Object.defineProperty(l,"Float16",{enumerable:!0,get:function(){return X.Float16}});Object.defineProperty(l,"Float32",{enumerable:!0,get:function(){return X.Float32}});Object.defineProperty(l,"Float64",{enumerable:!0,get:function(){return X.Float64}});Object.defineProperty(l,"Utf8",{enumerable:!0,get:function(){return X.Utf8}});Object.defineProperty(l,"Binary",{enumerable:!0,get:function(){return X.Binary}});Object.defineProperty(l,"FixedSizeBinary",{enumerable:!0,get:function(){return X.FixedSizeBinary}});Object.defineProperty(l,"Date_",{enumerable:!0,get:function(){return X.Date_}});Object.defineProperty(l,"DateDay",{enumerable:!0,get:function(){return X.DateDay}});Object.defineProperty(l,"DateMillisecond",{enumerable:!0,get:function(){return X.DateMillisecond}});Object.defineProperty(l,"Timestamp",{enumerable:!0,get:function(){return X.Timestamp}});Object.defineProperty(l,"TimestampSecond",{enumerable:!0,get:function(){return X.TimestampSecond}});Object.defineProperty(l,"TimestampMillisecond",{enumerable:!0,get:function(){return X.TimestampMillisecond}});Object.defineProperty(l,"TimestampMicrosecond",{enumerable:!0,get:function(){return X.TimestampMicrosecond}});Object.defineProperty(l,"TimestampNanosecond",{enumerable:!0,get:function(){return X.TimestampNanosecond}});Object.defineProperty(l,"Time",{enumerable:!0,get:function(){return X.Time}});Object.defineProperty(l,"TimeSecond",{enumerable:!0,get:function(){return X.TimeSecond}});Object.defineProperty(l,"TimeMillisecond",{enumerable:!0,get:function(){return X.TimeMillisecond}});Object.defineProperty(l,"TimeMicrosecond",{enumerable:!0,get:function(){return X.TimeMicrosecond}});Object.defineProperty(l,"TimeNanosecond",{enumerable:!0,get:function(){return X.TimeNanosecond}});Object.defineProperty(l,"Decimal",{enumerable:!0,get:function(){return X.Decimal}});Object.defineProperty(l,"List",{enumerable:!0,get:function(){return X.List}});Object.defineProperty(l,"Struct",{enumerable:!0,get:function(){return X.Struct}});Object.defineProperty(l,"Union",{enumerable:!0,get:function(){return X.Union}});Object.defineProperty(l,"DenseUnion",{enumerable:!0,get:function(){return X.DenseUnion}});Object.defineProperty(l,"SparseUnion",{enumerable:!0,get:function(){return X.SparseUnion}});Object.defineProperty(l,"Dictionary",{enumerable:!0,get:function(){return X.Dictionary}});Object.defineProperty(l,"Interval",{enumerable:!0,get:function(){return X.Interval}});Object.defineProperty(l,"IntervalDayTime",{enumerable:!0,get:function(){return X.IntervalDayTime}});Object.defineProperty(l,"IntervalYearMonth",{enumerable:!0,get:function(){return X.IntervalYearMonth}});Object.defineProperty(l,"FixedSizeList",{enumerable:!0,get:function(){return X.FixedSizeList}});Object.defineProperty(l,"Map_",{enumerable:!0,get:function(){return X.Map_}});var _A=Vs();Object.defineProperty(l,"Table",{enumerable:!0,get:function(){return _A.Table}});var mA=Oi();Object.defineProperty(l,"Column",{enumerable:!0,get:function(){return mA.Column}});var bA=Xe();Object.defineProperty(l,"Visitor",{enumerable:!0,get:function(){return bA.Visitor}});var zm=Ge();Object.defineProperty(l,"Schema",{enumerable:!0,get:function(){return zm.Schema}});Object.defineProperty(l,"Field",{enumerable:!0,get:function(){return zm.Field}});var Y=fr();Object.defineProperty(l,"Vector",{enumerable:!0,get:function(){return Y.Vector}});Object.defineProperty(l,"BaseVector",{enumerable:!0,get:function(){return Y.BaseVector}});Object.defineProperty(l,"BinaryVector",{enumerable:!0,get:function(){return Y.BinaryVector}});Object.defineProperty(l,"BoolVector",{enumerable:!0,get:function(){return Y.BoolVector}});Object.defineProperty(l,"Chunked",{enumerable:!0,get:function(){return Y.Chunked}});Object.defineProperty(l,"DateVector",{enumerable:!0,get:function(){return Y.DateVector}});Object.defineProperty(l,"DateDayVector",{enumerable:!0,get:function(){return Y.DateDayVector}});Object.defineProperty(l,"DateMillisecondVector",{enumerable:!0,get:function(){return Y.DateMillisecondVector}});Object.defineProperty(l,"DecimalVector",{enumerable:!0,get:function(){return Y.DecimalVector}});Object.defineProperty(l,"DictionaryVector",{enumerable:!0,get:function(){return Y.DictionaryVector}});Object.defineProperty(l,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return Y.FixedSizeBinaryVector}});Object.defineProperty(l,"FixedSizeListVector",{enumerable:!0,get:function(){return Y.FixedSizeListVector}});Object.defineProperty(l,"FloatVector",{enumerable:!0,get:function(){return Y.FloatVector}});Object.defineProperty(l,"Float16Vector",{enumerable:!0,get:function(){return Y.Float16Vector}});Object.defineProperty(l,"Float32Vector",{enumerable:!0,get:function(){return Y.Float32Vector}});Object.defineProperty(l,"Float64Vector",{enumerable:!0,get:function(){return Y.Float64Vector}});Object.defineProperty(l,"IntervalVector",{enumerable:!0,get:function(){return Y.IntervalVector}});Object.defineProperty(l,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Y.IntervalDayTimeVector}});Object.defineProperty(l,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Y.IntervalYearMonthVector}});Object.defineProperty(l,"IntVector",{enumerable:!0,get:function(){return Y.IntVector}});Object.defineProperty(l,"Int8Vector",{enumerable:!0,get:function(){return Y.Int8Vector}});Object.defineProperty(l,"Int16Vector",{enumerable:!0,get:function(){return Y.Int16Vector}});Object.defineProperty(l,"Int32Vector",{enumerable:!0,get:function(){return Y.Int32Vector}});Object.defineProperty(l,"Int64Vector",{enumerable:!0,get:function(){return Y.Int64Vector}});Object.defineProperty(l,"Uint8Vector",{enumerable:!0,get:function(){return Y.Uint8Vector}});Object.defineProperty(l,"Uint16Vector",{enumerable:!0,get:function(){return Y.Uint16Vector}});Object.defineProperty(l,"Uint32Vector",{enumerable:!0,get:function(){return Y.Uint32Vector}});Object.defineProperty(l,"Uint64Vector",{enumerable:!0,get:function(){return Y.Uint64Vector}});Object.defineProperty(l,"ListVector",{enumerable:!0,get:function(){return Y.ListVector}});Object.defineProperty(l,"MapVector",{enumerable:!0,get:function(){return Y.MapVector}});Object.defineProperty(l,"NullVector",{enumerable:!0,get:function(){return Y.NullVector}});Object.defineProperty(l,"StructVector",{enumerable:!0,get:function(){return Y.StructVector}});Object.defineProperty(l,"TimestampVector",{enumerable:!0,get:function(){return Y.TimestampVector}});Object.defineProperty(l,"TimestampSecondVector",{enumerable:!0,get:function(){return Y.TimestampSecondVector}});Object.defineProperty(l,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Y.TimestampMillisecondVector}});Object.defineProperty(l,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Y.TimestampMicrosecondVector}});Object.defineProperty(l,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Y.TimestampNanosecondVector}});Object.defineProperty(l,"TimeVector",{enumerable:!0,get:function(){return Y.TimeVector}});Object.defineProperty(l,"TimeSecondVector",{enumerable:!0,get:function(){return Y.TimeSecondVector}});Object.defineProperty(l,"TimeMillisecondVector",{enumerable:!0,get:function(){return Y.TimeMillisecondVector}});Object.defineProperty(l,"TimeMicrosecondVector",{enumerable:!0,get:function(){return Y.TimeMicrosecondVector}});Object.defineProperty(l,"TimeNanosecondVector",{enumerable:!0,get:function(){return Y.TimeNanosecondVector}});Object.defineProperty(l,"UnionVector",{enumerable:!0,get:function(){return Y.UnionVector}});Object.defineProperty(l,"DenseUnionVector",{enumerable:!0,get:function(){return Y.DenseUnionVector}});Object.defineProperty(l,"SparseUnionVector",{enumerable:!0,get:function(){return Y.SparseUnionVector}});Object.defineProperty(l,"Utf8Vector",{enumerable:!0,get:function(){return Y.Utf8Vector}});var Z=ua();Object.defineProperty(l,"Builder",{enumerable:!0,get:function(){return Z.Builder}});Object.defineProperty(l,"BinaryBuilder",{enumerable:!0,get:function(){return Z.BinaryBuilder}});Object.defineProperty(l,"BoolBuilder",{enumerable:!0,get:function(){return Z.BoolBuilder}});Object.defineProperty(l,"DateBuilder",{enumerable:!0,get:function(){return Z.DateBuilder}});Object.defineProperty(l,"DateDayBuilder",{enumerable:!0,get:function(){return Z.DateDayBuilder}});Object.defineProperty(l,"DateMillisecondBuilder",{enumerable:!0,get:function(){return Z.DateMillisecondBuilder}});Object.defineProperty(l,"DecimalBuilder",{enumerable:!0,get:function(){return Z.DecimalBuilder}});Object.defineProperty(l,"DictionaryBuilder",{enumerable:!0,get:function(){return Z.DictionaryBuilder}});Object.defineProperty(l,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return Z.FixedSizeBinaryBuilder}});Object.defineProperty(l,"FixedSizeListBuilder",{enumerable:!0,get:function(){return Z.FixedSizeListBuilder}});Object.defineProperty(l,"FloatBuilder",{enumerable:!0,get:function(){return Z.FloatBuilder}});Object.defineProperty(l,"Float16Builder",{enumerable:!0,get:function(){return Z.Float16Builder}});Object.defineProperty(l,"Float32Builder",{enumerable:!0,get:function(){return Z.Float32Builder}});Object.defineProperty(l,"Float64Builder",{enumerable:!0,get:function(){return Z.Float64Builder}});Object.defineProperty(l,"IntervalBuilder",{enumerable:!0,get:function(){return Z.IntervalBuilder}});Object.defineProperty(l,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Z.IntervalDayTimeBuilder}});Object.defineProperty(l,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Z.IntervalYearMonthBuilder}});Object.defineProperty(l,"IntBuilder",{enumerable:!0,get:function(){return Z.IntBuilder}});Object.defineProperty(l,"Int8Builder",{enumerable:!0,get:function(){return Z.Int8Builder}});Object.defineProperty(l,"Int16Builder",{enumerable:!0,get:function(){return Z.Int16Builder}});Object.defineProperty(l,"Int32Builder",{enumerable:!0,get:function(){return Z.Int32Builder}});Object.defineProperty(l,"Int64Builder",{enumerable:!0,get:function(){return Z.Int64Builder}});Object.defineProperty(l,"Uint8Builder",{enumerable:!0,get:function(){return Z.Uint8Builder}});Object.defineProperty(l,"Uint16Builder",{enumerable:!0,get:function(){return Z.Uint16Builder}});Object.defineProperty(l,"Uint32Builder",{enumerable:!0,get:function(){return Z.Uint32Builder}});Object.defineProperty(l,"Uint64Builder",{enumerable:!0,get:function(){return Z.Uint64Builder}});Object.defineProperty(l,"ListBuilder",{enumerable:!0,get:function(){return Z.ListBuilder}});Object.defineProperty(l,"MapBuilder",{enumerable:!0,get:function(){return Z.MapBuilder}});Object.defineProperty(l,"NullBuilder",{enumerable:!0,get:function(){return Z.NullBuilder}});Object.defineProperty(l,"StructBuilder",{enumerable:!0,get:function(){return Z.StructBuilder}});Object.defineProperty(l,"TimestampBuilder",{enumerable:!0,get:function(){return Z.TimestampBuilder}});Object.defineProperty(l,"TimestampSecondBuilder",{enumerable:!0,get:function(){return Z.TimestampSecondBuilder}});Object.defineProperty(l,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return Z.TimestampMillisecondBuilder}});Object.defineProperty(l,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return Z.TimestampMicrosecondBuilder}});Object.defineProperty(l,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return Z.TimestampNanosecondBuilder}});Object.defineProperty(l,"TimeBuilder",{enumerable:!0,get:function(){return Z.TimeBuilder}});Object.defineProperty(l,"TimeSecondBuilder",{enumerable:!0,get:function(){return Z.TimeSecondBuilder}});Object.defineProperty(l,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return Z.TimeMillisecondBuilder}});Object.defineProperty(l,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return Z.TimeMicrosecondBuilder}});Object.defineProperty(l,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return Z.TimeNanosecondBuilder}});Object.defineProperty(l,"UnionBuilder",{enumerable:!0,get:function(){return Z.UnionBuilder}});Object.defineProperty(l,"DenseUnionBuilder",{enumerable:!0,get:function(){return Z.DenseUnionBuilder}});Object.defineProperty(l,"SparseUnionBuilder",{enumerable:!0,get:function(){return Z.SparseUnionBuilder}});Object.defineProperty(l,"Utf8Builder",{enumerable:!0,get:function(){return Z.Utf8Builder}});var Wd=an();Object.defineProperty(l,"ByteStream",{enumerable:!0,get:function(){return Wd.ByteStream}});Object.defineProperty(l,"AsyncByteStream",{enumerable:!0,get:function(){return Wd.AsyncByteStream}});Object.defineProperty(l,"AsyncByteQueue",{enumerable:!0,get:function(){return Wd.AsyncByteQueue}});var Xs=Hs();Object.defineProperty(l,"RecordBatchReader",{enumerable:!0,get:function(){return Xs.RecordBatchReader}});Object.defineProperty(l,"RecordBatchFileReader",{enumerable:!0,get:function(){return Xs.RecordBatchFileReader}});Object.defineProperty(l,"RecordBatchStreamReader",{enumerable:!0,get:function(){return Xs.RecordBatchStreamReader}});Object.defineProperty(l,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return Xs.AsyncRecordBatchFileReader}});Object.defineProperty(l,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return Xs.AsyncRecordBatchStreamReader}});var pc=Va();Object.defineProperty(l,"RecordBatchWriter",{enumerable:!0,get:function(){return pc.RecordBatchWriter}});Object.defineProperty(l,"RecordBatchFileWriter",{enumerable:!0,get:function(){return pc.RecordBatchFileWriter}});Object.defineProperty(l,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return pc.RecordBatchStreamWriter}});Object.defineProperty(l,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return pc.RecordBatchJSONWriter}});var Yd=Ia();Object.defineProperty(l,"MessageReader",{enumerable:!0,get:function(){return Yd.MessageReader}});Object.defineProperty(l,"AsyncMessageReader",{enumerable:!0,get:function(){return Yd.AsyncMessageReader}});Object.defineProperty(l,"JSONMessageReader",{enumerable:!0,get:function(){return Yd.JSONMessageReader}});var gA=Yn();Object.defineProperty(l,"Message",{enumerable:!0,get:function(){return gA.Message}});var vA=Er();Object.defineProperty(l,"RecordBatch",{enumerable:!0,get:function(){return vA.RecordBatch}});var Gd=qm();Object.defineProperty(l,"DataFrame",{enumerable:!0,get:function(){return Gd.DataFrame}});Object.defineProperty(l,"FilteredDataFrame",{enumerable:!0,get:function(){return Gd.FilteredDataFrame}});Object.defineProperty(l,"CountByResult",{enumerable:!0,get:function(){return Gd.CountByResult}});var wA=bs(),BA=Qu(),IA=tr(),SA=ps(),TA=qe(),AA=As(),FA=qd();l.predicate=FA;var $d=ml();l.util=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},wA),BA),IA),SA),TA),AA),{compareSchemas:$d.compareSchemas,compareFields:$d.compareFields,compareTypes:$d.compareTypes});var DA=Hn();Object.defineProperty(l,"isTypedArray",{enumerable:!0,get:function(){return DA.isTypedArray}})});var Zd=g(()=>{});var Jm=g(()=>{});var tb=g((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!="undefined",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(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(r,e){return function(t){return new Sha256(e,!0).update(t)[r]()}},createMethod=function(r){var e=createOutputMethod("hex",r);NODE_JS&&(e=nodeWrap(e,r)),e.create=function(){return new Sha256(r)},e.update=function(i){return e.create().update(i)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createOutputMethod(n,r)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(r){if(typeof r=="string")return crypto.createHash(algorithm).update(r,"utf8").digest("hex");if(r==null)throw new Error(ERROR);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(r)).digest("hex"):method(r)};return nodeMethod},createHmacOutputMethod=function(r,e){return function(t,n){return new HmacSha256(t,e,!0).update(n)[r]()}},createHmacMethod=function(r){var e=createHmacOutputMethod("hex",r);e.create=function(i){return new HmacSha256(i,r)},e.update=function(i,s){return e.create(i).update(s)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createHmacOutputMethod(n,r)}return e};function Sha256(r,e){e?(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],r?(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=r}Sha256.prototype.update=function(r){if(!this.finalized){var e,t=typeof r;if(t!=="string"){if(t==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);e=!0}for(var n,i=0,s,o=r.length,a=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),e)for(s=this.start;i<o&&s<64;++i)a[s>>2]|=r[i]<<SHIFT[s++&3];else for(s=this.start;i<o&&s<64;++i)n=r.charCodeAt(i),n<128?a[s>>2]|=n<<SHIFT[s++&3]:n<2048?(a[s>>2]|=(192|n>>6)<<SHIFT[s++&3],a[s>>2]|=(128|n&63)<<SHIFT[s++&3]):n<55296||n>=57344?(a[s>>2]|=(224|n>>12)<<SHIFT[s++&3],a[s>>2]|=(128|n>>6&63)<<SHIFT[s++&3],a[s>>2]|=(128|n&63)<<SHIFT[s++&3]):(n=65536+((n&1023)<<10|r.charCodeAt(++i)&1023),a[s>>2]|=(240|n>>18)<<SHIFT[s++&3],a[s>>2]|=(128|n>>12&63)<<SHIFT[s++&3],a[s>>2]|=(128|n>>6&63)<<SHIFT[s++&3],a[s>>2]|=(128|n&63)<<SHIFT[s++&3]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=a[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}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 r=this.blocks,e=this.lastByteIndex;r[16]=this.block,r[e>>2]|=EXTRA[e&3],this.block=r[16],e>=56&&(this.hashed||this.hash(),r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.hBytes<<3|this.bytes>>>29,r[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var r=this.h0,e=this.h1,t=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,a=this.h7,c=this.blocks,f,y,B,D,A,J,te,ae,fe,at,br;for(f=16;f<64;++f)A=c[f-15],y=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,A=c[f-2],B=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,c[f]=c[f-16]+y+c[f-7]+B<<0;for(br=e&t,f=0;f<64;f+=4)this.first?(this.is224?(ae=300032,A=c[0]-1413257819,a=A-150054599<<0,n=A+24177077<<0):(ae=704751109,A=c[0]-210244248,a=A-1521486534<<0,n=A+143694565<<0),this.first=!1):(y=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),B=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),ae=r&e,D=ae^r&t^br,te=i&s^~i&o,A=a+B+te+K[f]+c[f],J=y+D,a=n+A<<0,n=A+J<<0),y=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),B=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),fe=n&r,D=fe^n&e^ae,te=a&i^~a&s,A=o+B+te+K[f+1]+c[f+1],J=y+D,o=t+A<<0,t=A+J<<0,y=(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),at=t&n,D=at^t&r^fe,te=o&a^~o&i,A=s+B+te+K[f+2]+c[f+2],J=y+D,s=e+A<<0,e=A+J<<0,y=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),B=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),br=e&t,D=br^e&n^at,te=s&o^~s&a,A=i+B+te+K[f+3]+c[f+3],J=y+D,i=r+A<<0,r=A+J<<0;this.h0=this.h0+r<<0,this.h1=this.h1+e<<0,this.h2=this.h2+t<<0,this.h3=this.h3+n<<0,this.h4=this.h4+i<<0,this.h5=this.h5+s<<0,this.h6=this.h6+o<<0,this.h7=this.h7+a<<0},Sha256.prototype.hex=function(){this.finalize();var r=this.h0,e=this.h1,t=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,a=this.h7,c=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[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[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[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[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[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&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];return this.is224||(c+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var r=this.h0,e=this.h1,t=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,a=this.h7,c=[r>>24&255,r>>16&255,r>>8&255,r&255,e>>24&255,e>>16&255,e>>8&255,e&255,t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,i>>24&255,i>>16&255,i>>8&255,i&255,s>>24&255,s>>16&255,s>>8&255,s&255,o>>24&255,o>>16&255,o>>8&255,o&255];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,a&255),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(this.is224?28:32),e=new DataView(r);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),r};function HmacSha256(r,e,t){var n,i=typeof r;if(i==="string"){var s=[],o=r.length,a=0,c;for(n=0;n<o;++n)c=r.charCodeAt(n),c<128?s[a++]=c:c<2048?(s[a++]=192|c>>6,s[a++]=128|c&63):c<55296||c>=57344?(s[a++]=224|c>>12,s[a++]=128|c>>6&63,s[a++]=128|c&63):(c=65536+((c&1023)<<10|r.charCodeAt(++n)&1023),s[a++]=240|c>>18,s[a++]=128|c>>12&63,s[a++]=128|c>>6&63,s[a++]=128|c&63);r=s}else if(i==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);r.length>64&&(r=new Sha256(e,!0).update(r).array());var f=[],y=[];for(n=0;n<64;++n){var B=r[n]||0;f[n]=92^B,y[n]=54^B}Sha256.call(this,e,t),this.update(y),this.oKeyPad=f,this.inner=!0,this.sharedMemory=t}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var r=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(r),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 kA={};H0(kA,{registerWorker:()=>ib});var Ym=Kt(fs(),1),Gm=Kt(ua(),1),Qi=Kt(Hs(),1),es=Kt(Va(),1),$m=Kt(Um(),1),Km=Kt(Vm(),1),yc=Kt(xm(),1),_c=Kt(Pm(),1),h=Kt(Wm(),1);Ym.default.toDOMStream=$m.toDOMStream;Gm.Builder.throughDOM=Km.builderThroughDOMStream;Qi.RecordBatchReader.throughDOM=yc.recordBatchReaderThroughDOMStream;Qi.RecordBatchFileReader.throughDOM=yc.recordBatchReaderThroughDOMStream;Qi.RecordBatchStreamReader.throughDOM=yc.recordBatchReaderThroughDOMStream;es.RecordBatchWriter.throughDOM=_c.recordBatchWriterThroughDOMStream;es.RecordBatchFileWriter.throughDOM=_c.recordBatchWriterThroughDOMStream;es.RecordBatchStreamWriter.throughDOM=_c.recordBatchWriterThroughDOMStream;function Jd(r){switch(r.typeId){case h.Type.Binary:return{type:"binary"};case h.Type.Bool:return{type:"bool"};case h.Type.Date:return{type:"date"};case h.Type.DateDay:return{type:"date32[d]"};case h.Type.DateMillisecond:return{type:"date64[ms]"};case h.Type.Decimal:{let e=r;return{type:"decimal",precision:e.precision,scale:e.scale}}case h.Type.Float:return{type:"float"};case h.Type.Float16:return{type:"float16"};case h.Type.Float32:return{type:"float32"};case h.Type.Float64:return{type:"float64"};case h.Type.Int:return{type:"int32"};case h.Type.Int16:return{type:"int16"};case h.Type.Int32:return{type:"int32"};case h.Type.Int64:return{type:"int64"};case h.Type.Uint16:return{type:"uint16"};case h.Type.Uint32:return{type:"uint32"};case h.Type.Uint64:return{type:"uint64"};case h.Type.Uint8:return{type:"uint8"};case h.Type.IntervalDayTime:return{type:"interval[dt]"};case h.Type.IntervalYearMonth:return{type:"interval[m]"};case h.Type.List:{let e=r;return{type:"list",children:[Zs(e.valueField.name,e.valueField.type)]}}case h.Type.FixedSizeBinary:return{type:"fixedsizebinary",byteWidth:r.byteWidth};case h.Type.Null:return{type:"null"};case h.Type.Utf8:return{type:"utf8"};case h.Type.Struct:return{type:"struct",children:r.children.map(t=>Zs(t.name,t.type))};case h.Type.Time:return{type:"time[s]"};case h.Type.TimeMicrosecond:return{type:"time[us]"};case h.Type.TimeMillisecond:return{type:"time[ms]"};case h.Type.TimeNanosecond:return{type:"time[ns]"};case h.Type.TimeSecond:return{type:"time[s]"};case h.Type.Timestamp:return{type:"timestamp",timezone:r.timezone||void 0};case h.Type.TimestampSecond:return{type:"timestamp[s]",timezone:r.timezone||void 0};case h.Type.TimestampMicrosecond:return{type:"timestamp[us]",timezone:r.timezone||void 0};case h.Type.TimestampNanosecond:return{type:"timestamp[ns]",timezone:r.timezone||void 0};case h.Type.TimestampMillisecond:return{type:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error(`unsupported arrow type: ${r.toString()}`)}function Zs(r,e){let t=Jd(e);return t.name=r,t}var Xd=class{constructor(){this._bindings=null;this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"OK",data:null},[])}failWith(e,t){let n={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"ERROR",data:n},[])}async onMessage(e){switch(e.type){case"PING":this.sendOK(e);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(e,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(e.data[0],e.data[1],t=>{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"INSTANTIATE_PROGRESS",data:t},[])}),this.sendOK(e)}catch(t){this._bindings=null,this.failWith(e,t)}return;default:break}if(!this._bindings)return this.failWith(e,new Error("duckdb is not initialized"));try{switch(e.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(e);break;case"OPEN":this._bindings.open(e.data),this.sendOK(e);break;case"DROP_FILE":this._bindings.dropFile(e.data),this.sendOK(e);break;case"DROP_FILES":this._bindings.dropFiles(),this.sendOK(e);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(e);break;case"CONNECT":{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"CONNECTION_INFO",data:t.useUnsafe((n,i)=>i)},[]);break}case"DISCONNECT":this._bindings.disconnect(e.data),this.sendOK(e);break;case"CREATE_PREPARED":{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"PREPARED_STATEMENT_ID",data:t},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case"RUN_PREPARED":{let t=this._bindings.runPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"RUN_QUERY":{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"SEND_PREPARED":{let t=this._bindings.sendPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_START",data:t},[t.buffer]);break}case"SEND_QUERY":{let t=this._bindings.sendQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_START",data:t},[t.buffer]);break}case"FETCH_QUERY_RESULTS":{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_CHUNK",data:t},[t.buffer]);break}case"GET_TABLE_NAMES":{let t=this._bindings.getTableNames(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"TABLE_NAMES",data:t},[]);break}case"GLOB_FILE_INFOS":{let t=this._bindings.globFiles(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_INFOS",data:t},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(e.data[0],e.data[1]),this.sendOK(e);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case"REGISTER_FILE_HANDLE":this._bindings.registerFileHandle(e.data[0],e.data[1]),this.sendOK(e);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case"COPY_FILE_TO_BUFFER":{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_BUFFER",data:t},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(e.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"TOKENIZE":{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SCRIPT_TOKENS",data:t},[]);break}}}catch(t){return this.failWith(e,t)}}};var Zm={},OA=(()=>{var r=Zm.url;return function(e){e=e||{};var t=typeof e!="undefined"?e:{},n=Object.assign,i,s;t.ready=new Promise(function(u,d){i=u,s=d});var o=n({},t),a=[],c="./this.program",f=(u,d)=>{throw d},y=typeof window=="object",B=typeof importScripts=="function",D=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",A="";function J(u){return t.locateFile?t.locateFile(u,A):A+u}var te,ae,fe,at;function br(u){if(u instanceof po)return;gr("exiting due to exception: "+u)}var xt,Qn,Pr;D?(B?A=Zd().dirname(A)+"/":A=__dirname+"/",Pr=function(){Qn||(xt=Jm(),Qn=Zd())},te=function(d,p){return Pr(),d=Qn.normalize(d),xt.readFileSync(d,p?null:"utf8")},fe=function(d){var p=te(d,!0);return p.buffer||(p=new Uint8Array(p)),p},ae=function(d,p,_){Pr(),d=Qn.normalize(d),xt.readFile(d,function(v,R){v?_(v):p(R.buffer)})},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),process.on("uncaughtException",function(u){if(!(u instanceof po))throw u}),process.on("unhandledRejection",function(u){throw u}),f=(u,d)=>{if(gc())throw process.exitCode=u,d;br(d),process.exit(u)},t.inspect=function(){return"[Emscripten Module object]"}):(y||B)&&(B?A=self.location.href:typeof document!="undefined"&&document.currentScript&&(A=document.currentScript.src),r&&(A=r),A.indexOf("blob:")!==0?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="",te=function(u){var d=new XMLHttpRequest;return d.open("GET",u,!1),d.send(null),d.responseText},B&&(fe=function(u){var d=new XMLHttpRequest;return d.open("GET",u,!1),d.responseType="arraybuffer",d.send(null),new Uint8Array(d.response)}),ae=function(u,d,p){var _=new XMLHttpRequest;_.open("GET",u,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){d(_.response);return}p()},_.onerror=p,_.send(null)},at=u=>document.title=u);var sb=t.print||console.log.bind(console),gr=t.printErr||console.warn.bind(console);n(t,o),o=null,t.arguments&&(a=t.arguments),t.thisProgram&&(c=t.thisProgram),t.quit&&(f=t.quit);var rs;t.wasmBinary&&(rs=t.wasmBinary);var ob=t.noExitRuntime||!0;typeof WebAssembly!="object"&&Pt("no native wasm support detected");var Qs,mc=!1,eo;function af(u,d){u||Pt(d)}function ab(u){var d=t["_"+u];return d}function cb(u,d,p,_,v){var R={string:function(Re){var Nt=0;if(Re!=null&&Re!==0){var Gt=(Re.length<<2)+1;Nt=Dc(Gt),bc(Re,Nt,Gt)}return Nt},array:function(Re){var Nt=Dc(Re.length);return df(Re,Nt),Nt}};function M(Re){return d==="string"?vr(Re):d==="boolean"?Boolean(Re):Re}var O=ab(u),k=[],ye=0;if(_)for(var he=0;he<_.length;he++){var ht=R[p[he]];ht?(ye===0&&(ye=Df()),k[he]=ht(_[he])):k[he]=_[he]}var ge=O.apply(null,k);function pt(Re){return ye!==0&&Of(ye),M(Re)}return ge=pt(ge),ge}var cf=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function uf(u,d,p){for(var _=d+p,v=d;u[v]&&!(v>=_);)++v;if(v-d>16&&u.subarray&&cf)return cf.decode(u.subarray(d,v));for(var R="";d<v;){var M=u[d++];if(!(M&128)){R+=String.fromCharCode(M);continue}var O=u[d++]&63;if((M&224)==192){R+=String.fromCharCode((M&31)<<6|O);continue}var k=u[d++]&63;if((M&240)==224?M=(M&15)<<12|O<<6|k:M=(M&7)<<18|O<<12|k<<6|u[d++]&63,M<65536)R+=String.fromCharCode(M);else{var ye=M-65536;R+=String.fromCharCode(55296|ye>>10,56320|ye&1023)}}return R}function vr(u,d){return u?uf(Nr,u,d):""}function lf(u,d,p,_){if(!(_>0))return 0;for(var v=p,R=p+_-1,M=0;M<u.length;++M){var O=u.charCodeAt(M);if(O>=55296&&O<=57343){var k=u.charCodeAt(++M);O=65536+((O&1023)<<10)|k&1023}if(O<=127){if(p>=R)break;d[p++]=O}else if(O<=2047){if(p+1>=R)break;d[p++]=192|O>>6,d[p++]=128|O&63}else if(O<=65535){if(p+2>=R)break;d[p++]=224|O>>12,d[p++]=128|O>>6&63,d[p++]=128|O&63}else{if(p+3>=R)break;d[p++]=240|O>>18,d[p++]=128|O>>12&63,d[p++]=128|O>>6&63,d[p++]=128|O&63}}return d[p]=0,p-v}function bc(u,d,p){return lf(u,Nr,d,p)}function ub(u){for(var d=0,p=0;p<u.length;++p){var _=u.charCodeAt(p);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|u.charCodeAt(++p)&1023),_<=127?++d:_<=2047?d+=2:_<=65535?d+=3:d+=4}return d}function df(u,d){ns.set(u,d)}function lb(u,d,p){for(var _=0;_<u.length;++_)ns[d++>>0]=u.charCodeAt(_);p||(ns[d>>0]=0)}function db(u,d){return u%d>0&&(u+=d-u%d),u}var ff,ns,Nr,is,hf,L,fb,hb,pb;function pf(u){ff=u,t.HEAP8=ns=new Int8Array(u),t.HEAP16=is=new Int16Array(u),t.HEAP32=L=new Int32Array(u),t.HEAPU8=Nr=new Uint8Array(u),t.HEAPU16=hf=new Uint16Array(u),t.HEAPU32=fb=new Uint32Array(u),t.HEAPF32=hb=new Float32Array(u),t.HEAPF64=pb=new Float64Array(u)}var CA=t.INITIAL_MEMORY||16777216,yf,_f=[],mf=[],yb=[],bf=[],_b=!1,mb=!1,bb=0;function gc(){return ob||bb>0}function gb(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Sb(t.preRun.shift());to(_f)}function vb(){_b=!0,to(mf)}function wb(){to(yb)}function Bb(){mb=!0}function Ib(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Ab(t.postRun.shift());to(bf)}function Sb(u){_f.unshift(u)}function Tb(u){mf.unshift(u)}function Ab(u){bf.unshift(u)}var Fn=0,vc=null,ss=null;function Fb(u){Fn++,t.monitorRunDependencies&&t.monitorRunDependencies(Fn)}function Db(u){if(Fn--,t.monitorRunDependencies&&t.monitorRunDependencies(Fn),Fn==0&&(vc!==null&&(clearInterval(vc),vc=null),ss)){var d=ss;ss=null,d()}}t.preloadedImages={},t.preloadedAudios={};function Pt(u){t.onAbort&&t.onAbort(u),u="Aborted("+u+")",gr(u),mc=!0,eo=1,u+=". Build with -s ASSERTIONS=1 for more info.";var d=new WebAssembly.RuntimeError(u);throw s(d),d}var Ob="data:application/octet-stream;base64,";function gf(u){return u.startsWith(Ob)}var dt;t.locateFile?(dt="./duckdb-eh.wasm",gf(dt)||(dt=J(dt))):dt=new URL("./duckdb-eh.wasm",Zm.url).toString();function vf(u){try{if(u==dt&&rs)return new Uint8Array(rs);if(fe)return fe(u);throw"both async and sync fetching of the wasm failed"}catch(d){Pt(d)}}function Mb(){return!rs&&(y||B)&&typeof fetch=="function"?fetch(dt,{credentials:"same-origin"}).then(function(u){if(!u.ok)throw"failed to load wasm binary file at '"+dt+"'";return u.arrayBuffer()}).catch(function(){return vf(dt)}):Promise.resolve().then(function(){return vf(dt)})}function Ub(){var u={a:zg};function d(M,O){var k=M.exports;t.asm=k,Qs=t.asm.ea,pf(Qs.buffer),yf=t.asm.ha,Tb(t.asm.fa),Db("wasm-instantiate")}Fb("wasm-instantiate");function p(M){d(M.instance)}function _(M){return Mb().then(function(O){return WebAssembly.instantiate(O,u)}).then(function(O){return O}).then(M,function(O){gr("failed to asynchronously prepare wasm: "+O),Pt(O)})}function v(){return!rs&&typeof WebAssembly.instantiateStreaming=="function"&&!gf(dt)&&typeof fetch=="function"?fetch(dt,{credentials:"same-origin"}).then(function(M){var O=WebAssembly.instantiateStreaming(M,u);return O.then(p,function(k){return gr("wasm streaming compile failed: "+k),gr("falling back to ArrayBuffer instantiation"),_(p)})}):_(p)}if(t.instantiateWasm)try{var R=t.instantiateWasm(u,d);return R}catch(M){return gr("Module.instantiateWasm callback failed with error: "+M),!1}return v().catch(s),{}}function to(u){for(;u.length>0;){var d=u.shift();if(typeof d=="function"){d(t);continue}var p=d.func;typeof p=="number"?d.arg===void 0?wf(p)():wf(p)(d.arg):p(d.arg===void 0?null:d.arg)}}var ro=[];function wf(u){var d=ro[u];return d||(u>=ro.length&&(ro.length=u+1),ro[u]=d=yf.get(u)),d}function Eb(u){if(u instanceof po||u=="unwind")return eo;f(1,u)}function Rb(u,d,p,_){Pt("Assertion failed: "+vr(u)+", at: "+[d?vr(d):"unknown filename",p,_?vr(_):"unknown function"])}var Ye={mappings:{},buffers:[null,[],[]],printChar:function(u,d){var p=Ye.buffers[u];d===0||d===10?((u===1?sb:gr)(uf(p,0)),p.length=0):p.push(d)},varargs:void 0,get:function(){Ye.varargs+=4;var u=L[Ye.varargs-4>>2];return u},getStr:function(u){var d=vr(u);return d},get64:function(u,d){return u}};function Vb(u,d,p,_,v){}function xb(u,d){return u=Ye.getStr(u),Ye.doAccess(u,d)}function Pb(){gr("missing function: $SOCKFS"),Pt(-1)}function Bf(){gr("missing function: $FS"),Pt(-1)}function os(u){var d=Pb.getSocket(u);if(!d)throw new Bf.ErrnoError(8);return d}function Nb(u){return L[Ff()>>2]=u,u}function wc(u){return(u&255)+"."+(u>>8&255)+"."+(u>>16&255)+"."+(u>>24&255)}function If(u){var d="",p=0,_=0,v=0,R=0,M=0,O=0,k=[u[0]&65535,u[0]>>16,u[1]&65535,u[1]>>16,u[2]&65535,u[2]>>16,u[3]&65535,u[3]>>16],ye=!0,he="";for(O=0;O<5;O++)if(k[O]!==0){ye=!1;break}if(ye){if(he=wc(k[6]|k[7]<<16),k[5]===-1)return d="::ffff:",d+=he,d;if(k[5]===0)return d="::",he==="0.0.0.0"&&(he=""),he==="0.0.0.1"&&(he="1"),d+=he,d}for(p=0;p<8;p++)k[p]===0&&(p-v>1&&(M=0),v=p,M++),M>_&&(_=M,R=p-_+1);for(p=0;p<8;p++){if(_>1&&k[p]===0&&p>=R&&p<R+_){p===R&&(d+=":",R===0&&(d+=":"));continue}d+=Number(Fc(k[p]&65535)).toString(16),d+=p<7?":":""}return d}function Sf(u,d){var p=is[u>>1],_=Fc(hf[u+2>>1]),v;switch(p){case 2:if(d!==16)return{errno:28};v=L[u+4>>2],v=wc(v);break;case 10:if(d!==28)return{errno:28};v=[L[u+8>>2],L[u+12>>2],L[u+16>>2],L[u+20>>2]],v=If(v);break;default:return{errno:5}}return{family:p,addr:v,port:_}}function no(u){for(var d=u.split("."),p=0;p<4;p++){var _=Number(d[p]);if(isNaN(_))return null;d[p]=_}return(d[0]|d[1]<<8|d[2]<<16|d[3]<<24)>>>0}function io(u){return parseInt(u)}function Bc(u){var d,p,_,v,R=/^((?=.*::)(?!.*::.+::)(::)?([\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,M=[];if(!R.test(u))return null;if(u==="::")return[0,0,0,0,0,0,0,0];for(u.startsWith("::")?u=u.replace("::","Z:"):u=u.replace("::",":Z:"),u.indexOf(".")>0?(u=u.replace(new RegExp("[.]","g"),":"),d=u.split(":"),d[d.length-4]=io(d[d.length-4])+io(d[d.length-3])*256,d[d.length-3]=io(d[d.length-2])+io(d[d.length-1])*256,d=d.slice(0,d.length-2)):d=u.split(":"),_=0,v=0,p=0;p<d.length;p++)if(typeof d[p]=="string")if(d[p]==="Z"){for(v=0;v<8-d.length+1;v++)M[p+v]=0;_=v-1}else M[p+_]=fo(parseInt(d[p],16));else M[p+_]=d[p];return[M[1]<<16|M[0],M[3]<<16|M[2],M[5]<<16|M[4],M[7]<<16|M[6]]}var ft={address_map:{id:1,addrs:{},names:{}},lookup_name:function(u){var d=no(u);if(d!==null||(d=Bc(u),d!==null))return u;var p;if(ft.address_map.addrs[u])p=ft.address_map.addrs[u];else{var _=ft.address_map.id++;af(_<65535,"exceeded max address mappings of 65535"),p="172.29."+(_&255)+"."+(_&65280),ft.address_map.names[p]=u,ft.address_map.addrs[u]=p}return p},lookup_addr:function(u){return ft.address_map.names[u]?ft.address_map.names[u]:null}};function Tf(u,d,p){if(p&&u===0)return null;var _=Sf(u,d);if(_.errno)throw new Bf.ErrnoError(_.errno);return _.addr=ft.lookup_addr(_.addr)||_.addr,_}function Lb(u,d,p){var _=os(u),v=Tf(d,p);return _.sock_ops.bind(_,v.addr,v.port),0}function kb(u,d,p){var _=os(u),v=Tf(d,p);return _.sock_ops.connect(_,v.addr,v.port),0}function Cb(u,d,p){return Ye.varargs=p,0}function jb(u,d){}function qb(u,d,p,_){}function Hb(u,d,p){}function zb(u,d,p){}function Af(u,d){Nr.fill(0,u,u+d)}function Ic(u,d,p,_,v){switch(d){case 2:p=no(p),Af(u,16),v&&(L[v>>2]=16),is[u>>1]=d,L[u+4>>2]=p,is[u+2>>1]=fo(_);break;case 10:p=Bc(p),Af(u,28),v&&(L[v>>2]=28),L[u>>2]=d,L[u+8>>2]=p[0],L[u+12>>2]=p[1],L[u+16>>2]=p[2],L[u+20>>2]=p[3],is[u+2>>1]=fo(_);break;default:return 5}return 0}function Wb(u,d,p){var _=os(u);if(!_.daddr)return-53;var v=Ic(d,_.family,ft.lookup_name(_.daddr),_.dport,p);return 0}function Yb(u,d,p,_,v){var R=os(u);return d===1&&p===4?(L[_>>2]=R.error,L[v>>2]=4,R.error=null,0):-50}function Gb(u,d,p){return Ye.varargs=p,0}function $b(u,d){}function Kb(u,d){return u=Ye.getStr(u),Ye.doMkdir(u,d)}function Jb(u,d,p){Ye.varargs=p}function Xb(u,d,p,_,v,R){var M=os(u),O=M.sock_ops.recvmsg(M,p);if(!O)return 0;if(v)var k=Ic(v,M.family,ft.lookup_name(O.addr),O.port,R);return Nr.set(O.buffer,d),O.buffer.byteLength}function Zb(u,d){}function Qb(u){}function eg(u,d,p,_,v,R){}function tg(u,d,p){}function rg(u,d){}function ng(u){}function ig(u,d){Pt("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function sg(u,d){Pt("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function og(){Pt("")}var Sc;D?Sc=()=>{var u=process.hrtime();return u[0]*1e3+u[1]/1e6}:Sc=()=>performance.now();var ag=!0;function cg(u,d){var p;if(u===0)p=Date.now();else if((u===1||u===4)&&ag)p=Sc();else return Nb(28),-1;return L[d>>2]=p/1e3|0,L[d+4>>2]=p%1e3*1e3*1e3|0,0}function ug(u,d){return globalThis.DUCKDB_RUNTIME.createDirectory(t,u,d)}function lg(u,d){return globalThis.DUCKDB_RUNTIME.checkDirectory(t,u,d)}function dg(u,d){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(t,u,d)}function fg(u,d){return globalThis.DUCKDB_RUNTIME.removeDirectory(t,u,d)}function hg(u){return globalThis.DUCKDB_RUNTIME.closeFile(t,u)}function pg(u,d){return globalThis.DUCKDB_RUNTIME.checkFile(t,u,d)}function yg(u){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(t,u)}function _g(u,d,p,_){return globalThis.DUCKDB_RUNTIME.moveFile(t,u,d,p,_)}function mg(u,d){return globalThis.DUCKDB_RUNTIME.openFile(t,u,d)}function bg(u,d,p,_){return globalThis.DUCKDB_RUNTIME.readFile(t,u,d,p,_)}function gg(u,d){return globalThis.DUCKDB_RUNTIME.truncateFile(t,u,d)}function vg(u,d,p,_){return globalThis.DUCKDB_RUNTIME.writeFile(t,u,d,p,_)}function wg(u,d){return globalThis.DUCKDB_RUNTIME.glob(t,u,d)}function Bg(u){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(t,u)}function Ig(u,d,p,_){return globalThis.DUCKDB_RUNTIME.callScalarUDF(t,u,d,p,_)}function Sg(){return 2147483648}function Tg(u,d,p){Nr.copyWithin(u,d,d+p)}function Ag(u){try{return Qs.grow(u-ff.byteLength+65535>>>16),pf(Qs.buffer),1}catch(d){}}function Fg(u){var d=Nr.length;u=u>>>0;var p=2147483648;if(u>p)return!1;for(var _=1;_<=4;_*=2){var v=d*(1+.2/_);v=Math.min(v,u+100663296);var R=Math.min(p,db(Math.max(u,v),65536)),M=Ag(R);if(M)return!0}return!1}var Tc={};function Dg(){return c||"./this.program"}function as(){if(!as.strings){var u=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",d={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:u,_:Dg()};for(var p in Tc)Tc[p]===void 0?delete d[p]:d[p]=Tc[p];var _=[];for(var p in d)_.push(p+"="+d[p]);as.strings=_}return as.strings}function Og(u,d){var p=0;return as().forEach(function(_,v){var R=d+p;L[u+v*4>>2]=R,lb(_,R),p+=_.length+1}),0}function Mg(u,d){var p=as();L[u>>2]=p.length;var _=0;return p.forEach(function(v){_+=v.length+1}),L[d>>2]=_,0}function Ug(u){return 0}function Eg(u,d,p,_,v,R){var M=Ye.getStreamFromFD(u),O=Ye.doReadv(M,d,p,_);return L[R>>2]=O,0}function Rg(u,d,p,_,v,R){var M=Ye.getStreamFromFD(u),O=Ye.doWritev(M,d,p,_);return L[R>>2]=O,0}function Vg(u,d,p,_){var v=Ye.getStreamFromFD(u),R=Ye.doReadv(v,d,p);return L[_>>2]=R,0}function xg(u,d,p,_,v){}function Pg(u){var d=Ye.getStreamFromFD(u);return d.stream_ops&&d.stream_ops.fsync?-d.stream_ops.fsync(d):0}function Ng(u,d,p,_){for(var v=0,R=0;R<p;R++){var M=L[d>>2],O=L[d+4>>2];d+=8;for(var k=0;k<O;k++)Ye.printChar(u,Nr[M+k]);v+=O}return L[_>>2]=v,0}function Lg(u,d,p,_){var v=0,R=0,M=0,O=0,k=0,ye=0,he;function ht(ge,pt,Re,Nt,Gt,cs){var S,C,le,pe;return C=ge===10?28:16,Gt=ge===10?If(Gt):wc(Gt),S=Oc(C),pe=Ic(S,ge,Gt,cs),af(!pe),le=Oc(32),L[le+4>>2]=ge,L[le+8>>2]=pt,L[le+12>>2]=Re,L[le+24>>2]=Nt,L[le+20>>2]=S,ge===10?L[le+16>>2]=28:L[le+16>>2]=16,L[le+28>>2]=0,le}if(p&&(M=L[p>>2],O=L[p+4>>2],k=L[p+8>>2],ye=L[p+12>>2]),k&&!ye&&(ye=k===2?17:6),!k&&ye&&(k=ye===17?2:1),ye===0&&(ye=6),k===0&&(k=1),!u&&!d)return-2;if(M&~(1|2|4|1024|8|16|32)||p!==0&&L[p>>2]&2&&!u)return-1;if(M&32)return-2;if(k!==0&&k!==1&&k!==2)return-7;if(O!==0&&O!==2&&O!==10)return-6;if(d&&(d=vr(d),R=parseInt(d,10),isNaN(R)))return M&1024?-2:-8;if(!u)return O===0&&(O=2),(M&1)===0&&(O===2?v=lo(2130706433):v=[0,0,0,1]),he=ht(O,k,ye,null,v,R),L[_>>2]=he,0;if(u=vr(u),v=no(u),v!==null)if(O===0||O===2)O=2;else if(O===10&&M&8)v=[0,0,lo(65535),v],O=10;else return-2;else if(v=Bc(u),v!==null)if(O===0||O===10)O=10;else return-2;return v!=null?(he=ht(O,k,ye,u,v,R),L[_>>2]=he,0):M&4?-2:(u=ft.lookup_name(u),v=no(u),O===0?O=2:O===10&&(v=[0,0,lo(65535),v]),he=ht(O,k,ye,null,v,R),L[_>>2]=he,0)}function kg(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var u=new Uint8Array(1);return function(){return crypto.getRandomValues(u),u[0]}}else if(D)try{var d=q0("crypto");return function(){return d.randomBytes(1)[0]}}catch(p){}return function(){Pt("randomDevice")}}function so(u,d){so.randomDevice||(so.randomDevice=kg());for(var p=0;p<d;p++)ns[u+p>>0]=so.randomDevice();return 0}function Cg(u,d,p,_,v,R,M){var O=Sf(u,d);if(O.errno)return-6;var k=O.port,ye=O.addr,he=!1;if(p&&_){var ht;if(M&1||!(ht=ft.lookup_addr(ye))){if(M&8)return-2}else ye=ht;var ge=bc(ye,p,_);ge+1>=_&&(he=!0)}if(v&&R){k=""+k;var ge=bc(k,v,R);ge+1>=R&&(he=!0)}return he?-12:0}function oo(u){return u%4===0&&(u%100!==0||u%400===0)}function Ac(u,d){for(var p=0,_=0;_<=d;p+=u[_++]);return p}var ao=[31,29,31,30,31,30,31,31,30,31,30,31],co=[31,28,31,30,31,30,31,31,30,31,30,31];function uo(u,d){for(var p=new Date(u.getTime());d>0;){var _=oo(p.getFullYear()),v=p.getMonth(),R=(_?ao:co)[v];if(d>R-p.getDate())d-=R-p.getDate()+1,p.setDate(1),v<11?p.setMonth(v+1):(p.setMonth(0),p.setFullYear(p.getFullYear()+1));else return p.setDate(p.getDate()+d),p}return p}function jg(u,d,p,_){var v=L[_+40>>2],R={tm_sec:L[_>>2],tm_min:L[_+4>>2],tm_hour:L[_+8>>2],tm_mday:L[_+12>>2],tm_mon:L[_+16>>2],tm_year:L[_+20>>2],tm_wday:L[_+24>>2],tm_yday:L[_+28>>2],tm_isdst:L[_+32>>2],tm_gmtoff:L[_+36>>2],tm_zone:v?vr(v):""},M=vr(p),O={"%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 k in O)M=M.replace(new RegExp(k,"g"),O[k]);var ye=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],he=["January","February","March","April","May","June","July","August","September","October","November","December"];function ht(S,C,le){for(var pe=typeof S=="number"?S.toString():S||"";pe.length<C;)pe=le[0]+pe;return pe}function ge(S,C){return ht(S,C,"0")}function pt(S,C){function le($t){return $t<0?-1:$t>0?1:0}var pe;return(pe=le(S.getFullYear()-C.getFullYear()))===0&&(pe=le(S.getMonth()-C.getMonth()))===0&&(pe=le(S.getDate()-C.getDate())),pe}function Re(S){switch(S.getDay()){case 0:return new Date(S.getFullYear()-1,11,29);case 1:return S;case 2:return new Date(S.getFullYear(),0,3);case 3:return new Date(S.getFullYear(),0,2);case 4:return new Date(S.getFullYear(),0,1);case 5:return new Date(S.getFullYear()-1,11,31);case 6:return new Date(S.getFullYear()-1,11,30)}}function Nt(S){var C=uo(new Date(S.tm_year+1900,0,1),S.tm_yday),le=new Date(C.getFullYear(),0,4),pe=new Date(C.getFullYear()+1,0,4),$t=Re(le),Lr=Re(pe);return pt($t,C)<=0?pt(Lr,C)<=0?C.getFullYear()+1:C.getFullYear():C.getFullYear()-1}var Gt={"%a":function(S){return ye[S.tm_wday].substring(0,3)},"%A":function(S){return ye[S.tm_wday]},"%b":function(S){return he[S.tm_mon].substring(0,3)},"%B":function(S){return he[S.tm_mon]},"%C":function(S){var C=S.tm_year+1900;return ge(C/100|0,2)},"%d":function(S){return ge(S.tm_mday,2)},"%e":function(S){return ht(S.tm_mday,2," ")},"%g":function(S){return Nt(S).toString().substring(2)},"%G":function(S){return Nt(S)},"%H":function(S){return ge(S.tm_hour,2)},"%I":function(S){var C=S.tm_hour;return C==0?C=12:C>12&&(C-=12),ge(C,2)},"%j":function(S){return ge(S.tm_mday+Ac(oo(S.tm_year+1900)?ao:co,S.tm_mon-1),3)},"%m":function(S){return ge(S.tm_mon+1,2)},"%M":function(S){return ge(S.tm_min,2)},"%n":function(){return`
|
|
18
|
-
`},"%p":function(S){return S.tm_hour>=0&&S.tm_hour<12?"AM":"PM"},"%S":function(S){return ge(S.tm_sec,2)},"%t":function(){return" "},"%u":function(S){return S.tm_wday||7},"%U":function(S){var C=new Date(S.tm_year+1900,0,1),le=C.getDay()===0?C:uo(C,7-C.getDay()),pe=new Date(S.tm_year+1900,S.tm_mon,S.tm_mday);if(pt(le,pe)<0){var $t=Ac(oo(pe.getFullYear())?ao:co,pe.getMonth()-1)-31,Lr=31-le.getDate(),Dn=Lr+$t+pe.getDate();return ge(Math.ceil(Dn/7),2)}return pt(le,C)===0?"01":"00"},"%V":function(S){var C=new Date(S.tm_year+1900,0,4),le=new Date(S.tm_year+1901,0,4),pe=Re(C),$t=Re(le),Lr=uo(new Date(S.tm_year+1900,0,1),S.tm_yday);if(pt(Lr,pe)<0)return"53";if(pt($t,Lr)<=0)return"01";var Dn;return pe.getFullYear()<S.tm_year+1900?Dn=S.tm_yday+32-pe.getDate():Dn=S.tm_yday+1-pe.getDate(),ge(Math.ceil(Dn/7),2)},"%w":function(S){return S.tm_wday},"%W":function(S){var C=new Date(S.tm_year,0,1),le=C.getDay()===1?C:uo(C,C.getDay()===0?1:7-C.getDay()+1),pe=new Date(S.tm_year+1900,S.tm_mon,S.tm_mday);if(pt(le,pe)<0){var $t=Ac(oo(pe.getFullYear())?ao:co,pe.getMonth()-1)-31,Lr=31-le.getDate(),Dn=Lr+$t+pe.getDate();return ge(Math.ceil(Dn/7),2)}return pt(le,C)===0?"01":"00"},"%y":function(S){return(S.tm_year+1900).toString().substring(2)},"%Y":function(S){return S.tm_year+1900},"%z":function(S){var C=S.tm_gmtoff,le=C>=0;return C=Math.abs(C)/60,C=C/60*100+C%60,(le?"+":"-")+String("0000"+C).slice(-4)},"%Z":function(S){return S.tm_zone},"%%":function(){return"%"}};for(var k in Gt)M.includes(k)&&(M=M.replace(new RegExp(k,"g"),Gt[k](R)));var cs=Hg(M,!1);return cs.length>d?0:(df(cs,u),cs.length-1)}function qg(u,d,p,_){return jg(u,d,p,_)}function Hg(u,d,p){var _=p>0?p:ub(u)+1,v=new Array(_),R=lf(u,v,0,v.length);return d&&(v.length=R),v}var zg={a:Rb,R:Vb,L:xb,T:Lb,S:kb,b:Cb,$:jb,Z:qb,W:Hb,X:zb,N:Wb,Q:Yb,ba:Gb,Y:$b,aa:Kb,q:Jb,O:Xb,J:Zb,o:Qb,P:eg,k:tg,_:rg,p:ng,m:ig,U:sg,d:og,n:cg,D:ug,E:lg,B:dg,C:fg,h:hg,z:pg,G:yg,A:_g,H:mg,f:bg,F:gg,i:vg,y:wg,g:Bg,I:Ig,r:Sg,ca:Tg,da:Fg,t:Og,u:Mg,c:Ug,w:Eg,v:Rg,j:Vg,x:xg,K:Pg,e:Ng,l:Lg,V:so,M:Cg,s:qg},jA=Ub(),Wg=t.___wasm_call_ctors=function(){return(Wg=t.___wasm_call_ctors=t.asm.fa).apply(null,arguments)},Yg=t._main=function(){return(Yg=t._main=t.asm.ga).apply(null,arguments)},Gg=t._duckdb_web_fs_glob_add_path=function(){return(Gg=t._duckdb_web_fs_glob_add_path=t.asm.ia).apply(null,arguments)},$g=t._duckdb_web_clear_response=function(){return($g=t._duckdb_web_clear_response=t.asm.ja).apply(null,arguments)},Kg=t._duckdb_web_fail_with=function(){return(Kg=t._duckdb_web_fail_with=t.asm.ka).apply(null,arguments)},Jg=t._duckdb_web_reset=function(){return(Jg=t._duckdb_web_reset=t.asm.la).apply(null,arguments)},Xg=t._duckdb_web_connect=function(){return(Xg=t._duckdb_web_connect=t.asm.ma).apply(null,arguments)},Zg=t._duckdb_web_disconnect=function(){return(Zg=t._duckdb_web_disconnect=t.asm.na).apply(null,arguments)},Qg=t._duckdb_web_flush_files=function(){return(Qg=t._duckdb_web_flush_files=t.asm.oa).apply(null,arguments)},e0=t._duckdb_web_flush_file=function(){return(e0=t._duckdb_web_flush_file=t.asm.pa).apply(null,arguments)},t0=t._duckdb_web_open=function(){return(t0=t._duckdb_web_open=t.asm.qa).apply(null,arguments)},r0=t._duckdb_web_get_global_file_info=function(){return(r0=t._duckdb_web_get_global_file_info=t.asm.ra).apply(null,arguments)},n0=t._duckdb_web_collect_file_stats=function(){return(n0=t._duckdb_web_collect_file_stats=t.asm.sa).apply(null,arguments)},i0=t._duckdb_web_export_file_stats=function(){return(i0=t._duckdb_web_export_file_stats=t.asm.ta).apply(null,arguments)},s0=t._duckdb_web_fs_drop_file=function(){return(s0=t._duckdb_web_fs_drop_file=t.asm.ua).apply(null,arguments)},o0=t._duckdb_web_fs_drop_files=function(){return(o0=t._duckdb_web_fs_drop_files=t.asm.va).apply(null,arguments)},a0=t._duckdb_web_fs_glob_file_infos=function(){return(a0=t._duckdb_web_fs_glob_file_infos=t.asm.wa).apply(null,arguments)},c0=t._duckdb_web_fs_get_file_info_by_id=function(){return(c0=t._duckdb_web_fs_get_file_info_by_id=t.asm.xa).apply(null,arguments)},u0=t._duckdb_web_fs_get_file_info_by_name=function(){return(u0=t._duckdb_web_fs_get_file_info_by_name=t.asm.ya).apply(null,arguments)},l0=t._duckdb_web_fs_set_file_descriptor=function(){return(l0=t._duckdb_web_fs_set_file_descriptor=t.asm.za).apply(null,arguments)},d0=t._duckdb_web_fs_register_file_url=function(){return(d0=t._duckdb_web_fs_register_file_url=t.asm.Aa).apply(null,arguments)},f0=t._duckdb_web_fs_register_file_buffer=function(){return(f0=t._duckdb_web_fs_register_file_buffer=t.asm.Ba).apply(null,arguments)},h0=t._duckdb_web_copy_file_to_buffer=function(){return(h0=t._duckdb_web_copy_file_to_buffer=t.asm.Ca).apply(null,arguments)},p0=t._duckdb_web_copy_file_to_path=function(){return(p0=t._duckdb_web_copy_file_to_path=t.asm.Da).apply(null,arguments)},y0=t._duckdb_web_get_version=function(){return(y0=t._duckdb_web_get_version=t.asm.Ea).apply(null,arguments)},_0=t._duckdb_web_get_feature_flags=function(){return(_0=t._duckdb_web_get_feature_flags=t.asm.Fa).apply(null,arguments)},m0=t._duckdb_web_tokenize=function(){return(m0=t._duckdb_web_tokenize=t.asm.Ga).apply(null,arguments)},b0=t._duckdb_web_udf_scalar_create=function(){return(b0=t._duckdb_web_udf_scalar_create=t.asm.Ha).apply(null,arguments)},g0=t._duckdb_web_prepared_create=function(){return(g0=t._duckdb_web_prepared_create=t.asm.Ia).apply(null,arguments)},v0=t._duckdb_web_prepared_close=function(){return(v0=t._duckdb_web_prepared_close=t.asm.Ja).apply(null,arguments)},w0=t._duckdb_web_prepared_run=function(){return(w0=t._duckdb_web_prepared_run=t.asm.Ka).apply(null,arguments)},B0=t._duckdb_web_prepared_send=function(){return(B0=t._duckdb_web_prepared_send=t.asm.La).apply(null,arguments)},I0=t._duckdb_web_query_run=function(){return(I0=t._duckdb_web_query_run=t.asm.Ma).apply(null,arguments)},S0=t._duckdb_web_query_send=function(){return(S0=t._duckdb_web_query_send=t.asm.Na).apply(null,arguments)},T0=t._duckdb_web_query_fetch_results=function(){return(T0=t._duckdb_web_query_fetch_results=t.asm.Oa).apply(null,arguments)},A0=t._duckdb_web_get_tablenames=function(){return(A0=t._duckdb_web_get_tablenames=t.asm.Pa).apply(null,arguments)},F0=t._duckdb_web_insert_arrow_from_ipc_stream=function(){return(F0=t._duckdb_web_insert_arrow_from_ipc_stream=t.asm.Qa).apply(null,arguments)},D0=t._duckdb_web_insert_csv_from_path=function(){return(D0=t._duckdb_web_insert_csv_from_path=t.asm.Ra).apply(null,arguments)},O0=t._duckdb_web_insert_json_from_path=function(){return(O0=t._duckdb_web_insert_json_from_path=t.asm.Sa).apply(null,arguments)},Ff=t.___errno_location=function(){return(Ff=t.___errno_location=t.asm.Ta).apply(null,arguments)},lo=t._htonl=function(){return(lo=t._htonl=t.asm.Ua).apply(null,arguments)},fo=t._htons=function(){return(fo=t._htons=t.asm.Va).apply(null,arguments)},Fc=t._ntohs=function(){return(Fc=t._ntohs=t.asm.Wa).apply(null,arguments)},Df=t.stackSave=function(){return(Df=t.stackSave=t.asm.Xa).apply(null,arguments)},Of=t.stackRestore=function(){return(Of=t.stackRestore=t.asm.Ya).apply(null,arguments)},Dc=t.stackAlloc=function(){return(Dc=t.stackAlloc=t.asm.Za).apply(null,arguments)},Oc=t._malloc=function(){return(Oc=t._malloc=t.asm._a).apply(null,arguments)},M0=t._free=function(){return(M0=t._free=t.asm.$a).apply(null,arguments)};t.ccall=cb;var ho;function po(u){this.name="ExitStatus",this.message="Program terminated with exit("+u+")",this.status=u}var U0=!1;ss=function u(){ho||Mc(),ho||(ss=u)};function E0(u){var d=t._main,p=0,_=0;try{var v=d(p,_);return R0(v,!0),v}catch(R){return Eb(R)}finally{U0=!0}}function Mc(u){if(u=u||a,Fn>0||(gb(),Fn>0))return;function d(){ho||(ho=!0,t.calledRun=!0,!mc&&(vb(),wb(),i(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Mf&&E0(u),Ib()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),d()},1)):d()}t.run=Mc;function R0(u,d){eo=u,gc()||Bb(),V0(u)}function V0(u){eo=u,gc()||(t.onExit&&t.onExit(u),mc=!0),f(u,new po(u))}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();var Mf=!0;return t.noInitialRun&&(Mf=!1),Mc(),e.ready}})(),Xm=OA;var Qd=class{constructor(e,t){this._bindings=e,this._conn=t}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let t=this._bindings.runQuery(this._conn,e),n=h.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),h.Table.from(n)}send(e){let t=this._bindings.sendQuery(this._conn,e),n=new ef(this._bindings,this._conn,t),i=h.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}getTableNames(e){return this._bindings.getTableNames(this._conn,e)}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new Qm(this._bindings,this._conn,t)}createScalarFunction(e,t,n){this._bindings.createScalarFunction(this._conn,e,t,n)}insertArrowTable(e,t){let n=e.serialize("binary",!0);this.insertArrowFromIPCStream(n,t)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},ef=class{constructor(e,t,n){this.bindings=e;this.conn=t;this.header=n;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},Qm=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),n=h.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),h.Table.from(n)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new ef(this.bindings,this.connectionId,t),i=h.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}};var MA=new TextEncoder;function tf(r,e,t){let n=MA.encode(t),i=r._malloc(n.byteLength),s=r.HEAPU8.subarray(i,i+n.byteLength);s.set(n),r.HEAPF64[(e>>3)+0]=1,r.HEAPF64[(e>>3)+1]=i,r.HEAPF64[(e>>3)+2]=s.byteLength}function eb(r,e,t,n,i,s){try{let o=r._udfFunctions.get(n);if(!o){tf(e,t,"unknown udf with id: "+n);return}let a=e.HEAPU8.subarray(i,i+s),c=h.RecordBatchFileReader.from(a);c.open();let f=c.next();if(f.done)return;let y=f.value,B;switch(o.returnType.typeId){case h.Type.Int:case h.Type.Int32:B=new h.Int32Builder({type:new h.Int32});break;default:tf(e,t,"unsupported result type: "+o.returnType.toString());return}let D=[],A=[];for(let xt=0;xt<y.numCols;++xt)D.push(y.getChildAt(xt)),A.push(null);for(let xt=0;xt<y.length;++xt){for(let Pr=0;Pr<y.numCols;++Pr)A[Pr]=D[Pr].get(xt)||null;let Qn=o.func(...A);B.append(Qn)}let J=new h.Schema([new h.Field("0",new h.Int32,!0)]),te=new h.RecordBatch(J,B.length,[B.toVector()]),ae=new h.RecordBatchStreamWriter;ae.write(te),ae.finish();let fe=ae.toUint8Array(!0),at=e._malloc(fe.byteLength),br=e.HEAPU8.subarray(at,at+fe.byteLength);br.set(fe),e.HEAPF64[(t>>3)+0]=0,e.HEAPF64[(t>>3)+1]=at,e.HEAPF64[(t>>3)+2]=br.byteLength}catch(o){tf(e,t,o.toString())}}function EA(){let r=new TextDecoder;return e=>(typeof SharedArrayBuffer!="undefined"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),r.decode(e))}var RA=EA();function mr(r,e){r.ccall("duckdb_web_fail_with",null,["string"],[e])}function ts(r,e,t){let n=r.HEAPU8.subarray(e,e+t),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function ne(r,e,t){return RA(r.HEAPU8.subarray(e,e+t))}function de(r,e,t,n){let i=r.stackSave(),s=r.stackAlloc(3*8);t.unshift("number"),n.unshift(s),r.ccall(e,null,t,n);let o=r.HEAPF64[(s>>3)+0],a=r.HEAPF64[(s>>3)+1],c=r.HEAPF64[(s>>3)+2];return r.stackRestore(i),[o,a,c]}function Be(r){r.ccall("duckdb_web_clear_response",null,[],[])}var rf=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),n=new Uint8Array(new ArrayBuffer(e.byteLength));n.set(e.subarray(7*8)),this.totalFileReadsCold=t[0],this.totalFileReadsAhead=t[1],this.totalFileReadsCached=t[2],this.totalFileWrites=t[3],this.totalPageAccesses=t[4],this.totalPageLoads=t[5],this.blockSize=t[6],this.blockStats=n}getBlockStats(e,t){return t=t||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},t.file_writes=this.blockStats[e*3+0]&15,t.file_reads_cold=this.blockStats[e*3+0]>>4,t.file_reads_ahead=this.blockStats[e*3+1]&15,t.file_reads_cached=this.blockStats[e*3+1]>>4,t.page_accesses=this.blockStats[e*3+1]&15,t.page_loads=this.blockStats[e*3+1]>>4,t}};var VA=new TextEncoder;var nf=class{constructor(e,t){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this.onInstantiationProgress=[];this._logger=e,this._runtime=t,this._nextUDFId=1}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(e=t=>{}){return this._instance!=null?this:(this._initPromise!=null&&(this.onInstantiationProgress.push(e),await this._initPromise),this._initPromise=new Promise(t=>{this._initPromiseResolver=t}),this.onInstantiationProgress=[e],this._instance=await this.instantiateImpl({print:console.log.bind(console),printErr:console.log.bind(console),onRuntimeInitialized:this._initPromiseResolver}),await this._initPromise,this._initPromise=null,this.onInstantiationProgress=this.onInstantiationProgress.filter(t=>t!=e),this)}open(e){let[t,n,i]=de(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(ne(this.mod,n,i));Be(this.mod)}reset(){let[e,t,n]=de(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(ne(this.mod,t,n));Be(this.mod)}getVersion(){let[e,t,n]=de(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(ne(this.mod,t,n));let i=ne(this.mod,t,n);return Be(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,n,i]=de(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==0)throw new Error(ne(this.mod,n,i));let s=ne(this.mod,n,i);return Be(this.mod),JSON.parse(s)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Qd(this,e)}disconnect(e){if(this.mod.ccall("duckdb_web_disconnect",null,["number"],[e]),this.pthread)for(let t of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])t.postMessage({cmd:"dropUDFFunctions",connectionId:e})}runQuery(e,t){let[n,i,s]=de(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(n!==0)throw new Error(ne(this.mod,i,s));let o=ts(this.mod,i,s);return Be(this.mod),o}sendQuery(e,t){let[n,i,s]=de(this.mod,"duckdb_web_query_send",["number","string"],[e,t]);if(n!==0)throw new Error(ne(this.mod,i,s));let o=ts(this.mod,i,s);return Be(this.mod),o}fetchQueryResults(e){let[t,n,i]=de(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==0)throw new Error(ne(this.mod,n,i));let s=ts(this.mod,n,i);return Be(this.mod),s}getTableNames(e,t){let[n,i,s]=de(this.mod,"duckdb_web_get_tablenames",["number","string"],[e,t]);if(n!==0)throw new Error(ne(this.mod,i,s));let o=ne(this.mod,i,s);return Be(this.mod),JSON.parse(o)}createScalarFunction(e,t,n,i){let s={functionId:this._nextUDFId,name:t,returnType:Jd(n)},o={functionId:s.functionId,connectionId:e,name:t,returnType:n,func:i};this._nextUDFId+=1;let[a,c,f]=de(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(s)]);if(a!==0)throw new Error(ne(this.mod,c,f));if(Be(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let y of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])y.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(e,t){let[n,i,s]=de(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(n!==0)throw new Error(ne(this.mod,i,s));return Be(this.mod),i}closePrepared(e,t){let[n,i,s]=de(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(n!==0)throw new Error(ne(this.mod,i,s));Be(this.mod)}runPrepared(e,t,n){let[i,s,o]=de(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==0)throw new Error(ne(this.mod,s,o));let a=ts(this.mod,s,o);return Be(this.mod),a}sendPrepared(e,t,n){let[i,s,o]=de(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==0)throw new Error(ne(this.mod,s,o));let a=ts(this.mod,s,o);return Be(this.mod),a}insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let o=n?JSON.stringify(n):"",[a,c,f]=de(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,t.length,o]);if(a!==0)throw new Error(ne(this.mod,c,f))}insertCSVFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let f in n.columns)n.columnsFlat.push(Zs(f,n.columns[f]))}let i=kr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,a,c]=de(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,s]);if(o!==0)throw new Error(ne(this.mod,a,c))}insertJSONFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let f in n.columns)n.columnsFlat.push(Zs(f,n.columns[f]))}let i=kr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,a,c]=de(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,s]);if(o!==0)throw new Error(ne(this.mod,a,c))}globFiles(e){let[t,n,i]=de(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(ne(this.mod,n,i));let s=ne(this.mod,n,i);Be(this.mod);let o=JSON.parse(s);return o==null?[]:o}registerFileURL(e,t){t===void 0&&(t=e);let[n,i,s]=de(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[e,t,-1]);if(n!==0)throw new Error(ne(this.mod,i,s));Be(this.mod)}registerFileText(e,t){let n=VA.encode(t);this.registerFileBuffer(e,n)}registerFileBuffer(e,t){let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let[s,o,a]=de(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,t.length]);if(s!==0)throw new Error(ne(this.mod,o,a));Be(this.mod)}registerFileHandle(e,t){let[n,i,s]=de(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[e,e,-1]);if(n!==0)throw new Error(ne(this.mod,i,s));if(Be(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let o of this.pthread.runningWorkers)o.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let o of this.pthread.unusedWorkers)o.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){let[t,n,i]=de(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(ne(this.mod,n,i));Be(this.mod)}dropFiles(){let[e,t,n]=de(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(ne(this.mod,t,n));Be(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[n,i,s]=de(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(n!==0)throw new Error(ne(this.mod,i,s));Be(this.mod)}copyFileToBuffer(e){let[t,n,i]=de(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(ne(this.mod,n,i));let s=this.mod.HEAPU8.subarray(n,n+i),o=new Uint8Array(s.length);return o.set(s),Be(this.mod),o}collectFileStatistics(e,t){let[n,i,s]=de(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(n!==0)throw new Error(ne(this.mod,i,s))}exportFileStatistics(e){let[t,n,i]=de(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(ne(this.mod,n,i));return new rf(this.mod.HEAPU8.subarray(n,n+i))}};var sf=class extends nf{constructor(e,t,n,i){super(e,t);this.mainModuleURL=n,this.pthreadWorkerURL=i}locateFile(e,t){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error(`WASM instantiation requested unexpected file: prefix=${t} path=${e}`)}instantiateWasm(e,t){globalThis.DUCKDB_RUNTIME=this._runtime;let n=this.onInstantiationProgress,i={lastEvent:new Date};if(typeof TransformStream=="function"&&ReadableStream.prototype.pipeThrough){let o=(async()=>{var A;let a=new Request(this.mainModuleURL),c=await fetch(a),f=c.headers.get("Content-Length"),y;f?y=parseInt(f,10)||0:y=await new Promise((J,te)=>{let ae=new XMLHttpRequest;ae.open("HEAD",this.mainModuleURL,!0),ae.onreadystatechange=()=>{if(ae.readyState==ae.DONE){let fe=ae.getResponseHeader("Content-Length");return J(fe?parseInt(fe):null)}},ae.onerror=fe=>J(null),ae.send()});let B={startedAt:new Date,bytesTotal:y||0,bytesLoaded:0},D=new TransformStream({transform(J,te){B.bytesLoaded+=J.byteLength;let ae=new Date;if(ae.getTime()-i.lastEvent.getTime()<100){i.lastEvent=ae,te.enqueue(J);return}for(let fe of n)fe(B);te.enqueue(J)}});return new Response((A=c.body)==null?void 0:A.pipeThrough(D),c)})();WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(o,e).then(a=>{t(a.instance,a.module)}):o.then(a=>a.arrayBuffer()).then(a=>WebAssembly.instantiate(a,e).then(c=>{t(c.instance,c.module)}).catch(c=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+c}),new Error(c)})).catch(a=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+a}),new Error(a)})}else{let s=new XMLHttpRequest,o=this.mainModuleURL,a={startedAt:new Date,bytesTotal:0,bytesLoaded:0};s.open("GET",o),s.responseType="arraybuffer",s.onerror=c=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+c}),new Error(c.toString())},s.onprogress=c=>{a.bytesTotal=c.total,a.bytesLoaded=c.loaded;for(let f of n)f(a)},s.onload=()=>{WebAssembly.instantiate(s.response,e).then(c=>{t(c.instance,c.module)}).catch(c=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+c}),new Error(c)})},s.send()}return[]}};var of=class extends sf{constructor(e,t,n,i=null){super(e,t,n,i)}instantiateImpl(e){return Xm(ls(kr({},e),{instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)}))}};var Sn=Kt(tb()),xA=function(r,e,t){var i,s,o,a;let n=rb(e);return{url:n.path,query:"",host:`${n.bucket}.s3.amazonaws.com`,region:(i=r==null?void 0:r.region)!=null?i:"",service:"s3",method:t,accessKeyId:(s=r==null?void 0:r.accessKeyId)!=null?s:"",secretAccessKey:(o=r==null?void 0:r.secretAccessKey)!=null?o:"",sessionToken:(a=r==null?void 0:r.sessionToken)!=null?a:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}};function PA(r,e=!1){let t="0123456789ABCDEF",n="";for(let i=0;i<r.length;i++){let s=r[i];s>="A"&&s<="Z"||s>="a"&&s<="z"||s>="0"&&s<="9"||s=="_"||s=="-"||s=="~"||s=="."?n+=s:s=="/"?e?n+="%2F":n+=s:(n+="%",n+=t[s.charCodeAt(0)>>4],n+=t[s.charCodeAt(0)&15])}return n}function NA(r,e=null){var J;let t=(J=e==null?void 0:e.contentHash)!=null?J:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",n=new Map;n.set("x-amz-date",r.datetimeNow),n.set("x-amz-content-sha256",t),r.sessionToken&&n.set("x-amz-security-token",r.sessionToken);let i="";(e==null?void 0:e.contentType)&&(i+="content-type;"),i+="host;x-amz-content-sha256;x-amz-date",r.sessionToken&&(i+=";x-amz-security-token");let s=r.method+`
|
|
19
|
-
`+PA(r.url)+`
|
|
20
|
-
`+r.query;(e==null?void 0:e.contentType)&&(s+=`
|
|
21
|
-
content-type:`+(e==null?void 0:e.contentType)),s+=`
|
|
5
|
+
}`),r.length!==e.length&&(t=`if (x !== x) return false;
|
|
6
|
+
${t}`),new Function("x",`${t}
|
|
7
|
+
return true;`)}function Sm(r){return typeof r!="bigint"?He(r):ps?`${He(r)}n`:`"${He(r)}"`}var Ua=(r,t)=>(r*t+63&-64||64)/t,Im=(r,t=0)=>r.length>=t?r.subarray(0,t):Dn(new r.constructor(t),r,0),Yr=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,n=this.length*e,i=this.buffer.length;n>=i&&this._resize(i===0?Ua(n*1,this.BYTES_PER_ELEMENT):Ua(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Ua(t*this.stride,this.BYTES_PER_ELEMENT);let e=Im(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Dn(new this.ArrayType(t),this.buffer)}};Yr.prototype.offset=0;var Er=class extends Yr{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}},Pn=class extends Er{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:n}=this.reserve(t-this.length+1),i=t>>3,s=t%8,o=n[i]>>s&1;return e?o===0&&(n[i]|=1<<s,++this.numValid):o===1&&(n[i]&=~(1<<s),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Vn=class extends Er{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,e){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&i.fill(i[n],n,t),i[t]=i[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}};var mt=class{constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=Se(t),this._nulls=new Pn,e&&e.length>0&&(this._isValid=hu(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 L([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:n,_nulls:i,_typeIds:s,children:o}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),o.reduce((a,c)=>a+c.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,n)=>e+n.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,n,i,{type:s,length:o,nullCount:a,_typeIds:c,_offsets:d,_values:p,_nulls:b}=this;(e=c==null?void 0:c.flush(o))?i=d==null?void 0:d.flush(o):(i=d==null?void 0:d.flush(o))?t=p==null?void 0:p.flush(d.last()):t=p==null?void 0:p.flush(o),a>0&&(n=b==null?void 0:b.flush(o));let y=this.children.map(S=>S.flush());return this.clear(),C({type:s,length:o,nullCount:a,children:y,child:y[0],data:t,typeIds:e,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(e=this._values)===null||e===void 0||e.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let s of this.children)s.clear();return this}};mt.prototype.length=1;mt.prototype.stride=1;mt.prototype.children=null;mt.prototype.finished=!1;mt.prototype.nullValues=null;mt.prototype._isValid=()=>!0;var Nt=class extends mt{constructor(t){super(t),this._values=new Er(new this.ArrayType(0),this.stride)}setValue(t,e){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,e)}},sr=class extends mt{constructor(t){super(t),this._pendingLength=0,this._offsets=new Vn}setValue(t,e){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=e instanceof nr?e[Me].length:e.length,n.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 yn=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,n,i){return t.prep(8,24),t.writeInt64(i),t.pad(4),t.writeInt32(n),t.writeInt64(e),t.offset()}};var or=new Int32Array(2),to=new Float32Array(or.buffer),eo=new Float64Array(or.buffer),Hn=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Tt=class{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Tt.ZERO:new Tt(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};Tt.ZERO=new Tt(0,0);var wi;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(wi||(wi={}));var ie=class{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new ie(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 Tt(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new Tt(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return or[0]=this.readInt32(t),to[0]}readFloat64(t){return or[Hn?0:1]=this.readInt32(t),or[Hn?1:0]=this.readInt32(t+4),eo[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){to[0]=e,this.writeInt32(t,or[0])}writeFloat64(t,e){eo[0]=e,this.writeInt32(t,or[Hn?0:1]),this.writeInt32(t+4,or[Hn?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 n=t-this.readInt32(t);return e<this.readInt16(n)?this.readInt16(n+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 n=this.readInt32(t),i="",s=0;if(t+=4,e===wi.UTF8_BYTES)return this.bytes_.subarray(t,t+n);for(;s<n;){let o,a=this.readUint8(t+s++);if(a<192)o=a;else{let c=this.readUint8(t+s++);if(a<224)o=(a&31)<<6|c&63;else{let d=this.readUint8(t+s++);if(a<240)o=(a&15)<<12|(c&63)<<6|d&63;else{let p=this.readUint8(t+s++);o=(a&7)<<18|(c&63)<<12|(d&63)<<6|p&63}}}o<65536?i+=String.fromCharCode(o):(o-=65536,i+=String.fromCharCode((o>>10)+55296,(o&(1<<10)-1)+56320))}return i}__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 Tt.create(t,e)}createScalarList(t,e){let n=[];for(let i=0;i<e;++i)t(i)!==null&&n.push(t(i));return n}createObjList(t,e){let n=[];for(let i=0;i<e;++i){let s=t(i);s!==null&&n.push(s.unpack())}return n}};var Or=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=ie.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 n=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<n+t+e;){let i=this.bb.capacity();this.bb=Or.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}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,n){(this.force_defaults||e!=n)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,n){(this.force_defaults||e!=n)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,n){(this.force_defaults||e!=n)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,n){(this.force_defaults||!e.equals(n))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,n){(this.force_defaults||e!=n)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,n){e!=n&&(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 n=e<<1,i=ie.allocate(n);return i.setPosition(n-e),i.bytes().set(t.bytes(),n-e),i}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 n=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);let i=2;this.addInt16(t-this.object_start);let s=(n+i)*2;this.addInt16(s);let o=0,a=this.space;t:for(e=0;e<this.vtables.length;e++){let c=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(c)){for(let d=2;d<s;d+=2)if(this.bb.readInt16(a+d)!=this.bb.readInt16(c+d))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,n){let i=n?4:0;if(e){let s=e;if(this.prep(this.minalign,4+4+i),s.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let o=4-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,4+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){let n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(this.bb.readInt16(i+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(n,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 n=0;for(;n<t.length;){let i,s=t.charCodeAt(n++);if(s<55296||s>=56320)i=s;else{let o=t.charCodeAt(n++);i=(s<<10)+o+(65536-(55296<<10)-56320)}i<128?e.push(i):(i<2048?e.push(i>>6&31|192):(i<65536?e.push(i>>12&15|224):e.push(i>>18&7|240,i>>12&63|128),e.push(i>>6&63|128)),e.push(i&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let n=0,i=this.space,s=this.bb.bytes();n<e.length;n++)s[i++]=e[n];return this.endVector()}createLong(t,e){return Tt.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let e=[];for(let n=0;n<t.length;++n){let i=t[n];if(i!==null)e.push(this.createObjectOffset(i));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 dt=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 dt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new dt).__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,n){return dt.startKeyValue(t),dt.addKey(t,e),dt.addValue(t,n),dt.endKeyValue(t)}};var Xr;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(Xr||(Xr={}));var Gr;(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Gr||(Gr={}));var vi;(function(r){r[r.DenseArray=0]="DenseArray"})(vi||(vi={}));var kt=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 kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new kt).__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,n){return kt.startInt(t),kt.addBitWidth(t,e),kt.addIsSigned(t,n),kt.endInt(t)}};var Ae=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 Ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new Ae).__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 kt).__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):vi.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,vi.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var ar=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 ar).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new ar).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return ar.startBinary(t),ar.endBinary(t)}};var cr=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 cr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new cr).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return cr.startBool(t),cr.endBool(t)}};var Si;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Si||(Si={}));var le=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 le).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new le).__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):Si.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Si.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return le.startDate(t),le.addUnit(t,e),le.endDate(t)}};var Lt=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 Lt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new Lt).__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,n,i){return Lt.startDecimal(t),Lt.addPrecision(t,e),Lt.addScale(t,n),Lt.addBitWidth(t,i),Lt.endDecimal(t)}};var Kr;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(Kr||(Kr={}));var ue=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 ue).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new ue).__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 ue.startFixedSizeBinary(t),ue.addByteWidth(t,e),ue.endFixedSizeBinary(t)}};var de=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 de).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new de).__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 de.startFixedSizeList(t),de.addListSize(t,e),de.endFixedSizeList(t)}};var Ii;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(Ii||(Ii={}));var fe=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 fe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new fe).__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):Ii.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Ii.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return fe.startFloatingPoint(t),fe.addPrecision(t,e),fe.endFloatingPoint(t)}};var Ai;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ai||(Ai={}));var he=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 he).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new he).__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):Ai.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Ai.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return he.startInterval(t),he.addUnit(t,e),he.endInterval(t)}};var lr=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 lr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new lr).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return lr.startList(t),lr.endList(t)}};var pe=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 pe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new pe).__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 pe.startMap(t),pe.addKeysSorted(t,e),pe.endMap(t)}};var ur=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 ur).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+4),(e||new ur).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return ur.startNull(t),ur.endNull(t)}};var dr=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 dr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new dr).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return dr.startStruct_(t),dr.endStruct_(t)}};var Kt=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 Kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new Kt).__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):Kr.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,Kr.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,n){return Kt.startTime(t),Kt.addUnit(t,e),Kt.addBitWidth(t,n),Kt.endTime(t)}};var Jt=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 Jt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new Jt).__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):Kr.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,Kr.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,n){return Jt.startTimestamp(t),Jt.addUnit(t,e),Jt.addTimezone(t,n),Jt.endTimestamp(t)}};var Fi;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(Fi||(Fi={}));var Ct=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 Ct).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new Ct).__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):Fi.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,Fi.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,n){return Ct.startUnion(t),Ct.addMode(t,e),Ct.addTypeIds(t,n),Ct.endUnion(t)}};var fr=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 fr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new fr).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return fr.startUtf8(t),fr.endUtf8(t)}};var yt;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList"})(yt||(yt={}));var Dt=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 Dt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new Dt).__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):yt.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 Ae).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?(e||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?(e||new dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,yt.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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}};var wt=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 wt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new wt).__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):Gr.Little}fields(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let 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,Gr.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);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 n=e.length-1;n>=0;n--)t.addInt64(e[n]);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,n,i,s){return wt.startSchema(t),wt.addEndianness(t,e),wt.addFields(t,n),wt.addCustomMetadata(t,i),wt.addFeatures(t,s),wt.endSchema(t)}};var qt=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 qt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new qt).__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):Xr.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new wt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new yn).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){let n=this.bb.__offset(this.bb_pos,10);return n?(e||new yn).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let n=this.bb.__offset(this.bb_pos,12);return n?(e||new dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Xr.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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);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 G=class{constructor(t=[],e,n){this.fields=t||[],this.metadata=e||new Map,n||(n=Na(t)),this.dictionaries=n}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),n=this.fields.filter(i=>e.has(i.name));return new G(n,this.metadata)}selectAt(t){let e=t.map(n=>this.fields[n]).filter(Boolean);return new G(e,this.metadata)}assign(...t){let e=t[0]instanceof G?t[0]:Array.isArray(t[0])?new G(t[0]):new G(t),n=[...this.fields],i=no(no(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{let c=n.findIndex(d=>d.name===a.name);return~c?(n[c]=a.clone({metadata:no(no(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=Na(s,new Map);return new G([...n,...s],i,new Map([...this.dictionaries,...o]))}};G.prototype.fields=null;G.prototype.metadata=null;G.prototype.dictionaries=null;var H=class{constructor(t,e,n=!1,i){this.name=t,this.type=e,this.nullable=n,this.metadata=i||new Map}static new(...t){let[e,n,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new H(`${e}`,n,i,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,i,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,i=this.nullable,s=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],H.new(e,n,i,s)}};H.prototype.type=null;H.prototype.name=null;H.prototype.nullable=null;H.prototype.metadata=null;function no(r,t){return new Map([...r||new Map,...t||new Map])}function Na(r,t=new Map){for(let e=-1,n=r.length;++e<n;){let s=r[e].type;if(F.isDictionary(s)){if(!t.has(s.id))t.set(s.id,s.dictionary);else if(t.get(s.id)!==s.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}s.children&&s.children.length>0&&Na(s.children,t)}return t}var pu=Tt,Am=Or,Fm=ie,Mr=class{constructor(t,e=Ut.V4,n,i){this.schema=t,this.version=e,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}static decode(t){t=new Fm(N(t));let e=qt.getRootAsFooter(t),n=G.decode(e.schema());return new ka(n,e)}static encode(t){let e=new Am,n=G.encode(e,t.schema);qt.startRecordBatchesVector(e,t.numRecordBatches);for(let o of[...t.recordBatches()].slice().reverse())Je.encode(e,o);let i=e.endVector();qt.startDictionariesVector(e,t.numDictionaries);for(let o of[...t.dictionaryBatches()].slice().reverse())Je.encode(e,o);let s=e.endVector();return qt.startFooter(e),qt.addSchema(e,n),qt.addVersion(e,Ut.V4),qt.addRecordBatches(e,i),qt.addDictionaries(e,s),qt.finishFooterBuffer(e,qt.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,e=-1,n=this.numRecordBatches;++e<n;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,n=this.numDictionaries;++e<n;)(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 ka=class extends Mr{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 Je.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return Je.decode(e)}return null}},Je=class{constructor(t,e,n){this.metaDataLength=t,this.offset=typeof n=="number"?n:n.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new Je(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:n}=e,i=new pu(e.offset,0),s=new pu(e.bodyLength,0);return yn.createBlock(t,i,n,s)}};var ft=Object.freeze({done:!0,value:void 0}),xi=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},_n=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())}},io=class extends _n{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return I(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(ft);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return $t.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return $t.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return I(this,void 0,void 0,function*(){return yield this.abort(t),ft})}return(t){return I(this,void 0,void 0,function*(){return yield this.close(),ft})}read(t){return I(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return I(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,n)=>{this.resolvers.push({resolve:e,reject:n})}):Promise.resolve(ft)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var hr=class extends io{write(t){if((t=N(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?ui(this.toUint8Array(!0)):this.toUint8Array(!1).then(ui)}toUint8Array(t=!1){return t?we(this._values)[0]:(()=>I(this,void 0,void 0,function*(){var e,n;let i=[],s=0;try{for(var o=De(this),a;a=yield o.next(),!a.done;){let c=a.value;i.push(c),s+=c.byteLength}}catch(c){e={error:c}}finally{try{a&&!a.done&&(n=o.return)&&(yield n.call(o))}finally{if(e)throw e.error}}return we(i,s)[0]}))()}},pr=class{constructor(t){t&&(this.source=new La($t.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)}},me=class{constructor(t){t instanceof me?this.source=t.source:t instanceof hr?this.source=new Rr($t.fromAsyncIterable(t)):ws(t)?this.source=new Rr($t.fromNodeStream(t)):fi(t)?this.source=new Rr($t.fromDOMStream(t)):bs(t)?this.source=new Rr($t.fromDOMStream(t.body)):Pe(t)?this.source=new Rr($t.fromIterable(t)):Ce(t)?this.source=new Rr($t.fromAsyncIterable(t)):Ee(t)&&(this.source=new Rr($t.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)}},La=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)||ft)}return(t){return Object.create(this.source.return&&this.source.return(t)||ft)}},Rr=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return I(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return I(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return I(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return I(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return I(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||ft;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return I(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||ft;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Bi=class extends pr{constructor(t,e){super(),this.position=0,this.buffer=N(t),this.size=typeof e>"u"?this.buffer.byteLength:e}readInt32(t){let{buffer:e,byteOffset:n}=this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:e,size:n,position:i}=this;return e&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),e.subarray(i,this.position)):null}readAt(t,e){let n=this.buffer,i=Math.min(this.size,t+e);return n?n.subarray(t,i):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}}},Jr=class extends me{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=(()=>I(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending}))()}readInt32(t){return I(this,void 0,void 0,function*(){let{buffer:e,byteOffset:n}=yield this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)})}seek(t){return I(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 I(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:n,position:i}=this;if(e&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let s=i,o=0,a=0,c=Math.min(n,s+Math.min(n-s,t)),d=new Uint8Array(Math.max(0,(this.position=c)-s));for(;(s+=a)<c&&(o+=a)<d.byteLength;)({bytesRead:a}=yield e.read(d,o,d.byteLength-o,s));return d}return null})}readAt(t,e){return I(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+e<i){let s=Math.min(i,t+e),o=new Uint8Array(s-t);return(yield n.read(o,0,e,t)).buffer}return new Uint8Array(e)})}close(){return I(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return I(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return I(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var Pa={};ln(Pa,{BaseInt64:()=>Ti,Int128:()=>ye,Int64:()=>Pt,Uint64:()=>rt});function zn(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var jn=8,Ca=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Ti=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]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<i?65536:0,this.buffer[1]+=s>>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[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`${zn(this.buffer[1])} ${zn(this.buffer[0])}`}},rt=class extends Ti{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return rt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return rt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let n=t.length,i=new rt(e);for(let s=0;s<n;){let o=jn<n-s?jn:n-s,a=new rt(new Uint32Array([Number.parseInt(t.slice(s,s+o),10),0])),c=new rt(new Uint32Array([Ca[o],0]));i.times(c),i.plus(a),s+=o}return i}static convertArray(t){let e=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)rt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new rt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new rt(new Uint32Array(t.buffer)).plus(e)}},Pt=class extends Ti{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,n=t.buffer[1]<<0;return e<n||e===n&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return Pt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Pt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,s=new Pt(e);for(let o=n?1:0;o<i;){let a=jn<i-o?jn:i-o,c=new Pt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0])),d=new Pt(new Uint32Array([Ca[a],0]));s.times(d),s.plus(c),o+=a}return n?s.negate():s}static convertArray(t){let e=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)Pt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new Pt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Pt(new Uint32Array(t.buffer)).plus(e)}},ye=class{constructor(t){this.buffer=t}high(){return new Pt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Pt(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 rt(new Uint32Array([this.buffer[3],0])),n=new rt(new Uint32Array([this.buffer[2],0])),i=new rt(new Uint32Array([this.buffer[1],0])),s=new rt(new Uint32Array([this.buffer[0],0])),o=new rt(new Uint32Array([t.buffer[3],0])),a=new rt(new Uint32Array([t.buffer[2],0])),c=new rt(new Uint32Array([t.buffer[1],0])),d=new rt(new Uint32Array([t.buffer[0],0])),p=rt.multiply(s,d);this.buffer[0]=p.low();let b=new rt(new Uint32Array([p.high(),0]));return p=rt.multiply(i,d),b.plus(p),p=rt.multiply(s,c),b.plus(p),this.buffer[1]=b.low(),this.buffer[3]=b.lessThan(p)?1:0,this.buffer[2]=b.high(),new rt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(rt.multiply(n,d)).plus(rt.multiply(i,c)).plus(rt.multiply(s,a)),this.buffer[3]+=rt.multiply(e,d).plus(rt.multiply(n,c)).plus(rt.multiply(i,a)).plus(rt.multiply(s,o)).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`${zn(this.buffer[3])} ${zn(this.buffer[2])} ${zn(this.buffer[1])} ${zn(this.buffer[0])}`}static multiply(t,e){return new ye(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ye(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ye.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ye.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,s=new ye(e);for(let o=n?1:0;o<i;){let a=jn<i-o?jn:i-o,c=new ye(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0,0,0])),d=new ye(new Uint32Array([Ca[a],0,0,0]));s.times(d),s.plus(c),o+=a}return n?s.negate():s}static convertArray(t){let e=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)ye.from(t[n],new Uint32Array(e.buffer,e.byteOffset+4*4*n,4));return e}};var Di=class extends D{constructor(t,e,n,i){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=n,this.dictionaries=i}visit(t){return super.visit(t instanceof H?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return C({type:t,length:e})}visitBool(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===gt.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:n}=this.nextFieldNode()){return C({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),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,n=this.nextBufferRange()){return e>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}},so=class extends Di{constructor(t,e,n,i){super(new Uint8Array(0),e,n,i),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):hn(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return $(Uint8Array,$(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return $(Uint8Array,$(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:n}=this;return F.isTimestamp(t)?$(Uint8Array,Pt.convertArray(n[e])):(F.isInt(t)||F.isTime(t))&&t.bitWidth===64?$(Uint8Array,Pt.convertArray(n[e])):F.isDate(t)&&t.unit===Yt.MILLISECOND?$(Uint8Array,Pt.convertArray(n[e])):F.isDecimal(t)?$(Uint8Array,ye.convertArray(n[e])):F.isBinary(t)||F.isFixedSizeBinary(t)?xm(n[e]):F.isBool(t)?hn(n[e]):F.isUtf8(t)?Vr(n[e].join("")):$(Uint8Array,$(t.ArrayType,n[e].map(i=>+i)))}};function xm(r){let t=r.join(""),e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n>>1]=Number.parseInt(t.slice(n,n+2),16);return e}var Wn=class extends sr{constructor(t){super(t),this._values=new Yr(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,N(e))}_flushPending(t,e){let n=this._offsets,i=this._values.reserve(e).buffer,s=0;for(let[o,a]of t)if(a===void 0)n.set(o,0);else{let c=a.length;i.set(a,s),n.set(o,c),s+=c}}};var oo=class extends mt{constructor(t){super(t),this._values=new Pn}setValue(t,e){this._values.set(t,+e)}};var bn=class extends Nt{};bn.prototype._setValue=wa;var Ei=class extends bn{};Ei.prototype._setValue=Us;var Oi=class extends bn{};Oi.prototype._setValue=Ns;var Mi=class extends Nt{};Mi.prototype._setValue=Ia;var ao=class extends mt{constructor({type:t,nullValues:e,dictionaryHashFunction:n}){super({type:new ve(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=gn({type:this.type.indices,nullValues:e}),this.dictionary=gn({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}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 n=this.indices;return e=n.setValid(t,e),this.length=n.length,e}setValue(t,e){let n=this._keysToIndices,i=this.valueToKey(e),s=n[i];return s===void 0&&(n[i]=s=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,s)}flush(){let t=this.type,e=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=e?e.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}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 Ri=class extends Nt{};Ri.prototype._setValue=ga;var co=class extends mt{setValue(t,e){let[n]=this.children,i=t*this.stride;for(let s=-1,o=e.length;++s<o;)n.set(i+s,e[s])}addChild(t,e="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new Ye(this.type.listSize,new H(e,t.type,!0)),n}};var wn=class extends Nt{setValue(t,e){this._values.set(t,e)}},lo=class extends wn{setValue(t,e){super.setValue(t,mi(e))}},uo=class extends wn{},fo=class extends wn{};var vn=class extends Nt{};vn.prototype._setValue=Aa;var Ui=class extends vn{};Ui.prototype._setValue=Ws;var Ni=class extends vn{};Ni.prototype._setValue=$s;var Ue=class extends Nt{setValue(t,e){this._values.set(t,e)}},ho=class extends Ue{},po=class extends Ue{},mo=class extends Ue{},yo=class extends Ue{},_o=class extends Ue{},bo=class extends Ue{},go=class extends Ue{},wo=class extends Ue{};var vo=class extends sr{constructor(t){super(t),this._offsets=new Vn}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 We(new H(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[n]=this.children;for(let[i,s]of t)if(s===void 0)e.set(i,0);else{let o=s.length,a=e.set(i,o).buffer[i];for(let c=-1;++c<o;)n.set(a+c,s[c])}}};var So=class extends sr{set(t,e){return super.set(t,e)}setValue(t,e){let n=e instanceof Map?e:new Map(Object.entries(e)),i=this._pending||(this._pending=new Map),s=i.get(t);s&&(this._pendingLength-=s.size),this._pendingLength+=n.size,i.set(t,n)}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 Xe(new H(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[n]=this.children;for(let[i,s]of t)if(s===void 0)e.set(i,0);else{let{[i]:o,[i+1]:a}=e.set(i,s.size).buffer;for(let c of s.entries())if(n.set(o,c),++o>=a)break}}};var Io=class extends mt{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var Ao=class extends mt{setValue(t,e){let{children:n,type:i}=this;switch(Array.isArray(e)||e.constructor){case!0:return i.children.forEach((s,o)=>n[o].set(t,e[o]));case Map:return i.children.forEach((s,o)=>n[o].set(t,e.get(s.name)));default:return i.children.forEach((s,o)=>n[o].set(t,e[s.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(n=>n.setValid(t,e)),e}addChild(t,e=`${this.numChildren}`){let n=this.children.push(t);return this.type=new ut([...this.type.children,new H(e,t.type,!0)]),n}};var Ur=class extends Nt{};Ur.prototype._setValue=va;var ki=class extends Ur{};ki.prototype._setValue=ks;var Li=class extends Ur{};Li.prototype._setValue=Ls;var Ci=class extends Ur{};Ci.prototype._setValue=Cs;var Pi=class extends Ur{};Pi.prototype._setValue=Ps;var Nr=class extends Nt{};Nr.prototype._setValue=Sa;var Vi=class extends Nr{};Vi.prototype._setValue=Vs;var Hi=class extends Nr{};Hi.prototype._setValue=Hs;var zi=class extends Nr{};zi.prototype._setValue=zs;var ji=class extends Nr{};ji.prototype._setValue=js;var $n=class extends mt{constructor(t){super(t),this._typeIds=new Er(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,n){return n===void 0&&(n=this._valueToChildTypeId(this,e,t)),this.setValid(t,this.isValid(e))&&this.setValue(t,e,n),this}setValue(t,e,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],s=this.children[i];s==null||s.set(t,e)}addChild(t,e=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:s,typeIds:o}}=this,a=[...i,new H(e,t.type)];return this.type=new $e(s,[...o,n],a),n}_valueToChildTypeId(t,e,n){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.")}},Fo=class extends $n{},xo=class extends $n{constructor(t){super(t),this._offsets=new Er(new Int32Array(0))}setValue(t,e,n){let i=this._typeIds.set(t,n).buffer[t],s=this.getChildAt(this.type.typeIdToChildIndex[i]),o=this._offsets.set(t,s.length).buffer[t];s==null||s.set(o,e)}};var Wi=class extends sr{constructor(t){super(t),this._values=new Yr(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,Vr(e))}_flushPending(t,e){}};Wi.prototype._flushPending=Wn.prototype._flushPending;var Va=class extends D{visitNull(){return Io}visitBool(){return oo}visitInt(){return Ue}visitInt8(){return ho}visitInt16(){return po}visitInt32(){return mo}visitInt64(){return yo}visitUint8(){return _o}visitUint16(){return bo}visitUint32(){return go}visitUint64(){return wo}visitFloat(){return wn}visitFloat16(){return lo}visitFloat32(){return uo}visitFloat64(){return fo}visitUtf8(){return Wi}visitBinary(){return Wn}visitFixedSizeBinary(){return Ri}visitDate(){return bn}visitDateDay(){return Ei}visitDateMillisecond(){return Oi}visitTimestamp(){return Ur}visitTimestampSecond(){return ki}visitTimestampMillisecond(){return Li}visitTimestampMicrosecond(){return Ci}visitTimestampNanosecond(){return Pi}visitTime(){return Nr}visitTimeSecond(){return Vi}visitTimeMillisecond(){return Hi}visitTimeMicrosecond(){return zi}visitTimeNanosecond(){return ji}visitDecimal(){return Mi}visitList(){return vo}visitStruct(){return Ao}visitUnion(){return $n}visitDenseUnion(){return xo}visitSparseUnion(){return Fo}visitDictionary(){return ao}visitInterval(){return vn}visitIntervalDayTime(){return Ui}visitIntervalYearMonth(){return Ni}visitFixedSizeList(){return co}visitMap(){return So}},mu=new Va;var U=class extends D{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((n,i)=>this.compareFields(n,e[i]))}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 _e(r,t){return t instanceof r.constructor}function $i(r,t){return r===t||_e(r,t)}function kr(r,t){return r===t||_e(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function Bo(r,t){return r===t||_e(r,t)&&r.precision===t.precision}function Bm(r,t){return r===t||_e(r,t)&&r.byteWidth===t.byteWidth}function Ha(r,t){return r===t||_e(r,t)&&r.unit===t.unit}function Yi(r,t){return r===t||_e(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function Xi(r,t){return r===t||_e(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function Tm(r,t){return r===t||_e(r,t)&&r.children.length===t.children.length&&mr.compareManyFields(r.children,t.children)}function Dm(r,t){return r===t||_e(r,t)&&r.children.length===t.children.length&&mr.compareManyFields(r.children,t.children)}function za(r,t){return r===t||_e(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&mr.compareManyFields(r.children,t.children)}function Em(r,t){return r===t||_e(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&mr.visit(r.indices,t.indices)&&mr.visit(r.dictionary,t.dictionary)}function ja(r,t){return r===t||_e(r,t)&&r.unit===t.unit}function Om(r,t){return r===t||_e(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&mr.compareManyFields(r.children,t.children)}function Mm(r,t){return r===t||_e(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&mr.compareManyFields(r.children,t.children)}U.prototype.visitNull=$i;U.prototype.visitBool=$i;U.prototype.visitInt=kr;U.prototype.visitInt8=kr;U.prototype.visitInt16=kr;U.prototype.visitInt32=kr;U.prototype.visitInt64=kr;U.prototype.visitUint8=kr;U.prototype.visitUint16=kr;U.prototype.visitUint32=kr;U.prototype.visitUint64=kr;U.prototype.visitFloat=Bo;U.prototype.visitFloat16=Bo;U.prototype.visitFloat32=Bo;U.prototype.visitFloat64=Bo;U.prototype.visitUtf8=$i;U.prototype.visitBinary=$i;U.prototype.visitFixedSizeBinary=Bm;U.prototype.visitDate=Ha;U.prototype.visitDateDay=Ha;U.prototype.visitDateMillisecond=Ha;U.prototype.visitTimestamp=Yi;U.prototype.visitTimestampSecond=Yi;U.prototype.visitTimestampMillisecond=Yi;U.prototype.visitTimestampMicrosecond=Yi;U.prototype.visitTimestampNanosecond=Yi;U.prototype.visitTime=Xi;U.prototype.visitTimeSecond=Xi;U.prototype.visitTimeMillisecond=Xi;U.prototype.visitTimeMicrosecond=Xi;U.prototype.visitTimeNanosecond=Xi;U.prototype.visitDecimal=$i;U.prototype.visitList=Tm;U.prototype.visitStruct=Dm;U.prototype.visitUnion=za;U.prototype.visitDenseUnion=za;U.prototype.visitSparseUnion=za;U.prototype.visitDictionary=Em;U.prototype.visitInterval=ja;U.prototype.visitIntervalDayTime=ja;U.prototype.visitIntervalYearMonth=ja;U.prototype.visitFixedSizeList=Om;U.prototype.visitMap=Mm;var mr=new U;function Sn(r,t){return mr.compareSchemas(r,t)}function yu(r,t){return mr.compareFields(r,t)}function _u(r,t){return mr.visit(r,t)}function gn(r){let t=r.type,e=new(mu.getVisitFn(t)())(r);if(t.children&&t.children.length>0){let n=r.children||[],i={nullValues:r.nullValues},s=Array.isArray(n)?(o,a)=>n[a]||i:({name:o})=>n[o]||i;for(let[o,a]of t.children.entries()){let{type:c}=a,d=s(a,o);e.children.push(gn(Object.assign(Object.assign({},d),{type:c})))}}return e}function To(r,t){return Rm(r,t.map(e=>e.data.concat()))}function Rm(r,t){let e=[...r.fields],n=[],i={numBatches:t.reduce((b,y)=>Math.max(b,y.length),0)},s=0,o=0,a=-1,c=t.length,d,p=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)p[a]=d=t[a].shift(),o=Math.min(o,d?d.length:o);Number.isFinite(o)&&(p=Um(e,o,p,t,i),o>0&&(n[s++]=C({type:new ut(e),length:o,nullCount:0,children:p.slice()})))}return[r=r.assign(e),n.map(b=>new ct(r,b))]}function Um(r,t,e,n,i){var s;let o=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let d=e[a],p=d==null?void 0:d.length;if(p>=t)p===t?e[a]=d:(e[a]=d.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(d.slice(t,p-t))));else{let b=r[a];r[a]=b.clone({nullable:!0}),e[a]=(s=d==null?void 0:d._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:C({type:b.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var bu,It=class{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new G([]),this._offsets=[0],this;let i,s;t[0]instanceof G&&(i=t.shift()),t[t.length-1]instanceof Uint32Array&&(s=t.pop());let o=c=>{if(c){if(c instanceof ct)return[c];if(c instanceof It)return c.batches;if(c instanceof et){if(c.type instanceof ut)return[new ct(new G(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(d=>o(d));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(d=>o(d));if(typeof c=="object"){let d=Object.keys(c),p=d.map(S=>new L([c[S]])),b=new G(d.map((S,J)=>new H(String(S),p[J].type))),[,y]=To(b,p);return y.length===0?[new ct(c)]:y}}}return[]},a=t.flatMap(c=>o(c));if(i=(n=i!=null?i:(e=a[0])===null||e===void 0?void 0:e.schema)!==null&&n!==void 0?n:new G([]),!(i instanceof G))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof ct))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Sn(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=s!=null?s:Js(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=Ks(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 Ln.visit(new L(this.data))}toArray(){return[...this]}toString(){return`[
|
|
8
|
+
${this.toArray().join(`,
|
|
9
|
+
`)}
|
|
10
|
+
]`}concat(...t){let e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new It(e,n.map(i=>new ct(e,i)))}slice(t,e){let n=this.schema;[t,e]=yi({length:this.numRows},t,e);let i=qs(this.data,this._offsets,t,e);return new It(n,i.map(s=>new ct(n,s)))}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(n=>n.children[t]);if(e.length===0){let{type:n}=this.schema.fields[t],i=C({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new L(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new L([C({type:new ne,length:this.numRows})]));let s=n.fields.slice(),o=s[t].clone({type:e.type}),a=this.schema.fields.map((c,d)=>this.getChildAt(d));[s[t],a[t]]=[o,e],[n,i]=To(n,a)}return new It(n,i)}select(t){let e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){let e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new It(e,n)}assign(t){let e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,c,d)=>{let[p,b]=a,y=e.findIndex(S=>S.name===c.name);return~y?b[y]=d:p.push(d),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new It(...To(s,o))}};bu=Symbol.toStringTag;It[bu]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=$r(gi),r.get=$r(Bt.getVisitFn(f.Struct)),r.set=Zs(Xt.getVisitFn(f.Struct)),r.indexOf=Qs(mn.getVisitFn(f.Struct)),r.getByteLength=$r(Ie.getVisitFn(f.Struct)),"Table"))(It.prototype);var wu,ct=class{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof G))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=C({nullCount:0,type:new ut(this.schema.fields),children:this.schema.fields.map(e=>C({type:e.type,nullCount:0}))})]=t,!(this.data instanceof et))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=gu(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((c,d,p)=>(c.children[p]=e[d],c.length=Math.max(c.length,e[d].length),c.fields[p]=H.new({name:d,type:e[d].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new G(n),a=C({type:new ut(n),length:s,children:i,nullCount:0});[this.schema,this.data]=gu(o,a.children,s);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=vu(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 Bt.visit(this.data,t)}set(t,e){return Xt.visit(this.data,t,e)}indexOf(t,e){return mn.visit(this.data,t,e)}getByteLength(t){return Ie.visit(this.data,t)}[Symbol.iterator](){return Ln.visit(new L([this.data]))}toArray(){return[...this]}concat(...t){return new It(this.schema,[this,...t])}slice(t,e){let[n]=new L([this.data]).slice(t,e).data;return new ct(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new L([this.data.children[t]]):null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){e||(e=new L([C({type:new ne,length:this.numRows})]));let s=n.fields.slice(),o=i.children.slice(),a=s[t].clone({type:e.type});[s[t],o[t]]=[a,e.data[0]],n=new G(s,new Map(this.schema.metadata)),i=C({type:new ut(s),children:o})}return new ct(n,i)}select(t){let e=this.schema.select(t),n=new ut(e.fields),i=[];for(let s of t){let o=this.schema.fields.findIndex(a=>a.name===s);~o&&(i[o]=this.data.children[o])}return new ct(e,C({type:n,length:this.numRows,children:i}))}selectAt(t){let e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=C({type:new ut(e.fields),length:this.numRows,children:n});return new ct(e,i)}};wu=Symbol.toStringTag;ct[wu]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(ct.prototype);function gu(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(let[a,c]of r.fields.entries()){let d=t[a];(!d||d.length!==e)&&(i[a]=c.clone({nullable:!0}),s[a]=(n=d==null?void 0:d._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:C({type:c.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),C({type:new ut(i),length:e,children:s})]}function vu(r,t,e=new Map){for(let n=-1,i=r.length;++n<i;){let o=r[n].type,a=t[n];if(F.isDictionary(o)){if(!e.has(o.id))a.dictionary&&e.set(o.id,a.dictionary);else if(e.get(o.id)!==a.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&vu(o.children,a.children,e)}return e}var In=class extends ct{constructor(t){let e=t.fields.map(i=>C({type:i.type})),n=C({type:new ut(t.fields),nullCount:0,children:e});super(t,n)}};var Gi;(function(r){r[r.BUFFER=0]="BUFFER"})(Gi||(Gi={}));var Ki;(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(Ki||(Ki={}));var qe=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 qe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new qe).__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):Ki.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Gi.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Ki.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Gi.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,n){return qe.startBodyCompression(t),qe.addCodec(t,e),qe.addMethod(t,n),qe.endBodyCompression(t)}};var Yn=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,n){return t.prep(8,16),t.writeInt64(n),t.writeInt64(e),t.offset()}};var Xn=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,n){return t.prep(8,16),t.writeInt64(n),t.writeInt64(e),t.offset()}};var Zt=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 Zt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new Zt).__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 n=this.bb.__offset(this.bb_pos,6);return n?(e||new Xn).__init(this.bb.__vector(this.bb_pos+n)+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 n=this.bb.__offset(this.bb_pos,8);return n?(e||new Yn).__init(this.bb.__vector(this.bb_pos+n)+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 qe).__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 Ne=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 Ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new Ne).__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 Zt).__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 Gn;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(Gn||(Gn={}));var Ft=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 Ft).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new Ft).__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):Xr.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Gn.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 n=this.bb.__offset(this.bb_pos,12);return n?(e||new dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Xr.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,Gn.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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);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,n,i,s,o){return Ft.startMessage(t),Ft.addVersion(t,e),Ft.addHeaderType(t,n),Ft.addHeader(t,i),Ft.addBodyLength(t,s),Ft.addCustomMetadata(t,o),Ft.endMessage(t)}};var km=Tt,Wa=class extends D{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return ur.startNull(e),ur.endNull(e)}visitInt(t,e){return kt.startInt(e),kt.addBitWidth(e,t.bitWidth),kt.addIsSigned(e,t.isSigned),kt.endInt(e)}visitFloat(t,e){return fe.startFloatingPoint(e),fe.addPrecision(e,t.precision),fe.endFloatingPoint(e)}visitBinary(t,e){return ar.startBinary(e),ar.endBinary(e)}visitBool(t,e){return cr.startBool(e),cr.endBool(e)}visitUtf8(t,e){return fr.startUtf8(e),fr.endUtf8(e)}visitDecimal(t,e){return Lt.startDecimal(e),Lt.addScale(e,t.scale),Lt.addPrecision(e,t.precision),Lt.addBitWidth(e,t.bitWidth),Lt.endDecimal(e)}visitDate(t,e){return le.startDate(e),le.addUnit(e,t.unit),le.endDate(e)}visitTime(t,e){return Kt.startTime(e),Kt.addUnit(e,t.unit),Kt.addBitWidth(e,t.bitWidth),Kt.endTime(e)}visitTimestamp(t,e){let n=t.timezone&&e.createString(t.timezone)||void 0;return Jt.startTimestamp(e),Jt.addUnit(e,t.unit),n!==void 0&&Jt.addTimezone(e,n),Jt.endTimestamp(e)}visitInterval(t,e){return he.startInterval(e),he.addUnit(e,t.unit),he.endInterval(e)}visitList(t,e){return lr.startList(e),lr.endList(e)}visitStruct(t,e){return dr.startStruct_(e),dr.endStruct_(e)}visitUnion(t,e){Ct.startTypeIdsVector(e,t.typeIds.length);let n=Ct.createTypeIdsVector(e,t.typeIds);return Ct.startUnion(e),Ct.addMode(e,t.mode),Ct.addTypeIds(e,n),Ct.endUnion(e)}visitDictionary(t,e){let n=this.visit(t.indices,e);return Ae.startDictionaryEncoding(e),Ae.addId(e,new km(t.id,0)),Ae.addIsOrdered(e,t.isOrdered),n!==void 0&&Ae.addIndexType(e,n),Ae.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ue.startFixedSizeBinary(e),ue.addByteWidth(e,t.byteWidth),ue.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return de.startFixedSizeList(e),de.addListSize(e,t.listSize),de.endFixedSizeList(e)}visitMap(t,e){return pe.startMap(e),pe.addKeysSorted(e,t.keysSorted),pe.endMap(e)}},Do=new Wa;function Fu(r,t=new Map){return new G(Lm(r,t),Eo(r.customMetadata),t)}function $a(r){return new Gt(r.count,Bu(r.columns),Tu(r.columns))}function xu(r){return new ge($a(r.data),r.id,r.isDelta)}function Lm(r,t){return(r.fields||[]).filter(Boolean).map(e=>H.fromJSON(e,t))}function Su(r,t){return(r.children||[]).filter(Boolean).map(e=>H.fromJSON(e,t))}function Bu(r){return(r||[]).reduce((t,e)=>[...t,new Ze(e.count,Cm(e.VALIDITY)),...Bu(e.children)],[])}function Tu(r,t=[]){for(let e=-1,n=(r||[]).length;++e<n;){let i=r[e];i.VALIDITY&&t.push(new be(t.length,i.VALIDITY.length)),i.TYPE&&t.push(new be(t.length,i.TYPE.length)),i.OFFSET&&t.push(new be(t.length,i.OFFSET.length)),i.DATA&&t.push(new be(t.length,i.DATA.length)),t=Tu(i.children,t)}return t}function Cm(r){return(r||[]).reduce((t,e)=>t+ +(e===0),0)}function Du(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=Au(r,Su(r,t)),i=new H(r.name,o,r.nullable,Eo(r.customMetadata))):t.has(e=s.id)?(n=(n=s.indexType)?Iu(n):new rr,a=new ve(t.get(e),n,e,s.isOrdered),i=new H(r.name,a,r.nullable,Eo(r.customMetadata))):(n=(n=s.indexType)?Iu(n):new rr,t.set(e,o=Au(r,Su(r,t))),a=new ve(o,n,e,s.isOrdered),i=new H(r.name,a,r.nullable,Eo(r.customMetadata))),i||null}function Eo(r){return new Map(Object.entries(r||{}))}function Iu(r){return new At(r.isSigned,r.bitWidth)}function Au(r,t){let e=r.type.name;switch(e){case"NONE":return new ne;case"null":return new ne;case"binary":return new vr;case"utf8":return new Sr;case"bool":return new Ir;case"list":return new We((t||[])[0]);case"struct":return new ut(t||[]);case"struct_":return new ut(t||[])}switch(e){case"int":{let n=r.type;return new At(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new ce(pt[n.precision])}case"decimal":{let n=r.type;return new Ar(n.scale,n.precision,n.bitWidth)}case"date":{let n=r.type;return new Fr(Yt[n.unit])}case"time":{let n=r.type;return new je(X[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new xr(X[n.unit],n.timezone)}case"interval":{let n=r.type;return new Br(re[n.unit])}case"union":{let n=r.type;return new $e(gt[n.mode],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=r.type;return new Tr(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Ye(n.listSize,(t||[])[0])}case"map":{let n=r.type;return new Xe((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var An=Tt,Pm=Or,Vm=ie,Et=class{constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){let n=new Et(0,Ut.V4,e);return n._createHeader=Hm(t,e),n}static decode(t){t=new Vm(N(t));let e=Ft.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new Et(n,i,s);return o._createHeader=zm(e,s),o}static encode(t){let e=new Pm,n=-1;return t.isSchema()?n=G.encode(e,t.header()):t.isRecordBatch()?n=Gt.encode(e,t.header()):t.isDictionaryBatch()&&(n=ge.encode(e,t.header())),Ft.startMessage(e),Ft.addVersion(e,Ut.V4),Ft.addHeader(e,n),Ft.addHeaderType(e,t.headerType),Ft.addBodyLength(e,new An(t.bodyLength,0)),Ft.finishMessageBuffer(e,Ft.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof G)return new Et(0,Ut.V4,Q.Schema,t);if(t instanceof Gt)return new Et(e,Ut.V4,Q.RecordBatch,t);if(t instanceof ge)return new Et(e,Ut.V4,Q.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===Q.Schema}isRecordBatch(){return this.headerType===Q.RecordBatch}isDictionaryBatch(){return this.headerType===Q.DictionaryBatch}},Gt=class{constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}},ge=class{constructor(t,e,n=!1){this._data=t,this._isDelta=n,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}},be=class{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}},Ze=class{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}};function Hm(r,t){return()=>{switch(t){case Q.Schema:return G.fromJSON(r);case Q.RecordBatch:return Gt.fromJSON(r);case Q.DictionaryBatch:return ge.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${Q[t]}, type: ${t} }`)}}function zm(r,t){return()=>{switch(t){case Q.Schema:return G.decode(r.header(new wt));case Q.RecordBatch:return Gt.decode(r.header(new Zt),r.version());case Q.DictionaryBatch:return ge.decode(r.header(new Ne),r.version())}throw new Error(`Unrecognized Message type: { name: ${Q[t]}, type: ${t} }`)}}H.encode=Qm;H.decode=qm;H.fromJSON=Du;G.encode=Zm;G.decode=jm;G.fromJSON=Fu;Gt.encode=ty;Gt.decode=Wm;Gt.fromJSON=$a;ge.encode=ey;ge.decode=$m;ge.fromJSON=xu;Ze.encode=ry;Ze.decode=Xm;be.encode=ny;be.decode=Ym;function jm(r,t=new Map){let e=Jm(r,t);return new G(e,Oo(r),t)}function Wm(r,t=Ut.V4){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Gt(r.length(),Gm(r),Km(r,t))}function $m(r,t=Ut.V4){return new ge(Gt.decode(r.data(),t),r.id(),r.isDelta())}function Ym(r){return new be(r.offset(),r.length())}function Xm(r){return new Ze(r.length(),r.nullCount())}function Gm(r){let t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++n<s;)(e=r.nodes(n))&&(t[++i]=Ze.decode(e));return t}function Km(r,t){let e=[];for(let n,i=-1,s=-1,o=r.buffersLength();++i<o;)(n=r.buffers(i))&&(t<Ut.V4&&(n.bb_pos+=8*(i+1)),e[++s]=be.decode(n));return e}function Jm(r,t){let e=[];for(let n,i=-1,s=-1,o=r.fieldsLength();++i<o;)(n=r.fields(i))&&(e[++s]=H.decode(n,t));return e}function Eu(r,t){let e=[];for(let n,i=-1,s=-1,o=r.childrenLength();++i<o;)(n=r.children(i))&&(e[++s]=H.decode(n,t));return e}function qm(r,t){let e,n,i,s,o,a;return!t||!(a=r.dictionary())?(i=Mu(r,Eu(r,t)),n=new H(r.name(),i,r.nullable(),Oo(r))):t.has(e=a.id().low)?(s=(s=a.indexType())?Ou(s):new rr,o=new ve(t.get(e),s,e,a.isOrdered()),n=new H(r.name(),o,r.nullable(),Oo(r))):(s=(s=a.indexType())?Ou(s):new rr,t.set(e,i=Mu(r,Eu(r,t))),o=new ve(i,s,e,a.isOrdered()),n=new H(r.name(),o,r.nullable(),Oo(r))),n||null}function Oo(r){let t=new Map;if(r)for(let e,n,i=-1,s=Math.trunc(r.customMetadataLength());++i<s;)(e=r.customMetadata(i))&&(n=e.key())!=null&&t.set(n,e.value());return t}function Ou(r){return new At(r.isSigned(),r.bitWidth())}function Mu(r,t){let e=r.typeType();switch(e){case yt.NONE:return new ne;case yt.Null:return new ne;case yt.Binary:return new vr;case yt.Utf8:return new Sr;case yt.Bool:return new Ir;case yt.List:return new We((t||[])[0]);case yt.Struct_:return new ut(t||[])}switch(e){case yt.Int:{let n=r.type(new kt);return new At(n.isSigned(),n.bitWidth())}case yt.FloatingPoint:{let n=r.type(new fe);return new ce(n.precision())}case yt.Decimal:{let n=r.type(new Lt);return new Ar(n.scale(),n.precision(),n.bitWidth())}case yt.Date:{let n=r.type(new le);return new Fr(n.unit())}case yt.Time:{let n=r.type(new Kt);return new je(n.unit(),n.bitWidth())}case yt.Timestamp:{let n=r.type(new Jt);return new xr(n.unit(),n.timezone())}case yt.Interval:{let n=r.type(new he);return new Br(n.unit())}case yt.Union:{let n=r.type(new Ct);return new $e(n.mode(),n.typeIdsArray()||[],t||[])}case yt.FixedSizeBinary:{let n=r.type(new ue);return new Tr(n.byteWidth())}case yt.FixedSizeList:{let n=r.type(new de);return new Ye(n.listSize(),(t||[])[0])}case yt.Map:{let n=r.type(new pe);return new Xe((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${yt[e]}" (${e})`)}function Zm(r,t){let e=t.fields.map(s=>H.encode(r,s));wt.startFieldsVector(r,e.length);let n=wt.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?wt.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{let a=r.createString(`${s}`),c=r.createString(`${o}`);return dt.startKeyValue(r),dt.addKey(r,a),dt.addValue(r,c),dt.endKeyValue(r)})):-1;return wt.startSchema(r),wt.addFields(r,n),wt.addEndianness(r,iy?Gr.Little:Gr.Big),i!==-1&&wt.addCustomMetadata(r,i),wt.endSchema(r)}function Qm(r,t){let e=-1,n=-1,i=-1,s=t.type,o=t.typeId;F.isDictionary(s)?(o=s.dictionary.typeId,i=Do.visit(s,r),n=Do.visit(s.dictionary,r)):n=Do.visit(s,r);let a=(s.children||[]).map(p=>H.encode(r,p)),c=Dt.createChildrenVector(r,a),d=t.metadata&&t.metadata.size>0?Dt.createCustomMetadataVector(r,[...t.metadata].map(([p,b])=>{let y=r.createString(`${p}`),S=r.createString(`${b}`);return dt.startKeyValue(r),dt.addKey(r,y),dt.addValue(r,S),dt.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Dt.startField(r),Dt.addType(r,n),Dt.addTypeType(r,o),Dt.addChildren(r,c),Dt.addNullable(r,!!t.nullable),e!==-1&&Dt.addName(r,e),i!==-1&&Dt.addDictionary(r,i),d!==-1&&Dt.addCustomMetadata(r,d),Dt.endField(r)}function ty(r,t){let e=t.nodes||[],n=t.buffers||[];Zt.startNodesVector(r,e.length);for(let o of e.slice().reverse())Ze.encode(r,o);let i=r.endVector();Zt.startBuffersVector(r,n.length);for(let o of n.slice().reverse())be.encode(r,o);let s=r.endVector();return Zt.startRecordBatch(r),Zt.addLength(r,new An(t.length,0)),Zt.addNodes(r,i),Zt.addBuffers(r,s),Zt.endRecordBatch(r)}function ey(r,t){let e=Gt.encode(r,t.data);return Ne.startDictionaryBatch(r),Ne.addId(r,new An(t.id,0)),Ne.addIsDelta(r,t.isDelta),Ne.addData(r,e),Ne.endDictionaryBatch(r)}function ry(r,t){return Xn.createFieldNode(r,new An(t.length,0),new An(t.nullCount,0))}function ny(r,t){return Yn.createBuffer(r,new An(t.offset,0),new An(t.length,0))}var iy=(()=>{let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})();var Xa=r=>`Expected ${Q[r]} Message in stream, but was null or length 0.`,Ga=r=>`Header pointer of flatbuffer-encoded ${Q[r]} Message is null or length 0.`,Ru=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,Uu=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`,Kn=class{constructor(t){this.source=t instanceof pr?t:new pr(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?ft:t.value===-1&&(t=this.readMetadataLength()).done?ft:(t=this.readMetadata(t.value)).done?ft: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(Xa(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=N(this.source.read(t));if(e.byteLength<t)throw new Error(Uu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=Q.Schema,n=this.readMessage(e),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Ga(e));return i}readMetadataLength(){let t=this.source.read(Mo),e=t&&new ie(t),n=(e==null?void 0:e.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(t){let e=this.source.read(t);if(!e)return ft;if(e.byteLength<t)throw new Error(Ru(t,e.byteLength));return{done:!1,value:Et.decode(e)}}},Ji=class{constructor(t,e){this.source=t instanceof me?t:_s(t)?new Jr(t,e):new me(t)}[Symbol.asyncIterator](){return this}next(){return I(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?ft:t.value===-1&&(t=yield this.readMetadataLength()).done?ft:(t=yield this.readMetadata(t.value)).done?ft:t})}throw(t){return I(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return I(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return I(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(Xa(t));return e.value})}readMessageBody(t){return I(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=N(yield this.source.read(t));if(e.byteLength<t)throw new Error(Uu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return I(this,void 0,void 0,function*(){let e=Q.Schema,n=yield this.readMessage(e),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Ga(e));return i})}readMetadataLength(){return I(this,void 0,void 0,function*(){let t=yield this.source.read(Mo),e=t&&new ie(t),n=(e==null?void 0:e.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(t){return I(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return ft;if(e.byteLength<t)throw new Error(Ru(t,e.byteLength));return{done:!1,value:Et.decode(e)}})}},qi=class extends Kn{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof xi?t:new xi(t)}next(){let{_json:t}=this;if(!this._schema){this._schema=!0;let e=Et.fromJSON(t.schema,Q.Schema);return{done:!1,value:e}}if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];this._body=e.data.columns;let n=Et.fromJSON(e,Q.DictionaryBatch);return{done:!1,value:n}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];this._body=e.columns;let n=Et.fromJSON(e,Q.RecordBatch);return{done:!1,value:n}}return this._body=[],ft}readMessageBody(t){return e(this._body);function e(n){return(n||[]).reduce((i,s)=>[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE&&[s.TYPE]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(Xa(t));return e.value}readSchema(){let t=Q.Schema,e=this.readMessage(t),n=e==null?void 0:e.header();if(!e||!n)throw new Error(Ga(t));return n}},Mo=4,Ya="ARROW1",Jn=new Uint8Array(Ya.length);for(let r=0;r<Ya.length;r+=1)Jn[r]=Ya.codePointAt(r);function Ro(r,t=0){for(let e=-1,n=Jn.length;++e<n;)if(Jn[e]!==r[t+e])return!1;return!0}var qn=Jn.length,Ka=qn+Mo,Nu=qn*2+Mo;var xt=class extends _n{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 Ce(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 $t.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return $t.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 xt?t:ms(t)?oy(t):_s(t)?ly(t):Ce(t)?(()=>I(this,void 0,void 0,function*(){return yield xt.from(yield t)}))():bs(t)||fi(t)||ws(t)||Ee(t)?cy(new me(t)):ay(new pr(t))}static readAll(t){return t instanceof xt?t.isSync()?ku(t):Lu(t):ms(t)||ArrayBuffer.isView(t)||Pe(t)||ys(t)?ku(t):Lu(t)}},yr=class extends xt{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return ae(this,arguments,function*(){yield W(yield*Bn(De(this[Symbol.iterator]())))})}},qr=class extends xt{constructor(t){super(t),this._impl=t}readAll(){var t,e;return I(this,void 0,void 0,function*(){let n=new Array;try{for(var i=De(this),s;s=yield i.next(),!s.done;){let o=s.value;n.push(o)}}catch(o){t={error:o}}finally{try{s&&!s.done&&(e=i.return)&&(yield e.call(i))}finally{if(t)throw t.error}}return n})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Zr=class extends yr{constructor(t){super(t),this._impl=t}},Zi=class extends qr{constructor(t){super(t),this._impl=t}},Uo=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 n=this._loadVectors(t,e,this.schema.fields),i=C({type:new ut(this.schema.fields),length:t.length,children:n});return new ct(this.schema,i)}_loadDictionaryBatch(t,e){let{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n);if(i||!a){let c=o.dictionaries.get(n),d=this._loadVectors(t.data,e,[c]);return(a&&i?a.concat(new L(d)):new L(d)).memoize()}return a.memoize()}_loadVectors(t,e,n){return new Di(e,t.nodes,t.buffers,this.dictionaries).visitMany(n)}},Zn=class extends Uo{constructor(t,e){super(e),this._reader=ms(t)?new qi(this._handle=t):new Kn(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=Cu(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):ft}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):ft}next(){if(this.closed)return ft;let t,{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new In(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Qn=class extends Uo{constructor(t,e){super(e),this._reader=new Ji(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return I(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 I(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Cu(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return I(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):ft})}return(t){return I(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):ft})}next(){return I(this,void 0,void 0,function*(){if(this.closed)return ft;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 n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new In(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return I(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},No=class extends Zn{constructor(t,e){super(t instanceof Bi?t:new Bi(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 n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Q.RecordBatch);if(i!=null&&i.isRecordBatch()){let s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;let n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Q.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){let{_handle:t}=this,e=t.size-Ka,n=t.readInt32(e),i=t.readAt(e-n,n);return Mr.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},Ja=class extends Qn{constructor(t,...e){let n=typeof e[0]!="number"?e.shift():void 0,i=e[0]instanceof Map?e.shift():void 0;super(t instanceof Jr?t:new Jr(t,n),i)}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 I(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){var e;return I(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Q.RecordBatch);if(i!=null&&i.isRecordBatch()){let s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){var e;return I(this,void 0,void 0,function*(){let n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Q.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return I(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-Ka,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return Mr.decode(i)})}_readNextMessageAndValidate(t){return I(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})}},qa=class extends Zn{constructor(t,e){super(t,e)}_loadVectors(t,e,n){return new so(e,t.nodes,t.buffers,this.dictionaries).visitMany(n)}};function Cu(r,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:r.autoDestroy}function*ku(r){let t=xt.from(r);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Lu(r){return ae(this,arguments,function*(){let e=yield W(xt.from(r));try{if(!(yield W(e.open({autoDestroy:!1}))).closed)do yield yield W(e);while(!(yield W(e.reset().open())).closed)}finally{yield W(e.cancel())}})}function oy(r){return new yr(new qa(r))}function ay(r){let t=r.peek(qn+7&-8);return t&&t.byteLength>=4?Ro(t)?new Zr(new No(r.read())):new yr(new Zn(r)):new yr(new Zn(function*(){}()))}function cy(r){return I(this,void 0,void 0,function*(){let t=yield r.peek(qn+7&-8);return t&&t.byteLength>=4?Ro(t)?new Zr(new No(yield r.read())):new qr(new Qn(r)):new qr(new Qn(function(){return ae(this,arguments,function*(){})}()))})}function ly(r){return I(this,void 0,void 0,function*(){let{size:t}=yield r.stat(),e=new Jr(r,t);return t>=Nu&&Ro(yield e.readAt(0,qn+7&-8))?new Zi(new Ja(e)):new qr(new Qn(e))})}var vt=class extends D{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){let e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof ct?s.data.children:s.data),n=new vt;return n.visitMany(e(t)),n}visit(t){if(t instanceof L)return this.visitMany(t.data),this;let{type:e}=t;if(!F.isDictionary(e)){let{length:n,nullCount:i}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");F.isNull(e)||Qe.call(this,i<=0?new Uint8Array(0):kn(t.offset,n,t.nullBitmap)),this.nodes.push(new Ze(n,i))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Qe(r){let t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new be(this._byteLength,t)),this._byteLength+=t,this}function uy(r){let{type:t,length:e,typeIds:n,valueOffsets:i}=r;if(Qe.call(this,n),t.mode===gt.Sparse)return Za.call(this,r);if(t.mode===gt.Dense){if(r.offset<=0)return Qe.call(this,i),Za.call(this,r);{let s=n.reduce((p,b)=>Math.max(p,b),n[0]),o=new Int32Array(s+1),a=new Int32Array(s+1).fill(-1),c=new Int32Array(e),d=hi(-i[0],e,i);for(let p,b,y=-1;++y<e;)(b=a[p=n[y]])===-1&&(b=a[p]=d[p]),c[y]=d[y]-b,++o[p];Qe.call(this,c);for(let p,b=-1,y=t.children.length;++b<y;)if(p=r.children[b]){let S=t.typeIds[b],J=Math.min(e,o[S]);this.visit(p.slice(a[S],J))}}}return this}function dy(r){let t;return r.nullCount>=r.length?Qe.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?Qe.call(this,kn(r.offset,r.length,t)):Qe.call(this,hn(r.values))}function Qr(r){return Qe.call(this,r.values.subarray(0,r.length*r.stride))}function Pu(r){let{length:t,values:e,valueOffsets:n}=r,i=n[0],s=n[t],o=Math.min(s-i,e.byteLength-i);return Qe.call(this,hi(-n[0],t,n)),Qe.call(this,e.subarray(i,i+o)),this}function Qa(r){let{length:t,valueOffsets:e}=r;return e&&Qe.call(this,hi(e[0],t,e)),this.visit(r.children[0])}function Za(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}vt.prototype.visitBool=dy;vt.prototype.visitInt=Qr;vt.prototype.visitFloat=Qr;vt.prototype.visitUtf8=Pu;vt.prototype.visitBinary=Pu;vt.prototype.visitFixedSizeBinary=Qr;vt.prototype.visitDate=Qr;vt.prototype.visitTimestamp=Qr;vt.prototype.visitTime=Qr;vt.prototype.visitDecimal=Qr;vt.prototype.visitList=Qa;vt.prototype.visitStruct=Za;vt.prototype.visitUnion=uy;vt.prototype.visitInterval=Qr;vt.prototype.visitFixedSizeList=Qa;vt.prototype.visitMap=Qa;var tn=class extends _n{constructor(t){super(),this._position=0,this._started=!1,this._sink=new hr,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,ee(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 Ce(t)?t.then(e=>this.writeAll(e)):Ee(t)?ec(this,t):tc(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 hr?this._sink=t:(this._sink=new hr,t&&ll(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&ul(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||!Sn(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 It&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof ct&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Sn(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof ct?t instanceof In||this._writeRecordBatch(t):t instanceof It?this.writeAll(t.batches):Pe(t)&&this.writeAll(t)}_writeMessage(t,e=8){let n=e-1,i=Et.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,c=a-s-o;return t.headerType===Q.RecordBatch?this._recordBatchBlocks.push(new Je(a,t.bodyLength,this._position)):t.headerType===Q.DictionaryBatch&&this._dictionaryBlocks.push(new Je(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let e=N(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Et.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Jn)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=vt.assemble(t),o=new Gt(t.numRows,n,i),a=Et.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));let{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=vt.assemble(new L([t])),c=new Gt(t.length,s,o),d=new ge(c,e,n),p=Et.from(d,i);return this._writeMessage(p)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,i;for(let s=-1,o=t.length;++s<o;)(e=t[s])&&(n=e.byteLength)>0&&(this._write(e),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[e,n]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(e)||0;if(i===0||(n=n==null?void 0:n.slice(i)).length>0)for(let s of n.data)this._writeDictionaryBatch(s,e,i>0),i+=s.length}return this}},_r=class extends tn{static writeAll(t,e){let n=new _r(e);return Ce(t)?t.then(i=>n.writeAll(i)):Ee(t)?ec(n,t):tc(n,t)}},en=class extends tn{static writeAll(t){let e=new en;return Ce(t)?t.then(n=>e.writeAll(n)):Ee(t)?ec(e,t):tc(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let e=Mr.encode(new Mr(t,Ut.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function tc(r,t){let e=t;t instanceof It&&(e=t.batches,r.reset(void 0,t.schema));for(let n of e)r.write(n);return r.finish()}function ec(r,t){var e,n,i,s;return I(this,void 0,void 0,function*(){try{for(e=De(t);n=yield e.next(),!n.done;){let o=n.value;r.write(o)}}catch(o){i={error:o}}finally{try{n&&!n.done&&(s=e.return)&&(yield s.call(e))}finally{if(i)throw i.error}}return r.finish()})}function Vu(r,t){if(Ee(r))return hy(r,t);if(Pe(r))return fy(r,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function fy(r,t){let e=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(o){s(o,e||(e=r[Symbol.iterator]()))},pull(o){e?s(o,e):o.close()},cancel(){((e==null?void 0:e.return)&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:n?i:void 0},t));function s(o,a){let c,d=null,p=o.desiredSize||null;for(;!(d=a.next(n?p:null)).done;)if(ArrayBuffer.isView(d.value)&&(c=N(d.value))&&(p!=null&&n&&(p=p-c.byteLength+1),d.value=c),o.enqueue(d.value),p!=null&&--p<=0)return;o.close()}}function hy(r,t){let e=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(o){return I(this,void 0,void 0,function*(){yield s(o,e||(e=r[Symbol.asyncIterator]()))})},pull(o){return I(this,void 0,void 0,function*(){e?yield s(o,e):o.close()})},cancel(){return I(this,void 0,void 0,function*(){((e==null?void 0:e.return)&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:n?i:void 0},t));function s(o,a){return I(this,void 0,void 0,function*(){let c,d=null,p=o.desiredSize||null;for(;!(d=yield a.next(n?p:null)).done;)if(ArrayBuffer.isView(d.value)&&(c=N(d.value))&&(p!=null&&n&&(p=p-c.byteLength+1),d.value=c),o.enqueue(d.value),p!=null&&--p<=0)return;o.close()})}}function ju(r){return new rc(r)}var rc=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,s=al(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=gn(s),this._getSize=i!=="bytes"?Hu:zu;let{["highWaterMark"]:o=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:i!=="bytes"?Hu:zu}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_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)}},Hu=r=>{var t;return(t=r==null?void 0:r.length)!==null&&t!==void 0?t:0},zu=r=>{var t;return(t=r==null?void 0:r.byteLength)!==null&&t!==void 0?t:0};function ko(r,t){let e=new hr,n=null,i=new ReadableStream({cancel(){return I(this,void 0,void 0,function*(){yield e.close()})},start(a){return I(this,void 0,void 0,function*(){yield o(a,n||(n=yield s()))})},pull(a){return I(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:i};function s(){return I(this,void 0,void 0,function*(){return yield(yield xt.from(e)).open(t)})}function o(a,c){return I(this,void 0,void 0,function*(){let d=a.desiredSize,p=null;for(;!(p=yield c.next()).done;)if(a.enqueue(p.value),d!=null&&--d<=0)return;a.close()})}}function Lo(r,t){let e=new this(r),n=new me(e),i=new ReadableStream({cancel(){return I(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return I(this,void 0,void 0,function*(){yield s(o)})},start(o){return I(this,void 0,void 0,function*(){yield s(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,r),readable:i};function s(o){return I(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}var _y=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ma),Pa),Oa),ya),da),Ea),{compareSchemas:Sn,compareFields:yu,compareTypes:_u});$t.toDOMStream=Vu;mt.throughDOM=ju;xt.throughDOM=ko;Zr.throughDOM=ko;yr.throughDOM=ko;tn.throughDOM=Lo;en.throughDOM=Lo;_r.throughDOM=Lo;function ti(r){switch(r.typeId){case f.Binary:return{sqlType:"binary"};case f.Bool:return{sqlType:"bool"};case f.Date:return{sqlType:"date"};case f.DateDay:return{sqlType:"date32[d]"};case f.DateMillisecond:return{sqlType:"date64[ms]"};case f.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case f.Float:return{sqlType:"float"};case f.Float16:return{sqlType:"float16"};case f.Float32:return{sqlType:"float32"};case f.Float64:return{sqlType:"float64"};case f.Int:return{sqlType:"int32"};case f.Int16:return{sqlType:"int16"};case f.Int32:return{sqlType:"int32"};case f.Int64:return{sqlType:"int64"};case f.Uint16:return{sqlType:"uint16"};case f.Uint32:return{sqlType:"uint32"};case f.Uint64:return{sqlType:"uint64"};case f.Uint8:return{sqlType:"uint8"};case f.IntervalDayTime:return{sqlType:"interval[dt]"};case f.IntervalYearMonth:return{sqlType:"interval[m]"};case f.List:return{sqlType:"list",valueType:ti(r.valueType)};case f.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case f.Null:return{sqlType:"null"};case f.Utf8:return{sqlType:"utf8"};case f.Struct:return{sqlType:"struct",fields:r.children.map(e=>Co(e.name,e.type))};case f.Map:{let t=r;return{sqlType:"map",keyType:ti(t.keyType),valueType:ti(t.valueType)}}case f.Time:return{sqlType:"time[s]"};case f.TimeMicrosecond:return{sqlType:"time[us]"};case f.TimeMillisecond:return{sqlType:"time[ms]"};case f.TimeNanosecond:return{sqlType:"time[ns]"};case f.TimeSecond:return{sqlType:"time[s]"};case f.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case f.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case f.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case f.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case f.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error(`unsupported arrow type: ${r.toString()}`)}function Co(r,t){let e=ti(t);return e.name=r,e}var Po=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 n={name:e.name,message:e.message,stack:e.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"ERROR",data:n},[])}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((n,i)=>i)},[]);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 Yu={},by=(()=>{var r=Yu.url;return function(t){t=t||{};var e=typeof t<"u"?t:{},n,i;e.ready=new Promise(function(l,u){n=l,i=u});var s=Object.assign({},e),o=[],a="./this.program",c=(l,u)=>{throw u},d=typeof window=="object",p=typeof importScripts=="function",b=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",y="";function S(l){return e.locateFile?e.locateFile(l,y):y+l}var J,q,ot,St;function Qt(l){if(l instanceof cs)return;Fe("exiting due to exception: "+l)}var se,Lr,on;b?(p?y=nc().dirname(y)+"/":y=__dirname+"/",on=()=>{Lr||(se=$u(),Lr=nc())},J=function(u,h){return on(),u=Lr.normalize(u),se.readFileSync(u,h?void 0:"utf8")},ot=l=>{var u=J(l,!0);return u.buffer||(u=new Uint8Array(u)),u},q=(l,u,h)=>{on(),l=Lr.normalize(l),se.readFile(l,function(m,_){m?h(m):u(_.buffer)})},process.argv.length>1&&(a=process.argv[1].replace(/\\/g,"/")),o=process.argv.slice(2),process.on("uncaughtException",function(l){if(!(l instanceof cs))throw l}),process.on("unhandledRejection",function(l){throw l}),c=(l,u)=>{if(bc())throw process.exitCode=l,u;Qt(u),process.exit(l)},e.inspect=function(){return"[Emscripten Module object]"}):(d||p)&&(p?y=self.location.href:typeof document<"u"&&document.currentScript&&(y=document.currentScript.src),r&&(y=r),y.indexOf("blob:")!==0?y=y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):y="",J=l=>{var u=new XMLHttpRequest;return u.open("GET",l,!1),u.send(null),u.responseText},p&&(ot=l=>{var u=new XMLHttpRequest;return u.open("GET",l,!1),u.responseType="arraybuffer",u.send(null),new Uint8Array(u.response)}),q=(l,u,h)=>{var m=new XMLHttpRequest;m.open("GET",l,!0),m.responseType="arraybuffer",m.onload=()=>{if(m.status==200||m.status==0&&m.response){u(m.response);return}h()},m.onerror=h,m.send(null)},St=l=>document.title=l);var Xo=e.print||console.log.bind(console),Fe=e.printErr||console.warn.bind(console);Object.assign(e,s),s=null,e.arguments&&(o=e.arguments),e.thisProgram&&(a=e.thisProgram),e.quit&&(c=e.quit);var gr;e.wasmBinary&&(gr=e.wasmBinary);var Z=e.noExitRuntime||!0;typeof WebAssembly!="object"&&ke("no native wasm support detected");var Rt,te=!1,Vt;function Ht(l,u){l||ke(u)}function zt(l){var u=e["_"+l];return u}function at(l,u,h,m,_){var A={string:function(Ot){var Le=0;if(Ot!=null&&Ot!==0){var tr=(Ot.length<<2)+1;Le=na(tr),Go(Ot,Le,tr)}return Le},array:function(Ot){var Le=na(Ot.length);return uc(Ot,Le),Le}};function v(Ot){return u==="string"?wr(Ot):u==="boolean"?Boolean(Ot):Ot}var w=zt(l),x=[],tt=0;if(m)for(var it=0;it<m.length;it++){var Te=A[h[it]];Te?(tt===0&&(tt=Oc()),x[it]=Te(m[it])):x[it]=m[it]}var ht=w.apply(null,x);function Fn(Ot){return tt!==0&&Mc(tt),v(Ot)}return ht=Fn(ht),ht}var oe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function an(l,u,h){for(var m=u+h,_=u;l[_]&&!(_>=m);)++_;if(_-u>16&&l.buffer&&oe)return oe.decode(l.subarray(u,_));for(var A="";u<_;){var v=l[u++];if(!(v&128)){A+=String.fromCharCode(v);continue}var w=l[u++]&63;if((v&224)==192){A+=String.fromCharCode((v&31)<<6|w);continue}var x=l[u++]&63;if((v&240)==224?v=(v&15)<<12|w<<6|x:v=(v&7)<<18|w<<12|x<<6|l[u++]&63,v<65536)A+=String.fromCharCode(v);else{var tt=v-65536;A+=String.fromCharCode(55296|tt>>10,56320|tt&1023)}}return A}function wr(l,u){return l?an(Cr,l,u):""}function lc(l,u,h,m){if(!(m>0))return 0;for(var _=h,A=h+m-1,v=0;v<l.length;++v){var w=l.charCodeAt(v);if(w>=55296&&w<=57343){var x=l.charCodeAt(++v);w=65536+((w&1023)<<10)|x&1023}if(w<=127){if(h>=A)break;u[h++]=w}else if(w<=2047){if(h+1>=A)break;u[h++]=192|w>>6,u[h++]=128|w&63}else if(w<=65535){if(h+2>=A)break;u[h++]=224|w>>12,u[h++]=128|w>>6&63,u[h++]=128|w&63}else{if(h+3>=A)break;u[h++]=240|w>>18,u[h++]=128|w>>12&63,u[h++]=128|w>>6&63,u[h++]=128|w&63}}return u[h]=0,h-_}function Go(l,u,h){return lc(l,Cr,u,h)}function rd(l){for(var u=0,h=0;h<l.length;++h){var m=l.charCodeAt(h);m>=55296&&m<=57343&&(m=65536+((m&1023)<<10)|l.charCodeAt(++h)&1023),m<=127?++u:m<=2047?u+=2:m<=65535?u+=3:u+=4}return u}function uc(l,u){ri.set(l,u)}function nd(l,u,h){for(var m=0;m<l.length;++m)ri[u++>>0]=l.charCodeAt(m);h||(ri[u>>0]=0)}var dc,ri,Cr,ni,fc,T,id,sd,od;function hc(l){dc=l,e.HEAP8=ri=new Int8Array(l),e.HEAP16=ni=new Int16Array(l),e.HEAP32=T=new Int32Array(l),e.HEAPU8=Cr=new Uint8Array(l),e.HEAPU16=fc=new Uint16Array(l),e.HEAPU32=id=new Uint32Array(l),e.HEAPF32=sd=new Float32Array(l),e.HEAPF64=od=new Float64Array(l)}var Ty=e.INITIAL_MEMORY||16777216,pc,mc=[],yc=[],ad=[],_c=[],cd=!1;function bc(){return Z}function ld(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)hd(e.preRun.shift());Qi(mc)}function ud(){cd=!0,Qi(yc)}function dd(){Qi(ad)}function fd(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)md(e.postRun.shift());Qi(_c)}function hd(l){mc.unshift(l)}function pd(l){yc.unshift(l)}function md(l){_c.unshift(l)}var cn=0,Ko=null,ii=null;function yd(l){cn++,e.monitorRunDependencies&&e.monitorRunDependencies(cn)}function _d(l){if(cn--,e.monitorRunDependencies&&e.monitorRunDependencies(cn),cn==0&&(Ko!==null&&(clearInterval(Ko),Ko=null),ii)){var u=ii;ii=null,u()}}function ke(l){e.onAbort&&e.onAbort(l),l="Aborted("+l+")",Fe(l),te=!0,Vt=1,l+=". Build with -sASSERTIONS for more info.";var u=new WebAssembly.RuntimeError(l);throw i(u),u}var bd="data:application/octet-stream;base64,";function gc(l){return l.startsWith(bd)}var xe;e.locateFile?(xe="./duckdb-eh.wasm",gc(xe)||(xe=S(xe))):xe=new URL("./duckdb-eh.wasm",Yu.url).toString();function wc(l){try{if(l==xe&&gr)return new Uint8Array(gr);if(ot)return ot(l);throw"both async and sync fetching of the wasm failed"}catch(u){ke(u)}}function gd(){return!gr&&(d||p)&&typeof fetch=="function"?fetch(xe,{credentials:"same-origin"}).then(function(l){if(!l.ok)throw"failed to load wasm binary file at '"+xe+"'";return l.arrayBuffer()}).catch(function(){return wc(xe)}):Promise.resolve().then(function(){return wc(xe)})}function wd(){var l={a:kf};function u(v,w){var x=v.exports;e.asm=x,Rt=e.asm.ha,hc(Rt.buffer),pc=e.asm.bb,pd(e.asm.ia),_d("wasm-instantiate")}yd("wasm-instantiate");function h(v){u(v.instance)}function m(v){return gd().then(function(w){return WebAssembly.instantiate(w,l)}).then(function(w){return w}).then(v,function(w){Fe("failed to asynchronously prepare wasm: "+w),ke(w)})}function _(){return!gr&&typeof WebAssembly.instantiateStreaming=="function"&&!gc(xe)&&typeof fetch=="function"?fetch(xe,{credentials:"same-origin"}).then(function(v){var w=WebAssembly.instantiateStreaming(v,l);return w.then(h,function(x){return Fe("wasm streaming compile failed: "+x),Fe("falling back to ArrayBuffer instantiation"),m(h)})}):m(h)}if(e.instantiateWasm)try{var A=e.instantiateWasm(l,u);return A}catch(v){return Fe("Module.instantiateWasm callback failed with error: "+v),!1}return _().catch(i),{}}function Qi(l){for(;l.length>0;){var u=l.shift();if(typeof u=="function"){u(e);continue}var h=u.func;typeof h=="number"?u.arg===void 0?vc(h)():vc(h)(u.arg):h(u.arg===void 0?null:u.arg)}}var ts=[];function vc(l){var u=ts[l];return u||(l>=ts.length&&(ts.length=l+1),ts[l]=u=pc.get(l)),u}function vd(l){if(l instanceof cs||l=="unwind")return Vt;c(1,l)}function Sd(l,u,h,m){ke("Assertion failed: "+wr(l)+", at: "+[u?wr(u):"unknown filename",h,m?wr(m):"unknown function"])}var jt={buffers:[null,[],[]],printChar:function(l,u){var h=jt.buffers[l];u===0||u===10?((l===1?Xo:Fe)(an(h,0)),h.length=0):h.push(u)},varargs:void 0,get:function(){jt.varargs+=4;var l=T[jt.varargs-4>>2];return l},getStr:function(l){var u=wr(l);return u}};function Id(l,u,h,m,_){}function Ad(){Fe("missing function: $SOCKFS"),ke(-1)}function Sc(){Fe("missing function: $FS"),ke(-1)}function si(l){var u=Ad.getSocket(l);if(!u)throw new Sc.ErrnoError(8);return u}function Jo(l){return(l&255)+"."+(l>>8&255)+"."+(l>>16&255)+"."+(l>>24&255)}function Ic(l){var u="",h=0,m=0,_=0,A=0,v=0,w=0,x=[l[0]&65535,l[0]>>16,l[1]&65535,l[1]>>16,l[2]&65535,l[2]>>16,l[3]&65535,l[3]>>16],tt=!0,it="";for(w=0;w<5;w++)if(x[w]!==0){tt=!1;break}if(tt){if(it=Jo(x[6]|x[7]<<16),x[5]===-1)return u="::ffff:",u+=it,u;if(x[5]===0)return u="::",it==="0.0.0.0"&&(it=""),it==="0.0.0.1"&&(it="1"),u+=it,u}for(h=0;h<8;h++)x[h]===0&&(h-_>1&&(v=0),_=h,v++),v>m&&(m=v,A=h-m+1);for(h=0;h<8;h++){if(m>1&&x[h]===0&&h>=A&&h<A+m){h===A&&(u+=":",A===0&&(u+=":"));continue}u+=Number(ea(x[h]&65535)).toString(16),u+=h<7?":":""}return u}function Ac(l,u){var h=ni[l>>1],m=ea(fc[l+2>>1]),_;switch(h){case 2:if(u!==16)return{errno:28};_=T[l+4>>2],_=Jo(_);break;case 10:if(u!==28)return{errno:28};_=[T[l+8>>2],T[l+12>>2],T[l+16>>2],T[l+20>>2]],_=Ic(_);break;default:return{errno:5}}return{family:h,addr:_,port:m}}function es(l){for(var u=l.split("."),h=0;h<4;h++){var m=Number(u[h]);if(isNaN(m))return null;u[h]=m}return(u[0]|u[1]<<8|u[2]<<16|u[3]<<24)>>>0}function rs(l){return parseInt(l)}function qo(l){var u,h,m,_,A=/^((?=.*::)(?!.*::.+::)(::)?([\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,v=[];if(!A.test(l))return null;if(l==="::")return[0,0,0,0,0,0,0,0];for(l.startsWith("::")?l=l.replace("::","Z:"):l=l.replace("::",":Z:"),l.indexOf(".")>0?(l=l.replace(new RegExp("[.]","g"),":"),u=l.split(":"),u[u.length-4]=rs(u[u.length-4])+rs(u[u.length-3])*256,u[u.length-3]=rs(u[u.length-2])+rs(u[u.length-1])*256,u=u.slice(0,u.length-2)):u=l.split(":"),m=0,_=0,h=0;h<u.length;h++)if(typeof u[h]=="string")if(u[h]==="Z"){for(_=0;_<8-u.length+1;_++)v[h+_]=0;m=_-1}else v[h+m]=os(parseInt(u[h],16));else v[h+m]=u[h];return[v[1]<<16|v[0],v[3]<<16|v[2],v[5]<<16|v[4],v[7]<<16|v[6]]}var Be={address_map:{id:1,addrs:{},names:{}},lookup_name:function(l){var u=es(l);if(u!==null||(u=qo(l),u!==null))return l;var h;if(Be.address_map.addrs[l])h=Be.address_map.addrs[l];else{var m=Be.address_map.id++;Ht(m<65535,"exceeded max address mappings of 65535"),h="172.29."+(m&255)+"."+(m&65280),Be.address_map.names[h]=l,Be.address_map.addrs[l]=h}return h},lookup_addr:function(l){return Be.address_map.names[l]?Be.address_map.names[l]:null}};function Fc(l,u,h){if(h&&l===0)return null;var m=Ac(l,u);if(m.errno)throw new Sc.ErrnoError(m.errno);return m.addr=Be.lookup_addr(m.addr)||m.addr,m}function Fd(l,u,h){var m=si(l),_=Fc(u,h);return m.sock_ops.bind(m,_.addr,_.port),0}function xd(l,u,h){var m=si(l),_=Fc(u,h);return m.sock_ops.connect(m,_.addr,_.port),0}function Bd(l,u,h,m){return u=jt.getStr(u),u=jt.calculateAt(l,u),jt.doAccess(u,h)}function Td(l,u,h){return jt.varargs=h,0}function Dd(l,u){}function Ed(l,u,h){}function Od(l,u,h){}function xc(l,u){Cr.fill(0,l,l+u)}function Zo(l,u,h,m,_){switch(u){case 2:h=es(h),xc(l,16),_&&(T[_>>2]=16),ni[l>>1]=u,T[l+4>>2]=h,ni[l+2>>1]=os(m);break;case 10:h=qo(h),xc(l,28),_&&(T[_>>2]=28),T[l>>2]=u,T[l+8>>2]=h[0],T[l+12>>2]=h[1],T[l+16>>2]=h[2],T[l+20>>2]=h[3],ni[l+2>>1]=os(m);break;default:return 5}return 0}function Md(l,u,h){var m=si(l);if(!m.daddr)return-53;var _=Zo(u,m.family,Be.lookup_name(m.daddr),m.dport,h);return 0}function Rd(l,u,h,m,_){var A=si(l);return u===1&&h===4?(T[m>>2]=A.error,T[_>>2]=4,A.error=null,0):-50}function Ud(l,u,h){return jt.varargs=h,0}function Nd(l,u){}function kd(l,u,h){}function Ld(l,u,h,m){}function Cd(l,u,h,m){jt.varargs=m}function Pd(l,u,h,m,_,A){var v=si(l),w=v.sock_ops.recvmsg(v,h);if(!w)return 0;if(_)var x=Zo(_,v.family,Be.lookup_name(w.addr),w.port,A);return Cr.set(w.buffer,u),w.buffer.byteLength}function Vd(l,u,h,m){}function Hd(l){}function zd(l,u,h,m,_,A){}function jd(l,u,h){}function Wd(l,u){}function $d(l,u,h){}function Yd(l){}var Bc="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Xd(l,u){ke(Bc)}function Gd(l,u){ke(Bc)}function Kd(){return Date.now()}var Jd=!0;function qd(){return Jd}function Zd(){ke("")}function Qd(l,u){return globalThis.DUCKDB_RUNTIME.createDirectory(e,l,u)}function tf(l,u){return globalThis.DUCKDB_RUNTIME.checkDirectory(e,l,u)}function ef(l,u){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(e,l,u)}function rf(l,u){return globalThis.DUCKDB_RUNTIME.removeDirectory(e,l,u)}function nf(l){return globalThis.DUCKDB_RUNTIME.closeFile(e,l)}function sf(l,u){return globalThis.DUCKDB_RUNTIME.checkFile(e,l,u)}function of(l){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(e,l)}function af(l,u,h,m){return globalThis.DUCKDB_RUNTIME.moveFile(e,l,u,h,m)}function cf(l,u){return globalThis.DUCKDB_RUNTIME.openFile(e,l,u)}function lf(l,u,h,m){return globalThis.DUCKDB_RUNTIME.readFile(e,l,u,h,m)}function uf(l,u){return globalThis.DUCKDB_RUNTIME.truncateFile(e,l,u)}function df(l,u,h,m){return globalThis.DUCKDB_RUNTIME.writeFile(e,l,u,h,m)}function ff(l,u){return globalThis.DUCKDB_RUNTIME.glob(e,l,u)}function hf(l){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(e,l)}function pf(l,u,h,m,_,A){return globalThis.DUCKDB_RUNTIME.callScalarUDF(e,l,u,h,m,_,A)}function Tc(){return 2147483648}var Qo;b?Qo=()=>{var l=process.hrtime();return l[0]*1e3+l[1]/1e6}:Qo=()=>performance.now();function mf(l,u,h){Cr.copyWithin(l,u,u+h)}function yf(l){try{return Rt.grow(l-dc.byteLength+65535>>>16),hc(Rt.buffer),1}catch(u){}}function _f(l){var u=Cr.length;l=l>>>0;var h=Tc();if(l>h)return!1;let m=(x,tt)=>x+(tt-x%tt)%tt;for(var _=1;_<=4;_*=2){var A=u*(1+.2/_);A=Math.min(A,l+100663296);var v=Math.min(h,m(Math.max(l,A),65536)),w=yf(v);if(w)return!0}return!1}var ta={};function bf(){return a||"./this.program"}function oi(){if(!oi.strings){var l=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",u={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:l,_:bf()};for(var h in ta)ta[h]===void 0?delete u[h]:u[h]=ta[h];var m=[];for(var h in u)m.push(h+"="+u[h]);oi.strings=m}return oi.strings}function gf(l,u){var h=0;return oi().forEach(function(m,_){var A=u+h;T[l+_*4>>2]=A,nd(m,A),h+=m.length+1}),0}function wf(l,u){var h=oi();T[l>>2]=h.length;var m=0;return h.forEach(function(_){m+=_.length+1}),T[u>>2]=m,0}function vf(l){return 0}function Sf(l,u,h,m,_,A){var v=jt.getStreamFromFD(l),w=jt.doReadv(v,u,h,m);return T[A>>2]=w,0}function If(l,u,h,m,_,A){var v=jt.getStreamFromFD(l),w=jt.doWritev(v,u,h,m);return T[A>>2]=w,0}function Af(l,u,h,m){var _=jt.getStreamFromFD(l),A=jt.doReadv(_,u,h);return T[m>>2]=A,0}function Ff(l,u,h,m,_){}function xf(l){var u=jt.getStreamFromFD(l);return u.stream_ops&&u.stream_ops.fsync?-u.stream_ops.fsync(u):0}function Bf(l,u,h,m){for(var _=0,A=0;A<h;A++){var v=T[u>>2],w=T[u+4>>2];u+=8;for(var x=0;x<w;x++)jt.printChar(l,Cr[v+x]);_+=w}return T[m>>2]=_,0}function Tf(l,u,h,m){var _=0,A=0,v=0,w=0,x=0,tt=0,it;function Te(ht,Fn,Ot,Le,tr,ai){var g,E,bt,Wt;return E=ht===10?28:16,tr=ht===10?Ic(tr):Jo(tr),g=ra(E),Wt=Zo(g,ht,tr,ai),Ht(!Wt),bt=ra(32),T[bt+4>>2]=ht,T[bt+8>>2]=Fn,T[bt+12>>2]=Ot,T[bt+24>>2]=Le,T[bt+20>>2]=g,ht===10?T[bt+16>>2]=28:T[bt+16>>2]=16,T[bt+28>>2]=0,bt}if(h&&(v=T[h>>2],w=T[h+4>>2],x=T[h+8>>2],tt=T[h+12>>2]),x&&!tt&&(tt=x===2?17:6),!x&&tt&&(x=tt===17?2:1),tt===0&&(tt=6),x===0&&(x=1),!l&&!u)return-2;if(v&-1088||h!==0&&T[h>>2]&2&&!l)return-1;if(v&32)return-2;if(x!==0&&x!==1&&x!==2)return-7;if(w!==0&&w!==2&&w!==10)return-6;if(u&&(u=wr(u),A=parseInt(u,10),isNaN(A)))return v&1024?-2:-8;if(!l)return w===0&&(w=2),(v&1)===0&&(w===2?_=ss(2130706433):_=[0,0,0,1]),it=Te(w,x,tt,null,_,A),T[m>>2]=it,0;if(l=wr(l),_=es(l),_!==null)if(w===0||w===2)w=2;else if(w===10&&v&8)_=[0,0,ss(65535),_],w=10;else return-2;else if(_=qo(l),_!==null)if(w===0||w===10)w=10;else return-2;return _!=null?(it=Te(w,x,tt,l,_,A),T[m>>2]=it,0):v&4?-2:(l=Be.lookup_name(l),_=es(l),w===0?w=2:w===10&&(_=[0,0,ss(65535),_]),it=Te(w,x,tt,null,_,A),T[m>>2]=it,0)}function Df(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var l=new Uint8Array(1);return function(){return crypto.getRandomValues(l),l[0]}}else if(b)try{var u=Nh("crypto");return function(){return u.randomBytes(1)[0]}}catch(h){}return function(){ke("randomDevice")}}function ns(l,u){ns.randomDevice||(ns.randomDevice=Df());for(var h=0;h<u;h++)ri[l+h>>0]=ns.randomDevice();return 0}function Ef(l,u,h,m,_,A,v){var w=Ac(l,u);if(w.errno)return-6;var x=w.port,tt=w.addr,it=!1;if(h&&m){var Te;if(v&1||!(Te=Be.lookup_addr(tt))){if(v&8)return-2}else tt=Te;var ht=Go(tt,h,m);ht+1>=m&&(it=!0)}if(_&&A){x=""+x;var ht=Go(x,_,A);ht+1>=A&&(it=!0)}return it?-12:0}function is(l){return l%4===0&&(l%100!==0||l%400===0)}function Of(l,u){for(var h=0,m=0;m<=u;h+=l[m++]);return h}var Dc=[31,29,31,30,31,30,31,31,30,31,30,31],Ec=[31,28,31,30,31,30,31,31,30,31,30,31];function Mf(l,u){for(var h=new Date(l.getTime());u>0;){var m=is(h.getFullYear()),_=h.getMonth(),A=(m?Dc:Ec)[_];if(u>A-h.getDate())u-=A-h.getDate()+1,h.setDate(1),_<11?h.setMonth(_+1):(h.setMonth(0),h.setFullYear(h.getFullYear()+1));else return h.setDate(h.getDate()+u),h}return h}function Rf(l,u,h,m){var _=T[m+40>>2],A={tm_sec:T[m>>2],tm_min:T[m+4>>2],tm_hour:T[m+8>>2],tm_mday:T[m+12>>2],tm_mon:T[m+16>>2],tm_year:T[m+20>>2],tm_wday:T[m+24>>2],tm_yday:T[m+28>>2],tm_isdst:T[m+32>>2],tm_gmtoff:T[m+36>>2],tm_zone:_?wr(_):""},v=wr(h),w={"%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 x in w)v=v.replace(new RegExp(x,"g"),w[x]);var tt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],it=["January","February","March","April","May","June","July","August","September","October","November","December"];function Te(g,E,bt){for(var Wt=typeof g=="number"?g.toString():g||"";Wt.length<E;)Wt=bt[0]+Wt;return Wt}function ht(g,E){return Te(g,E,"0")}function Fn(g,E){function bt(ls){return ls<0?-1:ls>0?1:0}var Wt;return(Wt=bt(g.getFullYear()-E.getFullYear()))===0&&(Wt=bt(g.getMonth()-E.getMonth()))===0&&(Wt=bt(g.getDate()-E.getDate())),Wt}function Ot(g){switch(g.getDay()){case 0:return new Date(g.getFullYear()-1,11,29);case 1:return g;case 2:return new Date(g.getFullYear(),0,3);case 3:return new Date(g.getFullYear(),0,2);case 4:return new Date(g.getFullYear(),0,1);case 5:return new Date(g.getFullYear()-1,11,31);case 6:return new Date(g.getFullYear()-1,11,30)}}function Le(g){var E=Mf(new Date(g.tm_year+1900,0,1),g.tm_yday),bt=new Date(E.getFullYear(),0,4),Wt=new Date(E.getFullYear()+1,0,4),ls=Ot(bt),Bh=Ot(Wt);return Fn(ls,E)<=0?Fn(Bh,E)<=0?E.getFullYear()+1:E.getFullYear():E.getFullYear()-1}var tr={"%a":function(g){return tt[g.tm_wday].substring(0,3)},"%A":function(g){return tt[g.tm_wday]},"%b":function(g){return it[g.tm_mon].substring(0,3)},"%B":function(g){return it[g.tm_mon]},"%C":function(g){var E=g.tm_year+1900;return ht(E/100|0,2)},"%d":function(g){return ht(g.tm_mday,2)},"%e":function(g){return Te(g.tm_mday,2," ")},"%g":function(g){return Le(g).toString().substring(2)},"%G":function(g){return Le(g)},"%H":function(g){return ht(g.tm_hour,2)},"%I":function(g){var E=g.tm_hour;return E==0?E=12:E>12&&(E-=12),ht(E,2)},"%j":function(g){return ht(g.tm_mday+Of(is(g.tm_year+1900)?Dc:Ec,g.tm_mon-1),3)},"%m":function(g){return ht(g.tm_mon+1,2)},"%M":function(g){return ht(g.tm_min,2)},"%n":function(){return`
|
|
11
|
+
`},"%p":function(g){return g.tm_hour>=0&&g.tm_hour<12?"AM":"PM"},"%S":function(g){return ht(g.tm_sec,2)},"%t":function(){return" "},"%u":function(g){return g.tm_wday||7},"%U":function(g){var E=g.tm_yday+7-g.tm_wday;return ht(Math.floor(E/7),2)},"%V":function(g){var E=Math.floor((g.tm_yday+7-(g.tm_wday+6)%7)/7);if((g.tm_wday+371-g.tm_yday-2)%7<=2&&E++,E){if(E==53){var Wt=(g.tm_wday+371-g.tm_yday)%7;Wt!=4&&(Wt!=3||!is(g.tm_year))&&(E=1)}}else{E=52;var bt=(g.tm_wday+7-g.tm_yday-1)%7;(bt==4||bt==5&&is(g.tm_year%400-1))&&E++}return ht(E,2)},"%w":function(g){return g.tm_wday},"%W":function(g){var E=g.tm_yday+7-(g.tm_wday+6)%7;return ht(Math.floor(E/7),2)},"%y":function(g){return(g.tm_year+1900).toString().substring(2)},"%Y":function(g){return g.tm_year+1900},"%z":function(g){var E=g.tm_gmtoff,bt=E>=0;return E=Math.abs(E)/60,E=E/60*100+E%60,(bt?"+":"-")+String("0000"+E).slice(-4)},"%Z":function(g){return g.tm_zone},"%%":function(){return"%"}};v=v.replace(/%%/g,"\0\0");for(var x in tr)v.includes(x)&&(v=v.replace(new RegExp(x,"g"),tr[x](A)));v=v.replace(/\0\0/g,"%");var ai=Nf(v,!1);return ai.length>u?0:(uc(ai,l),ai.length-1)}function Uf(l,u,h,m){return Rf(l,u,h,m)}function Nf(l,u,h){var m=h>0?h:rd(l)+1,_=new Array(m),A=lc(l,_,0,_.length);return u&&(_.length=A),_}var kf={a:Sd,P:Id,R:Fd,Q:xd,J:Bd,b:Td,$:Dd,u:Ed,X:Od,L:Md,O:Rd,ba:Ud,Y:Nd,aa:kd,Z:Ld,o:Cd,M:Pd,H:Vd,m:Hd,N:zd,k:jd,_:Wd,n:$d,T:Yd,V:Xd,U:Gd,da:Kd,ca:qd,d:Zd,B:Qd,C:tf,z:ef,A:rf,i:nf,x:sf,E:of,y:af,F:cf,f:lf,D:uf,j:df,w:ff,g:hf,G:pf,ea:Tc,S:Qo,fa:mf,ga:_f,q:gf,r:wf,c:vf,t:Sf,s:If,h:Af,v:Ff,I:xf,e:Bf,l:Tf,W:ns,K:Ef,p:Uf},Dy=wd(),Lf=e.___wasm_call_ctors=function(){return(Lf=e.___wasm_call_ctors=e.asm.ia).apply(null,arguments)},Cf=e._main=function(){return(Cf=e._main=e.asm.ja).apply(null,arguments)},Pf=e._duckdb_web_fs_glob_add_path=function(){return(Pf=e._duckdb_web_fs_glob_add_path=e.asm.ka).apply(null,arguments)},Vf=e._duckdb_web_clear_response=function(){return(Vf=e._duckdb_web_clear_response=e.asm.la).apply(null,arguments)},Hf=e._duckdb_web_fail_with=function(){return(Hf=e._duckdb_web_fail_with=e.asm.ma).apply(null,arguments)},zf=e._duckdb_web_reset=function(){return(zf=e._duckdb_web_reset=e.asm.na).apply(null,arguments)},jf=e._duckdb_web_connect=function(){return(jf=e._duckdb_web_connect=e.asm.oa).apply(null,arguments)},Wf=e._duckdb_web_disconnect=function(){return(Wf=e._duckdb_web_disconnect=e.asm.pa).apply(null,arguments)},$f=e._duckdb_web_flush_files=function(){return($f=e._duckdb_web_flush_files=e.asm.qa).apply(null,arguments)},Yf=e._duckdb_web_flush_file=function(){return(Yf=e._duckdb_web_flush_file=e.asm.ra).apply(null,arguments)},Xf=e._duckdb_web_open=function(){return(Xf=e._duckdb_web_open=e.asm.sa).apply(null,arguments)},Gf=e._duckdb_web_get_global_file_info=function(){return(Gf=e._duckdb_web_get_global_file_info=e.asm.ta).apply(null,arguments)},Kf=e._duckdb_web_collect_file_stats=function(){return(Kf=e._duckdb_web_collect_file_stats=e.asm.ua).apply(null,arguments)},Jf=e._duckdb_web_export_file_stats=function(){return(Jf=e._duckdb_web_export_file_stats=e.asm.va).apply(null,arguments)},qf=e._duckdb_web_fs_drop_file=function(){return(qf=e._duckdb_web_fs_drop_file=e.asm.wa).apply(null,arguments)},Zf=e._duckdb_web_fs_drop_files=function(){return(Zf=e._duckdb_web_fs_drop_files=e.asm.xa).apply(null,arguments)},Qf=e._duckdb_web_fs_glob_file_infos=function(){return(Qf=e._duckdb_web_fs_glob_file_infos=e.asm.ya).apply(null,arguments)},th=e._duckdb_web_fs_get_file_info_by_id=function(){return(th=e._duckdb_web_fs_get_file_info_by_id=e.asm.za).apply(null,arguments)},eh=e._duckdb_web_fs_get_file_info_by_name=function(){return(eh=e._duckdb_web_fs_get_file_info_by_name=e.asm.Aa).apply(null,arguments)},rh=e._duckdb_web_fs_set_file_descriptor=function(){return(rh=e._duckdb_web_fs_set_file_descriptor=e.asm.Ba).apply(null,arguments)},nh=e._duckdb_web_fs_register_file_url=function(){return(nh=e._duckdb_web_fs_register_file_url=e.asm.Ca).apply(null,arguments)},ih=e._duckdb_web_fs_register_file_buffer=function(){return(ih=e._duckdb_web_fs_register_file_buffer=e.asm.Da).apply(null,arguments)},sh=e._duckdb_web_copy_file_to_buffer=function(){return(sh=e._duckdb_web_copy_file_to_buffer=e.asm.Ea).apply(null,arguments)},oh=e._duckdb_web_copy_file_to_path=function(){return(oh=e._duckdb_web_copy_file_to_path=e.asm.Fa).apply(null,arguments)},ah=e._duckdb_web_get_version=function(){return(ah=e._duckdb_web_get_version=e.asm.Ga).apply(null,arguments)},ch=e._duckdb_web_get_feature_flags=function(){return(ch=e._duckdb_web_get_feature_flags=e.asm.Ha).apply(null,arguments)},lh=e._duckdb_web_tokenize=function(){return(lh=e._duckdb_web_tokenize=e.asm.Ia).apply(null,arguments)},uh=e._duckdb_web_udf_scalar_create=function(){return(uh=e._duckdb_web_udf_scalar_create=e.asm.Ja).apply(null,arguments)},dh=e._duckdb_web_prepared_create=function(){return(dh=e._duckdb_web_prepared_create=e.asm.Ka).apply(null,arguments)},fh=e._duckdb_web_prepared_close=function(){return(fh=e._duckdb_web_prepared_close=e.asm.La).apply(null,arguments)},hh=e._duckdb_web_prepared_run=function(){return(hh=e._duckdb_web_prepared_run=e.asm.Ma).apply(null,arguments)},ph=e._duckdb_web_prepared_send=function(){return(ph=e._duckdb_web_prepared_send=e.asm.Na).apply(null,arguments)},mh=e._duckdb_web_query_run=function(){return(mh=e._duckdb_web_query_run=e.asm.Oa).apply(null,arguments)},yh=e._duckdb_web_query_send=function(){return(yh=e._duckdb_web_query_send=e.asm.Pa).apply(null,arguments)},_h=e._duckdb_web_query_fetch_results=function(){return(_h=e._duckdb_web_query_fetch_results=e.asm.Qa).apply(null,arguments)},bh=e._duckdb_web_get_tablenames=function(){return(bh=e._duckdb_web_get_tablenames=e.asm.Ra).apply(null,arguments)},gh=e._duckdb_web_insert_arrow_from_ipc_stream=function(){return(gh=e._duckdb_web_insert_arrow_from_ipc_stream=e.asm.Sa).apply(null,arguments)},wh=e._duckdb_web_insert_csv_from_path=function(){return(wh=e._duckdb_web_insert_csv_from_path=e.asm.Ta).apply(null,arguments)},vh=e._duckdb_web_insert_json_from_path=function(){return(vh=e._duckdb_web_insert_json_from_path=e.asm.Ua).apply(null,arguments)},ss=e._htonl=function(){return(ss=e._htonl=e.asm.Va).apply(null,arguments)},os=e._htons=function(){return(os=e._htons=e.asm.Wa).apply(null,arguments)},ea=e._ntohs=function(){return(ea=e._ntohs=e.asm.Xa).apply(null,arguments)},ra=e._malloc=function(){return(ra=e._malloc=e.asm.Ya).apply(null,arguments)},Sh=e._free=function(){return(Sh=e._free=e.asm.Za).apply(null,arguments)},Oc=e.stackSave=function(){return(Oc=e.stackSave=e.asm._a).apply(null,arguments)},Mc=e.stackRestore=function(){return(Mc=e.stackRestore=e.asm.$a).apply(null,arguments)},na=e.stackAlloc=function(){return(na=e.stackAlloc=e.asm.ab).apply(null,arguments)};e.ccall=at;var as;function cs(l){this.name="ExitStatus",this.message="Program terminated with exit("+l+")",this.status=l}var Ih=!1;ii=function l(){as||ia(),as||(ii=l)};function Ah(l){var u=e._main,h=0,m=0;try{var _=u(h,m);return Fh(_,!0),_}catch(A){return vd(A)}finally{Ih=!0}}function ia(l){if(l=l||o,cn>0||(ld(),cn>0))return;function u(){as||(as=!0,e.calledRun=!0,!te&&(ud(),dd(),n(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),Rc&&Ah(l),fd()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),u()},1)):u()}e.run=ia;function Fh(l,u){Vt=l,xh(l)}function xh(l){Vt=l,bc()||(e.onExit&&e.onExit(l),te=!0),c(l,new cs(l))}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();var Rc=!0;return e.noInitialRun&&(Rc=!1),ia(),t.ready}})(),Xu=by;var Vo=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),n=xt.from(e);return console.assert(n.isSync()),console.assert(n.isFile()),new It(n)}send(t){let e=this._bindings.sendQuery(this._conn,t),n=new Ho(this._bindings,this._conn,e),i=xt.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}getTableNames(t){return this._bindings.getTableNames(this._conn,t)}prepare(t){let e=this._bindings.createPrepared(this._conn,t);return new ic(this._bindings,this._conn,e)}createScalarFunction(t,e,n){this._bindings.createScalarFunction(this._conn,t,e,n)}insertArrowTable(t,e){let n=new _r;n.writeAll(t);let i=n.toUint8Array(!0);this.insertArrowFromIPCStream(i,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)}},Ho=class{constructor(t,e,n){this.bindings=t;this.conn=e;this.header=n;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}},ic=class{constructor(t,e,n){this.bindings=t,this.connectionId=e,this.statementId=n}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...t){let e=this.bindings.runPrepared(this.connectionId,this.statementId,t),n=xt.from(e);return console.assert(n.isSync()),console.assert(n.isFile()),new It(n)}send(...t){let e=this.bindings.sendPrepared(this.connectionId,this.statementId,t),n=new Ho(this.bindings,this.connectionId,e),i=xt.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}};var Ju=new TextEncoder,Gu=new TextDecoder("utf-8");function sc(r,t,e){let n=Ju.encode(e),i=r._malloc(n.byteLength),s=r.HEAPU8.subarray(i,i+n.byteLength);s.set(n),r.HEAPF64[(t>>3)+0]=1,r.HEAPF64[(t>>3)+1]=i,r.HEAPF64[(t>>3)+2]=s.byteLength}function ac(r){switch(r){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 oc(r,t,e,n){let i=r.HEAPU8.subarray(t,t+n*ac(e));switch(e){case"UINT8":return new Uint8Array(i.buffer,i.byteOffset,n);case"INT8":return new Int8Array(i.buffer,i.byteOffset,n);case"INT32":return new Int32Array(i.buffer,i.byteOffset,n);case"FLOAT":return new Float32Array(i.buffer,i.byteOffset,n);case"DOUBLE":return new Float64Array(i.buffer,i.byteOffset,n);case"VARCHAR":return new Float64Array(i.buffer,i.byteOffset,n);default:return new Array(0)}}function Ku(r,t,e){let n=r.HEAPU8.subarray(t,t+e);return new Uint8Array(n.buffer,n.byteOffset,e)}function zo(r,t,e){let n=r.HEAPU8.subarray(t,t+e*8);return new Float64Array(n.buffer,n.byteOffset,e)}function qu(r,t,e,n,i,s,o,a){try{let c=r._udfFunctions.get(n);if(!c){sc(t,e,"Unknown UDF with id: "+n);return}let d=Gu.decode(t.HEAPU8.subarray(i,i+s)),p=JSON.parse(d),b=zo(t,o,a/8),y=Z=>{var te;let Rt=null;switch(Z.validityBuffer!==void 0&&(Rt=Ku(t,b[Z.validityBuffer],p.rows)),Z.physicalType){case"VARCHAR":{if(Z.dataBuffer===null||Z.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(Z.lengthBuffer===null||Z.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let Vt=oc(t,b[Z.dataBuffer],Z.physicalType,p.rows),Ht=[],zt=zo(t,b[Z.lengthBuffer],p.rows);for(let at=0;at<p.rows;++at){if(Rt!=null&&!Rt[at]){Ht.push(null);continue}let oe=t.HEAPU8.subarray(Vt[at],Vt[at]+zt[at]),an=Gu.decode(oe);Ht.push(an)}return at=>Ht[at]}case"STRUCT<?>":{let Vt={},Ht=[];for(let zt=0;zt<(((te=Z.children)==null?void 0:te.length)||0);++zt){let at=Z.children[zt],oe=y(at);Ht.push(an=>{Vt[at.name]=oe(an)})}return Rt!=null?zt=>{if(!Rt[zt])return null;for(let at of Ht)at(zt);return Vt}:zt=>{for(let at of Ht)at(zt);return Vt}}default:{if(Z.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+Z.physicalType);let Vt=oc(t,b[Z.dataBuffer],Z.physicalType,p.rows);return Rt!=null?Ht=>Rt[Ht]?Vt[Ht]:null:Ht=>Vt[Ht]}}},S=[];for(let Z=0;Z<p.args.length;++Z)S.push(y(p.args[Z]));let J=p.rows*ac(p.ret.physicalType),q=t._malloc(J),ot=oc(t,q,p.ret.physicalType,p.rows),St=t._malloc(p.rows),Qt=Ku(t,St,p.rows);if(ot.length==0||Qt.length==0){sc(t,e,"Can't create physical arrays for result");return}let se=ot;p.ret.physicalType=="VARCHAR"&&(se=new Array(p.rows));let Lr=[];for(let Z=0;Z<p.args.length;++Z)Lr.push(null);for(let Z=0;Z<p.rows;++Z){for(let te=0;te<p.args.length;++te)Lr[te]=S[te](Z);let Rt=c.func(...Lr);se[Z]=Rt,Qt[Z]=Rt==null?0:1}let on=0;switch(p.ret.physicalType){case"VARCHAR":{let Z=new Array(0);on=t._malloc(p.rows*ac("DOUBLE"));let Rt=zo(t,on,p.rows),te=0;for(let at=0;at<p.rows;++at){let oe=Ju.encode(se[at]||"");Z.push(oe),Rt[at]=oe.length,te+=oe.length}let Vt=t._malloc(te),Ht=t.HEAPU8.subarray(Vt,Vt+te),zt=0;for(let at=0;at<p.rows;++at){ot[at]=zt;let oe=Z[at];Ht.subarray(zt,zt+oe.length).set(oe),zt+=oe.length}}}let Xo=3*8,Fe=t._malloc(Xo),gr=zo(t,Fe,3);gr[0]=q,gr[1]=St,gr[2]=on,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=Fe,t.HEAPF64[(e>>3)+2]=0}catch(c){sc(t,e,c.toString())}}function wy(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}var vy=wy();function br(r,t){r.ccall("duckdb_web_fail_with",null,["string"],[t])}function ei(r,t,e){let n=r.HEAPU8.subarray(t,t+e),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function j(r,t,e){return vy(r.HEAPU8.subarray(t,t+e))}function nt(r,t,e,n){let i=r.stackSave(),s=r.stackAlloc(3*8);e.unshift("number"),n.unshift(s),r.ccall(t,null,e,n);let o=r.HEAPF64[(s>>3)+0],a=r.HEAPF64[(s>>3)+1],c=r.HEAPF64[(s>>3)+2];return r.stackRestore(i),[o,a,c]}function _t(r){r.ccall("duckdb_web_clear_response",null,[],[])}var jo=class{constructor(t){let e=new Float64Array(t.buffer,t.byteOffset,t.byteLength/8),n=new Uint8Array(new ArrayBuffer(t.byteLength));n.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=n}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 Sy=new TextEncoder;var Wo=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,n,i]=nt(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(j(this.mod,n,i));_t(this.mod)}reset(){let[t,e,n]=nt(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(j(this.mod,e,n));_t(this.mod)}getVersion(){let[t,e,n]=nt(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(j(this.mod,e,n));let i=j(this.mod,e,n);return _t(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let[e,n,i]=nt(this.mod,"duckdb_web_tokenize",["string"],[t]);if(e!==0)throw new Error(j(this.mod,n,i));let s=j(this.mod,n,i);return _t(this.mod),JSON.parse(s)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Vo(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[n,i,s]=nt(this.mod,"duckdb_web_query_run",["number","string"],[t,e]);if(n!==0)throw new Error(j(this.mod,i,s));let o=ei(this.mod,i,s);return _t(this.mod),o}sendQuery(t,e){let[n,i,s]=nt(this.mod,"duckdb_web_query_send",["number","string"],[t,e]);if(n!==0)throw new Error(j(this.mod,i,s));let o=ei(this.mod,i,s);return _t(this.mod),o}fetchQueryResults(t){let[e,n,i]=nt(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(e!==0)throw new Error(j(this.mod,n,i));let s=ei(this.mod,n,i);return _t(this.mod),s}getTableNames(t,e){let[n,i,s]=nt(this.mod,"duckdb_web_get_tablenames",["number","string"],[t,e]);if(n!==0)throw new Error(j(this.mod,i,s));let o=j(this.mod,i,s);return _t(this.mod),JSON.parse(o)}createScalarFunction(t,e,n,i){let s={functionId:this._nextUDFId,name:e,returnType:ti(n)},o={functionId:s.functionId,connectionId:t,name:e,returnType:n,func:i};this._nextUDFId+=1;let[a,c,d]=nt(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(s)]);if(a!==0)throw new Error(j(this.mod,c,d));if(_t(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let p of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])p.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(t,e){let[n,i,s]=nt(this.mod,"duckdb_web_prepared_create",["number","string"],[t,e]);if(n!==0)throw new Error(j(this.mod,i,s));return _t(this.mod),i}closePrepared(t,e){let[n,i,s]=nt(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(n!==0)throw new Error(j(this.mod,i,s));_t(this.mod)}runPrepared(t,e,n){let[i,s,o]=nt(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(n)]);if(i!==0)throw new Error(j(this.mod,s,o));let a=ei(this.mod,s,o);return _t(this.mod),a}sendPrepared(t,e,n){let[i,s,o]=nt(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(n)]);if(i!==0)throw new Error(j(this.mod,s,o));let a=ei(this.mod,s,o);return _t(this.mod),a}insertArrowFromIPCStream(t,e,n){if(e.length==0)return;let i=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(i,i+e.length).set(e);let o=n?JSON.stringify(n):"",[a,c,d]=nt(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,i,e.length,o]);if(a!==0)throw new Error(j(this.mod,c,d))}insertCSVFromPath(t,e,n){if(n.columns!==void 0){n.columnsFlat=[];for(let d in n.columns)n.columnsFlat.push(Co(d,n.columns[d]))}let i=Pr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,a,c]=nt(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,s]);if(o!==0)throw new Error(j(this.mod,a,c))}insertJSONFromPath(t,e,n){if(n.columns!==void 0){n.columnsFlat=[];for(let d in n.columns)n.columnsFlat.push(Co(d,n.columns[d]))}let i=Pr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,a,c]=nt(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,s]);if(o!==0)throw new Error(j(this.mod,a,c))}globFiles(t){let[e,n,i]=nt(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(j(this.mod,n,i));let s=j(this.mod,n,i);_t(this.mod);let o=JSON.parse(s);return o==null?[]:o}registerFileURL(t,e){e===void 0&&(e=t);let[n,i,s]=nt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,e,-1]);if(n!==0)throw new Error(j(this.mod,i,s));_t(this.mod)}registerFileText(t,e){let n=Sy.encode(e);this.registerFileBuffer(t,n)}registerFileBuffer(t,e){let n=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(n,n+e.length).set(e);let[s,o,a]=nt(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,n,e.length]);if(s!==0)throw new Error(j(this.mod,o,a));_t(this.mod)}registerFileHandle(t,e){let[n,i,s]=nt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,t,-1]);if(n!==0)throw new Error(j(this.mod,i,s));if(_t(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),this.pthread){for(let o of this.pthread.runningWorkers)o.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e});for(let o of this.pthread.unusedWorkers)o.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,n,i]=nt(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(j(this.mod,n,i));_t(this.mod)}dropFiles(){let[t,e,n]=nt(this.mod,"duckdb_web_fs_drop_files",[],[]);if(t!==0)throw new Error(j(this.mod,e,n));_t(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[n,i,s]=nt(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(n!==0)throw new Error(j(this.mod,i,s));_t(this.mod)}copyFileToBuffer(t){let[e,n,i]=nt(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(j(this.mod,n,i));let s=this.mod.HEAPU8.subarray(n,n+i),o=new Uint8Array(s.length);return o.set(s),_t(this.mod),o}collectFileStatistics(t,e){let[n,i,s]=nt(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(n!==0)throw new Error(j(this.mod,i,s))}exportFileStatistics(t){let[e,n,i]=nt(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(j(this.mod,n,i));return new jo(this.mod.HEAPU8.subarray(n,n+i))}};var $o=class extends Wo{constructor(e,n,i,s){super(e,n);this.mainModuleURL=i,this.pthreadWorkerURL=s}locateFile(e,n){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=${n} path=${e}`)}instantiateWasm(e,n){globalThis.DUCKDB_RUNTIME=this._runtime;let i=this.onInstantiationProgress;if(typeof TransformStream=="function"&&ReadableStream.prototype.pipeThrough&&WebAssembly.instantiateStreaming){let o=(async()=>{var q;let a=new Request(this.mainModuleURL),c=await fetch(a),d=c.headers.get("content-length"),p=d&&parseInt(d,10)||0,b=new Date,y={startedAt:b,updatedAt:b,bytesTotal:p||0,bytesLoaded:0},S={transform(ot,St){y.bytesLoaded+=ot.byteLength;let Qt=new Date;if(Qt.getTime()-y.updatedAt.getTime()<20){y.updatedAt=Qt,St.enqueue(ot);return}for(let se of i)se(y);St.enqueue(ot)}},J=new TransformStream(S);return new Response((q=c.body)==null?void 0:q.pipeThrough(J),c)})();WebAssembly.instantiateStreaming(o,e).then(a=>{n(a.instance,a.module)})}else{let s=new XMLHttpRequest,o=this.mainModuleURL,a=new Date,c={startedAt:a,updatedAt:a,bytesTotal:0,bytesLoaded:0};s.open("GET",o),s.responseType="arraybuffer",s.onerror=d=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+d}),new Error(d.toString())},s.onprogress=d=>{c.bytesTotal=d.total,c.bytesLoaded=d.loaded;let p=new Date;if(p.getTime()-c.updatedAt.getTime()<20){c.updatedAt=p;return}for(let b of i)b(c)},s.onload=()=>{WebAssembly.instantiate(s.response,e).then(d=>{n(d.instance,d.module)}).catch(d=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+d}),new Error(d)})},s.send()}return[]}};var Yo=class extends $o{constructor(t,e,n,i=null){super(t,e,n,i)}instantiateImpl(t){return Xu(li(Pr({},t),{instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)}))}};var rn=Cc(Zu()),Qu=function(r,t,e){var n;if((n=r==null?void 0:r.endpoint)!=null&&n.startsWith("http")){let i=`${r==null?void 0:r.endpoint}`,s=i.indexOf("://")+3;return i.substring(s)}else return r!=null&&r.endpoint?`${e}.${r==null?void 0:r.endpoint}`:`${e}.s3.amazonaws.com`};function Iy(r,t,e){var i,s,o,a;let n=td(t);return{url:n.path,query:"",host:Qu(r,t,n.bucket),region:(i=r==null?void 0:r.region)!=null?i:"",service:"s3",method:e,accessKeyId:(s=r==null?void 0:r.accessKeyId)!=null?s:"",secretAccessKey:(o=r==null?void 0:r.secretAccessKey)!=null?o:"",sessionToken:(a=r==null?void 0:r.sessionToken)!=null?a:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function Ay(r,t=!1){let e="0123456789ABCDEF",n="";for(let i=0;i<r.length;i++){let s=r[i];s>="A"&&s<="Z"||s>="a"&&s<="z"||s>="0"&&s<="9"||s=="_"||s=="-"||s=="~"||s=="."?n+=s:s=="/"?t?n+="%2F":n+=s:(n+="%",n+=e[s.charCodeAt(0)>>4],n+=e[s.charCodeAt(0)&15])}return n}function Fy(r,t=null){var J;let e=(J=t==null?void 0:t.contentHash)!=null?J:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",n=new Map;n.set("x-amz-date",r.datetimeNow),n.set("x-amz-content-sha256",e),r.sessionToken&&n.set("x-amz-security-token",r.sessionToken);let i="";t!=null&&t.contentType&&(i+="content-type;"),i+="host;x-amz-content-sha256;x-amz-date",r.sessionToken&&(i+=";x-amz-security-token");let s=r.method+`
|
|
12
|
+
`+Ay(r.url)+`
|
|
13
|
+
`+r.query;t!=null&&t.contentType&&(s+=`
|
|
14
|
+
content-type:`+(t==null?void 0:t.contentType)),s+=`
|
|
22
15
|
host:`+r.host+`
|
|
23
|
-
x-amz-content-sha256:`+
|
|
16
|
+
x-amz-content-sha256:`+e+`
|
|
24
17
|
x-amz-date:`+r.datetimeNow,r.sessionToken&&r.sessionToken.length>0&&(s+=`
|
|
25
18
|
x-amz-security-token:`+r.sessionToken),s+=`
|
|
26
19
|
|
|
27
20
|
`+i+`
|
|
28
|
-
`+
|
|
21
|
+
`+e;let o=(0,rn.sha256)(s),a=`AWS4-HMAC-SHA256
|
|
29
22
|
`+r.datetimeNow+`
|
|
30
23
|
`+r.dateNow+"/"+r.region+"/"+r.service+`/aws4_request
|
|
31
|
-
`+o,c="AWS4"+r.secretAccessKey,
|
|
24
|
+
`+o,c="AWS4"+r.secretAccessKey,d=rn.sha256.hmac.arrayBuffer(c,r.dateNow),p=rn.sha256.hmac.arrayBuffer(d,r.region),b=rn.sha256.hmac.arrayBuffer(p,r.service),y=rn.sha256.hmac.arrayBuffer(b,"aws4_request"),S=rn.sha256.hmac(y,a);return n.set("Authorization","AWS4-HMAC-SHA256 Credential="+r.accessKeyId+"/"+r.dateNow+"/"+r.region+"/"+r.service+"/aws4_request, SignedHeaders="+i+", Signature="+S),n}var xy=function(r,t,e,n=null,i=null){let s=Iy(r,t,e),o={contentType:n,contentHash:i?rn.sha256.hex(i):null};return Fy(s,o)};function nn(r,t,e,n,i=null,s=null){((t==null?void 0:t.accessKeyId)||(t==null?void 0:t.sessionToken))&&(xy(t,e,n,i,s).forEach((a,c)=>{r.setRequestHeader(c,a)}),i&&r.setRequestHeader("content-type",i))}function td(r){if(r.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let t=r.indexOf("/",5);if(t==-1)throw new Error("URL needs to contain a '/' after the host");let e=r.substring(5,t);if(!e)throw new Error("URL needs to contain a bucket name");let n=r.substring(t);if(!n)throw new Error("URL needs to contain key");return{bucket:e,path:n}}function sn(r,t){var n;let e=td(t);return(n=r==null?void 0:r.endpoint)!=null&&n.startsWith("http")?`${r==null?void 0:r.endpoint}/${e.bucket}`+e.path:"https://"+Qu(r,t,e.bucket)+e.path}var lt={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(r,t){try{let e=lt._fileInfoCache.get(t),[n,i,s]=nt(r,"duckdb_web_fs_get_file_info_by_id",["number","number"],[t,(e==null?void 0:e.cacheEpoch)||0]);if(n!==0)return null;if(s===0)return e;let o=j(r,i,s);_t(r);let a=JSON.parse(o);if(a==null)return null;let c=li(Pr({},a),{blob:null});return lt._fileInfoCache.set(t,c),c}catch(e){return null}},getGlobalFileInfo(r){var t;try{let[e,n,i]=nt(r,"duckdb_web_get_global_file_info",["number"],[((t=lt._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(i===0)return lt._globalFileInfo;let s=j(r,n,i);_t(r);let o=JSON.parse(s);return o==null?null:(lt._globalFileInfo=li(Pr({},o),{blob:null}),lt._globalFileInfo)}catch(e){return null}},testPlatformFeature:(r,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn(`test for unknown feature: ${t}`),!1}},openFile:(r,t,e)=>{var n;try{lt._fileInfoCache.delete(t);let i=lt.getFileInfo(r,t);switch(i==null?void 0:i.dataProtocol){case 3:case 4:{if(e&1&&e&2)throw new Error(`Opening file ${i.fileName} failed: cannot open file with both read and write flags set`);if(e&32)throw new Error(`Opening file ${i.fileName} failed: appending to HTTP/S3 files is not supported`);if(e&2){let o=new XMLHttpRequest;if(i.dataProtocol==4?(o.open("HEAD",sn(i.s3Config,i.dataUrl),!1),nn(o,i.s3Config,i.dataUrl,"HEAD")):o.open("HEAD",i.dataUrl,!1),o.send(null),o.status!=200&&o.status!=404)throw new Error(`Opening file ${i.fileName} failed: Unexpected return status from server (${o.status})`);if(o.status==404&&!(e&8||e&16))throw new Error(`Opening file ${i.fileName} failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag.`);let a=r._malloc(1),c=new Uint8Array;r.HEAPU8.set(c,a);let d=r._malloc(2*8);return r.HEAPF64[(d>>3)+0]=1,r.HEAPF64[(d>>3)+1]=a,d}else if(e!=1)throw new Error(`Opening file ${i.fileName} failed: unsupported file flags: ${e}`);let s=null;try{let o=new XMLHttpRequest;i.dataProtocol==4?(o.open("HEAD",sn(i.s3Config,i.dataUrl),!1),nn(o,i.s3Config,i.dataUrl,"HEAD")):o.open("HEAD",i.dataUrl,!1),o.setRequestHeader("Range","bytes=0-"),o.send(null);let a=o.getResponseHeader("Content-Length");if(o.status==206&&a!==null){let c=r._malloc(16);return r.HEAPF64[(c>>3)+0]=+a,r.HEAPF64[(c>>3)+1]=0,c}}catch(o){s=o,console.warn(`HEAD request with range header failed: ${o}`)}if(i.allowFullHttpReads){console.warn(`falling back to full HTTP read for: ${i.dataUrl}`);let o=new XMLHttpRequest;if(i.dataProtocol==4?(o.open("GET",sn(i.s3Config,i.dataUrl),!1),nn(o,i.s3Config,i.dataUrl,"GET")):o.open("GET",i.dataUrl,!1),o.responseType="arraybuffer",o.send(null),o.status==200){let a=r._malloc(o.response.byteLength),c=new Uint8Array(o.response,0,o.response.byteLength);r.HEAPU8.set(c,a);let d=r._malloc(2*8);return r.HEAPF64[(d>>3)+0]=o.response.byteLength,r.HEAPF64[(d>>3)+1]=a,d}}if(s!=null)throw new Error(`Reading file ${i.fileName} failed with error: ${s}`);return 0}case 1:{let s=(n=lt._files)==null?void 0:n.get(i.fileName);if(s){let c=r._malloc(16);return r.HEAPF64[(c>>3)+0]=s.size,r.HEAPF64[(c>>3)+1]=0,c}console.warn(`Buffering missing file: ${i.fileName}`);let o=r._malloc(2*8),a=r._malloc(1);return r.HEAPF64[(o>>3)+0]=1,r.HEAPF64[(o>>3)+1]=a,o}}}catch(i){console.error(i.toString()),br(r,i.toString())}return 0},glob:(r,t,e)=>{try{let n=j(r,t,e);if(n.startsWith("http")||n.startsWith("s3://")){let i=new XMLHttpRequest;if(n.startsWith("s3://")){let s=lt.getGlobalFileInfo(r);i.open("HEAD",sn(s==null?void 0:s.s3Config,n),!1),nn(i,s==null?void 0:s.s3Config,n,"HEAD")}else i.open("HEAD",n,!1);if(i.send(null),i.status!=200&&i.status!==206){br(r,`HEAD request failed: ${n}`);return}r.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return br(r,n.toString()),0}},checkFile:(r,t,e)=>{try{let n=j(r,t,e);if(n.startsWith("http")||n.startsWith("s3://")){let i=new XMLHttpRequest;if(n.startsWith("s3://")){let s=lt.getGlobalFileInfo(r);i.open("HEAD",sn(s==null?void 0:s.s3Config,n),!1),nn(i,s==null?void 0:s.s3Config,n,"HEAD")}else i.open("HEAD",n,!1);return i.send(null),i.status==206||i.status==200}}catch(n){return!1}return!1},syncFile:(r,t)=>{},closeFile:(r,t)=>{let e=lt.getFileInfo(r,t);switch(lt._fileInfoCache.delete(t),e==null?void 0:e.dataProtocol){case 3:case 4:break;case 1:return}},truncateFile:(r,t,e)=>{let n=lt.getFileInfo(r,t);switch(n==null?void 0:n.dataProtocol){case 3:br(r,"Cannot truncate a http file");return;case 4:br(r,"Cannot truncate an s3 file");return;case 1:br(r,"truncateFile not implemented");return}return 0},readFile(r,t,e,n,i){var s;try{let o=lt.getFileInfo(r,t);switch(o==null?void 0:o.dataProtocol){case 3:case 4:{if(!o.dataUrl)throw new Error(`Missing data URL for file ${t}`);try{let a=new XMLHttpRequest;if(o.dataProtocol==4?(a.open("GET",sn(o==null?void 0:o.s3Config,o.dataUrl),!1),nn(a,o==null?void 0:o.s3Config,o.dataUrl,"GET")):a.open("GET",o.dataUrl,!1),a.responseType="arraybuffer",a.setRequestHeader("Range",`bytes=${i}-${i+n-1}`),a.send(null),a.status==206||a.status==200&&n==a.response.byteLength&&i==0){let c=new Uint8Array(a.response,0,Math.min(a.response.byteLength,n));return r.HEAPU8.set(c,e),c.byteLength}else throw a.status==200?new Error(`Range request for ${o.dataUrl} did not return a partial response: ${a.status} "${a.statusText}"`):new Error(`Range request for ${o.dataUrl} did returned non-success status: ${a.status} "${a.statusText}"`)}catch(a){throw new Error(`Range request for ${o.dataUrl} failed with error: ${a}"`)}}case 1:{let a=(s=lt._files)==null?void 0:s.get(o.fileName);if(!a)throw new Error(`No handle available for file: ${o.fileName}`);let c=a.slice(i,i+n),d=new Uint8Array(new FileReaderSync().readAsArrayBuffer(c));return r.HEAPU8.set(d,e),d.byteLength}}return 0}catch(o){return br(r,o.toString()),0}},writeFile:(r,t,e,n,i)=>{let s=lt.getFileInfo(r,t);switch(s==null?void 0:s.dataProtocol){case 3:return br(r,"Cannot write to HTTP file"),0;case 4:{let o=r.HEAPU8.subarray(e,e+n),a=new XMLHttpRequest;return a.open("PUT",sn(s==null?void 0:s.s3Config,s.dataUrl),!1),nn(a,s==null?void 0:s.s3Config,s.dataUrl,"PUT","",o),a.send(o),n}case 1:return br(r,"writefile not implemented"),0}return 0},getLastFileModificationTime:(r,t)=>{var n;let e=lt.getFileInfo(r,t);switch(e==null?void 0:e.dataProtocol){case 1:{if(!((n=lt._files)==null?void 0:n.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:(r,t,e)=>{let n=j(r,t,e);return console.log(`checkDirectory: ${n}`),!1},createDirectory:(r,t,e)=>{let n=j(r,t,e);console.log(`createDirectory: ${n}`)},removeDirectory:(r,t,e)=>{let n=j(r,t,e);console.log(`removeDirectory: ${n}`)},listDirectoryEntries:(r,t,e)=>{let n=j(r,t,e);return console.log(`listDirectoryEntries: ${n}`),!1},moveFile:(r,t,e,n,i)=>{var c,d;let s=j(r,t,e),o=j(r,n,i),a=(c=lt._files)==null?void 0:c.get(s);a!==void 0&&(lt._files.delete(a),lt._files.set(o,a));for(let[p,b]of((d=lt._fileInfoCache)==null?void 0:d.entries())||[])if(b.dataUrl==s){lt._fileInfoCache.delete(p);break}return!0},removeFile:(r,t,e)=>{},callScalarUDF:(r,t,e,n,i,s,o)=>{qu(lt,r,t,e,n,i,s,o)}};var cc=class extends Po{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,n){return await new Yo(this,lt,t,e).instantiate(n)}};function ed(){let r=new cc;globalThis.onmessage=async t=>{await r.onMessage(t.data)}}ed();return kh(By);})();
|
|
32
25
|
/*! *****************************************************************************
|
|
33
26
|
Copyright (c) Microsoft Corporation.
|
|
34
27
|
|