@loaders.gl/las
Version:
Framework-independent loader for the LAS and LAZ formats
7 lines • 453 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if (typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if (typeof define === 'function' && define.amd) define([], factory);
else if (typeof exports === 'object') exports['loaders'] = factory();
else root['loaders'] = factory();})(globalThis, function () {
"use strict";var __exports__=(()=>{var $5=Object.create;var Zu=Object.defineProperty;var q5=Object.getOwnPropertyDescriptor;var K5=Object.getOwnPropertyNames;var tS=Object.getPrototypeOf,eS=Object.prototype.hasOwnProperty;var wa=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),Pn=(o,e)=>{for(var s in e)Zu(o,s,{get:e[s],enumerable:!0})},Du=(o,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of K5(e))!eS.call(o,d)&&d!==s&&Zu(o,d,{get:()=>e[d],enumerable:!(l=q5(e,d))||l.enumerable});return o},Wu=(o,e,s)=>(Du(o,e,"default"),s&&Du(s,e,"default")),rS=(o,e,s)=>(s=o!=null?$5(tS(o)):{},Du(e||!o||!o.__esModule?Zu(s,"default",{value:o,enumerable:!0}):s,o)),nS=o=>Du(Zu({},"__esModule",{value:!0}),o);var Dd=wa((qR,Od)=>{Od.exports=globalThis.loaders});var xf=wa(()=>{});var Cp=wa(()=>{});var tu={};Pn(tu,{LASArrowLoader:()=>jp,LASFormat:()=>Eu,LASLoader:()=>Ns,LASWorkerLoader:()=>j0,LAZPerfLoader:()=>Ns,LAZRsLoader:()=>nm});Wu(tu,rS(Dd(),1));var Eu={name:"LAS",id:"las",module:"las",extensions:["las","laz"],mimeTypes:["application/octet-stream"],text:!1,binary:!0,tests:["LASF"]};var iS="4.4.2",j0={...Eu,dataType:null,batchType:null,version:iS,worker:!0,options:{las:{shape:"mesh",fp64:!1,skip:1,colorDepth:8}}};function sS(o,e="float32"){return o instanceof Date?"date-millisecond":o instanceof Number?e:typeof o=="string"?"utf8":(o===null||o==="undefined","null")}function Zd(o){let e=_a(o);return e!=="null"?{type:e,nullable:!1}:o.length>0?(e=sS(o[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function _a(o){switch(o.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Ed(o,e){var s={};for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&e.indexOf(l)<0&&(s[l]=o[l]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,l=Object.getOwnPropertySymbols(o);d<l.length;d++)e.indexOf(l[d])<0&&Object.prototype.propertyIsEnumerable.call(o,l[d])&&(s[l[d]]=o[l[d]]);return s}function Q(o,e,s,l){function d(p){return p instanceof s?p:new s(function(w){w(p)})}return new(s||(s=Promise))(function(p,w){function F(V){try{U(l.next(V))}catch(X){w(X)}}function I(V){try{U(l.throw(V))}catch(X){w(X)}}function U(V){V.done?p(V.value):d(V.value).then(F,I)}U((l=l.apply(o,e||[])).next())})}function Wd(o){var e=typeof Symbol=="function"&&Symbol.iterator,s=e&&o[e],l=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&l>=o.length&&(o=void 0),{value:o&&o[l++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yt(o){return this instanceof yt?(this.v=o,this):new yt(o)}function Fr(o,e,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=s.apply(o,e||[]),d,p=[];return d=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),F("next"),F("throw"),F("return",w),d[Symbol.asyncIterator]=function(){return this},d;function w(it){return function(Vt){return Promise.resolve(Vt).then(it,X)}}function F(it,Vt){l[it]&&(d[it]=function(ke){return new Promise(function(Pr,Oe){p.push([it,ke,Pr,Oe])>1||I(it,ke)})},Vt&&(d[it]=Vt(d[it])))}function I(it,Vt){try{U(l[it](Vt))}catch(ke){q(p[0][3],ke)}}function U(it){it.value instanceof yt?Promise.resolve(it.value.v).then(V,X):q(p[0][2],it)}function V(it){I("next",it)}function X(it){I("throw",it)}function q(it,Vt){it(Vt),p.shift(),p.length&&I(p[0][0],p[0][1])}}function Y0(o){var e,s;return e={},l("next"),l("throw",function(d){throw d}),l("return"),e[Symbol.iterator]=function(){return this},e;function l(d,p){e[d]=o[d]?function(w){return(s=!s)?{value:yt(o[d](w)),done:!1}:p?p(w):w}:p}}function qr(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],s;return e?e.call(o):(o=typeof Wd=="function"?Wd(o):o[Symbol.iterator](),s={},l("next"),l("throw"),l("return"),s[Symbol.asyncIterator]=function(){return this},s);function l(p){s[p]=o[p]&&function(w){return new Promise(function(F,I){w=o[p](w),d(F,I,w.done,w.value)})}}function d(p,w,F,I){Promise.resolve(I).then(function(U){p({value:U,done:F})},w)}}var ba={};Pn(ba,{compareArrayLike:()=>Sa,joinUint8Arrays:()=>Br,memcpy:()=>fo,rebaseValueOffsets:()=>Ju,toArrayBufferView:()=>wt,toArrayBufferViewAsyncIterator:()=>en,toArrayBufferViewIterator:()=>Fn,toBigInt64Array:()=>Yu,toBigUint64Array:()=>dS,toFloat32Array:()=>AS,toFloat32ArrayAsyncIterator:()=>VS,toFloat32ArrayIterator:()=>FS,toFloat64Array:()=>pS,toFloat64ArrayAsyncIterator:()=>xS,toFloat64ArrayIterator:()=>BS,toInt16Array:()=>aS,toInt16ArrayAsyncIterator:()=>bS,toInt16ArrayIterator:()=>gS,toInt32Array:()=>Yi,toInt32ArrayAsyncIterator:()=>TS,toInt32ArrayIterator:()=>wS,toInt8Array:()=>lS,toInt8ArrayAsyncIterator:()=>SS,toInt8ArrayIterator:()=>yS,toUint16Array:()=>fS,toUint16ArrayAsyncIterator:()=>RS,toUint16ArrayIterator:()=>_S,toUint32Array:()=>hS,toUint32ArrayAsyncIterator:()=>US,toUint32ArrayIterator:()=>vS,toUint8Array:()=>ut,toUint8ArrayAsyncIterator:()=>Ia,toUint8ArrayIterator:()=>Ba,toUint8ClampedArray:()=>mS,toUint8ClampedArrayAsyncIterator:()=>MS,toUint8ClampedArrayIterator:()=>IS});var zd=new TextDecoder("utf-8"),lo=zd.decode.bind(zd),oS=new TextEncoder,vn=o=>oS.encode(o);var uS=o=>typeof o=="number",Xd=o=>typeof o=="boolean",we=o=>typeof o=="function",Je=o=>o!=null&&Object(o)===o,Kr=o=>Je(o)&&we(o.then);var tn=o=>Je(o)&&we(o[Symbol.iterator]),Wr=o=>Je(o)&&we(o[Symbol.asyncIterator]),zu=o=>Je(o)&&Je(o.schema);var Xu=o=>Je(o)&&"done"in o&&"value"in o;var Cu=o=>Je(o)&&we(o.stat)&&uS(o.fd);var Gu=o=>Je(o)&&ao(o.body),Lu=o=>"_getDOMStream"in o&&"_getNodeStream"in o,Cd=o=>Je(o)&&we(o.abort)&&we(o.getWriter)&&!Lu(o),ao=o=>Je(o)&&we(o.cancel)&&we(o.getReader)&&!Lu(o),Gd=o=>Je(o)&&we(o.end)&&we(o.write)&&Xd(o.writable)&&!Lu(o),ju=o=>Je(o)&&we(o.read)&&we(o.pipe)&&Xd(o.readable)&&!Lu(o),Ld=o=>Je(o)&&we(o.clear)&&we(o.bytes)&&we(o.position)&&we(o.setPosition)&&we(o.capacity)&&we(o.getBufferIdentifier)&&we(o.createLong);var Fa=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function cS(o){let e=o[0]?[o[0]]:[],s,l,d,p;for(let w,F,I=0,U=0,V=o.length;++I<V;){if(w=e[U],F=o[I],!w||!F||w.buffer!==F.buffer||F.byteOffset<w.byteOffset){F&&(e[++U]=F);continue}if({byteOffset:s,byteLength:d}=w,{byteOffset:l,byteLength:p}=F,s+d<l||l+p<s){F&&(e[++U]=F);continue}e[U]=new Uint8Array(w.buffer,s,l-s+p)}return e}function fo(o,e,s=0,l=e.byteLength){let d=o.byteLength,p=new Uint8Array(o.buffer,o.byteOffset,d),w=new Uint8Array(e.buffer,e.byteOffset,Math.min(l,d));return p.set(w,s),o}function Br(o,e){let s=cS(o),l=s.reduce((V,X)=>V+X.byteLength,0),d,p,w,F=0,I=-1,U=Math.min(e||Number.POSITIVE_INFINITY,l);for(let V=s.length;++I<V;){if(d=s[I],p=d.subarray(0,Math.min(d.length,U-F)),U<=F+p.length){p.length<d.length?s[I]=d.subarray(p.length):p.length===d.length&&I++,w?fo(w,p,F):w=p;break}fo(w||(w=new Uint8Array(U)),p,F),F+=p.length}return[w||new Uint8Array(0),s.slice(I),l-(w?w.byteLength:0)]}function wt(o,e){let s=Xu(e)?e.value:e;return s instanceof o?o===Uint8Array?new o(s.buffer,s.byteOffset,s.byteLength):s:s?(typeof s=="string"&&(s=vn(s)),s instanceof ArrayBuffer?new o(s):s instanceof Fa?new o(s):Ld(s)?wt(o,s.bytes()):ArrayBuffer.isView(s)?s.byteLength<=0?new o(0):new o(s.buffer,s.byteOffset,s.byteLength/o.BYTES_PER_ELEMENT):o.from(s)):new o(0)}var lS=o=>wt(Int8Array,o),aS=o=>wt(Int16Array,o),Yi=o=>wt(Int32Array,o),Yu=o=>wt(BigInt64Array,o),ut=o=>wt(Uint8Array,o),fS=o=>wt(Uint16Array,o),hS=o=>wt(Uint32Array,o),dS=o=>wt(BigUint64Array,o),AS=o=>wt(Float32Array,o),pS=o=>wt(Float64Array,o),mS=o=>wt(Uint8ClampedArray,o),va=o=>(o.next(),o);function*Fn(o,e){let s=function*(d){yield d},l=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Fa?s(e):tn(e)?e:s(e);return yield*va(function*(d){let p=null;do p=d.next(yield wt(o,p));while(!p.done)}(l[Symbol.iterator]())),new o}var yS=o=>Fn(Int8Array,o),gS=o=>Fn(Int16Array,o),wS=o=>Fn(Int32Array,o),Ba=o=>Fn(Uint8Array,o),_S=o=>Fn(Uint16Array,o),vS=o=>Fn(Uint32Array,o),FS=o=>Fn(Float32Array,o),BS=o=>Fn(Float64Array,o),IS=o=>Fn(Uint8ClampedArray,o);function en(o,e){return Fr(this,arguments,function*(){if(Kr(e))return yield yt(yield yt(yield*Y0(qr(en(o,yield yt(e))))));let l=function(w){return Fr(this,arguments,function*(){yield yield yt(yield yt(w))})},d=function(w){return Fr(this,arguments,function*(){yield yt(yield*Y0(qr(va(function*(F){let I=null;do I=F.next(yield I?.value);while(!I.done)}(w[Symbol.iterator]())))))})},p=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Fa?l(e):tn(e)?d(e):Wr(e)?e:l(e);return yield yt(yield*Y0(qr(va(function(w){return Fr(this,arguments,function*(){let F=null;do F=yield yt(w.next(yield yield yt(wt(o,F))));while(!F.done)})}(p[Symbol.asyncIterator]()))))),yield yt(new o)})}var SS=o=>en(Int8Array,o),bS=o=>en(Int16Array,o),TS=o=>en(Int32Array,o),Ia=o=>en(Uint8Array,o),RS=o=>en(Uint16Array,o),US=o=>en(Uint32Array,o),VS=o=>en(Float32Array,o),xS=o=>en(Float64Array,o),MS=o=>en(Uint8ClampedArray,o);function Ju(o,e,s){if(o!==0){s=s.slice(0,e);for(let l=-1,d=s.length;++l<d;)s[l]+=o}return s.subarray(0,e)}function Sa(o,e){let s=0,l=o.length;if(l!==e.length)return!1;if(l>0)do if(o[s]!==e[s])return!1;while(++s<l);return!0}var xe={fromIterable(o){return Pu(NS(o))},fromAsyncIterable(o){return Pu(kS(o))},fromDOMStream(o){return Pu(OS(o))},fromNodeStream(o){return Pu(DS(o))},toDOMStream(o,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(o,e){throw new Error('"toNodeStream" not available in this environment')}},Pu=o=>(o.next(),o);function*NS(o){let e,s=!1,l=[],d,p,w,F=0;function I(){return p==="peek"?Br(l,w)[0]:([d,l,F]=Br(l,w),d)}({cmd:p,size:w}=(yield(()=>null)())||{cmd:"read",size:0});let U=Ba(o)[Symbol.iterator]();try{do if({done:e,value:d}=Number.isNaN(w-F)?U.next():U.next(w-F),!e&&d.byteLength>0&&(l.push(d),F+=d.byteLength),e||w<=F)do({cmd:p,size:w}=yield I());while(w<F);while(!e)}catch(V){s=!0,typeof U.throw=="function"&&U.throw(V)}finally{s===!1&&typeof U.return=="function"&&U.return(null)}return null}function kS(o){return Fr(this,arguments,function*(){let s,l=!1,d=[],p,w,F,I=0;function U(){return w==="peek"?Br(d,F)[0]:([p,d,I]=Br(d,F),p)}({cmd:w,size:F}=(yield yield yt((()=>null)()))||{cmd:"read",size:0});let V=Ia(o)[Symbol.asyncIterator]();try{do if({done:s,value:p}=Number.isNaN(F-I)?yield yt(V.next()):yield yt(V.next(F-I)),!s&&p.byteLength>0&&(d.push(p),I+=p.byteLength),s||F<=I)do({cmd:w,size:F}=yield yield yt(U()));while(F<I);while(!s)}catch(X){l=!0,typeof V.throw=="function"&&(yield yt(V.throw(X)))}finally{l===!1&&typeof V.return=="function"&&(yield yt(V.return(new Uint8Array(0))))}return yield yt(null)})}function OS(o){return Fr(this,arguments,function*(){let s=!1,l=!1,d=[],p,w,F,I=0;function U(){return w==="peek"?Br(d,F)[0]:([p,d,I]=Br(d,F),p)}({cmd:w,size:F}=(yield yield yt((()=>null)()))||{cmd:"read",size:0});let V=new Ra(o);try{do if({done:s,value:p}=Number.isNaN(F-I)?yield yt(V.read()):yield yt(V.read(F-I)),!s&&p.byteLength>0&&(d.push(ut(p)),I+=p.byteLength),s||F<=I)do({cmd:w,size:F}=yield yield yt(U()));while(F<I);while(!s)}catch(X){l=!0,yield yt(V.cancel(X))}finally{l===!1?yield yt(V.cancel()):o.locked&&V.releaseLock()}return yield yt(null)})}var Ra=class{constructor(e){this.source=e,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(e){return Q(this,void 0,void 0,function*(){let{reader:s,source:l}=this;s&&(yield s.cancel(e).catch(()=>{})),l&&l.locked&&this.releaseLock()})}read(e){return Q(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let s=yield this.reader.read();return!s.done&&(s.value=ut(s)),s})}},Ta=(o,e)=>{let s=d=>l([e,d]),l;return[e,s,new Promise(d=>(l=d)&&o.once(e,s))]};function DS(o){return Fr(this,arguments,function*(){let s=[],l="error",d=!1,p=null,w,F,I=0,U=[],V;function X(){return w==="peek"?Br(U,F)[0]:([V,U,I]=Br(U,F),V)}if({cmd:w,size:F}=(yield yield yt((()=>null)()))||{cmd:"read",size:0},o.isTTY)return yield yield yt(new Uint8Array(0)),yield yt(null);try{s[0]=Ta(o,"end"),s[1]=Ta(o,"error");do{if(s[2]=Ta(o,"readable"),[l,p]=yield yt(Promise.race(s.map(it=>it[2]))),l==="error")break;if((d=l==="end")||(Number.isFinite(F-I)?(V=ut(o.read(F-I)),V.byteLength<F-I&&(V=ut(o.read()))):V=ut(o.read()),V.byteLength>0&&(U.push(V),I+=V.byteLength)),d||F<=I)do({cmd:w,size:F}=yield yield yt(X()));while(F<I)}while(!d)}finally{yield yt(q(s,l==="error"?p:null))}return yield yt(null);function q(it,Vt){return V=U=null,new Promise((ke,Pr)=>{for(let[Oe,Ii]of it)o.off(Oe,Ii);try{let Oe=o.destroy;Oe&&Oe.call(o,Vt),Vt=void 0}catch(Oe){Vt=Oe||Vt}finally{Vt!=null?Pr(Vt):ke()}})}})}var Wt;(function(o){o[o.V1=0]="V1",o[o.V2=1]="V2",o[o.V3=2]="V3",o[o.V4=3]="V4",o[o.V5=4]="V5"})(Wt||(Wt={}));var Lt;(function(o){o[o.Sparse=0]="Sparse",o[o.Dense=1]="Dense"})(Lt||(Lt={}));var zt;(function(o){o[o.HALF=0]="HALF",o[o.SINGLE=1]="SINGLE",o[o.DOUBLE=2]="DOUBLE"})(zt||(zt={}));var Kt;(function(o){o[o.DAY=0]="DAY",o[o.MILLISECOND=1]="MILLISECOND"})(Kt||(Kt={}));var H;(function(o){o[o.SECOND=0]="SECOND",o[o.MILLISECOND=1]="MILLISECOND",o[o.MICROSECOND=2]="MICROSECOND",o[o.NANOSECOND=3]="NANOSECOND"})(H||(H={}));var Xt;(function(o){o[o.YEAR_MONTH=0]="YEAR_MONTH",o[o.DAY_TIME=1]="DAY_TIME",o[o.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Xt||(Xt={}));var Bn=new Int32Array(2),Hu=new Float32Array(Bn.buffer),Qu=new Float64Array(Bn.buffer),J0=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var ho;(function(o){o[o.UTF8_BYTES=1]="UTF8_BYTES",o[o.UTF16_STRING=2]="UTF16_STRING"})(ho||(ho={}));var _e=class{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new _e(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Bn[0]=this.readInt32(e),Hu[0]}readFloat64(e){return Bn[J0?0:1]=this.readInt32(e),Bn[J0?1:0]=this.readInt32(e+4),Qu[0]}writeInt8(e,s){this.bytes_[e]=s}writeUint8(e,s){this.bytes_[e]=s}writeInt16(e,s){this.bytes_[e]=s,this.bytes_[e+1]=s>>8}writeUint16(e,s){this.bytes_[e]=s,this.bytes_[e+1]=s>>8}writeInt32(e,s){this.bytes_[e]=s,this.bytes_[e+1]=s>>8,this.bytes_[e+2]=s>>16,this.bytes_[e+3]=s>>24}writeUint32(e,s){this.bytes_[e]=s,this.bytes_[e+1]=s>>8,this.bytes_[e+2]=s>>16,this.bytes_[e+3]=s>>24}writeInt64(e,s){this.writeInt32(e,Number(BigInt.asIntN(32,s))),this.writeInt32(e+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(e,s){this.writeUint32(e,Number(BigInt.asUintN(32,s))),this.writeUint32(e+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(e,s){Hu[0]=s,this.writeInt32(e,Bn[0])}writeFloat64(e,s){Qu[0]=s,this.writeInt32(e,Bn[J0?0:1]),this.writeInt32(e+4,Bn[J0?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let s=0;s<4;s++)e+=String.fromCharCode(this.readInt8(this.position_+4+s));return e}__offset(e,s){let l=e-this.readInt32(e);return s<this.readInt16(l)?this.readInt16(l+s):0}__union(e,s){return e.bb_pos=s+this.readInt32(s),e.bb=this,e}__string(e,s){e+=this.readInt32(e);let l=this.readInt32(e);e+=4;let d=this.bytes_.subarray(e,e+l);return s===ho.UTF8_BYTES?d:this.text_decoder_.decode(d)}__union_with_string(e,s){return typeof e=="string"?this.__string(s):this.__union(e,s)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let s=0;s<4;s++)if(e.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(e,s){let l=[];for(let d=0;d<s;++d){let p=e(d);p!==null&&l.push(p)}return l}createObjList(e,s){let l=[];for(let d=0;d<s;++d){let p=e(d);p!==null&&l.push(p.unpack())}return l}};var Hn=class{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;e?s=e:s=1024,this.bb=_e.allocate(s),this.space=s}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(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,s){e>this.minalign&&(this.minalign=e);let l=~(this.bb.capacity()-this.space+s)+1&e-1;for(;this.space<l+e+s;){let d=this.bb.capacity();this.bb=Hn.growByteBuffer(this.bb),this.space+=this.bb.capacity()-d}this.pad(l)}pad(e){for(let s=0;s<e;s++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,s,l){(this.force_defaults||s!=l)&&(this.addInt8(s),this.slot(e))}addFieldInt16(e,s,l){(this.force_defaults||s!=l)&&(this.addInt16(s),this.slot(e))}addFieldInt32(e,s,l){(this.force_defaults||s!=l)&&(this.addInt32(s),this.slot(e))}addFieldInt64(e,s,l){(this.force_defaults||s!==l)&&(this.addInt64(s),this.slot(e))}addFieldFloat32(e,s,l){(this.force_defaults||s!=l)&&(this.addFloat32(s),this.slot(e))}addFieldFloat64(e,s,l){(this.force_defaults||s!=l)&&(this.addFloat64(s),this.slot(e))}addFieldOffset(e,s,l){(this.force_defaults||s!=l)&&(this.addOffset(s),this.slot(e))}addFieldStruct(e,s,l){s!=l&&(this.nested(s),this.slot(e))}nested(e){if(e!=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(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let s=e.capacity();if(s&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let l=s<<1,d=_e.allocate(l);return d.setPosition(l-s),d.bytes().set(e.bytes(),l-s),d}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let s=0;s<e;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let l=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?e-this.vtable[s]:0);let d=2;this.addInt16(e-this.object_start);let p=(l+d)*2;this.addInt16(p);let w=0,F=this.space;t:for(s=0;s<this.vtables.length;s++){let I=this.bb.capacity()-this.vtables[s];if(p==this.bb.readInt16(I)){for(let U=2;U<p;U+=2)if(this.bb.readInt16(F+U)!=this.bb.readInt16(I+U))continue t;w=this.vtables[s];break}}return w?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,w-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,s,l){let d=l?4:0;if(s){let p=s;if(this.prep(this.minalign,4+4+d),p.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let w=4-1;w>=0;w--)this.writeInt8(p.charCodeAt(w))}this.prep(this.minalign,4+d),this.addOffset(e),d&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,s){this.finish(e,s,!0)}requiredField(e,s){let l=this.bb.capacity()-e,d=l-this.bb.readInt32(l);if(!(s<this.bb.readInt16(d)&&this.bb.readInt16(d+s)!=0))throw new TypeError("FlatBuffers: field "+s+" must be set")}startVector(e,s,l){this.notNested(),this.vector_num_elems=s,this.prep(4,e*s),this.prep(l,e*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let s=this.createString(e);return this.string_maps.set(e,s),s}createString(e){if(e==null)return 0;let s;return e instanceof Uint8Array?s=e:s=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let s=[];for(let l=0;l<e.length;++l){let d=e[l];if(d!==null)s.push(this.createObjectOffset(d));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return s}createStructOffsetList(e,s){return s(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}};var Ji;(function(o){o[o.BUFFER=0]="BUFFER"})(Ji||(Ji={}));var Pe;(function(o){o[o.LZ4_FRAME=0]="LZ4_FRAME",o[o.ZSTD=1]="ZSTD"})(Pe||(Pe={}));var Ee=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsBodyCompression(e,s){return(s||new Ee).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,s){return e.setPosition(e.position()+4),(s||new Ee).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Pe.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Ji.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,s){e.addFieldInt8(0,s,Pe.LZ4_FRAME)}static addMethod(e,s){e.addFieldInt8(1,s,Ji.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,s,l){return Ee.startBodyCompression(e),Ee.addCodec(e,s),Ee.addMethod(e,l),Ee.endBodyCompression(e)}};var P0=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,s,l){return e.prep(8,16),e.writeInt64(BigInt(l??0)),e.writeInt64(BigInt(s??0)),e.offset()}};var H0=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,s,l){return e.prep(8,16),e.writeInt64(BigInt(l??0)),e.writeInt64(BigInt(s??0)),e.offset()}};var Me=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsRecordBatch(e,s){return(s||new Me).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,s){return e.setPosition(e.position()+4),(s||new Me).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,s){let l=this.bb.__offset(this.bb_pos,6);return l?(s||new H0).__init(this.bb.__vector(this.bb_pos+l)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,s){let l=this.bb.__offset(this.bb_pos,8);return l?(s||new P0).__init(this.bb.__vector(this.bb_pos+l)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let s=this.bb.__offset(this.bb_pos,10);return s?(e||new Ee).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,s){e.addFieldInt64(0,s,BigInt("0"))}static addNodes(e,s){e.addFieldOffset(1,s,0)}static startNodesVector(e,s){e.startVector(16,s,8)}static addBuffers(e,s){e.addFieldOffset(2,s,0)}static startBuffersVector(e,s){e.startVector(16,s,8)}static addCompression(e,s){e.addFieldOffset(3,s,0)}static endRecordBatch(e){return e.endObject()}};var zr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsDictionaryBatch(e,s){return(s||new zr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,s){return e.setPosition(e.position()+4),(s||new zr).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let s=this.bb.__offset(this.bb_pos,6);return s?(e||new Me).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,s){e.addFieldInt64(0,s,BigInt("0"))}static addData(e,s){e.addFieldOffset(1,s,0)}static addIsDelta(e,s){e.addFieldInt8(2,+s,0)}static endDictionaryBatch(e){return e.endObject()}};var mi;(function(o){o[o.Little=0]="Little",o[o.Big=1]="Big"})(mi||(mi={}));var Ao;(function(o){o[o.DenseArray=0]="DenseArray"})(Ao||(Ao={}));var Se=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsInt(e,s){return(s||new Se).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,s){return e.setPosition(e.position()+4),(s||new Se).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,s){e.addFieldInt32(0,s,0)}static addIsSigned(e,s){e.addFieldInt8(1,+s,0)}static endInt(e){return e.endObject()}static createInt(e,s,l){return Se.startInt(e),Se.addBitWidth(e,s),Se.addIsSigned(e,l),Se.endInt(e)}};var Ir=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsDictionaryEncoding(e,s){return(s||new Ir).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,s){return e.setPosition(e.position()+4),(s||new Ir).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let s=this.bb.__offset(this.bb_pos,6);return s?(e||new Se).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Ao.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,s){e.addFieldInt64(0,s,BigInt("0"))}static addIndexType(e,s){e.addFieldOffset(1,s,0)}static addIsOrdered(e,s){e.addFieldInt8(2,+s,0)}static addDictionaryKind(e,s){e.addFieldInt16(3,s,Ao.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}};var Qt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsKeyValue(e,s){return(s||new Qt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,s){return e.setPosition(e.position()+4),(s||new Qt).__init(e.readInt32(e.position())+e.position(),e)}key(e){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.__string(this.bb_pos+s,e):null}value(e){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__string(this.bb_pos+s,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,s){e.addFieldOffset(0,s,0)}static addValue(e,s){e.addFieldOffset(1,s,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,s,l){return Qt.startKeyValue(e),Qt.addKey(e,s),Qt.addValue(e,l),Qt.endKeyValue(e)}};var In=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsBinary(e,s){return(s||new In).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,s){return e.setPosition(e.position()+4),(s||new In).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return In.startBinary(e),In.endBinary(e)}};var Sn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsBool(e,s){return(s||new Sn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,s){return e.setPosition(e.position()+4),(s||new Sn).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return Sn.startBool(e),Sn.endBool(e)}};var tr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsDate(e,s){return(s||new tr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,s){return e.setPosition(e.position()+4),(s||new tr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Kt.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,s){e.addFieldInt16(0,s,Kt.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,s){return tr.startDate(e),tr.addUnit(e,s),tr.endDate(e)}};var be=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsDecimal(e,s){return(s||new be).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,s){return e.setPosition(e.position()+4),(s||new be).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,s){e.addFieldInt32(0,s,0)}static addScale(e,s){e.addFieldInt32(1,s,0)}static addBitWidth(e,s){e.addFieldInt32(2,s,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,s,l,d){return be.startDecimal(e),be.addPrecision(e,s),be.addScale(e,l),be.addBitWidth(e,d),be.endDecimal(e)}};var er=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsDuration(e,s){return(s||new er).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,s){return e.setPosition(e.position()+4),(s||new er).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):H.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,s){e.addFieldInt16(0,s,H.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,s){return er.startDuration(e),er.addUnit(e,s),er.endDuration(e)}};var rr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsFixedSizeBinary(e,s){return(s||new rr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,s){return e.setPosition(e.position()+4),(s||new rr).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,s){e.addFieldInt32(0,s,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,s){return rr.startFixedSizeBinary(e),rr.addByteWidth(e,s),rr.endFixedSizeBinary(e)}};var nr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsFixedSizeList(e,s){return(s||new nr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,s){return e.setPosition(e.position()+4),(s||new nr).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,s){e.addFieldInt32(0,s,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,s){return nr.startFixedSizeList(e),nr.addListSize(e,s),nr.endFixedSizeList(e)}};var ir=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsFloatingPoint(e,s){return(s||new ir).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,s){return e.setPosition(e.position()+4),(s||new ir).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):zt.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,s){e.addFieldInt16(0,s,zt.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,s){return ir.startFloatingPoint(e),ir.addPrecision(e,s),ir.endFloatingPoint(e)}};var sr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsInterval(e,s){return(s||new sr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,s){return e.setPosition(e.position()+4),(s||new sr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Xt.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,s){e.addFieldInt16(0,s,Xt.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,s){return sr.startInterval(e),sr.addUnit(e,s),sr.endInterval(e)}};var bn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsLargeBinary(e,s){return(s||new bn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,s){return e.setPosition(e.position()+4),(s||new bn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return bn.startLargeBinary(e),bn.endLargeBinary(e)}};var Tn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsLargeUtf8(e,s){return(s||new Tn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,s){return e.setPosition(e.position()+4),(s||new Tn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return Tn.startLargeUtf8(e),Tn.endLargeUtf8(e)}};var Rn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsList(e,s){return(s||new Rn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,s){return e.setPosition(e.position()+4),(s||new Rn).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return Rn.startList(e),Rn.endList(e)}};var or=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsMap(e,s){return(s||new or).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,s){return e.setPosition(e.position()+4),(s||new or).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,s){e.addFieldInt8(0,+s,0)}static endMap(e){return e.endObject()}static createMap(e,s){return or.startMap(e),or.addKeysSorted(e,s),or.endMap(e)}};var Un=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsNull(e,s){return(s||new Un).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,s){return e.setPosition(e.position()+4),(s||new Un).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return Un.startNull(e),Un.endNull(e)}};var Vn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsStruct_(e,s){return(s||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,s){return e.setPosition(e.position()+4),(s||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return Vn.startStruct_(e),Vn.endStruct_(e)}};var ze=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsTime(e,s){return(s||new ze).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,s){return e.setPosition(e.position()+4),(s||new ze).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):H.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,s){e.addFieldInt16(0,s,H.MILLISECOND)}static addBitWidth(e,s){e.addFieldInt32(1,s,32)}static endTime(e){return e.endObject()}static createTime(e,s,l){return ze.startTime(e),ze.addUnit(e,s),ze.addBitWidth(e,l),ze.endTime(e)}};var Xe=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsTimestamp(e,s){return(s||new Xe).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,s){return e.setPosition(e.position()+4),(s||new Xe).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):H.SECOND}timezone(e){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__string(this.bb_pos+s,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,s){e.addFieldInt16(0,s,H.SECOND)}static addTimezone(e,s){e.addFieldOffset(1,s,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,s,l){return Xe.startTimestamp(e),Xe.addUnit(e,s),Xe.addTimezone(e,l),Xe.endTimestamp(e)}};var Te=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsUnion(e,s){return(s||new Te).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,s){return e.setPosition(e.position()+4),(s||new Te).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Lt.Sparse}typeIds(e){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readInt32(this.bb.__vector(this.bb_pos+s)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,s){e.addFieldInt16(0,s,Lt.Sparse)}static addTypeIds(e,s){e.addFieldOffset(1,s,0)}static createTypeIdsVector(e,s){e.startVector(4,s.length,4);for(let l=s.length-1;l>=0;l--)e.addInt32(s[l]);return e.endVector()}static startTypeIdsVector(e,s){e.startVector(4,s,4)}static endUnion(e){return e.endObject()}static createUnion(e,s,l){return Te.startUnion(e),Te.addMode(e,s),Te.addTypeIds(e,l),Te.endUnion(e)}};var xn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsUtf8(e,s){return(s||new xn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,s){return e.setPosition(e.position()+4),(s||new xn).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return xn.startUtf8(e),xn.endUtf8(e)}};var jt;(function(o){o[o.NONE=0]="NONE",o[o.Null=1]="Null",o[o.Int=2]="Int",o[o.FloatingPoint=3]="FloatingPoint",o[o.Binary=4]="Binary",o[o.Utf8=5]="Utf8",o[o.Bool=6]="Bool",o[o.Decimal=7]="Decimal",o[o.Date=8]="Date",o[o.Time=9]="Time",o[o.Timestamp=10]="Timestamp",o[o.Interval=11]="Interval",o[o.List=12]="List",o[o.Struct_=13]="Struct_",o[o.Union=14]="Union",o[o.FixedSizeBinary=15]="FixedSizeBinary",o[o.FixedSizeList=16]="FixedSizeList",o[o.Map=17]="Map",o[o.Duration=18]="Duration",o[o.LargeBinary=19]="LargeBinary",o[o.LargeUtf8=20]="LargeUtf8",o[o.LargeList=21]="LargeList",o[o.RunEndEncoded=22]="RunEndEncoded"})(jt||(jt={}));var he=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsField(e,s){return(s||new he).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,s){return e.setPosition(e.position()+4),(s||new he).__init(e.readInt32(e.position())+e.position(),e)}name(e){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.__string(this.bb_pos+s,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):jt.NONE}type(e){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__union(e,this.bb_pos+s):null}dictionary(e){let s=this.bb.__offset(this.bb_pos,12);return s?(e||new Ir).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}children(e,s){let l=this.bb.__offset(this.bb_pos,14);return l?(s||new he).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+l)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,s){let l=this.bb.__offset(this.bb_pos,16);return l?(s||new Qt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+l)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,s){e.addFieldOffset(0,s,0)}static addNullable(e,s){e.addFieldInt8(1,+s,0)}static addTypeType(e,s){e.addFieldInt8(2,s,jt.NONE)}static addType(e,s){e.addFieldOffset(3,s,0)}static addDictionary(e,s){e.addFieldOffset(4,s,0)}static addChildren(e,s){e.addFieldOffset(5,s,0)}static createChildrenVector(e,s){e.startVector(4,s.length,4);for(let l=s.length-1;l>=0;l--)e.addOffset(s[l]);return e.endVector()}static startChildrenVector(e,s){e.startVector(4,s,4)}static addCustomMetadata(e,s){e.addFieldOffset(6,s,0)}static createCustomMetadataVector(e,s){e.startVector(4,s.length,4);for(let l=s.length-1;l>=0;l--)e.addOffset(s[l]);return e.endVector()}static startCustomMetadataVector(e,s){e.startVector(4,s,4)}static endField(e){return e.endObject()}};var oe=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,s){return this.bb_pos=e,this.bb=s,this}static getRootAsSchema(e,s){return(s||new oe).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,s){return e.setPosition(e.position()+4),(s||new oe).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):mi.Little}fields(e,s){let l=this.bb.__offset(this.bb_pos,6);return l?(s||new he).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+l)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,s){let l=this.bb.__offset(this.bb_pos,8);return l?(s||new Qt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+l)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.readInt64(this.bb.__vector(this.bb_pos+s)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,s){e.addFieldInt16(0,s,mi.Little)}static addFields(e,s){e.addFieldOffset(1,s,0)}static createFieldsVector(e,s){e.startVector(4,s.length,4);for(let l=s.length-1;l>=0;l--)e.addOffset(s[l]);return e.endVector()}static startFieldsVector(e,s){e.startVector(4,s,4)}static addCustomMetadata(e,s){e.addFieldOffset(2,s,0)}static createCustomMetadataVector(e,s){e.startVector(4,s.length,4);for(let l=s.length-1;l>=0;l--)e.addOffset(s[l]);return e.endVector()}static startCustomMetadataVector(e,s){e.startVector(4,s,4)}static addFeatures(e,s){e.addFieldOffset(3,s,0)}static createFeaturesVector(e,s){e.startVector(8,s.length,8);for(let l=s.length-1;l>=0;l--)e.addInt64(s[l]);return e.endVector()}static startFeaturesVector(e,s){e.startVector(8,s,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,s){e.finish(s)}static finishSizePrefixedSchemaBuffer(e,s){e.finish(s,void 0,!0)}static createSchema(e,s,l,d,p){return oe.startSchema(e),oe.addEndianness(e,s),oe.addFields(e,l),oe.addCustomMetadata(e,d),oe.addFeatures(e,p),oe.endSchema(e)}};var It;(function(o){o[o.NONE=0]="NONE",o[o.Schema=1]="Schema",o[o.DictionaryBatch=2]="DictionaryBatch",o[o.RecordBatch=3]="RecordBatch",o[o.Tensor=4]="Tensor",o[o.SparseTensor=5]="SparseTensor"})(It||(It={}));var x;(function(o){o[o.NONE=0]="NONE",o[o.Null=1]="Null",o[o.Int=2]="Int",o[o.Float=3]="Float",o[o.Binary=4]="Binary",o[o.Utf8=5]="Utf8",o[o.Bool=6]="Bool",o[o.Decimal=7]="Decimal",o[o.Date=8]="Date",o[o.Time=9]="Time",o[o.Timestamp=10]="Timestamp",o[o.Interval=11]="Interval",o[o.List=12]="List",o[o.Struct=13]="Struct",o[o.Union=14]="Union",o[o.FixedSizeBinary=15]="FixedSizeBinary",o[o.FixedSizeList=16]="FixedSizeList",o[o.Map=17]="Map",o[o.Duration=18]="Duration",o[o.LargeBinary=19]="LargeBinary",o[o.LargeUtf8=20]="LargeUtf8",o[o.Dictionary=-1]="Dictionary",o[o.Int8=-2]="Int8",o[o.Int16=-3]="Int16",o[o.Int32=-4]="Int32",o[o.Int64=-5]="Int64",o[o.Uint8=-6]="Uint8",o[o.Uint16=-7]="Uint16",o[o.Uint32=-8]="Uint32",o[o.Uint64=-9]="Uint64",o[o.Float16=-10]="Float16",o[o.Float32=-11]="Float32",o[o.Float64=-12]="Float64",o[o.DateDay=-13]="DateDay",o[o.DateMillisecond=-14]="DateMillisecond",o[o.TimestampSecond=-15]="TimestampSecond",o[o.TimestampMillisecond=-16]="TimestampMillisecond",o[o.TimestampMicrosecond=-17]="TimestampMicrosecond",o[o.TimestampNanosecond=-18]="TimestampNanosecond",o[o.TimeSecond=-19]="TimeSecond",o[o.TimeMillisecond=-20]="TimeMillisecond",o[o.TimeMicrosecond=-21]="TimeMicrosecond",o[o.TimeNanosecond=-22]="TimeNanosecond",o[o.DenseUnion=-23]="DenseUnion",o[o.SparseUnion=-24]="SparseUnion",o[o.IntervalDayTime=-25]="IntervalDayTime",o[o.IntervalYearMonth=-26]="IntervalYearMonth",o[o.DurationSecond=-27]="DurationSecond",o[o.DurationMillisecond=-28]="DurationMillisecond",o[o.DurationMicrosecond=-29]="DurationMicrosecond",o[o.DurationNanosecond=-30]="DurationNanosecond",o[o.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(x||(x={}));var ur;(function(o){o[o.OFFSET=0]="OFFSET",o[o.DATA=1]="DATA",o[o.VALIDITY=2]="VALIDITY",o[o.TYPE=3]="TYPE"})(ur||(ur={}));var Pa={};Pn(Pa,{clampRange:()=>yo,createElementComparator:()=>_i,wrapIndex:()=>s0});var Ua={};Pn(Ua,{valueToString:()=>nn});function nn(o){if(o===null)return"null";if(o===void 0)return"undefined";switch(typeof o){case"number":return`${o}`;case"bigint":return`${o}`;case"string":return`"${o}"`}return typeof o[Symbol.toPrimitive]=="function"?o[Symbol.toPrimitive]("string"):ArrayBuffer.isView(o)?o instanceof BigInt64Array||o instanceof BigUint64Array?`[${[...o].map(e=>nn(e))}]`:`[${o}]`:ArrayBuffer.isView(o)?`[${o}]`:JSON.stringify(o,(e,s)=>typeof s=="bigint"?`${s}`:s)}var Na={};Pn(Na,{BN:()=>Pi,bigNumToBigInt:()=>Yd,bigNumToNumber:()=>Ma,bigNumToString:()=>q0,isArrowBigNumSymbol:()=>jd});function Ut(o){if(typeof o