dbxlite-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/abap-CRCWOmpq.js +1 -0
- package/assets/assets/apex-DnsZk_dE.js +1 -0
- package/assets/assets/argon2-BUCifEKR.wasm +0 -0
- package/assets/assets/argon2-CtQQN5by.js +531 -0
- package/assets/assets/argon2-VsC-m8hX.js +38 -0
- package/assets/assets/azcli-1IWB1ccx.js +1 -0
- package/assets/assets/bat-DPkNLes8.js +1 -0
- package/assets/assets/bicep-Corcdgou.js +2 -0
- package/assets/assets/cameligo-CGrWLZr3.js +1 -0
- package/assets/assets/clojure-D9WOWImG.js +1 -0
- package/assets/assets/codicon-B_Z2XQ3P.ttf +0 -0
- package/assets/assets/coffee-B7EJu28W.js +1 -0
- package/assets/assets/cpp-SEyurbux.js +1 -0
- package/assets/assets/csharp-BoL64M5l.js +1 -0
- package/assets/assets/csp-C46ZqvIl.js +1 -0
- package/assets/assets/css-DQU6DXDx.js +3 -0
- package/assets/assets/cssMode-BwlhJ7iR.js +4 -0
- package/assets/assets/cypher-D84EuPTj.js +1 -0
- package/assets/assets/dart-D8lhlL1r.js +1 -0
- package/assets/assets/dockerfile-DLk6rpji.js +1 -0
- package/assets/assets/duckdb-browser-BSQM4t65.js +4 -0
- package/assets/assets/ecl-BO6FnfXk.js +1 -0
- package/assets/assets/elixir-BRjLKONM.js +1 -0
- package/assets/assets/flow9-Cac8vKd7.js +1 -0
- package/assets/assets/freemarker2-BkjRLolx.js +3 -0
- package/assets/assets/fsharp-fd1GTHhf.js +1 -0
- package/assets/assets/go-O9LJTZXk.js +1 -0
- package/assets/assets/graphql-LQdxqEYJ.js +1 -0
- package/assets/assets/handlebars-CBMLM90w.js +1 -0
- package/assets/assets/hcl-DxDQ3s82.js +1 -0
- package/assets/assets/html-CHZal9Bq.js +1 -0
- package/assets/assets/htmlMode-C9GZl6CA.js +4 -0
- package/assets/assets/index-B7kyXQsW.js +62964 -0
- package/assets/assets/index-Bls2JT31.css +1 -0
- package/assets/assets/ini-BvajGCUy.js +1 -0
- package/assets/assets/java-SYsfObOQ.js +1 -0
- package/assets/assets/javascript-3HFHugwg.js +1 -0
- package/assets/assets/jsonMode-uH9DvT2S.js +10 -0
- package/assets/assets/julia-DQXNmw_w.js +1 -0
- package/assets/assets/kotlin-qQ0MG-9I.js +1 -0
- package/assets/assets/less-GGFNNJHn.js +2 -0
- package/assets/assets/lexon-Canl7DCW.js +1 -0
- package/assets/assets/liquid-Ynp44jOk.js +1 -0
- package/assets/assets/lua-D28Ae8-K.js +1 -0
- package/assets/assets/m3-DPitgjJI.js +1 -0
- package/assets/assets/markdown-B811l8j2.js +1 -0
- package/assets/assets/mdx-B0LCS-Lw.js +1 -0
- package/assets/assets/mips-CdjsipkG.js +1 -0
- package/assets/assets/monaco-editor-DbSHhIAW.js +124636 -0
- package/assets/assets/monaco-editor-DvqauXKu.css +1 -0
- package/assets/assets/msdax-CYqgjx_P.js +1 -0
- package/assets/assets/mysql-BHd6q0vd.js +1 -0
- package/assets/assets/objective-c-B1aVtJYH.js +1 -0
- package/assets/assets/pascal-BhNW15KB.js +1 -0
- package/assets/assets/pascaligo-5jv8CcQD.js +1 -0
- package/assets/assets/perl-DlYyT36c.js +1 -0
- package/assets/assets/pgsql-Dy0bjov7.js +1 -0
- package/assets/assets/php-120yhfDK.js +1 -0
- package/assets/assets/pla-CjnFlu4u.js +1 -0
- package/assets/assets/postiats-CQpG440k.js +1 -0
- package/assets/assets/powerquery-DdJtto1Z.js +1 -0
- package/assets/assets/powershell-Bu_VLpJB.js +1 -0
- package/assets/assets/protobuf-IBS6jZEB.js +2 -0
- package/assets/assets/pug-kFxLfcjb.js +1 -0
- package/assets/assets/python-BLbP2FhE.js +1 -0
- package/assets/assets/qsharp-q7JyzKFN.js +1 -0
- package/assets/assets/r-BIFz-_sK.js +1 -0
- package/assets/assets/razor-CrzRfK-c.js +1 -0
- package/assets/assets/react-vendor-CJNQXC79.js +8 -0
- package/assets/assets/redis-CHOsPHWR.js +1 -0
- package/assets/assets/redshift-CBifECDb.js +1 -0
- package/assets/assets/restructuredtext-CghPJEOS.js +1 -0
- package/assets/assets/ruby-CYWGW-b1.js +1 -0
- package/assets/assets/rust-DMDD0SHb.js +1 -0
- package/assets/assets/sb-BYAiYHFx.js +1 -0
- package/assets/assets/scala-Bqvq8jcR.js +1 -0
- package/assets/assets/scheme-Dhb-2j9p.js +1 -0
- package/assets/assets/scss-CTwUZ5N7.js +3 -0
- package/assets/assets/shell-CsDZo4DB.js +1 -0
- package/assets/assets/solidity-CME5AdoB.js +1 -0
- package/assets/assets/sophia-RYC1BQQz.js +1 -0
- package/assets/assets/sparql-KEyrF7De.js +1 -0
- package/assets/assets/sql-BdTr02Mf.js +1 -0
- package/assets/assets/st-C7iG7M4S.js +1 -0
- package/assets/assets/swift-D7IUmUK8.js +1 -0
- package/assets/assets/systemverilog-DgMryOEJ.js +1 -0
- package/assets/assets/tcl-PloMZuKG.js +1 -0
- package/assets/assets/tsMode-B-o6MNSg.js +11 -0
- package/assets/assets/twig-BfRIq3la.js +1 -0
- package/assets/assets/typescript-nABxf5PW.js +1 -0
- package/assets/assets/typespec-CzxlYoT_.js +1 -0
- package/assets/assets/vb-BwAE3J76.js +1 -0
- package/assets/assets/wgsl-Dksx_ONF.js +298 -0
- package/assets/assets/worker-D4TW6ZaR.js +5 -0
- package/assets/assets/xml-BOnVlNcs.js +1 -0
- package/assets/assets/yaml-Yl61aKaY.js +1 -0
- package/assets/duckdb/.gitignore +8 -0
- package/assets/duckdb/README.md +24 -0
- package/assets/index.html +26 -0
- package/assets/logo/favicon.svg +44 -0
- package/assets/logo/logo-icon.svg +44 -0
- package/assets/logo/logo.svg +44 -0
- package/assets/screenshots/excel-query-any-sheet.png +0 -0
- package/assets/screenshots/explorer-multi-themes.png +0 -0
- package/assets/screenshots/export-status.png +0 -0
- package/assets/screenshots/main-interface-dark.png +0 -0
- package/assets/screenshots/query-remote-files.png +0 -0
- package/assets/screenshots/share-links.png +0 -0
- package/assets/sql-templates/initial-tab.sql +11 -0
- package/assets/sql-templates/new-tab.sql +0 -0
- package/dist/cli.js +311 -0
- package/package.json +37 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function E(i,t,e,n){function s(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(d){try{u(n.next(d))}catch(h){o(h)}}function l(d){try{u(n.throw(d))}catch(h){o(h)}}function u(d){d.done?r(d.value):s(d.value).then(a,l)}u((n=n.apply(i,t||[])).next())})}function jn(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],n=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&n>=i.length&&(i=void 0),{value:i&&i[n++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function O(i){return this instanceof O?(this.v=i,this):new O(i)}function Et(i,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(i,t||[]),s,r=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(B){return function(H){return Promise.resolve(H).then(B,h)}}function a(B,H){n[B]&&(s[B]=function(te){return new Promise(function(zi,kt){r.push([B,te,zi,kt])>1||l(B,te)})},H&&(s[B]=H(s[B])))}function l(B,H){try{u(n[B](H))}catch(te){W(r[0][3],te)}}function u(B){B.value instanceof O?Promise.resolve(B.value.v).then(d,h):W(r[0][2],B)}function d(B){l("next",B)}function h(B){l("throw",B)}function W(B,H){B(H),r.shift(),r.length&&l(r[0][0],r[0][1])}}function Ke(i){var t,e;return t={},n("next"),n("throw",function(s){throw s}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(s,r){t[s]=i[s]?function(o){return(e=!e)?{value:O(i[s](o)),done:!1}:r?r(o):o}:r}}function Qt(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=i[Symbol.asyncIterator],e;return t?t.call(i):(i=typeof jn=="function"?jn(i):i[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=i[r]&&function(o){return new Promise(function(a,l){o=i[r](o),s(a,l,o.done,o.value)})}}function s(r,o,a,l){Promise.resolve(l).then(function(u){r({value:u,done:a})},o)}}const Eo=new TextDecoder("utf-8"),Xi=i=>Eo.decode(i),Oo=new TextEncoder,pn=i=>Oo.encode(i),To=i=>typeof i=="number",_s=i=>typeof i=="boolean",$=i=>typeof i=="function",nt=i=>i!=null&&Object(i)===i,Jt=i=>nt(i)&&$(i.then),Ve=i=>nt(i)&&$(i[Symbol.iterator]),we=i=>nt(i)&&$(i[Symbol.asyncIterator]),tn=i=>nt(i)&&nt(i.schema),ms=i=>nt(i)&&"done"in i&&"value"in i,gs=i=>nt(i)&&$(i.stat)&&To(i.fd),bs=i=>nt(i)&&yn(i.body),Ci=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Ao=i=>nt(i)&&$(i.abort)&&$(i.getWriter)&&!Ci(i),yn=i=>nt(i)&&$(i.cancel)&&$(i.getReader)&&!Ci(i),Fo=i=>nt(i)&&$(i.end)&&$(i.write)&&_s(i.writable)&&!Ci(i),Is=i=>nt(i)&&$(i.read)&&$(i.pipe)&&_s(i.readable)&&!Ci(i),Bo=i=>nt(i)&&$(i.clear)&&$(i.bytes)&&$(i.position)&&$(i.setPosition)&&$(i.capacity)&&$(i.getBufferIdentifier)&&$(i.createLong),_n=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Ro(i){const t=i[0]?[i[0]]:[];let e,n,s,r;for(let o,a,l=0,u=0,d=i.length;++l<d;){if(o=t[u],a=i[l],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++u]=a);continue}if({byteOffset:e,byteLength:s}=o,{byteOffset:n,byteLength:r}=a,e+s<n||n+r<e){a&&(t[++u]=a);continue}t[u]=new Uint8Array(o.buffer,e,n-e+r)}return t}function Wn(i,t,e=0,n=t.byteLength){const s=i.byteLength,r=new Uint8Array(i.buffer,i.byteOffset,s),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,s));return r.set(o,e),i}function Tt(i,t){const e=Ro(i),n=e.reduce((d,h)=>d+h.byteLength,0);let s,r,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const d=e.length;++l<d;){if(s=e[l],r=s.subarray(0,Math.min(s.length,u-a)),u<=a+r.length){r.length<s.length?e[l]=s.subarray(r.length):r.length===s.length&&l++,o?Wn(o,r,a):o=r;break}Wn(o||(o=new Uint8Array(u)),r,a),a+=r.length}return[o||new Uint8Array(0),e.slice(l),n-(o?o.byteLength:0)]}function P(i,t){let e=ms(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=pn(e)),e instanceof ArrayBuffer?new i(e):e instanceof _n?new i(e):Bo(e)?P(i,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new i(0):new i(e.buffer,e.byteOffset,e.byteLength/i.BYTES_PER_ELEMENT):i.from(e)):new i(0)}const Ee=i=>P(Int32Array,i),Yn=i=>P(BigInt64Array,i),F=i=>P(Uint8Array,i),en=i=>(i.next(),i);function*Do(i,t){const e=function*(s){yield s},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof _n?e(t):Ve(t)?t:e(t);return yield*en((function*(s){let r=null;do r=s.next(yield P(i,r));while(!r.done)})(n[Symbol.iterator]())),new i}const No=i=>Do(Uint8Array,i);function Ss(i,t){return Et(this,arguments,function*(){if(Jt(t))return yield O(yield O(yield*Ke(Qt(Ss(i,yield O(t))))));const n=function(o){return Et(this,arguments,function*(){yield yield O(yield O(o))})},s=function(o){return Et(this,arguments,function*(){yield O(yield*Ke(Qt(en((function*(a){let l=null;do l=a.next(yield l?.value);while(!l.done)})(o[Symbol.iterator]())))))})},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof _n?n(t):Ve(t)?s(t):we(t)?t:n(t);return yield O(yield*Ke(Qt(en((function(o){return Et(this,arguments,function*(){let a=null;do a=yield O(o.next(yield yield O(P(i,a))));while(!a.done)})})(r[Symbol.asyncIterator]()))))),yield O(new i)})}const Lo=i=>Ss(Uint8Array,i);function ws(i,t,e){if(i!==0){e=e.slice(0,t);for(let n=-1,s=e.length;++n<s;)e[n]+=i}return e.subarray(0,t)}function Mo(i,t){let e=0;const n=i.length;if(n!==t.length)return!1;if(n>0)do if(i[e]!==t[e])return!1;while(++e<n);return!0}var lt={fromIterable(i){return $e(Uo(i))},fromAsyncIterable(i){return $e(Co(i))},fromDOMStream(i){return $e(Po(i))},fromNodeStream(i){return $e(xo(i))},toDOMStream(i,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(i,t){throw new Error('"toNodeStream" not available in this environment')}};const $e=i=>(i.next(),i);function*Uo(i){let t,e=!1,n=[],s,r,o,a=0;function l(){return r==="peek"?Tt(n,o)[0]:([s,n,a]=Tt(n,o),s)}({cmd:r,size:o}=(yield null)||{cmd:"read",size:0});const u=No(i)[Symbol.iterator]();try{do if({done:t,value:s}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&s.byteLength>0&&(n.push(s),a+=s.byteLength),t||o<=a)do({cmd:r,size:o}=yield l());while(o<a);while(!t)}catch(d){(e=!0)&&typeof u.throw=="function"&&u.throw(d)}finally{e===!1&&typeof u.return=="function"&&u.return(null)}return null}function Co(i){return Et(this,arguments,function*(){let e,n=!1,s=[],r,o,a,l=0;function u(){return o==="peek"?Tt(s,a)[0]:([r,s,l]=Tt(s,a),r)}({cmd:o,size:a}=(yield yield O(null))||{cmd:"read",size:0});const d=Lo(i)[Symbol.asyncIterator]();try{do if({done:e,value:r}=Number.isNaN(a-l)?yield O(d.next()):yield O(d.next(a-l)),!e&&r.byteLength>0&&(s.push(r),l+=r.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield O(u()));while(a<l);while(!e)}catch(h){(n=!0)&&typeof d.throw=="function"&&(yield O(d.throw(h)))}finally{n===!1&&typeof d.return=="function"&&(yield O(d.return(new Uint8Array(0))))}return yield O(null)})}function Po(i){return Et(this,arguments,function*(){let e=!1,n=!1,s=[],r,o,a,l=0;function u(){return o==="peek"?Tt(s,a)[0]:([r,s,l]=Tt(s,a),r)}({cmd:o,size:a}=(yield yield O(null))||{cmd:"read",size:0});const d=new ko(i);try{do if({done:e,value:r}=Number.isNaN(a-l)?yield O(d.read()):yield O(d.read(a-l)),!e&&r.byteLength>0&&(s.push(F(r)),l+=r.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield O(u()));while(a<l);while(!e)}catch(h){(n=!0)&&(yield O(d.cancel(h)))}finally{n===!1?yield O(d.cancel()):i.locked&&d.releaseLock()}return yield O(null)})}class ko{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 E(this,void 0,void 0,function*(){const{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return E(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=F(e)),e})}}const ji=(i,t)=>{const e=s=>n([t,s]);let n;return[t,e,new Promise(s=>(n=s)&&i.once(t,e))]};function xo(i){return Et(this,arguments,function*(){const e=[];let n="error",s=!1,r=null,o,a,l=0,u=[],d;function h(){return o==="peek"?Tt(u,a)[0]:([d,u,l]=Tt(u,a),d)}if({cmd:o,size:a}=(yield yield O(null))||{cmd:"read",size:0},i.isTTY)return yield yield O(new Uint8Array(0)),yield O(null);try{e[0]=ji(i,"end"),e[1]=ji(i,"error");do{if(e[2]=ji(i,"readable"),[n,r]=yield O(Promise.race(e.map(B=>B[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-l)?(d=F(i.read(a-l)),d.byteLength<a-l&&(d=F(i.read()))):d=F(i.read()),d.byteLength>0&&(u.push(d),l+=d.byteLength)),s||a<=l)do({cmd:o,size:a}=yield yield O(h()));while(a<l)}while(!s)}finally{yield O(W(e,n==="error"?r:null))}return yield O(null);function W(B,H){return d=u=null,new Promise((te,zi)=>{for(const[kt,vo]of B)i.off(kt,vo);try{const kt=i.destroy;kt&&kt.call(i,H),H=void 0}catch(kt){H=kt||H}finally{H!=null?zi(H):te()}})}})}var Y;(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4",i[i.V5=4]="V5"})(Y||(Y={}));var q;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(q||(q={}));var K;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(K||(K={}));var ft;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(ft||(ft={}));var g;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(g||(g={}));var At;(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME",i[i.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(At||(At={}));const Wi=2,St=4,Lt=4,M=4,zt=new Int32Array(2),$n=new Float32Array(zt.buffer),Gn=new Float64Array(zt.buffer),Ge=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var nn;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(nn||(nn={}));let me=class vs{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new vs(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return zt[0]=this.readInt32(t),$n[0]}readFloat64(t){return zt[Ge?0:1]=this.readInt32(t),zt[Ge?1:0]=this.readInt32(t+4),Gn[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){$n[0]=e,this.writeInt32(t,zt[0])}writeFloat64(t,e){Gn[0]=e,this.writeInt32(t,zt[Ge?0:1]),this.writeInt32(t+4,zt[Ge?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+St+Lt)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<Lt;e++)t+=String.fromCharCode(this.readInt8(this.position_+St+e));return t}__offset(t,e){const 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);const n=this.readInt32(t);t+=St;const s=this.bytes_.subarray(t,t+n);return e===nn.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+St}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=Lt)throw new Error("FlatBuffers: file identifier must be length "+Lt);for(let e=0;e<Lt;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+St+e))return!1;return!0}createScalarList(t,e){const n=[];for(let s=0;s<e;++s){const r=t(s);r!==null&&n.push(r)}return n}createObjList(t,e){const n=[];for(let s=0;s<e;++s){const r=t(s);r!==null&&n.push(r.unpack())}return n}},Es=class Os{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let e;t?e=t:e=1024,this.bb=me.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);const n=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<n+t+e;){const s=this.bb.capacity();this.bb=Os.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}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!==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 TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const n=e<<1,s=me.allocate(n);return s.setPosition(n-e),s.bytes().set(t.bytes(),n-e),s}addOffset(t){this.prep(St,0),this.writeInt32(this.offset()-t+St)}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);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const n=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const s=2;this.addInt16(t-this.object_start);const r=(n+s)*Wi;this.addInt16(r);let o=0;const a=this.space;t:for(e=0;e<this.vtables.length;e++){const l=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(l)){for(let u=Wi;u<r;u+=Wi)if(this.bb.readInt16(a+u)!=this.bb.readInt16(l+u))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){const s=n?M:0;if(e){const r=e;if(this.prep(this.minalign,St+Lt+s),r.length!=Lt)throw new TypeError("FlatBuffers: file identifier must be length "+Lt);for(let o=Lt-1;o>=0;o--)this.writeInt8(r.charCodeAt(o))}this.prep(this.minalign,St+s),this.addOffset(t),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const n=this.bb.capacity()-t,s=n-this.bb.readInt32(n);if(!(e<this.bb.readInt16(s)&&this.bb.readInt16(s+e)!=0))throw new TypeError("FlatBuffers: field "+e+" must be set")}startVector(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(St,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);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(t==null)return 0;let e;return t instanceof Uint8Array?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let n=0;n<t.length;++n){const s=t[n];if(s!==null)e.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var ri;(function(i){i[i.BUFFER=0]="BUFFER"})(ri||(ri={}));var oi;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(oi||(oi={}));class jt{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 jt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+M),(e||new jt).__init(t.readInt32(t.position())+t.position(),t)}codec(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):oi.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):ri.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,oi.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,ri.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,n){return jt.startBodyCompression(t),jt.addCodec(t,e),jt.addMethod(t,n),jt.endBodyCompression(t)}}class Ts{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(BigInt(n??0)),t.writeInt64(BigInt(e??0)),t.offset()}}let As=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(BigInt(n??0)),t.writeInt64(BigInt(e??0)),t.offset()}},Rt=class sn{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 sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+M),(e||new sn).__init(t.readInt32(t.position())+t.position(),t)}length(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new As).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}nodesLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new Ts).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}buffersLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){const e=this.bb.__offset(this.bb_pos,10);return e?(t||new jt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}},ie=class rn{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 rn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+M),(e||new rn).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Rt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var ge;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(ge||(ge={}));var ai;(function(i){i[i.DenseArray=0]="DenseArray"})(ai||(ai={}));class ot{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 ot).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+M),(e||new ot).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){const 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 ot.startInt(t),ot.addBitWidth(t,e),ot.addIsSigned(t,n),ot.endInt(t)}}class Mt{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 Mt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+M),(e||new Mt).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ot).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):ai.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,ai.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}class G{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 G).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+M),(e||new G).__init(t.readInt32(t.position())+t.position(),t)}key(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){const 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 G.startKeyValue(t),G.addKey(t,e),G.addValue(t,n),G.endKeyValue(t)}}let Hn=class Oe{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 Oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+M),(e||new Oe).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return Oe.startBinary(t),Oe.endBinary(t)}},Kn=class Te{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 Te).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+M),(e||new Te).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return Te.startBool(t),Te.endBool(t)}},qe=class ne{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 ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+M),(e||new ne).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ft.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,ft.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return ne.startDate(t),ne.addUnit(t,e),ne.endDate(t)}},se=class Vt{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 Vt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+M),(e||new Vt).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){const 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,s){return Vt.startDecimal(t),Vt.addPrecision(t,e),Vt.addScale(t,n),Vt.addBitWidth(t,s),Vt.endDecimal(t)}},Qe=class re{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(t,e){return(e||new re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,e){return t.setPosition(t.position()+M),(e||new re).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):g.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,g.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return re.startDuration(t),re.addUnit(t,e),re.endDuration(t)}},Je=class oe{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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+M),(e||new oe).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){const 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 oe.startFixedSizeBinary(t),oe.addByteWidth(t,e),oe.endFixedSizeBinary(t)}},Ze=class ae{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 ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+M),(e||new ae).__init(t.readInt32(t.position())+t.position(),t)}listSize(){const 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 ae.startFixedSizeList(t),ae.addListSize(t,e),ae.endFixedSizeList(t)}};class wt{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 wt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+M),(e||new wt).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):K.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,K.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return wt.startFloatingPoint(t),wt.addPrecision(t,e),wt.endFloatingPoint(t)}}class vt{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 vt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+M),(e||new vt).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):At.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,At.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return vt.startInterval(t),vt.addUnit(t,e),vt.endInterval(t)}}let qn=class Ae{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeBinary(t,e){return(e||new Ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,e){return t.setPosition(t.position()+M),(e||new Ae).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return Ae.startLargeBinary(t),Ae.endLargeBinary(t)}},Qn=class Fe{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeUtf8(t,e){return(e||new Fe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,e){return t.setPosition(t.position()+M),(e||new Fe).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return Fe.startLargeUtf8(t),Fe.endLargeUtf8(t)}},Jn=class Be{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 Be).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+M),(e||new Be).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return Be.startList(t),Be.endList(t)}},Xe=class ce{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 ce).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+M),(e||new ce).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){const 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 ce.startMap(t),ce.addKeysSorted(t,e),ce.endMap(t)}},Zn=class Re{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 Re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+M),(e||new Re).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return Re.startNull(t),Re.endNull(t)}};class qt{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 qt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+M),(e||new qt).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return qt.startStruct_(t),qt.endStruct_(t)}}class ut{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 ut).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+M),(e||new ut).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):g.MILLISECOND}bitWidth(){const 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,g.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,n){return ut.startTime(t),ut.addUnit(t,e),ut.addBitWidth(t,n),ut.endTime(t)}}class dt{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 dt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+M),(e||new dt).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):g.SECOND}timezone(t){const 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,g.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,n){return dt.startTimestamp(t),dt.addUnit(t,e),dt.addTimezone(t,n),dt.endTimestamp(t)}}class et{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 et).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+M),(e||new et).__init(t.readInt32(t.position())+t.position(),t)}mode(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.Sparse}typeIds(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){const 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,q.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 et.startUnion(t),et.addMode(t,e),et.addTypeIds(t,n),et.endUnion(t)}}let Xn=class De{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 De).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+M),(e||new De).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return De.startUtf8(t),De.endUtf8(t)}};var x;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.FloatingPoint=3]="FloatingPoint",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct_=13]="Struct_",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.LargeList=21]="LargeList",i[i.RunEndEncoded=22]="RunEndEncoded"})(x||(x={}));let ct=class ti{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 ti).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+M),(e||new ti).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):x.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new Mt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const n=this.bb.__offset(this.bb_pos,14);return n?(e||new ti).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,16);return n?(e||new G).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const 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,x.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()}},bt=class Bt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Bt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+M),(e||new Bt).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ge.Little}fields(t,e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new G).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){const 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,ge.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,s,r){return Bt.startSchema(t),Bt.addEndianness(t,e),Bt.addFields(t,n),Bt.addCustomMetadata(t,s),Bt.addFeatures(t,r),Bt.endSchema(t)}};var D;(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(D||(D={}));var c;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.Float=3]="Float",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct=13]="Struct",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.Dictionary=-1]="Dictionary",i[i.Int8=-2]="Int8",i[i.Int16=-3]="Int16",i[i.Int32=-4]="Int32",i[i.Int64=-5]="Int64",i[i.Uint8=-6]="Uint8",i[i.Uint16=-7]="Uint16",i[i.Uint32=-8]="Uint32",i[i.Uint64=-9]="Uint64",i[i.Float16=-10]="Float16",i[i.Float32=-11]="Float32",i[i.Float64=-12]="Float64",i[i.DateDay=-13]="DateDay",i[i.DateMillisecond=-14]="DateMillisecond",i[i.TimestampSecond=-15]="TimestampSecond",i[i.TimestampMillisecond=-16]="TimestampMillisecond",i[i.TimestampMicrosecond=-17]="TimestampMicrosecond",i[i.TimestampNanosecond=-18]="TimestampNanosecond",i[i.TimeSecond=-19]="TimeSecond",i[i.TimeMillisecond=-20]="TimeMillisecond",i[i.TimeMicrosecond=-21]="TimeMicrosecond",i[i.TimeNanosecond=-22]="TimeNanosecond",i[i.DenseUnion=-23]="DenseUnion",i[i.SparseUnion=-24]="SparseUnion",i[i.IntervalDayTime=-25]="IntervalDayTime",i[i.IntervalYearMonth=-26]="IntervalYearMonth",i[i.DurationSecond=-27]="DurationSecond",i[i.DurationMillisecond=-28]="DurationMillisecond",i[i.DurationMicrosecond=-29]="DurationMicrosecond",i[i.DurationNanosecond=-30]="DurationNanosecond"})(c||(c={}));var Dt;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Dt||(Dt={}));const Vo=void 0;function Me(i){if(i===null)return"null";if(i===Vo)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>Me(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}function k(i){if(typeof i=="bigint"&&(i<Number.MIN_SAFE_INTEGER||i>Number.MAX_SAFE_INTEGER))throw new TypeError(`${i} is not safe to convert to a number.`);return Number(i)}function Fs(i,t){return k(i/t)+k(i%t)/k(t)}const zo=Symbol.for("isArrowBigNum");function mt(i,...t){return t.length===0?Object.setPrototypeOf(P(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}mt.prototype[zo]=!0;mt.prototype.toJSON=function(){return`"${Ce(this)}"`};mt.prototype.valueOf=function(i){return Bs(this,i)};mt.prototype.toString=function(){return Ce(this)};mt.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return Bs(this);case"string":return Ce(this);case"default":return Yo(this)}return Ce(this)};function fe(...i){return mt.apply(this,i)}function pe(...i){return mt.apply(this,i)}function Ue(...i){return mt.apply(this,i)}Object.setPrototypeOf(fe.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(pe.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ue.prototype,Object.create(Uint32Array.prototype));Object.assign(fe.prototype,mt.prototype,{constructor:fe,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(pe.prototype,mt.prototype,{constructor:pe,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Ue.prototype,mt.prototype,{constructor:Ue,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const jo=BigInt(4294967296)*BigInt(4294967296),Wo=jo-BigInt(1);function Bs(i,t){const{buffer:e,byteOffset:n,byteLength:s,signed:r}=i,o=new BigUint64Array(e,n,s/8),a=r&&o.at(-1)&BigInt(1)<<BigInt(63);let l=BigInt(0),u=0;if(a){for(const d of o)l|=(d^Wo)*(BigInt(1)<<BigInt(64*u++));l*=BigInt(-1),l-=BigInt(1)}else for(const d of o)l|=d*(BigInt(1)<<BigInt(64*u++));if(typeof t=="number"){const d=BigInt(Math.pow(10,t)),h=l/d,W=l%d;return k(h)+k(W)/k(d)}return k(l)}function Ce(i){if(i.byteLength===8)return`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`;if(!i.signed)return Yi(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Yi(i);t=t.slice();let n=1;for(let r=0;r<t.length;r++){const o=t[r],a=~o+n;t[r]=a,n&=o===0?1:0}return`-${Yi(t)}`}function Yo(i){return i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:Ce(i)}function Yi(i){let t="";const e=new Uint32Array(2);let n=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);const s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer);let r=-1;const o=n.length-1;do{for(e[0]=n[r=0];r<o;)n[r++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+n[r];n[r]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(s[0]||s[1]||s[2]||s[3]);return t??"0"}class mn{static new(t,e){switch(e){case!0:return new fe(t);case!1:return new pe(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new fe(t)}return t.byteLength===16?new Ue(t):new pe(t)}static signed(t){return new fe(t)}static unsigned(t){return new pe(t)}static decimal(t){return new Ue(t)}constructor(t,e){return mn.new(t,e)}}var Rs,Ds,Ns,Ls,Ms,Us,Cs,Ps,ks,xs,Vs,zs,js,Ws,Ys,$s,Gs,Hs,Ks,qs,Qs,Js;class f{static isNull(t){return t?.typeId===c.Null}static isInt(t){return t?.typeId===c.Int}static isFloat(t){return t?.typeId===c.Float}static isBinary(t){return t?.typeId===c.Binary}static isLargeBinary(t){return t?.typeId===c.LargeBinary}static isUtf8(t){return t?.typeId===c.Utf8}static isLargeUtf8(t){return t?.typeId===c.LargeUtf8}static isBool(t){return t?.typeId===c.Bool}static isDecimal(t){return t?.typeId===c.Decimal}static isDate(t){return t?.typeId===c.Date}static isTime(t){return t?.typeId===c.Time}static isTimestamp(t){return t?.typeId===c.Timestamp}static isInterval(t){return t?.typeId===c.Interval}static isDuration(t){return t?.typeId===c.Duration}static isList(t){return t?.typeId===c.List}static isStruct(t){return t?.typeId===c.Struct}static isUnion(t){return t?.typeId===c.Union}static isFixedSizeBinary(t){return t?.typeId===c.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===c.FixedSizeList}static isMap(t){return t?.typeId===c.Map}static isDictionary(t){return t?.typeId===c.Dictionary}static isDenseUnion(t){return f.isUnion(t)&&t.mode===q.Dense}static isSparseUnion(t){return f.isUnion(t)&&t.mode===q.Sparse}constructor(t){this.typeId=t}}Rs=Symbol.toStringTag;f[Rs]=(i=>(i.children=null,i.ArrayType=Array,i.OffsetArrayType=Int32Array,i[Symbol.toStringTag]="DataType"))(f.prototype);class Wt extends f{constructor(){super(c.Null)}toString(){return"Null"}}Ds=Symbol.toStringTag;Wt[Ds]=(i=>i[Symbol.toStringTag]="Null")(Wt.prototype);class Zt extends f{constructor(t,e){super(c.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Ns=Symbol.toStringTag;Zt[Ns]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Zt.prototype);class Pe extends Zt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Pe.prototype,"ArrayType",{value:Int32Array});class ci extends f{constructor(t){super(c.Float),this.precision=t}get ArrayType(){switch(this.precision){case K.HALF:return Uint16Array;case K.SINGLE:return Float32Array;case K.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Ls=Symbol.toStringTag;ci[Ls]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(ci.prototype);class li extends f{constructor(){super(c.Binary)}toString(){return"Binary"}}Ms=Symbol.toStringTag;li[Ms]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(li.prototype);class ui extends f{constructor(){super(c.LargeBinary)}toString(){return"LargeBinary"}}Us=Symbol.toStringTag;ui[Us]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeBinary"))(ui.prototype);class di extends f{constructor(){super(c.Utf8)}toString(){return"Utf8"}}Cs=Symbol.toStringTag;di[Cs]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(di.prototype);class hi extends f{constructor(){super(c.LargeUtf8)}toString(){return"LargeUtf8"}}Ps=Symbol.toStringTag;hi[Ps]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeUtf8"))(hi.prototype);class fi extends f{constructor(){super(c.Bool)}toString(){return"Bool"}}ks=Symbol.toStringTag;fi[ks]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(fi.prototype);class pi extends f{constructor(t,e,n=128){super(c.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}xs=Symbol.toStringTag;pi[xs]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(pi.prototype);class yi extends f{constructor(t){super(c.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${ft[this.unit]}>`}get ArrayType(){return this.unit===ft.DAY?Int32Array:BigInt64Array}}Vs=Symbol.toStringTag;yi[Vs]=(i=>(i.unit=null,i[Symbol.toStringTag]="Date"))(yi.prototype);class _i extends f{constructor(t,e){super(c.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${g[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}zs=Symbol.toStringTag;_i[zs]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(_i.prototype);class mi extends f{constructor(t,e){super(c.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${g[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}js=Symbol.toStringTag;mi[js]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Timestamp"))(mi.prototype);class gi extends f{constructor(t){super(c.Interval),this.unit=t}toString(){return`Interval<${At[this.unit]}>`}}Ws=Symbol.toStringTag;gi[Ws]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(gi.prototype);class bi extends f{constructor(t){super(c.Duration),this.unit=t}toString(){return`Duration<${g[this.unit]}>`}}Ys=Symbol.toStringTag;bi[Ys]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(bi.prototype);class Ii extends f{constructor(t){super(c.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}$s=Symbol.toStringTag;Ii[$s]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(Ii.prototype);class J extends f{constructor(t){super(c.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Gs=Symbol.toStringTag;J[Gs]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(J.prototype);class Si extends f{constructor(t,e,n){super(c.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((s,r,o)=>(s[r]=o)&&s||s,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Hs=Symbol.toStringTag;Si[Hs]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(Si.prototype);class wi extends f{constructor(t){super(c.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Ks=Symbol.toStringTag;wi[Ks]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(wi.prototype);class vi extends f{constructor(t,e){super(c.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}qs=Symbol.toStringTag;vi[qs]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(vi.prototype);class Ei extends f{constructor(t,e=!1){var n,s,r;if(super(c.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.children)){const o=(s=t?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");const a=(r=t?.type)===null||r===void 0?void 0:r.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Qs=Symbol.toStringTag;Ei[Qs]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(Ei.prototype);const $o=(i=>()=>++i)(-1);class be extends f{constructor(t,e,n,s){super(c.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=s||!1,this.id=n==null?$o():k(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Js=Symbol.toStringTag;be[Js]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(be.prototype);function Nt(i){const t=i;switch(i.typeId){case c.Decimal:return i.bitWidth/32;case c.Interval:return 1+t.unit;case c.FixedSizeList:return t.listSize;case c.FixedSizeBinary:return t.byteWidth;default:return 1}}class T{visitMany(t,...e){return t.map((n,s)=>this.visit(n,...e.map(r=>r[s])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return Go(this,t,e)}getVisitFnByTypeId(t,e=!0){return le(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function Go(i,t,e=!0){return typeof t=="number"?le(i,t,e):typeof t=="string"&&t in c?le(i,c[t],e):t&&t instanceof f?le(i,ts(t),e):t?.type&&t.type instanceof f?le(i,ts(t.type),e):le(i,c.NONE,e)}function le(i,t,e=!0){let n=null;switch(t){case c.Null:n=i.visitNull;break;case c.Bool:n=i.visitBool;break;case c.Int:n=i.visitInt;break;case c.Int8:n=i.visitInt8||i.visitInt;break;case c.Int16:n=i.visitInt16||i.visitInt;break;case c.Int32:n=i.visitInt32||i.visitInt;break;case c.Int64:n=i.visitInt64||i.visitInt;break;case c.Uint8:n=i.visitUint8||i.visitInt;break;case c.Uint16:n=i.visitUint16||i.visitInt;break;case c.Uint32:n=i.visitUint32||i.visitInt;break;case c.Uint64:n=i.visitUint64||i.visitInt;break;case c.Float:n=i.visitFloat;break;case c.Float16:n=i.visitFloat16||i.visitFloat;break;case c.Float32:n=i.visitFloat32||i.visitFloat;break;case c.Float64:n=i.visitFloat64||i.visitFloat;break;case c.Utf8:n=i.visitUtf8;break;case c.LargeUtf8:n=i.visitLargeUtf8;break;case c.Binary:n=i.visitBinary;break;case c.LargeBinary:n=i.visitLargeBinary;break;case c.FixedSizeBinary:n=i.visitFixedSizeBinary;break;case c.Date:n=i.visitDate;break;case c.DateDay:n=i.visitDateDay||i.visitDate;break;case c.DateMillisecond:n=i.visitDateMillisecond||i.visitDate;break;case c.Timestamp:n=i.visitTimestamp;break;case c.TimestampSecond:n=i.visitTimestampSecond||i.visitTimestamp;break;case c.TimestampMillisecond:n=i.visitTimestampMillisecond||i.visitTimestamp;break;case c.TimestampMicrosecond:n=i.visitTimestampMicrosecond||i.visitTimestamp;break;case c.TimestampNanosecond:n=i.visitTimestampNanosecond||i.visitTimestamp;break;case c.Time:n=i.visitTime;break;case c.TimeSecond:n=i.visitTimeSecond||i.visitTime;break;case c.TimeMillisecond:n=i.visitTimeMillisecond||i.visitTime;break;case c.TimeMicrosecond:n=i.visitTimeMicrosecond||i.visitTime;break;case c.TimeNanosecond:n=i.visitTimeNanosecond||i.visitTime;break;case c.Decimal:n=i.visitDecimal;break;case c.List:n=i.visitList;break;case c.Struct:n=i.visitStruct;break;case c.Union:n=i.visitUnion;break;case c.DenseUnion:n=i.visitDenseUnion||i.visitUnion;break;case c.SparseUnion:n=i.visitSparseUnion||i.visitUnion;break;case c.Dictionary:n=i.visitDictionary;break;case c.Interval:n=i.visitInterval;break;case c.IntervalDayTime:n=i.visitIntervalDayTime||i.visitInterval;break;case c.IntervalYearMonth:n=i.visitIntervalYearMonth||i.visitInterval;break;case c.Duration:n=i.visitDuration;break;case c.DurationSecond:n=i.visitDurationSecond||i.visitDuration;break;case c.DurationMillisecond:n=i.visitDurationMillisecond||i.visitDuration;break;case c.DurationMicrosecond:n=i.visitDurationMicrosecond||i.visitDuration;break;case c.DurationNanosecond:n=i.visitDurationNanosecond||i.visitDuration;break;case c.FixedSizeList:n=i.visitFixedSizeList;break;case c.Map:n=i.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${c[t]}'`)}function ts(i){switch(i.typeId){case c.Null:return c.Null;case c.Int:{const{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?c.Int8:c.Uint8;case 16:return e?c.Int16:c.Uint16;case 32:return e?c.Int32:c.Uint32;case 64:return e?c.Int64:c.Uint64}return c.Int}case c.Float:switch(i.precision){case K.HALF:return c.Float16;case K.SINGLE:return c.Float32;case K.DOUBLE:return c.Float64}return c.Float;case c.Binary:return c.Binary;case c.LargeBinary:return c.LargeBinary;case c.Utf8:return c.Utf8;case c.LargeUtf8:return c.LargeUtf8;case c.Bool:return c.Bool;case c.Decimal:return c.Decimal;case c.Time:switch(i.unit){case g.SECOND:return c.TimeSecond;case g.MILLISECOND:return c.TimeMillisecond;case g.MICROSECOND:return c.TimeMicrosecond;case g.NANOSECOND:return c.TimeNanosecond}return c.Time;case c.Timestamp:switch(i.unit){case g.SECOND:return c.TimestampSecond;case g.MILLISECOND:return c.TimestampMillisecond;case g.MICROSECOND:return c.TimestampMicrosecond;case g.NANOSECOND:return c.TimestampNanosecond}return c.Timestamp;case c.Date:switch(i.unit){case ft.DAY:return c.DateDay;case ft.MILLISECOND:return c.DateMillisecond}return c.Date;case c.Interval:switch(i.unit){case At.DAY_TIME:return c.IntervalDayTime;case At.YEAR_MONTH:return c.IntervalYearMonth}return c.Interval;case c.Duration:switch(i.unit){case g.SECOND:return c.DurationSecond;case g.MILLISECOND:return c.DurationMillisecond;case g.MICROSECOND:return c.DurationMicrosecond;case g.NANOSECOND:return c.DurationNanosecond}return c.Duration;case c.Map:return c.Map;case c.List:return c.List;case c.Struct:return c.Struct;case c.Union:switch(i.mode){case q.Dense:return c.DenseUnion;case q.Sparse:return c.SparseUnion}return c.Union;case c.FixedSizeBinary:return c.FixedSizeBinary;case c.FixedSizeList:return c.FixedSizeList;case c.Dictionary:return c.Dictionary}throw new Error(`Unrecognized type '${c[i.typeId]}'`)}T.prototype.visitInt8=null;T.prototype.visitInt16=null;T.prototype.visitInt32=null;T.prototype.visitInt64=null;T.prototype.visitUint8=null;T.prototype.visitUint16=null;T.prototype.visitUint32=null;T.prototype.visitUint64=null;T.prototype.visitFloat16=null;T.prototype.visitFloat32=null;T.prototype.visitFloat64=null;T.prototype.visitDateDay=null;T.prototype.visitDateMillisecond=null;T.prototype.visitTimestampSecond=null;T.prototype.visitTimestampMillisecond=null;T.prototype.visitTimestampMicrosecond=null;T.prototype.visitTimestampNanosecond=null;T.prototype.visitTimeSecond=null;T.prototype.visitTimeMillisecond=null;T.prototype.visitTimeMicrosecond=null;T.prototype.visitTimeNanosecond=null;T.prototype.visitDenseUnion=null;T.prototype.visitSparseUnion=null;T.prototype.visitIntervalDayTime=null;T.prototype.visitIntervalYearMonth=null;T.prototype.visitDuration=null;T.prototype.visitDurationSecond=null;T.prototype.visitDurationMillisecond=null;T.prototype.visitDurationMicrosecond=null;T.prototype.visitDurationNanosecond=null;const Zs=new Float64Array(1),ee=new Uint32Array(Zs.buffer);function Xs(i){const t=(i&31744)>>10,e=(i&1023)/1024,n=Math.pow(-1,(i&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 Ho(i){if(i!==i)return 32256;Zs[0]=i;const t=(ee[1]&2147483648)>>16&65535;let e=ee[1]&2146435072,n=0;return e>=1089470464?ee[0]>0?e=31744:(e=(e&2080374784)>>16,n=(ee[1]&1048575)>>10):e<=1056964608?(n=1048576+(ee[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(ee[1]&1048575)+512>>10),t|e|n&65535}class b extends T{}function w(i){return(t,e,n)=>{if(t.setValid(e,n!=null))return i(t,e,n)}}const Ko=(i,t,e)=>{i[t]=Math.floor(e/864e5)},tr=(i,t,e,n)=>{if(e+1<t.length){const s=k(t[e]),r=k(t[e+1]);i.set(n.subarray(0,r-s),s)}},qo=({offset:i,values:t},e,n)=>{const s=i+e;n?t[s>>3]|=1<<s%8:t[s>>3]&=~(1<<s%8)},Ut=({values:i},t,e)=>{i[t]=e},gn=({values:i},t,e)=>{i[t]=e},er=({values:i},t,e)=>{i[t]=Ho(e)},Qo=(i,t,e)=>{switch(i.type.precision){case K.HALF:return er(i,t,e);case K.SINGLE:case K.DOUBLE:return gn(i,t,e)}},ir=({values:i},t,e)=>{Ko(i,t,e.valueOf())},nr=({values:i},t,e)=>{i[t]=BigInt(e)},Jo=({stride:i,values:t},e,n)=>{t.set(n.subarray(0,i),i*e)},sr=({values:i,valueOffsets:t},e,n)=>tr(i,t,e,n),rr=({values:i,valueOffsets:t},e,n)=>tr(i,t,e,pn(n)),Zo=(i,t,e)=>{i.type.unit===ft.DAY?ir(i,t,e):nr(i,t,e)},or=({values:i},t,e)=>{i[t]=BigInt(e/1e3)},ar=({values:i},t,e)=>{i[t]=BigInt(e)},cr=({values:i},t,e)=>{i[t]=BigInt(e*1e3)},lr=({values:i},t,e)=>{i[t]=BigInt(e*1e6)},Xo=(i,t,e)=>{switch(i.type.unit){case g.SECOND:return or(i,t,e);case g.MILLISECOND:return ar(i,t,e);case g.MICROSECOND:return cr(i,t,e);case g.NANOSECOND:return lr(i,t,e)}},ur=({values:i},t,e)=>{i[t]=e},dr=({values:i},t,e)=>{i[t]=e},hr=({values:i},t,e)=>{i[t]=e},fr=({values:i},t,e)=>{i[t]=e},ta=(i,t,e)=>{switch(i.type.unit){case g.SECOND:return ur(i,t,e);case g.MILLISECOND:return dr(i,t,e);case g.MICROSECOND:return hr(i,t,e);case g.NANOSECOND:return fr(i,t,e)}},ea=({values:i,stride:t},e,n)=>{i.set(n.subarray(0,t),t*e)},ia=(i,t,e)=>{const n=i.children[0],s=i.valueOffsets,r=pt.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=s[t],l=s[t+1];a<l;)r(n,a++,e[++o]);else for(let o=-1,a=s[t],l=s[t+1];a<l;)r(n,a++,e.get(++o))},na=(i,t,e)=>{const n=i.children[0],{valueOffsets:s}=i,r=pt.getVisitFn(n);let{[t]:o,[t+1]:a}=s;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(r(n,o,u),++o>=a)break},sa=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[r]),ra=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(r)),oa=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(s.name)),aa=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[s.name]),ca=(i,t,e)=>{const n=i.type.children.map(r=>pt.getVisitFn(r.type)),s=e instanceof Map?oa(t,e):e instanceof N?ra(t,e):Array.isArray(e)?sa(t,e):aa(t,e);i.type.children.forEach((r,o)=>s(n[o],i.children[o],r,o))},la=(i,t,e)=>{i.type.mode===q.Dense?pr(i,t,e):yr(i,t,e)},pr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];pt.visit(s,i.valueOffsets[t],e)},yr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];pt.visit(s,t,e)},ua=(i,t,e)=>{var n;(n=i.dictionary)===null||n===void 0||n.set(i.values[t],e)},da=(i,t,e)=>{i.type.unit===At.DAY_TIME?_r(i,t,e):mr(i,t,e)},_r=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},mr=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},gr=({values:i},t,e)=>{i[t]=e},br=({values:i},t,e)=>{i[t]=e},Ir=({values:i},t,e)=>{i[t]=e},Sr=({values:i},t,e)=>{i[t]=e},ha=(i,t,e)=>{switch(i.type.unit){case g.SECOND:return gr(i,t,e);case g.MILLISECOND:return br(i,t,e);case g.MICROSECOND:return Ir(i,t,e);case g.NANOSECOND:return Sr(i,t,e)}},fa=(i,t,e)=>{const{stride:n}=i,s=i.children[0],r=pt.getVisitFn(s);if(Array.isArray(e))for(let o=-1,a=t*n;++o<n;)r(s,a+o,e[o]);else for(let o=-1,a=t*n;++o<n;)r(s,a+o,e.get(o))};b.prototype.visitBool=w(qo);b.prototype.visitInt=w(Ut);b.prototype.visitInt8=w(Ut);b.prototype.visitInt16=w(Ut);b.prototype.visitInt32=w(Ut);b.prototype.visitInt64=w(Ut);b.prototype.visitUint8=w(Ut);b.prototype.visitUint16=w(Ut);b.prototype.visitUint32=w(Ut);b.prototype.visitUint64=w(Ut);b.prototype.visitFloat=w(Qo);b.prototype.visitFloat16=w(er);b.prototype.visitFloat32=w(gn);b.prototype.visitFloat64=w(gn);b.prototype.visitUtf8=w(rr);b.prototype.visitLargeUtf8=w(rr);b.prototype.visitBinary=w(sr);b.prototype.visitLargeBinary=w(sr);b.prototype.visitFixedSizeBinary=w(Jo);b.prototype.visitDate=w(Zo);b.prototype.visitDateDay=w(ir);b.prototype.visitDateMillisecond=w(nr);b.prototype.visitTimestamp=w(Xo);b.prototype.visitTimestampSecond=w(or);b.prototype.visitTimestampMillisecond=w(ar);b.prototype.visitTimestampMicrosecond=w(cr);b.prototype.visitTimestampNanosecond=w(lr);b.prototype.visitTime=w(ta);b.prototype.visitTimeSecond=w(ur);b.prototype.visitTimeMillisecond=w(dr);b.prototype.visitTimeMicrosecond=w(hr);b.prototype.visitTimeNanosecond=w(fr);b.prototype.visitDecimal=w(ea);b.prototype.visitList=w(ia);b.prototype.visitStruct=w(ca);b.prototype.visitUnion=w(la);b.prototype.visitDenseUnion=w(pr);b.prototype.visitSparseUnion=w(yr);b.prototype.visitDictionary=w(ua);b.prototype.visitInterval=w(da);b.prototype.visitIntervalDayTime=w(_r);b.prototype.visitIntervalYearMonth=w(mr);b.prototype.visitDuration=w(ha);b.prototype.visitDurationSecond=w(gr);b.prototype.visitDurationMillisecond=w(br);b.prototype.visitDurationMicrosecond=w(Ir);b.prototype.visitDurationNanosecond=w(Sr);b.prototype.visitFixedSizeList=w(fa);b.prototype.visitMap=w(na);const pt=new b,yt=Symbol.for("parent"),ye=Symbol.for("rowIndex");class bn{constructor(t,e){return this[yt]=t,this[ye]=e,new Proxy(this,new ya)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[ye],e=this[yt],n=e.type.children,s={};for(let r=-1,o=n.length;++r<o;)s[n[r].name]=st.visit(e.children[r],t);return s}toString(){return`{${[...this].map(([t,e])=>`${Me(t)}: ${Me(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new pa(this[yt],this[ye])}}class pa{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(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,st.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(bn.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[yt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ye]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class ya{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[yt].type.children.map(e=>e.name)}has(t,e){return t[yt].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[yt].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];const n=t[yt].type.children.findIndex(s=>s.name===e);if(n!==-1){const s=st.visit(t[yt].children[n],t[ye]);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[yt].type.children.findIndex(r=>r.name===e);return s!==-1?(pt.visit(t[yt].children[s],t[ye],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}class p extends T{}function I(i){return(t,e)=>t.getValid(e)?i(t,e):null}const _a=(i,t)=>864e5*i[t],ma=(i,t)=>null,wr=(i,t,e)=>{if(e+1>=t.length)return null;const n=k(t[e]),s=k(t[e+1]);return i.subarray(n,s)},ga=({offset:i,values:t},e)=>{const n=i+e;return(t[n>>3]&1<<n%8)!==0},vr=({values:i},t)=>_a(i,t),Er=({values:i},t)=>k(i[t]),Ht=({stride:i,values:t},e)=>t[i*e],ba=({stride:i,values:t},e)=>Xs(t[i*e]),Or=({values:i},t)=>i[t],Ia=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),Tr=({values:i,valueOffsets:t},e)=>wr(i,t,e),Ar=({values:i,valueOffsets:t},e)=>{const n=wr(i,t,e);return n!==null?Xi(n):null},Sa=({values:i},t)=>i[t],wa=({type:i,values:t},e)=>i.precision!==K.HALF?t[e]:Xs(t[e]),va=(i,t)=>i.type.unit===ft.DAY?vr(i,t):Er(i,t),Fr=({values:i},t)=>1e3*k(i[t]),Br=({values:i},t)=>k(i[t]),Rr=({values:i},t)=>Fs(i[t],BigInt(1e3)),Dr=({values:i},t)=>Fs(i[t],BigInt(1e6)),Ea=(i,t)=>{switch(i.type.unit){case g.SECOND:return Fr(i,t);case g.MILLISECOND:return Br(i,t);case g.MICROSECOND:return Rr(i,t);case g.NANOSECOND:return Dr(i,t)}},Nr=({values:i},t)=>i[t],Lr=({values:i},t)=>i[t],Mr=({values:i},t)=>i[t],Ur=({values:i},t)=>i[t],Oa=(i,t)=>{switch(i.type.unit){case g.SECOND:return Nr(i,t);case g.MILLISECOND:return Lr(i,t);case g.MICROSECOND:return Mr(i,t);case g.NANOSECOND:return Ur(i,t)}},Ta=({values:i,stride:t},e)=>mn.decimal(i.subarray(t*e,t*(e+1))),Aa=(i,t)=>{const{valueOffsets:e,stride:n,children:s}=i,{[t*n]:r,[t*n+1]:o}=e,l=s[0].slice(r,o-r);return new N([l])},Fa=(i,t)=>{const{valueOffsets:e,children:n}=i,{[t]:s,[t+1]:r}=e,o=n[0];return new In(o.slice(s,r-s))},Ba=(i,t)=>new bn(i,t),Ra=(i,t)=>i.type.mode===q.Dense?Cr(i,t):Pr(i,t),Cr=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,i.valueOffsets[t])},Pr=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,t)},Da=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Na=(i,t)=>i.type.unit===At.DAY_TIME?kr(i,t):xr(i,t),kr=({values:i},t)=>i.subarray(2*t,2*(t+1)),xr=({values:i},t)=>{const e=i[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},Vr=({values:i},t)=>i[t],zr=({values:i},t)=>i[t],jr=({values:i},t)=>i[t],Wr=({values:i},t)=>i[t],La=(i,t)=>{switch(i.type.unit){case g.SECOND:return Vr(i,t);case g.MILLISECOND:return zr(i,t);case g.MICROSECOND:return jr(i,t);case g.NANOSECOND:return Wr(i,t)}},Ma=(i,t)=>{const{stride:e,children:n}=i,r=n[0].slice(t*e,e);return new N([r])};p.prototype.visitNull=I(ma);p.prototype.visitBool=I(ga);p.prototype.visitInt=I(Sa);p.prototype.visitInt8=I(Ht);p.prototype.visitInt16=I(Ht);p.prototype.visitInt32=I(Ht);p.prototype.visitInt64=I(Or);p.prototype.visitUint8=I(Ht);p.prototype.visitUint16=I(Ht);p.prototype.visitUint32=I(Ht);p.prototype.visitUint64=I(Or);p.prototype.visitFloat=I(wa);p.prototype.visitFloat16=I(ba);p.prototype.visitFloat32=I(Ht);p.prototype.visitFloat64=I(Ht);p.prototype.visitUtf8=I(Ar);p.prototype.visitLargeUtf8=I(Ar);p.prototype.visitBinary=I(Tr);p.prototype.visitLargeBinary=I(Tr);p.prototype.visitFixedSizeBinary=I(Ia);p.prototype.visitDate=I(va);p.prototype.visitDateDay=I(vr);p.prototype.visitDateMillisecond=I(Er);p.prototype.visitTimestamp=I(Ea);p.prototype.visitTimestampSecond=I(Fr);p.prototype.visitTimestampMillisecond=I(Br);p.prototype.visitTimestampMicrosecond=I(Rr);p.prototype.visitTimestampNanosecond=I(Dr);p.prototype.visitTime=I(Oa);p.prototype.visitTimeSecond=I(Nr);p.prototype.visitTimeMillisecond=I(Lr);p.prototype.visitTimeMicrosecond=I(Mr);p.prototype.visitTimeNanosecond=I(Ur);p.prototype.visitDecimal=I(Ta);p.prototype.visitList=I(Aa);p.prototype.visitStruct=I(Ba);p.prototype.visitUnion=I(Ra);p.prototype.visitDenseUnion=I(Cr);p.prototype.visitSparseUnion=I(Pr);p.prototype.visitDictionary=I(Da);p.prototype.visitInterval=I(Na);p.prototype.visitIntervalDayTime=I(kr);p.prototype.visitIntervalYearMonth=I(xr);p.prototype.visitDuration=I(La);p.prototype.visitDurationSecond=I(Vr);p.prototype.visitDurationMillisecond=I(zr);p.prototype.visitDurationMicrosecond=I(jr);p.prototype.visitDurationNanosecond=I(Wr);p.prototype.visitFixedSizeList=I(Ma);p.prototype.visitMap=I(Fa);const st=new p,ue=Symbol.for("keys"),_e=Symbol.for("vals"),de=Symbol.for("kKeysAsStrings"),on=Symbol.for("_kKeysAsStrings");class In{constructor(t){return this[ue]=new N([t.children[0]]).memoize(),this[_e]=t.children[1],new Proxy(this,new Ca)}get[de](){return this[on]||(this[on]=Array.from(this[ue].toArray(),String))}[Symbol.iterator](){return new Ua(this[ue],this[_e])}get size(){return this[ue].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[ue],e=this[_e],n={};for(let s=-1,r=t.length;++s<r;)n[t.get(s)]=st.visit(e,s);return n}toString(){return`{${[...this].map(([t,e])=>`${Me(t)}: ${Me(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class Ua{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),st.visit(this.vals,t)]})}}class Ca{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[de]}has(t,e){return t[de].includes(e)}getOwnPropertyDescriptor(t,e){if(t[de].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[de].indexOf(e);if(n!==-1){const s=st.visit(Reflect.get(t,_e),n);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[de].indexOf(e);return s!==-1?(pt.visit(Reflect.get(t,_e),s,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(In.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ue]:{writable:!0,enumerable:!1,configurable:!1,value:null},[_e]:{writable:!0,enumerable:!1,configurable:!1,value:null},[on]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let es;function Yr(i,t,e,n){const{length:s=0}=i;let r=typeof t!="number"?0:t,o=typeof e!="number"?s:e;return r<0&&(r=(r%s+s)%s),o<0&&(o=(o%s+s)%s),o<r&&(es=r,r=o,o=es),o>s&&(o=s),n?n(i,r,o):[r,o]}const Sn=(i,t)=>i<0?t+i:i,is=i=>i!==i;function ve(i){if(typeof i!=="object"||i===null)return is(i)?is:e=>e===i;if(i instanceof Date){const e=i.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(i)?e=>e?Mo(i,e):!1:i instanceof Map?ka(i):Array.isArray(i)?Pa(i):i instanceof N?xa(i):Va(i,!0)}function Pa(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=ve(i[e]);return Pi(t)}function ka(i){let t=-1;const e=[];for(const n of i.values())e[++t]=ve(n);return Pi(e)}function xa(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=ve(i.get(e));return Pi(t)}function Va(i,t=!1){const e=Object.keys(i);if(!t&&e.length===0)return()=>!1;const n=[];for(let s=-1,r=e.length;++s<r;)n[s]=ve(i[e[s]]);return Pi(n,e)}function Pi(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return za(i,e);case Map:return ns(i,e,e.keys());case In:case bn:case Object:case void 0:return ns(i,e,t||Object.keys(e))}return e instanceof N?ja(i,e):!1}}function za(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t[n]))return!1;return!0}function ja(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t.get(n)))return!1;return!0}function ns(i,t,e){const n=e[Symbol.iterator](),s=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),r=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=i.length;let l=r.next(),u=n.next(),d=s.next();for(;o<a&&!u.done&&!d.done&&!l.done&&!(u.value!==d.value||!i[o](l.value));++o,u=n.next(),d=s.next(),l=r.next());return o===a&&u.done&&d.done&&l.done?!0:(n.return&&n.return(),s.return&&s.return(),r.return&&r.return(),!1)}function $r(i,t,e,n){return(e&1<<n)!==0}function Wa(i,t,e,n){return(e&1<<n)>>n}function Oi(i,t,e){const n=e.byteLength+7&-8;if(i>0||e.byteLength<n){const s=new Uint8Array(n);return s.set(i%8===0?e.subarray(i>>3):Ti(new wn(e,i,t,null,$r)).subarray(0,n)),s}return e}function Ti(i){const t=[];let e=0,n=0,s=0;for(const o of i)o&&(s|=1<<n),++n===8&&(t[e++]=s,s=n=0);(e===0||n>0)&&(t[e++]=s);const r=new Uint8Array(t.length+7&-8);return r.set(t),r}class wn{constructor(t,e,n,s,r){this.bytes=t,this.length=n,this.context=s,this.get=r,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function an(i,t,e){if(e-t<=0)return 0;if(e-t<8){let r=0;for(const o of new wn(i,t,e-t,i,Wa))r+=o;return r}const n=e>>3<<3,s=t+(t%8===0?0:8-t%8);return an(i,t,s)+an(i,n,e)+Ya(i,s>>3,n-s>>3)}function Ya(i,t,e){let n=0,s=Math.trunc(t);const r=new DataView(i.buffer,i.byteOffset,i.byteLength),o=e===void 0?i.byteLength:s+e;for(;o-s>=4;)n+=$i(r.getUint32(s)),s+=4;for(;o-s>=2;)n+=$i(r.getUint16(s)),s+=2;for(;o-s>=1;)n+=$i(r.getUint8(s)),s+=1;return n}function $i(i){let t=Math.trunc(i);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const $a=-1;class U{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return f.isSparseUnion(t)?this.children.some(e=>e.nullable):f.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:s,typeIds:r}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),r&&(t+=r.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(f.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let t=this._nullCount,e;return t<=$a&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-an(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,s,r,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(s||0,-1));let l;r instanceof U?(this.stride=r.stride,this.values=r.values,this.typeIds=r.typeIds,this.nullBitmap=r.nullBitmap,this.valueOffsets=r.valueOffsets):(this.stride=Nt(t),r&&((l=r[0])&&(this.valueOffsets=l),(l=r[1])&&(this.values=l),(l=r[2])&&(this.nullBitmap=l),(l=r[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(f.isUnion(e)){const n=e,s=this.children[n.typeIdToChildIndex[this.typeIds[t]]],r=n.mode===q.Dense?this.valueOffsets[t]:t;return s.getValid(r)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,e){let n;const{type:s}=this;if(f.isUnion(s)){const r=s,o=this.children[r.typeIdToChildIndex[this.typeIds[t]]],a=r.mode===q.Dense?this.valueOffsets[t]:t;n=o.getValid(a),o.setValid(a,e)}else{let{nullBitmap:r}=this;const{offset:o,length:a}=this,l=o+t,u=1<<l%8,d=l>>3;(!r||r.byteLength<=d)&&(r=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(Oi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));const h=r[d];n=(h&u)!==0,r[d]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,s=this._nullCount,r=this,o=this.children){return new U(t,e,n,s,r,o,this.dictionary)}slice(t,e){const{stride:n,typeId:s,children:r}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,l=this._sliceBuffers(t,e,n,s);return this.clone(this.type,this.offset+t,e,o,l,r.length===0||this.valueOffsets?r:this._sliceChildren(r,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===c.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,s=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);s[e>>3]=(1<<e-(e&-8))-1,n>0&&s.set(Oi(this.offset,e,this.nullBitmap),0);const r=this.buffers;return r[Dt.VALIDITY]=s,this.clone(this.type,0,t,n+(t-e),r)}_sliceBuffers(t,e,n,s){let r;const{buffers:o}=this;return(r=o[Dt.TYPE])&&(o[Dt.TYPE]=r.subarray(t,t+e)),(r=o[Dt.OFFSET])&&(o[Dt.OFFSET]=r.subarray(t,t+e+1))||(r=o[Dt.DATA])&&(o[Dt.DATA]=s===6?r:r.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(s=>s.slice(e,n))}}U.prototype.children=Object.freeze([]);class Le extends T{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:s=0}=t;return new U(e,n,s,s)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.data),r=F(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new U(e,n,a,l,[o,s,r])}visitLargeUtf8(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.data),r=F(t.nullBitmap),o=Yn(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new U(e,n,a,l,[o,s,r])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.data),r=F(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new U(e,n,a,l,[o,s,r])}visitLargeBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.data),r=F(t.nullBitmap),o=Yn(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new U(e,n,a,l,[o,s,r])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length/Nt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length/Nt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length/Nt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length/Nt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length/Nt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:s}=t,r=F(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new U(e,n,a,l,[o,void 0,r],[s])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=F(t.nullBitmap),{length:o=s.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,void 0,r],s)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=P(e.ArrayType,t.typeIds),{["length"]:o=r.length,["nullCount"]:a=-1}=t;if(f.isSparseUnion(e))return new U(e,n,o,a,[void 0,void 0,void 0,r],s);const l=Ee(t.valueOffsets);return new U(e,n,o,a,[l,void 0,void 0,r],s)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.indices.ArrayType,t.data),{["dictionary"]:o=new N([new Le().visit({type:e.dictionary})])}=t,{["length"]:a=r.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new U(e,n,a,l,[void 0,r,s],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length/Nt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,s=F(t.nullBitmap),r=P(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,r,s])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new Le().visit({type:e.valueType})}=t,r=F(t.nullBitmap),{["length"]:o=s.length/Nt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new U(e,n,o,a,[void 0,void 0,r],[s])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new Le().visit({type:e.childType})}=t,r=F(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new U(e,n,a,l,[o,void 0,r],[s])}}const Ga=new Le;function A(i){return Ga.visit(i)}class ss{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const 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 Ha(i){return i.some(t=>t.nullable)}function Gr(i){return i.reduce((t,e)=>t+e.nullCount,0)}function Hr(i){return i.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(i.length+1))}function Kr(i,t,e,n){const s=[];for(let r=-1,o=i.length;++r<o;){const a=i[r],l=t[r],{length:u}=a;if(l>=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){s.push(a);continue}const d=Math.max(0,e-l),h=Math.min(n-l,u);s.push(a.slice(d,h-d))}return s.length===0&&s.push(i[0].slice(0,0)),s}function vn(i,t,e,n){let s=0,r=0,o=t.length-1;do{if(s>=o-1)return e<t[o]?n(i,s,e-t[s]):null;r=s+Math.trunc((o-s)*.5),e<t[r]?o=r:s=r}while(s<o)}function En(i,t){return i.getValid(t)}function Ai(i){function t(e,n,s){return i(e[n],s)}return function(e){const n=this.data;return vn(n,this._offsets,e,t)}}function qr(i){let t;function e(n,s,r){return i(n[s],r,t)}return function(n,s){const r=this.data;t=s;const o=vn(r,this._offsets,n,e);return t=void 0,o}}function Qr(i){let t;function e(n,s,r){let o=r,a=0,l=0;for(let u=s-1,d=n.length;++u<d;){const h=n[u];if(~(a=i(h,t,o)))return l+a;o=0,l+=h.length}return-1}return function(n,s){t=n;const r=this.data,o=typeof s!="number"?e(r,0,0):vn(r,this._offsets,s,e);return t=void 0,o}}class y extends T{}function Ka(i,t){return t===null&&i.length>0?0:-1}function qa(i,t){const{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let n=0;for(const s of new wn(e,i.offset+(t||0),i.length,e,$r)){if(!s)return n;++n}return-1}function v(i,t,e){if(t===void 0)return-1;if(t===null)switch(i.typeId){case c.Union:break;case c.Dictionary:break;default:return qa(i,e)}const n=st.getVisitFn(i),s=ve(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}function Jr(i,t,e){const n=st.getVisitFn(i),s=ve(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}y.prototype.visitNull=Ka;y.prototype.visitBool=v;y.prototype.visitInt=v;y.prototype.visitInt8=v;y.prototype.visitInt16=v;y.prototype.visitInt32=v;y.prototype.visitInt64=v;y.prototype.visitUint8=v;y.prototype.visitUint16=v;y.prototype.visitUint32=v;y.prototype.visitUint64=v;y.prototype.visitFloat=v;y.prototype.visitFloat16=v;y.prototype.visitFloat32=v;y.prototype.visitFloat64=v;y.prototype.visitUtf8=v;y.prototype.visitLargeUtf8=v;y.prototype.visitBinary=v;y.prototype.visitLargeBinary=v;y.prototype.visitFixedSizeBinary=v;y.prototype.visitDate=v;y.prototype.visitDateDay=v;y.prototype.visitDateMillisecond=v;y.prototype.visitTimestamp=v;y.prototype.visitTimestampSecond=v;y.prototype.visitTimestampMillisecond=v;y.prototype.visitTimestampMicrosecond=v;y.prototype.visitTimestampNanosecond=v;y.prototype.visitTime=v;y.prototype.visitTimeSecond=v;y.prototype.visitTimeMillisecond=v;y.prototype.visitTimeMicrosecond=v;y.prototype.visitTimeNanosecond=v;y.prototype.visitDecimal=v;y.prototype.visitList=v;y.prototype.visitStruct=v;y.prototype.visitUnion=v;y.prototype.visitDenseUnion=Jr;y.prototype.visitSparseUnion=Jr;y.prototype.visitDictionary=v;y.prototype.visitInterval=v;y.prototype.visitIntervalDayTime=v;y.prototype.visitIntervalYearMonth=v;y.prototype.visitDuration=v;y.prototype.visitDurationSecond=v;y.prototype.visitDurationMillisecond=v;y.prototype.visitDurationMicrosecond=v;y.prototype.visitDurationNanosecond=v;y.prototype.visitFixedSizeList=v;y.prototype.visitMap=v;const Fi=new y;class _ extends T{}function S(i){const{type:t}=i;if(i.nullCount===0&&i.stride===1&&(f.isInt(t)&&t.bitWidth!==64||f.isTime(t)&&t.bitWidth!==64||f.isFloat(t)&&t.precision!==K.HALF))return new ss(i.data.length,n=>{const s=i.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let e=0;return new ss(i.data.length,n=>{const r=i.data[n].length,o=i.slice(e,e+r);return e+=r,new Qa(o)})}class Qa{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}}_.prototype.visitNull=S;_.prototype.visitBool=S;_.prototype.visitInt=S;_.prototype.visitInt8=S;_.prototype.visitInt16=S;_.prototype.visitInt32=S;_.prototype.visitInt64=S;_.prototype.visitUint8=S;_.prototype.visitUint16=S;_.prototype.visitUint32=S;_.prototype.visitUint64=S;_.prototype.visitFloat=S;_.prototype.visitFloat16=S;_.prototype.visitFloat32=S;_.prototype.visitFloat64=S;_.prototype.visitUtf8=S;_.prototype.visitLargeUtf8=S;_.prototype.visitBinary=S;_.prototype.visitLargeBinary=S;_.prototype.visitFixedSizeBinary=S;_.prototype.visitDate=S;_.prototype.visitDateDay=S;_.prototype.visitDateMillisecond=S;_.prototype.visitTimestamp=S;_.prototype.visitTimestampSecond=S;_.prototype.visitTimestampMillisecond=S;_.prototype.visitTimestampMicrosecond=S;_.prototype.visitTimestampNanosecond=S;_.prototype.visitTime=S;_.prototype.visitTimeSecond=S;_.prototype.visitTimeMillisecond=S;_.prototype.visitTimeMicrosecond=S;_.prototype.visitTimeNanosecond=S;_.prototype.visitDecimal=S;_.prototype.visitList=S;_.prototype.visitStruct=S;_.prototype.visitUnion=S;_.prototype.visitDenseUnion=S;_.prototype.visitSparseUnion=S;_.prototype.visitDictionary=S;_.prototype.visitInterval=S;_.prototype.visitIntervalDayTime=S;_.prototype.visitIntervalYearMonth=S;_.prototype.visitDuration=S;_.prototype.visitDurationSecond=S;_.prototype.visitDurationMillisecond=S;_.prototype.visitDurationMicrosecond=S;_.prototype.visitDurationNanosecond=S;_.prototype.visitFixedSizeList=S;_.prototype.visitMap=S;const On=new _;var Zr;const Xr={},to={};class N{constructor(t){var e,n,s;const r=t[0]instanceof N?t.flatMap(a=>a.data):t;if(r.length===0||r.some(a=>!(a instanceof U)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=r[0])===null||e===void 0?void 0:e.type;switch(r.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=Xr[o.typeId],d=r[0];this.isValid=h=>En(d,h),this.get=h=>a(d,h),this.set=(h,W)=>l(d,h,W),this.indexOf=h=>u(d,h),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,to[o.typeId]),this._offsets=Hr(r);break}this.data=r,this.type=o,this.stride=Nt(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return Ha(this.data)}get nullCount(){return Gr(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${c[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Sn(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return On.visit(this)}concat(...t){return new N(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new N(Yr(this,t,e,({data:n,_offsets:s},r,o)=>Kr(n,s,r,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:s,ArrayType:r}=this;switch(t.typeId){case c.Int:case c.Float:case c.Decimal:case c.Time:case c.Timestamp:switch(e.length){case 0:return new r;case 1:return e[0].values.subarray(0,n*s);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*s),o.offset),o.offset+=l*s,o),{array:new r(n*s),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 N(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)){const t=new Bi(this.data[0].dictionary),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new N(e)}return new Bi(this)}unmemoize(){if(f.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new N(e)}return this}}Zr=Symbol.toStringTag;N[Zr]=(i=>{i.type=f.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;const t=Object.keys(c).map(e=>c[e]).filter(e=>typeof e=="number"&&e!==c.NONE);for(const e of t){const n=st.getVisitFnByTypeId(e),s=pt.getVisitFnByTypeId(e),r=Fi.getVisitFnByTypeId(e);Xr[e]={get:n,set:s,indexOf:r},to[e]=Object.create(i,{isValid:{value:Ai(En)},get:{value:Ai(st.getVisitFnByTypeId(e))},set:{value:qr(pt.getVisitFnByTypeId(e))},indexOf:{value:Qr(Fi.getVisitFnByTypeId(e))}})}return"Vector"})(N.prototype);class Bi extends N{constructor(t){super(t.data);const e=this.get,n=this.set,s=this.slice,r=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=r[o];if(a!==void 0)return a;const l=e.call(this,o);return r[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),r[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Bi(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new N(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class cn{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,s){return t.prep(8,24),t.writeInt64(BigInt(s??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(e??0)),t.offset()}}class rt{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 rt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+M),(e||new rt).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Y.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new bt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new cn).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const n=this.bb.__offset(this.bb_pos,10);return n?(e||new cn).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new G).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const 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,Y.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)}}class L{constructor(t=[],e,n,s=Y.V5){this.fields=t||[],this.metadata=e||new Map,n||(n=ln(this.fields)),this.dictionaries=n,this.metadataVersion=s}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){const e=new Set(t),n=this.fields.filter(s=>e.has(s.name));return new L(n,this.metadata)}selectAt(t){const e=t.map(n=>this.fields[n]).filter(Boolean);return new L(e,this.metadata)}assign(...t){const e=t[0]instanceof L?t[0]:Array.isArray(t[0])?new L(t[0]):new L(t),n=[...this.fields],s=He(He(new Map,this.metadata),e.metadata),r=e.fields.filter(a=>{const l=n.findIndex(u=>u.name===a.name);return~l?(n[l]=a.clone({metadata:He(He(new Map,n[l].metadata),a.metadata)}))&&!1:!0}),o=ln(r,new Map);return new L([...n,...r],s,new Map([...this.dictionaries,...o]))}}L.prototype.fields=null;L.prototype.metadata=null;L.prototype.dictionaries=null;class V{static new(...t){let[e,n,s,r]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),s===void 0&&(s=t[0].nullable),r===void 0&&(r=t[0].metadata)),new V(`${e}`,n,s,r)}constructor(t,e,n=!1,s){this.name=t,this.type=e,this.nullable=n,this.metadata=s||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,s,r]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,s=this.nullable,r=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:s=this.nullable,metadata:r=this.metadata}=t[0],V.new(e,n,s,r)}}V.prototype.type=null;V.prototype.name=null;V.prototype.nullable=null;V.prototype.metadata=null;function He(i,t){return new Map([...i||new Map,...t||new Map])}function ln(i,t=new Map){for(let e=-1,n=i.length;++e<n;){const r=i[e].type;if(f.isDictionary(r)){if(!t.has(r.id))t.set(r.id,r.dictionary);else if(t.get(r.id)!==r.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}r.children&&r.children.length>0&&ln(r.children,t)}return t}var Ja=Es,Za=me;class ke{static decode(t){t=new Za(F(t));const e=rt.getRootAsFooter(t),n=L.decode(e.schema(),new Map,e.version());return new Xa(n,e)}static encode(t){const e=new Ja,n=L.encode(e,t.schema);rt.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())Yt.encode(e,o);const s=e.endVector();rt.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())Yt.encode(e,o);const r=e.endVector();return rt.startFooter(e),rt.addSchema(e,n),rt.addVersion(e,Y.V5),rt.addRecordBatches(e,s),rt.addDictionaries(e,r),rt.finishFooterBuffer(e,rt.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=Y.V5,n,s){this.schema=t,this.version=e,n&&(this._recordBatches=n),s&&(this._dictionaryBatches=s)}*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}}class Xa extends ke{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,e){super(t,e.version()),this._footer=e}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const e=this._footer.recordBatches(t);if(e)return Yt.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return Yt.decode(e)}return null}}class Yt{static decode(t){return new Yt(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:n}=e,s=BigInt(e.offset),r=BigInt(e.bodyLength);return cn.createBlock(t,s,n,r)}constructor(t,e,n){this.metaDataLength=t,this.offset=k(n),this.bodyLength=k(e)}}const z=Object.freeze({done:!0,value:void 0});class rs{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class Tn{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())}}class tc extends Tn{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return E(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){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(z);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return lt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return lt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return E(this,void 0,void 0,function*(){return yield this.abort(t),z})}return(t){return E(this,void 0,void 0,function*(){return yield this.close(),z})}read(t){return E(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return E(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(z)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class ei extends tc{write(t){if((t=F(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Xi(this.toUint8Array(!0)):this.toUint8Array(!1).then(Xi)}toUint8Array(t=!1){return t?Tt(this._values)[0]:E(this,void 0,void 0,function*(){var e,n,s,r;const o=[];let a=0;try{for(var l=!0,u=Qt(this),d;d=yield u.next(),e=d.done,!e;l=!0){r=d.value,l=!1;const h=r;o.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!l&&!e&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return Tt(o,a)[0]})}}class Ri{constructor(t){t&&(this.source=new ec(lt.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)}}class Ie{constructor(t){t instanceof Ie?this.source=t.source:t instanceof ei?this.source=new Kt(lt.fromAsyncIterable(t)):Is(t)?this.source=new Kt(lt.fromNodeStream(t)):yn(t)?this.source=new Kt(lt.fromDOMStream(t)):bs(t)?this.source=new Kt(lt.fromDOMStream(t.body)):Ve(t)?this.source=new Kt(lt.fromIterable(t)):Jt(t)?this.source=new Kt(lt.fromAsyncIterable(t)):we(t)&&(this.source=new Kt(lt.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)}}class ec{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)||z)}return(t){return Object.create(this.source.return&&this.source.return(t)||z)}}class Kt{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return E(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return E(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return E(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return E(this,arguments,void 0,function*(e,n="read"){return yield this.source.next({cmd:n,size:e})})}throw(t){return E(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||z;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return E(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||z;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class os extends Ri{constructor(t,e){super(),this.position=0,this.buffer=F(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{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){const{buffer:e,size:n,position:s}=this;return e&&s<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,s+Math.min(n-s,t)),e.subarray(s,this.position)):null}readAt(t,e){const n=this.buffer,s=Math.min(this.size,t+e);return n?n.subarray(t,s):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class Di extends Ie{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=E(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return E(this,void 0,void 0,function*(){const{buffer:e,byteOffset:n}=yield this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)})}seek(t){return E(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 E(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:e,size:n,position:s}=this;if(e&&s<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let r=s,o=0,a=0;const l=Math.min(n,r+Math.min(n-r,t)),u=new Uint8Array(Math.max(0,(this.position=l)-r));for(;(r+=a)<l&&(o+=a)<u.byteLength;)({bytesRead:a}=yield e.read(u,o,u.byteLength-o,r));return u}return null})}readAt(t,e){return E(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:n,size:s}=this;if(n&&t+e<s){const r=Math.min(s,t+e),o=new Uint8Array(r-t);return(yield n.read(o,0,e,t)).buffer}return new Uint8Array(e)})}close(){return E(this,void 0,void 0,function*(){const t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return E(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return E(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}const ic=65536;function he(i){return i<0&&(i=4294967295+i+1),`0x${i.toString(16)}`}const Se=8,An=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class eo{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const 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]);let s=e[3]*n[3];this.buffer[0]=s&65535;let r=s>>>16;return s=e[2]*n[3],r+=s,s=e[3]*n[2]>>>0,r+=s,this.buffer[0]+=r<<16,this.buffer[1]=r>>>0<s?ic:0,this.buffer[1]+=r>>>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){const 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`${he(this.buffer[1])} ${he(this.buffer[0])}`}}class C extends eo{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return C.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return C.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.length,s=new C(e);for(let r=0;r<n;){const o=Se<n-r?Se:n-r,a=new C(new Uint32Array([Number.parseInt(t.slice(r,r+o),10),0])),l=new C(new Uint32Array([An[o],0]));s.times(l),s.plus(a),r+=o}return s}static convertArray(t){const e=new Uint32Array(t.length*2);for(let n=-1,s=t.length;++n<s;)C.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new C(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new C(new Uint32Array(t.buffer)).plus(e)}}class tt extends eo{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){const 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 tt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return tt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.startsWith("-"),s=t.length,r=new tt(e);for(let o=n?1:0;o<s;){const a=Se<s-o?Se:s-o,l=new tt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0])),u=new tt(new Uint32Array([An[a],0]));r.times(u),r.plus(l),o+=a}return n?r.negate():r}static convertArray(t){const e=new Uint32Array(t.length*2);for(let n=-1,s=t.length;++n<s;)tt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new tt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new tt(new Uint32Array(t.buffer)).plus(e)}}class It{constructor(t){this.buffer=t}high(){return new tt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new tt(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){const e=new C(new Uint32Array([this.buffer[3],0])),n=new C(new Uint32Array([this.buffer[2],0])),s=new C(new Uint32Array([this.buffer[1],0])),r=new C(new Uint32Array([this.buffer[0],0])),o=new C(new Uint32Array([t.buffer[3],0])),a=new C(new Uint32Array([t.buffer[2],0])),l=new C(new Uint32Array([t.buffer[1],0])),u=new C(new Uint32Array([t.buffer[0],0]));let d=C.multiply(r,u);this.buffer[0]=d.low();const h=new C(new Uint32Array([d.high(),0]));return d=C.multiply(s,u),h.plus(d),d=C.multiply(r,l),h.plus(d),this.buffer[1]=h.low(),this.buffer[3]=h.lessThan(d)?1:0,this.buffer[2]=h.high(),new C(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(C.multiply(n,u)).plus(C.multiply(s,l)).plus(C.multiply(r,a)),this.buffer[3]+=C.multiply(e,u).plus(C.multiply(n,l)).plus(C.multiply(s,a)).plus(C.multiply(r,o)).low(),this}plus(t){const 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`${he(this.buffer[3])} ${he(this.buffer[2])} ${he(this.buffer[1])} ${he(this.buffer[0])}`}static multiply(t,e){return new It(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new It(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return It.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return It.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),s=t.length,r=new It(e);for(let o=n?1:0;o<s;){const a=Se<s-o?Se:s-o,l=new It(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0,0,0])),u=new It(new Uint32Array([An[a],0,0,0]));r.times(u),r.plus(l),o+=a}return n?r.negate():r}static convertArray(t){const e=new Uint32Array(t.length*4);for(let n=-1,s=t.length;++n<s;)It.from(t[n],new Uint32Array(e.buffer,e.byteOffset+16*n,4));return e}}class io extends T{constructor(t,e,n,s,r=Y.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=n,this.dictionaries=s,this.metadataVersion=r}visit(t){return super.visit(t instanceof V?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return A({type:t,length:e})}visitBool(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({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 A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({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 A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({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 A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<Y.V5&&this.readNullBitmap(t,n),t.mode===q.Sparse?this.visitSparseUnion(t,{length:e,nullCount:n}):this.visitDenseUnion(t,{length:e,nullCount:n})}visitDenseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({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 A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({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 A({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)}}class nc extends io{constructor(t,e,n,s,r){super(new Uint8Array(0),e,n,s,r),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Ti(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return P(Uint8Array,P(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return P(Uint8Array,P(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:n}=this;return f.isTimestamp(t)||(f.isInt(t)||f.isTime(t))&&t.bitWidth===64||f.isDuration(t)||f.isDate(t)&&t.unit===ft.MILLISECOND?P(Uint8Array,tt.convertArray(n[e])):f.isDecimal(t)?P(Uint8Array,It.convertArray(n[e])):f.isBinary(t)||f.isLargeBinary(t)||f.isFixedSizeBinary(t)?sc(n[e]):f.isBool(t)?Ti(n[e]):f.isUtf8(t)||f.isLargeUtf8(t)?pn(n[e].join("")):P(Uint8Array,P(t.ArrayType,n[e].map(s=>+s)))}}function sc(i){const t=i.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}class m extends T{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,s)=>this.compareFields(n,e[s]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function X(i,t){return t instanceof i.constructor}function Xt(i,t){return i===t||X(i,t)}function Ct(i,t){return i===t||X(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function ki(i,t){return i===t||X(i,t)&&i.precision===t.precision}function rc(i,t){return i===t||X(i,t)&&i.byteWidth===t.byteWidth}function Fn(i,t){return i===t||X(i,t)&&i.unit===t.unit}function ze(i,t){return i===t||X(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function je(i,t){return i===t||X(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function oc(i,t){return i===t||X(i,t)&&i.children.length===t.children.length&&$t.compareManyFields(i.children,t.children)}function ac(i,t){return i===t||X(i,t)&&i.children.length===t.children.length&&$t.compareManyFields(i.children,t.children)}function Bn(i,t){return i===t||X(i,t)&&i.mode===t.mode&&i.typeIds.every((e,n)=>e===t.typeIds[n])&&$t.compareManyFields(i.children,t.children)}function cc(i,t){return i===t||X(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&$t.visit(i.indices,t.indices)&&$t.visit(i.dictionary,t.dictionary)}function Rn(i,t){return i===t||X(i,t)&&i.unit===t.unit}function We(i,t){return i===t||X(i,t)&&i.unit===t.unit}function lc(i,t){return i===t||X(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&$t.compareManyFields(i.children,t.children)}function uc(i,t){return i===t||X(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&$t.compareManyFields(i.children,t.children)}m.prototype.visitNull=Xt;m.prototype.visitBool=Xt;m.prototype.visitInt=Ct;m.prototype.visitInt8=Ct;m.prototype.visitInt16=Ct;m.prototype.visitInt32=Ct;m.prototype.visitInt64=Ct;m.prototype.visitUint8=Ct;m.prototype.visitUint16=Ct;m.prototype.visitUint32=Ct;m.prototype.visitUint64=Ct;m.prototype.visitFloat=ki;m.prototype.visitFloat16=ki;m.prototype.visitFloat32=ki;m.prototype.visitFloat64=ki;m.prototype.visitUtf8=Xt;m.prototype.visitLargeUtf8=Xt;m.prototype.visitBinary=Xt;m.prototype.visitLargeBinary=Xt;m.prototype.visitFixedSizeBinary=rc;m.prototype.visitDate=Fn;m.prototype.visitDateDay=Fn;m.prototype.visitDateMillisecond=Fn;m.prototype.visitTimestamp=ze;m.prototype.visitTimestampSecond=ze;m.prototype.visitTimestampMillisecond=ze;m.prototype.visitTimestampMicrosecond=ze;m.prototype.visitTimestampNanosecond=ze;m.prototype.visitTime=je;m.prototype.visitTimeSecond=je;m.prototype.visitTimeMillisecond=je;m.prototype.visitTimeMicrosecond=je;m.prototype.visitTimeNanosecond=je;m.prototype.visitDecimal=Xt;m.prototype.visitList=oc;m.prototype.visitStruct=ac;m.prototype.visitUnion=Bn;m.prototype.visitDenseUnion=Bn;m.prototype.visitSparseUnion=Bn;m.prototype.visitDictionary=cc;m.prototype.visitInterval=Rn;m.prototype.visitIntervalDayTime=Rn;m.prototype.visitIntervalYearMonth=Rn;m.prototype.visitDuration=We;m.prototype.visitDurationSecond=We;m.prototype.visitDurationMillisecond=We;m.prototype.visitDurationMicrosecond=We;m.prototype.visitDurationNanosecond=We;m.prototype.visitFixedSizeList=lc;m.prototype.visitMap=uc;const $t=new m;function un(i,t){return $t.compareSchemas(i,t)}function Gi(i,t){return dc(i,t.map(e=>e.data.concat()))}function dc(i,t){const e=[...i.fields],n=[],s={numBatches:t.reduce((h,W)=>Math.max(h,W.length),0)};let r=0,o=0,a=-1;const l=t.length;let u,d=[];for(;s.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<l;)d[a]=u=t[a].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(d=hc(e,o,d,t,s),o>0&&(n[r++]=A({type:new J(e),length:o,nullCount:0,children:d.slice()})))}return[i=i.assign(e),n.map(h=>new it(i,h))]}function hc(i,t,e,n,s){var r;const o=(t+63&-64)>>3;for(let a=-1,l=n.length;++a<l;){const u=e[a],d=u?.length;if(d>=t)d===t?e[a]=u:(e[a]=u.slice(0,t),s.numBatches=Math.max(s.numBatches,n[a].unshift(u.slice(t,d-t))));else{const h=i[a];i[a]=h.clone({nullable:!0}),e[a]=(r=u?._changeLengthAndBackfillNullBitmap(t))!==null&&r!==void 0?r:A({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var no;class Q{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new L([]),this._offsets=[0],this;let s,r;t[0]instanceof L&&(s=t.shift()),t.at(-1)instanceof Uint32Array&&(r=t.pop());const o=l=>{if(l){if(l instanceof it)return[l];if(l instanceof Q)return l.batches;if(l instanceof U){if(l.type instanceof J)return[new it(new L(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(u=>o(u));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(u=>o(u));if(typeof l=="object"){const u=Object.keys(l),d=u.map(B=>new N([l[B]])),h=s??new L(u.map((B,H)=>new V(String(B),d[H].type,d[H].nullable))),[,W]=Gi(h,d);return W.length===0?[new it(l)]:W}}}return[]},a=t.flatMap(l=>o(l));if(s=(n=s??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&n!==void 0?n:new L([]),!(s instanceof L))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof it))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!un(s,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=a,this._offsets=r??Hr(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=Gr(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(Sn(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?On.visit(new N(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
2
|
+
${this.toArray().join(`,
|
|
3
|
+
`)}
|
|
4
|
+
]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:s})=>s));return new Q(e,n.map(s=>new it(e,s)))}slice(t,e){const n=this.schema;[t,e]=Yr({length:this.numRows},t,e);const s=Kr(this.data,this._offsets,t,e);return new Q(n,s.map(r=>new it(n,r)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){const e=this.data.map(n=>n.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],s=A({type:n,length:0,nullCount:0});e.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new N(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===t),e)}setChildAt(t,e){let n=this.schema,s=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new N([A({type:new Wt,length:this.numRows})]));const r=n.fields.slice(),o=r[t].clone({type:e.type}),a=this.schema.fields.map((l,u)=>this.getChildAt(u));[r[t],a[t]]=[o,e],[n,s]=Gi(n,a)}return new Q(n,s)}select(t){const e=this.schema.fields.reduce((n,s,r)=>n.set(s.name,r),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(s=>s.selectAt(t));return new Q(e,n)}assign(t){const e=this.schema.fields,[n,s]=t.schema.fields.reduce((a,l,u)=>{const[d,h]=a,W=e.findIndex(B=>B.name===l.name);return~W?h[W]=u:d.push(u),a},[[],[]]),r=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,s[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new Q(...Gi(r,o))}}no=Symbol.toStringTag;Q[no]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Ai(En),i.get=Ai(st.getVisitFn(c.Struct)),i.set=qr(pt.getVisitFn(c.Struct)),i.indexOf=Qr(Fi.getVisitFn(c.Struct)),"Table"))(Q.prototype);var so;let it=class Ne{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof L))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=A({nullCount:0,type:new J(this.schema.fields),children:this.schema.fields.map(e=>A({type:e.type,nullCount:0}))})]=t,!(this.data instanceof U))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=as(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:s,length:r}=Object.keys(e).reduce((l,u,d)=>(l.children[d]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[d]=V.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new L(n),a=A({type:new J(n),length:r,children:s,nullCount:0});[this.schema,this.data]=as(o,a.children,r);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=ro(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 st.visit(this.data,t)}at(t){return this.get(Sn(t,this.numRows))}set(t,e){return pt.visit(this.data,t,e)}indexOf(t,e){return Fi.visit(this.data,t,e)}[Symbol.iterator](){return On.visit(new N([this.data]))}toArray(){return[...this]}concat(...t){return new Q(this.schema,[this,...t])}slice(t,e){const[n]=new N([this.data]).slice(t,e).data;return new Ne(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 N([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(s=>s.name===t),e)}setChildAt(t,e){let n=this.schema,s=this.data;if(t>-1&&t<this.numCols){e||(e=new N([A({type:new Wt,length:this.numRows})]));const r=n.fields.slice(),o=s.children.slice(),a=r[t].clone({type:e.type});[r[t],o[t]]=[a,e.data[0]],n=new L(r,new Map(this.schema.metadata)),s=A({type:new J(r),children:o})}return new Ne(n,s)}select(t){const e=this.schema.select(t),n=new J(e.fields),s=[];for(const r of t){const o=this.schema.fields.findIndex(a=>a.name===r);~o&&(s[o]=this.data.children[o])}return new Ne(e,A({type:n,length:this.numRows,children:s}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(r=>this.data.children[r]).filter(Boolean),s=A({type:new J(e.fields),length:this.numRows,children:n});return new Ne(e,s)}};so=Symbol.toStringTag;it[so]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(it.prototype);function as(i,t,e=t.reduce((n,s)=>Math.max(n,s.length),0)){var n;const s=[...i.fields],r=[...t],o=(e+63&-64)>>3;for(const[a,l]of i.fields.entries()){const u=t[a];(!u||u.length!==e)&&(s[a]=l.clone({nullable:!0}),r[a]=(n=u?._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:A({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[i.assign(s),A({type:new J(s),length:e,children:r})]}function ro(i,t,e=new Map){var n,s;if(((n=i?.length)!==null&&n!==void 0?n:0)>0&&i?.length===t?.length)for(let r=-1,o=i.length;++r<o;){const{type:a}=i[r],l=t[r];for(const u of[l,...((s=l?.dictionary)===null||s===void 0?void 0:s.data)||[]])ro(a.children,u?.children,e);if(f.isDictionary(a)){const{id:u}=a;if(!e.has(u))l?.dictionary&&e.set(u,l.dictionary);else if(e.get(u)!==l.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return e}class Dn extends it{constructor(t){const e=t.fields.map(s=>A({type:s.type})),n=A({type:new J(t.fields),nullCount:0,children:e});super(t,n)}}let xt=class gt{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 gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+M),(e||new gt).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Y.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):D.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new G).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const 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,Y.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,D.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let 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,s,r,o){return gt.startMessage(t),gt.addVersion(t,e),gt.addHeaderType(t,n),gt.addHeader(t,s),gt.addBodyLength(t,r),gt.addCustomMetadata(t,o),gt.endMessage(t)}};class fc extends T{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return Zn.startNull(e),Zn.endNull(e)}visitInt(t,e){return ot.startInt(e),ot.addBitWidth(e,t.bitWidth),ot.addIsSigned(e,t.isSigned),ot.endInt(e)}visitFloat(t,e){return wt.startFloatingPoint(e),wt.addPrecision(e,t.precision),wt.endFloatingPoint(e)}visitBinary(t,e){return Hn.startBinary(e),Hn.endBinary(e)}visitLargeBinary(t,e){return qn.startLargeBinary(e),qn.endLargeBinary(e)}visitBool(t,e){return Kn.startBool(e),Kn.endBool(e)}visitUtf8(t,e){return Xn.startUtf8(e),Xn.endUtf8(e)}visitLargeUtf8(t,e){return Qn.startLargeUtf8(e),Qn.endLargeUtf8(e)}visitDecimal(t,e){return se.startDecimal(e),se.addScale(e,t.scale),se.addPrecision(e,t.precision),se.addBitWidth(e,t.bitWidth),se.endDecimal(e)}visitDate(t,e){return qe.startDate(e),qe.addUnit(e,t.unit),qe.endDate(e)}visitTime(t,e){return ut.startTime(e),ut.addUnit(e,t.unit),ut.addBitWidth(e,t.bitWidth),ut.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return dt.startTimestamp(e),dt.addUnit(e,t.unit),n!==void 0&&dt.addTimezone(e,n),dt.endTimestamp(e)}visitInterval(t,e){return vt.startInterval(e),vt.addUnit(e,t.unit),vt.endInterval(e)}visitDuration(t,e){return Qe.startDuration(e),Qe.addUnit(e,t.unit),Qe.endDuration(e)}visitList(t,e){return Jn.startList(e),Jn.endList(e)}visitStruct(t,e){return qt.startStruct_(e),qt.endStruct_(e)}visitUnion(t,e){et.startTypeIdsVector(e,t.typeIds.length);const n=et.createTypeIdsVector(e,t.typeIds);return et.startUnion(e),et.addMode(e,t.mode),et.addTypeIds(e,n),et.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return Mt.startDictionaryEncoding(e),Mt.addId(e,BigInt(t.id)),Mt.addIsOrdered(e,t.isOrdered),n!==void 0&&Mt.addIndexType(e,n),Mt.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Je.startFixedSizeBinary(e),Je.addByteWidth(e,t.byteWidth),Je.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Ze.startFixedSizeList(e),Ze.addListSize(e,t.listSize),Ze.endFixedSizeList(e)}visitMap(t,e){return Xe.startMap(e),Xe.addKeysSorted(e,t.keysSorted),Xe.endMap(e)}}const Hi=new fc;function pc(i,t=new Map){return new L(_c(i,t),ii(i.metadata),t)}function oo(i){return new at(i.count,ao(i.columns),co(i.columns))}function yc(i){return new Ft(oo(i.data),i.id,i.isDelta)}function _c(i,t){return(i.fields||[]).filter(Boolean).map(e=>V.fromJSON(e,t))}function cs(i,t){return(i.children||[]).filter(Boolean).map(e=>V.fromJSON(e,t))}function ao(i){return(i||[]).reduce((t,e)=>[...t,new Gt(e.count,mc(e.VALIDITY)),...ao(e.children)],[])}function co(i,t=[]){for(let e=-1,n=(i||[]).length;++e<n;){const s=i[e];s.VALIDITY&&t.push(new Ot(t.length,s.VALIDITY.length)),s.TYPE_ID&&t.push(new Ot(t.length,s.TYPE_ID.length)),s.OFFSET&&t.push(new Ot(t.length,s.OFFSET.length)),s.DATA&&t.push(new Ot(t.length,s.DATA.length)),t=co(s.children,t)}return t}function mc(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function gc(i,t){let e,n,s,r,o,a;return!t||!(r=i.dictionary)?(o=us(i,cs(i,t)),s=new V(i.name,o,i.nullable,ii(i.metadata))):t.has(e=r.id)?(n=(n=r.indexType)?ls(n):new Pe,a=new be(t.get(e),n,e,r.isOrdered),s=new V(i.name,a,i.nullable,ii(i.metadata))):(n=(n=r.indexType)?ls(n):new Pe,t.set(e,o=us(i,cs(i,t))),a=new be(o,n,e,r.isOrdered),s=new V(i.name,a,i.nullable,ii(i.metadata))),s||null}function ii(i=[]){return new Map(i.map(({key:t,value:e})=>[t,e]))}function ls(i){return new Zt(i.isSigned,i.bitWidth)}function us(i,t){const e=i.type.name;switch(e){case"NONE":return new Wt;case"null":return new Wt;case"binary":return new li;case"largebinary":return new ui;case"utf8":return new di;case"largeutf8":return new hi;case"bool":return new fi;case"list":return new Ii((t||[])[0]);case"struct":return new J(t||[]);case"struct_":return new J(t||[])}switch(e){case"int":{const n=i.type;return new Zt(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=i.type;return new ci(K[n.precision])}case"decimal":{const n=i.type;return new pi(n.scale,n.precision,n.bitWidth)}case"date":{const n=i.type;return new yi(ft[n.unit])}case"time":{const n=i.type;return new _i(g[n.unit],n.bitWidth)}case"timestamp":{const n=i.type;return new mi(g[n.unit],n.timezone)}case"interval":{const n=i.type;return new gi(At[n.unit])}case"duration":{const n=i.type;return new bi(g[n.unit])}case"union":{const n=i.type,[s,...r]=(n.mode+"").toLowerCase(),o=s.toUpperCase()+r.join("");return new Si(q[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=i.type;return new wi(n.byteWidth)}case"fixedsizelist":{const n=i.type;return new vi(n.listSize,(t||[])[0])}case"map":{const n=i.type;return new Ei((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var bc=Es,Ic=me;class Z{static fromJSON(t,e){const n=new Z(0,Y.V5,e);return n._createHeader=Sc(t,e),n}static decode(t){t=new Ic(F(t));const e=xt.getRootAsMessage(t),n=e.bodyLength(),s=e.version(),r=e.headerType(),o=new Z(n,s,r);return o._createHeader=wc(e,r),o}static encode(t){const e=new bc;let n=-1;return t.isSchema()?n=L.encode(e,t.header()):t.isRecordBatch()?n=at.encode(e,t.header()):t.isDictionaryBatch()&&(n=Ft.encode(e,t.header())),xt.startMessage(e),xt.addVersion(e,Y.V5),xt.addHeader(e,n),xt.addHeaderType(e,t.headerType),xt.addBodyLength(e,BigInt(t.bodyLength)),xt.finishMessageBuffer(e,xt.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof L)return new Z(0,Y.V5,D.Schema,t);if(t instanceof at)return new Z(e,Y.V5,D.RecordBatch,t);if(t instanceof Ft)return new Z(e,Y.V5,D.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===D.Schema}isRecordBatch(){return this.headerType===D.RecordBatch}isDictionaryBatch(){return this.headerType===D.DictionaryBatch}constructor(t,e,n,s){this._version=e,this._headerType=n,this.body=new Uint8Array(0),s&&(this._createHeader=()=>s),this._bodyLength=k(t)}}class at{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=k(t)}}class Ft{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=k(e)}}class Ot{constructor(t,e){this.offset=k(t),this.length=k(e)}}class Gt{constructor(t,e){this.length=k(t),this.nullCount=k(e)}}function Sc(i,t){return(()=>{switch(t){case D.Schema:return L.fromJSON(i);case D.RecordBatch:return at.fromJSON(i);case D.DictionaryBatch:return Ft.fromJSON(i)}throw new Error(`Unrecognized Message type: { name: ${D[t]}, type: ${t} }`)})}function wc(i,t){return(()=>{switch(t){case D.Schema:return L.decode(i.header(new bt),new Map,i.version());case D.RecordBatch:return at.decode(i.header(new Rt),i.version());case D.DictionaryBatch:return Ft.decode(i.header(new ie),i.version())}throw new Error(`Unrecognized Message type: { name: ${D[t]}, type: ${t} }`)})}V.encode=Lc;V.decode=Dc;V.fromJSON=gc;L.encode=Nc;L.decode=vc;L.fromJSON=pc;at.encode=Mc;at.decode=Ec;at.fromJSON=oo;Ft.encode=Uc;Ft.decode=Oc;Ft.fromJSON=yc;Gt.encode=Cc;Gt.decode=Ac;Ot.encode=Pc;Ot.decode=Tc;function vc(i,t=new Map,e=Y.V5){const n=Rc(i,t);return new L(n,ni(i),t,e)}function Ec(i,t=Y.V5){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new at(i.length(),Fc(i),Bc(i,t))}function Oc(i,t=Y.V5){return new Ft(at.decode(i.data(),t),i.id(),i.isDelta())}function Tc(i){return new Ot(i.offset(),i.length())}function Ac(i){return new Gt(i.length(),i.nullCount())}function Fc(i){const t=[];for(let e,n=-1,s=-1,r=i.nodesLength();++n<r;)(e=i.nodes(n))&&(t[++s]=Gt.decode(e));return t}function Bc(i,t){const e=[];for(let n,s=-1,r=-1,o=i.buffersLength();++s<o;)(n=i.buffers(s))&&(t<Y.V4&&(n.bb_pos+=8*(s+1)),e[++r]=Ot.decode(n));return e}function Rc(i,t){const e=[];for(let n,s=-1,r=-1,o=i.fieldsLength();++s<o;)(n=i.fields(s))&&(e[++r]=V.decode(n,t));return e}function ds(i,t){const e=[];for(let n,s=-1,r=-1,o=i.childrenLength();++s<o;)(n=i.children(s))&&(e[++r]=V.decode(n,t));return e}function Dc(i,t){let e,n,s,r,o,a;return!t||!(a=i.dictionary())?(s=fs(i,ds(i,t)),n=new V(i.name(),s,i.nullable(),ni(i))):t.has(e=k(a.id()))?(r=(r=a.indexType())?hs(r):new Pe,o=new be(t.get(e),r,e,a.isOrdered()),n=new V(i.name(),o,i.nullable(),ni(i))):(r=(r=a.indexType())?hs(r):new Pe,t.set(e,s=fs(i,ds(i,t))),o=new be(s,r,e,a.isOrdered()),n=new V(i.name(),o,i.nullable(),ni(i))),n||null}function ni(i){const t=new Map;if(i)for(let e,n,s=-1,r=Math.trunc(i.customMetadataLength());++s<r;)(e=i.customMetadata(s))&&(n=e.key())!=null&&t.set(n,e.value());return t}function hs(i){return new Zt(i.isSigned(),i.bitWidth())}function fs(i,t){const e=i.typeType();switch(e){case x.NONE:return new Wt;case x.Null:return new Wt;case x.Binary:return new li;case x.LargeBinary:return new ui;case x.Utf8:return new di;case x.LargeUtf8:return new hi;case x.Bool:return new fi;case x.List:return new Ii((t||[])[0]);case x.Struct_:return new J(t||[])}switch(e){case x.Int:{const n=i.type(new ot);return new Zt(n.isSigned(),n.bitWidth())}case x.FloatingPoint:{const n=i.type(new wt);return new ci(n.precision())}case x.Decimal:{const n=i.type(new se);return new pi(n.scale(),n.precision(),n.bitWidth())}case x.Date:{const n=i.type(new qe);return new yi(n.unit())}case x.Time:{const n=i.type(new ut);return new _i(n.unit(),n.bitWidth())}case x.Timestamp:{const n=i.type(new dt);return new mi(n.unit(),n.timezone())}case x.Interval:{const n=i.type(new vt);return new gi(n.unit())}case x.Duration:{const n=i.type(new Qe);return new bi(n.unit())}case x.Union:{const n=i.type(new et);return new Si(n.mode(),n.typeIdsArray()||[],t||[])}case x.FixedSizeBinary:{const n=i.type(new Je);return new wi(n.byteWidth())}case x.FixedSizeList:{const n=i.type(new Ze);return new vi(n.listSize(),(t||[])[0])}case x.Map:{const n=i.type(new Xe);return new Ei((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${x[e]}" (${e})`)}function Nc(i,t){const e=t.fields.map(r=>V.encode(i,r));bt.startFieldsVector(i,e.length);const n=bt.createFieldsVector(i,e),s=t.metadata&&t.metadata.size>0?bt.createCustomMetadataVector(i,[...t.metadata].map(([r,o])=>{const a=i.createString(`${r}`),l=i.createString(`${o}`);return G.startKeyValue(i),G.addKey(i,a),G.addValue(i,l),G.endKeyValue(i)})):-1;return bt.startSchema(i),bt.addFields(i,n),bt.addEndianness(i,kc?ge.Little:ge.Big),s!==-1&&bt.addCustomMetadata(i,s),bt.endSchema(i)}function Lc(i,t){let e=-1,n=-1,s=-1;const r=t.type;let o=t.typeId;f.isDictionary(r)?(o=r.dictionary.typeId,s=Hi.visit(r,i),n=Hi.visit(r.dictionary,i)):n=Hi.visit(r,i);const a=(r.children||[]).map(d=>V.encode(i,d)),l=ct.createChildrenVector(i,a),u=t.metadata&&t.metadata.size>0?ct.createCustomMetadataVector(i,[...t.metadata].map(([d,h])=>{const W=i.createString(`${d}`),B=i.createString(`${h}`);return G.startKeyValue(i),G.addKey(i,W),G.addValue(i,B),G.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),ct.startField(i),ct.addType(i,n),ct.addTypeType(i,o),ct.addChildren(i,l),ct.addNullable(i,!!t.nullable),e!==-1&&ct.addName(i,e),s!==-1&&ct.addDictionary(i,s),u!==-1&&ct.addCustomMetadata(i,u),ct.endField(i)}function Mc(i,t){const e=t.nodes||[],n=t.buffers||[];Rt.startNodesVector(i,e.length);for(const o of e.slice().reverse())Gt.encode(i,o);const s=i.endVector();Rt.startBuffersVector(i,n.length);for(const o of n.slice().reverse())Ot.encode(i,o);const r=i.endVector();return Rt.startRecordBatch(i),Rt.addLength(i,BigInt(t.length)),Rt.addNodes(i,s),Rt.addBuffers(i,r),Rt.endRecordBatch(i)}function Uc(i,t){const e=at.encode(i,t.data);return ie.startDictionaryBatch(i),ie.addId(i,BigInt(t.id)),ie.addIsDelta(i,t.isDelta),ie.addData(i,e),ie.endDictionaryBatch(i)}function Cc(i,t){return As.createFieldNode(i,BigInt(t.length),BigInt(t.nullCount))}function Pc(i,t){return Ts.createBuffer(i,BigInt(t.offset),BigInt(t.length))}const kc=(()=>{const i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})(),Nn=i=>`Expected ${D[i]} Message in stream, but was null or length 0.`,Ln=i=>`Header pointer of flatbuffer-encoded ${D[i]} Message is null or length 0.`,lo=(i,t)=>`Expected to read ${i} metadata bytes, but only read ${t}.`,uo=(i,t)=>`Expected to read ${i} bytes for message body, but only read ${t}.`;class ho{constructor(t){this.source=t instanceof Ri?t:new Ri(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?z: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(Nn(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=F(this.source.read(t));if(e.byteLength<t)throw new Error(uo(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=D.Schema,n=this.readMessage(e),s=n?.header();if(t&&!s)throw new Error(Ln(e));return s}readMetadataLength(){const t=this.source.read(xi),e=t&&new me(t),n=e?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(t){const e=this.source.read(t);if(!e)return z;if(e.byteLength<t)throw new Error(lo(t,e.byteLength));return{done:!1,value:Z.decode(e)}}}class xc{constructor(t,e){this.source=t instanceof Ie?t:gs(t)?new Di(t,e):new Ie(t)}[Symbol.asyncIterator](){return this}next(){return E(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done||t.value===-1&&(t=yield this.readMetadataLength()).done||(t=yield this.readMetadata(t.value)).done?z:t})}throw(t){return E(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return E(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return E(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(Nn(t));return e.value})}readMessageBody(t){return E(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);const e=F(yield this.source.read(t));if(e.byteLength<t)throw new Error(uo(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(){return E(this,arguments,void 0,function*(t=!1){const e=D.Schema,n=yield this.readMessage(e),s=n?.header();if(t&&!s)throw new Error(Ln(e));return s})}readMetadataLength(){return E(this,void 0,void 0,function*(){const t=yield this.source.read(xi),e=t&&new me(t),n=e?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(t){return E(this,void 0,void 0,function*(){const e=yield this.source.read(t);if(!e)return z;if(e.byteLength<t)throw new Error(lo(t,e.byteLength));return{done:!1,value:Z.decode(e)}})}}class Vc extends ho{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof rs?t:new rs(t)}next(){const{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Z.fromJSON(t.schema,D.Schema)};if(this._dictionaryIndex<t.dictionaries.length){const e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:Z.fromJSON(e,D.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:Z.fromJSON(e,D.RecordBatch)}}return this._body=[],z}readMessageBody(t){return e(this._body);function e(n){return(n||[]).reduce((s,r)=>[...s,...r.VALIDITY&&[r.VALIDITY]||[],...r.TYPE_ID&&[r.TYPE_ID]||[],...r.OFFSET&&[r.OFFSET]||[],...r.DATA&&[r.DATA]||[],...e(r.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(Nn(t));return e.value}readSchema(){const t=D.Schema,e=this.readMessage(t),n=e?.header();if(!e||!n)throw new Error(Ln(t));return n}}const xi=4,dn="ARROW1",xe=new Uint8Array(dn.length);for(let i=0;i<dn.length;i+=1)xe[i]=dn.codePointAt(i);function Mn(i,t=0){for(let e=-1,n=xe.length;++e<n;)if(xe[e]!==i[t+e])return!1;return!0}const Ye=xe.length,fo=Ye+xi,zc=Ye*2+xi;class ht extends Tn{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){const e=this._impl.open(t);return Jt(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 lt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return lt.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 ht?t:tn(t)?$c(t):gs(t)?Kc(t):Jt(t)?E(this,void 0,void 0,function*(){return yield ht.from(yield t)}):bs(t)||yn(t)||Is(t)||we(t)?Hc(new Ie(t)):Gc(new Ri(t))}static readAll(t){return t instanceof ht?t.isSync()?ps(t):ys(t):tn(t)||ArrayBuffer.isView(t)||Ve(t)||ms(t)?ps(t):ys(t)}}class Ni extends ht{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Et(this,arguments,function*(){yield O(yield*Ke(Qt(this[Symbol.iterator]())))})}}class Li extends ht{constructor(t){super(t),this._impl=t}readAll(){return E(this,void 0,void 0,function*(){var t,e,n,s;const r=new Array;try{for(var o=!0,a=Qt(this),l;l=yield a.next(),t=l.done,!t;o=!0){s=l.value,o=!1;const u=s;r.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return r})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class po extends Ni{constructor(t){super(t),this._impl=t}}class jc extends Li{constructor(t){super(t),this._impl=t}}class yo{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),s=A({type:new J(this.schema.fields),length:t.length,children:n});return new it(this.schema,s)}_loadDictionaryBatch(t,e){const{id:n,isDelta:s}=t,{dictionaries:r,schema:o}=this,a=r.get(n),l=o.dictionaries.get(n),u=this._loadVectors(t.data,e,[l]);return(a&&s?a.concat(new N(u)):new N(u)).memoize()}_loadVectors(t,e,n){return new io(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class Mi extends yo{constructor(t,e){super(e),this._reader=tn(t)?new Vc(this._handle=t):new ho(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=mo(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):z}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):z}next(){if(this.closed)return z;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),s=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),s=e.readMessageBody(t.bodyLength),r=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,r)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dn(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ui extends yo{constructor(t,e){super(e),this._reader=new xc(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return E(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 E(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=mo(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return E(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):z})}return(t){return E(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):z})}next(){return E(this,void 0,void 0,function*(){if(this.closed)return z;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),s=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),s=yield e.readMessageBody(t.bodyLength),r=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,r)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dn(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return E(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class _o extends Mi{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof os?t:new os(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const 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();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const s=this._reader.readMessage(D.RecordBatch);if(s?.isRecordBatch()){const r=s.header(),o=this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(r,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const s=this._reader.readMessage(D.DictionaryBatch);if(s?.isDictionaryBatch()){const r=s.header(),o=this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(r,o);this.dictionaries.set(r.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-fo,n=t.readInt32(e),s=t.readAt(e-n,n);return ke.decode(s)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const 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}}class Wc extends Ui{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...e){const n=typeof e[0]!="number"?e.shift():void 0,s=e[0]instanceof Map?e.shift():void 0;super(t instanceof Di?t:new Di(t,n),s)}isFile(){return!0}isAsync(){return!0}open(t){const e=Object.create(null,{open:{get:()=>super.open}});return E(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return E(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const s=yield this._reader.readMessage(D.RecordBatch);if(s?.isRecordBatch()){const r=s.header(),o=yield this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(r,o)}}return null})}_readDictionaryBatch(t){return E(this,void 0,void 0,function*(){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const s=yield this._reader.readMessage(D.DictionaryBatch);if(s?.isDictionaryBatch()){const r=s.header(),o=yield this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(r,o);this.dictionaries.set(r.id,a)}}})}_readFooter(){return E(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-fo,n=yield t.readInt32(e),s=yield t.readAt(e-n,n);return ke.decode(s)})}_readNextMessageAndValidate(t){return E(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null})}}class Yc extends Mi{constructor(t,e){super(t,e)}_loadVectors(t,e,n){return new nc(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}function mo(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*ps(i){const t=ht.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function ys(i){return Et(this,arguments,function*(){const e=yield O(ht.from(i));try{if(!(yield O(e.open({autoDestroy:!1}))).closed)do yield yield O(e);while(!(yield O(e.reset().open())).closed)}finally{yield O(e.cancel())}})}function $c(i){return new Ni(new Yc(i))}function Gc(i){const t=i.peek(Ye+7&-8);return t&&t.byteLength>=4?Mn(t)?new po(new _o(i.read())):new Ni(new Mi(i)):new Ni(new Mi((function*(){})()))}function Hc(i){return E(this,void 0,void 0,function*(){const t=yield i.peek(Ye+7&-8);return t&&t.byteLength>=4?Mn(t)?new po(new _o(yield i.read())):new Li(new Ui(i)):new Li(new Ui((function(){return Et(this,arguments,function*(){})})()))})}function Kc(i){return E(this,void 0,void 0,function*(){const{size:t}=yield i.stat(),e=new Di(i,t);return t>=zc&&Mn(yield e.readAt(0,Ye+7&-8))?new jc(new Wc(e)):new Li(new Ui(e))})}class j extends T{static assemble(...t){const e=s=>s.flatMap(r=>Array.isArray(r)?e(r):r instanceof it?r.data.children:r.data),n=new j;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof N)return this.visitMany(t.data),this;const{type:e}=t;if(!f.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(f.isUnion(e))this.nodes.push(new Gt(n,0));else{const{nullCount:s}=t;f.isNull(e)||_t.call(this,s<=0?new Uint8Array(0):Oi(t.offset,n,t.nullBitmap)),this.nodes.push(new Gt(n,s))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function _t(i){const t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new Ot(this._byteLength,t)),this._byteLength+=t,this}function qc(i){var t;const{type:e,length:n,typeIds:s,valueOffsets:r}=i;if(_t.call(this,s),e.mode===q.Sparse)return hn.call(this,i);if(e.mode===q.Dense){if(i.offset<=0)return _t.call(this,r),hn.call(this,i);{const o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let u,d,h=-1;++h<n;)(u=s[h])!==void 0&&((d=a[u])===void 0&&(d=a[u]=r[h]),o[h]=r[h]-d,l[u]=((t=l[u])!==null&&t!==void 0?t:0)+1);_t.call(this,o),this.visitMany(i.children.map((u,d)=>{const h=e.typeIds[d],W=a[h],B=l[h];return u.slice(W,Math.min(n,B))}))}}return this}function Qc(i){let t;return i.nullCount>=i.length?_t.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?_t.call(this,Oi(i.offset,i.length,t)):_t.call(this,Ti(i.values))}function Pt(i){return _t.call(this,i.values.subarray(0,i.length*i.stride))}function Vi(i){const{length:t,values:e,valueOffsets:n}=i,s=k(n[0]),r=k(n[t]),o=Math.min(r-s,e.byteLength-s);return _t.call(this,ws(-s,t+1,n)),_t.call(this,e.subarray(s,s+o)),this}function Un(i){const{length:t,valueOffsets:e}=i;if(e){const{[0]:n,[t]:s}=e;return _t.call(this,ws(-n,t+1,e)),this.visit(i.children[0].slice(n,s-n))}return this.visit(i.children[0])}function hn(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}j.prototype.visitBool=Qc;j.prototype.visitInt=Pt;j.prototype.visitFloat=Pt;j.prototype.visitUtf8=Vi;j.prototype.visitLargeUtf8=Vi;j.prototype.visitBinary=Vi;j.prototype.visitLargeBinary=Vi;j.prototype.visitFixedSizeBinary=Pt;j.prototype.visitDate=Pt;j.prototype.visitTimestamp=Pt;j.prototype.visitTime=Pt;j.prototype.visitDecimal=Pt;j.prototype.visitList=Un;j.prototype.visitStruct=hn;j.prototype.visitUnion=qc;j.prototype.visitInterval=Pt;j.prototype.visitDuration=Pt;j.prototype.visitFixedSizeList=Un;j.prototype.visitMap=Un;class go extends Tn{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new ei,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,nt(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Jt(t)?t.then(e=>this.writeAll(e)):we(t)?xn(this,t):kn(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 ei?this._sink=t:(this._sink=new ei,t&&Ao(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Fo(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!un(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 Q&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof it&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!un(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof it?t instanceof Dn||this._writeRecordBatch(t):t instanceof Q?this.writeAll(t.batches):Ve(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,s=Z.encode(t),r=s.byteLength,o=this._writeLegacyIpcFormat?4:8,a=r+o+n&~n,l=a-r-o;return t.headerType===D.RecordBatch?this._recordBatchBlocks.push(new Yt(a,t.bodyLength,this._position)):t.headerType===D.DictionaryBatch&&this._dictionaryBlocks.push(new Yt(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),r>0&&this._write(s),this._writePadding(l)}_write(t){if(this._started){const e=F(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Z.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(xe)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:s,buffers:r}=j.assemble(t),o=new at(t.numRows,n,s),a=Z.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(r)}_writeDictionaryBatch(t,e,n=!1){const{byteLength:s,nodes:r,bufferRegions:o,buffers:a}=j.assemble(new N([t])),l=new at(t.length,r,o),u=new Ft(l,e,n),d=Z.from(u,s);return this._writeMessage(d)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,s;for(let r=-1,o=t.length;++r<o;)(e=t[r])&&(n=e.byteLength)>0&&(this._write(e),(s=(n+7&-8)-n)>0&&this._writePadding(s));return this}_writeDictionaries(t){var e,n;for(const[s,r]of t.dictionaries){const o=(e=r?.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(s),l=(n=this._dictionaryDeltaOffsets.get(s))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(const[u,d]of o.entries())this._writeDictionaryBatch(d,s,u>0);else if(l<o.length)for(const u of o.slice(l))this._writeDictionaryBatch(u,s,!0);this._seenDictionaries.set(s,r),this._dictionaryDeltaOffsets.set(s,o.length)}return this}}class Cn extends go{static writeAll(t,e){const n=new Cn(e);return Jt(t)?t.then(s=>n.writeAll(s)):we(t)?xn(n,t):kn(n,t)}}class Pn extends go{static writeAll(t){const e=new Pn;return Jt(t)?t.then(n=>e.writeAll(n)):we(t)?xn(e,t):kn(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){const e=ke.encode(new ke(t,Y.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function kn(i,t){let e=t;t instanceof Q&&(e=t.batches,i.reset(void 0,t.schema));for(const n of e)i.write(n);return i.finish()}function xn(i,t){return E(this,void 0,void 0,function*(){var e,n,s,r,o,a,l;try{for(e=!0,n=Qt(t);s=yield n.next(),r=s.done,!r;e=!0){l=s.value,e=!1;const u=l;i.write(u)}}catch(u){o={error:u}}finally{try{!e&&!r&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return i.finish()})}function Jc(i,t="stream"){return(t==="stream"?Cn:Pn).writeAll(i).toUint8Array(!0)}var Zc=Object.create,bo=Object.defineProperty,Xc=Object.getOwnPropertyDescriptor,tl=Object.getOwnPropertyNames,el=Object.getPrototypeOf,il=Object.prototype.hasOwnProperty,nl=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),sl=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of tl(t))!il.call(i,s)&&s!==e&&bo(i,s,{get:()=>t[s],enumerable:!(n=Xc(t,s))||n.enumerable});return i},rl=(i,t,e)=>(e=i!=null?Zc(el(i)):{},sl(!i||!i.__esModule?bo(e,"default",{value:i,enumerable:!0}):e,i)),ol=nl((i,t)=>{t.exports=Worker}),al=(i=>(i[i.UNDEFINED=0]="UNDEFINED",i[i.AUTOMATIC=1]="AUTOMATIC",i[i.READ_ONLY=2]="READ_ONLY",i[i.READ_WRITE=3]="READ_WRITE",i))(al||{}),cl=(i=>(i[i.IDENTIFIER=0]="IDENTIFIER",i[i.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",i[i.STRING_CONSTANT=2]="STRING_CONSTANT",i[i.OPERATOR=3]="OPERATOR",i[i.KEYWORD=4]="KEYWORD",i[i.COMMENT=5]="COMMENT",i))(cl||{}),ll=(i=>(i[i.NONE=0]="NONE",i[i.DEBUG=1]="DEBUG",i[i.INFO=2]="INFO",i[i.WARNING=3]="WARNING",i[i.ERROR=4]="ERROR",i))(ll||{}),ul=(i=>(i[i.NONE=0]="NONE",i[i.CONNECT=1]="CONNECT",i[i.DISCONNECT=2]="DISCONNECT",i[i.OPEN=3]="OPEN",i[i.QUERY=4]="QUERY",i[i.INSTANTIATE=5]="INSTANTIATE",i))(ul||{}),dl=(i=>(i[i.NONE=0]="NONE",i[i.OK=1]="OK",i[i.ERROR=2]="ERROR",i[i.START=3]="START",i[i.RUN=4]="RUN",i[i.CAPTURE=5]="CAPTURE",i))(dl||{}),hl=(i=>(i[i.NONE=0]="NONE",i[i.WEB_WORKER=1]="WEB_WORKER",i[i.NODE_WORKER=2]="NODE_WORKER",i[i.BINDINGS=3]="BINDINGS",i[i.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",i))(hl||{}),Ml=class{log(i){}},Ul=class{constructor(i=2){this.level=i}log(i){i.level>=this.level&&console.log(i)}};function Cl(i){switch(i){case 0:return"NONE";case 1:return"DEBUG";case 2:return"INFO";case 3:return"WARNING";case 4:return"ERROR";default:return"?"}}function Pl(i){switch(i){case 0:return"NONE";case 1:return"OK";case 2:return"ERROR";case 3:return"START";case 4:return"RUN";case 5:return"CAPTURE";default:return"?"}}function kl(i){switch(i){case 1:return"CONNECT";case 2:return"DISCONNECT";case 5:return"INSTANTIATE";case 3:return"OPEN";case 4:return"QUERY";default:return"?"}}function xl(i){switch(i){case 0:return"NONE";case 1:return"WEB WORKER";case 2:return"NODE WORKER";case 3:return"DUCKDB BINDINGS";case 4:return"DUCKDB";default:return"?"}}var fl=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.MAX_ARROW_ERROR=255]="MAX_ARROW_ERROR",i[i.DUCKDB_WASM_RETRY=256]="DUCKDB_WASM_RETRY",i))(fl||{});function Vl(i){return i<=255}function zl(i){return i===256}var pl=class{constructor(i,t){this._bindings=i,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(i){return i(this._bindings,this._conn)}async query(i){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:i});let t=await this._bindings.runQuery(this._conn,i),e=ht.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new Q(e)}async send(i,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:i});let e=await this._bindings.startPendingQuery(this._conn,i,t);for(;e==null;){if(this._bindings.isDetached()){console.error("cannot send a message since the worker is not set!");return}e=await this._bindings.pollPendingQuery(this._conn)}let n=new Io(this._bindings,this._conn,e),s=await ht.from(n);return console.assert(s.isAsync()),console.assert(s.isStream()),s}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(i){return await this._bindings.getTableNames(this._conn,i)}async prepare(i){let t=await this._bindings.createPrepared(this._conn,i);return new yl(this._bindings,this._conn,t)}async insertArrowTable(i,t){let e=Jc(i,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(i,t){await this._bindings.insertArrowFromIPCStream(this._conn,i,t)}async insertCSVFromPath(i,t){await this._bindings.insertCSVFromPath(this._conn,i,t)}async insertJSONFromPath(i,t){await this._bindings.insertJSONFromPath(this._conn,i,t)}},Io=class{constructor(i,t,e){this.db=i,this.conn=t,this.header=e,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let i=null;for(this._inFlight!=null&&(i=await this._inFlight,this._inFlight=null);i==null;)i=await this.db.fetchQueryResults(this.conn);return this._depleted=i.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:i}}[Symbol.asyncIterator](){return this}},yl=class{constructor(i,t,e){this.bindings=i,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...i){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,i),e=ht.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new Q(e)}async send(...i){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,i),e=new Io(this.bindings,this.connectionId,t),n=await ht.from(e);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},_l=(i=>(i.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",i.CLOSE_PREPARED="CLOSE_PREPARED",i.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",i.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",i.CONNECT="CONNECT",i.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",i.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",i.CREATE_PREPARED="CREATE_PREPARED",i.DISCONNECT="DISCONNECT",i.DROP_FILE="DROP_FILE",i.DROP_FILES="DROP_FILES",i.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",i.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",i.FLUSH_FILES="FLUSH_FILES",i.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",i.GET_TABLE_NAMES="GET_TABLE_NAMES",i.GET_VERSION="GET_VERSION",i.GLOB_FILE_INFOS="GLOB_FILE_INFOS",i.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",i.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",i.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",i.INSTANTIATE="INSTANTIATE",i.OPEN="OPEN",i.PING="PING",i.POLL_PENDING_QUERY="POLL_PENDING_QUERY",i.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",i.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",i.REGISTER_FILE_URL="REGISTER_FILE_URL",i.RESET="RESET",i.RUN_PREPARED="RUN_PREPARED",i.RUN_QUERY="RUN_QUERY",i.SEND_PREPARED="SEND_PREPARED",i.START_PENDING_QUERY="START_PENDING_QUERY",i.TOKENIZE="TOKENIZE",i))(_l||{}),ml=(i=>(i.CONNECTION_INFO="CONNECTION_INFO",i.ERROR="ERROR",i.FEATURE_FLAGS="FEATURE_FLAGS",i.FILE_BUFFER="FILE_BUFFER",i.FILE_INFOS="FILE_INFOS",i.FILE_SIZE="FILE_SIZE",i.FILE_STATISTICS="FILE_STATISTICS",i.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",i.LOG="LOG",i.PROGRESS_UPDATE="PROGRESS_UPDATE",i.OK="OK",i.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",i.QUERY_PLAN="QUERY_PLAN",i.QUERY_RESULT="QUERY_RESULT",i.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",i.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",i.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",i.REGISTERED_FILE="REGISTERED_FILE",i.SCRIPT_TOKENS="SCRIPT_TOKENS",i.SUCCESS="SUCCESS",i.TABLE_NAMES="TABLE_NAMES",i.VERSION_STRING="VERSION_STRING",i))(ml||{}),R=class{constructor(i,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=i,this.data=t,this.promise=new Promise((e,n)=>{this.promiseResolver=e,this.promiseRejecter=n})}};function si(i){switch(i.typeId){case c.Binary:return{sqlType:"binary"};case c.Bool:return{sqlType:"bool"};case c.Date:return{sqlType:"date"};case c.DateDay:return{sqlType:"date32[d]"};case c.DateMillisecond:return{sqlType:"date64[ms]"};case c.Decimal:{let t=i;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case c.Float:return{sqlType:"float"};case c.Float16:return{sqlType:"float16"};case c.Float32:return{sqlType:"float32"};case c.Float64:return{sqlType:"float64"};case c.Int:return{sqlType:"int32"};case c.Int16:return{sqlType:"int16"};case c.Int32:return{sqlType:"int32"};case c.Int64:return{sqlType:"int64"};case c.Uint16:return{sqlType:"uint16"};case c.Uint32:return{sqlType:"uint32"};case c.Uint64:return{sqlType:"uint64"};case c.Uint8:return{sqlType:"uint8"};case c.IntervalDayTime:return{sqlType:"interval[dt]"};case c.IntervalYearMonth:return{sqlType:"interval[m]"};case c.List:return{sqlType:"list",valueType:si(i.valueType)};case c.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:i.byteWidth};case c.Null:return{sqlType:"null"};case c.Utf8:return{sqlType:"utf8"};case c.Struct:return{sqlType:"struct",fields:i.children.map(t=>fn(t.name,t.type))};case c.Map:{let t=i;return{sqlType:"map",keyType:si(t.keyType),valueType:si(t.valueType)}}case c.Time:return{sqlType:"time[s]"};case c.TimeMicrosecond:return{sqlType:"time[us]"};case c.TimeMillisecond:return{sqlType:"time[ms]"};case c.TimeNanosecond:return{sqlType:"time[ns]"};case c.TimeSecond:return{sqlType:"time[s]"};case c.Timestamp:return{sqlType:"timestamp",timezone:i.timezone||void 0};case c.TimestampSecond:return{sqlType:"timestamp[s]",timezone:i.timezone||void 0};case c.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:i.timezone||void 0};case c.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:i.timezone||void 0};case c.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:i.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(i.toString()))}function fn(i,t){let e=si(t);return e.name=i,e}var gl=/'(opfs:\/\/\S*?)'/g,bl=/(opfs:\/\/\S*?)/g;function Il(i){return i.search(bl)>-1}function Sl(i){return[...i.matchAll(gl)].map(t=>t[1])}var wl=new TextEncoder,jl=class{constructor(i,t=null){this._onInstantiationProgress=[],this._onExecutionProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._config={},this._logger=i,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}get config(){return this._config}attach(i){this._worker=i,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(i,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!:"+i.type+","+i.data);return}let e=this._nextMessageId++;return this._pendingRequests.set(e,i),this._worker.postMessage({messageId:e,type:i.type,data:i.data},t),await i.promise}onMessage(i){var t;let e=i.data;switch(e.type){case"PROGRESS_UPDATE":{for(let s of this._onExecutionProgress)s(e.data);return}case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let s of this._onInstantiationProgress)s(e.data);return}}let n=this._pendingRequests.get(e.requestId);if(!n){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let s=new Error(e.data.message);s.name=e.data.name,(t=Object.getOwnPropertyDescriptor(s,"stack"))!=null&&t.writable&&(s.stack=e.data.stack),n.promiseRejecter(s);return}switch(n.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"REGISTER_OPFS_FILE_NAME":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(e.type=="OK"){n.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){n.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){n.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){n.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){n.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){n.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){n.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){n.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){n.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){n.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){n.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){n.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){n.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(e.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(i){console.error(i),console.error("error in duckdb worker: ".concat(i.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}isDetached(){return!this._worker}async reset(){let i=new R("RESET",null);return await this.postTask(i)}async ping(){let i=new R("PING",null);await this.postTask(i)}async dropFile(i){let t=new R("DROP_FILE",i);return await this.postTask(t)}async dropFiles(i){let t=new R("DROP_FILES",i);return await this.postTask(t)}async flushFiles(){let i=new R("FLUSH_FILES",null);return await this.postTask(i)}async instantiate(i,t=null,e=n=>{}){this._onInstantiationProgress.push(e);let n=new R("INSTANTIATE",[i,t]);return await this.postTask(n)}async getVersion(){let i=new R("GET_VERSION",null);return await this.postTask(i)}async getFeatureFlags(){let i=new R("GET_FEATURE_FLAGS",null);return await this.postTask(i)}async open(i){this._config=i;let t=new R("OPEN",i);await this.postTask(t)}async tokenize(i){let t=new R("TOKENIZE",i);return await this.postTask(t)}async connectInternal(){let i=new R("CONNECT",null);return await this.postTask(i)}async connect(){let i=await this.connectInternal();return new pl(this,i)}async disconnect(i){let t=new R("DISCONNECT",i);await this.postTask(t)}async runQuery(i,t){if(this.shouldOPFSFileHandling()){let e=await this.registerOPFSFileFromSQL(t);try{return await this._runQueryAsync(i,t)}finally{e.length>0&&await this.dropFiles(e)}}else return await this._runQueryAsync(i,t)}async _runQueryAsync(i,t){let e=new R("RUN_QUERY",[i,t]);return await this.postTask(e)}async startPendingQuery(i,t,e=!1){if(this.shouldOPFSFileHandling()){let n=await this.registerOPFSFileFromSQL(t);try{return await this._startPendingQueryAsync(i,t,e)}finally{n.length>0&&await this.dropFiles(n)}}else return await this._startPendingQueryAsync(i,t,e)}async _startPendingQueryAsync(i,t,e=!1){let n=new R("START_PENDING_QUERY",[i,t,e]);return await this.postTask(n)}async pollPendingQuery(i){let t=new R("POLL_PENDING_QUERY",i);return await this.postTask(t)}async cancelPendingQuery(i){let t=new R("CANCEL_PENDING_QUERY",i);return await this.postTask(t)}async fetchQueryResults(i){let t=new R("FETCH_QUERY_RESULTS",i);return await this.postTask(t)}async getTableNames(i,t){let e=new R("GET_TABLE_NAMES",[i,t]);return await this.postTask(e)}async createPrepared(i,t){let e=new R("CREATE_PREPARED",[i,t]);return await this.postTask(e)}async closePrepared(i,t){let e=new R("CLOSE_PREPARED",[i,t]);await this.postTask(e)}async runPrepared(i,t,e){let n=new R("RUN_PREPARED",[i,t,e]);return await this.postTask(n)}async sendPrepared(i,t,e){let n=new R("SEND_PREPARED",[i,t,e]);return await this.postTask(n)}async globFiles(i){let t=new R("GLOB_FILE_INFOS",i);return await this.postTask(t)}async registerFileText(i,t){let e=wl.encode(t);await this.registerFileBuffer(i,e)}async registerFileURL(i,t,e,n){t===void 0&&(t=i);let s=new R("REGISTER_FILE_URL",[i,t,e,n]);await this.postTask(s)}async registerEmptyFileBuffer(i){}async registerFileBuffer(i,t){let e=new R("REGISTER_FILE_BUFFER",[i,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(i,t,e,n){let s=new R("REGISTER_FILE_HANDLE",[i,t,e,n]);await this.postTask(s,[])}async registerOPFSFileName(i){let t=new R("REGISTER_OPFS_FILE_NAME",[i]);await this.postTask(t,[])}async collectFileStatistics(i,t){let e=new R("COLLECT_FILE_STATISTICS",[i,t]);await this.postTask(e,[])}async exportFileStatistics(i){let t=new R("EXPORT_FILE_STATISTICS",i);return await this.postTask(t,[])}async copyFileToBuffer(i){let t=new R("COPY_FILE_TO_BUFFER",i);return await this.postTask(t)}async copyFileToPath(i,t){let e=new R("COPY_FILE_TO_PATH",[i,t]);await this.postTask(e)}async insertArrowFromIPCStream(i,t,e){if(t.length==0)return;let n=new R("INSERT_ARROW_FROM_IPC_STREAM",[i,t,e]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(i,t,e){if(e.columns!==void 0){let s=[];for(let r in e.columns){let o=e.columns[r];s.push(fn(r,o))}e.columnsFlat=s,delete e.columns}let n=new R("IMPORT_CSV_FROM_PATH",[i,t,e]);await this.postTask(n)}async insertJSONFromPath(i,t,e){if(e.columns!==void 0){let s=[];for(let r in e.columns){let o=e.columns[r];s.push(fn(r,o))}e.columnsFlat=s,delete e.columns}let n=new R("IMPORT_JSON_FROM_PATH",[i,t,e]);await this.postTask(n)}shouldOPFSFileHandling(){var i,t;return Il((i=this.config.path)!=null?i:"")?((t=this.config.opfs)==null?void 0:t.fileHandling)=="auto":!1}async registerOPFSFileFromSQL(i){let t=Sl(i),e=[];for(let n of t)try{await this.registerOPFSFileName(n),e.push(n)}catch(s){throw console.error(s),new Error("File Not found:"+n)}return e}};function vl(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}vl();var El=(i=>(i[i.BUFFER=0]="BUFFER",i[i.NODE_FS=1]="NODE_FS",i[i.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",i[i.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",i[i.HTTP=4]="HTTP",i[i.S3=5]="S3",i))(El||{}),Wl=class{constructor(){this._bindings=null,this._nextMessageId=0}log(i){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:i},[])}sendOK(i){this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"OK",data:null},[])}failWith(i,t){let e={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"ERROR",data:e},[])}async onMessage(i){switch(i.type){case"PING":this.sendOK(i);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(i,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(i.data[0],i.data[1],t=>{this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"INSTANTIATE_PROGRESS",data:t},[])}),this.sendOK(i)}catch(t){console.log(t),this._bindings=null,this.failWith(i,t)}return}if(!this._bindings)return this.failWith(i,new Error("duckdb is not initialized"));try{switch(i.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(i);break;case"OPEN":{let t=i.data.path;t!=null&&t.startsWith("opfs://")&&(await this._bindings.prepareDBFileHandle(t,3),i.data.useDirectIO=!0),this._bindings.open(i.data),this.sendOK(i);break}case"DROP_FILE":this._bindings.dropFile(i.data),this.sendOK(i);break;case"DROP_FILES":this._bindings.dropFiles(i.data),this.sendOK(i);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(i);break;case"CONNECT":{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"CONNECTION_INFO",data:t.useUnsafe((e,n)=>n)},[]);break}case"DISCONNECT":this._bindings.disconnect(i.data),this.sendOK(i);break;case"CREATE_PREPARED":{let t=this._bindings.createPrepared(i.data[0],i.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"PREPARED_STATEMENT_ID",data:t},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(i.data[0],i.data[1]),this.sendOK(i);break}case"RUN_PREPARED":{let t=this._bindings.runPrepared(i.data[0],i.data[1],i.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"RUN_QUERY":{let t=this._bindings.runQuery(i.data[0],i.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"SEND_PREPARED":{let t=this._bindings.sendPrepared(i.data[0],i.data[1],i.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"QUERY_RESULT_HEADER",data:t},[t.buffer]);break}case"START_PENDING_QUERY":{let t=this._bindings.startPendingQuery(i.data[0],i.data[1],i.data[2]),e=[];t&&e.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},e);break}case"POLL_PENDING_QUERY":{let t=this._bindings.pollPendingQuery(i.data),e=[];t&&e.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},e);break}case"CANCEL_PENDING_QUERY":{let t=this._bindings.cancelPendingQuery(i.data);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"SUCCESS",data:t},[]);break}case"FETCH_QUERY_RESULTS":{let t=this._bindings.fetchQueryResults(i.data),e=t?[t.buffer]:[];this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"QUERY_RESULT_CHUNK",data:t},e);break}case"GET_TABLE_NAMES":{let t=this._bindings.getTableNames(i.data[0],i.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"TABLE_NAMES",data:t},[]);break}case"GLOB_FILE_INFOS":{let t=this._bindings.globFiles(i.data);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"FILE_INFOS",data:t},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(i.data[0],i.data[1],i.data[2],i.data[3]),this.sendOK(i);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(i.data[0],i.data[1]),this.sendOK(i);break;case"REGISTER_FILE_HANDLE":await this._bindings.registerFileHandleAsync(i.data[0],i.data[1],i.data[2],i.data[3]),this.sendOK(i);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(i.data[0],i.data[1]),this.sendOK(i);break;case"COPY_FILE_TO_BUFFER":{let t=this._bindings.copyFileToBuffer(i.data);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"FILE_BUFFER",data:t},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(i.data[0],i.data[1]),this.sendOK(i);break;case"REGISTER_OPFS_FILE_NAME":await this._bindings.registerOPFSFileName(i.data[0]),this.sendOK(i);break;case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(i.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(i.data[0],i.data[1],i.data[2]),this.sendOK(i);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(i.data[0],i.data[1],i.data[2]),this.sendOK(i);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(i.data[0],i.data[1],i.data[2]),this.sendOK(i);break}case"TOKENIZE":{let t=this._bindings.tokenize(i.data);this.postMessage({messageId:this._nextMessageId++,requestId:i.messageId,type:"SCRIPT_TOKENS",data:t},[]);break}}}catch(t){return console.log(t),this.failWith(i,t)}}},Ol=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),Tl=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),Al=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),Fl=()=>(async i=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(i)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),Vn={name:"@duckdb/duckdb-wasm",version:"1.31.0"},Bl=Vn.name,Rl=Vn.version,zn=Vn.version.split("."),Yl=zn[0],$l=zn[1],Gl=zn[2],So=()=>typeof navigator>"u",wo=()=>So()?"node":navigator.userAgent,Hl=()=>wo().includes("Firefox"),Kl=()=>/^((?!chrome|android).)*safari/i.test(wo());function ql(){let i="https://cdn.jsdelivr.net/npm/".concat(Bl,"@").concat(Rl,"/dist/");return{mvp:{mainModule:"".concat(i,"duckdb-mvp.wasm"),mainWorker:"".concat(i,"duckdb-browser-mvp.worker.js")},eh:{mainModule:"".concat(i,"duckdb-eh.wasm"),mainWorker:"".concat(i,"duckdb-browser-eh.worker.js")}}}var Ki=null,qi=null,Qi=null,Ji=null,Zi=null;async function Dl(){return Ki==null&&(Ki=typeof BigInt64Array<"u"),qi==null&&(qi=await Tl()),Qi==null&&(Qi=await Fl()),Ji==null&&(Ji=await Al()),Zi==null&&(Zi=await Ol()),{bigInt64Array:Ki,crossOriginIsolated:So()||globalThis.crossOriginIsolated||!1,wasmExceptions:qi,wasmSIMD:Ji,wasmThreads:Qi,wasmBulkMemory:Zi}}async function Ql(i){let t=await Dl();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&i.coi)return{mainModule:i.coi.mainModule,mainWorker:i.coi.mainWorker,pthreadWorker:i.coi.pthreadWorker};if(i.eh)return{mainModule:i.eh.mainModule,mainWorker:i.eh.mainWorker,pthreadWorker:null}}return{mainModule:i.mvp.mainModule,mainWorker:i.mvp.mainWorker,pthreadWorker:null}}var Nl=rl(ol());async function Jl(i){let t=new Request(i),e=await fetch(t),n=URL.createObjectURL(await e.blob());return new Nl.default(n)}export{jl as AsyncDuckDB,pl as AsyncDuckDBConnection,Wl as AsyncDuckDBDispatcher,yl as AsyncPreparedStatement,Io as AsyncResultStreamIterator,Ul as ConsoleLogger,al as DuckDBAccessMode,El as DuckDBDataProtocol,Vl as IsArrowBuffer,zl as IsDuckDBWasmRetry,dl as LogEvent,ll as LogLevel,hl as LogOrigin,ul as LogTopic,Bl as PACKAGE_NAME,Rl as PACKAGE_VERSION,Yl as PACKAGE_VERSION_MAJOR,$l as PACKAGE_VERSION_MINOR,Gl as PACKAGE_VERSION_PATCH,fl as StatusCode,cl as TokenType,Ml as VoidLogger,_l as WorkerRequestType,ml as WorkerResponseType,R as WorkerTask,Jl as createWorker,ql as getJsDelivrBundles,Pl as getLogEventLabel,Cl as getLogLevelLabel,xl as getLogOriginLabel,kl as getLogTopicLabel,Dl as getPlatformFeatures,Hl as isFirefox,So as isNode,Kl as isSafari,Ql as selectBundle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}]},o={defaultToken:"",tokenPostfix:".ecl",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],pounds:["append","break","declare","demangle","end","for","getdatatype","if","inmodule","loop","mangle","onwarning","option","set","stored","uniquename"].join("|"),keywords:["__compressed__","after","all","and","any","as","atmost","before","beginc","best","between","case","cluster","compressed","compression","const","counter","csv","default","descend","embed","encoding","encrypt","end","endc","endembed","endmacro","enum","escape","except","exclusive","expire","export","extend","fail","few","fileposition","first","flat","forward","from","full","function","functionmacro","group","grouped","heading","hole","ifblock","import","in","inner","interface","internal","joined","keep","keyed","last","left","limit","linkcounted","literal","little_endian","load","local","locale","lookup","lzw","macro","many","maxcount","maxlength","min skew","module","mofn","multiple","named","namespace","nocase","noroot","noscan","nosort","not","noxpath","of","onfail","only","opt","or","outer","overwrite","packed","partition","penalty","physicallength","pipe","prefetch","quote","record","repeat","retry","return","right","right1","right2","rows","rowset","scan","scope","self","separator","service","shared","skew","skip","smart","soapaction","sql","stable","store","terminator","thor","threshold","timelimit","timeout","token","transform","trim","type","unicodeorder","unordered","unsorted","unstable","update","use","validate","virtual","whole","width","wild","within","wnotrim","xml","xpath"],functions:["abs","acos","aggregate","allnodes","apply","ascii","asin","assert","asstring","atan","atan2","ave","build","buildindex","case","catch","choose","choosen","choosesets","clustersize","combine","correlation","cos","cosh","count","covariance","cron","dataset","dedup","define","denormalize","dictionary","distribute","distributed","distribution","ebcdic","enth","error","evaluate","event","eventextra","eventname","exists","exp","fail","failcode","failmessage","fetch","fromunicode","fromxml","getenv","getisvalid","global","graph","group","hash","hash32","hash64","hashcrc","hashmd5","having","httpcall","httpheader","if","iff","index","intformat","isvalid","iterate","join","keydiff","keypatch","keyunicode","length","library","limit","ln","loadxml","local","log","loop","map","matched","matchlength","matchposition","matchtext","matchunicode","max","merge","mergejoin","min","nofold","nolocal","nonempty","normalize","nothor","notify","output","parallel","parse","pipe","power","preload","process","project","pull","random","range","rank","ranked","realformat","recordof","regexfind","regexreplace","regroup","rejected","rollup","round","roundup","row","rowdiff","sample","sequential","set","sin","sinh","sizeof","soapcall","sort","sorted","sqrt","stepped","stored","sum","table","tan","tanh","thisnode","topn","tounicode","toxml","transfer","transform","trim","truncate","typeof","ungroup","unicodeorder","variance","wait","which","workunit","xmldecode","xmlencode","xmltext","xmlunicode"],typesint:["integer","unsigned"].join("|"),typesnum:["data","qstring","string","unicode","utf8","varstring","varunicode"],typesone:["ascii","big_endian","boolean","data","decimal","ebcdic","grouped","integer","linkcounted","pattern","qstring","real","record","rule","set of","streamed","string","token","udecimal","unicode","unsigned","utf8","varstring","varunicode"].join("|"),operators:["+","-","/",":=","<","<>","=",">","\\","and","in","not","or"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/@typesint[4|8]/,"type"],[/#(@pounds)/,"type"],[/@typesone/,"type"],[/[a-zA-Z_$][\w-$]*/,{cases:{"@functions":"keyword.function","@keywords":"keyword","@operators":"operator"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]]}};export{e as conf,o as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],autoClosingPairs:[{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["comment"]},{open:'"""',close:'"""'},{open:"`",close:"`",notIn:["string","comment"]},{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"<<",close:">>"}],indentationRules:{increaseIndentPattern:/^\s*(after|else|catch|rescue|fn|[^#]*(do|<\-|\->|\{|\[|\=))\s*$/,decreaseIndentPattern:/^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b)/}},t={defaultToken:"source",tokenPostfix:".elixir",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"<<",close:">>",token:"delimiter.angle.special"}],declarationKeywords:["def","defp","defn","defnp","defguard","defguardp","defmacro","defmacrop","defdelegate","defcallback","defmacrocallback","defmodule","defprotocol","defexception","defimpl","defstruct"],operatorKeywords:["and","in","not","or","when"],namespaceKeywords:["alias","import","require","use"],otherKeywords:["after","case","catch","cond","do","else","end","fn","for","if","quote","raise","receive","rescue","super","throw","try","unless","unquote_splicing","unquote","with"],constants:["true","false","nil"],nameBuiltin:["__MODULE__","__DIR__","__ENV__","__CALLER__","__STACKTRACE__"],operator:/-[->]?|!={0,2}|\*{1,2}|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,variableName:/[a-z_][a-zA-Z0-9_]*[?!]?/,atomName:/[a-zA-Z_][a-zA-Z0-9_@]*[?!]?|@specialAtomName|@operator/,specialAtomName:/\.\.\.|<<>>|%\{\}|%|\{\}/,aliasPart:/[A-Z][a-zA-Z0-9_]*/,moduleName:/@aliasPart(?:\.@aliasPart)*/,sigilSymmetricDelimiter:/"""|'''|"|'|\/|\|/,sigilStartDelimiter:/@sigilSymmetricDelimiter|<|\{|\[|\(/,sigilEndDelimiter:/@sigilSymmetricDelimiter|>|\}|\]|\)/,sigilModifiers:/[a-zA-Z0-9]*/,decimal:/\d(?:_?\d)*/,hex:/[0-9a-fA-F](_?[0-9a-fA-F])*/,octal:/[0-7](_?[0-7])*/,binary:/[01](_?[01])*/,escape:/\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}|\\./,tokenizer:{root:[{include:"@whitespace"},{include:"@comments"},{include:"@keywordsShorthand"},{include:"@numbers"},{include:"@identifiers"},{include:"@strings"},{include:"@atoms"},{include:"@sigils"},{include:"@attributes"},{include:"@symbols"}],whitespace:[[/\s+/,"white"]],comments:[[/(#)(.*)/,["comment.punctuation","comment"]]],keywordsShorthand:[[/(@atomName)(:)(\s+)/,["constant","constant.punctuation","white"]],[/"(?=([^"]|#\{.*?\}|\\")*":)/,{token:"constant.delimiter",next:"@doubleQuotedStringKeyword"}],[/'(?=([^']|#\{.*?\}|\\')*':)/,{token:"constant.delimiter",next:"@singleQuotedStringKeyword"}]],doubleQuotedStringKeyword:[[/":/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringKeyword:[[/':/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],numbers:[[/0b@binary/,"number.binary"],[/0o@octal/,"number.octal"],[/0x@hex/,"number.hex"],[/@decimal\.@decimal([eE]-?@decimal)?/,"number.float"],[/@decimal/,"number"]],identifiers:[[/\b(defp?|defnp?|defmacrop?|defguardp?|defdelegate)(\s+)(@variableName)(?!\s+@operator)/,["keyword.declaration","white",{cases:{unquote:"keyword","@default":"function"}}]],[/(@variableName)(?=\s*\.?\s*\()/,{cases:{"@declarationKeywords":"keyword.declaration","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@default":"function.call"}}],[/(@moduleName)(\s*)(\.)(\s*)(@variableName)/,["type.identifier","white","operator","white","function.call"]],[/(:)(@atomName)(\s*)(\.)(\s*)(@variableName)/,["constant.punctuation","constant","white","operator","white","function.call"]],[/(\|>)(\s*)(@variableName)/,["operator","white",{cases:{"@otherKeywords":"keyword","@default":"function.call"}}]],[/(&)(\s*)(@variableName)/,["operator","white","function.call"]],[/@variableName/,{cases:{"@declarationKeywords":"keyword.declaration","@operatorKeywords":"keyword.operator","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@constants":"constant.language","@nameBuiltin":"variable.language","_.*":"comment.unused","@default":"identifier"}}],[/@moduleName/,"type.identifier"]],strings:[[/"""/,{token:"string.delimiter",next:"@doubleQuotedHeredoc"}],[/'''/,{token:"string.delimiter",next:"@singleQuotedHeredoc"}],[/"/,{token:"string.delimiter",next:"@doubleQuotedString"}],[/'/,{token:"string.delimiter",next:"@singleQuotedString"}]],doubleQuotedHeredoc:[[/"""/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedHeredoc:[[/'''/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],doubleQuotedString:[[/"/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedString:[[/'/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],atoms:[[/(:)(@atomName)/,["constant.punctuation","constant"]],[/:"/,{token:"constant.delimiter",next:"@doubleQuotedStringAtom"}],[/:'/,{token:"constant.delimiter",next:"@singleQuotedStringAtom"}]],doubleQuotedStringAtom:[[/"/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringAtom:[[/'/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],sigils:[[/~[a-z]@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.interpol"}],[/~([A-Z]+)@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.noInterpol"}]],sigil:[[/~([a-z]|[A-Z]+)\{/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.{.}"}],[/~([a-z]|[A-Z]+)\[/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.[.]"}],[/~([a-z]|[A-Z]+)\(/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.(.)"}],[/~([a-z]|[A-Z]+)\</,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.<.>"}],[/~([a-z]|[A-Z]+)(@sigilSymmetricDelimiter)/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.$2.$2"}]],"sigilStart.interpol.s":[[/~s@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.s":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContentInterpol"}],"sigilStart.noInterpol.S":[[/~S@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.S":[[/(^|[^\\])\\@sigilEndDelimiter/,"string"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContent"}],"sigilStart.interpol.r":[[/~r@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.r":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContentInterpol"}],"sigilStart.noInterpol.R":[[/~R@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.R":[[/(^|[^\\])\\@sigilEndDelimiter/,"regexp"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContent"}],"sigilStart.interpol":[[/~([a-z]|[A-Z]+)@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContentInterpol"}],"sigilStart.noInterpol":[[/~([a-z]|[A-Z]+)@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol":[[/(^|[^\\])\\@sigilEndDelimiter/,"sigil"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContent"}],attributes:[[/\@(module|type)?doc (~[sS])?"""/,{token:"comment.block.documentation",next:"@doubleQuotedHeredocDocstring"}],[/\@(module|type)?doc (~[sS])?'''/,{token:"comment.block.documentation",next:"@singleQuotedHeredocDocstring"}],[/\@(module|type)?doc (~[sS])?"/,{token:"comment.block.documentation",next:"@doubleQuotedStringDocstring"}],[/\@(module|type)?doc (~[sS])?'/,{token:"comment.block.documentation",next:"@singleQuotedStringDocstring"}],[/\@(module|type)?doc false/,"comment.block.documentation"],[/\@(@variableName)/,"variable"]],doubleQuotedHeredocDocstring:[[/"""/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],singleQuotedHeredocDocstring:[[/'''/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],doubleQuotedStringDocstring:[[/"/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],singleQuotedStringDocstring:[[/'/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],symbols:[[/\?(\\.|[^\\\s])/,"number.constant"],[/&\d+/,"operator"],[/<<<|>>>/,"operator"],[/[()\[\]\{\}]|<<|>>/,"@brackets"],[/\.\.\./,"identifier"],[/=>/,"punctuation"],[/@operator/,"operator"],[/[:;,.%]/,"punctuation"]],stringContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringContent"}],stringContent:[[/./,"string"]],stringConstantContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringConstantContent"}],stringConstantContent:[[/./,"constant"]],regexpContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@regexpContent"}],regexpContent:[[/(\s)(#)(\s.*)$/,["white","comment.punctuation","comment"]],[/./,"regexp"]],sigilContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@sigilContent"}],sigilContent:[[/./,"sigil"]],docstringContent:[[/./,"comment.block.documentation"]],escapeChar:[[/@escape/,"constant.character.escape"]],interpolation:[[/#{/,{token:"delimiter.bracket.embed",next:"@interpolationContinue"}]],interpolationContinue:[[/}/,{token:"delimiter.bracket.embed",next:"@pop"}],{include:"@root"}]}};export{e as conf,t as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:"(",close:")",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}]},o={defaultToken:"",tokenPostfix:".flow",keywords:["import","require","export","forbid","native","if","else","cast","unsafe","switch","default"],types:["io","mutable","bool","int","double","string","flow","void","ref","true","false","with"],operators:["=",">","<","<=",">=","==","!","!=",":=","::=","&&","||","+","-","*","/","@","&","%",":","->","\\","$","??","^"],symbols:/[@$=><!~?:&|+\-*\\\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/[a-zA-Z_]\w*/,{cases:{"@keywords":"keyword","@types":"type","@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"delimiter"],[/[<>](?!@symbols)/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}};export{e as conf,o as language};
|