(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerpolicy&&(o.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?o.credentials="include":s.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var Od=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hl={exports:{}},X={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var pt=typeof Symbol=="function"&&Symbol.for,Qo=pt?Symbol.for("react.element"):60103,ta=pt?Symbol.for("react.portal"):60106,cs=pt?Symbol.for("react.fragment"):60107,us=pt?Symbol.for("react.strict_mode"):60108,ls=pt?Symbol.for("react.profiler"):60114,fs=pt?Symbol.for("react.provider"):60109,hs=pt?Symbol.for("react.context"):60110,ea=pt?Symbol.for("react.async_mode"):60111,ds=pt?Symbol.for("react.concurrent_mode"):60111,ps=pt?Symbol.for("react.forward_ref"):60112,ys=pt?Symbol.for("react.suspense"):60113,xd=pt?Symbol.for("react.suspense_list"):60120,bs=pt?Symbol.for("react.memo"):60115,ms=pt?Symbol.for("react.lazy"):60116,Ld=pt?Symbol.for("react.block"):60121,Dd=pt?Symbol.for("react.fundamental"):60117,kd=pt?Symbol.for("react.responder"):60118,Ed=pt?Symbol.for("react.scope"):60119;function Rt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Qo:switch(e=e.type,e){case ea:case ds:case cs:case ls:case us:case ys:return e;default:switch(e=e&&e.$$typeof,e){case hs:case ps:case ms:case bs:case fs:return e;default:return t}}case ta:return t}}}function dl(e){return Rt(e)===ds}X.AsyncMode=ea;X.ConcurrentMode=ds;X.ContextConsumer=hs;X.ContextProvider=fs;X.Element=Qo;X.ForwardRef=ps;X.Fragment=cs;X.Lazy=ms;X.Memo=bs;X.Portal=ta;X.Profiler=ls;X.StrictMode=us;X.Suspense=ys;X.isAsyncMode=function(e){return dl(e)||Rt(e)===ea};X.isConcurrentMode=dl;X.isContextConsumer=function(e){return Rt(e)===hs};X.isContextProvider=function(e){return Rt(e)===fs};X.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qo};X.isForwardRef=function(e){return Rt(e)===ps};X.isFragment=function(e){return Rt(e)===cs};X.isLazy=function(e){return Rt(e)===ms};X.isMemo=function(e){return Rt(e)===bs};X.isPortal=function(e){return Rt(e)===ta};X.isProfiler=function(e){return Rt(e)===ls};X.isStrictMode=function(e){return Rt(e)===us};X.isSuspense=function(e){return Rt(e)===ys};X.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===cs||e===ds||e===ls||e===us||e===ys||e===xd||typeof e=="object"&&e!==null&&(e.$$typeof===ms||e.$$typeof===bs||e.$$typeof===fs||e.$$typeof===hs||e.$$typeof===ps||e.$$typeof===Dd||e.$$typeof===kd||e.$$typeof===Ed||e.$$typeof===Ld)};X.typeOf=Rt;(function(e){e.exports=X})(hl);var pl=hl.exports,Ud={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Nd={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},yl={};yl[pl.ForwardRef]=Ud;yl[pl.Memo]=Nd;var bl={exports:{}},q={};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var Bc=Object.getOwnPropertySymbols,Md=Object.prototype.hasOwnProperty,Cd=Object.prototype.propertyIsEnumerable;function Rd(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Vd(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(o){s[o]=o}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var jd=Vd()?Object.assign:function(e,t){for(var n,r=Rd(e),s,o=1;o<arguments.length;o++){n=Object(arguments[o]);for(var i in n)Md.call(n,i)&&(r[i]=n[i]);if(Bc){s=Bc(n);for(var a=0;a<s.length;a++)Cd.call(n,s[a])&&(r[s[a]]=n[s[a]])}}return r};/** @license React v16.14.0
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var na=jd,te=typeof Symbol=="function"&&Symbol.for,Wr=te?Symbol.for("react.element"):60103,Pd=te?Symbol.for("react.portal"):60106,zd=te?Symbol.for("react.fragment"):60107,Wd=te?Symbol.for("react.strict_mode"):60108,$d=te?Symbol.for("react.profiler"):60114,Yd=te?Symbol.for("react.provider"):60109,Gd=te?Symbol.for("react.context"):60110,Kd=te?Symbol.for("react.forward_ref"):60112,Zd=te?Symbol.for("react.suspense"):60113,Hd=te?Symbol.for("react.memo"):60115,Jd=te?Symbol.for("react.lazy"):60116,Oc=typeof Symbol=="function"&&Symbol.iterator;function $r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ml={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gl={};function or(e,t,n){this.props=e,this.context=t,this.refs=gl,this.updater=n||ml}or.prototype.isReactComponent={};or.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error($r(85));this.updater.enqueueSetState(this,e,t,"setState")};or.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vl(){}vl.prototype=or.prototype;function ra(e,t,n){this.props=e,this.context=t,this.refs=gl,this.updater=n||ml}var ia=ra.prototype=new vl;ia.constructor=ra;na(ia,or.prototype);ia.isPureReactComponent=!0;var sa={current:null},wl=Object.prototype.hasOwnProperty,_l={key:!0,ref:!0,__self:!0,__source:!0};function Sl(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)wl.call(t,r)&&!_l.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Wr,type:e,key:o,ref:i,props:s,_owner:sa.current}}function Xd(e,t){return{$$typeof:Wr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function oa(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wr}function qd(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(n){return t[n]})}var Il=/\/+/g,Ui=[];function Tl(e,t,n,r){if(Ui.length){var s=Ui.pop();return s.result=e,s.keyPrefix=t,s.func=n,s.context=r,s.count=0,s}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function Al(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Ui.length&&Ui.push(e)}function wo(e,t,n,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Wr:case Pd:o=!0}}if(o)return n(r,e,t===""?"."+js(e,0):t),1;if(o=0,t=t===""?".":t+":",Array.isArray(e))for(var i=0;i<e.length;i++){s=e[i];var a=t+js(s,i);o+=wo(s,a,n,r)}else if(e===null||typeof e!="object"?a=null:(a=Oc&&e[Oc]||e["@@iterator"],a=typeof a=="function"?a:null),typeof a=="function")for(e=a.call(e),i=0;!(s=e.next()).done;)s=s.value,a=t+js(s,i++),o+=wo(s,a,n,r);else if(s==="object")throw n=""+e,Error($r(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return o}function _o(e,t,n){return e==null?0:wo(e,"",t,n)}function js(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qd(e.key):t.toString(36)}function Qd(e,t){e.func.call(e.context,t,e.count++)}function tp(e,t,n){var r=e.result,s=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?So(e,r,n,function(o){return o}):e!=null&&(oa(e)&&(e=Xd(e,s+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(Il,"$&/")+"/")+n)),r.push(e))}function So(e,t,n,r,s){var o="";n!=null&&(o=(""+n).replace(Il,"$&/")+"/"),t=Tl(t,o,r,s),_o(e,tp,t),Al(t)}var Bl={current:null};function xe(){var e=Bl.current;if(e===null)throw Error($r(321));return e}var ep={ReactCurrentDispatcher:Bl,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:sa,IsSomeRendererActing:{current:!1},assign:na};q.Children={map:function(e,t,n){if(e==null)return e;var r=[];return So(e,r,null,t,n),r},forEach:function(e,t,n){if(e==null)return e;t=Tl(null,null,t,n),_o(e,Qd,t),Al(t)},count:function(e){return _o(e,function(){return null},null)},toArray:function(e){var t=[];return So(e,t,null,function(n){return n}),t},only:function(e){if(!oa(e))throw Error($r(143));return e}};q.Component=or;q.Fragment=zd;q.Profiler=$d;q.PureComponent=ra;q.StrictMode=Wd;q.Suspense=Zd;q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ep;q.cloneElement=function(e,t,n){if(e==null)throw Error($r(267,e));var r=na({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=sa.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)wl.call(t,c)&&!_l.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Wr,type:e.type,key:s,ref:o,props:r,_owner:i}};q.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Gd,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:Yd,_context:e},e.Consumer=e};q.createElement=Sl;q.createFactory=function(e){var t=Sl.bind(null,e);return t.type=e,t};q.createRef=function(){return{current:null}};q.forwardRef=function(e){return{$$typeof:Kd,render:e}};q.isValidElement=oa;q.lazy=function(e){return{$$typeof:Jd,_ctor:e,_status:-1,_result:null}};q.memo=function(e,t){return{$$typeof:Hd,type:e,compare:t===void 0?null:t}};q.useCallback=function(e,t){return xe().useCallback(e,t)};q.useContext=function(e,t){return xe().useContext(e,t)};q.useDebugValue=function(){};q.useEffect=function(e,t){return xe().useEffect(e,t)};q.useImperativeHandle=function(e,t,n){return xe().useImperativeHandle(e,t,n)};q.useLayoutEffect=function(e,t){return xe().useLayoutEffect(e,t)};q.useMemo=function(e,t){return xe().useMemo(e,t)};q.useReducer=function(e,t,n){return xe().useReducer(e,t,n)};q.useRef=function(e){return xe().useRef(e)};q.useState=function(e){return xe().useState(e)};q.version="16.14.0";(function(e){e.exports=q})(bl);const np=Fd(bl.exports),Ol=new WeakMap,Io=new WeakMap;function et(e){const t=Ol.get(e);return console.assert(t!=null,"'this' is expected an Event object, but got",e),t}function Fc(e){if(e.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}!e.event.cancelable||(e.canceled=!0,typeof e.event.preventDefault=="function"&&e.event.preventDefault())}function Yn(e,t){Ol.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=Object.keys(t);for(let r=0;r<n.length;++r){const s=n[r];s in this||Object.defineProperty(this,s,Fl(s))}}Yn.prototype={get type(){return et(this).event.type},get target(){return et(this).eventTarget},get currentTarget(){return et(this).currentTarget},composedPath(){const e=et(this).currentTarget;return e==null?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return et(this).eventPhase},stopPropagation(){const e=et(this);e.stopped=!0,typeof e.event.stopPropagation=="function"&&e.event.stopPropagation()},stopImmediatePropagation(){const e=et(this);e.stopped=!0,e.immediateStopped=!0,typeof e.event.stopImmediatePropagation=="function"&&e.event.stopImmediatePropagation()},get bubbles(){return Boolean(et(this).event.bubbles)},get cancelable(){return Boolean(et(this).event.cancelable)},preventDefault(){Fc(et(this))},get defaultPrevented(){return et(this).canceled},get composed(){return Boolean(et(this).event.composed)},get timeStamp(){return et(this).timeStamp},get srcElement(){return et(this).eventTarget},get cancelBubble(){return et(this).stopped},set cancelBubble(e){if(!e)return;const t=et(this);t.stopped=!0,typeof t.event.cancelBubble=="boolean"&&(t.event.cancelBubble=!0)},get returnValue(){return!et(this).canceled},set returnValue(e){e||Fc(et(this))},initEvent(){}};Object.defineProperty(Yn.prototype,"constructor",{value:Yn,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Yn.prototype,window.Event.prototype),Io.set(window.Event.prototype,Yn));function Fl(e){return{get(){return et(this).event[e]},set(t){et(this).event[e]=t},configurable:!0,enumerable:!0}}function rp(e){return{value(){const t=et(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function ip(e,t){const n=Object.keys(t);if(n.length===0)return e;function r(s,o){e.call(this,s,o)}r.prototype=Object.create(e.prototype,{constructor:{value:r,configurable:!0,writable:!0}});for(let s=0;s<n.length;++s){const o=n[s];if(!(o in e.prototype)){const a=typeof Object.getOwnPropertyDescriptor(t,o).value=="function";Object.defineProperty(r.prototype,o,a?rp(o):Fl(o))}}return r}function xl(e){if(e==null||e===Object.prototype)return Yn;let t=Io.get(e);return t==null&&(t=ip(xl(Object.getPrototypeOf(e)),e),Io.set(e,t)),t}function sp(e,t){const n=xl(Object.getPrototypeOf(t));return new n(e,t)}function op(e){return et(e).immediateStopped}function ap(e,t){et(e).eventPhase=t}function cp(e,t){et(e).currentTarget=t}function xc(e,t){et(e).passiveListener=t}const Ll=new WeakMap,Lc=1,Dc=2,Ti=3;function Ai(e){return e!==null&&typeof e=="object"}function _r(e){const t=Ll.get(e);if(t==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function up(e){return{get(){let n=_r(this).get(e);for(;n!=null;){if(n.listenerType===Ti)return n.listener;n=n.next}return null},set(t){typeof t!="function"&&!Ai(t)&&(t=null);const n=_r(this);let r=null,s=n.get(e);for(;s!=null;)s.listenerType===Ti?r!==null?r.next=s.next:s.next!==null?n.set(e,s.next):n.delete(e):r=s,s=s.next;if(t!==null){const o={listener:t,listenerType:Ti,passive:!1,once:!1,next:null};r===null?n.set(e,o):r.next=o}},configurable:!0,enumerable:!0}}function lp(e,t){Object.defineProperty(e,`on${t}`,up(t))}function kc(e){function t(){$e.call(this)}t.prototype=Object.create($e.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let n=0;n<e.length;++n)lp(t.prototype,e[n]);return t}function $e(){if(this instanceof $e){Ll.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return kc(arguments[0]);if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return kc(e)}throw new TypeError("Cannot call a class as a function")}$e.prototype={addEventListener(e,t,n){if(t==null)return;if(typeof t!="function"&&!Ai(t))throw new TypeError("'listener' should be a function or an object.");const r=_r(this),s=Ai(n),i=Boolean(s?n.capture:n)?Lc:Dc,a={listener:t,listenerType:i,passive:s&&Boolean(n.passive),once:s&&Boolean(n.once),next:null};let c=r.get(e);if(c===void 0){r.set(e,a);return}let u=null;for(;c!=null;){if(c.listener===t&&c.listenerType===i)return;u=c,c=c.next}u.next=a},removeEventListener(e,t,n){if(t==null)return;const r=_r(this),o=(Ai(n)?Boolean(n.capture):Boolean(n))?Lc:Dc;let i=null,a=r.get(e);for(;a!=null;){if(a.listener===t&&a.listenerType===o){i!==null?i.next=a.next:a.next!==null?r.set(e,a.next):r.delete(e);return}i=a,a=a.next}},dispatchEvent(e){if(e==null||typeof e.type!="string")throw new TypeError('"event.type" should be a string.');const t=_r(this),n=e.type;let r=t.get(n);if(r==null)return!0;const s=sp(this,e);let o=null;for(;r!=null;){if(r.once?o!==null?o.next=r.next:r.next!==null?t.set(n,r.next):t.delete(n):o=r,xc(s,r.passive?r.listener:null),typeof r.listener=="function")try{r.listener.call(this,s)}catch(i){typeof console<"u"&&typeof console.error=="function"&&console.error(i)}else r.listenerType!==Ti&&typeof r.listener.handleEvent=="function"&&r.listener.handleEvent(s);if(op(s))break;r=r.next}return xc(s,null),ap(s,0),cp(s,null),!s.defaultPrevented}};Object.defineProperty($e.prototype,"constructor",{value:$e,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf($e.prototype,window.EventTarget.prototype);var y={};y.SIZEOF_SHORT=2;y.SIZEOF_INT=4;y.FILE_IDENTIFIER_LENGTH=4;y.Encoding={UTF8_BYTES:1,UTF16_STRING:2};y.int32=new Int32Array(2);y.float32=new Float32Array(y.int32.buffer);y.float64=new Float64Array(y.int32.buffer);y.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;y.Long=function(e,t){this.low=e|0,this.high=t|0};y.Long.create=function(e,t){return e==0&&t==0?y.Long.ZERO:new y.Long(e,t)};y.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};y.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high};y.Long.ZERO=new y.Long(0,0);y.Builder=function(e){if(e)var t=e;else var t=1024;this.bb=y.ByteBuffer.allocate(t),this.space=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};y.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1};y.Builder.prototype.forceDefaults=function(e){this.force_defaults=e};y.Builder.prototype.dataBuffer=function(){return this.bb};y.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};y.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var n=~(this.bb.capacity()-this.space+t)+1&e-1;this.space<n+e+t;){var r=this.bb.capacity();this.bb=y.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(n)};y.Builder.prototype.pad=function(e){for(var t=0;t<e;t++)this.bb.writeInt8(--this.space,0)};y.Builder.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)};y.Builder.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)};y.Builder.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)};y.Builder.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)};y.Builder.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)};y.Builder.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)};y.Builder.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)};y.Builder.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)};y.Builder.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)};y.Builder.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)};y.Builder.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)};y.Builder.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)};y.Builder.prototype.addFieldInt8=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))};y.Builder.prototype.addFieldInt16=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))};y.Builder.prototype.addFieldInt32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))};y.Builder.prototype.addFieldInt64=function(e,t,n){(this.force_defaults||!t.equals(n))&&(this.addInt64(t),this.slot(e))};y.Builder.prototype.addFieldFloat32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))};y.Builder.prototype.addFieldFloat64=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))};y.Builder.prototype.addFieldOffset=function(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))};y.Builder.prototype.addFieldStruct=function(e,t,n){t!=n&&(this.nested(t),this.slot(e))};y.Builder.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};y.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};y.Builder.prototype.slot=function(e){this.vtable[e]=this.offset()};y.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};y.Builder.growByteBuffer=function(e){var t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=t<<1,r=y.ByteBuffer.allocate(n);return r.setPosition(n-t),r.bytes().set(e.bytes(),n-t),r};y.Builder.prototype.addOffset=function(e){this.prep(y.SIZEOF_INT,0),this.writeInt32(this.offset()-e+y.SIZEOF_INT)};y.Builder.prototype.startObject=function(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(var t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()};y.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),t=this.vtable_in_use-1;t>=0&&this.vtable[t]==0;t--);for(var n=t+1;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);var r=2;this.addInt16(e-this.object_start);var s=(n+r)*y.SIZEOF_SHORT;this.addInt16(s);var o=0,i=this.space;t:for(t=0;t<this.vtables.length;t++){var a=this.bb.capacity()-this.vtables[t];if(s==this.bb.readInt16(a)){for(var c=y.SIZEOF_SHORT;c<s;c+=y.SIZEOF_SHORT)if(this.bb.readInt16(i+c)!=this.bb.readInt16(a+c))continue t;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e};y.Builder.prototype.finish=function(e,t){if(t){var n=t;if(this.prep(this.minalign,y.SIZEOF_INT+y.FILE_IDENTIFIER_LENGTH),n.length!=y.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+y.FILE_IDENTIFIER_LENGTH);for(var r=y.FILE_IDENTIFIER_LENGTH-1;r>=0;r--)this.writeInt8(n.charCodeAt(r))}this.prep(this.minalign,y.SIZEOF_INT),this.addOffset(e),this.bb.setPosition(this.space)};y.Builder.prototype.requiredField=function(e,t){var n=this.bb.capacity()-e,r=n-this.bb.readInt32(n),s=this.bb.readInt16(r+t)!=0;if(!s)throw new Error("FlatBuffers: field "+t+" must be set")};y.Builder.prototype.startVector=function(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(y.SIZEOF_INT,e*t),this.prep(n,e*t)};y.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};y.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else for(var t=[],n=0;n<e.length;){var r,s=e.charCodeAt(n++);if(s<55296||s>=56320)r=s;else{var o=e.charCodeAt(n++);r=(s<<10)+o+(65536-(55296<<10)-56320)}r<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(r&63|128))}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);for(var n=0,i=this.space,a=this.bb.bytes();n<t.length;n++)a[i++]=t[n];return this.endVector()};y.Builder.prototype.createLong=function(e,t){return y.Long.create(e,t)};y.ByteBuffer=function(e){this.bytes_=e,this.position_=0};y.ByteBuffer.allocate=function(e){return new y.ByteBuffer(new Uint8Array(e))};y.ByteBuffer.prototype.clear=function(){this.position_=0};y.ByteBuffer.prototype.bytes=function(){return this.bytes_};y.ByteBuffer.prototype.position=function(){return this.position_};y.ByteBuffer.prototype.setPosition=function(e){this.position_=e};y.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};y.ByteBuffer.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24};y.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]};y.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16};y.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8};y.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24};y.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0};y.ByteBuffer.prototype.readInt64=function(e){return new y.Long(this.readInt32(e),this.readInt32(e+4))};y.ByteBuffer.prototype.readUint64=function(e){return new y.Long(this.readUint32(e),this.readUint32(e+4))};y.ByteBuffer.prototype.readFloat32=function(e){return y.int32[0]=this.readInt32(e),y.float32[0]};y.ByteBuffer.prototype.readFloat64=function(e){return y.int32[y.isLittleEndian?0:1]=this.readInt32(e),y.int32[y.isLittleEndian?1:0]=this.readInt32(e+4),y.float64[0]};y.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t};y.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t};y.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8};y.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8};y.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24};y.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24};y.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)};y.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)};y.ByteBuffer.prototype.writeFloat32=function(e,t){y.float32[0]=t,this.writeInt32(e,y.int32[0])};y.ByteBuffer.prototype.writeFloat64=function(e,t){y.float64[0]=t,this.writeInt32(e,y.int32[y.isLittleEndian?0:1]),this.writeInt32(e+4,y.int32[y.isLittleEndian?1:0])};y.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+y.SIZEOF_INT+y.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",t=0;t<y.FILE_IDENTIFIER_LENGTH;t++)e+=String.fromCharCode(this.readInt8(this.position_+y.SIZEOF_INT+t));return e};y.ByteBuffer.prototype.__offset=function(e,t){var n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0};y.ByteBuffer.prototype.__union=function(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e};y.ByteBuffer.prototype.__string=function(e,t){e+=this.readInt32(e);var n=this.readInt32(e),r="",s=0;if(e+=y.SIZEOF_INT,t===y.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;s<n;){var o,i=this.readUint8(e+s++);if(i<192)o=i;else{var a=this.readUint8(e+s++);if(i<224)o=(i&31)<<6|a&63;else{var c=this.readUint8(e+s++);if(i<240)o=(i&15)<<12|(a&63)<<6|c&63;else{var u=this.readUint8(e+s++);o=(i&7)<<18|(a&63)<<12|(c&63)<<6|u&63}}}o<65536?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode((o>>10)+55296,(o&(1<<10)-1)+56320))}return r};y.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)};y.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+y.SIZEOF_INT};y.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))};y.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=y.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+y.FILE_IDENTIFIER_LENGTH);for(var t=0;t<y.FILE_IDENTIFIER_LENGTH;t++)if(e.charCodeAt(t)!=this.readInt8(this.position_+y.SIZEOF_INT+t))return!1;return!0};y.ByteBuffer.prototype.createLong=function(e,t){return y.Long.create(e,t)};function we(e,t,n){return t<=e&&e<=n}function gs(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function fp(e){for(var t=String(e),n=t.length,r=0,s=[];r<n;){var o=t.charCodeAt(r);if(o<55296||o>57343)s.push(o);else if(56320<=o&&o<=57343)s.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)s.push(65533);else{var i=e.charCodeAt(r+1);if(56320<=i&&i<=57343){var a=o&1023,c=i&1023;s.push(65536+(a<<10)+c),r+=1}else s.push(65533)}r+=1}return s}function hp(e){for(var t="",n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t}var Ni=-1;function aa(e){this.tokens=[].slice.call(e)}aa.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Ni},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var Gn=-1;function Ps(e,t){if(e)throw TypeError("Decoder error");return t||65533}var Mi="utf-8";function Ci(e,t){if(!(this instanceof Ci))return new Ci(e,t);if(e=e!==void 0?String(e).toLowerCase():Mi,e!==Mi)throw new Error("Encoding not supported. Only utf-8 is supported");t=gs(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}Ci.prototype={decode:function(t,n){var r;typeof t=="object"&&t instanceof ArrayBuffer?r=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):r=new Uint8Array(0),n=gs(n),this._streaming||(this._decoder=new dp({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(n.stream);for(var s=new aa(r),o=[],i;!s.endOfStream()&&(i=this._decoder.handler(s,s.read()),i!==Gn);)i!==null&&(Array.isArray(i)?o.push.apply(o,i):o.push(i));if(!this._streaming){do{if(i=this._decoder.handler(s,s.read()),i===Gn)break;i!==null&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}while(!s.endOfStream());this._decoder=null}return o.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(o[0]===65279?(this._BOMseen=!0,o.shift()):this._BOMseen=!0),hp(o)}};function Ri(e,t){if(!(this instanceof Ri))return new Ri(e,t);if(e=e!==void 0?String(e).toLowerCase():Mi,e!==Mi)throw new Error("Encoding not supported. Only utf-8 is supported");t=gs(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}Ri.prototype={encode:function(t,n){t=t?String(t):"",n=gs(n),this._streaming||(this._encoder=new pp(this._options)),this._streaming=Boolean(n.stream);for(var r=[],s=new aa(fp(t)),o;!s.endOfStream()&&(o=this._encoder.handler(s,s.read()),o!==Gn);)Array.isArray(o)?r.push.apply(r,o):r.push(o);if(!this._streaming){for(;o=this._encoder.handler(s,s.read()),o!==Gn;)Array.isArray(o)?r.push.apply(r,o):r.push(o);this._encoder=null}return new Uint8Array(r)}};function dp(e){var t=e.fatal,n=0,r=0,s=0,o=128,i=191;this.handler=function(a,c){if(c===Ni&&s!==0)return s=0,Ps(t);if(c===Ni)return Gn;if(s===0){if(we(c,0,127))return c;if(we(c,194,223))s=1,n=c-192;else if(we(c,224,239))c===224&&(o=160),c===237&&(i=159),s=2,n=c-224;else if(we(c,240,244))c===240&&(o=144),c===244&&(i=143),s=3,n=c-240;else return Ps(t);return n=n<<6*s,null}if(!we(c,o,i))return n=s=r=0,o=128,i=191,a.prepend(c),Ps(t);if(o=128,i=191,r+=1,n+=c-128<<6*(s-r),r!==s)return null;var u=n;return n=s=r=0,u}}function pp(e){e.fatal,this.handler=function(t,n){if(n===Ni)return Gn;if(we(n,0,127))return n;var r,s;we(n,128,2047)?(r=1,s=192):we(n,2048,65535)?(r=2,s=224):we(n,65536,1114111)&&(r=3,s=240);for(var o=[(n>>6*r)+s];r>0;){var i=n>>6*(r-1);o.push(128|i&63),r-=1}return o}}const Vi=typeof Buffer=="function"?Buffer:null,Dl=typeof TextDecoder=="function"&&typeof TextEncoder=="function",To=(e=>{if(Dl||!Vi){const t=new e("utf-8");return n=>t.decode(n)}return t=>{const{buffer:n,byteOffset:r,length:s}=j(t);return Vi.from(n,r,s).toString()}})(typeof TextDecoder<"u"?TextDecoder:Ci),vs=(e=>{if(Dl||!Vi){const t=new e;return n=>t.encode(n)}return(t="")=>j(Vi.from(t,"utf8"))})(typeof TextEncoder<"u"?TextEncoder:Ri),ot=Object.freeze({done:!0,value:void 0});class Ec{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class wn{tee(){return this._getDOMStream().tee()}pipe(t,n){return this._getNodeStream().pipe(t,n)}pipeTo(t,n){return this._getDOMStream().pipeTo(t,n)}pipeThrough(t,n){return this._getDOMStream().pipeThrough(t,n)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class yp extends wn{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}async cancel(t){await 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(ot);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Ut.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Ut.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}async throw(t){return await this.abort(t),ot}async return(t){return await this.close(),ot}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await 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((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(ot)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error(`${this} is closed`)}}const[bp,ws]=(()=>{const e=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw e()}return t.asIntN=()=>{throw e()},t.asUintN=()=>{throw e()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[ar,x_]=(()=>{const e=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Yr,L_]=(()=>{const e=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),mp=e=>typeof e=="number",kl=e=>typeof e=="boolean",zt=e=>typeof e=="function",Mt=e=>e!=null&&Object(e)===e,Ye=e=>Mt(e)&&zt(e.then),Xt=e=>Mt(e)&&zt(e[Symbol.iterator]),Le=e=>Mt(e)&&zt(e[Symbol.asyncIterator]),Ao=e=>Mt(e)&&Mt(e.schema),El=e=>Mt(e)&&"done"in e&&"value"in e,Ul=e=>Mt(e)&&zt(e.stat)&&mp(e.fd),Nl=e=>Mt(e)&&ca(e.body),gp=e=>Mt(e)&&zt(e.abort)&&zt(e.getWriter)&&!(e instanceof wn),ca=e=>Mt(e)&&zt(e.cancel)&&zt(e.getReader)&&!(e instanceof wn),vp=e=>Mt(e)&&zt(e.end)&&zt(e.write)&&kl(e.writable)&&!(e instanceof wn),Ml=e=>Mt(e)&&zt(e.read)&&zt(e.pipe)&&kl(e.readable)&&!(e instanceof wn);var wp=y.ByteBuffer;const ua=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function _p(e){let t=e[0]?[e[0]]:[],n,r,s,o;for(let i,a,c=0,u=0,l=e.length;++c<l;){if(i=t[u],a=e[c],!i||!a||i.buffer!==a.buffer||a.byteOffset<i.byteOffset){a&&(t[++u]=a);continue}if({byteOffset:n,byteLength:s}=i,{byteOffset:r,byteLength:o}=a,n+s<r||r+o<n){a&&(t[++u]=a);continue}t[u]=new Uint8Array(i.buffer,n,r-n+o)}return t}function Or(e,t,n=0,r=t.byteLength){const s=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,s),i=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,s));return o.set(i,n),e}function qt(e,t){let n=_p(e),r=n.reduce((l,f)=>l+f.byteLength,0),s,o,i,a=0,c=-1,u=Math.min(t||1/0,r);for(let l=n.length;++c<l;){if(s=n[c],o=s.subarray(0,Math.min(s.length,u-a)),u<=a+o.length){o.length<s.length?n[c]=s.subarray(o.length):o.length===s.length&&c++,i?Or(i,o,a):i=o;break}Or(i||(i=new Uint8Array(u)),o,a),a+=o.length}return[i||new Uint8Array(0),n.slice(c),r-(i?i.byteLength:0)]}function R(e,t){let n=El(t)?t.value:t;return n instanceof e?e===Uint8Array?new e(n.buffer,n.byteOffset,n.byteLength):n:n?(typeof n=="string"&&(n=vs(n)),n instanceof ArrayBuffer?new e(n):n instanceof ua?new e(n):n instanceof wp?R(e,n.bytes()):ArrayBuffer.isView(n)?n.byteLength<=0?new e(0):new e(n.buffer,n.byteOffset,n.byteLength/e.BYTES_PER_ELEMENT):e.from(n)):new e(0)}const Sp=e=>R(Int8Array,e),Ip=e=>R(Int16Array,e),Dn=e=>R(Int32Array,e),Cl=e=>R(ar,e),j=e=>R(Uint8Array,e),Tp=e=>R(Uint16Array,e),Ap=e=>R(Uint32Array,e),Rl=e=>R(Yr,e),Bp=e=>R(Float32Array,e),Op=e=>R(Float64Array,e),Fp=e=>R(Uint8ClampedArray,e),Bo=e=>(e.next(),e);function*he(e,t){const n=function*(s){yield s},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ua?n(t):Xt(t)?t:n(t);yield*Bo(function*(s){let o=null;do o=s.next(yield R(e,o));while(!o.done)}(r[Symbol.iterator]()))}const xp=e=>he(Int8Array,e),Lp=e=>he(Int16Array,e),Dp=e=>he(Int32Array,e),Vl=e=>he(Uint8Array,e),kp=e=>he(Uint16Array,e),Ep=e=>he(Uint32Array,e),Up=e=>he(Float32Array,e),Np=e=>he(Float64Array,e),Mp=e=>he(Uint8ClampedArray,e);async function*ee(e,t){if(Ye(t))return yield*ee(e,await t);const n=async function*(o){yield await o},r=async function*(o){yield*Bo(function*(i){let a=null;do a=i.next(yield a&&a.value);while(!a.done)}(o[Symbol.iterator]()))},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ua?n(t):Xt(t)?r(t):Le(t)?t:n(t);yield*Bo(async function*(o){let i=null;do i=await o.next(yield R(e,i));while(!i.done)}(s[Symbol.asyncIterator]()))}const Cp=e=>ee(Int8Array,e),Rp=e=>ee(Int16Array,e),Vp=e=>ee(Int32Array,e),jl=e=>ee(Uint8Array,e),jp=e=>ee(Uint16Array,e),Pp=e=>ee(Uint32Array,e),zp=e=>ee(Float32Array,e),Wp=e=>ee(Float64Array,e),$p=e=>ee(Uint8ClampedArray,e);function _s(e,t,n){if(e!==0){n=n.slice(0,t+1);for(let r=-1;++r<=t;)n[r]+=e}return n}function Pl(e,t){let n=0,r=e.length;if(r!==t.length)return!1;if(r>0)do if(e[n]!==t[n])return!1;while(++n<r);return!0}const Yp=Object.freeze(Object.defineProperty({__proto__:null,memcpy:Or,joinUint8Arrays:qt,toArrayBufferView:R,toInt8Array:Sp,toInt16Array:Ip,toInt32Array:Dn,toBigInt64Array:Cl,toUint8Array:j,toUint16Array:Tp,toUint32Array:Ap,toBigUint64Array:Rl,toFloat32Array:Bp,toFloat64Array:Op,toUint8ClampedArray:Fp,toArrayBufferViewIterator:he,toInt8ArrayIterator:xp,toInt16ArrayIterator:Lp,toInt32ArrayIterator:Dp,toUint8ArrayIterator:Vl,toUint16ArrayIterator:kp,toUint32ArrayIterator:Ep,toFloat32ArrayIterator:Up,toFloat64ArrayIterator:Np,toUint8ClampedArrayIterator:Mp,toArrayBufferViewAsyncIterator:ee,toInt8ArrayAsyncIterator:Cp,toInt16ArrayAsyncIterator:Rp,toInt32ArrayAsyncIterator:Vp,toUint8ArrayAsyncIterator:jl,toUint16ArrayAsyncIterator:jp,toUint32ArrayAsyncIterator:Pp,toFloat32ArrayAsyncIterator:zp,toFloat64ArrayAsyncIterator:Wp,toUint8ClampedArrayAsyncIterator:$p,rebaseValueOffsets:_s,compareArrayLike:Pl},Symbol.toStringTag,{value:"Module"})),Ut={fromIterable(e){return li(Gp(e))},fromAsyncIterable(e){return li(Kp(e))},fromDOMStream(e){return li(Zp(e))},fromNodeStream(e){return li(Jp(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},li=e=>(e.next(),e);function*Gp(e){let t,n=!1,r=[],s,o,i,a=0;function c(){return o==="peek"?qt(r,i)[0]:([s,r,a]=qt(r,i),s)}({cmd:o,size:i}=yield null);let u=Vl(e)[Symbol.iterator]();try{do if({done:t,value:s}=isNaN(i-a)?u.next(void 0):u.next(i-a),!t&&s.byteLength>0&&(r.push(s),a+=s.byteLength),t||i<=a)do({cmd:o,size:i}=yield c());while(i<a);while(!t)}catch(l){(n=!0)&&typeof u.throw=="function"&&u.throw(l)}finally{n===!1&&typeof u.return=="function"&&u.return()}}async function*Kp(e){let t,n=!1,r=[],s,o,i,a=0;function c(){return o==="peek"?qt(r,i)[0]:([s,r,a]=qt(r,i),s)}({cmd:o,size:i}=yield null);let u=jl(e)[Symbol.asyncIterator]();try{do if({done:t,value:s}=isNaN(i-a)?await u.next(void 0):await u.next(i-a),!t&&s.byteLength>0&&(r.push(s),a+=s.byteLength),t||i<=a)do({cmd:o,size:i}=yield c());while(i<a);while(!t)}catch(l){(n=!0)&&typeof u.throw=="function"&&await u.throw(l)}finally{n===!1&&typeof u.return=="function"&&await u.return()}}async function*Zp(e){let t=!1,n=!1,r=[],s,o,i,a=0;function c(){return o==="peek"?qt(r,i)[0]:([s,r,a]=qt(r,i),s)}({cmd:o,size:i}=yield null);let u=new Hp(e);try{do if({done:t,value:s}=isNaN(i-a)?await u.read(void 0):await u.read(i-a),!t&&s.byteLength>0&&(r.push(j(s)),a+=s.byteLength),t||i<=a)do({cmd:o,size:i}=yield c());while(i<a);while(!t)}catch(l){(n=!0)&&await u.cancel(l)}finally{n===!1?await u.cancel():e.locked&&u.releaseLock()}}class Hp{constructor(t){this.source=t,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch{this.supportsBYOB=!(this.reader=this.getDefaultReader())}}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}async cancel(t){const{reader:n,source:r}=this;n&&await n.cancel(t).catch(()=>{}),r&&r.locked&&this.releaseLock()}async read(t){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const n=!this.supportsBYOB||typeof t!="number"?await this.getDefaultReader().read():await this.readFromBYOBReader(t);return!n.done&&(n.value=j(n)),n}getDefaultReader(){return this.byobReader&&this.releaseLock(),this.defaultReader||(this.defaultReader=this.source.getReader(),this.defaultReader.closed.catch(()=>{})),this.reader=this.defaultReader}getBYOBReader(){return this.defaultReader&&this.releaseLock(),this.byobReader||(this.byobReader=this.source.getReader({mode:"byob"}),this.byobReader.closed.catch(()=>{})),this.reader=this.byobReader}async readFromBYOBReader(t){return await zl(this.getBYOBReader(),new ArrayBuffer(t),0,t)}}async function zl(e,t,n,r){if(n>=r)return{done:!1,value:new Uint8Array(t,0,r)};const{done:s,value:o}=await e.read(new Uint8Array(t,n,r-n));return(n+=o.byteLength)<r&&!s?await zl(e,o.buffer,n,r):{done:s,value:new Uint8Array(o.buffer,0,n)}}const zs=(e,t)=>{let n=s=>r([t,s]),r;return[t,n,new Promise(s=>(r=s)&&e.once(t,n))]};async function*Jp(e){let t=[],n="error",r=!1,s=null,o,i,a=0,c=[],u;function l(){return o==="peek"?qt(c,i)[0]:([u,c,a]=qt(c,i),u)}if({cmd:o,size:i}=yield null,e.isTTY)return yield new Uint8Array(0);try{t[0]=zs(e,"end"),t[1]=zs(e,"error");do{if(t[2]=zs(e,"readable"),[n,s]=await Promise.race(t.map(h=>h[2])),n==="error")break;if((r=n==="end")||(isFinite(i-a)?(u=j(e.read(i-a)),u.byteLength<i-a&&(u=j(e.read(void 0)))):u=j(e.read(void 0)),u.byteLength>0&&(c.push(u),a+=u.byteLength)),r||i<=a)do({cmd:o,size:i}=yield l());while(i<a)}while(!r)}finally{await f(t,n==="error"?s:null)}function f(h,p){return u=c=null,new Promise(async(w,_)=>{for(const[b,g]of h)e.off(b,g);try{const b=e.destroy;b&&b.call(e,p),p=void 0}catch(b){p=b||p}finally{p!=null?_(p):w()}})}}class z{}var m;(function(e){(function(t){(function(n){(function(r){(function(s){s[s.V1=0]="V1",s[s.V2=1]="V2",s[s.V3=2]="V3",s[s.V4=3]="V4"})(r.MetadataVersion||(r.MetadataVersion={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.Sparse=0]="Sparse",s[s.Dense=1]="Dense"})(r.UnionMode||(r.UnionMode={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.HALF=0]="HALF",s[s.SINGLE=1]="SINGLE",s[s.DOUBLE=2]="DOUBLE"})(r.Precision||(r.Precision={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.DAY=0]="DAY",s[s.MILLISECOND=1]="MILLISECOND"})(r.DateUnit||(r.DateUnit={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.SECOND=0]="SECOND",s[s.MILLISECOND=1]="MILLISECOND",s[s.MICROSECOND=2]="MICROSECOND",s[s.NANOSECOND=3]="NANOSECOND"})(r.TimeUnit||(r.TimeUnit={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.YEAR_MONTH=0]="YEAR_MONTH",s[s.DAY_TIME=1]="DAY_TIME"})(r.IntervalUnit||(r.IntervalUnit={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.FloatingPoint=3]="FloatingPoint",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct_=13]="Struct_",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Duration=18]="Duration",s[s.LargeBinary=19]="LargeBinary",s[s.LargeUtf8=20]="LargeUtf8",s[s.LargeList=21]="LargeList"})(r.Type||(r.Type={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.Little=0]="Little",s[s.Big=1]="Big"})(r.Endianness||(r.Endianness={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsNull(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startNull(i){i.startObject(0)}static endNull(i){return i.endObject()}static createNull(i){return s.startNull(i),s.endNull(i)}}r.Null=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsStruct_(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startStruct_(i){i.startObject(0)}static endStruct_(i){return i.endObject()}static createStruct_(i){return s.startStruct_(i),s.endStruct_(i)}}r.Struct_=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsList(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startList(i){i.startObject(0)}static endList(i){return i.endObject()}static createList(i){return s.startList(i),s.endList(i)}}r.List=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsLargeList(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startLargeList(i){i.startObject(0)}static endLargeList(i){return i.endObject()}static createLargeList(i){return s.startLargeList(i),s.endLargeList(i)}}r.LargeList=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsFixedSizeList(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}listSize(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}static startFixedSizeList(i){i.startObject(1)}static addListSize(i,a){i.addFieldInt32(0,a,0)}static endFixedSizeList(i){return i.endObject()}static createFixedSizeList(i,a){return s.startFixedSizeList(i),s.addListSize(i,a),s.endFixedSizeList(i)}}r.FixedSizeList=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsMap(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}keysSorted(){let i=this.bb.__offset(this.bb_pos,4);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startMap(i){i.startObject(1)}static addKeysSorted(i,a){i.addFieldInt8(0,+a,0)}static endMap(i){return i.endObject()}static createMap(i,a){return s.startMap(i),s.addKeysSorted(i,a),s.endMap(i)}}r.Map=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsUnion(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}mode(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(i){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readInt32(this.bb.__vector(this.bb_pos+a)+i*4):0}typeIdsLength(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.__vector_len(this.bb_pos+i):0}typeIdsArray(){let i=this.bb.__offset(this.bb_pos,6);return i?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+i),this.bb.__vector_len(this.bb_pos+i)):null}static startUnion(i){i.startObject(2)}static addMode(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.UnionMode.Sparse)}static addTypeIds(i,a){i.addFieldOffset(1,a,0)}static createTypeIdsVector(i,a){i.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)i.addInt32(a[c]);return i.endVector()}static startTypeIdsVector(i,a){i.startVector(4,a,4)}static endUnion(i){return i.endObject()}static createUnion(i,a,c){return s.startUnion(i),s.addMode(i,a),s.addTypeIds(i,c),s.endUnion(i)}}r.Union=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsInt(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}bitWidth(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}isSigned(){let i=this.bb.__offset(this.bb_pos,6);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startInt(i){i.startObject(2)}static addBitWidth(i,a){i.addFieldInt32(0,a,0)}static addIsSigned(i,a){i.addFieldInt8(1,+a,0)}static endInt(i){return i.endObject()}static createInt(i,a,c){return s.startInt(i),s.addBitWidth(i,a),s.addIsSigned(i,c),s.endInt(i)}}r.Int=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsFloatingPoint(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}precision(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(i){i.startObject(1)}static addPrecision(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(i){return i.endObject()}static createFloatingPoint(i,a){return s.startFloatingPoint(i),s.addPrecision(i,a),s.endFloatingPoint(i)}}r.FloatingPoint=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsUtf8(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startUtf8(i){i.startObject(0)}static endUtf8(i){return i.endObject()}static createUtf8(i){return s.startUtf8(i),s.endUtf8(i)}}r.Utf8=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsBinary(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startBinary(i){i.startObject(0)}static endBinary(i){return i.endObject()}static createBinary(i){return s.startBinary(i),s.endBinary(i)}}r.Binary=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsLargeUtf8(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startLargeUtf8(i){i.startObject(0)}static endLargeUtf8(i){return i.endObject()}static createLargeUtf8(i){return s.startLargeUtf8(i),s.endLargeUtf8(i)}}r.LargeUtf8=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsLargeBinary(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startLargeBinary(i){i.startObject(0)}static endLargeBinary(i){return i.endObject()}static createLargeBinary(i){return s.startLargeBinary(i),s.endLargeBinary(i)}}r.LargeBinary=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsFixedSizeBinary(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}byteWidth(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}static startFixedSizeBinary(i){i.startObject(1)}static addByteWidth(i,a){i.addFieldInt32(0,a,0)}static endFixedSizeBinary(i){return i.endObject()}static createFixedSizeBinary(i,a){return s.startFixedSizeBinary(i),s.addByteWidth(i,a),s.endFixedSizeBinary(i)}}r.FixedSizeBinary=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsBool(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}static startBool(i){i.startObject(0)}static endBool(i){return i.endObject()}static createBool(i){return s.startBool(i),s.endBool(i)}}r.Bool=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsDecimal(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}precision(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}scale(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.readInt32(this.bb_pos+i):0}static startDecimal(i){i.startObject(2)}static addPrecision(i,a){i.addFieldInt32(0,a,0)}static addScale(i,a){i.addFieldInt32(1,a,0)}static endDecimal(i){return i.endObject()}static createDecimal(i,a,c){return s.startDecimal(i),s.addPrecision(i,a),s.addScale(i,c),s.endDecimal(i)}}r.Decimal=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsDate(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(i){i.startObject(1)}static addUnit(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(i){return i.endObject()}static createDate(i,a){return s.startDate(i),s.addUnit(i,a),s.endDate(i)}}r.Date=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsTime(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.TimeUnit.MILLISECOND}bitWidth(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.readInt32(this.bb_pos+i):32}static startTime(i){i.startObject(2)}static addUnit(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(i,a){i.addFieldInt32(1,a,32)}static endTime(i){return i.endObject()}static createTime(i,a,c){return s.startTime(i),s.addUnit(i,a),s.addBitWidth(i,c),s.endTime(i)}}r.Time=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsTimestamp(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(i){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,i):null}static startTimestamp(i){i.startObject(2)}static addUnit(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(i,a){i.addFieldOffset(1,a,0)}static endTimestamp(i){return i.endObject()}static createTimestamp(i,a,c){return s.startTimestamp(i),s.addUnit(i,a),s.addTimezone(i,c),s.endTimestamp(i)}}r.Timestamp=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsInterval(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(i){i.startObject(1)}static addUnit(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(i){return i.endObject()}static createInterval(i,a){return s.startInterval(i),s.addUnit(i,a),s.endInterval(i)}}r.Interval=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsDuration(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.TimeUnit.MILLISECOND}static startDuration(i){i.startObject(1)}static addUnit(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(i){return i.endObject()}static createDuration(i,a){return s.startDuration(i),s.addUnit(i,a),s.endDuration(i)}}r.Duration=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsKeyValue(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}key(i){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,i):null}value(i){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,i):null}static startKeyValue(i){i.startObject(2)}static addKey(i,a){i.addFieldOffset(0,a,0)}static addValue(i,a){i.addFieldOffset(1,a,0)}static endKeyValue(i){return i.endObject()}static createKeyValue(i,a,c){return s.startKeyValue(i),s.addKey(i,a),s.addValue(i,c),s.endKeyValue(i)}}r.KeyValue=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsDictionaryEncoding(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}id(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}indexType(i){let a=this.bb.__offset(this.bb_pos,6);return a?(i||new e.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}isOrdered(){let i=this.bb.__offset(this.bb_pos,8);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startDictionaryEncoding(i){i.startObject(3)}static addId(i,a){i.addFieldInt64(0,a,i.createLong(0,0))}static addIndexType(i,a){i.addFieldOffset(1,a,0)}static addIsOrdered(i,a){i.addFieldInt8(2,+a,0)}static endDictionaryEncoding(i){return i.endObject()}static createDictionaryEncoding(i,a,c,u){return s.startDictionaryEncoding(i),s.addId(i,a),s.addIndexType(i,c),s.addIsOrdered(i,u),s.endDictionaryEncoding(i)}}r.DictionaryEncoding=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsField(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}name(i){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,i):null}nullable(){let i=this.bb.__offset(this.bb_pos,6);return i?!!this.bb.readInt8(this.bb_pos+i):!1}typeType(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.readUint8(this.bb_pos+i):e.apache.arrow.flatbuf.Type.NONE}type(i){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.__union(i,this.bb_pos+a):null}dictionary(i){let a=this.bb.__offset(this.bb_pos,12);return a?(i||new e.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}children(i,a){let c=this.bb.__offset(this.bb_pos,14);return c?(a||new e.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}childrenLength(){let i=this.bb.__offset(this.bb_pos,14);return i?this.bb.__vector_len(this.bb_pos+i):0}customMetadata(i,a){let c=this.bb.__offset(this.bb_pos,16);return c?(a||new e.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}customMetadataLength(){let i=this.bb.__offset(this.bb_pos,16);return i?this.bb.__vector_len(this.bb_pos+i):0}static startField(i){i.startObject(7)}static addName(i,a){i.addFieldOffset(0,a,0)}static addNullable(i,a){i.addFieldInt8(1,+a,0)}static addTypeType(i,a){i.addFieldInt8(2,a,e.apache.arrow.flatbuf.Type.NONE)}static addType(i,a){i.addFieldOffset(3,a,0)}static addDictionary(i,a){i.addFieldOffset(4,a,0)}static addChildren(i,a){i.addFieldOffset(5,a,0)}static createChildrenVector(i,a){i.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)i.addOffset(a[c]);return i.endVector()}static startChildrenVector(i,a){i.startVector(4,a,4)}static addCustomMetadata(i,a){i.addFieldOffset(6,a,0)}static createCustomMetadataVector(i,a){i.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)i.addOffset(a[c]);return i.endVector()}static startCustomMetadataVector(i,a){i.startVector(4,a,4)}static endField(i){return i.endObject()}static createField(i,a,c,u,l,f,h,p){return s.startField(i),s.addName(i,a),s.addNullable(i,c),s.addTypeType(i,u),s.addType(i,l),s.addDictionary(i,f),s.addChildren(i,h),s.addCustomMetadata(i,p),s.endField(i)}}r.Field=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(i,a,c){return i.prep(8,16),i.writeInt64(c),i.writeInt64(a),i.offset()}}r.Buffer=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsSchema(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}endianness(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.Endianness.Little}fields(i,a){let c=this.bb.__offset(this.bb_pos,6);return c?(a||new e.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}fieldsLength(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.__vector_len(this.bb_pos+i):0}customMetadata(i,a){let c=this.bb.__offset(this.bb_pos,8);return c?(a||new e.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}customMetadataLength(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.__vector_len(this.bb_pos+i):0}static startSchema(i){i.startObject(3)}static addEndianness(i,a){i.addFieldInt16(0,a,e.apache.arrow.flatbuf.Endianness.Little)}static addFields(i,a){i.addFieldOffset(1,a,0)}static createFieldsVector(i,a){i.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)i.addOffset(a[c]);return i.endVector()}static startFieldsVector(i,a){i.startVector(4,a,4)}static addCustomMetadata(i,a){i.addFieldOffset(2,a,0)}static createCustomMetadataVector(i,a){i.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)i.addOffset(a[c]);return i.endVector()}static startCustomMetadataVector(i,a){i.startVector(4,a,4)}static endSchema(i){return i.endObject()}static finishSchemaBuffer(i,a){i.finish(a)}static createSchema(i,a,c,u){return s.startSchema(i),s.addEndianness(i,a),s.addFields(i,c),s.addCustomMetadata(i,u),s.endSchema(i)}}r.Schema=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(m||(m={}));var gt;(function(e){(function(t){(function(n){(function(r){r.Schema=m.apache.arrow.flatbuf.Schema})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(gt||(gt={}));(function(e){(function(t){(function(n){(function(r){(function(s){s[s.NONE=0]="NONE",s[s.Schema=1]="Schema",s[s.DictionaryBatch=2]="DictionaryBatch",s[s.RecordBatch=3]="RecordBatch",s[s.Tensor=4]="Tensor",s[s.SparseTensor=5]="SparseTensor"})(r.MessageHeader||(r.MessageHeader={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(gt||(gt={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(i,a,c){return i.prep(8,16),i.writeInt64(c),i.writeInt64(a),i.offset()}}r.FieldNode=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(gt||(gt={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsRecordBatch(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}length(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}nodes(i,a){let c=this.bb.__offset(this.bb_pos,6);return c?(a||new e.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+c)+i*16,this.bb):null}nodesLength(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.__vector_len(this.bb_pos+i):0}buffers(i,a){let c=this.bb.__offset(this.bb_pos,8);return c?(a||new m.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+c)+i*16,this.bb):null}buffersLength(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.__vector_len(this.bb_pos+i):0}static startRecordBatch(i){i.startObject(3)}static addLength(i,a){i.addFieldInt64(0,a,i.createLong(0,0))}static addNodes(i,a){i.addFieldOffset(1,a,0)}static startNodesVector(i,a){i.startVector(16,a,8)}static addBuffers(i,a){i.addFieldOffset(2,a,0)}static startBuffersVector(i,a){i.startVector(16,a,8)}static endRecordBatch(i){return i.endObject()}static createRecordBatch(i,a,c,u){return s.startRecordBatch(i),s.addLength(i,a),s.addNodes(i,c),s.addBuffers(i,u),s.endRecordBatch(i)}}r.RecordBatch=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(gt||(gt={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsDictionaryBatch(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}id(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}data(i){let a=this.bb.__offset(this.bb_pos,6);return a?(i||new e.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}isDelta(){let i=this.bb.__offset(this.bb_pos,8);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startDictionaryBatch(i){i.startObject(3)}static addId(i,a){i.addFieldInt64(0,a,i.createLong(0,0))}static addData(i,a){i.addFieldOffset(1,a,0)}static addIsDelta(i,a){i.addFieldInt8(2,+a,0)}static endDictionaryBatch(i){return i.endObject()}static createDictionaryBatch(i,a,c,u){return s.startDictionaryBatch(i),s.addId(i,a),s.addData(i,c),s.addIsDelta(i,u),s.endDictionaryBatch(i)}}r.DictionaryBatch=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(gt||(gt={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsMessage(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}version(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):m.apache.arrow.flatbuf.MetadataVersion.V1}headerType(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.readUint8(this.bb_pos+i):e.apache.arrow.flatbuf.MessageHeader.NONE}header(i){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__union(i,this.bb_pos+a):null}bodyLength(){let i=this.bb.__offset(this.bb_pos,10);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}customMetadata(i,a){let c=this.bb.__offset(this.bb_pos,12);return c?(a||new m.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}customMetadataLength(){let i=this.bb.__offset(this.bb_pos,12);return i?this.bb.__vector_len(this.bb_pos+i):0}static startMessage(i){i.startObject(5)}static addVersion(i,a){i.addFieldInt16(0,a,m.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(i,a){i.addFieldInt8(1,a,e.apache.arrow.flatbuf.MessageHeader.NONE)}static addHeader(i,a){i.addFieldOffset(2,a,0)}static addBodyLength(i,a){i.addFieldInt64(3,a,i.createLong(0,0))}static addCustomMetadata(i,a){i.addFieldOffset(4,a,0)}static createCustomMetadataVector(i,a){i.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)i.addOffset(a[c]);return i.endVector()}static startCustomMetadataVector(i,a){i.startVector(4,a,4)}static endMessage(i){return i.endObject()}static finishMessageBuffer(i,a){i.finish(a)}static createMessage(i,a,c,u,l,f){return s.startMessage(i),s.addVersion(i,a),s.addHeaderType(i,c),s.addHeader(i,u),s.addBodyLength(i,l),s.addCustomMetadata(i,f),s.endMessage(i)}}r.Message=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(gt||(gt={}));m.apache.arrow.flatbuf.Type;var ue=m.apache.arrow.flatbuf.DateUnit,Z=m.apache.arrow.flatbuf.TimeUnit,Pt=m.apache.arrow.flatbuf.Precision,Ae=m.apache.arrow.flatbuf.UnionMode,Kn=m.apache.arrow.flatbuf.IntervalUnit,Q=gt.apache.arrow.flatbuf.MessageHeader,Gt=m.apache.arrow.flatbuf.MetadataVersion,d;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"})(d||(d={}));var T;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(T||(T={}));function la(e,t,n,r){return(n&1<<r)!==0}function Wl(e,t,n,r){return(n&1<<r)>>r}function $l(e,t,n){return n?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function Ss(e,t,n){const r=n.byteLength+7&-8;if(e>0||n.byteLength<r){const s=new Uint8Array(r);return s.set(e%8===0?n.subarray(e>>3):Fr(Gr(n,e,t,null,la)).subarray(0,r)),s}return n}function Fr(e){let t=[],n=0,r=0,s=0;for(const i of e)i&&(s|=1<<r),++r===8&&(t[n++]=s,s=r=0);(n===0||r>0)&&(t[n++]=s);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}function*Gr(e,t,n,r,s){let o=t%8,i=t>>3,a=0,c=n;for(;c>0;o=0){let u=e[i++];do yield s(r,a++,u,o);while(--c>0&&++o<8)}}function ji(e,t,n){if(n-t<=0)return 0;if(n-t<8){let o=0;for(const i of Gr(e,t,n-t,e,Wl))o+=i;return o}const r=n>>3<<3,s=t+(t%8===0?0:8-t%8);return ji(e,t,s)+ji(e,r,n)+Yl(e,s>>3,r-s>>3)}function Yl(e,t,n){let r=0,s=t|0;const o=new DataView(e.buffer,e.byteOffset,e.byteLength),i=n===void 0?e.byteLength:s+n;for(;i-s>=4;)r+=Bi(o.getUint32(s)),s+=4;for(;i-s>=2;)r+=Bi(o.getUint16(s)),s+=2;for(;i-s>=1;)r+=Bi(o.getUint8(s)),s+=1;return r}function Bi(e){let t=e|0;return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const Xp=Object.freeze(Object.defineProperty({__proto__:null,getBool:la,getBit:Wl,setBool:$l,truncateBitmap:Ss,packBools:Fr,iterateBits:Gr,popcnt_bit_range:ji,popcnt_array:Yl,popcnt_uint32:Bi},Symbol.toStringTag,{value:"Module"}));class V{visitMany(t,...n){return t.map((r,s)=>this.visit(r,...n.map(o=>o[s])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return qp(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}}function qp(e,t,n=!0){let r=null,s=d.NONE;switch(t instanceof S||t instanceof z?s=Ws(t.type):t instanceof U?s=Ws(t):typeof(s=t)!="number"&&(s=d[t]),s){case d.Null:r=e.visitNull;break;case d.Bool:r=e.visitBool;break;case d.Int:r=e.visitInt;break;case d.Int8:r=e.visitInt8||e.visitInt;break;case d.Int16:r=e.visitInt16||e.visitInt;break;case d.Int32:r=e.visitInt32||e.visitInt;break;case d.Int64:r=e.visitInt64||e.visitInt;break;case d.Uint8:r=e.visitUint8||e.visitInt;break;case d.Uint16:r=e.visitUint16||e.visitInt;break;case d.Uint32:r=e.visitUint32||e.visitInt;break;case d.Uint64:r=e.visitUint64||e.visitInt;break;case d.Float:r=e.visitFloat;break;case d.Float16:r=e.visitFloat16||e.visitFloat;break;case d.Float32:r=e.visitFloat32||e.visitFloat;break;case d.Float64:r=e.visitFloat64||e.visitFloat;break;case d.Utf8:r=e.visitUtf8;break;case d.Binary:r=e.visitBinary;break;case d.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case d.Date:r=e.visitDate;break;case d.DateDay:r=e.visitDateDay||e.visitDate;break;case d.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case d.Timestamp:r=e.visitTimestamp;break;case d.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case d.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case d.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case d.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case d.Time:r=e.visitTime;break;case d.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case d.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case d.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case d.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case d.Decimal:r=e.visitDecimal;break;case d.List:r=e.visitList;break;case d.Struct:r=e.visitStruct;break;case d.Union:r=e.visitUnion;break;case d.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case d.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case d.Dictionary:r=e.visitDictionary;break;case d.Interval:r=e.visitInterval;break;case d.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case d.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case d.FixedSizeList:r=e.visitFixedSizeList;break;case d.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${d[s]}'`)}function Ws(e){switch(e.typeId){case d.Null:return d.Null;case d.Int:const{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?d.Int8:d.Uint8;case 16:return n?d.Int16:d.Uint16;case 32:return n?d.Int32:d.Uint32;case 64:return n?d.Int64:d.Uint64}return d.Int;case d.Float:switch(e.precision){case Pt.HALF:return d.Float16;case Pt.SINGLE:return d.Float32;case Pt.DOUBLE:return d.Float64}return d.Float;case d.Binary:return d.Binary;case d.Utf8:return d.Utf8;case d.Bool:return d.Bool;case d.Decimal:return d.Decimal;case d.Time:switch(e.unit){case Z.SECOND:return d.TimeSecond;case Z.MILLISECOND:return d.TimeMillisecond;case Z.MICROSECOND:return d.TimeMicrosecond;case Z.NANOSECOND:return d.TimeNanosecond}return d.Time;case d.Timestamp:switch(e.unit){case Z.SECOND:return d.TimestampSecond;case Z.MILLISECOND:return d.TimestampMillisecond;case Z.MICROSECOND:return d.TimestampMicrosecond;case Z.NANOSECOND:return d.TimestampNanosecond}return d.Timestamp;case d.Date:switch(e.unit){case ue.DAY:return d.DateDay;case ue.MILLISECOND:return d.DateMillisecond}return d.Date;case d.Interval:switch(e.unit){case Kn.DAY_TIME:return d.IntervalDayTime;case Kn.YEAR_MONTH:return d.IntervalYearMonth}return d.Interval;case d.Map:return d.Map;case d.List:return d.List;case d.Struct:return d.Struct;case d.Union:switch(e.mode){case Ae.Dense:return d.DenseUnion;case Ae.Sparse:return d.SparseUnion}return d.Union;case d.FixedSizeBinary:return d.FixedSizeBinary;case d.FixedSizeList:return d.FixedSizeList;case d.Dictionary:return d.Dictionary}throw new Error(`Unrecognized type '${d[e.typeId]}'`)}V.prototype.visitInt8=null;V.prototype.visitInt16=null;V.prototype.visitInt32=null;V.prototype.visitInt64=null;V.prototype.visitUint8=null;V.prototype.visitUint16=null;V.prototype.visitUint32=null;V.prototype.visitUint64=null;V.prototype.visitFloat16=null;V.prototype.visitFloat32=null;V.prototype.visitFloat64=null;V.prototype.visitDateDay=null;V.prototype.visitDateMillisecond=null;V.prototype.visitTimestampSecond=null;V.prototype.visitTimestampMillisecond=null;V.prototype.visitTimestampMicrosecond=null;V.prototype.visitTimestampNanosecond=null;V.prototype.visitTimeSecond=null;V.prototype.visitTimeMillisecond=null;V.prototype.visitTimeMicrosecond=null;V.prototype.visitTimeNanosecond=null;V.prototype.visitDenseUnion=null;V.prototype.visitSparseUnion=null;V.prototype.visitIntervalDayTime=null;V.prototype.visitIntervalYearMonth=null;class B extends V{compareSchemas(t,n){return t===n||n instanceof t.constructor&&Nt.compareFields(t.fields,n.fields)}compareFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,s)=>Nt.compareField(r,n[s]))}compareField(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&Nt.visit(t.type,n.type)}}function Lt(e,t){return t instanceof e.constructor}function Kr(e,t){return e===t||Lt(e,t)}function De(e,t){return e===t||Lt(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Is(e,t){return e===t||Lt(e,t)&&e.precision===t.precision}function Qp(e,t){return e===t||Lt(e,t)&&e.byteWidth===t.byteWidth}function fa(e,t){return e===t||Lt(e,t)&&e.unit===t.unit}function Zr(e,t){return e===t||Lt(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Hr(e,t){return e===t||Lt(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function ty(e,t){return e===t||Lt(e,t)&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}function ey(e,t){return e===t||Lt(e,t)&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}function ha(e,t){return e===t||Lt(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&Nt.compareFields(e.children,t.children)}function ny(e,t){return e===t||Lt(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Nt.visit(e.indices,t.indices)&&Nt.visit(e.dictionary,t.dictionary)}function da(e,t){return e===t||Lt(e,t)&&e.unit===t.unit}function ry(e,t){return e===t||Lt(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}function iy(e,t){return e===t||Lt(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}B.prototype.visitNull=Kr;B.prototype.visitBool=Kr;B.prototype.visitInt=De;B.prototype.visitInt8=De;B.prototype.visitInt16=De;B.prototype.visitInt32=De;B.prototype.visitInt64=De;B.prototype.visitUint8=De;B.prototype.visitUint16=De;B.prototype.visitUint32=De;B.prototype.visitUint64=De;B.prototype.visitFloat=Is;B.prototype.visitFloat16=Is;B.prototype.visitFloat32=Is;B.prototype.visitFloat64=Is;B.prototype.visitUtf8=Kr;B.prototype.visitBinary=Kr;B.prototype.visitFixedSizeBinary=Qp;B.prototype.visitDate=fa;B.prototype.visitDateDay=fa;B.prototype.visitDateMillisecond=fa;B.prototype.visitTimestamp=Zr;B.prototype.visitTimestampSecond=Zr;B.prototype.visitTimestampMillisecond=Zr;B.prototype.visitTimestampMicrosecond=Zr;B.prototype.visitTimestampNanosecond=Zr;B.prototype.visitTime=Hr;B.prototype.visitTimeSecond=Hr;B.prototype.visitTimeMillisecond=Hr;B.prototype.visitTimeMicrosecond=Hr;B.prototype.visitTimeNanosecond=Hr;B.prototype.visitDecimal=Kr;B.prototype.visitList=ty;B.prototype.visitStruct=ey;B.prototype.visitUnion=ha;B.prototype.visitDenseUnion=ha;B.prototype.visitSparseUnion=ha;B.prototype.visitDictionary=ny;B.prototype.visitInterval=da;B.prototype.visitIntervalDayTime=da;B.prototype.visitIntervalYearMonth=da;B.prototype.visitFixedSizeList=ry;B.prototype.visitMap=iy;const Nt=new B;class U{static isNull(t){return t&&t.typeId===d.Null}static isInt(t){return t&&t.typeId===d.Int}static isFloat(t){return t&&t.typeId===d.Float}static isBinary(t){return t&&t.typeId===d.Binary}static isUtf8(t){return t&&t.typeId===d.Utf8}static isBool(t){return t&&t.typeId===d.Bool}static isDecimal(t){return t&&t.typeId===d.Decimal}static isDate(t){return t&&t.typeId===d.Date}static isTime(t){return t&&t.typeId===d.Time}static isTimestamp(t){return t&&t.typeId===d.Timestamp}static isInterval(t){return t&&t.typeId===d.Interval}static isList(t){return t&&t.typeId===d.List}static isStruct(t){return t&&t.typeId===d.Struct}static isUnion(t){return t&&t.typeId===d.Union}static isFixedSizeBinary(t){return t&&t.typeId===d.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===d.FixedSizeList}static isMap(t){return t&&t.typeId===d.Map}static isDictionary(t){return t&&t.typeId===d.Dictionary}get typeId(){return d.NONE}compareTo(t){return Nt.visit(this,t)}}U[Symbol.toStringTag]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(U.prototype);class Zn extends U{toString(){return"Null"}get typeId(){return d.Null}}Zn[Symbol.toStringTag]=(e=>e[Symbol.toStringTag]="Null")(Zn.prototype);class xt extends U{constructor(t,n){super(),this.isSigned=t,this.bitWidth=n}get typeId(){return d.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?Int32Array:Uint32Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}xt[Symbol.toStringTag]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(xt.prototype);class pa extends xt{constructor(){super(!0,8)}}class ya extends xt{constructor(){super(!0,16)}}class fn extends xt{constructor(){super(!0,32)}}class Hn extends xt{constructor(){super(!0,64)}}class ba extends xt{constructor(){super(!1,8)}}class ma extends xt{constructor(){super(!1,16)}}class ga extends xt{constructor(){super(!1,32)}}class Jn extends xt{constructor(){super(!1,64)}}Object.defineProperty(pa.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(ya.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(fn.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Hn.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(ba.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(ma.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(ga.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Jn.prototype,"ArrayType",{value:Uint32Array});class hn extends U{constructor(t){super(),this.precision=t}get typeId(){return d.Float}get ArrayType(){switch(this.precision){case Pt.HALF:return Uint16Array;case Pt.SINGLE:return Float32Array;case Pt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}hn[Symbol.toStringTag]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(hn.prototype);class Ts extends hn{constructor(){super(Pt.HALF)}}class va extends hn{constructor(){super(Pt.SINGLE)}}class wa extends hn{constructor(){super(Pt.DOUBLE)}}Object.defineProperty(Ts.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(va.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(wa.prototype,"ArrayType",{value:Float64Array});class xr extends U{constructor(){super()}get typeId(){return d.Binary}toString(){return"Binary"}}xr[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(xr.prototype);class Xn extends U{constructor(){super()}get typeId(){return d.Utf8}toString(){return"Utf8"}}Xn[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Xn.prototype);class Lr extends U{constructor(){super()}get typeId(){return d.Bool}toString(){return"Bool"}}Lr[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Lr.prototype);class Pi extends U{constructor(t,n){super(),this.scale=t,this.precision=n}get typeId(){return d.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}Pi[Symbol.toStringTag]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Pi.prototype);class qn extends U{constructor(t){super(),this.unit=t}get typeId(){return d.Date}toString(){return`Date${(this.unit+1)*32}<${ue[this.unit]}>`}}qn[Symbol.toStringTag]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(qn.prototype);class sy extends qn{constructor(){super(ue.DAY)}}class Uc extends qn{constructor(){super(ue.MILLISECOND)}}class zi extends U{constructor(t,n){super(),this.unit=t,this.bitWidth=n}get typeId(){return d.Time}toString(){return`Time${this.bitWidth}<${Z[this.unit]}>`}}zi[Symbol.toStringTag]=(e=>(e.unit=null,e.bitWidth=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Time"))(zi.prototype);class Wi extends U{constructor(t,n){super(),this.unit=t,this.timezone=n}get typeId(){return d.Timestamp}toString(){return`Timestamp<${Z[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Wi[Symbol.toStringTag]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(Wi.prototype);class $i extends U{constructor(t){super(),this.unit=t}get typeId(){return d.Interval}toString(){return`Interval<${Kn[this.unit]}>`}}$i[Symbol.toStringTag]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))($i.prototype);class Qn extends U{constructor(t){super(),this.children=[t]}get typeId(){return d.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}Qn[Symbol.toStringTag]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(Qn.prototype);class Qt extends U{constructor(t){super(),this.children=t}get typeId(){return d.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Qt[Symbol.toStringTag]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(Qt.prototype);class Dr extends U{constructor(t,n,r){super(),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((s,o,i)=>(s[o]=i)&&s||s,Object.create(null))}get typeId(){return d.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Dr[Symbol.toStringTag]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Dr.prototype);class Yi extends U{constructor(t){super(),this.byteWidth=t}get typeId(){return d.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Yi[Symbol.toStringTag]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(Yi.prototype);class kr extends U{constructor(t,n){super(),this.listSize=t,this.children=[n]}get typeId(){return d.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}kr[Symbol.toStringTag]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(kr.prototype);class Er extends U{constructor(t,n=!1){super(),this.children=[t],this.keysSorted=n}get typeId(){return d.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Er[Symbol.toStringTag]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Er.prototype);const oy=(e=>()=>++e)(-1);class Ge extends U{constructor(t,n,r,s){super(),this.indices=n,this.dictionary=t,this.isOrdered=s||!1,this.id=r==null?oy():typeof r=="number"?r:r.low}get typeId(){return d.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Ge[Symbol.toStringTag]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Ge.prototype);function Gl(e){let t=e;switch(e.typeId){case d.Decimal:return 4;case d.Timestamp:return 2;case d.Date:return 1+t.unit;case d.Interval:return 1+t.unit;case d.Int:return 1+ +(t.bitWidth>32);case d.Time:return 1+ +(t.bitWidth>32);case d.FixedSizeList:return t.listSize;case d.FixedSizeBinary:return t.byteWidth;default:return 1}}const ay=-1;class S{constructor(t,n,r,s,o,i,a){this.type=t,this.dictionary=a,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1)),this.childData=(i||[]).map(u=>u instanceof S?u:u.data);let c;o instanceof S?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=Gl(t),o&&((c=o[0])&&(this.valueOffsets=c),(c=o[1])&&(this.values=c),(c=o[2])&&(this.nullBitmap=c),(c=o[3])&&(this.typeIds=c)))}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:n,values:r,nullBitmap:s,typeIds:o}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),s&&(t+=s.byteLength),o&&(t+=o.byteLength),this.childData.reduce((i,a)=>i+a.byteLength,t)}get nullCount(){let t=this._nullCount,n;return t<=ay&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-ji(n,this.offset,this.offset+this.length)),t}clone(t,n=this.offset,r=this.length,s=this._nullCount,o=this,i=this.childData){return new S(t,n,r,s,o,i,this.dictionary)}slice(t,n){const{stride:r,typeId:s,childData:o}=this,i=+(this._nullCount===0)-1,a=s===16?r:1,c=this._sliceBuffers(t,n,r,s);return this.clone(this.type,this.offset+t,n,i,c,!o.length||this.valueOffsets?o:this._sliceChildren(o,a*t,a*n))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===d.Null)return this.clone(this.type,0,t,0);const{length:n,nullCount:r}=this,s=new Uint8Array((t+63&-64)>>3).fill(255,0,n>>3);s[n>>3]=(1<<n-(n&-8))-1,r>0&&s.set(Ss(this.offset,n,this.nullBitmap),0);const o=this.buffers;return o[T.VALIDITY]=s,this.clone(this.type,0,t,r+(t-n),o)}_sliceBuffers(t,n,r,s){let o,{buffers:i}=this;return(o=i[T.TYPE])&&(i[T.TYPE]=o.subarray(t,t+n)),(o=i[T.OFFSET])&&(i[T.OFFSET]=o.subarray(t,t+n+1))||(o=i[T.DATA])&&(i[T.DATA]=s===6?o:o.subarray(r*t,r*(t+n))),i}_sliceChildren(t,n,r){return t.map(s=>s.slice(n,r))}static new(t,n,r,s,o,i,a){switch(o instanceof S?o=o.buffers:o||(o=[]),t.typeId){case d.Null:return S.Null(t,n,r);case d.Int:return S.Int(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Dictionary:return S.Dictionary(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[],a);case d.Float:return S.Float(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Bool:return S.Bool(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Decimal:return S.Decimal(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Date:return S.Date(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Time:return S.Time(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Timestamp:return S.Timestamp(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Interval:return S.Interval(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.FixedSizeBinary:return S.FixedSizeBinary(t,n,r,s||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Binary:return S.Binary(t,n,r,s||0,o[T.VALIDITY],o[T.OFFSET]||[],o[T.DATA]||[]);case d.Utf8:return S.Utf8(t,n,r,s||0,o[T.VALIDITY],o[T.OFFSET]||[],o[T.DATA]||[]);case d.List:return S.List(t,n,r,s||0,o[T.VALIDITY],o[T.OFFSET]||[],(i||[])[0]);case d.FixedSizeList:return S.FixedSizeList(t,n,r,s||0,o[T.VALIDITY],(i||[])[0]);case d.Struct:return S.Struct(t,n,r,s||0,o[T.VALIDITY],i||[]);case d.Map:return S.Map(t,n,r,s||0,o[T.VALIDITY],o[T.OFFSET]||[],(i||[])[0]);case d.Union:return S.Union(t,n,r,s||0,o[T.VALIDITY],o[T.TYPE]||[],o[T.OFFSET]||i,i)}throw new Error(`Unrecognized typeId ${t.typeId}`)}static Null(t,n,r){return new S(t,n,r,0)}static Int(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Dictionary(t,n,r,s,o,i,a){return new S(t,n,r,s,[void 0,R(t.indices.ArrayType,i),j(o)],[],a)}static Float(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Bool(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Decimal(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Date(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Time(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Timestamp(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Interval(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static FixedSizeBinary(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,R(t.ArrayType,i),j(o)])}static Binary(t,n,r,s,o,i,a){return new S(t,n,r,s,[Dn(i),j(a),j(o)])}static Utf8(t,n,r,s,o,i,a){return new S(t,n,r,s,[Dn(i),j(a),j(o)])}static List(t,n,r,s,o,i,a){return new S(t,n,r,s,[Dn(i),void 0,j(o)],[a])}static FixedSizeList(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,void 0,j(o)],[i])}static Struct(t,n,r,s,o,i){return new S(t,n,r,s,[void 0,void 0,j(o)],i)}static Map(t,n,r,s,o,i,a){return new S(t,n,r,s,[Dn(i),void 0,j(o)],[a])}static Union(t,n,r,s,o,i,a,c){const u=[void 0,void 0,j(o),R(t.ArrayType,i)];return t.mode===Ae.Sparse?new S(t,n,r,s,u,a):(u[T.OFFSET]=Dn(a),new S(t,n,r,s,u,c))}}S.prototype.childData=Object.freeze([]);const cy=void 0;function Sr(e){if(e===null)return"null";if(e===cy)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e)}function uy(e){if(!e||e.length<=0)return function(s){return!0};let t="",n=e.filter(r=>r===r);return n.length>0&&(t=`
    switch (x) {${n.map(r=>`
        case ${ly(r)}:`).join("")}
            return false;
    }`),e.length!==n.length&&(t=`if (x !== x) return false;
${t}`),new Function("x",`${t}
return true;`)}function ly(e){return typeof e!="bigint"?Sr(e):ws?`${Sr(e)}n`:`"${Sr(e)}"`}const $s=(e,t)=>(e*t+63&-64||64)/t,fy=(e,t=0)=>e.length>=t?e.subarray(0,t):Or(new e.constructor(t),e,0);class Jr{constructor(t,n=1){this.buffer=t,this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=t.length/n|0)}get byteLength(){return this.length*this.stride*this.BYTES_PER_ELEMENT|0}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const n=this.stride,r=this.length*n,s=this.buffer.length;r>=s&&this._resize(s===0?$s(r*1,this.BYTES_PER_ELEMENT):$s(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=$s(t*this.stride,this.BYTES_PER_ELEMENT);const n=fy(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Or(new this.ArrayType(t),this.buffer)}}Jr.prototype.offset=0;class Xr extends Jr{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,n){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=n,this}}class Kl extends Xr{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){const{buffer:r}=this.reserve(t-this.length+1),s=t>>3,o=t%8,i=r[s]>>o&1;return n?i===0&&(r[s]|=1<<o,++this.numValid):i===1&&(r[s]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}}class Zl extends Xr{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,n){const r=this.length-1,s=this.reserve(t-r+1).buffer;return r<t++&&s.fill(s[r],r,t),s[t]=s[t-1]+n,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}}class Hl extends Jr{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?ar:Yr)}set(t,n){switch(this.reserve(t-this.length+1),typeof n){case"bigint":this.buffer64[t]=n;break;case"number":this.buffer[t*this.stride]=n;break;default:this.buffer.set(n,t*this.stride)}return this}_resize(t){const n=super._resize(t),r=n.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return ws&&(this.buffer64=new this.ArrayType64(n.buffer,n.byteOffset,r)),n}}class at{constructor({type:t,nullValues:n}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=n,this.stride=Gl(t),this._nulls=new Kl,n&&n.length>0&&(this._isValid=uy(n))}static new(t){}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}static throughIterable(t){return hy(t)}static throughAsyncIterable(t){return dy(t)}toVector(){return z.new(this.flush())}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),this._typeIds&&(t+=this._typeIds.byteLength),this.children.reduce((n,r)=>n+r.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((n,r)=>n+r.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){const t=[],n=this._values,r=this._offsets,s=this._typeIds,{length:o,nullCount:i}=this;s?(t[T.TYPE]=s.flush(o),r&&(t[T.OFFSET]=r.flush(o))):r?(n&&(t[T.DATA]=n.flush(r.last())),t[T.OFFSET]=r.flush(o)):n&&(t[T.DATA]=n.flush(o)),i>0&&(t[T.VALIDITY]=this._nulls.flush(o));const a=S.new(this.type,0,o,i,t,this.children.map(c=>c.flush()));return this.clear(),a}finish(){return this.finished=!0,this.children.forEach(t=>t.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(t=>t.clear()),this}}at.prototype.length=1;at.prototype.stride=1;at.prototype.children=null;at.prototype.finished=!1;at.prototype.nullValues=null;at.prototype._isValid=()=>!0;class Je extends at{constructor(t){super(t),this._values=new Xr(new this.ArrayType(0),this.stride)}setValue(t,n){const r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}}class As extends at{constructor(t){super(t),this._pendingLength=0,this._offsets=new Zl}setValue(t,n){const r=this._pending||(this._pending=new Map),s=r.get(t);s&&(this._pendingLength-=s.length),this._pendingLength+=n.length,r.set(t,n)}setValid(t,n){return super.setValid(t,n)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){const t=this._pending,n=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,n),this}}function hy(e){const{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:n=t!=="bytes"?1e3:2**14}=e,r=t!=="bytes"?"length":"byteLength";return function*(s){let o=0,i=at.new(e);for(const a of s)i.append(a)[r]>=n&&++o&&(yield i.toVector());(i.finish().length>0||o===0)&&(yield i.toVector())}}function dy(e){const{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:n=t!=="bytes"?1e3:2**14}=e,r=t!=="bytes"?"length":"byteLength";return async function*(s){let o=0,i=at.new(e);for await(const a of s)i.append(a)[r]>=n&&++o&&(yield i.toVector());(i.finish().length>0||o===0)&&(yield i.toVector())}}class py extends at{constructor(t){super(t),this._values=new Kl}setValue(t,n){this._values.set(t,+n)}}class yy extends at{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}}class _a extends Je{}class by extends _a{}class my extends _a{}class gy extends Je{}class vy extends at{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new Ge(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=at.new({type:this.type.indices,nullValues:n}),this.dictionary=at.new({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,n){const r=this.indices;return n=r.setValid(t,n),this.length=r.length,n}setValue(t,n){let r=this._keysToIndices,s=this.valueToKey(n),o=r[s];return o===void 0&&(r[s]=o=this._dictionaryOffset+this.dictionary.append(n).length-1),this.indices.setValue(t,o)}flush(){const t=this.type,n=this._dictionary,r=this.dictionary.toVector(),s=this.indices.flush().clone(t);return s.dictionary=n?n.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=s.dictionary,this.clear(),s}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}class wy extends Je{}const Jl=new Float64Array(1),Bn=new Uint32Array(Jl.buffer);function Xl(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function Sa(e){if(e!==e)return 32256;Jl[0]=e;let t=(Bn[1]&2147483648)>>16&65535,n=Bn[1]&2146435072,r=0;return n>=1089470464?Bn[0]>0?n=31744:(n=(n&2080374784)>>16,r=(Bn[1]&1048575)>>10):n<=1056964608?(r=1048576+(Bn[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(Bn[1]&1048575)+512>>10),t|n|r&65535}const _y=Object.freeze(Object.defineProperty({__proto__:null,uint16ToFloat64:Xl,float64ToUint16:Sa},Symbol.toStringTag,{value:"Module"}));class Bs extends Je{}class Sy extends Bs{setValue(t,n){this._values.set(t,Sa(n))}}class Iy extends Bs{setValue(t,n){this._values.set(t,n)}}class Ty extends Bs{setValue(t,n){this._values.set(t,n)}}const ql=Symbol.for("isArrowBigNum");function ne(e,...t){return t.length===0?Object.setPrototypeOf(R(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}ne.prototype[ql]=!0;ne.prototype.toJSON=function(){return`"${Pe(this)}"`};ne.prototype.valueOf=function(){return Ql(this)};ne.prototype.toString=function(){return Pe(this)};ne.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return Ql(this);case"string":return Pe(this);case"default":return Nr(this)}return Pe(this)};function Rn(...e){return ne.apply(this,e)}function Vn(...e){return ne.apply(this,e)}function Ur(...e){return ne.apply(this,e)}Object.setPrototypeOf(Rn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Vn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ur.prototype,Object.create(Uint32Array.prototype));Object.assign(Rn.prototype,ne.prototype,{constructor:Rn,signed:!0,TypedArray:Int32Array,BigIntArray:ar});Object.assign(Vn.prototype,ne.prototype,{constructor:Vn,signed:!1,TypedArray:Uint32Array,BigIntArray:Yr});Object.assign(Ur.prototype,ne.prototype,{constructor:Ur,signed:!0,TypedArray:Uint32Array,BigIntArray:Yr});function Ql(e){let{buffer:t,byteOffset:n,length:r,signed:s}=e,o=new Int32Array(t,n,r),i=0,a=0,c=o.length,u,l;for(;a<c;)l=o[a++],u=o[a++],s||(u=u>>>0),i+=(l>>>0)+u*a**32;return i}let Pe,Nr;ws?(Nr=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Ys(e),Pe=e=>e.byteLength===8?`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`:Ys(e)):(Pe=Ys,Nr=Pe);function Ys(e){let t="",n=new Uint32Array(2),r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),s=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,i=r.length-1;do{for(n[0]=r[o=0];o<i;)r[o++]=n[1]=n[0]/10,n[0]=(n[0]-n[1]*10<<16)+r[o];r[o]=n[1]=n[0]/10,n[0]=n[0]-n[1]*10,t=`${n[0]}${t}`}while(s[0]||s[1]||s[2]||s[3]);return t||"0"}class _n{constructor(t,n){return _n.new(t,n)}static new(t,n){switch(n){case!0:return new Rn(t);case!1:return new Vn(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case ar:return new Rn(t)}return t.byteLength===16?new Ur(t):new Vn(t)}static signed(t){return new Rn(t)}static unsigned(t){return new Vn(t)}static decimal(t){return new Ur(t)}}const Ay=Object.freeze(Object.defineProperty({__proto__:null,isArrowBigNumSymbol:ql,get bignumToString(){return Pe},get bignumToBigInt(){return Nr},BN:_n},Symbol.toStringTag,{value:"Module"}));class ke extends Je{setValue(t,n){this._values.set(t,n)}}class By extends ke{}class Oy extends ke{}class Fy extends ke{}class xy extends ke{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(Gi)),super(t),this._values=new Hl(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(Gi(t))}}class Ly extends ke{}class Dy extends ke{}class ky extends ke{}class Ey extends ke{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(Gi)),super(t),this._values=new Hl(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(Gi(t))}}const Gi=(e=>t=>(ArrayBuffer.isView(t)&&(e.buffer=t.buffer,e.byteOffset=t.byteOffset,e.byteLength=t.byteLength,t=Nr(e),e.buffer=null),t))({BigIntArray:ar});class qr extends Je{}class Uy extends qr{}class Ny extends qr{}class My extends qr{}class Cy extends qr{}class Qr extends Je{}class Ry extends Qr{}class Vy extends Qr{}class jy extends Qr{}class Py extends Qr{}class Ia extends Je{}class zy extends Ia{}class Wy extends Ia{}class tf extends As{constructor(t){super(t),this._values=new Jr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,j(n))}_flushPending(t,n){const r=this._offsets,s=this._values.reserve(n).buffer;let o=0,i=0,a=0,c;for([o,c]of t)c===void 0?r.set(o,0):(i=c.length,s.set(c,a),r.set(o,i),a+=i)}}class Ta extends As{constructor(t){super(t),this._values=new Jr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,vs(n))}_flushPending(t,n){}}Ta.prototype._flushPending=tf.prototype._flushPending;class ef{get length(){return this._values.length}get(t){return this._values[t]}clear(){return this._values=null,this}bind(t){return t instanceof z?t:(this._values=t,this)}}const bt=Symbol.for("parent"),jn=Symbol.for("rowIndex"),Et=Symbol.for("keyToIdx"),kt=Symbol.for("idxToVal"),Oo=Symbol.for("nodejs.util.inspect.custom");class _e{constructor(t,n){this[bt]=t,this.size=n}entries(){return this[Symbol.iterator]()}has(t){return this.get(t)!==void 0}get(t){let n;if(t!=null){const r=this[Et]||(this[Et]=new Map);let s=r.get(t);if(s!==void 0){const o=this[kt]||(this[kt]=new Array(this.size));(n=o[s])!==void 0||(o[s]=n=this.getValue(s))}else if((s=this.getIndex(t))>-1){r.set(t,s);const o=this[kt]||(this[kt]=new Array(this.size));(n=o[s])!==void 0||(o[s]=n=this.getValue(s))}}return n}set(t,n){if(t!=null){const r=this[Et]||(this[Et]=new Map);let s=r.get(t);if(s===void 0&&r.set(t,s=this.getIndex(t)),s>-1){const o=this[kt]||(this[kt]=new Array(this.size));o[s]=this.setValue(s,n)}}return this}clear(){throw new Error(`Clearing ${this[Symbol.toStringTag]} not supported.`)}delete(t){throw new Error(`Deleting ${this[Symbol.toStringTag]} values not supported.`)}*[Symbol.iterator](){const t=this.keys(),n=this.values(),r=this[Et]||(this[Et]=new Map),s=this[kt]||(this[kt]=new Array(this.size));for(let o,i,a=0,c,u;!((c=t.next()).done||(u=n.next()).done);++a)o=c.value,i=u.value,s[a]=i,r.has(o)||r.set(o,a),yield[o,i]}forEach(t,n){const r=this.keys(),s=this.values(),o=n===void 0?t:(c,u,l)=>t.call(n,c,u,l),i=this[Et]||(this[Et]=new Map),a=this[kt]||(this[kt]=new Array(this.size));for(let c,u,l=0,f,h;!((f=r.next()).done||(h=s.next()).done);++l)c=f.value,u=h.value,a[l]=u,i.has(c)||i.set(c,l),o(u,c,this)}toArray(){return[...this.values()]}toJSON(){const t={};return this.forEach((n,r)=>t[r]=n),t}inspect(){return this.toString()}[Oo](){return this.toString()}toString(){const t=[];return this.forEach((n,r)=>{r=Sr(r),n=Sr(n),t.push(`${r}: ${n}`)}),`{ ${t.join(", ")} }`}}_e[Symbol.toStringTag]=(e=>(Object.defineProperties(e,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[bt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[jn]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),e[Symbol.toStringTag]="Row"))(_e.prototype);class nf extends _e{constructor(t){return super(t,t.length),$y(this)}keys(){return this[bt].getChildAt(0)[Symbol.iterator]()}values(){return this[bt].getChildAt(1)[Symbol.iterator]()}getKey(t){return this[bt].getChildAt(0).get(t)}getIndex(t){return this[bt].getChildAt(0).indexOf(t)}getValue(t){return this[bt].getChildAt(1).get(t)}setValue(t,n){this[bt].getChildAt(1).set(t,n)}}class rf extends _e{constructor(t){return super(t,t.type.children.length),sf(this)}*keys(){for(const t of this[bt].type.children)yield t.name}*values(){for(const t of this[bt].type.children)yield this[t.name]}getKey(t){return this[bt].type.children[t].name}getIndex(t){return this[bt].type.children.findIndex(n=>n.name===t)}getValue(t){return this[bt].getChildAt(t).get(this[jn])}setValue(t,n){return this[bt].getChildAt(t).set(this[jn],n)}}Object.setPrototypeOf(_e.prototype,Map.prototype);const sf=(()=>{const e={enumerable:!0,configurable:!1,get:null,set:null};return t=>{let n=-1,r=t[Et]||(t[Et]=new Map);const s=i=>function(){return this.get(i)},o=i=>function(a){return this.set(i,a)};for(const i of t.keys())r.set(i,++n),e.get=s(i),e.set=o(i),t.hasOwnProperty(i)||(e.enumerable=!0,Object.defineProperty(t,i,e)),t.hasOwnProperty(n)||(e.enumerable=!1,Object.defineProperty(t,n,e));return e.get=e.set=null,t}})(),$y=(()=>{if(typeof Proxy>"u")return sf;const e=_e.prototype.has,t=_e.prototype.get,n=_e.prototype.set,r=_e.prototype.getKey,s={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(o){return[...o.keys()].map(i=>`${i}`)},has(o,i){switch(i){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case bt:case jn:case kt:case Et:case Oo:return!0}return typeof i=="number"&&!o.has(i)&&(i=o.getKey(i)),o.has(i)},get(o,i,a){switch(i){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case bt:case jn:case kt:case Et:case Oo:return Reflect.get(o,i,a)}return typeof i=="number"&&!e.call(a,i)&&(i=r.call(a,i)),t.call(a,i)},set(o,i,a,c){switch(i){case bt:case jn:case kt:case Et:return Reflect.set(o,i,a,c);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return typeof i=="number"&&!e.call(c,i)&&(i=r.call(c,i)),e.call(c,i)?!!n.call(c,i,a):!1}};return o=>new Proxy(o,s)})();function Yy(e,t,n){const r=e.length,s=t>-1?t:r+t%r;return n?n(e,s):s}let Nc;function Aa(e,t,n,r){let{length:s=0}=e,o=typeof t!="number"?0:t,i=typeof n!="number"?s:n;return o<0&&(o=(o%s+s)%s),i<0&&(i=(i%s+s)%s),i<o&&(Nc=o,o=i,i=Nc),i>s&&(i=s),r?r(e,o,i):[o,i]}const Gy=ws?bp(0):0,Mc=e=>e!==e;function Sn(e){let t=typeof e;if(t!=="object"||e===null)return Mc(e)?Mc:t!=="bigint"?n=>n===e:n=>Gy+n===e;if(e instanceof Date){const n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?Pl(e,n):!1:e instanceof Map?Zy(e):Array.isArray(e)?Ky(e):e instanceof z?Hy(e):Jy(e)}function Ky(e){const t=[];for(let n=-1,r=e.length;++n<r;)t[n]=Sn(e[n]);return Os(t)}function Zy(e){let t=-1;const n=[];return e.forEach(r=>n[++t]=Sn(r)),Os(n)}function Hy(e){const t=[];for(let n=-1,r=e.length;++n<r;)t[n]=Sn(e.get(n));return Os(t)}function Jy(e){const t=Object.keys(e);if(t.length===0)return()=>!1;const n=[];for(let r=-1,s=t.length;++r<s;)n[r]=Sn(e[t[r]]);return Os(n,t)}function Os(e,t){return n=>{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return Xy(e,n);case Map:case nf:case rf:return Cc(e,n,n.keys());case Object:case void 0:return Cc(e,n,t||Object.keys(n))}return n instanceof z?qy(e,n):!1}}function Xy(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t[r]))return!1;return!0}function qy(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t.get(r)))return!1;return!0}function Cc(e,t,n){const r=n[Symbol.iterator](),s=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let i=0,a=e.length,c=o.next(),u=r.next(),l=s.next();for(;i<a&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!e[i](c.value));++i,u=r.next(),l=s.next(),c=o.next());return i===a&&u.done&&l.done&&c.done?!0:(r.return&&r.return(),s.return&&s.return(),o.return&&o.return(),!1)}const Qy=Object.freeze(Object.defineProperty({__proto__:null,clampIndex:Yy,clampRange:Aa,createElementComparator:Sn},Symbol.toStringTag,{value:"Module"}));class mt extends z{constructor(t,n=[],r=tb(n)){super(),this._nullCount=-1,this._type=t,this._chunks=n,this._chunkOffsets=r,this._length=r[r.length-1],this._numChildren=(this._type.children||[]).length}static flatten(...t){return ib(z,t)}static concat(...t){const n=mt.flatten(...t);return new mt(n[0].type,n)}get type(){return this._type}get length(){return this._length}get chunks(){return this._chunks}get typeId(){return this._type.typeId}get VectorName(){return`Chunked<${this._type}>`}get data(){return this._chunks[0]?this._chunks[0].data:null}get ArrayType(){return this._type.ArrayType}get numChildren(){return this._numChildren}get stride(){return this._chunks[0]?this._chunks[0].stride:1}get byteLength(){return this._chunks.reduce((t,n)=>t+n.byteLength,0)}get nullCount(){let t=this._nullCount;return t<0&&(this._nullCount=t=this._chunks.reduce((n,{nullCount:r})=>n+r,0)),t}get indices(){if(U.isDictionary(this._type)){if(!this._indices){const t=this._chunks;this._indices=t.length===1?t[0].indices:mt.concat(...t.map(n=>n.indices))}return this._indices}return null}get dictionary(){return U.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}*[Symbol.iterator](){for(const t of this._chunks)yield*t}clone(t=this._chunks){return new mt(this._type,t)}concat(...t){return this.clone(mt.flatten(this,...t))}slice(t,n){return Aa(this,t,n,this._sliceInternal)}getChildAt(t){if(t<0||t>=this._numChildren)return null;let n=this._children||(this._children=[]),r,s,o;return(r=n[t])?r:(s=(this._type.children||[])[t])&&(o=this._chunks.map(i=>i.getChildAt(t)).filter(i=>i!=null),o.length>0)?n[t]=new mt(s.type,o):null}search(t,n){let r=t,s=this._chunkOffsets,o=s.length-1;if(r<0||r>=s[o])return null;if(o<=1)return n?n(this,0,r):[0,r];let i=0,a=0,c=0;do{if(i+1===o)return n?n(this,i,r-a):[i,r-a];c=i+(o-i)/2|0,r>=s[c]?i=c:o=c}while(r<s[o]&&r>=(a=s[i]));return null}isValid(t){return!!this.search(t,this.isValidInternal)}get(t){return this.search(t,this.getInternal)}set(t,n){this.search(t,({chunks:r},s,o)=>r[s].set(o,n))}indexOf(t,n){return n&&typeof n=="number"?this.search(n,(r,s,o)=>this.indexOfInternal(r,s,o,t)):this.indexOfInternal(this,0,Math.max(0,n||0),t)}toArray(){const{chunks:t}=this,n=t.length;let r=this._type.ArrayType;if(n<=0)return new r(0);if(n<=1)return t[0].toArray();let s=0,o=new Array(n);for(let c=-1;++c<n;)s+=(o[c]=t[c].toArray()).length;r!==o[0].constructor&&(r=o[0].constructor);let i=new r(s),a=r===Array?nb:eb;for(let c=-1,u=0;++c<n;)u=a(o[c],i,u);return i}getInternal({_chunks:t},n,r){return t[n].get(r)}isValidInternal({_chunks:t},n,r){return t[n].isValid(r)}indexOfInternal({_chunks:t},n,r,s){let o=n-1,i=t.length,a=r,c=0,u=-1;for(;++o<i;){if(~(u=t[o].indexOf(s,a)))return c+u;a=0,c+=t[o].length}return-1}_sliceInternal(t,n,r){const s=[],{chunks:o,_chunkOffsets:i}=t;for(let a=-1,c=o.length;++a<c;){const u=o[a],l=u.length,f=i[a];if(f>=r)break;if(n>=f+l)continue;if(f>=n&&f+l<=r){s.push(u);continue}const h=Math.max(0,n-f),p=Math.min(r-f,l);s.push(u.slice(h,p))}return t.clone(s)}}function tb(e){let t=new Uint32Array((e||[]).length+1),n=t[0]=0,r=t.length;for(let s=0;++s<r;)t[s]=n+=e[s-1].length;return t}const eb=(e,t,n)=>(t.set(e,n),n+e.length),nb=(e,t,n)=>{let r=n;for(let s=-1,o=e.length;++s<o;)t[r++]=e[s];return r};class Kt extends mt{constructor(t,n=[],r){if(n=mt.flatten(...n),super(t.type,n,r),this._field=t,n.length===1&&!(this instanceof Rc))return new Rc(t,n[0],this._chunkOffsets)}static new(t,n,...r){const s=mt.flatten(Array.isArray(n)?[...n,...r]:n instanceof z?[n,...r]:[z.new(n,...r)]);if(typeof t=="string"){const o=s[0].data.type;t=new W(t,o,!0)}else!t.nullable&&s.some(({nullCount:o})=>o>0)&&(t=t.clone({nullable:!0}));return new Kt(t,s)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(t=this._chunks){return new Kt(this._field,t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let n=this._children||(this._children=[]),r,s,o;return(r=n[t])?r:(s=(this.type.children||[])[t])&&(o=this._chunks.map(i=>i.getChildAt(t)).filter(i=>i!=null),o.length>0)?n[t]=new Kt(s,o):null}}class Rc extends Kt{constructor(t,n,r){super(t,[n],r),this._chunk=n}search(t,n){return n?n(this,0,t):[0,t]}isValid(t){return this._chunk.isValid(t)}get(t){return this._chunk.get(t)}set(t,n){this._chunk.set(t,n)}indexOf(t,n){return this._chunk.indexOf(t,n)}}const an=Array.isArray,of=(e,t)=>Ba(e,t,[],0),rb=e=>{const[t,n]=Oa(e,[[],[]]);return n.map((r,s)=>r instanceof Kt?Kt.new(r.field.clone(t[s]),r):r instanceof z?Kt.new(t[s],r):Kt.new(t[s],[]))},af=e=>Oa(e,[[],[]]),ib=(e,t)=>Fo(e,t,[],0),sb=(e,t)=>cf(e,t,[],0);function Ba(e,t,n,r){let s,o=r,i=-1,a=t.length;for(;++i<a;)an(s=t[i])?o=Ba(e,s,n,o).length:s instanceof e&&(n[o++]=s);return n}function Fo(e,t,n,r){let s,o=r,i=-1,a=t.length;for(;++i<a;)an(s=t[i])?o=Fo(e,s,n,o).length:s instanceof mt?o=Fo(e,s.chunks,n,o).length:s instanceof e&&(n[o++]=s);return n}function cf(e,t,n,r){let s,o=r,i=-1,a=t.length;for(;++i<a;)an(s=t[i])?o=cf(e,s,n,o).length:s instanceof e?o=Ba(z,s.schema.fields.map((c,u)=>s.getChildAt(u)),n,o).length:s instanceof z&&(n[o++]=s);return n}const ob=(e,[t,n],r)=>(e[0][r]=t,e[1][r]=n,e);function Oa(e,t){let n,r;switch(r=e.length){case 0:return t;case 1:if(n=t[0],!e[0])return t;if(an(e[0]))return Oa(e[0],t);e[0]instanceof S||e[0]instanceof z||e[0]instanceof U||([n,e]=Object.entries(e[0]).reduce(ob,t));break;default:an(n=e[r-1])?e=an(e[0])?e[0]:e.slice(0,r-1):(e=an(e[0])?e[0]:e,n=[])}let s=-1,o=-1,i=-1,a=e.length,c,u,[l,f]=t;for(;++i<a;)u=e[i],u instanceof Kt&&(f[++o]=u)?l[++s]=u.field.clone(n[i],u.type,!0):({[i]:c=i}=n,u instanceof U&&(f[++o]=u)?l[++s]=W.new(c,u,!0):u&&u.type&&(f[++o]=u)&&(u instanceof S&&(f[o]=u=z.new(u)),l[++s]=W.new(c,u.type,!0)));return t}class H{constructor(t=[],n,r){this.fields=t||[],this.metadata=n||new Map,r||(r=xo(t)),this.dictionaries=r}static from(...t){return H.new(t[0],t[1])}static new(...t){return new H(af(t)[0])}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}compareTo(t){return Nt.compareSchemas(this,t)}select(...t){const n=t.reduce((r,s)=>(r[s]=!0)&&r,Object.create(null));return new H(this.fields.filter(r=>n[r.name]),this.metadata)}selectAt(...t){return new H(t.map(n=>this.fields[n]).filter(Boolean),this.metadata)}assign(...t){const n=t[0]instanceof H?t[0]:new H(of(W,t)),r=[...this.fields],s=fi(fi(new Map,this.metadata),n.metadata),o=n.fields.filter(a=>{const c=r.findIndex(u=>u.name===a.name);return~c?(r[c]=a.clone({metadata:fi(fi(new Map,r[c].metadata),a.metadata)}))&&!1:!0}),i=xo(o,new Map);return new H([...r,...o],s,new Map([...this.dictionaries,...i]))}}class W{constructor(t,n,r=!1,s){this.name=t,this.type=n,this.nullable=r,this.metadata=s||new Map}static new(...t){let[n,r,s,o]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),s===void 0&&(s=t[0].nullable),o===void 0&&(o=t[0].metadata)),new W(`${n}`,r,s,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}compareTo(t){return Nt.compareField(this,t)}clone(...t){let[n,r,s,o]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,s=this.nullable,o=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:s=this.nullable,metadata:o=this.metadata}=t[0],W.new(n,r,s,o)}}function fi(e,t){return new Map([...e||new Map,...t||new Map])}function xo(e,t=new Map){for(let n=-1,r=e.length;++n<r;){const o=e[n].type;if(U.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&xo(o.children,t)}return t}H.prototype.fields=null;H.prototype.metadata=null;H.prototype.dictionaries=null;W.prototype.type=null;W.prototype.name=null;W.prototype.nullable=null;W.prototype.metadata=null;class ab extends As{constructor(t){super(t),this._run=new ef,this._offsets=new Zl}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Qn(new W(n,t.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(t){const n=this._run,r=this._offsets,s=this._setValue;let o=0,i;for([o,i]of t)i===void 0?r.set(o,0):(r.set(o,i.length),s(this,o,n.bind(i)))}}class cb extends at{constructor(){super(...arguments),this._run=new ef}setValue(t,n){super.setValue(t,this._run.bind(n))}addChild(t,n="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");const r=this.children.push(t);return this.type=new kr(this.type.listSize,new W(n,t.type,!0)),r}clear(){return this._run.clear(),super.clear()}}class ub extends As{set(t,n){return super.set(t,n)}setValue(t,n){n=n instanceof Map?n:new Map(Object.entries(n));const r=this._pending||(this._pending=new Map),s=r.get(t);s&&(this._pendingLength-=s.size),this._pendingLength+=n.size,r.set(t,n)}addChild(t,n=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Er(new W(n,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const n=this._offsets,r=this._setValue;t.forEach((s,o)=>{s===void 0?n.set(o,0):(n.set(o,s.size),r(this,o,s))})}}class lb extends at{addChild(t,n=`${this.numChildren}`){const r=this.children.push(t);return this.type=new Qt([...this.type.children,new W(n,t.type,!0)]),r}}class Fa extends at{constructor(t){super(t),this._typeIds=new Xr(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,n){return this.set(this.length,t,n)}set(t,n,r){return r===void 0&&(r=this._valueToChildTypeId(this,n,t)),this.setValid(t,this.isValid(n))&&this.setValue(t,n,r),this}setValue(t,n,r){this._typeIds.set(t,r),super.setValue(t,n)}addChild(t,n=`${this.children.length}`){const r=this.children.push(t),{type:{children:s,mode:o,typeIds:i}}=this,a=[...s,new W(n,t.type)];return this.type=new Dr(o,[...i,r],a),r}_valueToChildTypeId(t,n,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}}class fb extends Fa{}class hb extends Fa{constructor(t){super(t),this._offsets=new Xr(new Int32Array(0))}setValue(t,n,r){const s=this.type.typeIdToChildIndex[r];return this._offsets.set(t,this.getChildAt(s).length),super.setValue(t,n,r)}}class D extends V{}const db=(e,t,n)=>{e[t]=n/864e5|0},xa=(e,t,n)=>{e[t]=n%4294967296|0,e[t+1]=n/4294967296|0},pb=(e,t,n)=>{e[t]=n*1e3%4294967296|0,e[t+1]=n*1e3/4294967296|0},yb=(e,t,n)=>{e[t]=n*1e6%4294967296|0,e[t+1]=n*1e6/4294967296|0},uf=(e,t,n,r)=>{const{[n]:s,[n+1]:o}=t;s!=null&&o!=null&&e.set(r.subarray(0,o-s),s)},bb=({offset:e,values:t},n,r)=>{const s=e+n;r?t[s>>3]|=1<<s%8:t[s>>3]&=~(1<<s%8)},lf=({values:e},t,n)=>{db(e,t,n.valueOf())},ff=({values:e},t,n)=>{xa(e,t*2,n.valueOf())},de=({stride:e,values:t},n,r)=>{t[e*n]=r},hf=({stride:e,values:t},n,r)=>{t[e*n]=Sa(r)},La=(e,t,n)=>{switch(typeof n){case"bigint":e.values64[t]=n;break;case"number":e.values[t*e.stride]=n;break;default:const r=n,{stride:s,ArrayType:o}=e,i=R(o,r);e.values.set(i.subarray(0,s),s*t)}},mb=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},gb=({values:e,valueOffsets:t},n,r)=>uf(e,t,n,r),vb=({values:e,valueOffsets:t},n,r)=>{uf(e,t,n,vs(r))},wb=(e,t,n)=>{e.type.bitWidth<64?de(e,t,n):La(e,t,n)},_b=(e,t,n)=>{e.type.precision!==Pt.HALF?de(e,t,n):hf(e,t,n)},Sb=(e,t,n)=>{e.type.unit===ue.DAY?lf(e,t,n):ff(e,t,n)},df=({values:e},t,n)=>xa(e,t*2,n/1e3),pf=({values:e},t,n)=>xa(e,t*2,n),yf=({values:e},t,n)=>pb(e,t*2,n),bf=({values:e},t,n)=>yb(e,t*2,n),Ib=(e,t,n)=>{switch(e.type.unit){case Z.SECOND:return df(e,t,n);case Z.MILLISECOND:return pf(e,t,n);case Z.MICROSECOND:return yf(e,t,n);case Z.NANOSECOND:return bf(e,t,n)}},mf=({values:e,stride:t},n,r)=>{e[t*n]=r},gf=({values:e,stride:t},n,r)=>{e[t*n]=r},vf=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},wf=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Tb=(e,t,n)=>{switch(e.type.unit){case Z.SECOND:return mf(e,t,n);case Z.MILLISECOND:return gf(e,t,n);case Z.MICROSECOND:return vf(e,t,n);case Z.NANOSECOND:return wf(e,t,n)}},Ab=({values:e},t,n)=>{e.set(n.subarray(0,4),4*t)},Bb=(e,t,n)=>{const r=e.getChildAt(0),s=e.valueOffsets;for(let o=-1,i=s[t],a=s[t+1];i<a;)r.set(i++,n.get(++o))},Ob=(e,t,n)=>{const r=e.getChildAt(0),s=e.valueOffsets,o=n instanceof Map?[...n]:Object.entries(n);for(let i=-1,a=s[t],c=s[t+1];a<c;)r.set(a++,o[++i])},Fb=(e,t)=>(n,r,s)=>n&&n.set(e,t[s]),xb=(e,t)=>(n,r,s)=>n&&n.set(e,t.get(s)),Lb=(e,t)=>(n,r,s)=>n&&n.set(e,t.get(r.name)),Db=(e,t)=>(n,r,s)=>n&&n.set(e,t[r.name]),kb=(e,t,n)=>{const r=n instanceof Map?Lb(t,n):n instanceof z?xb(t,n):Array.isArray(n)?Fb(t,n):Db(t,n);e.type.children.forEach((s,o)=>r(e.getChildAt(o),s,o))},Eb=(e,t,n)=>{e.type.mode===Ae.Dense?_f(e,t,n):Sf(e,t,n)},_f=(e,t,n)=>{const r=e.typeIdToChildIndex[e.typeIds[t]],s=e.getChildAt(r);s&&s.set(e.valueOffsets[t],n)},Sf=(e,t,n)=>{const r=e.typeIdToChildIndex[e.typeIds[t]],s=e.getChildAt(r);s&&s.set(t,n)},Ub=(e,t,n)=>{const r=e.getKey(t);r!==null&&e.setValue(r,n)},Nb=(e,t,n)=>{e.type.unit===Kn.DAY_TIME?If(e,t,n):Tf(e,t,n)},If=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Tf=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Mb=(e,t,n)=>{const r=e.getChildAt(0),{stride:s}=e;for(let o=-1,i=t*s;++o<s;)r.set(i+o,n.get(o))};D.prototype.visitBool=bb;D.prototype.visitInt=wb;D.prototype.visitInt8=de;D.prototype.visitInt16=de;D.prototype.visitInt32=de;D.prototype.visitInt64=La;D.prototype.visitUint8=de;D.prototype.visitUint16=de;D.prototype.visitUint32=de;D.prototype.visitUint64=La;D.prototype.visitFloat=_b;D.prototype.visitFloat16=hf;D.prototype.visitFloat32=de;D.prototype.visitFloat64=de;D.prototype.visitUtf8=vb;D.prototype.visitBinary=gb;D.prototype.visitFixedSizeBinary=mb;D.prototype.visitDate=Sb;D.prototype.visitDateDay=lf;D.prototype.visitDateMillisecond=ff;D.prototype.visitTimestamp=Ib;D.prototype.visitTimestampSecond=df;D.prototype.visitTimestampMillisecond=pf;D.prototype.visitTimestampMicrosecond=yf;D.prototype.visitTimestampNanosecond=bf;D.prototype.visitTime=Tb;D.prototype.visitTimeSecond=mf;D.prototype.visitTimeMillisecond=gf;D.prototype.visitTimeMicrosecond=vf;D.prototype.visitTimeNanosecond=wf;D.prototype.visitDecimal=Ab;D.prototype.visitList=Bb;D.prototype.visitStruct=kb;D.prototype.visitUnion=Eb;D.prototype.visitDenseUnion=_f;D.prototype.visitSparseUnion=Sf;D.prototype.visitDictionary=Ub;D.prototype.visitInterval=Nb;D.prototype.visitIntervalDayTime=If;D.prototype.visitIntervalYearMonth=Tf;D.prototype.visitFixedSizeList=Mb;D.prototype.visitMap=Ob;const Fs=new D;class Cb extends V{visitNull(){return yy}visitBool(){return py}visitInt(){return ke}visitInt8(){return By}visitInt16(){return Oy}visitInt32(){return Fy}visitInt64(){return xy}visitUint8(){return Ly}visitUint16(){return Dy}visitUint32(){return ky}visitUint64(){return Ey}visitFloat(){return Bs}visitFloat16(){return Sy}visitFloat32(){return Iy}visitFloat64(){return Ty}visitUtf8(){return Ta}visitBinary(){return tf}visitFixedSizeBinary(){return wy}visitDate(){return _a}visitDateDay(){return by}visitDateMillisecond(){return my}visitTimestamp(){return Qr}visitTimestampSecond(){return Ry}visitTimestampMillisecond(){return Vy}visitTimestampMicrosecond(){return jy}visitTimestampNanosecond(){return Py}visitTime(){return qr}visitTimeSecond(){return Uy}visitTimeMillisecond(){return Ny}visitTimeMicrosecond(){return My}visitTimeNanosecond(){return Cy}visitDecimal(){return gy}visitList(){return ab}visitStruct(){return lb}visitUnion(){return Fa}visitDenseUnion(){return hb}visitSparseUnion(){return fb}visitDictionary(){return vy}visitInterval(){return Ia}visitIntervalDayTime(){return zy}visitIntervalYearMonth(){return Wy}visitFixedSizeList(){return cb}visitMap(){return ub}}const Af=new Cb;at.new=Bf;function Bf(e){const t=e.type,n=new(Af.getVisitFn(t)())(e);if(t.children&&t.children.length>0){const r=e.children||[],s={nullValues:e.nullValues},o=Array.isArray(r)?(i,a)=>r[a]||s:({name:i})=>r[i]||s;t.children.forEach((i,a)=>{const{type:c}=i,u=o(i,a);n.children.push(Bf({...u,type:c}))})}return n}Object.keys(d).map(e=>d[e]).filter(e=>typeof e=="number"&&e!==d.NONE).forEach(e=>{const t=Af.visit(e);t.prototype._setValue=Fs.getVisitFn(e)});Ta.prototype._setValue=Fs.visitBinary;var tr;(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}static getRootAsFooter(i,a){return(a||new s).__init(i.readInt32(i.position())+i.position(),i)}version(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):m.apache.arrow.flatbuf.MetadataVersion.V1}schema(i){let a=this.bb.__offset(this.bb_pos,6);return a?(i||new m.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}dictionaries(i,a){let c=this.bb.__offset(this.bb_pos,8);return c?(a||new e.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+c)+i*24,this.bb):null}dictionariesLength(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.__vector_len(this.bb_pos+i):0}recordBatches(i,a){let c=this.bb.__offset(this.bb_pos,10);return c?(a||new e.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+c)+i*24,this.bb):null}recordBatchesLength(){let i=this.bb.__offset(this.bb_pos,10);return i?this.bb.__vector_len(this.bb_pos+i):0}static startFooter(i){i.startObject(4)}static addVersion(i,a){i.addFieldInt16(0,a,m.apache.arrow.flatbuf.MetadataVersion.V1)}static addSchema(i,a){i.addFieldOffset(1,a,0)}static addDictionaries(i,a){i.addFieldOffset(2,a,0)}static startDictionariesVector(i,a){i.startVector(24,a,8)}static addRecordBatches(i,a){i.addFieldOffset(3,a,0)}static startRecordBatchesVector(i,a){i.startVector(24,a,8)}static endFooter(i){return i.endObject()}static finishFooterBuffer(i,a){i.finish(a)}static createFooter(i,a,c,u,l){return s.startFooter(i),s.addVersion(i,a),s.addSchema(i,c),s.addDictionaries(i,u),s.addRecordBatches(i,l),s.endFooter(i)}}r.Footer=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(tr||(tr={}));(function(e){(function(t){(function(n){(function(r){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,a){return this.bb_pos=i,this.bb=a,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(i,a,c,u){return i.prep(8,24),i.writeInt64(u),i.pad(4),i.writeInt32(c),i.writeInt64(a),i.offset()}}r.Block=s})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(tr||(tr={}));var Vc=y.Long,Rb=y.Builder,Vb=y.ByteBuffer,jb=tr.apache.arrow.flatbuf.Block,se=tr.apache.arrow.flatbuf.Footer;class Mr{constructor(t,n=Gt.V4,r,s){this.schema=t,this.version=n,r&&(this._recordBatches=r),s&&(this._dictionaryBatches=s)}static decode(t){t=new Vb(j(t));const n=se.getRootAsFooter(t),r=H.decode(n.schema());return new Pb(r,n)}static encode(t){const n=new Rb,r=H.encode(n,t.schema);se.startRecordBatchesVector(n,t.numRecordBatches),[...t.recordBatches()].slice().reverse().forEach(i=>Ke.encode(n,i));const s=n.endVector();se.startDictionariesVector(n,t.numDictionaries),[...t.dictionaryBatches()].slice().reverse().forEach(i=>Ke.encode(n,i));const o=n.endVector();return se.startFooter(n),se.addSchema(n,r),se.addVersion(n,Gt.V4),se.addRecordBatches(n,s),se.addDictionaries(n,o),se.finishFooterBuffer(n,se.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n<r;)(t=this.getRecordBatch(n))&&(yield t)}*dictionaryBatches(){for(let t,n=-1,r=this.numDictionaries;++n<r;)(t=this.getDictionaryBatch(n))&&(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 Pb extends Mr{constructor(t,n){super(t,n.version()),this._footer=n}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const n=this._footer.recordBatches(t);if(n)return Ke.decode(n)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const n=this._footer.dictionaries(t);if(n)return Ke.decode(n)}return null}}class Ke{static decode(t){return new Ke(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,n){const{metaDataLength:r}=n,s=new Vc(n.offset,0),o=new Vc(n.bodyLength,0);return jb.createBlock(t,s,r,o)}constructor(t,n,r){this.metaDataLength=t,this.offset=typeof r=="number"?r:r.low,this.bodyLength=typeof n=="number"?n:n.low}}class Ir extends yp{write(t){if((t=j(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?To(this.toUint8Array(!0)):this.toUint8Array(!1).then(To)}toUint8Array(t=!1){return t?qt(this._values)[0]:(async()=>{let n=[],r=0;for await(const s of this)n.push(s),r+=s.byteLength;return qt(n,r)[0]})()}}class Ki{constructor(t){t&&(this.source=new zb(Ut.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 dn{constructor(t){t instanceof dn?this.source=t.source:t instanceof Ir?this.source=new en(Ut.fromAsyncIterable(t)):Ml(t)?this.source=new en(Ut.fromNodeStream(t)):ca(t)?this.source=new en(Ut.fromDOMStream(t)):Nl(t)?this.source=new en(Ut.fromDOMStream(t.body)):Xt(t)?this.source=new en(Ut.fromIterable(t)):Ye(t)?this.source=new en(Ut.fromAsyncIterable(t)):Le(t)&&(this.source=new en(Ut.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 zb{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,n="read"){return this.source.next({cmd:n,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||ot)}return(t){return Object.create(this.source.return&&this.source.return(t)||ot)}}class en{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}async cancel(t){await this.return(t)}get closed(){return this._closedPromise}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}async next(t,n="read"){return await this.source.next({cmd:n,size:t})}async throw(t){const n=this.source.throw&&await this.source.throw(t)||ot;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)}async return(t){const n=this.source.return&&await this.source.return(t)||ot;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)}}class jc extends Ki{constructor(t,n){super(),this.position=0,this.buffer=j(t),this.size=typeof n>"u"?this.buffer.byteLength:n}readInt32(t){const{buffer:n,byteOffset:r}=this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:n,size:r,position:s}=this;return n&&s<r?(typeof t!="number"&&(t=1/0),this.position=Math.min(r,s+Math.min(r-s,t)),n.subarray(s,this.position)):null}readAt(t,n){const r=this.buffer,s=Math.min(this.size,t+n);return r?r.subarray(t,s):new Uint8Array(n)}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 Zi extends dn{constructor(t,n){super(),this.position=0,this._handle=t,typeof n=="number"?this.size=n:this._pending=(async()=>{this.size=(await t.stat()).size,delete this._pending})()}async readInt32(t){const{buffer:n,byteOffset:r}=await this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}async seek(t){return this._pending&&await this._pending,this.position=Math.min(t,this.size),t<this.size}async read(t){this._pending&&await this._pending;const{_handle:n,size:r,position:s}=this;if(n&&s<r){typeof t!="number"&&(t=1/0);let o=s,i=0,a=0,c=Math.min(r,o+Math.min(r-o,t)),u=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(i+=a)<u.byteLength;)({bytesRead:a}=await n.read(u,i,u.byteLength-i,o));return u}return null}async readAt(t,n){this._pending&&await this._pending;const{_handle:r,size:s}=this;if(r&&t+n<s){const o=Math.min(s,t+n),i=new Uint8Array(o-t);return(await r.read(i,0,n,t)).buffer}return new Uint8Array(n)}async close(){const t=this._handle;this._handle=null,t&&await t.close()}async throw(t){return await this.close(),{done:!0,value:t}}async return(t){return await this.close(),{done:!0,value:t}}}const Wb=1<<16;function Nn(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const er=8,Da=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class ka{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const n=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let s=n[3]*r[3];this.buffer[0]=s&65535;let o=s>>>16;return s=n[2]*r[3],o+=s,s=n[3]*r[2]>>>0,o+=s,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<s?Wb:0,this.buffer[1]+=o>>>16,this.buffer[1]+=n[1]*r[3]+n[2]*r[2]+n[3]*r[1],this.buffer[1]+=n[0]*r[3]+n[1]*r[2]+n[2]*r[1]+n[3]*r[0]<<16,this}_plus(t){const n=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],n<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=n}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`${Nn(this.buffer[1])} ${Nn(this.buffer[0])}`}}class K extends ka{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,n=new Uint32Array(2)){return K.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return K.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){const r=t.length;let s=new K(n);for(let o=0;o<r;){const i=er<r-o?er:r-o,a=new K(new Uint32Array([parseInt(t.substr(o,i),10),0])),c=new K(new Uint32Array([Da[i],0]));s.times(c),s.plus(a),o+=i}return s}static convertArray(t){const n=new Uint32Array(t.length*2);for(let r=-1,s=t.length;++r<s;)K.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new K(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new K(new Uint32Array(t.buffer)).plus(n)}}class wt extends ka{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 n=this.buffer[1]<<0,r=t.buffer[1]<<0;return n<r||n===r&&this.buffer[0]<t.buffer[0]}static from(t,n=new Uint32Array(2)){return wt.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return wt.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){const r=t.startsWith("-"),s=t.length;let o=new wt(n);for(let i=r?1:0;i<s;){const a=er<s-i?er:s-i,c=new wt(new Uint32Array([parseInt(t.substr(i,a),10),0])),u=new wt(new Uint32Array([Da[a],0]));o.times(u),o.plus(c),i+=a}return r?o.negate():o}static convertArray(t){const n=new Uint32Array(t.length*2);for(let r=-1,s=t.length;++r<s;)wt.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new wt(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new wt(new Uint32Array(t.buffer)).plus(n)}}class Yt{constructor(t){this.buffer=t}high(){return new wt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new wt(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 n=new K(new Uint32Array([this.buffer[3],0])),r=new K(new Uint32Array([this.buffer[2],0])),s=new K(new Uint32Array([this.buffer[1],0])),o=new K(new Uint32Array([this.buffer[0],0])),i=new K(new Uint32Array([t.buffer[3],0])),a=new K(new Uint32Array([t.buffer[2],0])),c=new K(new Uint32Array([t.buffer[1],0])),u=new K(new Uint32Array([t.buffer[0],0]));let l=K.multiply(o,u);this.buffer[0]=l.low();let f=new K(new Uint32Array([l.high(),0]));return l=K.multiply(s,u),f.plus(l),l=K.multiply(o,c),f.plus(l),this.buffer[1]=f.low(),this.buffer[3]=f.lessThan(l)?1:0,this.buffer[2]=f.high(),new K(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(K.multiply(r,u)).plus(K.multiply(s,c)).plus(K.multiply(o,a)),this.buffer[3]+=K.multiply(n,u).plus(K.multiply(r,c)).plus(K.multiply(s,a)).plus(K.multiply(o,i)).low(),this}plus(t){let n=new Uint32Array(4);return n[3]=this.buffer[3]+t.buffer[3]>>>0,n[2]=this.buffer[2]+t.buffer[2]>>>0,n[1]=this.buffer[1]+t.buffer[1]>>>0,n[0]=this.buffer[0]+t.buffer[0]>>>0,n[0]<this.buffer[0]>>>0&&++n[1],n[1]<this.buffer[1]>>>0&&++n[2],n[2]<this.buffer[2]>>>0&&++n[3],this.buffer[3]=n[3],this.buffer[2]=n[2],this.buffer[1]=n[1],this.buffer[0]=n[0],this}hex(){return`${Nn(this.buffer[3])} ${Nn(this.buffer[2])} ${Nn(this.buffer[1])} ${Nn(this.buffer[0])}`}static multiply(t,n){return new Yt(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new Yt(new Uint32Array(t.buffer)).plus(n)}static from(t,n=new Uint32Array(4)){return Yt.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return Yt.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){const r=t.startsWith("-"),s=t.length;let o=new Yt(n);for(let i=r?1:0;i<s;){const a=er<s-i?er:s-i,c=new Yt(new Uint32Array([parseInt(t.substr(i,a),10),0,0,0])),u=new Yt(new Uint32Array([Da[a],0,0,0]));o.times(u),o.plus(c),i+=a}return r?o.negate():o}static convertArray(t){const n=new Uint32Array(t.length*4);for(let r=-1,s=t.length;++r<s;)Yt.from(t[r],new Uint32Array(n.buffer,n.byteOffset+4*4*r,4));return n}}const $b=Object.freeze(Object.defineProperty({__proto__:null,BaseInt64:ka,Uint64:K,Int64:wt,Int128:Yt},Symbol.toStringTag,{value:"Module"}));class Of extends V{constructor(t,n,r,s){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=n,this.buffers=r,this.dictionaries=s}visit(t){return super.visit(t instanceof W?t.type:t)}visitNull(t,{length:n}=this.nextFieldNode()){return S.Null(t,0,n)}visitBool(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Bool(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitInt(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Int(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitFloat(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Float(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Utf8(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Binary(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitFixedSizeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.FixedSizeBinary(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitDate(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Date(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitTimestamp(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Timestamp(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitTime(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Time(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitDecimal(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Decimal(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitList(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.List(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}visitStruct(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Struct(t,0,n,r,this.readNullBitmap(t,r),this.visitMany(t.children))}visitUnion(t){return t.mode===Ae.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Union(t,0,n,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.readOffsets(t),this.visitMany(t.children))}visitSparseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Union(t,0,n,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.visitMany(t.children))}visitDictionary(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Dictionary(t,0,n,r,this.readNullBitmap(t,r),this.readData(t.indices),this.readDictionary(t))}visitInterval(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Interval(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitFixedSizeList(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.FixedSizeList(t,0,n,r,this.readNullBitmap(t,r),this.visit(t.children[0]))}visitMap(t,{length:n,nullCount:r}=this.nextFieldNode()){return S.Map(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,n,r=this.nextBufferRange()){return n>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,n){return this.readData(t,n)}readTypeIds(t,n){return this.readData(t,n)}readData(t,{length:n,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+n)}readDictionary(t){return this.dictionaries.get(t.id)}}class Yb extends Of{constructor(t,n,r,s){super(new Uint8Array(0),n,r,s),this.sources=t}readNullBitmap(t,n,{offset:r}=this.nextBufferRange()){return n<=0?new Uint8Array(0):Fr(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return R(Uint8Array,R(Int32Array,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return R(Uint8Array,R(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){const{sources:r}=this;return U.isTimestamp(t)||(U.isInt(t)||U.isTime(t))&&t.bitWidth===64||U.isDate(t)&&t.unit===ue.MILLISECOND?R(Uint8Array,wt.convertArray(r[n])):U.isDecimal(t)?R(Uint8Array,Yt.convertArray(r[n])):U.isBinary(t)||U.isFixedSizeBinary(t)?Gb(r[n]):U.isBool(t)?Fr(r[n]):U.isUtf8(t)?vs(r[n].join("")):R(Uint8Array,R(t.ArrayType,r[n].map(s=>+s)))}}function Gb(e){const t=e.join(""),n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r>>1]=parseInt(t.substr(r,2),16);return n}var Kb=y.Long,Pc=m.apache.arrow.flatbuf.Null,hi=m.apache.arrow.flatbuf.Int,Gs=m.apache.arrow.flatbuf.FloatingPoint,zc=m.apache.arrow.flatbuf.Binary,Wc=m.apache.arrow.flatbuf.Bool,$c=m.apache.arrow.flatbuf.Utf8,di=m.apache.arrow.flatbuf.Decimal,Ks=m.apache.arrow.flatbuf.Date,pi=m.apache.arrow.flatbuf.Time,yi=m.apache.arrow.flatbuf.Timestamp,Zs=m.apache.arrow.flatbuf.Interval,Yc=m.apache.arrow.flatbuf.List,Gc=m.apache.arrow.flatbuf.Struct_,On=m.apache.arrow.flatbuf.Union,dr=m.apache.arrow.flatbuf.DictionaryEncoding,Hs=m.apache.arrow.flatbuf.FixedSizeBinary,Js=m.apache.arrow.flatbuf.FixedSizeList,Xs=m.apache.arrow.flatbuf.Map;class Zb extends V{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return Pc.startNull(n),Pc.endNull(n)}visitInt(t,n){return hi.startInt(n),hi.addBitWidth(n,t.bitWidth),hi.addIsSigned(n,t.isSigned),hi.endInt(n)}visitFloat(t,n){return Gs.startFloatingPoint(n),Gs.addPrecision(n,t.precision),Gs.endFloatingPoint(n)}visitBinary(t,n){return zc.startBinary(n),zc.endBinary(n)}visitBool(t,n){return Wc.startBool(n),Wc.endBool(n)}visitUtf8(t,n){return $c.startUtf8(n),$c.endUtf8(n)}visitDecimal(t,n){return di.startDecimal(n),di.addScale(n,t.scale),di.addPrecision(n,t.precision),di.endDecimal(n)}visitDate(t,n){return Ks.startDate(n),Ks.addUnit(n,t.unit),Ks.endDate(n)}visitTime(t,n){return pi.startTime(n),pi.addUnit(n,t.unit),pi.addBitWidth(n,t.bitWidth),pi.endTime(n)}visitTimestamp(t,n){const r=t.timezone&&n.createString(t.timezone)||void 0;return yi.startTimestamp(n),yi.addUnit(n,t.unit),r!==void 0&&yi.addTimezone(n,r),yi.endTimestamp(n)}visitInterval(t,n){return Zs.startInterval(n),Zs.addUnit(n,t.unit),Zs.endInterval(n)}visitList(t,n){return Yc.startList(n),Yc.endList(n)}visitStruct(t,n){return Gc.startStruct_(n),Gc.endStruct_(n)}visitUnion(t,n){On.startTypeIdsVector(n,t.typeIds.length);const r=On.createTypeIdsVector(n,t.typeIds);return On.startUnion(n),On.addMode(n,t.mode),On.addTypeIds(n,r),On.endUnion(n)}visitDictionary(t,n){const r=this.visit(t.indices,n);return dr.startDictionaryEncoding(n),dr.addId(n,new Kb(t.id,0)),dr.addIsOrdered(n,t.isOrdered),r!==void 0&&dr.addIndexType(n,r),dr.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return Hs.startFixedSizeBinary(n),Hs.addByteWidth(n,t.byteWidth),Hs.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return Js.startFixedSizeList(n),Js.addListSize(n,t.listSize),Js.endFixedSizeList(n)}visitMap(t,n){return Xs.startMap(n),Xs.addKeysSorted(n,t.keysSorted),Xs.endMap(n)}}const qs=new Zb;function Hb(e,t=new Map){return new H(Xb(e,t),Oi(e.customMetadata),t)}function Ff(e){return new Ct(e.count,xf(e.columns),Lf(e.columns))}function Jb(e){return new le(Ff(e.data),e.id,e.isDelta)}function Xb(e,t){return(e.fields||[]).filter(Boolean).map(n=>W.fromJSON(n,t))}function Kc(e,t){return(e.children||[]).filter(Boolean).map(n=>W.fromJSON(n,t))}function xf(e){return(e||[]).reduce((t,n)=>[...t,new In(n.count,qb(n.VALIDITY)),...xf(n.children)],[])}function Lf(e,t=[]){for(let n=-1,r=(e||[]).length;++n<r;){const s=e[n];s.VALIDITY&&t.push(new ae(t.length,s.VALIDITY.length)),s.TYPE&&t.push(new ae(t.length,s.TYPE.length)),s.OFFSET&&t.push(new ae(t.length,s.OFFSET.length)),s.DATA&&t.push(new ae(t.length,s.DATA.length)),t=Lf(s.children,t)}return t}function qb(e){return(e||[]).reduce((t,n)=>t+ +(n===0),0)}function Qb(e,t){let n,r,s,o,i,a;return!t||!(o=e.dictionary)?(i=Hc(e,Kc(e,t)),s=new W(e.name,i,e.nullable,Oi(e.customMetadata))):t.has(n=o.id)?(r=(r=o.indexType)?Zc(r):new fn,a=new Ge(t.get(n),r,n,o.isOrdered),s=new W(e.name,a,e.nullable,Oi(e.customMetadata))):(r=(r=o.indexType)?Zc(r):new fn,t.set(n,i=Hc(e,Kc(e,t))),a=new Ge(i,r,n,o.isOrdered),s=new W(e.name,a,e.nullable,Oi(e.customMetadata))),s||null}function Oi(e){return new Map(Object.entries(e||{}))}function Zc(e){return new xt(e.isSigned,e.bitWidth)}function Hc(e,t){const n=e.type.name;switch(n){case"NONE":return new Zn;case"null":return new Zn;case"binary":return new xr;case"utf8":return new Xn;case"bool":return new Lr;case"list":return new Qn((t||[])[0]);case"struct":return new Qt(t||[]);case"struct_":return new Qt(t||[])}switch(n){case"int":{const r=e.type;return new xt(r.isSigned,r.bitWidth)}case"floatingpoint":{const r=e.type;return new hn(Pt[r.precision])}case"decimal":{const r=e.type;return new Pi(r.scale,r.precision)}case"date":{const r=e.type;return new qn(ue[r.unit])}case"time":{const r=e.type;return new zi(Z[r.unit],r.bitWidth)}case"timestamp":{const r=e.type;return new Wi(Z[r.unit],r.timezone)}case"interval":{const r=e.type;return new $i(Kn[r.unit])}case"union":{const r=e.type;return new Dr(Ae[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{const r=e.type;return new Yi(r.byteWidth)}case"fixedsizelist":{const r=e.type;return new kr(r.listSize,(t||[])[0])}case"map":{const r=e.type;return new Er((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var pn=y.Long,tm=y.Builder,em=y.ByteBuffer,ft=m.apache.arrow.flatbuf.Type,$t=m.apache.arrow.flatbuf.Field,ge=m.apache.arrow.flatbuf.Schema,nm=m.apache.arrow.flatbuf.Buffer,Ee=gt.apache.arrow.flatbuf.Message,Ve=m.apache.arrow.flatbuf.KeyValue,rm=gt.apache.arrow.flatbuf.FieldNode,Jc=m.apache.arrow.flatbuf.Endianness,Ce=gt.apache.arrow.flatbuf.RecordBatch,kn=gt.apache.arrow.flatbuf.DictionaryBatch;class _t{constructor(t,n,r,s){this._version=n,this._headerType=r,this.body=new Uint8Array(0),s&&(this._createHeader=()=>s),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,n){const r=new _t(0,Gt.V4,n);return r._createHeader=im(t,n),r}static decode(t){t=new em(j(t));const n=Ee.getRootAsMessage(t),r=n.bodyLength(),s=n.version(),o=n.headerType(),i=new _t(r,s,o);return i._createHeader=sm(n,o),i}static encode(t){let n=new tm,r=-1;return t.isSchema()?r=H.encode(n,t.header()):t.isRecordBatch()?r=Ct.encode(n,t.header()):t.isDictionaryBatch()&&(r=le.encode(n,t.header())),Ee.startMessage(n),Ee.addVersion(n,Gt.V4),Ee.addHeader(n,r),Ee.addHeaderType(n,t.headerType),Ee.addBodyLength(n,new pn(t.bodyLength,0)),Ee.finishMessageBuffer(n,Ee.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof H)return new _t(0,Gt.V4,Q.Schema,t);if(t instanceof Ct)return new _t(n,Gt.V4,Q.RecordBatch,t);if(t instanceof le)return new _t(n,Gt.V4,Q.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Q.Schema}isRecordBatch(){return this.headerType===Q.RecordBatch}isDictionaryBatch(){return this.headerType===Q.DictionaryBatch}}class Ct{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=typeof t=="number"?t:t.low}}class le{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,n,r=!1){this._data=t,this._isDelta=r,this._id=typeof n=="number"?n:n.low}}class ae{constructor(t,n){this.offset=typeof t=="number"?t:t.low,this.length=typeof n=="number"?n:n.low}}class In{constructor(t,n){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof n=="number"?n:n.low}}function im(e,t){return()=>{switch(t){case Q.Schema:return H.fromJSON(e);case Q.RecordBatch:return Ct.fromJSON(e);case Q.DictionaryBatch:return le.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Q[t]}, type: ${t} }`)}}function sm(e,t){return()=>{switch(t){case Q.Schema:return H.decode(e.header(new ge));case Q.RecordBatch:return Ct.decode(e.header(new Ce),e.version());case Q.DictionaryBatch:return le.decode(e.header(new kn),e.version())}throw new Error(`Unrecognized Message type: { name: ${Q[t]}, type: ${t} }`)}}W.encode=bm;W.decode=pm;W.fromJSON=Qb;H.encode=ym;H.decode=om;H.fromJSON=Hb;Ct.encode=mm;Ct.decode=am;Ct.fromJSON=Ff;le.encode=gm;le.decode=cm;le.fromJSON=Jb;In.encode=vm;In.decode=lm;ae.encode=wm;ae.decode=um;function om(e,t=new Map){const n=dm(e,t);return new H(n,Fi(e),t)}function am(e,t=Gt.V4){return new Ct(e.length(),fm(e),hm(e,t))}function cm(e,t=Gt.V4){return new le(Ct.decode(e.data(),t),e.id(),e.isDelta())}function um(e){return new ae(e.offset(),e.length())}function lm(e){return new In(e.length(),e.nullCount())}function fm(e){const t=[];for(let n,r=-1,s=-1,o=e.nodesLength();++r<o;)(n=e.nodes(r))&&(t[++s]=In.decode(n));return t}function hm(e,t){const n=[];for(let r,s=-1,o=-1,i=e.buffersLength();++s<i;)(r=e.buffers(s))&&(t<Gt.V4&&(r.bb_pos+=8*(s+1)),n[++o]=ae.decode(r));return n}function dm(e,t){const n=[];for(let r,s=-1,o=-1,i=e.fieldsLength();++s<i;)(r=e.fields(s))&&(n[++o]=W.decode(r,t));return n}function Xc(e,t){const n=[];for(let r,s=-1,o=-1,i=e.childrenLength();++s<i;)(r=e.children(s))&&(n[++o]=W.decode(r,t));return n}function pm(e,t){let n,r,s,o,i,a;return!t||!(a=e.dictionary())?(s=Qc(e,Xc(e,t)),r=new W(e.name(),s,e.nullable(),Fi(e))):t.has(n=a.id().low)?(o=(o=a.indexType())?qc(o):new fn,i=new Ge(t.get(n),o,n,a.isOrdered()),r=new W(e.name(),i,e.nullable(),Fi(e))):(o=(o=a.indexType())?qc(o):new fn,t.set(n,s=Qc(e,Xc(e,t))),i=new Ge(s,o,n,a.isOrdered()),r=new W(e.name(),i,e.nullable(),Fi(e))),r||null}function Fi(e){const t=new Map;if(e)for(let n,r,s=-1,o=e.customMetadataLength()|0;++s<o;)(n=e.customMetadata(s))&&(r=n.key())!=null&&t.set(r,n.value());return t}function qc(e){return new xt(e.isSigned(),e.bitWidth())}function Qc(e,t){const n=e.typeType();switch(n){case ft.NONE:return new Zn;case ft.Null:return new Zn;case ft.Binary:return new xr;case ft.Utf8:return new Xn;case ft.Bool:return new Lr;case ft.List:return new Qn((t||[])[0]);case ft.Struct_:return new Qt(t||[])}switch(n){case ft.Int:{const r=e.type(new m.apache.arrow.flatbuf.Int);return new xt(r.isSigned(),r.bitWidth())}case ft.FloatingPoint:{const r=e.type(new m.apache.arrow.flatbuf.FloatingPoint);return new hn(r.precision())}case ft.Decimal:{const r=e.type(new m.apache.arrow.flatbuf.Decimal);return new Pi(r.scale(),r.precision())}case ft.Date:{const r=e.type(new m.apache.arrow.flatbuf.Date);return new qn(r.unit())}case ft.Time:{const r=e.type(new m.apache.arrow.flatbuf.Time);return new zi(r.unit(),r.bitWidth())}case ft.Timestamp:{const r=e.type(new m.apache.arrow.flatbuf.Timestamp);return new Wi(r.unit(),r.timezone())}case ft.Interval:{const r=e.type(new m.apache.arrow.flatbuf.Interval);return new $i(r.unit())}case ft.Union:{const r=e.type(new m.apache.arrow.flatbuf.Union);return new Dr(r.mode(),r.typeIdsArray()||[],t||[])}case ft.FixedSizeBinary:{const r=e.type(new m.apache.arrow.flatbuf.FixedSizeBinary);return new Yi(r.byteWidth())}case ft.FixedSizeList:{const r=e.type(new m.apache.arrow.flatbuf.FixedSizeList);return new kr(r.listSize(),(t||[])[0])}case ft.Map:{const r=e.type(new m.apache.arrow.flatbuf.Map);return new Er((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${ft[n]}" (${n})`)}function ym(e,t){const n=t.fields.map(o=>W.encode(e,o));ge.startFieldsVector(e,n.length);const r=ge.createFieldsVector(e,n),s=t.metadata&&t.metadata.size>0?ge.createCustomMetadataVector(e,[...t.metadata].map(([o,i])=>{const a=e.createString(`${o}`),c=e.createString(`${i}`);return Ve.startKeyValue(e),Ve.addKey(e,a),Ve.addValue(e,c),Ve.endKeyValue(e)})):-1;return ge.startSchema(e),ge.addFields(e,r),ge.addEndianness(e,_m?Jc.Little:Jc.Big),s!==-1&&ge.addCustomMetadata(e,s),ge.endSchema(e)}function bm(e,t){let n=-1,r=-1,s=-1,o=t.type,i=t.typeId;U.isDictionary(o)?(i=o.dictionary.typeId,s=qs.visit(o,e),r=qs.visit(o.dictionary,e)):r=qs.visit(o,e);const a=(o.children||[]).map(l=>W.encode(e,l)),c=$t.createChildrenVector(e,a),u=t.metadata&&t.metadata.size>0?$t.createCustomMetadataVector(e,[...t.metadata].map(([l,f])=>{const h=e.createString(`${l}`),p=e.createString(`${f}`);return Ve.startKeyValue(e),Ve.addKey(e,h),Ve.addValue(e,p),Ve.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),$t.startField(e),$t.addType(e,r),$t.addTypeType(e,i),$t.addChildren(e,c),$t.addNullable(e,!!t.nullable),n!==-1&&$t.addName(e,n),s!==-1&&$t.addDictionary(e,s),u!==-1&&$t.addCustomMetadata(e,u),$t.endField(e)}function mm(e,t){const n=t.nodes||[],r=t.buffers||[];Ce.startNodesVector(e,n.length),n.slice().reverse().forEach(i=>In.encode(e,i));const s=e.endVector();Ce.startBuffersVector(e,r.length),r.slice().reverse().forEach(i=>ae.encode(e,i));const o=e.endVector();return Ce.startRecordBatch(e),Ce.addLength(e,new pn(t.length,0)),Ce.addNodes(e,s),Ce.addBuffers(e,o),Ce.endRecordBatch(e)}function gm(e,t){const n=Ct.encode(e,t.data);return kn.startDictionaryBatch(e),kn.addId(e,new pn(t.id,0)),kn.addIsDelta(e,t.isDelta),kn.addData(e,n),kn.endDictionaryBatch(e)}function vm(e,t){return rm.createFieldNode(e,new pn(t.length,0),new pn(t.nullCount,0))}function wm(e,t){return nm.createBuffer(e,new pn(t.offset,0),new pn(t.length,0))}const _m=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256}();var Df=y.ByteBuffer;const Ea=e=>`Expected ${Q[e]} Message in stream, but was null or length 0.`,Ua=e=>`Header pointer of flatbuffer-encoded ${Q[e]} Message is null or length 0.`,kf=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Ef=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;class Uf{constructor(t){this.source=t instanceof Ki?t:new Ki(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?ot:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(Ea(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const n=j(this.source.read(t));if(n.byteLength<t)throw new Error(Ef(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}readSchema(t=!1){const n=Q.Schema,r=this.readMessage(n),s=r&&r.header();if(t&&!s)throw new Error(Ua(n));return s}readMetadataLength(){const t=this.source.read(xs),n=t&&new Df(t),r=n&&n.readInt32(0)||0;return{done:r===0,value:r}}readMetadata(t){const n=this.source.read(t);if(!n)return ot;if(n.byteLength<t)throw new Error(kf(t,n.byteLength));return{done:!1,value:_t.decode(n)}}}class Sm{constructor(t,n){this.source=t instanceof dn?t:Ul(t)?new Zi(t,n):new dn(t)}[Symbol.asyncIterator](){return this}async next(){let t;return(t=await this.readMetadataLength()).done||t.value===-1&&(t=await this.readMetadataLength()).done||(t=await this.readMetadata(t.value)).done?ot:t}async throw(t){return await this.source.throw(t)}async return(t){return await this.source.return(t)}async readMessage(t){let n;if((n=await this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(Ea(t));return n.value}async readMessageBody(t){if(t<=0)return new Uint8Array(0);const n=j(await this.source.read(t));if(n.byteLength<t)throw new Error(Ef(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}async readSchema(t=!1){const n=Q.Schema,r=await this.readMessage(n),s=r&&r.header();if(t&&!s)throw new Error(Ua(n));return s}async readMetadataLength(){const t=await this.source.read(xs),n=t&&new Df(t),r=n&&n.readInt32(0)||0;return{done:r===0,value:r}}async readMetadata(t){const n=await this.source.read(t);if(!n)return ot;if(n.byteLength<t)throw new Error(kf(t,n.byteLength));return{done:!1,value:_t.decode(n)}}}class Im extends Uf{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Ec?t:new Ec(t)}next(){const{_json:t}=this;if(!this._schema){this._schema=!0;const n=_t.fromJSON(t.schema,Q.Schema);return{done:!1,value:n}}if(this._dictionaryIndex<t.dictionaries.length){const n=t.dictionaries[this._dictionaryIndex++];this._body=n.data.columns;const r=_t.fromJSON(n,Q.DictionaryBatch);return{done:!1,value:r}}if(this._batchIndex<t.batches.length){const n=t.batches[this._batchIndex++];this._body=n.columns;const r=_t.fromJSON(n,Q.RecordBatch);return{done:!1,value:r}}return this._body=[],ot}readMessageBody(t){return n(this._body);function n(r){return(r||[]).reduce((s,o)=>[...s,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...n(o.children)],[])}}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(Ea(t));return n.value}readSchema(){const t=Q.Schema,n=this.readMessage(t),r=n&&n.header();if(!n||!r)throw new Error(Ua(t));return r}}const xs=4,Lo="ARROW1",Cr=new Uint8Array(Lo.length);for(let e=0;e<Lo.length;e+=1)Cr[e]=Lo.charCodeAt(e);function Na(e,t=0){for(let n=-1,r=Cr.length;++n<r;)if(Cr[n]!==e[t+n])return!1;return!0}const ti=Cr.length,Nf=ti+xs,Tm=ti*2+xs;class lt extends V{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){const n=new lt,r=sb(Ot,t),[s=n]=n.visitMany(r);return s}visit(t){if(!U.isDictionary(t.type)){const{data:n,length:r,nullCount:s}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");U.isNull(t.type)||Ht.call(this,s<=0?new Uint8Array(0):Ss(n.offset,r,n.nullBitmap)),this.nodes.push(new In(r,s))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.indices)}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function Ht(e){const t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new ae(this._byteLength,t)),this._byteLength+=t,this}function Am(e){const{type:t,length:n,typeIds:r,valueOffsets:s}=e;if(Ht.call(this,r),t.mode===Ae.Sparse)return Do.call(this,e);if(t.mode===Ae.Dense){if(e.offset<=0)return Ht.call(this,s),Do.call(this,e);{const o=r.reduce((l,f)=>Math.max(l,f),r[0]),i=new Int32Array(o+1),a=new Int32Array(o+1).fill(-1),c=new Int32Array(n),u=_s(-s[0],n,s);for(let l,f,h=-1;++h<n;)(f=a[l=r[h]])===-1&&(f=a[l]=u[l]),c[h]=u[h]-f,++i[l];Ht.call(this,c);for(let l,f=-1,h=t.children.length;++f<h;)if(l=e.getChildAt(f)){const p=t.typeIds[f],w=Math.min(n,i[p]);this.visit(l.slice(a[p],w))}}}return this}function Bm(e){let t;return e.nullCount>=e.length?Ht.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Ht.call(this,Ss(e.offset,e.length,t)):Ht.call(this,Fr(e))}function Xe(e){return Ht.call(this,e.values.subarray(0,e.length*e.stride))}function Mf(e){const{length:t,values:n,valueOffsets:r}=e,s=r[0],o=r[t],i=Math.min(o-s,n.byteLength-s);return Ht.call(this,_s(-r[0],t,r)),Ht.call(this,n.subarray(s,s+i)),this}function Ma(e){const{length:t,valueOffsets:n}=e;return n&&Ht.call(this,_s(n[0],t,n)),this.visit(e.getChildAt(0))}function Do(e){return this.visitMany(e.type.children.map((t,n)=>e.getChildAt(n)).filter(Boolean))[0]}lt.prototype.visitBool=Bm;lt.prototype.visitInt=Xe;lt.prototype.visitFloat=Xe;lt.prototype.visitUtf8=Mf;lt.prototype.visitBinary=Mf;lt.prototype.visitFixedSizeBinary=Xe;lt.prototype.visitDate=Xe;lt.prototype.visitTimestamp=Xe;lt.prototype.visitTime=Xe;lt.prototype.visitDecimal=Xe;lt.prototype.visitList=Ma;lt.prototype.visitStruct=Do;lt.prototype.visitUnion=Am;lt.prototype.visitInterval=Xe;lt.prototype.visitFixedSizeList=Ma;lt.prototype.visitMap=Ma;class Ca extends wn{constructor(t){super(),this._position=0,this._started=!1,this._sink=new Ir,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Mt(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Ye(t)?t.then(n=>this.writeAll(n)):Le(t)?Pa(this,t):ja(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,n=null){return t===this._sink||t instanceof Ir?this._sink=t:(this._sink=new Ir,t&&gp(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&vp(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!n||!n.compareTo(this._schema))&&(n===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof G&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof Ot&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!n.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof Ot?t instanceof Es||this._writeRecordBatch(t):t instanceof G?this.writeAll(t.chunks):Xt(t)&&this.writeAll(t)}_writeMessage(t,n=8){const r=n-1,s=_t.encode(t),o=s.byteLength,i=this._writeLegacyIpcFormat?4:8,a=o+i+r&~r,c=a-o-i;return t.headerType===Q.RecordBatch?this._recordBatchBlocks.push(new Ke(a,t.bodyLength,this._position)):t.headerType===Q.DictionaryBatch&&this._dictionaryBlocks.push(new Ke(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-i)),o>0&&this._write(s),this._writePadding(c)}_write(t){if(this._started){const n=j(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(_t.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Cr)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:n,nodes:r,bufferRegions:s,buffers:o}=lt.assemble(t),i=new Ct(t.length,r,s),a=_t.from(i,n);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));const{byteLength:s,nodes:o,bufferRegions:i,buffers:a}=lt.assemble(t),c=new Ct(t.length,o,i),u=new le(c,n,r),l=_t.from(u,s);return this._writeMessage(l)._writeBodyBuffers(a)}_writeBodyBuffers(t){let n,r,s;for(let o=-1,i=t.length;++o<i;)(n=t[o])&&(r=n.byteLength)>0&&(this._write(n),(s=(r+7&-8)-r)>0&&this._writePadding(s));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let s=this._dictionaryDeltaOffsets.get(n)||0;if(s===0||(r=r.slice(s)).length>0){const o="chunks"in r?r.chunks:[r];for(const i of o)this._writeDictionaryBatch(i,n,s>0),s+=i.length}}return this}}class Ra extends Ca{static writeAll(t,n){const r=new Ra(n);return Ye(t)?t.then(s=>r.writeAll(s)):Le(t)?Pa(r,t):ja(r,t)}}class Va extends Ca{constructor(){super(),this._autoDestroy=!0}static writeAll(t){const n=new Va;return Ye(t)?t.then(r=>n.writeAll(r)):Le(t)?Pa(n,t):ja(n,t)}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const n=Mr.encode(new Mr(t,Gt.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}}function ja(e,t){let n=t;t instanceof G&&(n=t.chunks,e.reset(void 0,t.schema));for(const r of n)e.write(r);return e.finish()}async function Pa(e,t){for await(const n of t)e.write(n);return e.finish()}const Qs=new Uint8Array(0),Cf=e=>[Qs,Qs,new Uint8Array(e),Qs];function Om(e,t,n=t.reduce((r,s)=>Math.max(r,s.length),0)){let r,s,o=-1,i=t.length;const a=[...e.fields],c=[],u=(n+63&-64)>>3;for(;++o<i;)(r=t[o])&&r.length===n?c[o]=r:((s=a[o]).nullable||(a[o]=a[o].clone({nullable:!0})),c[o]=r?r._changeLengthAndBackfillNullBitmap(n):S.new(s.type,0,n,n,Cf(u)));return[new H(a),n,c]}function Fm(e){return Rf(new H(e.map(({field:t})=>t)),e)}function Rf(e,t){return xm(e,t.map(n=>n instanceof mt?n.chunks.map(r=>r.data):[n.data]))}function xm(e,t){const n=[...e.fields],r=[],s={numBatches:t.reduce((f,h)=>Math.max(f,h.length),0)};let o=0,i=0,a=-1,c=t.length,u,l=[];for(;s.numBatches-- >0;){for(i=Number.POSITIVE_INFINITY,a=-1;++a<c;)l[a]=u=t[a].shift(),i=Math.min(i,u?u.length:i);isFinite(i)&&(l=Lm(n,i,l,t,s),i>0&&(r[o++]=[i,l.slice()]))}return[e=new H(n,e.metadata),r.map(f=>new Ot(e,...f))]}function Lm(e,t,n,r,s){let o,i,a=0,c=-1,u=r.length;const l=(t+63&-64)>>3;for(;++c<u;)(o=n[c])&&(a=o.length)>=t?a===t?n[c]=o:(n[c]=o.slice(0,t),o=o.slice(t,a-t),s.numBatches=Math.max(s.numBatches,r[c].unshift(o))):((i=e[c]).nullable||(e[c]=i.clone({nullable:!0})),n[c]=o?o._changeLengthAndBackfillNullBitmap(t):S.new(i.type,0,t,t,Cf(l)));return n}class tt extends z{constructor(t,n){super(),this._children=n,this.numChildren=t.childData.length,this._bindDataAccessors(this.data=t)}get type(){return this.data.type}get typeId(){return this.data.typeId}get length(){return this.data.length}get offset(){return this.data.offset}get stride(){return this.data.stride}get nullCount(){return this.data.nullCount}get byteLength(){return this.data.byteLength}get VectorName(){return`${d[this.typeId]}Vector`}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}clone(t,n=this._children){return z.new(t,n)}concat(...t){return mt.concat(this,...t)}slice(t,n){return Aa(this,t,n,this._sliceInternal)}isValid(t){if(this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}getChildAt(t){return t<0||t>=this.numChildren?null:(this._children||(this._children=[]))[t]||(this._children[t]=z.new(this.data.childData[t]))}toJSON(){return[...this]}_sliceInternal(t,n,r){return t.clone(t.data.slice(n,r-n),null)}_bindDataAccessors(t){}}tt.prototype[Symbol.isConcatSpreadable]=!0;class Dm extends tt{asUtf8(){return z.new(this.data.clone(new Xn))}}class km extends tt{static from(t){return yn(()=>new Lr,t)}}class za extends tt{static from(...t){return t.length===2?yn(()=>t[1]===ue.DAY?new sy:new Uc,t[0]):yn(()=>new Uc,t[0])}}class Em extends za{}class Um extends za{}class Nm extends tt{}class Wa extends tt{constructor(t){super(t),this.indices=z.new(t.clone(this.type.indices))}static from(...t){if(t.length===3){const[n,r,s]=t,o=new Ge(n.type,r,null,null);return z.new(S.Dictionary(o,0,s.length,0,null,s,n))}return yn(()=>t[0].type,t[0])}get dictionary(){return this.data.dictionary}reverseLookup(t){return this.dictionary.indexOf(t)}getKey(t){return this.indices.get(t)}getValue(t){return this.dictionary.get(t)}setKey(t,n){return this.indices.set(t,n)}setValue(t,n){return this.dictionary.set(t,n)}}Wa.prototype.indices=null;class Mm extends tt{}class Cm extends tt{}class Ls extends tt{static from(t){let n=jm(this);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let r=Vm(t.constructor)||n;if(n===null&&(n=r),n&&n===r){let s=new n,o=t.byteLength/s.ArrayType.BYTES_PER_ELEMENT;if(!Rm(n,t.constructor))return z.new(S.Float(s,0,o,0,null,t))}}if(n)return yn(()=>new n,t);throw t instanceof DataView||t instanceof ArrayBuffer?new TypeError(`Cannot infer float type from instance of ${t.constructor.name}`):new TypeError("Unrecognized FloatVector input")}}class Vf extends Ls{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}}class jf extends Ls{}class Pf extends Ls{}const Rm=(e,t)=>e===Ts&&t!==Uint16Array,Vm=e=>{switch(e){case Uint16Array:return Ts;case Float32Array:return va;case Float64Array:return wa;default:return null}},jm=e=>{switch(e){case Vf:return Ts;case jf:return va;case Pf:return wa;default:return null}};class $a extends tt{}class Pm extends $a{}class zm extends $a{}class re extends tt{static from(...t){let[n,r=!1]=t,s=Ym(this,r);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)){let o=$m(n.constructor,r)||s;if(s===null&&(s=o),s&&s===o){let i=new s,a=n.byteLength/i.ArrayType.BYTES_PER_ELEMENT;return Wm(s,n.constructor)&&(a*=.5),z.new(S.Int(i,0,a,0,null,n))}}if(s)return yn(()=>new s,n);throw n instanceof DataView||n instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${n.constructor.name}`):new TypeError("Unrecognized IntVector input")}}class zf extends re{}class Wf extends re{}class $f extends re{}class Yf extends re{toBigInt64Array(){return Cl(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}}class Gf extends re{}class Kf extends re{}class Zf extends re{}class Hf extends re{toBigUint64Array(){return Rl(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}}const Wm=(e,t)=>(e===Hn||e===Jn)&&(t===Int32Array||t===Uint32Array),$m=(e,t)=>{switch(e){case Int8Array:return pa;case Int16Array:return ya;case Int32Array:return t?Hn:fn;case ar:return Hn;case Uint8Array:return ba;case Uint16Array:return ma;case Uint32Array:return t?Jn:ga;case Yr:return Jn;default:return null}},Ym=(e,t)=>{switch(e){case zf:return pa;case Wf:return ya;case $f:return t?Hn:fn;case Yf:return Hn;case Gf:return ba;case Kf:return ma;case Zf:return t?Jn:ga;case Hf:return Jn;default:return null}};class Gm extends tt{}class Km extends tt{asList(){const t=this.type.children[0];return z.new(this.data.clone(new Qn(t)))}bind(t){const n=this.getChildAt(0),{[t]:r,[t+1]:s}=this.valueOffsets;return new nf(n.slice(r,s))}}class Zm extends tt{}const Hm=Symbol.for("rowIndex");class Ds extends tt{bind(t){const n=this._row||(this._row=new rf(this)),r=Object.create(n);return r[Hm]=t,r}}class ei extends tt{}class Jm extends ei{}class Xm extends ei{}class qm extends ei{}class Qm extends ei{}class ni extends tt{}class tg extends ni{}class eg extends ni{}class ng extends ni{}class rg extends ni{}class Ya extends tt{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}}class ig extends Ya{get valueOffsets(){return this.data.valueOffsets}}class sg extends Ya{}class og extends tt{static from(t){return yn(()=>new Xn,t)}asBinary(){return z.new(this.data.clone(new xr))}}function tu(e){return function(){return e(this)}}function ag(e){return function(t){return e(this,t)}}function eu(e){return function(t,n){return e(this,t,n)}}class O extends V{}const cg=(e,t)=>864e5*e[t],Ga=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),ug=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,lg=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,Jf=e=>new Date(e),fg=(e,t)=>Jf(cg(e,t)),hg=(e,t)=>Jf(Ga(e,t)),dg=(e,t)=>null,Xf=(e,t,n)=>{const{[n]:r,[n+1]:s}=t;return r!=null&&s!=null?e.subarray(r,s):null},pg=({offset:e,values:t},n)=>{const r=e+n;return(t[r>>3]&1<<r%8)!==0},qf=({values:e},t)=>fg(e,t),Qf=({values:e},t)=>hg(e,t*2),pe=({stride:e,values:t},n)=>t[e*n],th=({stride:e,values:t},n)=>Xl(t[e*n]),Ka=({stride:e,values:t,type:n},r)=>_n.new(t.subarray(e*r,e*(r+1)),n.isSigned),yg=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),bg=({values:e,valueOffsets:t},n)=>Xf(e,t,n),mg=({values:e,valueOffsets:t},n)=>{const r=Xf(e,t,n);return r!==null?To(r):null},gg=(e,t)=>e.type.bitWidth<64?pe(e,t):Ka(e,t),vg=(e,t)=>e.type.precision!==Pt.HALF?pe(e,t):th(e,t),wg=(e,t)=>e.type.unit===ue.DAY?qf(e,t):Qf(e,t),eh=({values:e},t)=>1e3*Ga(e,t*2),nh=({values:e},t)=>Ga(e,t*2),rh=({values:e},t)=>ug(e,t*2),ih=({values:e},t)=>lg(e,t*2),_g=(e,t)=>{switch(e.type.unit){case Z.SECOND:return eh(e,t);case Z.MILLISECOND:return nh(e,t);case Z.MICROSECOND:return rh(e,t);case Z.NANOSECOND:return ih(e,t)}},sh=({values:e,stride:t},n)=>e[t*n],oh=({values:e,stride:t},n)=>e[t*n],ah=({values:e},t)=>_n.signed(e.subarray(2*t,2*(t+1))),ch=({values:e},t)=>_n.signed(e.subarray(2*t,2*(t+1))),Sg=(e,t)=>{switch(e.type.unit){case Z.SECOND:return sh(e,t);case Z.MILLISECOND:return oh(e,t);case Z.MICROSECOND:return ah(e,t);case Z.NANOSECOND:return ch(e,t)}},Ig=({values:e},t)=>_n.decimal(e.subarray(4*t,4*(t+1))),Tg=(e,t)=>{const n=e.getChildAt(0),{valueOffsets:r,stride:s}=e;return n.slice(r[t*s],r[t*s+1])},Ag=(e,t)=>e.bind(t),Bg=(e,t)=>e.bind(t),Og=(e,t)=>e.type.mode===Ae.Dense?uh(e,t):lh(e,t),uh=(e,t)=>{const n=e.typeIdToChildIndex[e.typeIds[t]],r=e.getChildAt(n);return r?r.get(e.valueOffsets[t]):null},lh=(e,t)=>{const n=e.typeIdToChildIndex[e.typeIds[t]],r=e.getChildAt(n);return r?r.get(t):null},Fg=(e,t)=>e.getValue(e.getKey(t)),xg=(e,t)=>e.type.unit===Kn.DAY_TIME?fh(e,t):hh(e,t),fh=({values:e},t)=>e.subarray(2*t,2*(t+1)),hh=({values:e},t)=>{const n=e[t],r=new Int32Array(2);return r[0]=n/12|0,r[1]=n%12|0,r},Lg=(e,t)=>{const n=e.getChildAt(0),{stride:r}=e;return n.slice(t*r,(t+1)*r)};O.prototype.visitNull=dg;O.prototype.visitBool=pg;O.prototype.visitInt=gg;O.prototype.visitInt8=pe;O.prototype.visitInt16=pe;O.prototype.visitInt32=pe;O.prototype.visitInt64=Ka;O.prototype.visitUint8=pe;O.prototype.visitUint16=pe;O.prototype.visitUint32=pe;O.prototype.visitUint64=Ka;O.prototype.visitFloat=vg;O.prototype.visitFloat16=th;O.prototype.visitFloat32=pe;O.prototype.visitFloat64=pe;O.prototype.visitUtf8=mg;O.prototype.visitBinary=bg;O.prototype.visitFixedSizeBinary=yg;O.prototype.visitDate=wg;O.prototype.visitDateDay=qf;O.prototype.visitDateMillisecond=Qf;O.prototype.visitTimestamp=_g;O.prototype.visitTimestampSecond=eh;O.prototype.visitTimestampMillisecond=nh;O.prototype.visitTimestampMicrosecond=rh;O.prototype.visitTimestampNanosecond=ih;O.prototype.visitTime=Sg;O.prototype.visitTimeSecond=sh;O.prototype.visitTimeMillisecond=oh;O.prototype.visitTimeMicrosecond=ah;O.prototype.visitTimeNanosecond=ch;O.prototype.visitDecimal=Ig;O.prototype.visitList=Tg;O.prototype.visitStruct=Bg;O.prototype.visitUnion=Og;O.prototype.visitDenseUnion=uh;O.prototype.visitSparseUnion=lh;O.prototype.visitDictionary=Fg;O.prototype.visitInterval=xg;O.prototype.visitIntervalDayTime=fh;O.prototype.visitIntervalYearMonth=hh;O.prototype.visitFixedSizeList=Lg;O.prototype.visitMap=Ag;const ks=new O;class F extends V{}function Dg(e,t){return t===null&&e.length>0?0:-1}function kg(e,t){const{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(const s of Gr(n,e.data.offset+(t||0),e.length,n,la)){if(!s)return r;++r}return-1}function C(e,t,n){if(t===void 0)return-1;if(t===null)return kg(e,n);const r=Sn(t);for(let s=(n||0)-1,o=e.length;++s<o;)if(r(e.get(s)))return s;return-1}function dh(e,t,n){const r=Sn(t);for(let s=(n||0)-1,o=e.length;++s<o;)if(r(e.get(s)))return s;return-1}F.prototype.visitNull=Dg;F.prototype.visitBool=C;F.prototype.visitInt=C;F.prototype.visitInt8=C;F.prototype.visitInt16=C;F.prototype.visitInt32=C;F.prototype.visitInt64=C;F.prototype.visitUint8=C;F.prototype.visitUint16=C;F.prototype.visitUint32=C;F.prototype.visitUint64=C;F.prototype.visitFloat=C;F.prototype.visitFloat16=C;F.prototype.visitFloat32=C;F.prototype.visitFloat64=C;F.prototype.visitUtf8=C;F.prototype.visitBinary=C;F.prototype.visitFixedSizeBinary=C;F.prototype.visitDate=C;F.prototype.visitDateDay=C;F.prototype.visitDateMillisecond=C;F.prototype.visitTimestamp=C;F.prototype.visitTimestampSecond=C;F.prototype.visitTimestampMillisecond=C;F.prototype.visitTimestampMicrosecond=C;F.prototype.visitTimestampNanosecond=C;F.prototype.visitTime=C;F.prototype.visitTimeSecond=C;F.prototype.visitTimeMillisecond=C;F.prototype.visitTimeMicrosecond=C;F.prototype.visitTimeNanosecond=C;F.prototype.visitDecimal=C;F.prototype.visitList=C;F.prototype.visitStruct=C;F.prototype.visitUnion=C;F.prototype.visitDenseUnion=dh;F.prototype.visitSparseUnion=dh;F.prototype.visitDictionary=C;F.prototype.visitInterval=C;F.prototype.visitIntervalDayTime=C;F.prototype.visitIntervalYearMonth=C;F.prototype.visitFixedSizeList=C;F.prototype.visitMap=C;const ph=new F;class x extends V{}function Eg(e){const t=ks.getVisitFn(e);return Gr(e.nullBitmap,e.offset,e.length,e,(n,r,s,o)=>(s&1<<o)!==0?t(n,r):null)}function k(e){if(e.nullCount>0)return Eg(e);const{type:t,typeId:n,length:r}=e;return e.stride===1&&(n===d.Timestamp||n===d.Int&&t.bitWidth!==64||n===d.Time&&t.bitWidth!==64||n===d.Float&&t.precision>0)?e.values.subarray(0,r)[Symbol.iterator]():function*(s){for(let o=-1;++o<r;)yield s(e,o)}(ks.getVisitFn(e))}x.prototype.visitNull=k;x.prototype.visitBool=k;x.prototype.visitInt=k;x.prototype.visitInt8=k;x.prototype.visitInt16=k;x.prototype.visitInt32=k;x.prototype.visitInt64=k;x.prototype.visitUint8=k;x.prototype.visitUint16=k;x.prototype.visitUint32=k;x.prototype.visitUint64=k;x.prototype.visitFloat=k;x.prototype.visitFloat16=k;x.prototype.visitFloat32=k;x.prototype.visitFloat64=k;x.prototype.visitUtf8=k;x.prototype.visitBinary=k;x.prototype.visitFixedSizeBinary=k;x.prototype.visitDate=k;x.prototype.visitDateDay=k;x.prototype.visitDateMillisecond=k;x.prototype.visitTimestamp=k;x.prototype.visitTimestampSecond=k;x.prototype.visitTimestampMillisecond=k;x.prototype.visitTimestampMicrosecond=k;x.prototype.visitTimestampNanosecond=k;x.prototype.visitTime=k;x.prototype.visitTimeSecond=k;x.prototype.visitTimeMillisecond=k;x.prototype.visitTimeMicrosecond=k;x.prototype.visitTimeNanosecond=k;x.prototype.visitDecimal=k;x.prototype.visitList=k;x.prototype.visitStruct=k;x.prototype.visitUnion=k;x.prototype.visitDenseUnion=k;x.prototype.visitSparseUnion=k;x.prototype.visitDictionary=k;x.prototype.visitInterval=k;x.prototype.visitIntervalDayTime=k;x.prototype.visitIntervalYearMonth=k;x.prototype.visitFixedSizeList=k;x.prototype.visitMap=k;const Za=new x;class L extends V{}function E(e){const{type:t,length:n,stride:r}=e;switch(t.typeId){case d.Int:case d.Float:case d.Decimal:case d.Time:case d.Timestamp:return e.values.subarray(0,n*r)}return[...Za.visit(e)]}L.prototype.visitNull=E;L.prototype.visitBool=E;L.prototype.visitInt=E;L.prototype.visitInt8=E;L.prototype.visitInt16=E;L.prototype.visitInt32=E;L.prototype.visitInt64=E;L.prototype.visitUint8=E;L.prototype.visitUint16=E;L.prototype.visitUint32=E;L.prototype.visitUint64=E;L.prototype.visitFloat=E;L.prototype.visitFloat16=E;L.prototype.visitFloat32=E;L.prototype.visitFloat64=E;L.prototype.visitUtf8=E;L.prototype.visitBinary=E;L.prototype.visitFixedSizeBinary=E;L.prototype.visitDate=E;L.prototype.visitDateDay=E;L.prototype.visitDateMillisecond=E;L.prototype.visitTimestamp=E;L.prototype.visitTimestampSecond=E;L.prototype.visitTimestampMillisecond=E;L.prototype.visitTimestampMicrosecond=E;L.prototype.visitTimestampNanosecond=E;L.prototype.visitTime=E;L.prototype.visitTimeSecond=E;L.prototype.visitTimeMillisecond=E;L.prototype.visitTimeMicrosecond=E;L.prototype.visitTimeNanosecond=E;L.prototype.visitDecimal=E;L.prototype.visitList=E;L.prototype.visitStruct=E;L.prototype.visitUnion=E;L.prototype.visitDenseUnion=E;L.prototype.visitSparseUnion=E;L.prototype.visitDictionary=E;L.prototype.visitInterval=E;L.prototype.visitIntervalDayTime=E;L.prototype.visitIntervalYearMonth=E;L.prototype.visitFixedSizeList=E;L.prototype.visitMap=E;const yh=new L,pr=(e,t)=>e+t,to=e=>`Cannot compute the byte width of variable-width column ${e}`;class Ug extends V{visitNull(t){return 0}visitInt(t){return t.bitWidth/8}visitFloat(t){return t.ArrayType.BYTES_PER_ELEMENT}visitBinary(t){throw new Error(to(t))}visitUtf8(t){throw new Error(to(t))}visitBool(t){return 1/8}visitDecimal(t){return 16}visitDate(t){return(t.unit+1)*4}visitTime(t){return t.bitWidth/8}visitTimestamp(t){return t.unit===Z.SECOND?4:8}visitInterval(t){return(t.unit+1)*4}visitList(t){throw new Error(to(t))}visitStruct(t){return this.visitFields(t.children).reduce(pr,0)}visitUnion(t){return this.visitFields(t.children).reduce(pr,0)}visitFixedSizeBinary(t){return t.byteWidth}visitFixedSizeList(t){return t.listSize*this.visitFields(t.children).reduce(pr,0)}visitMap(t){return this.visitFields(t.children).reduce(pr,0)}visitDictionary(t){return this.visit(t.indices)}visitFields(t){return(t||[]).map(n=>this.visit(n.type))}visitSchema(t){return this.visitFields(t.fields).reduce(pr,0)}}const bh=new Ug;class Ng extends V{visitNull(){return Zm}visitBool(){return km}visitInt(){return re}visitInt8(){return zf}visitInt16(){return Wf}visitInt32(){return $f}visitInt64(){return Yf}visitUint8(){return Gf}visitUint16(){return Kf}visitUint32(){return Zf}visitUint64(){return Hf}visitFloat(){return Ls}visitFloat16(){return Vf}visitFloat32(){return jf}visitFloat64(){return Pf}visitUtf8(){return og}visitBinary(){return Dm}visitFixedSizeBinary(){return Mm}visitDate(){return za}visitDateDay(){return Em}visitDateMillisecond(){return Um}visitTimestamp(){return ei}visitTimestampSecond(){return Jm}visitTimestampMillisecond(){return Xm}visitTimestampMicrosecond(){return qm}visitTimestampNanosecond(){return Qm}visitTime(){return ni}visitTimeSecond(){return tg}visitTimeMillisecond(){return eg}visitTimeMicrosecond(){return ng}visitTimeNanosecond(){return rg}visitDecimal(){return Nm}visitList(){return Gm}visitStruct(){return Ds}visitUnion(){return Ya}visitDenseUnion(){return ig}visitSparseUnion(){return sg}visitDictionary(){return Wa}visitInterval(){return $a}visitIntervalDayTime(){return Pm}visitIntervalYearMonth(){return zm}visitFixedSizeList(){return Cm}visitMap(){return Km}}const mh=new Ng;z.new=Mg;z.from=Cg;function Mg(e,...t){return new(mh.getVisitFn(e)())(e,...t)}function yn(e,t){if(Xt(t))return z.from({nullValues:[null,void 0],type:e(),values:t});if(Le(t))return z.from({nullValues:[null,void 0],type:e(),values:t});const{values:n=[],type:r=e(),nullValues:s=[null,void 0]}={...t};return Xt(n)?z.from({nullValues:s,...t,type:r}):z.from({nullValues:s,...t,type:r})}function Cg(e){const{values:t=[],...n}={nullValues:[null,void 0],...e};if(Xt(t)){const r=[...at.throughIterable(n)(t)];return r.length===1?r[0]:mt.concat(r)}return(async r=>{const s=at.throughAsyncIterable(n);for await(const o of s(t))r.push(o);return r.length===1?r[0]:mt.concat(r)})([])}tt.prototype.get=function(t){return ks.visit(this,t)};tt.prototype.set=function(t,n){return Fs.visit(this,t,n)};tt.prototype.indexOf=function(t,n){return ph.visit(this,t,n)};tt.prototype.toArray=function(){return yh.visit(this)};tt.prototype.getByteWidth=function(){return bh.visit(this.type)};tt.prototype[Symbol.iterator]=function(){return Za.visit(this)};tt.prototype._bindDataAccessors=Pg;Object.keys(d).map(e=>d[e]).filter(e=>typeof e=="number").filter(e=>e!==d.NONE).forEach(e=>{const t=mh.visit(e);t.prototype.get=ag(ks.getVisitFn(e)),t.prototype.set=eu(Fs.getVisitFn(e)),t.prototype.indexOf=eu(ph.getVisitFn(e)),t.prototype.toArray=tu(yh.getVisitFn(e)),t.prototype.getByteWidth=Rg(bh.getVisitFn(e)),t.prototype[Symbol.iterator]=tu(Za.getVisitFn(e))});function Rg(e){return function(){return e(this.type)}}function Vg(e){return function(t){return this.isValid(t)?e.call(this,t):null}}function jg(e){return function(t,n){$l(this.nullBitmap,this.offset+t,n!=null)&&e.call(this,t,n)}}function Pg(){const e=this.nullBitmap;e&&e.byteLength>0&&(this.get=Vg(this.get),this.set=jg(this.set))}class G extends mt{constructor(...t){let n=null;t[0]instanceof H&&(n=t.shift());let r=of(Ot,t);if(!n&&!(n=r[0]&&r[0].schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");r[0]||(r[0]=new Es(n)),super(new Qt(n.fields),r),this._schema=n,this._chunks=r}static empty(t=new H([])){return new G(t,[])}static from(t){if(!t)return G.empty();if(typeof t=="object"){let r=Xt(t.values)?zg(t):Le(t.values)?Wg(t):null;if(r!==null)return r}let n=Jt.from(t);return Ye(n)?(async()=>await G.from(await n))():n.isSync()&&(n=n.open())?n.schema?new G(n.schema,[...n]):G.empty():(async r=>{const s=await r,o=s.schema,i=[];if(o){for await(let a of s)i.push(a);return new G(o,i)}return G.empty()})(n.open())}static async fromAsync(t){return await G.from(t)}static fromStruct(t){return G.new(t.data.childData,t.type.children)}static new(...t){return new G(...Fm(rb(t)))}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(t=this._chunks){return new G(this._schema,t)}getColumn(t){return this.getColumnAt(this.getColumnIndex(t))}getColumnAt(t){return this.getChildAt(t)}getColumnIndex(t){return this._schema.fields.findIndex(n=>n.name===t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let n,r;const s=this._schema.fields,o=this._children||(this._children=[]);if(r=o[t])return r;if(n=s[t]){const i=this._chunks.map(a=>a.getChildAt(t)).filter(a=>a!=null);if(i.length>0)return o[t]=new Kt(n,i)}return null}serialize(t="binary",n=!0){return(n?Ra:Va).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...t){const n=this._schema.fields.reduce((r,s,o)=>r.set(s.name,o),new Map);return this.selectAt(...t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(...t){const n=this._schema.selectAt(...t);return new G(n,this._chunks.map(({length:r,data:{childData:s}})=>new Ot(n,r,t.map(o=>s[o]).filter(Boolean))))}assign(t){const n=this._schema.fields,[r,s]=t.schema.fields.reduce((a,c,u)=>{const[l,f]=a,h=n.findIndex(p=>p.name===c.name);return~h?f[h]=u:l.push(u),a},[[],[]]),o=this._schema.assign(t.schema),i=[...n.map((a,c,u,l=s[c])=>l===void 0?this.getColumnAt(c):t.getColumnAt(l)),...r.map(a=>t.getColumnAt(a))].filter(Boolean);return new G(...Rf(o,i))}}function zg(e){const{type:t}=e;return t instanceof Qt?G.fromStruct(Ds.from(e)):null}function Wg(e){const{type:t}=e;return t instanceof Qt?Ds.from(e).then(n=>G.fromStruct(n)):null}class Ot extends Ds{constructor(...t){let n,r=t[0],s;if(t[1]instanceof S)[,n,s]=t;else{const o=r.fields,[,i,a]=t;n=S.Struct(new Qt(o),0,i,0,null,a)}super(n,s),this._schema=r}static from(t){return Xt(t.values),G.from(t)}static new(...t){const[n,r]=af(t),s=r.filter(o=>o instanceof z);return new Ot(...Om(new H(n),s.map(o=>o.data)))}clone(t,n=this._children){return new Ot(this._schema,t,n)}concat(...t){const n=this._schema,r=mt.flatten(this,...t);return new G(n,r.map(({data:s})=>new Ot(n,s)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=Ha.collect(this))}select(...t){const n=this._schema.fields.reduce((r,s,o)=>r.set(s.name,o),new Map);return this.selectAt(...t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(...t){const n=this._schema.selectAt(...t),r=t.map(s=>this.data.childData[s]).filter(Boolean);return new Ot(n,this.length,r)}}class Es extends Ot{constructor(t){super(t,0,t.fields.map(n=>S.new(n.type,0,0,0)))}}class Ha extends V{constructor(){super(...arguments),this.dictionaries=new Map}static collect(t){return new Ha().visit(t.data,new Qt(t.schema.fields)).dictionaries}visit(t,n){return U.isDictionary(n)?this.visitDictionary(t,n):(t.childData.forEach((r,s)=>this.visit(r,n.children[s].type)),this)}visitDictionary(t,n){const r=t.dictionary;return r&&r.length>0&&this.dictionaries.set(n.id,r),this}}class Jt extends wn{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 n=this._impl.open(t);return Ye(n)?n.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 Ut.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Ut.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,n){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Jt?t:Ao(t)?Kg(t):Ul(t)?Jg(t):Ye(t)?(async()=>await Jt.from(await t))():Nl(t)||ca(t)||Ml(t)||Le(t)?Hg(new dn(t)):Zg(new Ki(t))}static readAll(t){return t instanceof Jt?t.isSync()?nu(t):ru(t):Ao(t)||ArrayBuffer.isView(t)||Xt(t)||El(t)?nu(t):ru(t)}}class Hi extends Jt{constructor(t){super(t),this._impl=t}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}}class Ji extends Jt{constructor(t){super(t),this._impl=t}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class gh extends Hi{constructor(t){super(t),this._impl=t}}class $g extends Ji{constructor(t){super(t),this._impl=t}}class vh{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,n){return new Ot(this.schema,t.length,this._loadVectors(t,n,this.schema.fields))}_loadDictionaryBatch(t,n){const{id:r,isDelta:s,data:o}=t,{dictionaries:i,schema:a}=this,c=i.get(r);if(s||!c){const u=a.dictionaries.get(r);return c&&s?c.concat(z.new(this._loadVectors(o,n,[u])[0])):z.new(this._loadVectors(o,n,[u])[0])}return c}_loadVectors(t,n,r){return new Of(n,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}class Xi extends vh{constructor(t,n){super(n),this._reader=Ao(t)?new Im(this._handle=t):new Uf(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=_h(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):ot}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):ot}next(){if(this.closed)return ot;let t,{_reader:n}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),s=n.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,s);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),s=n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,s);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Es(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class qi extends vh{constructor(t,n){super(n),this._reader=new Sm(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}async cancel(){!this.closed&&(this.closed=!0)&&(await this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}async open(t){return this.closed||(this.autoDestroy=_h(this,t),this.schema||(this.schema=await this._reader.readSchema())||await this.cancel()),this}async throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.throw(t):ot}async return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(t):ot}async next(){if(this.closed)return ot;let t,{_reader:n}=this;for(;t=await this._readNextMessageAndValidate();)if(t.isSchema())await this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),s=await n.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,s);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),s=await n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,s);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Es(this.schema)}):await this.return()}async _readNextMessageAndValidate(t){return await this._reader.readMessage(t)}}class wh extends Xi{constructor(t,n){super(t instanceof jc?t:new jc(t),n)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){if(this.closed)return null;this._footer||this.open();const n=this._footer&&this._footer.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const r=this._reader.readMessage(Q.RecordBatch);if(r&&r.isRecordBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){const n=this._footer&&this._footer.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const r=this._reader.readMessage(Q.DictionaryBatch);if(r&&r.isDictionaryBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength),i=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,i)}}}_readFooter(){const{_handle:t}=this,n=t.size-Nf,r=t.readInt32(n),s=t.readAt(n-r,r);return Mr.decode(s)}_readNextMessageAndValidate(t){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const n=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}}class Yg extends qi{constructor(t,...n){const r=typeof n[0]!="number"?n.shift():void 0,s=n[0]instanceof Map?n.shift():void 0;super(t instanceof Zi?t:new Zi(t,r),s)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}async open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=await this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&await this._readDictionaryBatch(this._dictionaryIndex++)}return await super.open(t)}async readRecordBatch(t){if(this.closed)return null;this._footer||await this.open();const n=this._footer&&this._footer.getRecordBatch(t);if(n&&await this._handle.seek(n.offset)){const r=await this._reader.readMessage(Q.RecordBatch);if(r&&r.isRecordBatch()){const s=r.header(),o=await this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,o)}}return null}async _readDictionaryBatch(t){const n=this._footer&&this._footer.getDictionaryBatch(t);if(n&&await this._handle.seek(n.offset)){const r=await this._reader.readMessage(Q.DictionaryBatch);if(r&&r.isDictionaryBatch()){const s=r.header(),o=await this._reader.readMessageBody(r.bodyLength),i=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,i)}}}async _readFooter(){const{_handle:t}=this;t._pending&&await t._pending;const n=t.size-Nf,r=await t.readInt32(n),s=await t.readAt(n-r,r);return Mr.decode(s)}async _readNextMessageAndValidate(t){if(this._footer||await this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const n=this._footer.getRecordBatch(this._recordBatchIndex);if(n&&await this._handle.seek(n.offset))return await this._reader.readMessage(t)}return null}}class Gg extends Xi{constructor(t,n){super(t,n)}_loadVectors(t,n,r){return new Yb(n,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}function _h(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*nu(e){const t=Jt.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}async function*ru(e){const t=await Jt.from(e);try{if(!(await t.open({autoDestroy:!1})).closed)do yield t;while(!(await t.reset().open()).closed)}finally{await t.cancel()}}function Kg(e){return new Hi(new Gg(e))}function Zg(e){const t=e.peek(ti+7&-8);return t&&t.byteLength>=4?Na(t)?new gh(new wh(e.read())):new Hi(new Xi(e)):new Hi(new Xi(function*(){}()))}async function Hg(e){const t=await e.peek(ti+7&-8);return t&&t.byteLength>=4?Na(t)?new gh(new wh(await e.read())):new Ji(new qi(e)):new Ji(new qi(async function*(){}()))}async function Jg(e){const{size:t}=await e.stat(),n=new Zi(e,t);return t>=Tm&&Na(await n.readAt(0,ti+7&-8))?new $g(new Yg(n)):new Ji(new qi(n))}function Xg(e,t){if(Le(e))return Qg(e,t);if(Xt(e))return qg(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function qg(e,t){let n=null;const r=t&&t.type==="bytes"||!1,s=t&&t.highWaterMark||2**24;return new ReadableStream({...t,start(i){o(i,n||(n=e[Symbol.iterator]()))},pull(i){n?o(i,n):i.close()},cancel(){(n&&n.return&&n.return()||!0)&&(n=null)}},{highWaterMark:r?s:void 0,...t});function o(i,a){let c,u=null,l=i.desiredSize||null;for(;!(u=a.next(r?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=j(u.value))&&(l!=null&&r&&(l=l-c.byteLength+1),u.value=c),i.enqueue(u.value),l!=null&&--l<=0)return;i.close()}}function Qg(e,t){let n=null;const r=t&&t.type==="bytes"||!1,s=t&&t.highWaterMark||2**24;return new ReadableStream({...t,async start(i){await o(i,n||(n=e[Symbol.asyncIterator]()))},async pull(i){n?await o(i,n):i.close()},async cancel(){(n&&n.return&&await n.return()||!0)&&(n=null)}},{highWaterMark:r?s:void 0,...t});async function o(i,a){let c,u=null,l=i.desiredSize||null;for(;!(u=await a.next(r?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=j(u.value))&&(l!=null&&r&&(l=l-c.byteLength+1),u.value=c),i.enqueue(u.value),l!=null&&--l<=0)return;i.close()}}function t0(e){return new e0(e)}class e0{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;const{["readableStrategy"]:n,["writableStrategy"]:r,["queueingStrategy"]:s="count",...o}=t;this._controller=null,this._builder=at.new(o),this._getSize=s!=="bytes"?iu:su;const{["highWaterMark"]:i=s==="bytes"?2**14:1e3}={...n},{["highWaterMark"]:a=s==="bytes"?2**14:1e3}={...r};this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:i,size:s!=="bytes"?iu:su}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){const n=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-n}_maybeFlush(t,n){n!==null&&(this._bufferedSize>=n.desiredSize&&++this._numChunks&&this._enqueue(n,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(n,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(n,null)))}_enqueue(t,n){this._bufferedSize=0,this._controller=null,n===null?t.close():t.enqueue(n)}}const iu=e=>e.length,su=e=>e.byteLength;function n0(e,t){const n=new Ir;let r=null;const s=new ReadableStream({async cancel(){await n.close()},async start(a){await i(a,r||(r=await o()))},async pull(a){r?await i(a,r):a.close()}});return{writable:new WritableStream(n,{highWaterMark:2**14,...e}),readable:s};async function o(){return await(await Jt.from(n)).open(t)}async function i(a,c){let u=a.desiredSize,l=null;for(;!(l=await c.next()).done;)if(a.enqueue(l.value),u!=null&&--u<=0)return;a.close()}}function r0(e,t){const n=new this(e),r=new dn(n),s=new ReadableStream({type:"bytes",async cancel(){await r.cancel()},async pull(i){await o(i)},async start(i){await o(i)}},{highWaterMark:2**14,...t});return{writable:new WritableStream(n,e),readable:s};async function o(i){let a=null,c=i.desiredSize;for(;a=await r.read(c||null);)if(i.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;i.close()}}class Pn{eq(t){return t instanceof Pn||(t=new zn(t)),new i0(this,t)}le(t){return t instanceof Pn||(t=new zn(t)),new s0(this,t)}ge(t){return t instanceof Pn||(t=new zn(t)),new o0(this,t)}lt(t){return new xi(this.ge(t))}gt(t){return new xi(this.le(t))}ne(t){return new xi(this.eq(t))}}class zn extends Pn{constructor(t){super(),this.v=t}}class Sh extends Pn{constructor(t){super(),this.name=t}bind(t){if(!this.colidx){this.colidx=-1;const r=t.schema.fields;for(let s=-1;++s<r.length;)if(r[s].name===this.name){this.colidx=s;break}if(this.colidx<0)throw new Error(`Failed to bind Col "${this.name}"`)}const n=this.vector=t.getChildAt(this.colidx);return r=>n.get(r)}}class Ja{and(...t){return new Qa(this,...t)}or(...t){return new tc(this,...t)}not(){return new xi(this)}}class Xa extends Ja{constructor(t,n){super(),this.left=t,this.right=n}bind(t){return this.left instanceof zn?this.right instanceof zn?this._bindLitLit(t,this.left,this.right):this._bindLitCol(t,this.left,this.right):this.right instanceof zn?this._bindColLit(t,this.left,this.right):this._bindColCol(t,this.left,this.right)}}class qa extends Ja{constructor(...t){super(),this.children=t}}qa.prototype.children=Object.freeze([]);class Qa extends qa{constructor(...t){t=t.reduce((n,r)=>n.concat(r instanceof Qa?r.children:r),[]),super(...t)}bind(t){const n=this.children.map(r=>r.bind(t));return(r,s)=>n.every(o=>o(r,s))}}class tc extends qa{constructor(...t){t=t.reduce((n,r)=>n.concat(r instanceof tc?r.children:r),[]),super(...t)}bind(t){const n=this.children.map(r=>r.bind(t));return(r,s)=>n.some(o=>o(r,s))}}class i0 extends Xa{_bindLitLit(t,n,r){const s=n.v==r.v;return()=>s}_bindColCol(t,n,r){const s=n.bind(t),o=r.bind(t);return(i,a)=>s(i,a)==o(i,a)}_bindColLit(t,n,r){const s=n.bind(t);if(n.vector instanceof Wa){let o;const i=n.vector;return i.dictionary!==this.lastDictionary?(o=i.reverseLookup(r.v),this.lastDictionary=i.dictionary,this.lastKey=o):o=this.lastKey,o===-1?()=>!1:a=>i.getKey(a)===o}else return(o,i)=>s(o,i)==r.v}_bindLitCol(t,n,r){return this._bindColLit(t,r,n)}}class s0 extends Xa{_bindLitLit(t,n,r){const s=n.v<=r.v;return()=>s}_bindColCol(t,n,r){const s=n.bind(t),o=r.bind(t);return(i,a)=>s(i,a)<=o(i,a)}_bindColLit(t,n,r){const s=n.bind(t);return(o,i)=>s(o,i)<=r.v}_bindLitCol(t,n,r){const s=r.bind(t);return(o,i)=>n.v<=s(o,i)}}class o0 extends Xa{_bindLitLit(t,n,r){const s=n.v>=r.v;return()=>s}_bindColCol(t,n,r){const s=n.bind(t),o=r.bind(t);return(i,a)=>s(i,a)>=o(i,a)}_bindColLit(t,n,r){const s=n.bind(t);return(o,i)=>s(o,i)>=r.v}_bindLitCol(t,n,r){const s=r.bind(t);return(o,i)=>n.v>=s(o,i)}}class xi extends Ja{constructor(t){super(),this.child=t}bind(t){const n=this.child.bind(t);return(r,s)=>!n(r,s)}}G.prototype.countBy=function(e){return new ri(this.chunks).countBy(e)};G.prototype.scan=function(e,t){return new ri(this.chunks).scan(e,t)};G.prototype.scanReverse=function(e,t){return new ri(this.chunks).scanReverse(e,t)};G.prototype.filter=function(e){return new ri(this.chunks).filter(e)};class ri extends G{filter(t){return new ec(this.chunks,t)}scan(t,n){const r=this.chunks,s=r.length;for(let o=-1;++o<s;){const i=r[o];n&&n(i);for(let a=-1,c=i.length;++a<c;)t(a,i)}}scanReverse(t,n){const r=this.chunks,s=r.length;for(let o=s;--o>=0;){const i=r[o];n&&n(i);for(let a=i.length;--a>=0;)t(a,i)}}countBy(t){const n=this.chunks,r=n.length,s=typeof t=="string"?new Sh(t):t;s.bind(n[r-1]);const o=s.vector;if(!U.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");const i=Math.ceil(Math.log(o.length)/Math.log(256)),a=i==4?Uint32Array:i>=2?Uint16Array:Uint8Array,c=new a(o.dictionary.length);for(let u=-1;++u<r;){const l=n[u];s.bind(l);const f=s.vector.indices;for(let h=-1,p=l.length;++h<p;){let w=f.get(h);w!==null&&c[w]++}}return new Ih(o.dictionary,re.from(c))}}class Ih extends G{constructor(t,n){const r=new H([new W("values",t.type),new W("counts",n.type)]);super(new Ot(r,n.length,[t,n]))}toJSON(){const t=this.getColumnAt(0),n=this.getColumnAt(1),r={};for(let s=-1;++s<this.length;)r[t.get(s)]=n.get(s);return r}}class ec extends ri{constructor(t,n){super(t),this._predicate=n}scan(t,n){const r=this._chunks,s=r.length;for(let o=-1;++o<s;){const i=r[o],a=this._predicate.bind(i);let c=!1;for(let u=-1,l=i.length;++u<l;)a(u,i)&&(n&&!c&&(n(i),c=!0),t(u,i))}}scanReverse(t,n){const r=this._chunks,s=r.length;for(let o=s;--o>=0;){const i=r[o],a=this._predicate.bind(i);let c=!1;for(let u=i.length;--u>=0;)a(u,i)&&(n&&!c&&(n(i),c=!0),t(u,i))}}count(){let t=0;const n=this._chunks,r=n.length;for(let s=-1;++s<r;){const o=n[s],i=this._predicate.bind(o);for(let a=-1,c=o.length;++a<c;)i(a,o)&&++t}return t}*[Symbol.iterator](){const t=this._chunks,n=t.length;for(let r=-1;++r<n;){const s=t[r],o=this._predicate.bind(s);for(let i=-1,a=s.length;++i<a;)o(i,s)&&(yield s.get(i))}}filter(t){return new ec(this._chunks,this._predicate.and(t))}countBy(t){const n=this._chunks,r=n.length,s=typeof t=="string"?new Sh(t):t;s.bind(n[r-1]);const o=s.vector;if(!U.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");const i=Math.ceil(Math.log(o.length)/Math.log(256)),a=i==4?Uint32Array:i>=2?Uint16Array:Uint8Array,c=new a(o.dictionary.length);for(let u=-1;++u<r;){const l=n[u],f=this._predicate.bind(l);s.bind(l);const h=s.vector.indices;for(let p=-1,w=l.length;++p<w;){let _=h.get(p);_!==null&&f(p,l)&&c[_]++}}return new Ih(o.dictionary,re.from(c))}}({...Ay,...$b,...Xp,..._y,...Yp,...Qy});Ut.toDOMStream=Xg;at.throughDOM=t0;Jt.throughDOM=n0;Ca.throughDOM=r0;/**
 * @license
 * Copyright 2018-2021 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var ou=function(){function e(t,n,r,s){var o=this;this.getCell=function(i,a){var c=i<o.headerRows&&a<o.headerColumns,u=i>=o.headerRows&&a<o.headerColumns,l=i<o.headerRows&&a>=o.headerColumns;if(c){var f=["blank"];return a>0&&f.push("level"+i),{type:"blank",classNames:f.join(" "),content:""}}else if(l){var h=a-o.headerColumns,f=["col_heading","level"+i,"col"+h];return{type:"columns",classNames:f.join(" "),content:o.getContent(o.columnsTable,h,i)}}else if(u){var p=i-o.headerRows,f=["row_heading","level"+a,"row"+p];return{type:"index",id:"T_"+o.uuid+"level"+a+"_row"+p,classNames:f.join(" "),content:o.getContent(o.indexTable,p,a)}}else{var p=i-o.headerRows,h=a-o.headerColumns,f=["data","row"+p,"col"+h],w=o.styler?o.getContent(o.styler.displayValuesTable,p,h):o.getContent(o.dataTable,p,h);return{type:"data",id:"T_"+o.uuid+"row"+p+"_col"+h,classNames:f.join(" "),content:w}}},this.getContent=function(i,a,c){var u=i.getColumnAt(c);if(u===null)return"";var l=o.getColumnTypeId(i,c);switch(l){case d.Timestamp:return o.nanosToDate(u.get(a));default:return u.get(a)}},this.dataTable=G.from(t),this.indexTable=G.from(n),this.columnsTable=G.from(r),this.styler=s?{caption:s.caption,displayValuesTable:G.from(s.displayValues),styles:s.styles,uuid:s.uuid}:void 0}return Object.defineProperty(e.prototype,"rows",{get:function(){return this.indexTable.length+this.columnsTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataRows",{get:function(){return this.dataTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"table",{get:function(){return this.dataTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.indexTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!0,configurable:!0}),e.prototype.serialize=function(){return{data:this.dataTable.serialize(),index:this.indexTable.serialize(),columns:this.columnsTable.serialize()}},e.prototype.getColumnTypeId=function(t,n){return t.schema.fields[n].type.typeId},e.prototype.nanosToDate=function(t){return new Date(t/1e6)},e}();/**
 * @license
 * Copyright 2018-2021 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var Tr=globalThis&&globalThis.__assign||function(){return Tr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Tr.apply(this,arguments)},Ar;(function(e){e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight"})(Ar||(Ar={}));var bn=function(){function e(){}return e.API_VERSION=1,e.RENDER_EVENT="streamlit:render",e.events=new $e,e.registeredMessageListener=!1,e.setComponentReady=function(){e.registeredMessageListener||(window.addEventListener("message",e.onMessageEvent),e.registeredMessageListener=!0),e.sendBackMsg(Ar.COMPONENT_READY,{apiVersion:e.API_VERSION})},e.setFrameHeight=function(t){t===void 0&&(t=document.body.scrollHeight),t!==e.lastFrameHeight&&(e.lastFrameHeight=t,e.sendBackMsg(Ar.SET_FRAME_HEIGHT,{height:t}))},e.setComponentValue=function(t){var n;t instanceof ou?(n="dataframe",t=t.serialize()):c0(t)?(n="bytes",t=new Uint8Array(t.buffer)):t instanceof ArrayBuffer?(n="bytes",t=new Uint8Array(t)):n="json",e.sendBackMsg(Ar.SET_COMPONENT_VALUE,{value:t,dataType:n})},e.onMessageEvent=function(t){var n=t.data.type;switch(n){case e.RENDER_EVENT:e.onRenderMessage(t.data);break}},e.onRenderMessage=function(t){var n=t.args;n==null&&(console.error("Got null args in onRenderMessage. This should never happen"),n={});var r=t.dfs&&t.dfs.length>0?e.argsDataframeToObject(t.dfs):{};n=Tr(Tr({},n),r);var s=Boolean(t.disabled),o=t.theme;o&&a0(o);var i={disabled:s,args:n,theme:o},a=new CustomEvent(e.RENDER_EVENT,{detail:i});e.events.dispatchEvent(a)},e.argsDataframeToObject=function(t){var n=t.map(function(r){var s=r.key,o=r.value;return[s,e.toArrowTable(o)]});return Object.fromEntries(n)},e.toArrowTable=function(t){var n=t.data,r=n.data,s=n.index,o=n.columns,i=n.styler;return new ou(r,s,o,i)},e.sendBackMsg=function(t,n){window.parent.postMessage(Tr({isStreamlitMessage:!0,type:t},n),"*")},e}(),a0=function(e){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML=`
    :root {
      --primary-color: `+e.primaryColor+`;
      --background-color: `+e.backgroundColor+`;
      --secondary-background-color: `+e.secondaryBackgroundColor+`;
      --text-color: `+e.textColor+`;
      --font: `+e.font+`;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `};function c0(e){var t=!1;try{t=e instanceof BigInt64Array||e instanceof BigUint64Array}catch{}return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||t}/**
 * @license
 * Copyright 2018-2021 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var u0=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var o in s)s.hasOwnProperty(o)&&(r[o]=s[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){u0(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){bn.setFrameHeight()},t.prototype.componentDidUpdate=function(){bn.setFrameHeight()},t})(np.PureComponent);var ko=function(e,t){return ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},ko(e,t)};function Tn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ko(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var N=function(){return N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},N.apply(this,arguments)};function Tt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}function $(e,t,n,r){return new(n||(n=Promise))(function(s,o){function i(u){try{c(r.next(u))}catch(l){o(l)}}function a(u){try{c(r.throw(u))}catch(l){o(l)}}function c(u){var l;u.done?s(u.value):(l=u.value,l instanceof n?l:new n(function(f){f(l)})).then(i,a)}c((r=r.apply(e,t||[])).next())})}function Y(e,t){var n,r,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(s=2&l[0]?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[2&l[0],s.value]),l[0]){case 0:case 1:s=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!((s=s.length>0&&s[s.length-1])||l[0]!==6&&l[0]!==2)){i=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){i.label=l[1];break}if(l[0]===6&&i.label<s[1]){i.label=s[1],s=l;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(l);break}s[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(f){l=[6,f],r=0}finally{n=s=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([c,u])}}}function nr(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i}function Eo(e,t,n){if(n||arguments.length===2)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))}var ce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cr(e,t){return e(t={exports:{}},t.exports),t.exports}var Ue,Li,bi=function(e){return e&&e.Math==Math&&e},M=bi(typeof globalThis=="object"&&globalThis)||bi(typeof window=="object"&&window)||bi(typeof self=="object"&&self)||bi(typeof ce=="object"&&ce)||function(){return this}()||Function("return this")(),nt=function(e){try{return!!e()}catch{return!0}},J=!nt(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),ii=!nt(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),mi=Function.prototype.call,St=ii?mi.bind(mi):function(){return mi.apply(mi,arguments)},au={}.propertyIsEnumerable,cu=Object.getOwnPropertyDescriptor,l0=cu&&!au.call({1:2},1)?function(e){var t=cu(this,e);return!!t&&t.enumerable}:au,rc={f:l0},mn=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Th=Function.prototype,f0=Th.bind,Uo=Th.call,h0=ii&&f0.bind(Uo,Uo),P=ii?function(e){return e&&h0(e)}:function(e){return e&&function(){return Uo.apply(e,arguments)}},d0=P({}.toString),p0=P("".slice),Ie=function(e){return p0(d0(e),8,-1)},eo=Object,y0=P("".split),Ah=nt(function(){return!eo("z").propertyIsEnumerable(0)})?function(e){return Ie(e)=="String"?y0(e,""):eo(e)}:eo,b0=TypeError,si=function(e){if(e==null)throw b0("Can't call method on "+e);return e},ye=function(e){return Ah(si(e))},rt=function(e){return typeof e=="function"},st=function(e){return typeof e=="object"?e!==null:rt(e)},m0=function(e){return rt(e)?e:void 0},ie=function(e,t){return arguments.length<2?m0(M[e]):M[e]&&M[e][t]},gn=P({}.isPrototypeOf),no=ie("navigator","userAgent")||"",uu=M.process,lu=M.Deno,fu=uu&&uu.versions||lu&&lu.version,hu=fu&&fu.v8;hu&&(Li=(Ue=hu.split("."))[0]>0&&Ue[0]<4?1:+(Ue[0]+Ue[1])),!Li&&no&&(!(Ue=no.match(/Edge\/(\d+)/))||Ue[1]>=74)&&(Ue=no.match(/Chrome\/(\d+)/))&&(Li=+Ue[1]);var Qi=Li,Vt=!!Object.getOwnPropertySymbols&&!nt(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Qi&&Qi<41}),ic=Vt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",g0=Object,rr=ic?function(e){return typeof e=="symbol"}:function(e){var t=ie("Symbol");return rt(t)&&gn(t.prototype,g0(e))},v0=String,ur=function(e){try{return v0(e)}catch{return"Object"}},w0=TypeError,sc=function(e){if(rt(e))return e;throw w0(ur(e)+" is not a function")},ts=function(e,t){var n=e[t];return n==null?void 0:sc(n)},_0=TypeError,S0=Object.defineProperty,oc=function(e,t){try{S0(M,e,{value:t,configurable:!0,writable:!0})}catch{M[e]=t}return t},ze=M["__core-js_shared__"]||oc("__core-js_shared__",{}),qe=cr(function(e){(e.exports=function(t,n){return ze[t]||(ze[t]=n!==void 0?n:{})})("versions",[]).push({version:"3.24.0",mode:"global",copyright:"\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),I0=Object,lr=function(e){return I0(si(e))},T0=P({}.hasOwnProperty),A=Object.hasOwn||function(e,t){return T0(lr(e),t)},A0=0,B0=Math.random(),O0=P(1 .toString),ir=function(e){return"Symbol("+(e===void 0?"":e)+")_"+O0(++A0+B0,36)},yr=qe("wks"),un=M.Symbol,du=un&&un.for,F0=ic?un:un&&un.withoutSetter||ir,ut=function(e){if(!A(yr,e)||!Vt&&typeof yr[e]!="string"){var t="Symbol."+e;Vt&&A(un,e)?yr[e]=un[e]:yr[e]=ic&&du?du(t):F0(t)}return yr[e]},x0=TypeError,L0=ut("toPrimitive"),D0=function(e,t){if(!st(e)||rr(e))return e;var n,r=ts(e,L0);if(r){if(t===void 0&&(t="default"),n=St(r,e,t),!st(n)||rr(n))return n;throw x0("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(s,o){var i,a;if(o==="string"&&rt(i=s.toString)&&!st(a=St(i,s))||rt(i=s.valueOf)&&!st(a=St(i,s))||o!=="string"&&rt(i=s.toString)&&!st(a=St(i,s)))return a;throw _0("Can't convert object to primitive value")}(e,t)},vn=function(e){var t=D0(e,"string");return rr(t)?t:t+""},No=M.document,k0=st(No)&&st(No.createElement),Bh=function(e){return k0?No.createElement(e):{}},Oh=!J&&!nt(function(){return Object.defineProperty(Bh("div"),"a",{get:function(){return 7}}).a!=7}),pu=Object.getOwnPropertyDescriptor,oi={f:J?pu:function(e,t){if(e=ye(e),t=vn(t),Oh)try{return pu(e,t)}catch{}if(A(e,t))return mn(!St(rc.f,e,t),e[t])}},Fh=J&&nt(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),E0=String,U0=TypeError,ht=function(e){if(st(e))return e;throw U0(E0(e)+" is not an object")},N0=TypeError,ro=Object.defineProperty,M0=Object.getOwnPropertyDescriptor,vt={f:J?Fh?function(e,t,n){if(ht(e),t=vn(t),ht(n),typeof e=="function"&&t==="prototype"&&"value"in n&&"writable"in n&&!n.writable){var r=M0(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return ro(e,t,n)}:ro:function(e,t,n){if(ht(e),t=vn(t),ht(n),Oh)try{return ro(e,t,n)}catch{}if("get"in n||"set"in n)throw N0("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},Us=J?function(e,t,n){return vt.f(e,t,mn(1,n))}:function(e,t,n){return e[t]=n,e},xh=Function.prototype,C0=J&&Object.getOwnPropertyDescriptor,io=A(xh,"name"),ac={EXISTS:io,PROPER:io&&function(){}.name==="something",CONFIGURABLE:io&&(!J||J&&C0(xh,"name").configurable)},R0=P(Function.toString);rt(ze.inspectSource)||(ze.inspectSource=function(e){return R0(e)});var es,Br,ns,cc=ze.inspectSource,yu=M.WeakMap,V0=rt(yu)&&/native code/.test(cc(yu)),bu=qe("keys"),Ns=function(e){return bu[e]||(bu[e]=ir(e))},fr={},Mo=M.TypeError,j0=M.WeakMap;if(V0||ze.state){var nn=ze.state||(ze.state=new j0),P0=P(nn.get),mu=P(nn.has),z0=P(nn.set);es=function(e,t){if(mu(nn,e))throw new Mo("Object already initialized");return t.facade=e,z0(nn,e,t),t},Br=function(e){return P0(nn,e)||{}},ns=function(e){return mu(nn,e)}}else{var Fn=Ns("state");fr[Fn]=!0,es=function(e,t){if(A(e,Fn))throw new Mo("Object already initialized");return t.facade=e,Us(e,Fn,t),t},Br=function(e){return A(e,Fn)?e[Fn]:{}},ns=function(e){return A(e,Fn)}}var Wt={set:es,get:Br,has:ns,enforce:function(e){return ns(e)?Br(e):es(e,{})},getterFor:function(e){return function(t){var n;if(!st(t)||(n=Br(t)).type!==e)throw Mo("Incompatible receiver, "+e+" required");return n}}},W0=cr(function(e){var t=ac.CONFIGURABLE,n=Wt.enforce,r=Wt.get,s=Object.defineProperty,o=J&&!nt(function(){return s(function(){},"length",{value:8}).length!==8}),i=String(String).split("String"),a=e.exports=function(c,u,l){String(u).slice(0,7)==="Symbol("&&(u="["+String(u).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),l&&l.getter&&(u="get "+u),l&&l.setter&&(u="set "+u),(!A(c,"name")||t&&c.name!==u)&&(J?s(c,"name",{value:u,configurable:!0}):c.name=u),o&&l&&A(l,"arity")&&c.length!==l.arity&&s(c,"length",{value:l.arity});try{l&&A(l,"constructor")&&l.constructor?J&&s(c,"prototype",{writable:!1}):c.prototype&&(c.prototype=void 0)}catch{}var f=n(c);return A(f,"source")||(f.source=i.join(typeof u=="string"?u:"")),c};Function.prototype.toString=a(function(){return rt(this)&&r(this).source||cc(this)},"toString")}),It=function(e,t,n,r){r||(r={});var s=r.enumerable,o=r.name!==void 0?r.name:t;if(rt(n)&&W0(n,o,r),r.global)s?e[t]=n:oc(t,n);else{try{r.unsafe?e[t]&&(s=!0):delete e[t]}catch{}s?e[t]=n:vt.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},$0=Math.ceil,Y0=Math.floor,G0=Math.trunc||function(e){var t=+e;return(t>0?Y0:$0)(t)},uc=function(e){var t=+e;return t!=t||t===0?0:G0(t)},K0=Math.max,Z0=Math.min,Co=function(e,t){var n=uc(e);return n<0?K0(n+t,0):Z0(n,t)},H0=Math.min,Lh=function(e){return e>0?H0(uc(e),9007199254740991):0},hr=function(e){return Lh(e.length)},gu=function(e){return function(t,n,r){var s,o=ye(t),i=hr(o),a=Co(r,i);if(e&&n!=n){for(;i>a;)if((s=o[a++])!=s)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},Dh={includes:gu(!0),indexOf:gu(!1)},J0=Dh.indexOf,vu=P([].push),kh=function(e,t){var n,r=ye(e),s=0,o=[];for(n in r)!A(fr,n)&&A(r,n)&&vu(o,n);for(;t.length>s;)A(r,n=t[s++])&&(~J0(o,n)||vu(o,n));return o},rs=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],X0=rs.concat("length","prototype"),Rr={f:Object.getOwnPropertyNames||function(e){return kh(e,X0)}},Ms={f:Object.getOwnPropertySymbols},q0=P([].concat),Q0=ie("Reflect","ownKeys")||function(e){var t=Rr.f(ht(e)),n=Ms.f;return n?q0(t,n(e)):t},Eh=function(e,t,n){for(var r=Q0(t),s=vt.f,o=oi.f,i=0;i<r.length;i++){var a=r[i];A(e,a)||n&&A(n,a)||s(e,a,o(t,a))}},tv=/#|\.prototype\./,ai=function(e,t){var n=nv[ev(e)];return n==iv||n!=rv&&(rt(t)?nt(t):!!t)},ev=ai.normalize=function(e){return String(e).replace(tv,".").toLowerCase()},nv=ai.data={},rv=ai.NATIVE="N",iv=ai.POLYFILL="P",Ro=ai,sv=oi.f,dt=function(e,t){var n,r,s,o,i,a=e.target,c=e.global,u=e.stat;if(n=c?M:u?M[a]||oc(a,{}):(M[a]||{}).prototype)for(r in t){if(o=t[r],s=e.dontCallGetSet?(i=sv(n,r))&&i.value:n[r],!Ro(c?r:a+(u?".":"#")+r,e.forced)&&s!==void 0){if(typeof o==typeof s)continue;Eh(o,s)}(e.sham||s&&s.sham)&&Us(o,"sham",!0),It(n,r,o,e)}},Uh={};Uh[ut("toStringTag")]="z";var so,lc=String(Uh)==="[object z]",ov=ut("toStringTag"),av=Object,cv=Ie(function(){return arguments}())=="Arguments",An=lc?Ie:function(e){var t,n,r;return e===void 0?"Undefined":e===null?"Null":typeof(n=function(s,o){try{return s[o]}catch{}}(t=av(e),ov))=="string"?n:cv?Ie(t):(r=Ie(t))=="Object"&&rt(t.callee)?"Arguments":r},uv=String,Be=function(e){if(An(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return uv(e)},lv=ut("match"),fv=TypeError,Nh=function(e){if(function(t){var n;return st(t)&&((n=t[lv])!==void 0?!!n:Ie(t)=="RegExp")}(e))throw fv("The method doesn't accept regular expressions");return e},hv=ut("match"),Mh=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[hv]=!1,"/./"[e](t)}catch{}}return!1},dv=oi.f,wu=P("".startsWith),pv=P("".slice),yv=Math.min,Ch=Mh("startsWith"),bv=!(Ch||(so=dv(String.prototype,"startsWith"),!so||so.writable));dt({target:"String",proto:!0,forced:!bv&&!Ch},{startsWith:function(e){var t=Be(si(this));Nh(e);var n=Lh(yv(arguments.length>1?arguments[1]:void 0,t.length)),r=Be(e);return wu?wu(t,r,n):pv(t,n,n+r.length)===r}});var fc=function(e,t){return P(M[e].prototype[t])};fc("String","startsWith");var is=Array.isArray||function(e){return Ie(e)=="Array"},mv=TypeError,_u=function(e){if(e>9007199254740991)throw mv("Maximum allowed index exceeded");return e},Vr=function(e,t,n){var r=vn(t);r in e?vt.f(e,r,mn(0,n)):e[r]=n},Rh=function(){},gv=[],Vh=ie("Reflect","construct"),hc=/^\s*(?:class|function)\b/,vv=P(hc.exec),wv=!hc.exec(Rh),br=function(e){if(!rt(e))return!1;try{return Vh(Rh,gv,e),!0}catch{return!1}},jh=function(e){if(!rt(e))return!1;switch(An(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return wv||!!vv(hc,cc(e))}catch{return!0}};jh.sham=!0;var Su,dc=!Vh||nt(function(){var e;return br(br.call)||!br(Object)||!br(function(){e=!0})||e})?jh:br,_v=ut("species"),Iu=Array,Ph=function(e,t){return new(function(n){var r;return is(n)&&(r=n.constructor,(dc(r)&&(r===Iu||is(r.prototype))||st(r)&&(r=r[_v])===null)&&(r=void 0)),r===void 0?Iu:r}(e))(t===0?0:t)},Sv=ut("species"),zh=ut("isConcatSpreadable"),Iv=Qi>=51||!nt(function(){var e=[];return e[zh]=!1,e.concat()[0]!==e}),Tv=(Su="concat",Qi>=51||!nt(function(){var e=[];return(e.constructor={})[Sv]=function(){return{foo:1}},e[Su](Boolean).foo!==1})),Av=function(e){if(!st(e))return!1;var t=e[zh];return t!==void 0?!!t:is(e)};dt({target:"Array",proto:!0,arity:1,forced:!Iv||!Tv},{concat:function(e){var t,n,r,s,o,i=lr(this),a=Ph(i,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(Av(o=t===-1?i:arguments[t]))for(s=hr(o),_u(c+s),n=0;n<s;n++,c++)n in o&&Vr(a,c,o[n]);else _u(c+1),Vr(a,c++,o);return a.length=c,a}});var Bv=lc?{}.toString:function(){return"[object "+An(this)+"]"};lc||It(Object.prototype,"toString",Bv,{unsafe:!0});var gi,pc=Object.keys||function(e){return kh(e,rs)},Ov=J&&!Fh?Object.defineProperties:function(e,t){ht(e);for(var n,r=ye(t),s=pc(t),o=s.length,i=0;o>i;)vt.f(e,n=s[i++],r[n]);return e},Wh={f:Ov},Fv=ie("document","documentElement"),$h=Ns("IE_PROTO"),oo=function(){},Yh=function(e){return"<script>"+e+"<\/script>"},Tu=function(e){e.write(Yh("")),e.close();var t=e.parentWindow.Object;return e=null,t},Di=function(){try{gi=new ActiveXObject("htmlfile")}catch{}var e,t;Di=typeof document<"u"?document.domain&&gi?Tu(gi):((t=Bh("iframe")).style.display="none",Fv.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Yh("document.F=Object")),e.close(),e.F):Tu(gi);for(var n=rs.length;n--;)delete Di.prototype[rs[n]];return Di()};fr[$h]=!0;var Ze=Object.create||function(e,t){var n;return e!==null?(oo.prototype=ht(e),n=new oo,oo.prototype=null,n[$h]=e):n=Di(),t===void 0?n:Wh.f(n,t)},xv=Array,Lv=Math.max,Gh=Rr.f,Kh=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Dv=function(e){try{return Gh(e)}catch{return function(n,r,s){for(var o=hr(n),i=Co(r,o),a=Co(s===void 0?o:s,o),c=xv(Lv(a-i,0)),u=0;i<a;i++,u++)Vr(c,u,n[i]);return c.length=u,c}(Kh)}},yc={f:function(e){return Kh&&Ie(e)=="Window"?Dv(e):Gh(ye(e))}},Zh={f:ut},jr=M,kv=vt.f,At=function(e){var t=jr.Symbol||(jr.Symbol={});A(t,e)||kv(t,e,{value:Zh.f(e)})},Hh=function(){var e=ie("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=ut("toPrimitive");t&&!t[r]&&It(t,r,function(s){return St(n,this)},{arity:1})},Ev=vt.f,Au=ut("toStringTag"),je=function(e,t,n){e&&!n&&(e=e.prototype),e&&!A(e,Au)&&Ev(e,Au,{configurable:!0,value:t})},Uv=P(P.bind),Cs=function(e,t){return sc(e),t===void 0?e:ii?Uv(e,t):function(){return e.apply(t,arguments)}},Bu=P([].push),Ne=function(e){var t=e==1,n=e==2,r=e==3,s=e==4,o=e==6,i=e==7,a=e==5||o;return function(c,u,l,f){for(var h,p,w=lr(c),_=Ah(w),b=Cs(u,l),g=hr(_),v=0,I=f||Ph,it=t?I(c,g):n||i?I(c,0):void 0;g>v;v++)if((a||v in _)&&(p=b(h=_[v],v,w),e))if(t)it[v]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return v;case 2:Bu(it,h)}else switch(e){case 4:return!1;case 7:Bu(it,h)}return o?-1:r||s?s:it}},Rs={forEach:Ne(0),map:Ne(1),filter:Ne(2),some:Ne(3),every:Ne(4),find:Ne(5),findIndex:Ne(6),filterReject:Ne(7)}.forEach,Bt=Ns("hidden"),Nv=Wt.set,Ou=Wt.getterFor("Symbol"),jt=Object.prototype,Mn=M.Symbol,wr=Mn&&Mn.prototype,Mv=M.TypeError,ao=M.QObject,Jh=oi.f,Re=vt.f,Xh=yc.f,Cv=rc.f,qh=P([].push),Oe=qe("symbols"),ci=qe("op-symbols"),Rv=qe("wks"),co=!ao||!ao.prototype||!ao.prototype.findChild,Vo=J&&nt(function(){return Ze(Re({},"a",{get:function(){return Re(this,"a",{value:7}).a}})).a!=7})?function(e,t,n){var r=Jh(jt,t);r&&delete jt[t],Re(e,t,n),r&&e!==jt&&Re(jt,t,r)}:Re,uo=function(e,t){var n=Oe[e]=Ze(wr);return Nv(n,{type:"Symbol",tag:e,description:t}),J||(n.description=t),n},ss=function(e,t,n){e===jt&&ss(ci,t,n),ht(e);var r=vn(t);return ht(n),A(Oe,r)?(n.enumerable?(A(e,Bt)&&e[Bt][r]&&(e[Bt][r]=!1),n=Ze(n,{enumerable:mn(0,!1)})):(A(e,Bt)||Re(e,Bt,mn(1,{})),e[Bt][r]=!0),Vo(e,r,n)):Re(e,r,n)},lo=function(e,t){ht(e);var n=ye(t),r=pc(n).concat(Qh(n));return Rs(r,function(s){J&&!St(jo,n,s)||ss(e,s,n[s])}),e},jo=function(e){var t=vn(e),n=St(Cv,this,t);return!(this===jt&&A(Oe,t)&&!A(ci,t))&&(!(n||!A(this,t)||!A(Oe,t)||A(this,Bt)&&this[Bt][t])||n)},Fu=function(e,t){var n=ye(e),r=vn(t);if(n!==jt||!A(Oe,r)||A(ci,r)){var s=Jh(n,r);return!s||!A(Oe,r)||A(n,Bt)&&n[Bt][r]||(s.enumerable=!0),s}},xu=function(e){var t=Xh(ye(e)),n=[];return Rs(t,function(r){A(Oe,r)||A(fr,r)||qh(n,r)}),n},Qh=function(e){var t=e===jt,n=Xh(t?ci:ye(e)),r=[];return Rs(n,function(s){!A(Oe,s)||t&&!A(jt,s)||qh(r,Oe[s])}),r};Vt||(wr=(Mn=function(){if(gn(wr,this))throw Mv("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?Be(arguments[0]):void 0,t=ir(e),n=function(r){this===jt&&St(n,ci,r),A(this,Bt)&&A(this[Bt],t)&&(this[Bt][t]=!1),Vo(this,t,mn(1,r))};return J&&co&&Vo(jt,t,{configurable:!0,set:n}),uo(t,e)}).prototype,It(wr,"toString",function(){return Ou(this).tag}),It(Mn,"withoutSetter",function(e){return uo(ir(e),e)}),rc.f=jo,vt.f=ss,Wh.f=lo,oi.f=Fu,Rr.f=yc.f=xu,Ms.f=Qh,Zh.f=function(e){return uo(ut(e),e)},J&&(Re(wr,"description",{configurable:!0,get:function(){return Ou(this).description}}),It(jt,"propertyIsEnumerable",jo,{unsafe:!0}))),dt({global:!0,constructor:!0,wrap:!0,forced:!Vt,sham:!Vt},{Symbol:Mn}),Rs(pc(Rv),function(e){At(e)}),dt({target:"Symbol",stat:!0,forced:!Vt},{useSetter:function(){co=!0},useSimple:function(){co=!1}}),dt({target:"Object",stat:!0,forced:!Vt,sham:!J},{create:function(e,t){return t===void 0?Ze(e):lo(Ze(e),t)},defineProperty:ss,defineProperties:lo,getOwnPropertyDescriptor:Fu}),dt({target:"Object",stat:!0,forced:!Vt},{getOwnPropertyNames:xu}),Hh(),je(Mn,"Symbol"),fr[Bt]=!0;var td=Vt&&!!Symbol.for&&!!Symbol.keyFor,fo=qe("string-to-symbol-registry"),Vv=qe("symbol-to-string-registry");dt({target:"Symbol",stat:!0,forced:!td},{for:function(e){var t=Be(e);if(A(fo,t))return fo[t];var n=ie("Symbol")(t);return fo[t]=n,Vv[n]=t,n}});var Lu=qe("symbol-to-string-registry");dt({target:"Symbol",stat:!0,forced:!td},{keyFor:function(e){if(!rr(e))throw TypeError(ur(e)+" is not a symbol");if(A(Lu,e))return Lu[e]}});var ed=Function.prototype,Du=ed.apply,ku=ed.call,nd=typeof Reflect=="object"&&Reflect.apply||(ii?ku.bind(Du):function(){return ku.apply(Du,arguments)}),bc=P([].slice),We=ie("JSON","stringify"),vi=P(/./.exec),Eu=P("".charAt),jv=P("".charCodeAt),Pv=P("".replace),zv=P(1 .toString),Wv=/[\uD800-\uDFFF]/g,Uu=/^[\uD800-\uDBFF]$/,Nu=/^[\uDC00-\uDFFF]$/,Mu=!Vt||nt(function(){var e=ie("Symbol")();return We([e])!="[null]"||We({a:e})!="{}"||We(Object(e))!="{}"}),Cu=nt(function(){return We("\uDF06\uD834")!=='"\\udf06\\ud834"'||We("\uDEAD")!=='"\\udead"'}),$v=function(e,t){var n=bc(arguments),r=t;if((st(t)||e!==void 0)&&!rr(e))return is(t)||(t=function(s,o){if(rt(r)&&(o=St(r,this,s,o)),!rr(o))return o}),n[1]=t,nd(We,null,n)},Yv=function(e,t,n){var r=Eu(n,t-1),s=Eu(n,t+1);return vi(Uu,e)&&!vi(Nu,s)||vi(Nu,e)&&!vi(Uu,r)?"\\u"+zv(jv(e,0),16):e};We&&dt({target:"JSON",stat:!0,arity:3,forced:Mu||Cu},{stringify:function(e,t,n){var r=bc(arguments),s=nd(Mu?$v:We,null,r);return Cu&&typeof s=="string"?Pv(s,Wv,Yv):s}});var Gv=!Vt||nt(function(){Ms.f(1)});dt({target:"Object",stat:!0,forced:Gv},{getOwnPropertySymbols:function(e){var t=Ms.f;return t?t(lr(e)):[]}}),At("asyncIterator");var Kv=vt.f,ve=M.Symbol,rn=ve&&ve.prototype;if(J&&rt(ve)&&(!("description"in rn)||ve().description!==void 0)){var Ru={},wi=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:Be(arguments[0]),t=gn(rn,this)?new ve(e):e===void 0?ve():ve(e);return e===""&&(Ru[t]=!0),t};Eh(wi,ve),wi.prototype=rn,rn.constructor=wi;var Zv=String(ve("test"))=="Symbol(test)",Hv=P(rn.toString),Jv=P(rn.valueOf),Xv=/^Symbol\((.*)\)[^)]+$/,qv=P("".replace),Qv=P("".slice);Kv(rn,"description",{configurable:!0,get:function(){var e=Jv(this),t=Hv(e);if(A(Ru,e))return"";var n=Zv?Qv(t,7,-1):qv(t,Xv,"$1");return n===""?void 0:n}}),dt({global:!0,constructor:!0,forced:!0},{Symbol:wi})}At("hasInstance"),At("isConcatSpreadable"),At("iterator"),At("match"),At("matchAll"),At("replace"),At("search"),At("species"),At("split"),At("toPrimitive"),Hh(),At("toStringTag"),je(ie("Symbol"),"Symbol"),At("unscopables"),je(M.JSON,"JSON",!0),je(Math,"Math",!0),dt({global:!0},{Reflect:{}}),je(M.Reflect,"Reflect",!0),jr.Symbol;var ln,Vu,ju,tw=P("".charAt),Pu=P("".charCodeAt),ew=P("".slice),zu=function(e){return function(t,n){var r,s,o=Be(si(t)),i=uc(n),a=o.length;return i<0||i>=a?e?"":void 0:(r=Pu(o,i))<55296||r>56319||i+1===a||(s=Pu(o,i+1))<56320||s>57343?e?tw(o,i):r:e?ew(o,i,i+2):s-56320+(r-55296<<10)+65536}},nw={codeAt:zu(!1),charAt:zu(!0)},rw=!nt(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Wu=Ns("IE_PROTO"),Po=Object,iw=Po.prototype,He=rw?Po.getPrototypeOf:function(e){var t=lr(e);if(A(t,Wu))return t[Wu];var n=t.constructor;return rt(n)&&t instanceof n?n.prototype:t instanceof Po?iw:null},zo=ut("iterator"),rd=!1;[].keys&&("next"in(ju=[].keys())?(Vu=He(He(ju)))!==Object.prototype&&(ln=Vu):rd=!0);var sw=ln==null||nt(function(){var e={};return ln[zo].call(e)!==e});sw&&(ln={}),rt(ln[zo])||It(ln,zo,function(){return this});var mc={IteratorPrototype:ln,BUGGY_SAFARI_ITERATORS:rd},sr={},ow=mc.IteratorPrototype,aw=function(){return this},cw=String,uw=TypeError,fe=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=P(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch{}return function(r,s){return ht(r),function(o){if(typeof o=="object"||rt(o))return o;throw uw("Can't set "+cw(o)+" as a prototype")}(s),t?e(r,s):r.__proto__=s,r}}():void 0),lw=ac.PROPER,fw=ac.CONFIGURABLE,$u=mc.IteratorPrototype,_i=mc.BUGGY_SAFARI_ITERATORS,mr=ut("iterator"),hw=function(){return this},gc=function(e,t,n,r,s,o,i){(function(g,v,I,it){var yt=v+" Iterator";g.prototype=Ze(ow,{next:mn(+!it,I)}),je(g,yt,!1),sr[yt]=aw})(n,t,r);var a,c,u,l=function(g){if(g===s&&_)return _;if(!_i&&g in p)return p[g];switch(g){case"keys":case"values":case"entries":return function(){return new n(this,g)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,p=e.prototype,w=p[mr]||p["@@iterator"]||s&&p[s],_=!_i&&w||l(s),b=t=="Array"&&p.entries||w;if(b&&(a=He(b.call(new e)))!==Object.prototype&&a.next&&(He(a)!==$u&&(fe?fe(a,$u):rt(a[mr])||It(a,mr,hw)),je(a,f,!0)),lw&&s=="values"&&w&&w.name!=="values"&&(fw?Us(p,"name","values"):(h=!0,_=function(){return St(w,this)})),s)if(c={values:l("values"),keys:o?_:l("keys"),entries:l("entries")},i)for(u in c)(_i||h||!(u in p))&&It(p,u,c[u]);else dt({target:t,proto:!0,forced:_i||h},c);return p[mr]!==_&&It(p,mr,_,{name:s}),sr[t]=_,c},dw=nw.charAt,pw=Wt.set,yw=Wt.getterFor("String Iterator");gc(String,"String",function(e){pw(this,{type:"String Iterator",string:Be(e),index:0})},function(){var e,t=yw(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=dw(n,r),t.index+=e.length,{value:e,done:!1})});var Wo=function(e,t,n){var r,s;ht(e);try{if(!(r=ts(e,"return"))){if(t==="throw")throw n;return n}r=St(r,e)}catch(o){s=!0,r=o}if(t==="throw")throw n;if(s)throw r;return ht(r),n},bw=function(e,t,n,r){try{return r?t(ht(n)[0],n[1]):t(n)}catch(s){Wo(e,"throw",s)}},mw=ut("iterator"),gw=Array.prototype,id=function(e){return e!==void 0&&(sr.Array===e||gw[mw]===e)},vw=ut("iterator"),vc=function(e){if(e!=null)return ts(e,vw)||ts(e,"@@iterator")||sr[An(e)]},ww=TypeError,sd=function(e,t){var n=arguments.length<2?vc(e):t;if(sc(n))return ht(St(n,e));throw ww(ur(e)+" is not iterable")},Yu=Array,od=ut("iterator"),ad=!1;try{var _w=0,Gu={next:function(){return{done:!!_w++}},return:function(){ad=!0}};Gu[od]=function(){return this},Array.from(Gu,function(){throw 2})}catch{}var cd=function(e,t){if(!t&&!ad)return!1;var n=!1;try{var r={};r[od]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},Sw=!cd(function(e){Array.from(e)});dt({target:"Array",stat:!0,forced:Sw},{from:function(e){var t=lr(e),n=dc(this),r=arguments.length,s=r>1?arguments[1]:void 0,o=s!==void 0;o&&(s=Cs(s,r>2?arguments[2]:void 0));var i,a,c,u,l,f,h=vc(t),p=0;if(!h||this===Yu&&id(h))for(i=hr(t),a=n?new this(i):Yu(i);i>p;p++)f=o?s(t[p],p):t[p],Vr(a,p,f);else for(l=(u=sd(t,h)).next,a=n?new this:[];!(c=St(l,u)).done;p++)f=o?bw(u,s,[c.value,p],!0):c.value,Vr(a,p,f);return a.length=p,a}}),jr.Array.from;var Ft,Wn,os,Iw=typeof ArrayBuffer<"u"&&typeof DataView<"u",Tw=vt.f,ud=Wt.enforce,Aw=Wt.get,as=M.Int8Array,$o=as&&as.prototype,Ku=M.Uint8ClampedArray,Zu=Ku&&Ku.prototype,oe=as&&He(as),Zt=$o&&He($o),Bw=Object.prototype,Yo=M.TypeError,Hu=ut("toStringTag"),Go=ir("TYPED_ARRAY_TAG"),Te=Iw&&!!fe&&An(M.opera)!=="Opera",ld=!1,Se={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},wc={BigInt64Array:8,BigUint64Array:8},fd=function(e){var t=He(e);if(st(t)){var n=Aw(t);return n&&A(n,"TypedArrayConstructor")?n.TypedArrayConstructor:fd(t)}},Ju=function(e){if(!st(e))return!1;var t=An(e);return A(Se,t)||A(wc,t)};for(Ft in Se)(os=(Wn=M[Ft])&&Wn.prototype)?ud(os).TypedArrayConstructor=Wn:Te=!1;for(Ft in wc)(os=(Wn=M[Ft])&&Wn.prototype)&&(ud(os).TypedArrayConstructor=Wn);if((!Te||!rt(oe)||oe===Function.prototype)&&(oe=function(){throw Yo("Incorrect invocation")},Te))for(Ft in Se)M[Ft]&&fe(M[Ft],oe);if((!Te||!Zt||Zt===Bw)&&(Zt=oe.prototype,Te))for(Ft in Se)M[Ft]&&fe(M[Ft].prototype,Zt);if(Te&&He(Zu)!==Zt&&fe(Zu,Zt),J&&!A(Zt,Hu))for(Ft in ld=!0,Tw(Zt,Hu,{get:function(){return st(this)?this[Go]:void 0}}),Se)M[Ft]&&Us(M[Ft],Go,Ft);var Vs={NATIVE_ARRAY_BUFFER_VIEWS:Te,TYPED_ARRAY_TAG:ld&&Go,aTypedArray:function(e){if(Ju(e))return e;throw Yo("Target is not a typed array")},aTypedArrayConstructor:function(e){if(rt(e)&&(!fe||gn(oe,e)))return e;throw Yo(ur(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(J){if(n)for(var s in Se){var o=M[s];if(o&&A(o.prototype,e))try{delete o.prototype[e]}catch{try{o.prototype[e]=t}catch{}}}Zt[e]&&!n||It(Zt,e,n?t:Te&&$o[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,s;if(J){if(fe){if(n){for(r in Se)if((s=M[r])&&A(s,e))try{delete s[e]}catch{}}if(oe[e]&&!n)return;try{return It(oe,e,n?t:Te&&oe[e]||t)}catch{}}for(r in Se)!(s=M[r])||s[e]&&!n||It(s,e,t)}},getTypedArrayConstructor:fd,isView:function(e){if(!st(e))return!1;var t=An(e);return t==="DataView"||A(Se,t)||A(wc,t)},isTypedArray:Ju,TypedArray:oe,TypedArrayPrototype:Zt},Ow=TypeError,Fw=ut("species"),xw=function(e,t){var n,r=ht(e).constructor;return r===void 0||(n=ht(r)[Fw])==null?t:function(s){if(dc(s))return s;throw Ow(ur(s)+" is not a constructor")}(n)},Lw=Vs.aTypedArrayConstructor,Dw=Vs.getTypedArrayConstructor,kw=Vs.aTypedArray;(0,Vs.exportTypedArrayMethod)("slice",function(e,t){for(var n,r=bc(kw(this),e,t),s=Lw(xw(n=this,Dw(n))),o=0,i=r.length,a=new s(i);i>o;)a[o]=r[o++];return a},nt(function(){new Int8Array(1).slice()}));var Ew=vt.f,Ko=ut("unscopables"),Zo=Array.prototype;Zo[Ko]==null&&Ew(Zo,Ko,{configurable:!0,value:Ze(null)});var ki=function(e){Zo[Ko][e]=!0},Uw=Dh.includes,Nw=nt(function(){return!Array(1).includes()});dt({target:"Array",proto:!0,forced:Nw},{includes:function(e){return Uw(this,e,arguments.length>1?arguments[1]:void 0)}}),ki("includes"),fc("Array","includes");var Mw=P("".indexOf);dt({target:"String",proto:!0,forced:!Mh("includes")},{includes:function(e){return!!~Mw(Be(si(this)),Be(Nh(e)),arguments.length>1?arguments[1]:void 0)}}),fc("String","includes");var Cw=vt.f,Rw=Wt.set,Vw=Wt.getterFor("Array Iterator");gc(Array,"Array",function(e,t){Rw(this,{type:"Array Iterator",target:ye(e),index:0,kind:t})},function(){var e=Vw(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):n=="keys"?{value:r,done:!1}:n=="values"?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values");var Xu=sr.Arguments=sr.Array;if(ki("keys"),ki("values"),ki("entries"),J&&Xu.name!=="values")try{Cw(Xu,"name",{value:"values"})}catch{}var qu=nt(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),Si=Object.isExtensible,ho=nt(function(){Si(1)})||qu?function(e){return!!st(e)&&(!qu||Ie(e)!="ArrayBuffer")&&(!Si||Si(e))}:Si,jw=!nt(function(){return Object.isExtensible(Object.preventExtensions({}))}),Cn=cr(function(e){var t=vt.f,n=!1,r=ir("meta"),s=0,o=function(a){t(a,r,{value:{objectID:"O"+s++,weakData:{}}})},i=e.exports={enable:function(){i.enable=function(){},n=!0;var a=Rr.f,c=P([].splice),u={};u[r]=1,a(u).length&&(Rr.f=function(l){for(var f=a(l),h=0,p=f.length;h<p;h++)if(f[h]===r){c(f,h,1);break}return f},dt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:yc.f}))},fastKey:function(a,c){if(!st(a))return typeof a=="symbol"?a:(typeof a=="string"?"S":"P")+a;if(!A(a,r)){if(!ho(a))return"F";if(!c)return"E";o(a)}return a[r].objectID},getWeakData:function(a,c){if(!A(a,r)){if(!ho(a))return!0;if(!c)return!1;o(a)}return a[r].weakData},onFreeze:function(a){return jw&&n&&ho(a)&&!A(a,r)&&o(a),a}};fr[r]=!0});Cn.enable,Cn.fastKey,Cn.getWeakData,Cn.onFreeze;var Pw=TypeError,Ei=function(e,t){this.stopped=e,this.result=t},Qu=Ei.prototype,hd=function(e,t,n){var r,s,o,i,a,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),w=!(!n||!n.INTERRUPTED),_=Cs(t,l),b=function(v){return r&&Wo(r,"normal",v),new Ei(!0,v)},g=function(v){return f?(ht(v),w?_(v[0],v[1],b):_(v[0],v[1])):w?_(v,b):_(v)};if(h)r=e.iterator;else if(p)r=e;else{if(!(s=vc(e)))throw Pw(ur(e)+" is not iterable");if(id(s)){for(o=0,i=hr(e);i>o;o++)if((a=g(e[o]))&&gn(Qu,a))return a;return new Ei(!1)}r=sd(e,s)}for(c=h?e.next:r.next;!(u=St(c,r)).done;){try{a=g(u.value)}catch(v){Wo(r,"throw",v)}if(typeof a=="object"&&a&&gn(Qu,a))return a}return new Ei(!1)},zw=TypeError,dd=function(e,t){if(gn(t,e))return e;throw zw("Incorrect invocation")},tl=function(e,t,n){for(var r in t)It(e,r,t[r],n);return e},el=ut("species"),Ww=vt.f,nl=Cn.fastKey,rl=Wt.set,po=Wt.getterFor,$w={getConstructor:function(e,t,n,r){var s=e(function(u,l){dd(u,o),rl(u,{type:t,index:Ze(null),first:void 0,last:void 0,size:0}),J||(u.size=0),l!=null&&hd(l,u[r],{that:u,AS_ENTRIES:n})}),o=s.prototype,i=po(t),a=function(u,l,f){var h,p,w=i(u),_=c(u,l);return _?_.value=f:(w.last=_={index:p=nl(l,!0),key:l,value:f,previous:h=w.last,next:void 0,removed:!1},w.first||(w.first=_),h&&(h.next=_),J?w.size++:u.size++,p!=="F"&&(w.index[p]=_)),u},c=function(u,l){var f,h=i(u),p=nl(l);if(p!=="F")return h.index[p];for(f=h.first;f;f=f.next)if(f.key==l)return f};return tl(o,{clear:function(){for(var u=i(this),l=u.index,f=u.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete l[f.index],f=f.next;u.first=u.last=void 0,J?u.size=0:this.size=0},delete:function(u){var l=this,f=i(l),h=c(l,u);if(h){var p=h.next,w=h.previous;delete f.index[h.index],h.removed=!0,w&&(w.next=p),p&&(p.previous=w),f.first==h&&(f.first=p),f.last==h&&(f.last=w),J?f.size--:l.size--}return!!h},forEach:function(u){for(var l,f=i(this),h=Cs(u,arguments.length>1?arguments[1]:void 0);l=l?l.next:f.first;)for(h(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(u){return!!c(this,u)}}),tl(o,n?{get:function(u){var l=c(this,u);return l&&l.value},set:function(u,l){return a(this,u===0?0:u,l)}}:{add:function(u){return a(this,u=u===0?0:u,u)}}),J&&Ww(o,"size",{get:function(){return i(this).size}}),s},setStrong:function(e,t,n){var r=t+" Iterator",s=po(t),o=po(r);gc(e,t,function(i,a){rl(this,{type:r,target:i,state:s(i),kind:a,last:void 0})},function(){for(var i=o(this),a=i.kind,c=i.last;c&&c.removed;)c=c.previous;return i.target&&(i.last=c=c?c.next:i.state.first)?a=="keys"?{value:c.key,done:!1}:a=="values"?{value:c.value,done:!1}:{value:[c.key,c.value],done:!1}:(i.target=void 0,{value:void 0,done:!0})},n?"entries":"values",!n,!0),function(i){var a=ie(i),c=vt.f;J&&a&&!a[el]&&c(a,el,{configurable:!0,get:function(){return this}})}(t)}};function pd(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}function yd(e){return new this(function(t,n){if(!e||e.length===void 0)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(r.length===0)return t([]);var s=r.length;function o(a,c){if(c&&(typeof c=="object"||typeof c=="function")){var u=c.then;if(typeof u=="function")return void u.call(c,function(l){o(a,l)},function(l){r[a]={status:"rejected",reason:l},--s==0&&t(r)})}r[a]={status:"fulfilled",value:c},--s==0&&t(r)}for(var i=0;i<r.length;i++)o(i,r[i])})}(function(e,t,n){var r=e.indexOf("Map")!==-1,s=e.indexOf("Weak")!==-1,o=r?"set":"add",i=M[e],a=i&&i.prototype,c=i,u={},l=function(b){var g=P(a[b]);It(a,b,b=="add"?function(v){return g(this,v===0?0:v),this}:b=="delete"?function(v){return!(s&&!st(v))&&g(this,v===0?0:v)}:b=="get"?function(v){return s&&!st(v)?void 0:g(this,v===0?0:v)}:b=="has"?function(v){return!(s&&!st(v))&&g(this,v===0?0:v)}:function(v,I){return g(this,v===0?0:v,I),this})};if(Ro(e,!rt(i)||!(s||a.forEach&&!nt(function(){new i().entries().next()}))))c=n.getConstructor(t,e,r,o),Cn.enable();else if(Ro(e,!0)){var f=new c,h=f[o](s?{}:-0,1)!=f,p=nt(function(){f.has(1)}),w=cd(function(b){new i(b)}),_=!s&&nt(function(){for(var b=new i,g=5;g--;)b[o](g,g);return!b.has(-0)});w||((c=t(function(b,g){dd(b,a);var v=function(I,it,yt){var Dt,be;return fe&&rt(Dt=it.constructor)&&Dt!==yt&&st(be=Dt.prototype)&&be!==yt.prototype&&fe(I,be),I}(new i,b,c);return g!=null&&hd(g,v[o],{that:v,AS_ENTRIES:r}),v})).prototype=a,a.constructor=c),(p||_)&&(l("delete"),l("has"),r&&l("get")),(_||h)&&l(o),s&&a.clear&&delete a.clear}u[e]=c,dt({global:!0,constructor:!0,forced:c!=i},u),je(c,e),s||n.setStrong(c,e,r)})("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},$w),jr.Set;var Yw=setTimeout;function il(e){return Boolean(e&&e.length!==void 0)}function Gw(){}function ct(e){if(!(this instanceof ct))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],md(e,this)}function bd(e,t){for(;e._state===3;)e=e._value;e._state!==0?(e._handled=!0,ct._immediateFn(function(){var n=e._state===1?t.onFulfilled:t.onRejected;if(n!==null){var r;try{r=n(e._value)}catch(s){return void Pr(t.promise,s)}Ho(t.promise,r)}else(e._state===1?Ho:Pr)(t.promise,e._value)})):e._deferreds.push(t)}function Ho(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var n=t.then;if(t instanceof ct)return e._state=3,e._value=t,void Jo(e);if(typeof n=="function")return void md((r=n,s=t,function(){r.apply(s,arguments)}),e)}e._state=1,e._value=t,Jo(e)}catch(o){Pr(e,o)}var r,s}function Pr(e,t){e._state=2,e._value=t,Jo(e)}function Jo(e){e._state===2&&e._deferreds.length===0&&ct._immediateFn(function(){e._handled||ct._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)bd(e,e._deferreds[t]);e._deferreds=null}function Kw(e,t,n){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=n}function md(e,t){var n=!1;try{e(function(r){n||(n=!0,Ho(t,r))},function(r){n||(n=!0,Pr(t,r))})}catch(r){if(n)return;n=!0,Pr(t,r)}}ct.prototype.catch=function(e){return this.then(null,e)},ct.prototype.then=function(e,t){var n=new this.constructor(Gw);return bd(this,new Kw(e,t,n)),n},ct.prototype.finally=pd,ct.all=function(e){return new ct(function(t,n){if(!il(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(r.length===0)return t([]);var s=r.length;function o(a,c){try{if(c&&(typeof c=="object"||typeof c=="function")){var u=c.then;if(typeof u=="function")return void u.call(c,function(l){o(a,l)},n)}r[a]=c,--s==0&&t(r)}catch(l){n(l)}}for(var i=0;i<r.length;i++)o(i,r[i])})},ct.allSettled=yd,ct.resolve=function(e){return e&&typeof e=="object"&&e.constructor===ct?e:new ct(function(t){t(e)})},ct.reject=function(e){return new ct(function(t,n){n(e)})},ct.race=function(e){return new ct(function(t,n){if(!il(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,s=e.length;r<s;r++)ct.resolve(e[r]).then(t,n)})},ct._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){Yw(e,0)},ct._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var xn=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}();typeof xn.Promise!="function"?xn.Promise=ct:(xn.Promise.prototype.finally||(xn.Promise.prototype.finally=pd),xn.Promise.allSettled||(xn.Promise.allSettled=yd)),function(e){function t(){}function n(i,a){if(i=i===void 0?"utf-8":i,a=a===void 0?{fatal:!1}:a,s.indexOf(i.toLowerCase())===-1)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+i+"') is invalid.");if(a.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function r(i){for(var a=0,c=Math.min(65536,i.length+1),u=new Uint16Array(c),l=[],f=0;;){var h=a<i.length;if(!h||f>=c-1){if(l.push(String.fromCharCode.apply(null,u.subarray(0,f))),!h)return l.join("");i=i.subarray(a),f=a=0}if((128&(h=i[a++]))==0)u[f++]=h;else if((224&h)==192){var p=63&i[a++];u[f++]=(31&h)<<6|p}else if((240&h)==224){p=63&i[a++];var w=63&i[a++];u[f++]=(31&h)<<12|p<<6|w}else(248&h)==240&&(65535<(h=(7&h)<<18|(p=63&i[a++])<<12|(w=63&i[a++])<<6|63&i[a++])&&(h-=65536,u[f++]=h>>>10&1023|55296,h=56320|1023&h),u[f++]=h)}}if(e.TextEncoder&&e.TextDecoder)return!1;var s=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(i,a){if((a=a===void 0?{stream:!1}:a).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");a=0;for(var c=i.length,u=0,l=Math.max(32,c+(c>>>1)+7),f=new Uint8Array(l>>>3<<3);a<c;){var h=i.charCodeAt(a++);if(55296<=h&&56319>=h){if(a<c){var p=i.charCodeAt(a);(64512&p)==56320&&(++a,h=((1023&h)<<10)+(1023&p)+65536)}if(55296<=h&&56319>=h)continue}if(u+4>f.length&&(l+=8,l=(l*=1+a/i.length*2)>>>3<<3,(p=new Uint8Array(l)).set(f),f=p),(4294967168&h)==0)f[u++]=h;else{if((4294965248&h)==0)f[u++]=h>>>6&31|192;else if((4294901760&h)==0)f[u++]=h>>>12&15|224,f[u++]=h>>>6&63|128;else{if((4292870144&h)!=0)continue;f[u++]=h>>>18&7|240,f[u++]=h>>>12&63|128,f[u++]=h>>>6&63|128}f[u++]=63&h|128}}return f.slice?f.slice(0,u):f.subarray(0,u)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1});var o=r;typeof Buffer=="function"&&Buffer.from?o=function(i){return Buffer.from(i.buffer,i.byteOffset,i.byteLength).toString("utf-8")}:typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&(o=function(i){try{var a=URL.createObjectURL(new Blob([i],{type:"text/plain;charset=UTF-8"})),c=new XMLHttpRequest;return c.open("GET",a,!1),c.send(),c.responseText}catch{return r(i)}finally{a&&URL.revokeObjectURL(a)}}),n.prototype.decode=function(i,a){if((a=a===void 0?{stream:!1}:a).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return i=i instanceof Uint8Array?i:i.buffer instanceof ArrayBuffer?new Uint8Array(i.buffer):new Uint8Array(i),o(i)},e.TextEncoder=t,e.TextDecoder=n}(typeof window<"u"?window:ce),function(){function e(b,g){if(!(b instanceof g))throw new TypeError("Cannot call a class as a function")}function t(b,g){for(var v=0;v<g.length;v++){var I=g[v];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(b,I.key,I)}}function n(b,g,v){return g&&t(b.prototype,g),v&&t(b,v),b}function r(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(g&&g.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),g&&o(b,g)}function s(b){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},s(b)}function o(b,g){return o=Object.setPrototypeOf||function(v,I){return v.__proto__=I,v},o(b,g)}function i(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function c(b,g){return!g||typeof g!="object"&&typeof g!="function"?a(b):g}function u(b){var g=i();return function(){var v,I=s(b);if(g){var it=s(this).constructor;v=Reflect.construct(I,arguments,it)}else v=I.apply(this,arguments);return c(this,v)}}function l(b,g){for(;!Object.prototype.hasOwnProperty.call(b,g)&&(b=s(b))!==null;);return b}function f(b,g,v){return f=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(I,it,yt){var Dt=l(I,it);if(Dt){var be=Object.getOwnPropertyDescriptor(Dt,it);return be.get?be.get.call(yt):be.value}},f(b,g,v||b)}var h=function(){function b(){e(this,b),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(b,[{key:"addEventListener",value:function(g,v,I){g in this.listeners||(this.listeners[g]=[]),this.listeners[g].push({callback:v,options:I})}},{key:"removeEventListener",value:function(g,v){if(g in this.listeners){for(var I=this.listeners[g],it=0,yt=I.length;it<yt;it++)if(I[it].callback===v)return void I.splice(it,1)}}},{key:"dispatchEvent",value:function(g){if(g.type in this.listeners){for(var v=this.listeners[g.type].slice(),I=0,it=v.length;I<it;I++){var yt=v[I];try{yt.callback.call(this,g)}catch(Dt){Promise.resolve().then(function(){throw Dt})}yt.options&&yt.options.once&&this.removeEventListener(g.type,yt.callback)}return!g.defaultPrevented}}}]),b}(),p=function(b){r(v,b);var g=u(v);function v(){var I;return e(this,v),(I=g.call(this)).listeners||h.call(a(I)),Object.defineProperty(a(I),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(a(I),"onabort",{value:null,writable:!0,configurable:!0}),I}return n(v,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(I){I.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,I)),f(s(v.prototype),"dispatchEvent",this).call(this,I)}}]),v}(h),w=function(){function b(){e(this,b),Object.defineProperty(this,"signal",{value:new p,writable:!0,configurable:!0})}return n(b,[{key:"abort",value:function(){var g;try{g=new Event("abort")}catch{typeof document<"u"?document.createEvent?(g=document.createEvent("Event")).initEvent("abort",!1,!1):(g=document.createEventObject()).type="abort":g={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(g)}},{key:"toString",value:function(){return"[object AbortController]"}}]),b}();function _(b){return b.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof b.Request=="function"&&!b.Request.prototype.hasOwnProperty("signal")||!b.AbortController}typeof Symbol<"u"&&Symbol.toStringTag&&(w.prototype[Symbol.toStringTag]="AbortController",p.prototype[Symbol.toStringTag]="AbortSignal"),function(b){_(b)&&(b.AbortController=w,b.AbortSignal=p)}(typeof self<"u"?self:ce)}();var sn=cr(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function r(){var s=this;this.locked=new Map,this.addToLocked=function(o,i){var a=s.locked.get(o);a===void 0?i===void 0?s.locked.set(o,[]):s.locked.set(o,[i]):i!==void 0&&(a.unshift(i),s.locked.set(o,a))},this.isLocked=function(o){return s.locked.has(o)},this.lock=function(o){return new Promise(function(i,a){s.isLocked(o)?s.addToLocked(o,i):(s.addToLocked(o),i())})},this.unlock=function(o){var i=s.locked.get(o);if(i!==void 0&&i.length!==0){var a=i.pop();s.locked.set(o,i),a!==void 0&&setTimeout(a,0)}else s.locked.delete(o)}}return r.getInstance=function(){return r.instance===void 0&&(r.instance=new r),r.instance},r}();t.default=function(){return n.getInstance()}});nc(sn);var Zw=cr(function(e,t){var n=ce&&ce.__awaiter||function(c,u,l,f){return new(l||(l=Promise))(function(h,p){function w(g){try{b(f.next(g))}catch(v){p(v)}}function _(g){try{b(f.throw(g))}catch(v){p(v)}}function b(g){g.done?h(g.value):new l(function(v){v(g.value)}).then(w,_)}b((f=f.apply(c,u||[])).next())})},r=ce&&ce.__generator||function(c,u){var l,f,h,p,w={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return p={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function _(b){return function(g){return function(v){if(l)throw new TypeError("Generator is already executing.");for(;w;)try{if(l=1,f&&(h=2&v[0]?f.return:v[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,v[1])).done)return h;switch(f=0,h&&(v=[2&v[0],h.value]),v[0]){case 0:case 1:h=v;break;case 4:return w.label++,{value:v[1],done:!1};case 5:w.label++,f=v[1],v=[0];continue;case 7:v=w.ops.pop(),w.trys.pop();continue;default:if(h=w.trys,!((h=h.length>0&&h[h.length-1])||v[0]!==6&&v[0]!==2)){w=0;continue}if(v[0]===3&&(!h||v[1]>h[0]&&v[1]<h[3])){w.label=v[1];break}if(v[0]===6&&w.label<h[1]){w.label=h[1],h=v;break}if(h&&w.label<h[2]){w.label=h[2],w.ops.push(v);break}h[2]&&w.ops.pop(),w.trys.pop();continue}v=u.call(c,w)}catch(I){v=[6,I],f=0}finally{l=h=0}if(5&v[0])throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}([b,g])}}};Object.defineProperty(t,"__esModule",{value:!0});var s="browser-tabs-lock-key";function o(c){return new Promise(function(u){return setTimeout(u,c)})}function i(c){for(var u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",l="",f=0;f<c;f++)l+=u[Math.floor(Math.random()*u.length)];return l}var a=function(){function c(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+i(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(u,l){return l===void 0&&(l=5e3),n(this,void 0,void 0,function(){var f,h,p,w,_,b;return r(this,function(g){switch(g.label){case 0:f=Date.now()+i(4),h=Date.now()+l,p=s+"-"+u,w=window.localStorage,g.label=1;case 1:return Date.now()<h?[4,o(30)]:[3,8];case 2:return g.sent(),w.getItem(p)!==null?[3,5]:(_=this.id+"-"+u+"-"+f,[4,o(Math.floor(25*Math.random()))]);case 3:return g.sent(),w.setItem(p,JSON.stringify({id:this.id,iat:f,timeoutKey:_,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return g.sent(),(b=w.getItem(p))!==null&&(b=JSON.parse(b)).id===this.id&&b.iat===f?(this.acquiredIatSet.add(f),this.refreshLockWhileAcquired(p,f),[2,!0]):[3,7];case 5:return c.lockCorrector(),[4,this.waitForSomethingToChange(h)];case 6:g.sent(),g.label=7;case 7:return f=Date.now()+i(4),[3,1];case 8:return[2,!1]}})})},c.prototype.refreshLockWhileAcquired=function(u,l){return n(this,void 0,void 0,function(){var f=this;return r(this,function(h){return setTimeout(function(){return n(f,void 0,void 0,function(){var p,w;return r(this,function(_){switch(_.label){case 0:return[4,sn.default().lock(l)];case 1:return _.sent(),this.acquiredIatSet.has(l)?(p=window.localStorage,(w=p.getItem(u))===null?(sn.default().unlock(l),[2]):((w=JSON.parse(w)).timeRefreshed=Date.now(),p.setItem(u,JSON.stringify(w)),sn.default().unlock(l),this.refreshLockWhileAcquired(u,l),[2])):(sn.default().unlock(l),[2])}})})},1e3),[2]})})},c.prototype.waitForSomethingToChange=function(u){return n(this,void 0,void 0,function(){return r(this,function(l){switch(l.label){case 0:return[4,new Promise(function(f){var h=!1,p=Date.now(),w=!1;function _(){if(w||(window.removeEventListener("storage",_),c.removeFromWaiting(_),clearTimeout(b),w=!0),!h){h=!0;var g=50-(Date.now()-p);g>0?setTimeout(f,g):f()}}window.addEventListener("storage",_),c.addToWaiting(_);var b=setTimeout(_,Math.max(0,u-Date.now()))})];case 1:return l.sent(),[2]}})})},c.addToWaiting=function(u){this.removeFromWaiting(u),c.waiters!==void 0&&c.waiters.push(u)},c.removeFromWaiting=function(u){c.waiters!==void 0&&(c.waiters=c.waiters.filter(function(l){return l!==u}))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach(function(u){return u()})},c.prototype.releaseLock=function(u){return n(this,void 0,void 0,function(){return r(this,function(l){switch(l.label){case 0:return[4,this.releaseLock__private__(u)];case 1:return[2,l.sent()]}})})},c.prototype.releaseLock__private__=function(u){return n(this,void 0,void 0,function(){var l,f,h;return r(this,function(p){switch(p.label){case 0:return l=window.localStorage,f=s+"-"+u,(h=l.getItem(f))===null?[2]:(h=JSON.parse(h)).id!==this.id?[3,2]:[4,sn.default().lock(h.iat)];case 1:p.sent(),this.acquiredIatSet.delete(h.iat),l.removeItem(f),sn.default().unlock(h.iat),c.notifyWaiters(),p.label=2;case 2:return[2]}})})},c.lockCorrector=function(){for(var u=Date.now()-5e3,l=window.localStorage,f=Object.keys(l),h=!1,p=0;p<f.length;p++){var w=f[p];if(w.includes(s)){var _=l.getItem(w);_!==null&&((_=JSON.parse(_)).timeRefreshed===void 0&&_.timeAcquired<u||_.timeRefreshed!==void 0&&_.timeRefreshed<u)&&(l.removeItem(w),h=!0)}}h&&c.notifyWaiters()},c.waiters=void 0,c}();t.default=a}),Hw=nc(Zw),Jw={timeoutInSeconds:60},Xw=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],gd={name:"auth0-spa-js",version:"1.22.4"},vd=function(){return Date.now()},Fe=function(e){function t(n,r){var s=e.call(this,r)||this;return s.error=n,s.error_description=r,Object.setPrototypeOf(s,t.prototype),s}return Tn(t,e),t.fromPayload=function(n){return new t(n.error,n.error_description)},t}(Error),qw=function(e){function t(n,r,s,o){o===void 0&&(o=null);var i=e.call(this,n,r)||this;return i.state=s,i.appState=o,Object.setPrototypeOf(i,t.prototype),i}return Tn(t,e),t}(Fe),Xo=function(e){function t(){var n=e.call(this,"timeout","Timeout")||this;return Object.setPrototypeOf(n,t.prototype),n}return Tn(t,e),t}(Fe),Qw=function(e){function t(n){var r=e.call(this)||this;return r.popup=n,Object.setPrototypeOf(r,t.prototype),r}return Tn(t,e),t}(Xo),t_=function(e){function t(n){var r=e.call(this,"cancelled","Popup closed")||this;return r.popup=n,Object.setPrototypeOf(r,t.prototype),r}return Tn(t,e),t}(Fe),e_=function(e){function t(n,r,s){var o=e.call(this,n,r)||this;return o.mfa_token=s,Object.setPrototypeOf(o,t.prototype),o}return Tn(t,e),t}(Fe),n_=function(e){function t(n,r){var s=e.call(this,"missing_refresh_token","Missing Refresh Token (audience: '".concat(ol(n,["default"]),"', scope: '").concat(ol(r),"')"))||this;return s.audience=n,s.scope=r,Object.setPrototypeOf(s,t.prototype),s}return Tn(t,e),t}(Fe),r_=function(e){return new Promise(function(t,n){var r,s=setInterval(function(){e.popup&&e.popup.closed&&(clearInterval(s),clearTimeout(o),window.removeEventListener("message",r,!1),n(new t_(e.popup)))},1e3),o=setTimeout(function(){clearInterval(s),n(new Qw(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(i){if(i.data&&i.data.type==="authorization_response"){if(clearTimeout(o),clearInterval(s),window.removeEventListener("message",r,!1),e.popup.close(),i.data.response.error)return n(Fe.fromPayload(i.data.response));t(i.data.response)}},window.addEventListener("message",r)})},_c=function(){return window.crypto||window.msCrypto},wd=function(){var e=_c();return e.subtle||e.webkitSubtle},me=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(_c().getRandomValues(new Uint8Array(43))).forEach(function(n){return t+=e[n%e.length]}),t},Ln=function(e){return btoa(e)},qo=function(e){return Object.keys(e).filter(function(t){return e[t]!==void 0}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},yo=function(e){return $(void 0,void 0,void 0,function(){var t;return Y(this,function(n){switch(n.label){case 0:return t=wd().digest({name:"SHA-256"},new TextEncoder().encode(e)),window.msCrypto?[2,new Promise(function(r,s){t.oncomplete=function(o){r(o.target.result)},t.onerror=function(o){s(o.error)},t.onabort=function(){s("The digest operation was aborted")}})]:[4,t];case 1:return[2,n.sent()]}})})},sl=function(e){return function(t){return decodeURIComponent(atob(t).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},bo=function(e){var t=new Uint8Array(e);return function(n){var r={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,function(s){return r[s]})}(window.btoa(String.fromCharCode.apply(String,Eo([],nr(Array.from(t)),!1))))};function ol(e,t){return t===void 0&&(t=[]),e&&!t.includes(e)?e:""}var i_=function(e,t){return $(void 0,void 0,void 0,function(){var n,r;return Y(this,function(s){switch(s.label){case 0:return[4,(o=e,i=t,i=i||{},new Promise(function(a,c){var u=new XMLHttpRequest,l=[],f=[],h={},p=function(){return{ok:(u.status/100|0)==2,statusText:u.statusText,status:u.status,url:u.responseURL,text:function(){return Promise.resolve(u.responseText)},json:function(){return Promise.resolve(u.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([u.response]))},clone:p,headers:{keys:function(){return l},entries:function(){return f},get:function(_){return h[_.toLowerCase()]},has:function(_){return _.toLowerCase()in h}}}};for(var w in u.open(i.method||"get",o,!0),u.onload=function(){u.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,b,g){l.push(b=b.toLowerCase()),f.push([b,g]),h[b]=h[b]?h[b]+","+g:g}),a(p())},u.onerror=c,u.withCredentials=i.credentials=="include",i.headers)u.setRequestHeader(w,i.headers[w]);u.send(i.body||null)}))];case 1:return n=s.sent(),r={ok:n.ok},[4,n.json()];case 2:return[2,(r.json=s.sent(),r)]}var o,i})})},s_=function(e,t,n){return $(void 0,void 0,void 0,function(){var r,s;return Y(this,function(o){return r=new AbortController,t.signal=r.signal,[2,Promise.race([i_(e,t),new Promise(function(i,a){s=setTimeout(function(){r.abort(),a(new Error("Timeout when executing 'fetch'"))},n)})]).finally(function(){clearTimeout(s)})]})})},o_=function(e,t,n,r,s,o,i){return $(void 0,void 0,void 0,function(){return Y(this,function(a){return[2,(c={auth:{audience:t,scope:n},timeout:s,fetchUrl:e,fetchOptions:r,useFormData:i},u=o,new Promise(function(l,f){var h=new MessageChannel;h.port1.onmessage=function(p){p.data.error?f(new Error(p.data.error)):l(p.data)},u.postMessage(c,[h.port2])}))];var c,u})})},a_=function(e,t,n,r,s,o,i){return i===void 0&&(i=1e4),$(void 0,void 0,void 0,function(){return Y(this,function(a){return s?[2,o_(e,t,n,r,i,s,o)]:[2,s_(e,r,i)]})})};function c_(e,t,n,r,s,o,i){return $(this,void 0,void 0,function(){var a,c,u,l,f,h,p,w,_;return Y(this,function(b){switch(b.label){case 0:a=null,u=0,b.label=1;case 1:if(!(u<3))return[3,6];b.label=2;case 2:return b.trys.push([2,4,,5]),[4,a_(e,n,r,s,o,i,t)];case 3:return c=b.sent(),a=null,[3,6];case 4:return l=b.sent(),a=l,[3,5];case 5:return u++,[3,1];case 6:if(a)throw a.message=a.message||"Failed to fetch",a;if(f=c.json,h=f.error,p=f.error_description,w=Tt(f,["error","error_description"]),!c.ok)throw _=p||"HTTP error. Unable to fetch ".concat(e),h==="mfa_required"?new e_(h,_,w.mfa_token):new Fe(h||"request_error",_);return[2,w]}})})}function Ii(e,t){var n=e.baseUrl,r=e.timeout,s=e.audience,o=e.scope,i=e.auth0Client,a=e.useFormData,c=Tt(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);return $(this,void 0,void 0,function(){var u;return Y(this,function(l){switch(l.label){case 0:return u=a?qo(c):JSON.stringify(c),[4,c_("".concat(n,"/oauth/token"),r,s||"default",o,{method:"POST",body:u,headers:{"Content-Type":a?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(i||gd))}},t,a)];case 1:return[2,l.sent()]}})})}var u_=function(e){return Array.from(new Set(e))},Me=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return u_(e.join(" ").trim().split(/\s+/)).join(" ")},on=function(){function e(t,n){n===void 0&&(n="@@auth0spajs@@"),this.prefix=n,this.client_id=t.client_id,this.scope=t.scope,this.audience=t.audience}return e.prototype.toKey=function(){return"".concat(this.prefix,"::").concat(this.client_id,"::").concat(this.audience,"::").concat(this.scope)},e.fromKey=function(t){var n=nr(t.split("::"),4),r=n[0],s=n[1],o=n[2];return new e({client_id:s,scope:n[3],audience:o},r)},e.fromCacheEntry=function(t){return new e({scope:t.scope,audience:t.audience,client_id:t.client_id})},e}(),l_=function(){function e(){}return e.prototype.set=function(t,n){localStorage.setItem(t,JSON.stringify(n))},e.prototype.get=function(t){var n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}},e.prototype.remove=function(t){localStorage.removeItem(t)},e.prototype.allKeys=function(){return Object.keys(window.localStorage).filter(function(t){return t.startsWith("@@auth0spajs@@")})},e}(),f_=function(){var e;this.enclosedCache=(e={},{set:function(t,n){e[t]=n},get:function(t){var n=e[t];if(n)return n},remove:function(t){delete e[t]},allKeys:function(){return Object.keys(e)}})},h_=function(){function e(t,n,r){this.cache=t,this.keyManifest=n,this.nowProvider=r,this.nowProvider=this.nowProvider||vd}return e.prototype.get=function(t,n){var r;return n===void 0&&(n=0),$(this,void 0,void 0,function(){var s,o,i,a,c;return Y(this,function(u){switch(u.label){case 0:return[4,this.cache.get(t.toKey())];case 1:return(s=u.sent())?[3,4]:[4,this.getCacheKeys()];case 2:return(o=u.sent())?(i=this.matchExistingCacheKey(t,o))?[4,this.cache.get(i)]:[3,4]:[2];case 3:s=u.sent(),u.label=4;case 4:return s?[4,this.nowProvider()]:[2];case 5:return a=u.sent(),c=Math.floor(a/1e3),s.expiresAt-n<c?s.body.refresh_token?(s.body={refresh_token:s.body.refresh_token},[4,this.cache.set(t.toKey(),s)]):[3,7]:[3,10];case 6:return u.sent(),[2,s.body];case 7:return[4,this.cache.remove(t.toKey())];case 8:return u.sent(),[4,(r=this.keyManifest)===null||r===void 0?void 0:r.remove(t.toKey())];case 9:return u.sent(),[2];case 10:return[2,s.body]}})})},e.prototype.set=function(t){var n;return $(this,void 0,void 0,function(){var r,s;return Y(this,function(o){switch(o.label){case 0:return r=new on({client_id:t.client_id,scope:t.scope,audience:t.audience}),[4,this.wrapCacheEntry(t)];case 1:return s=o.sent(),[4,this.cache.set(r.toKey(),s)];case 2:return o.sent(),[4,(n=this.keyManifest)===null||n===void 0?void 0:n.add(r.toKey())];case 3:return o.sent(),[2]}})})},e.prototype.clear=function(t){var n;return $(this,void 0,void 0,function(){var r,s=this;return Y(this,function(o){switch(o.label){case 0:return[4,this.getCacheKeys()];case 1:return(r=o.sent())?[4,r.filter(function(i){return!t||i.includes(t)}).reduce(function(i,a){return $(s,void 0,void 0,function(){return Y(this,function(c){switch(c.label){case 0:return[4,i];case 1:return c.sent(),[4,this.cache.remove(a)];case 2:return c.sent(),[2]}})})},Promise.resolve())]:[2];case 2:return o.sent(),[4,(n=this.keyManifest)===null||n===void 0?void 0:n.clear()];case 3:return o.sent(),[2]}})})},e.prototype.clearSync=function(t){var n=this,r=this.cache.allKeys();r&&r.filter(function(s){return!t||s.includes(t)}).forEach(function(s){n.cache.remove(s)})},e.prototype.wrapCacheEntry=function(t){return $(this,void 0,void 0,function(){var n,r,s;return Y(this,function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return n=o.sent(),r=Math.floor(n/1e3)+t.expires_in,s=Math.min(r,t.decodedToken.claims.exp),[2,{body:t,expiresAt:s}]}})})},e.prototype.getCacheKeys=function(){var t;return $(this,void 0,void 0,function(){var n;return Y(this,function(r){switch(r.label){case 0:return this.keyManifest?[4,this.keyManifest.get()]:[3,2];case 1:return n=(t=r.sent())===null||t===void 0?void 0:t.keys,[3,4];case 2:return[4,this.cache.allKeys()];case 3:n=r.sent(),r.label=4;case 4:return[2,n]}})})},e.prototype.matchExistingCacheKey=function(t,n){return n.filter(function(r){var s=on.fromKey(r),o=new Set(s.scope&&s.scope.split(" ")),i=t.scope.split(" "),a=s.scope&&i.reduce(function(c,u){return c&&o.has(u)},!0);return s.prefix==="@@auth0spajs@@"&&s.client_id===t.client_id&&s.audience===t.audience&&a})[0]},e}(),d_=function(){function e(t,n){this.storage=t,this.clientId=n,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId),this.transaction=this.storage.get(this.storageKey)}return e.prototype.create=function(t){this.transaction=t,this.storage.save(this.storageKey,t,{daysUntilExpire:1})},e.prototype.get=function(){return this.transaction},e.prototype.remove=function(){delete this.transaction,this.storage.remove(this.storageKey)},e}(),gr=function(e){return typeof e=="number"},p_=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],y_=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(a){var c=a.split("."),u=nr(c,3),l=u[0],f=u[1],h=u[2];if(c.length!==3||!l||!f||!h)throw new Error("ID token could not be decoded");var p=JSON.parse(sl(f)),w={__raw:a},_={};return Object.keys(p).forEach(function(b){w[b]=p[b],p_.includes(b)||(_[b]=p[b])}),{encoded:{header:l,payload:f,signature:h},header:JSON.parse(sl(l)),claims:w,user:_}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!gr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!gr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!gr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date(e.now||Date.now()),s=new Date(0),o=new Date(0),i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),s.setUTCSeconds(t.claims.exp+n),o.setUTCSeconds(t.claims.nbf-n),r>s)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(r,") is after expiration time (").concat(s,")"));if(gr(t.claims.nbf)&&r<o)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (".concat(r,") is before ").concat(o));if(gr(t.claims.auth_time)&&r>i)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (".concat(r,") is after last auth at ").concat(i));if(e.organizationId){if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e.organizationId!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(e.organizationId,'", found "').concat(t.claims.org_id,'"'))}return t},cn=cr(function(e,t){var n=ce&&ce.__assign||function(){return n=Object.assign||function(c){for(var u,l=1,f=arguments.length;l<f;l++)for(var h in u=arguments[l])Object.prototype.hasOwnProperty.call(u,h)&&(c[h]=u[h]);return c},n.apply(this,arguments)};function r(c,u){if(!u)return"";var l="; "+c;return u===!0?l:l+"="+u}function s(c,u,l){return encodeURIComponent(c).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return r("Expires",f.expires?f.expires.toUTCString():"")+r("Domain",f.domain)+r("Path",f.path)+r("Secure",f.secure)+r("SameSite",f.sameSite)}(l)}function o(c){for(var u={},l=c?c.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<l.length;h++){var p=l[h].split("="),w=p.slice(1).join("=");w.charAt(0)==='"'&&(w=w.slice(1,-1));try{u[p[0].replace(f,decodeURIComponent)]=w.replace(f,decodeURIComponent)}catch{}}return u}function i(){return o(document.cookie)}function a(c,u,l){document.cookie=s(c,u,n({path:"/"},l))}t.__esModule=!0,t.encode=s,t.parse=o,t.getAll=i,t.get=function(c){return i()[c]},t.set=a,t.remove=function(c,u){a(c,"",n(n({},u),{expires:-1}))}});nc(cn),cn.encode,cn.parse,cn.getAll;var b_=cn.get,_d=cn.set,Sd=cn.remove,En={get:function(e){var t=b_(e);if(t!==void 0)return JSON.parse(t)},save:function(e,t,n){var r={};window.location.protocol==="https:"&&(r={secure:!0,sameSite:"none"}),n!=null&&n.daysUntilExpire&&(r.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(r.domain=n.cookieDomain),_d(e,JSON.stringify(t),r)},remove:function(e,t){var n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Sd(e,n)}},m_={get:function(e){var t=En.get(e);return t||En.get("".concat("_legacy_").concat(e))},save:function(e,t,n){var r={};window.location.protocol==="https:"&&(r={secure:!0}),n!=null&&n.daysUntilExpire&&(r.expires=n.daysUntilExpire),_d("".concat("_legacy_").concat(e),JSON.stringify(t),r),En.save(e,t,n)},remove:function(e,t){var n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Sd(e,n),En.remove(e,t),En.remove("".concat("_legacy_").concat(e),t)}},g_={get:function(e){if(typeof sessionStorage<"u"){var t=sessionStorage.getItem(e);if(t!==void 0)return JSON.parse(t)}},save:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove:function(e){sessionStorage.removeItem(e)}};function v_(e,t,n){var r=t===void 0?null:t,s=function(c,u){var l=atob(c);if(u){for(var f=new Uint8Array(l.length),h=0,p=l.length;h<p;++h)f[h]=l.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return l}(e,n!==void 0&&n),o=s.indexOf(`
`,10)+1,i=s.substring(o)+(r?"//# sourceMappingURL="+r:""),a=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(a)}var al,cl,ul,mo,w_=(al=" ",cl=null,ul=!1,function(e){return mo=mo||v_(al,cl,ul),new Worker(mo,e)}),go={},__=function(){function e(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}return e.prototype.add=function(t){var n;return $(this,void 0,void 0,function(){var r,s;return Y(this,function(o){switch(o.label){case 0:return s=Set.bind,[4,this.cache.get(this.manifestKey)];case 1:return(r=new(s.apply(Set,[void 0,((n=o.sent())===null||n===void 0?void 0:n.keys)||[]]))).add(t),[4,this.cache.set(this.manifestKey,{keys:Eo([],nr(r),!1)})];case 2:return o.sent(),[2]}})})},e.prototype.remove=function(t){return $(this,void 0,void 0,function(){var n,r;return Y(this,function(s){switch(s.label){case 0:return[4,this.cache.get(this.manifestKey)];case 1:return(n=s.sent())?((r=new Set(n.keys)).delete(t),r.size>0?[4,this.cache.set(this.manifestKey,{keys:Eo([],nr(r),!1)})]:[3,3]):[3,5];case 2:case 4:return[2,s.sent()];case 3:return[4,this.cache.remove(this.manifestKey)];case 5:return[2]}})})},e.prototype.get=function(){return this.cache.get(this.manifestKey)},e.prototype.clear=function(){return this.cache.remove(this.manifestKey)},e.prototype.createManifestKeyFrom=function(t){return"".concat("@@auth0spajs@@","::").concat(t)},e}(),vo=new Hw,S_={memory:function(){return new f_().enclosedCache},localstorage:function(){return new l_}},ll=function(e){return S_[e]},I_=function(){return!/Trident.*rv:11\.0/.test(navigator.userAgent)},T_=function(){function e(t){var n,r,s,o,i=this;if(this.options=t,this._releaseLockOnPageHide=function(){return $(i,void 0,void 0,function(){return Y(this,function(u){switch(u.label){case 0:return[4,vo.releaseLock("auth0.lock.getTokenSilently")];case 1:return u.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[2]}})})},typeof window<"u"&&function(){if(!_c())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(wd()===void 0)throw new Error(`
      auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
    `)}(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)s=t.cache;else{if(this.cacheLocation=t.cacheLocation||"memory",!ll(this.cacheLocation))throw new Error('Invalid cache location "'.concat(this.cacheLocation,'"'));s=ll(this.cacheLocation)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?En:m_,this.orgHintCookieName=(o=this.options.client_id,"auth0.".concat(o,".organization_hint")),this.isAuthenticatedCookieName=function(u){return"auth0.".concat(u,".is.authenticated")}(this.options.client_id),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;var a,c=t.useCookiesForTransactions?this.cookieStorage:g_;this.scope=this.options.scope,this.transactionManager=new d_(c,this.options.client_id),this.nowProvider=this.options.nowProvider||vd,this.cacheManager=new h_(s,s.allKeys?null:new __(s,this.options.client_id),this.nowProvider),this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),this.tokenIssuer=function(u,l){return u?u.startsWith("https://")?u:"https://".concat(u,"/"):"".concat(l,"/")}(this.options.issuer,this.domainUrl),this.defaultScope=Me("openid",((r=(n=this.options)===null||n===void 0?void 0:n.advancedOptions)===null||r===void 0?void 0:r.defaultScope)!==void 0?this.options.advancedOptions.defaultScope:"openid profile email"),this.options.useRefreshTokens&&(this.scope=Me(this.scope,"offline_access")),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&this.cacheLocation==="memory"&&I_()&&(this.worker=new w_),this.customOptions=function(u){return u.advancedOptions,u.audience,u.auth0Client,u.authorizeTimeoutInSeconds,u.cacheLocation,u.cache,u.client_id,u.domain,u.issuer,u.leeway,u.max_age,u.nowProvider,u.redirect_uri,u.scope,u.useRefreshTokens,u.useRefreshTokensFallback,u.useCookiesForTransactions,u.useFormData,Tt(u,["advancedOptions","audience","auth0Client","authorizeTimeoutInSeconds","cacheLocation","cache","client_id","domain","issuer","leeway","max_age","nowProvider","redirect_uri","scope","useRefreshTokens","useRefreshTokensFallback","useCookiesForTransactions","useFormData"])}(t),this.useRefreshTokensFallback=this.options.useRefreshTokensFallback!==!1}return e.prototype._url=function(t){var n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||gd)));return"".concat(this.domainUrl).concat(t,"&auth0Client=").concat(n)},e.prototype._getParams=function(t,n,r,s,o){var i=this.options;i.useRefreshTokens,i.useCookiesForTransactions,i.useFormData,i.auth0Client,i.cacheLocation,i.advancedOptions,i.detailedResponse,i.nowProvider,i.authorizeTimeoutInSeconds,i.legacySameSiteCookie,i.sessionCheckExpiryDays,i.domain,i.leeway,i.httpTimeoutInSeconds;var a=Tt(i,["useRefreshTokens","useCookiesForTransactions","useFormData","auth0Client","cacheLocation","advancedOptions","detailedResponse","nowProvider","authorizeTimeoutInSeconds","legacySameSiteCookie","sessionCheckExpiryDays","domain","leeway","httpTimeoutInSeconds"]);return N(N(N({},a),t),{scope:Me(this.defaultScope,this.scope,t.scope),response_type:"code",response_mode:"query",state:n,nonce:r,redirect_uri:o||this.options.redirect_uri,code_challenge:s,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(t){return this._url("/authorize?".concat(qo(t)))},e.prototype._verifyIdToken=function(t,n,r){return $(this,void 0,void 0,function(){var s;return Y(this,function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return s=o.sent(),[2,y_({iss:this.tokenIssuer,aud:this.options.client_id,id_token:t,nonce:n,organizationId:r,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age),now:s})]}})})},e.prototype._parseNumber=function(t){return typeof t!="string"?t:parseInt(t,10)||void 0},e.prototype._processOrgIdHint=function(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})},e.prototype.buildAuthorizeUrl=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,s,o,i,a,c,u,l,f,h,p;return Y(this,function(w){switch(w.label){case 0:return n=t.redirect_uri,r=t.appState,s=Tt(t,["redirect_uri","appState"]),o=Ln(me()),i=Ln(me()),a=me(),[4,yo(a)];case 1:return c=w.sent(),u=bo(c),l=t.fragment?"#".concat(t.fragment):"",f=this._getParams(s,o,i,u,n),h=this._authorizeUrl(f),p=t.organization||this.options.organization,this.transactionManager.create(N({nonce:i,code_verifier:a,appState:r,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:o},p&&{organizationId:p})),[2,h+l]}})})},e.prototype.loginWithPopup=function(t,n){return $(this,void 0,void 0,function(){var r,s,o,i,a,c,u,l,f,h,p,w,_;return Y(this,function(b){switch(b.label){case 0:if(t=t||{},!(n=n||{}).popup&&(n.popup=function(g){var v=window.screenX+(window.innerWidth-400)/2,I=window.screenY+(window.innerHeight-600)/2;return window.open(g,"auth0:authorize:popup","left=".concat(v,",top=").concat(I,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))}(""),!n.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");return r=Tt(t,[]),s=Ln(me()),o=Ln(me()),i=me(),[4,yo(i)];case 1:return a=b.sent(),c=bo(a),u=this._getParams(r,s,o,c,this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(N(N({},u),{response_mode:"web_message"})),n.popup.location.href=l,[4,r_(N(N({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(f=b.sent(),s!==f.state)throw new Error("Invalid state");return[4,Ii({audience:u.audience,scope:u.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:i,code:f.code,grant_type:"authorization_code",redirect_uri:u.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},this.worker)];case 3:return h=b.sent(),p=t.organization||this.options.organization,[4,this._verifyIdToken(h.id_token,o,p)];case 4:return w=b.sent(),_=N(N({},h),{decodedToken:w,scope:u.scope,audience:u.audience||"default",client_id:this.options.client_id}),[4,this.cacheManager.set(_)];case 5:return b.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(w.claims.org_id),[2]}})})},e.prototype.getUser=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,s;return Y(this,function(o){switch(o.label){case 0:return n=t.audience||this.options.audience||"default",r=Me(this.defaultScope,this.scope,t.scope),[4,this.cacheManager.get(new on({client_id:this.options.client_id,audience:n,scope:r}))];case 1:return[2,(s=o.sent())&&s.decodedToken&&s.decodedToken.user]}})})},e.prototype.getIdTokenClaims=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,s;return Y(this,function(o){switch(o.label){case 0:return n=t.audience||this.options.audience||"default",r=Me(this.defaultScope,this.scope,t.scope),[4,this.cacheManager.get(new on({client_id:this.options.client_id,audience:n,scope:r}))];case 1:return[2,(s=o.sent())&&s.decodedToken&&s.decodedToken.claims]}})})},e.prototype.loginWithRedirect=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,s;return Y(this,function(o){switch(o.label){case 0:return n=t.redirectMethod,r=Tt(t,["redirectMethod"]),[4,this.buildAuthorizeUrl(r)];case 1:return s=o.sent(),window.location[n||"assign"](s),[2]}})})},e.prototype.handleRedirectCallback=function(t){return t===void 0&&(t=window.location.href),$(this,void 0,void 0,function(){var n,r,s,o,i,a,c,u,l,f;return Y(this,function(h){switch(h.label){case 0:if((n=t.split("?").slice(1)).length===0)throw new Error("There are no query params available for parsing.");if(r=function(p){p.indexOf("#")>-1&&(p=p.substr(0,p.indexOf("#")));var w=p.split("&"),_={};return w.forEach(function(b){var g=nr(b.split("="),2),v=g[0],I=g[1];_[v]=decodeURIComponent(I)}),_.expires_in&&(_.expires_in=parseInt(_.expires_in)),_}(n.join("")),s=r.state,o=r.code,i=r.error,a=r.error_description,!(c=this.transactionManager.get()))throw new Error("Invalid state");if(this.transactionManager.remove(),i)throw new qw(i,a,s,c.appState);if(!c.code_verifier||c.state&&c.state!==s)throw new Error("Invalid state");return u={audience:c.audience,scope:c.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:c.code_verifier,grant_type:"authorization_code",code:o,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},c.redirect_uri!==void 0&&(u.redirect_uri=c.redirect_uri),[4,Ii(u,this.worker)];case 1:return l=h.sent(),[4,this._verifyIdToken(l.id_token,c.nonce,c.organizationId)];case 2:return f=h.sent(),[4,this.cacheManager.set(N(N(N(N({},l),{decodedToken:f,audience:c.audience,scope:c.scope}),l.scope?{oauthTokenScope:l.scope}:null),{client_id:this.options.client_id}))];case 3:return h.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(f.claims.org_id),[2,{appState:c.appState}]}})})},e.prototype.checkSession=function(t){return $(this,void 0,void 0,function(){var n;return Y(this,function(r){switch(r.label){case 0:if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return[2];this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.getTokenSilently(t)];case 2:return r.sent(),[3,4];case 3:if(n=r.sent(),!Xw.includes(n.error))throw n;return[3,4];case 4:return[2]}})})},e.prototype.getTokenSilently=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,s,o=this;return Y(this,function(i){return n=N(N({audience:this.options.audience,ignoreCache:!1},t),{scope:Me(this.defaultScope,this.scope,t.scope)}),r=n.ignoreCache,s=Tt(n,["ignoreCache"]),[2,(a=function(){return o._getTokenSilently(N({ignoreCache:r},s))},c="".concat(this.options.client_id,"::").concat(s.audience,"::").concat(s.scope),u=go[c],u||(u=a().finally(function(){delete go[c],u=null}),go[c]=u),u)];var a,c,u})})},e.prototype._getTokenSilently=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,s,o,i,a,c,u,l;return Y(this,function(f){switch(f.label){case 0:return n=t.ignoreCache,r=Tt(t,["ignoreCache"]),n?[3,2]:[4,this._getEntryFromCache({scope:r.scope,audience:r.audience||"default",client_id:this.options.client_id,getDetailedEntry:t.detailedResponse})];case 1:if(s=f.sent())return[2,s];f.label=2;case 2:return[4,(h=function(){return vo.acquireLock("auth0.lock.getTokenSilently",5e3)},p=10,p===void 0&&(p=3),$(void 0,void 0,void 0,function(){var w;return Y(this,function(_){switch(_.label){case 0:w=0,_.label=1;case 1:return w<p?[4,h()]:[3,4];case 2:if(_.sent())return[2,!0];_.label=3;case 3:return w++,[3,1];case 4:return[2,!1]}})}))];case 3:if(!f.sent())return[3,15];f.label=4;case 4:return f.trys.push([4,,12,14]),window.addEventListener("pagehide",this._releaseLockOnPageHide),n?[3,6]:[4,this._getEntryFromCache({scope:r.scope,audience:r.audience||"default",client_id:this.options.client_id,getDetailedEntry:t.detailedResponse})];case 5:if(s=f.sent())return[2,s];f.label=6;case 6:return this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(r)]:[3,8];case 7:return i=f.sent(),[3,10];case 8:return[4,this._getTokenFromIFrame(r)];case 9:i=f.sent(),f.label=10;case 10:return o=i,[4,this.cacheManager.set(N({client_id:this.options.client_id},o))];case 11:return f.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),t.detailedResponse?(a=o.id_token,c=o.access_token,u=o.oauthTokenScope,l=o.expires_in,[2,N(N({id_token:a,access_token:c},u?{scope:u}:null),{expires_in:l})]):[2,o.access_token];case 12:return[4,vo.releaseLock("auth0.lock.getTokenSilently")];case 13:return f.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[7];case 14:return[3,16];case 15:throw new Xo;case 16:return[2]}var h,p})})},e.prototype.getTokenWithPopup=function(t,n){return t===void 0&&(t={}),n===void 0&&(n={}),$(this,void 0,void 0,function(){return Y(this,function(r){switch(r.label){case 0:return t.audience=t.audience||this.options.audience,t.scope=Me(this.defaultScope,this.scope,t.scope),n=N(N({},Jw),n),[4,this.loginWithPopup(t,n)];case 1:return r.sent(),[4,this.cacheManager.get(new on({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id}))];case 2:return[2,r.sent().access_token]}})})},e.prototype.isAuthenticated=function(){return $(this,void 0,void 0,function(){return Y(this,function(t){switch(t.label){case 0:return[4,this.getUser()];case 1:return[2,!!t.sent()]}})})},e.prototype.buildLogoutUrl=function(t){t===void 0&&(t={}),t.client_id!==null?t.client_id=t.client_id||this.options.client_id:delete t.client_id;var n=t.federated,r=Tt(t,["federated"]),s=n?"&federated":"";return this._url("/v2/logout?".concat(qo(r)))+s},e.prototype.logout=function(t){var n=this;t===void 0&&(t={});var r=t.localOnly,s=Tt(t,["localOnly"]);if(r&&s.federated)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");var o=function(){if(n.cookieStorage.remove(n.orgHintCookieName,{cookieDomain:n.options.cookieDomain}),n.cookieStorage.remove(n.isAuthenticatedCookieName,{cookieDomain:n.options.cookieDomain}),!r){var i=n.buildLogoutUrl(s);window.location.assign(i)}};if(this.options.cache)return this.cacheManager.clear().then(function(){return o()});this.cacheManager.clearSync(),o()},e.prototype._getTokenFromIFrame=function(t){return $(this,void 0,void 0,function(){var n,r,s,o,i,a,c,u,l,f,h,p,w,_,b,g,v;return Y(this,function(I){switch(I.label){case 0:return n=Ln(me()),r=Ln(me()),s=me(),[4,yo(s)];case 1:o=I.sent(),i=bo(o),a=Tt(t,["detailedResponse"]),c=this._getParams(a,n,r,i,t.redirect_uri||this.options.redirect_uri||window.location.origin),(u=this.cookieStorage.get(this.orgHintCookieName))&&!c.organization&&(c.organization=u),l=this._authorizeUrl(N(N({},c),{prompt:"none",response_mode:"web_message"})),I.label=2;case 2:if(I.trys.push([2,6,,7]),window.crossOriginIsolated)throw new Fe("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");return f=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(it=l,yt=this.domainUrl,Dt=f,Dt===void 0&&(Dt=60),new Promise(function(be,Ic){var Qe=window.document.createElement("iframe");Qe.setAttribute("width","0"),Qe.setAttribute("height","0"),Qe.style.display="none";var ui,Tc=function(){window.document.body.contains(Qe)&&(window.document.body.removeChild(Qe),window.removeEventListener("message",ui,!1))},Bd=setTimeout(function(){Ic(new Xo),Tc()},1e3*Dt);ui=function(tn){if(tn.origin==yt&&tn.data&&tn.data.type==="authorization_response"){var Ac=tn.source;Ac&&Ac.close(),tn.data.response.error?Ic(Fe.fromPayload(tn.data.response)):be(tn.data.response),clearTimeout(Bd),window.removeEventListener("message",ui,!1),setTimeout(Tc,2e3)}},window.addEventListener("message",ui,!1),window.document.body.appendChild(Qe),Qe.setAttribute("src",it)}))];case 3:if(h=I.sent(),n!==h.state)throw new Error("Invalid state");return p=t.scope,w=t.audience,_=Tt(t,["scope","audience","redirect_uri","ignoreCache","timeoutInSeconds","detailedResponse"]),[4,Ii(N(N(N({},this.customOptions),_),{scope:p,audience:w,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:s,code:h.code,grant_type:"authorization_code",redirect_uri:c.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:_.timeout||this.httpTimeoutMs}),this.worker)];case 4:return b=I.sent(),[4,this._verifyIdToken(b.id_token,r)];case 5:return g=I.sent(),this._processOrgIdHint(g.claims.org_id),[2,N(N({},b),{decodedToken:g,scope:c.scope,oauthTokenScope:b.scope,audience:c.audience||"default"})];case 6:throw(v=I.sent()).error==="login_required"&&this.logout({localOnly:!0}),v;case 7:return[2]}var it,yt,Dt})})},e.prototype._getTokenUsingRefreshToken=function(t){return $(this,void 0,void 0,function(){var n,r,s,o,i,a,c,u,l;return Y(this,function(f){switch(f.label){case 0:return t.scope=Me(this.defaultScope,this.options.scope,t.scope),[4,this.cacheManager.get(new on({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id}))];case 1:return(n=f.sent())&&n.refresh_token||this.worker?[3,4]:this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(t)]:[3,3];case 2:return[2,f.sent()];case 3:throw new n_(t.audience||"default",t.scope);case 4:r=t.redirect_uri||this.options.redirect_uri||window.location.origin,o=t.scope,i=t.audience,a=Tt(t,["scope","audience","ignoreCache","timeoutInSeconds","detailedResponse"]),c=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,f.label=5;case 5:return f.trys.push([5,7,,10]),[4,Ii(N(N(N(N(N({},this.customOptions),a),{audience:i,scope:o,baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:r}),c&&{timeout:c}),{auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs}),this.worker)];case 6:return s=f.sent(),[3,10];case 7:return((u=f.sent()).message.indexOf("Missing Refresh Token")>-1||u.message&&u.message.indexOf("invalid refresh token")>-1)&&this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(t)]:[3,9];case 8:return[2,f.sent()];case 9:throw u;case 10:return[4,this._verifyIdToken(s.id_token)];case 11:return l=f.sent(),[2,N(N({},s),{decodedToken:l,scope:t.scope,oauthTokenScope:s.scope,audience:t.audience||"default"})]}})})},e.prototype._getEntryFromCache=function(t){var n=t.scope,r=t.audience,s=t.client_id,o=t.getDetailedEntry,i=o!==void 0&&o;return $(this,void 0,void 0,function(){var a,c,u,l,f;return Y(this,function(h){switch(h.label){case 0:return[4,this.cacheManager.get(new on({scope:n,audience:r,client_id:s}),60)];case 1:return(a=h.sent())&&a.access_token?i?(c=a.id_token,u=a.access_token,l=a.oauthTokenScope,f=a.expires_in,[2,N(N({id_token:c,access_token:u},l?{scope:l}:null),{expires_in:f})]):[2,a.access_token]:[2]}})})},e}();function A_(e){return $(this,void 0,void 0,function(){var t;return Y(this,function(n){switch(n.label){case 0:return[4,(t=new T_(e)).checkSession()];case 1:return n.sent(),[2,t]}})})}var B_={exports:{}};/*!
 * Toastify js 1.12.0
 * https://github.com/apvarun/toastify-js
 * @license MIT licensed
 *
 * Copyright (C) 2018 Varun A P
 */(function(e){(function(t,n){e.exports?e.exports=n():t.Toastify=n()})(Od,function(t){var n=function(i){return new n.lib.init(i)},r="1.12.0";n.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},n.lib=n.prototype={toastify:r,constructor:n,init:function(i){return i||(i={}),this.options={},this.toastElement=null,this.options.text=i.text||n.defaults.text,this.options.node=i.node||n.defaults.node,this.options.duration=i.duration===0?0:i.duration||n.defaults.duration,this.options.selector=i.selector||n.defaults.selector,this.options.callback=i.callback||n.defaults.callback,this.options.destination=i.destination||n.defaults.destination,this.options.newWindow=i.newWindow||n.defaults.newWindow,this.options.close=i.close||n.defaults.close,this.options.gravity=i.gravity==="bottom"?"toastify-bottom":n.defaults.gravity,this.options.positionLeft=i.positionLeft||n.defaults.positionLeft,this.options.position=i.position||n.defaults.position,this.options.backgroundColor=i.backgroundColor||n.defaults.backgroundColor,this.options.avatar=i.avatar||n.defaults.avatar,this.options.className=i.className||n.defaults.className,this.options.stopOnFocus=i.stopOnFocus===void 0?n.defaults.stopOnFocus:i.stopOnFocus,this.options.onClick=i.onClick||n.defaults.onClick,this.options.offset=i.offset||n.defaults.offset,this.options.escapeMarkup=i.escapeMarkup!==void 0?i.escapeMarkup:n.defaults.escapeMarkup,this.options.ariaLive=i.ariaLive||n.defaults.ariaLive,this.options.style=i.style||n.defaults.style,i.backgroundColor&&(this.options.style.background=i.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var i=document.createElement("div");i.className="toastify on "+this.options.className,this.options.position?i.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(i.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):i.className+=" toastify-right",i.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var a in this.options.style)i.style[a]=this.options.style[a];if(this.options.ariaLive&&i.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)i.appendChild(this.options.node);else if(this.options.escapeMarkup?i.innerText=this.options.text:i.innerHTML=this.options.text,this.options.avatar!==""){var c=document.createElement("img");c.src=this.options.avatar,c.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?i.appendChild(c):i.insertAdjacentElement("afterbegin",c)}if(this.options.close===!0){var u=document.createElement("button");u.type="button",u.setAttribute("aria-label","Close"),u.className="toast-close",u.innerHTML="&#10006;",u.addEventListener("click",function(b){b.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var l=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&l>360?i.insertAdjacentElement("afterbegin",u):i.appendChild(u)}if(this.options.stopOnFocus&&this.options.duration>0){var f=this;i.addEventListener("mouseover",function(b){window.clearTimeout(i.timeOutValue)}),i.addEventListener("mouseleave",function(){i.timeOutValue=window.setTimeout(function(){f.removeElement(i)},f.options.duration)})}if(typeof this.options.destination<"u"&&i.addEventListener("click",function(b){b.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),typeof this.options.onClick=="function"&&typeof this.options.destination>"u"&&i.addEventListener("click",function(b){b.stopPropagation(),this.options.onClick()}.bind(this)),typeof this.options.offset=="object"){var h=s("x",this.options),p=s("y",this.options),w=this.options.position=="left"?h:"-"+h,_=this.options.gravity=="toastify-top"?p:"-"+p;i.style.transform="translate("+w+","+_+")"}return i},showToast:function(){this.toastElement=this.buildToast();var i;if(typeof this.options.selector=="string"?i=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<"u"&&this.options.selector instanceof ShadowRoot?i=this.options.selector:i=document.body,!i)throw"Root element is not defined";var a=n.defaults.oldestFirst?i.firstChild:i.lastChild;return i.insertBefore(this.toastElement,a),n.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(i){i.className=i.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),i.parentNode&&i.parentNode.removeChild(i),this.options.callback.call(i),n.reposition()}.bind(this),400)}},n.reposition=function(){for(var i={top:15,bottom:15},a={top:15,bottom:15},c={top:15,bottom:15},u=document.getElementsByClassName("toastify"),l,f=0;f<u.length;f++){o(u[f],"toastify-top")===!0?l="toastify-top":l="toastify-bottom";var h=u[f].offsetHeight;l=l.substr(9,l.length-1);var p=15,w=window.innerWidth>0?window.innerWidth:screen.width;w<=360?(u[f].style[l]=c[l]+"px",c[l]+=h+p):o(u[f],"toastify-left")===!0?(u[f].style[l]=i[l]+"px",i[l]+=h+p):(u[f].style[l]=a[l]+"px",a[l]+=h+p)}return this};function s(i,a){return a.offset[i]?isNaN(a.offset[i])?a.offset[i]:a.offset[i]+"px":"0px"}function o(i,a){return!i||typeof a!="string"?!1:!!(i.className&&i.className.trim().split(/\s+/gi).indexOf(a)>-1)}return n.lib.init.prototype=n.lib,n})})(B_);const zr=document.body.appendChild(document.createElement("div")),Id=document.createElement("button"),$n=zr.appendChild(Id);$n.className="log";$n.textContent="Login";const Sc=document.createElement("p");Sc.textContent="Access denied. Please try again later.";Sc.className="denied";zr.style="display: flex; flex-direction: column; color: rgb(104, 85, 224); font-weight: 600; margin: 0; padding: 10px;";const O_=zr.appendChild(document.createTextNode(""));let Td,Un,vr;const Ad=async()=>{$n.textContent="working...",console.log("Callback urls set to: ",fl()),vr=await A_({domain:Un,client_id:Td,redirect_uri:fl(),audience:`https://${Un}/api/v2/`,useRefreshTokens:!0,cacheLocation:"localstorage"});try{await vr.loginWithPopup(),O_.textContent=""}catch(r){console.log(r),zr.appendChild(Sc),$n.remove();return}const e=await vr.getUser();console.log(e),console.log({audience:`https://${Un}/api/v2/`,scope:"read:current_user"});let t=!1;try{t=await vr.getTokenSilently({audience:`https://${Un}/api/v2/`})}catch(r){r.error==="consent_required"||r.error==="login_required"?(console.log("asking user for permission to their profile"),t=await vr.getTokenWithPopup({audience:`https://${Un}/api/v2/`,scope:"read:current_user"}),console.log(t)):console.log(r)}let n=JSON.parse(JSON.stringify(e));n.token=t,console.log(n),bn.setComponentValue(n),$n.removeEventListener("click",Ad),zr.removeChild(Id)};$n.onclick=Ad;function F_(e){const t=e.detail;Td=t.args.client_id,Un=t.args.domain,bn.setFrameHeight()}bn.events.addEventListener(bn.RENDER_EVENT,F_);bn.setComponentReady();const fl=()=>{if(window.parent!==window){const e=new URL(document.location.href),t=e.origin,n=decodeURIComponent(e.pathname);return t+n}else return window.location.origin};
