@loaders.gl/splats 5.0.0-alpha.8 → 5.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/ksplat-loader-types.js +1 -1
- package/dist/rad-loader-types.js +1 -1
- package/dist/rad-source-loader.js +1 -1
- package/dist/splat-loader-types.js +1 -1
- package/dist/spz-loader-types.js +1 -1
- package/package.json +5 -5
package/dist/dist.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
6
|
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var JB=Object.create;var qu=Object.defineProperty;var GB=Object.getOwnPropertyDescriptor;var HB=Object.getOwnPropertyNames;var KB=Object.getPrototypeOf,YB=Object.prototype.hasOwnProperty;var m=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var XB=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ie=(t,e)=>{for(var r in e)qu(t,r,{get:e[r],enumerable:!0})},Xu=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of HB(e))!YB.call(t,n)&&n!==r&&qu(t,n,{get:()=>e[n],enumerable:!(i=GB(e,n))||i.enumerable});return t},Qu=(t,e,r)=>(Xu(t,e,"default"),r&&Xu(r,e,"default")),qB=(t,e,r)=>(r=t!=null?JB(KB(t)):{},Xu(e||!t||!t.__esModule?qu(r,"default",{value:t,enumerable:!0}):r,t)),QB=t=>Xu(qu({},"__esModule",{value:!0}),t);var q$=XB((AF,X$)=>{X$.exports=globalThis.loaders});var el,tl,rl,Po,$i=m(()=>{"use strict";el={name:"SPLAT",id:"splat",module:"splats",format:"splat",extensions:["splat"],mimeTypes:["application/octet-stream"],binary:!0},tl={name:"KSPLAT",id:"ksplat",module:"splats",format:"ksplat",extensions:["ksplat"],mimeTypes:["application/octet-stream"],binary:!0},rl={name:"SPZ",id:"spz",module:"splats",format:"spz",extensions:["spz"],mimeTypes:["application/octet-stream"],binary:!0,tests:[new Uint8Array([78,71,83,80]).buffer]},Po={name:"RAD",id:"rad",module:"splats",format:"rad",extensions:["rad"],mimeTypes:["application/octet-stream"],binary:!0,tests:[new Uint8Array([82,65,68,48]).buffer]}});var nl,eT,il,tT,OF,Q$=m(()=>{nl=globalThis,eT=globalThis.document||{},il=globalThis.process||{},tT=globalThis.console,OF=globalThis.navigator||{}});function ex(t){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;let e=typeof navigator<"u"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}var tx=m(()=>{});function xi(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||ex()}var rx=m(()=>{tx()});var Am,ol=m(()=>{Q$();rx();Am="4.1.1"});function Lo(t,e){if(!t)throw new Error(e||"Assertion failed")}var zm=m(()=>{});function Om(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Lo(Number.isFinite(e)&&e>=0),e}function nx(t){let{logLevel:e,message:r}=t;t.logLevel=Om(e);let i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&i.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let n=typeof t.message;return Lo(n==="string"||n==="object"),Object.assign(t,{args:i},t.opts)}var ix=m(()=>{zm()});var Ii,al,ox=m(()=>{ix();Ii=()=>{},al=class{constructor({level:e=0}={}){this.userData={},this._onceCache=new Set,this._level=e}set level(e){this.setLevel(e)}get level(){return this.getLevel()}setLevel(e){return this._level=e,this}getLevel(){return this._level}warn(e,...r){return this._log("warn",0,e,r,{once:!0})}error(e,...r){return this._log("error",0,e,r)}log(e,r,...i){return this._log("log",e,r,i)}info(e,r,...i){return this._log("info",e,r,i)}once(e,r,...i){return this._log("once",e,r,i,{once:!0})}_log(e,r,i,n,o={}){let a=nx({logLevel:r,message:i,args:this._buildArgs(r,i,n),opts:o});return this._createLogFunction(e,a,o)}_buildArgs(e,r,i){return[e,r,...i]}_createLogFunction(e,r,i){if(!this._shouldLog(r.logLevel))return Ii;let n=this._getOnceTag(i.tag??r.tag??r.message);if((i.once||r.once)&&n!==void 0){if(this._onceCache.has(n))return Ii;this._onceCache.add(n)}return this._emit(e,r)}_shouldLog(e){return this.getLevel()>=Om(e)}_getOnceTag(e){if(e!==void 0)try{return typeof e=="string"?e:String(e)}catch{return}}}});function nT(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var sl,ax=m(()=>{sl=class{constructor(e,r,i="sessionStorage"){this.storage=nT(i),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}}});function sx(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function cx(t,e=8){let r=Math.max(e-t.length,0);return`${" ".repeat(r)}${t}`}var ux=m(()=>{});function lx(t){return typeof t!="string"?t:(t=t.toUpperCase(),cl[t]||cl.WHITE)}function dx(t,e,r){return!xi&&typeof t=="string"&&(e&&(t=`\x1B[${lx(e)}m${t}\x1B[39m`),r&&(t=`\x1B[${lx(r)+iT}m${t}\x1B[49m`)),t}var cl,iT,fx=m(()=>{ol();(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(cl||(cl={}));iT=10});function px(t,e=["constructor"]){let r=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(r),n=t;for(let o of i){let a=n[o];typeof a=="function"&&(e.find(s=>o===s)||(n[o]=a.bind(t)))}}var mx=m(()=>{});function Eo(){let t;if(xi()&&nl.performance)t=nl?.performance?.now?.();else if("hrtime"in il){let e=il?.hrtime?.();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var hx=m(()=>{ol()});function oT(t,e,r){if(typeof e=="string"){let i=r.time?cx(sx(r.total)):"";e=r.time?`${t}: ${i} ${e}`:`${t}: ${e}`,e=dx(e,r.color,r.background)}return e}function aT(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var Co,Bm,mn,Tm=m(()=>{ol();ox();ax();ux();fx();mx();zm();hx();Co={debug:xi()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Bm={enabled:!0,level:0},mn=class extends al{constructor({id:e}={id:""}){super({level:0}),this.VERSION=Am,this._startTs=Eo(),this._deltaTs=Eo(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new sl(`__probe-${this.id}__`,{[this.id]:Bm}),this.timeStamp(`${this.id} started`),px(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((Eo()-this._startTs).toPrecision(10))}getDelta(){return Number((Eo()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._updateConfiguration({enabled:e}),this}setLevel(e){return this._updateConfiguration({level:e}),this}get(e){return this._getConfiguration()[e]}set(e,r){this._updateConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){if(!e)throw new Error(r||"Assertion failed")}warn(e,...r){return this._log("warn",0,e,r,{method:Co.warn,once:!0})}error(e,...r){return this._log("error",0,e,r,{method:Co.error})}deprecated(e,r){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(e,r){return this.error(`\`${e}\` has been removed. Use \`${r}\` instead`)}probe(e,r,...i){return this._log("log",e,r,i,{method:Co.log,time:!0,once:!0})}log(e,r,...i){return this._log("log",e,r,i,{method:Co.debug})}info(e,r,...i){return this._log("info",e,r,i,{method:console.info})}once(e,r,...i){return this._log("once",e,r,i,{method:Co.debug||Co.info,once:!0})}table(e,r,i){return r?this._log("table",e,r,i&&[i]||[],{method:console.table||Ii,tag:aT(r)}):Ii}time(e,r){return this._log("time",e,r,[],{method:console.time?console.time:console.info})}timeEnd(e,r){return this._log("time",e,r,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(e,r){return this._log("time",e,r,[],{method:console.timeStamp||Ii})}group(e,r,i={collapsed:!1}){let n=(i.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",e,r,[],{method:n})}groupCollapsed(e,r,i={}){return this.group(e,r,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._log("groupEnd",e,"",[],{method:console.groupEnd||Ii})}withGroup(e,r,i){this.group(e,r)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&super._shouldLog(e)}_emit(e,r){let i=r.method;Lo(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Eo();let n=oT(this.id,r.message,r);return i.bind(console,n,...r.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(Bm),this._storage.config[this.id]}_updateConfiguration(e){let r=this._storage.config[this.id]||{...Bm};this._storage.setConfiguration({[this.id]:{...r,...e}})}};mn.VERSION=Am});var gx=m(()=>{globalThis.probe={}});var aj,yx=m(()=>{Tm();Tm();gx();aj=new mn({id:"@probe.gl/log"})});function cT(){let t=new mn({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=t,globalThis.loaders.version=sT,globalThis.probe||={},globalThis.probe.loaders=t,t}var Nm,sT,vx,bx=m(()=>{"use strict";yx();Nm="5.0.0-alpha.8",sT=Nm[0]>="0"&&Nm[0]<="9"?`v${Nm}`:"";vx=cT()});var uT,_x,wx,Um=m(()=>{"use strict";uT=t=>t!==null&&typeof t=="object",_x=t=>uT(t)&&t.constructor==={}.constructor,wx=t=>typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer});function ul(t,e){return $x(t||{},e)}function $x(t,e,r=0){if(r>3)return e;let i={...t};for(let[n,o]of Object.entries(e))_x(o)?i[n]=$x(i[n]||{},e[n],r+1):i[n]=e[n];return i}var xx=m(()=>{"use strict";Um()});function hn(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function ll(t,e){let r=globalThis.loaders?.modules?.[t];if(!r)throw new Error(`${e}: ${t} library not installed`);return r}function gr(t){return globalThis.loaders?.modules?.[t]||null}var Pm=m(()=>{"use strict"});function Ix(...t){return lT(t)}function lT(t){let e=t.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=e.reduce((o,a)=>o+a.byteLength,0),i=new Uint8Array(r),n=0;for(let o of e)i.set(o,n),n+=o.byteLength;return i.buffer}var Sx=m(()=>{"use strict"});async function Lm(t){let e=[];for await(let r of t)e.push(dT(r));return Ix(...e)}function dT(t){if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)){let{buffer:e,byteOffset:r,byteLength:i}=t;return kx(e,r,i)}return kx(t)}function kx(t,e=0,r=t.byteLength-e){let i=new Uint8Array(t,e,r),n=new Uint8Array(i.length);return n.set(i),n.buffer}var Dx=m(()=>{"use strict";Sx()});function Cm(t,e=[]){return t.every(Em)?t:t.map((r,i)=>{if(Em(r))return r;let n=e.find(a=>a.type===r?.type);if(!n)throw new Error(`No authentication class registered for credential at index ${i}.`);let o;try{o=new n(r)}catch{throw new Error(`Invalid authentication configuration at index ${i}.`)}if(!Em(o))throw new Error(`Authentication class returned an invalid credential at index ${i}.`);return o})}function Fm(t){if(!t.core?.credentials?.length)return t;let e=Cm(t.core.credentials,t.core.authentications);return e===t.core.credentials?t:{...t,core:{...t.core,credentials:e}}}function Em(t){return!t||typeof t!="object"||typeof t.id!="string"||!Array.isArray(t.origins)?!1:t.type==="request"?typeof t.authenticate=="function":(t.type==="header"||t.type==="query-parameter")&&typeof t.name=="string"&&(typeof t.token=="string"||typeof t.token=="function")&&Array.isArray(t.refreshStatusCodes)}var jm=m(()=>{"use strict"});function fT(t){let e=t.fetch||((d,f)=>fetch(d,f)),r=e[Ax],i=new Map(r?.credentialResolutions),n=Cm(t.credentials.map(d=>i.get(d)||d),t.authentications);if(t.credentials.forEach((d,f)=>{i.set(d,n[f])}),!t.fetchOptions&&(!n.length||r?.credentials.length===n.length&&n.every((d,f)=>d===r.credentials[f])))return e;let o=r?.fetch||e,a=r?[...new Set([...n,...r.credentials])]:n,s=zx(r?.fetchOptions||{},t.fetchOptions),c=a.filter(d=>d.type!=="request"),u=a.filter(d=>d.type==="request");for(let d of u)Px(d.origins);let l=async(d,f={})=>{if(f=zx(s,f),f.signal?.aborted)throw vs();if(!a.length)return o(d,f);let p=hT(d),h=p?await Bx(p,f,c):{url:d,options:f,credentials:[]},y=await Ox(h,u,"request"),_=await o(y.url,y.options),D=h.credentials.filter(({credential:k})=>typeof k.token=="function"&&k.refreshStatusCodes.includes(_.status)),I=y.credentials.some(k=>k.refreshStatusCodes?.includes(_.status));if(!D.length&&!I||!Tx(f)||!Tx(y.options))return _;if(f.signal?.aborted)throw vs();let A=new Map;if(await Promise.all(D.map(async({credential:k})=>{let le=await pT(k,d,_);le&&A.set(k,le)})),!A.size&&!I)return _;if(await _.body?.cancel().catch(()=>{}),f.signal?.aborted)throw vs();let Z=p?await Bx(p,f,c,A,h.credentials):{url:d,options:f},L=await Ox(Z,u,"retry",_);return o(L.url,L.options)};return Object.defineProperty(l,Ax,{value:{fetch:o,credentials:a,credentialResolutions:i,fetchOptions:s}}),l}function Nx(t={}){let e=t.fetch??t.core?.fetch,r;return typeof e=="function"?r=e:r=(i,n)=>fetch(i,n),fT({fetch:r,fetchOptions:typeof e=="object"&&e?e:void 0,credentials:t.core?.credentials||[],authentications:t.core?.authentications})}function zx(t,e){let r={...t,...e};if(t.headers||e?.headers){let i=new Headers(t.headers);new Headers(e?.headers).forEach((n,o)=>i.set(o,n)),r.headers=i}return r}async function Ox(t,e,r,i){let n=[],o=t.options.signal;for(let a of e){let s=Ux(t.url);if(!s||!Px(a.origins).includes(s))continue;if(o?.aborted)throw vs();let c=await a.authenticate({url:t.url,options:{...t.options,headers:new Headers(t.options.headers)},reason:r,response:i?{status:i.status,headers:new Headers(i.headers)}:void 0});if(!c||typeof c.url!="string"||!c.options||typeof c.options!="object")throw new Error("Authentication callback returned an invalid request.");t={url:c.url,options:{...c.options,...o?{signal:o}:{}}},n.push(a)}if(o?.aborted)throw vs();return{...t,credentials:n}}function Ux(t){try{let e=new URL(t);return!e.host||e.username||e.password?null:e.origin!=="null"?e.origin:`${e.protocol}//${e.host}`}catch{return null}}function Px(t){if(!t.length)throw new Error("Request authentication requires at least one exact origin.");return t.map(e=>{let r=Ux(e),i;try{i=new URL(e)}catch{throw new Error("Invalid request authentication origin.")}if(!r||i.pathname&&i.pathname!=="/"||i.search||i.hash)throw new Error("Invalid request authentication origin.");return r})}async function Bx(t,e,r,i=new Map,n=[]){let o=new URL(t),a=new Headers(e.headers),s=[],c=new Map(n.map(({credential:u,token:l})=>[u,l]));for(let u of r){if(!u.origins.includes(o.origin))continue;let l=i.get(u),d=c.get(u),f=u.type==="query-parameter"&&d!==void 0,p=u.type==="header"&&d!==void 0;if(u.type==="query-parameter"&&o.searchParams.has(u.name)&&!f||u.type==="header"&&a.has(u.name)&&!p)continue;let h=l??d??await mT(u.token,{url:t.toString(),reason:"request"});h&&(u.type==="query-parameter"?o.searchParams.set(u.name,h):a.set(u.name,`${u.prefix||""}${h}`),s.push({credential:u,token:h}))}return{url:o.toString(),options:{...e,headers:a},credentials:s}}async function pT(t,e,r){let i=Mm.get(t);if(i)return i;let n=t.token,o=Promise.resolve(n({url:e,reason:"refresh",response:{status:r.status,headers:r.headers}})).finally(()=>Mm.delete(t));return Mm.set(t,o),o}async function mT(t,e){return typeof t=="function"?t(e):t}function hT(t){try{let e=new URL(t);return["http:","https:"].includes(e.protocol)?e:null}catch{return null}}function Tx(t){let e=(t.method||"GET").toUpperCase();return["GET","HEAD","OPTIONS","PUT","DELETE"].includes(e)?!(t.body&&typeof ReadableStream<"u"&&t.body instanceof ReadableStream):!1}function vs(){return new DOMException("The operation was aborted.","AbortError")}var Ax,Mm,Lx=m(()=>{"use strict";jm();Ax=Symbol("loaders.gl.authenticated-fetch"),Mm=new WeakMap});function Cx(t){for(let e in Ex)if(t.startsWith(e)){let r=Ex[e];t=t.replace(e,r)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${gT}${t}`),t}var gT,Ex,Fx=m(()=>{"use strict";gT="",Ex={}});function dl(t){if(t instanceof ArrayBuffer)return t;if(wx(t))return Rm(t);let{buffer:e,byteOffset:r,byteLength:i}=t;return e instanceof ArrayBuffer&&r===0&&i===e.byteLength?e:Rm(e,r,i)}function Rm(t,e=0,r=t.byteLength-e){let i=new Uint8Array(t,e,r),n=new Uint8Array(i.length);return n.set(i),n.buffer}var jx=m(()=>{"use strict";Um()});function Mx(t){return Nx(t)}function Rx(t){if(t.loadOptions!==void 0||t.core?.loadOptions!==void 0)throw new Error("Source loadOptions and core.loadOptions were removed. Use core and root loader namespaces directly.");let e={...t};if(t?.core){e.core={...t.core};let n=e.core;for(let o of["type","attributions","loaders","onError","loadOptions"])delete n[o];Object.keys(n).length===0&&delete e.core}let r=typeof e.baseUri=="string"?e.baseUri:void 0,i=typeof e.baseUrl=="string"?e.baseUrl:void 0;return(r!==void 0||i!==void 0)&&(e.core||={},e.core.baseUrl===void 0&&(e.core.baseUrl=i??r),delete e.baseUri,delete e.baseUrl),e}function vT(t,e){return t instanceof Error?t:typeof t=="string"?new Error(t):new Error(e)}function Si(t){return()=>{throw new Error(`CoreAPI.${t} is unavailable. Use @loaders.gl/core.createDataSource().`)}}var yT,bs,Vx=m(()=>{"use strict";xx();Fx();bx();Lx();jm();yT={fetchFile:Si("fetchFile"),parse:Si("parse"),parseFile:Si("parseFile"),parseSync:Si("parseSync"),parseInBatches:Si("parseInBatches"),load:Si("load"),loadInBatches:Si("loadInBatches")},bs=class t{static defaultOptions={core:{type:"auto",attributions:[],loaders:[],onError:void 0}};optionsType;options;data;url;loadOptions;fetch;coreApi;hasCoreApi;_needsRefresh=!0;constructor(e,r,i,n){this.options=ul(ul(t.defaultOptions,i||{}),r),this.data=e,this.url=typeof e=="string"?Cx(e):"";let o=Fm(Rx(this.options));this.loadOptions=o;let a=Mx(o);this.coreApi=n||yT,this.hasCoreApi=!!n,this.fetch=a}setProps(e){let r=ul(this.options,e),i=Fm(Rx(r));this.options=r,this.loadOptions=i,this.fetch=Mx(i),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){let r=this._needsRefresh;return e&&(this._needsRefresh=!1),r}reportError(e,r){let i=vT(e,r),n=this.options.core?.onError;return n?n(i,this):vx.warn(`${this.constructor.name}: ${i.message}`)(),i}}});var Fo=m(()=>{"use strict";Pm();Pm();Dx();jx();Vx()});var fl,pl,nr,ml,ki=m(()=>{"use strict";Fo();fl=class{async preload(e={}){hn(e)}concatenate(e){return Lm(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}},pl=class extends fl{constructor(e){super(),this.compressBatches=this.compressBatches.bind(this)}async compress(e){return await this.preload(),this.compressSync(e)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}},nr=class extends fl{constructor(e){super(),this.decompressBatches=this.decompressBatches.bind(this)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}},ml=class extends pl{constructor(e){super(e),this.decompressBatches=this.decompressBatches.bind(this)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}}});function Qx(t,e){return gl(t,e)}function tI(t,e){return gl(t.subarray(qx(t),-8),e||new bt(DT(t)))}function nI(t,e){return gl((AT(t),t.subarray(2,-4)),e)}var bt,Di,Zx,Wx,Jx,bT,Gx,Hx,Kx,_T,Yx,wT,Jj,Wm,gn,ge,_s,ws,ge,ge,ge,ge,Xx,ge,$T,xT,Vm,yr,Zm,IT,hl,ST,vt,gl,kT,qx,DT,AT,Zn,eI,rI,zT,OT,Jm=m(()=>{bt=Uint8Array,Di=Uint16Array,Zx=Uint32Array,Wx=new bt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Jx=new bt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),bT=new bt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gx=function(t,e){for(var r=new Di(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];for(var n=new Zx(r[30]),i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},Hx=Gx(Wx,2),Kx=Hx[0],_T=Hx[1];Kx[28]=258,_T[258]=28;Yx=Gx(Jx,0),wT=Yx[0],Jj=Yx[1],Wm=new Di(32768);for(ge=0;ge<32768;++ge)gn=(ge&43690)>>>1|(ge&21845)<<1,gn=(gn&52428)>>>2|(gn&13107)<<2,gn=(gn&61680)>>>4|(gn&3855)<<4,Wm[ge]=((gn&65280)>>>8|(gn&255)<<8)>>>1;_s=(function(t,e,r){for(var i=t.length,n=0,o=new Di(e);n<i;++n)t[n]&&++o[t[n]-1];var a=new Di(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;var s;if(r){s=new Di(1<<e);var c=15-e;for(n=0;n<i;++n)if(t[n])for(var u=n<<4|t[n],l=e-t[n],d=a[t[n]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)s[Wm[d]>>>c]=u}else for(s=new Di(i),n=0;n<i;++n)t[n]&&(s[n]=Wm[a[t[n]-1]++]>>>15-t[n]);return s}),ws=new bt(288);for(ge=0;ge<144;++ge)ws[ge]=8;for(ge=144;ge<256;++ge)ws[ge]=9;for(ge=256;ge<280;++ge)ws[ge]=7;for(ge=280;ge<288;++ge)ws[ge]=8;Xx=new bt(32);for(ge=0;ge<32;++ge)Xx[ge]=5;$T=_s(ws,9,1),xT=_s(Xx,5,1),Vm=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},yr=function(t,e,r){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(e&7)&r},Zm=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},IT=function(t){return(t+7)/8|0},hl=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new(t.BYTES_PER_ELEMENT==2?Di:t.BYTES_PER_ELEMENT==4?Zx:bt)(r-e);return i.set(t.subarray(e,r)),i},ST=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],vt=function(t,e,r){var i=new Error(e||ST[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,vt),!r)throw i;return i},gl=function(t,e,r){var i=t.length;if(!i||r&&r.f&&!r.l)return e||new bt(0);var n=!e||r,o=!r||r.i;r||(r={}),e||(e=new bt(i*3));var a=function(hs){var Lr=e.length;if(hs>Lr){var Vn=new bt(Math.max(Lr*2,hs));Vn.set(e),e=Vn}},s=r.f||0,c=r.p||0,u=r.b||0,l=r.l,d=r.d,f=r.m,p=r.n,h=i*8;do{if(!l){s=yr(t,c,1);var y=yr(t,c+1,3);if(c+=3,y)if(y==1)l=$T,d=xT,f=9,p=5;else if(y==2){var A=yr(t,c,31)+257,Z=yr(t,c+10,15)+4,L=A+yr(t,c+5,31)+1;c+=14;for(var k=new bt(L),le=new bt(19),he=0;he<Z;++he)le[bT[he]]=yr(t,c+he*3,7);c+=Z*3;for(var ut=Vm(le),Ze=(1<<ut)-1,gt=_s(le,ut,1),he=0;he<L;){var yt=gt[yr(t,c,Ze)];c+=yt&15;var _=yt>>>4;if(_<16)k[he++]=_;else{var We=0,me=0;for(_==16?(me=3+yr(t,c,3),c+=2,We=k[he-1]):_==17?(me=3+yr(t,c,7),c+=3):_==18&&(me=11+yr(t,c,127),c+=7);me--;)k[he++]=We}}var ce=k.subarray(0,A),Ee=k.subarray(A);f=Vm(ce),p=Vm(Ee),l=_s(ce,f,1),d=_s(Ee,p,1)}else vt(1);else{var _=IT(c)+4,D=t[_-4]|t[_-3]<<8,I=_+D;if(I>i){o&&vt(0);break}n&&a(u+D),e.set(t.subarray(_,I),u),r.b=u+=D,r.p=c=I*8,r.f=s;continue}if(c>h){o&&vt(0);break}}n&&a(u+131072);for(var Bo=(1<<f)-1,To=(1<<p)-1,Rn=c;;Rn=c){var We=l[Zm(t,c)&Bo],Pr=We>>>4;if(c+=We&15,c>h){o&&vt(0);break}if(We||vt(2),Pr<256)e[u++]=Pr;else if(Pr==256){Rn=c,l=null;break}else{var ps=Pr-254;if(Pr>264){var he=Pr-257,pn=Wx[he];ps=yr(t,c,(1<<pn)-1)+Kx[he],c+=pn}var No=d[Zm(t,c)&To],Uo=No>>>4;No||vt(3),c+=No&15;var Ee=wT[Uo];if(Uo>3){var pn=Jx[Uo];Ee+=Zm(t,c)&(1<<pn)-1,c+=pn}if(c>h){o&&vt(0);break}n&&a(u+131072);for(var ms=u+ps;u<ms;u+=4)e[u]=e[u-Ee],e[u+1]=e[u+1-Ee],e[u+2]=e[u+2-Ee],e[u+3]=e[u+3-Ee];u=ms}}r.l=l,r.p=Rn,r.b=u,r.f=s,l&&(s=1,r.m=f,r.d=d,r.n=p)}while(!s);return u==e.length?e:hl(e,0,u)},kT=new bt(0),qx=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&vt(6,"invalid gzip data");var e=t[3],r=10;e&4&&(r+=t[10]|(t[11]<<8)+2);for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[r++]);return r+(e&2)},DT=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},AT=function(t){((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&vt(6,"invalid zlib data"),t[1]&32&&vt(6,"invalid zlib data: preset dictionaries not supported")},Zn=(function(){function t(e){this.s={},this.p=new bt(0),this.ondata=e}return t.prototype.e=function(e){this.ondata||vt(5),this.d&&vt(4);var r=this.p.length,i=new bt(r+e.length);i.set(this.p),i.set(e,r),this.p=i},t.prototype.c=function(e){this.d=this.s.i=e||!1;var r=this.s.b,i=gl(this.p,this.o,this.s);this.ondata(hl(i,r,this.s.b),this.d),this.o=hl(i,this.s.b-32768),this.s.b=this.o.length,this.p=hl(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,r){this.e(e),this.c(r)},t})();eI=(function(){function t(e){this.v=1,Zn.call(this,e)}return t.prototype.push=function(e,r){if(Zn.prototype.e.call(this,e),this.v){var i=this.p.length>3?qx(this.p):4;if(i>=this.p.length&&!r)return;this.p=this.p.subarray(i),this.v=0}r&&(this.p.length<8&&vt(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Zn.prototype.c.call(this,r)},t})();rI=(function(){function t(e){this.v=1,Zn.call(this,e)}return t.prototype.push=function(e,r){if(Zn.prototype.e.call(this,e),this.v){if(this.p.length<2&&!r)return;this.p=this.p.subarray(2),this.v=0}r&&(this.p.length<4&&vt(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Zn.prototype.c.call(this,r)},t})();zT=typeof TextDecoder<"u"&&new TextDecoder,OT=0;try{zT.decode(kT,{stream:!0}),OT=1}catch{}});async function iI(t,e){let r=BT([t],e);return r?await PT(r):null}function BT(t,e){let r=TT(e);return r?NT(t,r):null}function TT(t){if(typeof globalThis.CompressionStream>"u")return null;try{let e=globalThis.CompressionStream;return new e(t)}catch(e){if(e instanceof TypeError||e?.name==="TypeError")return null;throw e}}async function*NT(t,e){let r=e.writable.getWriter(),i=e.readable.getReader(),n=UT(t,r);n.catch(()=>{});let o=!1;try{for(;;){let{done:a,value:s}=await i.read();if(a){o=!0;break}yield new Uint8Array(s).buffer}await n}finally{o||(await i.cancel().catch(()=>{}),await r.abort().catch(()=>{}),await n.catch(()=>{})),i.releaseLock()}}async function UT(t,e){try{for await(let r of t)await e.write(new Uint8Array(r));await e.close()}catch(r){throw await e.abort(r).catch(()=>{}),r}}async function PT(t){let e=[],r=0;for await(let o of t){let a=new Uint8Array(o);e.push(a),r+=a.byteLength}let i=new Uint8Array(r),n=0;for(let o of e)i.set(o,n),n+=o.byteLength;return i.buffer}var oI=m(()=>{"use strict"});async function Er(t,e){let r=yn([t],e);return r?await ET(r):null}function yn(t,e){let r=sI(e);return r?LT(t,r):null}function aI(t){return!!sI(t)}function sI(t){if(typeof globalThis.DecompressionStream>"u"||globalThis.process?.release?.name==="node"&&typeof globalThis.Buffer>"u")return null;try{let e=globalThis.DecompressionStream;return new e(t)}catch(e){if(e instanceof TypeError||e?.name==="TypeError")return null;throw e}}async function*LT(t,e){let r=e.writable.getWriter(),i=e.readable.getReader(),n=FT(t,r);n.catch(()=>{});let o=!1;try{for(;;){let{done:a,value:s}=await i.read();if(a){o=!0;break}yield CT(s)}await n}finally{o||(await i.cancel().catch(()=>{}),await r.abort().catch(()=>{}),await n.catch(()=>{})),i.releaseLock()}}async function ET(t){let e=[],r=0;for await(let o of t){let a=new Uint8Array(o);e.push(a),r+=a.byteLength}let i=new Uint8Array(r),n=0;for(let o of e)i.set(o,n),n+=o.byteLength;return i.buffer}function CT(t){return new Uint8Array(t).buffer}async function FT(t,e){try{for await(let r of t)await e.write(new Uint8Array(r));await e.close()}catch(r){throw await e.abort(r).catch(()=>{}),r}}var Ai=m(()=>{"use strict"});var cI={};Ie(cI,{NativeDecompressor:()=>Gm});var Gm,uI=m(()=>{"use strict";ki();Ai();Gm=class extends nr{name;extensions;contentEncodings;isSupported=!0;format;constructor(e,r,i={}){super(i),this.name=e.name,this.extensions=[...e.extensions],this.contentEncodings=[...e.contentEncodings],this.format=r}async decompress(e){let r=await Er(e,this.format);if(!r)throw new Error(`${this.name}: built-in decompression is no longer available`);return r}async*decompressBatches(e){let r=yn(e,this.format);if(!r)throw new Error(`${this.name}: built-in decompression is no longer available`);yield*r}}});function jT(t,e){return{...t,modules:{...t.modules,...e}}}var $s,lI=m(()=>{"use strict";ki();Ai();$s=class extends nr{name;extensions;contentEncodings;isSupported=!0;options;nativeFormat;shouldUseNative;loadFallback;implementation=null;implementationPromise=null;constructor(e,r,i={},n=null,o=()=>!0){super(i),this.name=e.name,this.extensions=[...e.extensions],this.contentEncodings=[...e.contentEncodings],this.options=i,this.nativeFormat=n,this.shouldUseNative=o,this.loadFallback=r}async preload(e={}){if(this.implementation)return this.implementation;let r=jT(this.options,e);this.implementationPromise||=this.loadImplementation(r);try{return this.implementation=await this.implementationPromise,this.implementation}catch(i){throw this.implementationPromise=null,i}}async loadImplementation(e){if(e.useNative!==!1&&this.nativeFormat&&this.shouldUseNative(e)&&aI(this.nativeFormat)){let{NativeDecompressor:n}=await Promise.resolve().then(()=>(uI(),cI));return new n(this,this.nativeFormat,e)}let r=await this.loadFallback(),i=new r({...e,useNative:!1});return await i.preload(e.modules),i}async decompress(e,r){return(await this.preload()).decompress(e,r)}decompressSync(e,r){if(!this.implementation)throw new Error(`${this.name}: call preload() before decompressSync()`);return this.implementation.decompressSync(e,r)}async*decompressBatches(e){yield*(await this.preload()).decompressBatches(e)}}});async function*yl(t,e){let r=[];t.ondata=i=>{r.push(i.slice().buffer)};for await(let i of e)t.push(new Uint8Array(i),!1),yield*r.splice(0);t.push(new Uint8Array(0),!0),yield*r}var Hm=m(()=>{"use strict"});var vl,dI=m(()=>{"use strict";Jm();ki();Hm();vl=class extends nr{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e={}){super(e)}decompressSync(e){return tI(new Uint8Array(e)).slice().buffer}async*decompressBatches(e){yield*yl(new eI,e)}}});var fI={};Ie(fI,{GZipDecompressor:()=>Km});var Km,pI=m(()=>{"use strict";dI();Ai();Km=class extends vl{options;constructor(e={}){super(e),this.options=e}async decompress(e){if(this.options.useNative!==!1){let r=await Er(e,"gzip");if(r)return r}return this.decompressSync(e)}async*decompressBatches(e){if(this.options.useNative!==!1){let r=yn(e,"gzip");if(r){yield*r;return}}yield*super.decompressBatches(e)}}});function wl(t,e){for(var r=[],i=+!e,n=0,o=0;t.length;){var a=JT(t,i||e);if(typeof a=="object"){for(i?(e=null,a.w.length==a.u&&(r.push(e=a.w),o+=a.u)):(r.push(e),a.e=0);!a.l;){var s=eN(t,a,e);s||Je(5),e?a.e=a.y:(r.push(s),o+=s.length,VT(a.w,0,s.length),a.w.set(s,a.w.length-s.length))}n=a.b+a.c*4}else n=a;t=t.subarray(n)}return tN(r,o)}var MT,Re,bl,RT,_l,Ym,Is,VT,ZT,Je,mI,WT,JT,zi,Ss,GT,HT,KT,YT,hI,Xm,XT,qm,qT,xs,QT,eN,tN,Qm=m(()=>{MT=ArrayBuffer,Re=Uint8Array,bl=Uint16Array,RT=Int16Array,_l=Int32Array,Ym=function(t,e,r){if(Re.prototype.slice)return Re.prototype.slice.call(t,e,r);(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new Re(r-e);return i.set(t.subarray(e,r)),i},Is=function(t,e,r,i){if(Re.prototype.fill)return Re.prototype.fill.call(t,e,r,i);for((r==null||r<0)&&(r=0),(i==null||i>t.length)&&(i=t.length);r<i;++r)t[r]=e;return t},VT=function(t,e,r,i){if(Re.prototype.copyWithin)return Re.prototype.copyWithin.call(t,e,r,i);for((r==null||r<0)&&(r=0),(i==null||i>t.length)&&(i=t.length);r<i;)t[e++]=t[r++]},ZT=["invalid zstd data","window size too large (>2046MB)","invalid block type","FSE accuracy too high","match distance too far back","unexpected EOF"],Je=function(t,e,r){var i=new Error(e||ZT[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,Je),!r)throw i;return i},mI=function(t,e,r){for(var i=0,n=0;i<r;++i)n|=t[e++]<<(i<<3);return n},WT=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},JT=function(t,e){var r=t[0]|t[1]<<8|t[2]<<16;if(r==3126568&&t[3]==253){var i=t[4],n=i>>5&1,o=i>>2&1,a=i&3,s=i>>6;i&8&&Je(0);var c=6-n,u=a==3?4:a,l=mI(t,c,u);c+=u;var d=s?1<<s:n,f=mI(t,c,d)+(s==1&&256),p=f;if(!n){var h=1<<10+(t[5]>>3);p=h+(h>>3)*(t[5]&7)}p>2145386496&&Je(1);var y=new Re((e==1?f||p:e?0:p)+12);return y[0]=1,y[4]=4,y[8]=8,{b:c+d,y:0,l:0,d:l,w:e&&e!=1?e:y.subarray(12),e:p,o:new _l(y.buffer,0,3),u:f,c:o,m:Math.min(131072,p)}}else if((r>>4|t[3]<<20)==25481893)return WT(t,4)+8;Je(0)},zi=function(t){for(var e=0;1<<e<=t;++e);return e-1},Ss=function(t,e,r){var i=(e<<3)+4,n=(t[e]&15)+5;n>r&&Je(3);for(var o=1<<n,a=o,s=-1,c=-1,u=-1,l=o,d=new MT(512+(o<<2)),f=new RT(d,0,256),p=new bl(d,0,256),h=new bl(d,512,o),y=512+(o<<1),_=new Re(d,y,o),D=new Re(d,y+o);s<255&&a>0;){var I=zi(a+1),A=i>>3,Z=(1<<I+1)-1,L=(t[A]|t[A+1]<<8|t[A+2]<<16)>>(i&7)&Z,k=(1<<I)-1,le=Z-a-1,he=L&k;if(he<le?(i+=I,L=he):(i+=I+1,L>k&&(L-=le)),f[++s]=--L,L==-1?(a+=L,_[--l]=s):a-=L,!L)do{var ut=i>>3;c=(t[ut]|t[ut+1]<<8)>>(i&7)&3,i+=2,s+=c}while(c==3)}(s>255||a)&&Je(0);for(var Ze=0,gt=(o>>1)+(o>>3)+3,yt=o-1,We=0;We<=s;++We){var me=f[We];if(me<1){p[We]=-me;continue}for(u=0;u<me;++u){_[Ze]=We;do Ze=Ze+gt&yt;while(Ze>=l)}}for(Ze&&Je(0),u=0;u<o;++u){var ce=p[_[u]]++,Ee=D[u]=n-zi(ce);h[u]=(ce<<Ee)-o}return[i+7>>3,{b:n,s:_,n:D,t:h}]},GT=function(t,e){var r=0,i=-1,n=new Re(292),o=t[e],a=n.subarray(0,256),s=n.subarray(256,268),c=new bl(n.buffer,268);if(o<128){var u=Ss(t,e+1,6),l=u[0],d=u[1];e+=o;var f=l<<3,p=t[e];p||Je(0);for(var h=0,y=0,_=d.b,D=_,I=(++e<<3)-8+zi(p);I-=_,!(I<f);){var A=I>>3;if(h+=(t[A]|t[A+1]<<8)>>(I&7)&(1<<_)-1,a[++i]=d.s[h],I-=D,I<f)break;A=I>>3,y+=(t[A]|t[A+1]<<8)>>(I&7)&(1<<D)-1,a[++i]=d.s[y],_=d.n[h],h=d.t[h],D=d.n[y],y=d.t[y]}++i>255&&Je(0)}else{for(i=o-127;r<i;r+=2){var Z=t[++e];a[r]=Z>>4,a[r+1]=Z&15}++e}var L=0;for(r=0;r<i;++r){var k=a[r];k>11&&Je(0),L+=k&&1<<k-1}var le=zi(L)+1,he=1<<le,ut=he-L;for(ut&ut-1&&Je(0),a[i++]=zi(ut)+1,r=0;r<i;++r){var k=a[r];++s[a[r]=k&&le+1-k]}var Ze=new Re(he<<1),gt=Ze.subarray(0,he),yt=Ze.subarray(he);for(c[le]=0,r=le;r>0;--r){var We=c[r];Is(yt,r,We,c[r-1]=We+s[r]*(1<<le-r))}for(c[0]!=he&&Je(0),r=0;r<i;++r){var me=a[r];if(me){var ce=c[me];Is(gt,r,ce,c[me]=ce+(1<<le-me))}}return[e,{n:yt,b:le,s:gt}]},HT=Ss(new Re([81,16,99,140,49,198,24,99,12,33,196,24,99,102,102,134,70,146,4]),0,6)[1],KT=Ss(new Re([33,20,196,24,99,140,33,132,16,66,8,33,132,16,66,8,33,68,68,68,68,68,68,68,68,36,9]),0,6)[1],YT=Ss(new Re([32,132,16,66,102,70,68,68,68,68,36,73,2]),0,5)[1],hI=function(t,e){for(var r=t.length,i=new _l(r),n=0;n<r;++n)i[n]=e,e+=1<<t[n];return i},Xm=new Re(new _l([0,0,0,0,16843009,50528770,134678020,202050057,269422093]).buffer,0,36),XT=hI(Xm,0),qm=new Re(new _l([0,0,0,0,0,0,0,0,16843009,50528770,117769220,185207048,252579084,16]).buffer,0,53),qT=hI(qm,3),xs=function(t,e,r){var i=t.length,n=e.length,o=t[i-1],a=(1<<r.b)-1,s=-r.b;o||Je(0);for(var c=0,u=r.b,l=(i<<3)-8+zi(o)-u,d=-1;l>s&&d<n;){var f=l>>3,p=(t[f]|t[f+1]<<8|t[f+2]<<16)>>(l&7);c=(c<<u|p)&a,e[++d]=r.s[c],l-=u=r.n[c]}(l!=s||d+1!=n)&&Je(0)},QT=function(t,e,r){var i=6,n=e.length,o=n+3>>2,a=o<<1,s=o+a;xs(t.subarray(i,i+=t[0]|t[1]<<8),e.subarray(0,o),r),xs(t.subarray(i,i+=t[2]|t[3]<<8),e.subarray(o,a),r),xs(t.subarray(i,i+=t[4]|t[5]<<8),e.subarray(a,s),r),xs(t.subarray(i),e.subarray(s),r)},eN=function(t,e,r){var i,n=e.b,o=t[n],a=o>>1&3;e.l=o&1;var s=o>>3|t[n+1]<<5|t[n+2]<<13,c=(n+=3)+s;if(a==1)return n>=t.length?void 0:(e.b=n+1,r?(Is(r,t[n],e.y,e.y+=s),r):Is(new Re(s),t[n]));if(!(c>t.length)){if(a==0)return e.b=c,r?(r.set(t.subarray(n,c),e.y),e.y+=s,r):Ym(t,n,c);if(a==2){var u=t[n],l=u&3,d=u>>2&3,f=u>>4,p=0,h=0;l<2?d&1?f|=t[++n]<<4|(d&2&&t[++n]<<12):f=u>>3:(h=d,d<2?(f|=(t[++n]&63)<<4,p=t[n]>>6|t[++n]<<2):d==2?(f|=t[++n]<<4|(t[++n]&3)<<12,p=t[n]>>2|t[++n]<<6):(f|=t[++n]<<4|(t[++n]&63)<<12,p=t[n]>>6|t[++n]<<2|t[++n]<<10)),++n;var y=r?r.subarray(e.y,e.y+e.m):new Re(e.m),_=y.length-f;if(l==0)y.set(t.subarray(n,n+=f),_);else if(l==1)Is(y,t[n++],_);else{var D=e.h;if(l==2){var I=GT(t,n);p+=n-(n=I[0]),e.h=D=I[1]}else D||Je(0);(h?QT:xs)(t.subarray(n,n+=p),y.subarray(_),D)}var A=t[n++];if(A){A==255?A=(t[n++]|t[n++]<<8)+32512:A>127&&(A=A-128<<8|t[n++]);var Z=t[n++];Z&3&&Je(0);for(var L=[KT,YT,HT],k=2;k>-1;--k){var le=Z>>(k<<1)+2&3;if(le==1){var he=new Re([0,0,t[n++]]);L[k]={s:he.subarray(2,3),n:he.subarray(0,1),t:new bl(he.buffer,0,1),b:0}}else le==2?(i=Ss(t,n,9-(k&1)),n=i[0],L[k]=i[1]):le==3&&(e.t||Je(0),L[k]=e.t[k])}var ut=e.t=L,Ze=ut[0],gt=ut[1],yt=ut[2],We=t[c-1];We||Je(0);var me=(c<<3)-8+zi(We)-yt.b,ce=me>>3,Ee=0,Bo=(t[ce]|t[ce+1]<<8)>>(me&7)&(1<<yt.b)-1;ce=(me-=gt.b)>>3;var To=(t[ce]|t[ce+1]<<8)>>(me&7)&(1<<gt.b)-1;ce=(me-=Ze.b)>>3;var Rn=(t[ce]|t[ce+1]<<8)>>(me&7)&(1<<Ze.b)-1;for(++A;--A;){var Pr=yt.s[Bo],ps=yt.n[Bo],pn=Ze.s[Rn],No=Ze.n[Rn],Uo=gt.s[To],ms=gt.n[To];ce=(me-=Uo)>>3;var hs=1<<Uo,Lr=hs+((t[ce]|t[ce+1]<<8|t[ce+2]<<16|t[ce+3]<<24)>>>(me&7)&hs-1);ce=(me-=qm[pn])>>3;var Vn=qT[pn]+((t[ce]|t[ce+1]<<8|t[ce+2]<<16)>>(me&7)&(1<<qm[pn])-1);ce=(me-=Xm[Pr])>>3;var Ku=XT[Pr]+((t[ce]|t[ce+1]<<8|t[ce+2]<<16)>>(me&7)&(1<<Xm[Pr])-1);if(ce=(me-=ps)>>3,Bo=yt.t[Bo]+((t[ce]|t[ce+1]<<8)>>(me&7)&(1<<ps)-1),ce=(me-=No)>>3,Rn=Ze.t[Rn]+((t[ce]|t[ce+1]<<8)>>(me&7)&(1<<No)-1),ce=(me-=ms)>>3,To=gt.t[To]+((t[ce]|t[ce+1]<<8)>>(me&7)&(1<<ms)-1),Lr>3)e.o[2]=e.o[1],e.o[1]=e.o[0],e.o[0]=Lr-=3;else{var Yu=Lr-(Ku!=0);Yu?(Lr=Yu==3?e.o[0]-1:e.o[Yu],Yu>1&&(e.o[2]=e.o[1]),e.o[1]=e.o[0],e.o[0]=Lr):Lr=e.o[0]}for(var k=0;k<Ku;++k)y[Ee+k]=y[_+k];Ee+=Ku,_+=Ku;var gs=Ee-Lr;if(gs<0){var ys=-gs,WB=e.e+gs;ys>Vn&&(ys=Vn);for(var k=0;k<ys;++k)y[Ee+k]=e.w[WB+k];Ee+=ys,Vn-=ys,gs=0}for(var k=0;k<Vn;++k)y[Ee+k]=y[gs+k];Ee+=Vn}if(Ee!=_)for(;_<y.length;)y[Ee++]=y[_++];else Ee=y.length;r?e.y+=Ee:y=Ym(y,0,Ee)}else if(r){if(e.y+=f,_)for(var k=0;k<f;++k)y[k]=y[_+k]}else _&&(y=Ym(y,_));return e.b=c,y}Je(2)}},tN=function(t,e){if(t.length==1)return t[0];for(var r=new Re(e),i=0,n=0;i<t.length;++i){var o=t[i];r.set(o,n),n+=o.length}return r}});var $l,gI=m(()=>{"use strict";ki();Qm();$l=class extends nr{name="zstd";extensions=["zst"];contentEncodings=["zstd"];isSupported=!0;constructor(e={}){super(e)}decompressSync(e){return wl(new Uint8Array(e)).slice().buffer}}});var yI={};Ie(yI,{decompressZstd:()=>rN});function rN(t){return wl(t)}var vI=m(()=>{"use strict";Qm()});var _I={};Ie(_I,{ZstdCompression:()=>eh});var bI,xl,ks,eh,wI=m(()=>{"use strict";ki();Fo();oI();Ai();bI=1e6,eh=class extends ml{name="zstd";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(e={}){super(e),this.options=e,hn(e?.modules)}async preload(e={}){hn(e);let r=gr("zstd-codec");!xl&&r&&(xl=new Promise(i=>r.run(n=>i(n)))),xl&&(ks=await xl)}compressSync(e){ll("zstd-codec",this.name);let r=new ks.Simple,i=new Uint8Array(e);return r.compress(i).buffer}async compress(e){if(this.options.useNative!==!1&&this.options.zstd?.useNative!==!1){let r=await iI(e,"zstd");if(r)return r}return await this.preload(),this.compressSync(e)}decompressSync(e){ll("zstd-codec",this.name);let r=new ks.Simple,i=new Uint8Array(e);return r.decompress(i).buffer}async decompress(e,r){if(!gr("zstd-codec")&&this.options.useNative!==!1&&this.options.zstd?.useNative!==!1){let s=await Er(e,"zstd");if(s)return s}await this.preload();let i=new Uint8Array(e);if(!ks){let{decompressZstd:s}=await Promise.resolve().then(()=>(vI(),yI));return dl(s(i))}let n=new ks.Streaming,o=[];for(let s=0;s<=i.length;s+=bI){let c=i.subarray(s,s+bI),u=dl(c);o.push(new Uint8Array(u))}return(await n.decompressChunks(o)).buffer}}});var $I={};Ie($I,{ZstdDecompressor:()=>th});var th,xI=m(()=>{"use strict";gI();Ai();Fo();th=class extends $l{options;compatibility=null;constructor(e={}){super(e),this.options=e,hn(e.modules)}async preload(e={}){if(hn(e),gr("zstd-codec")){let{ZstdCompression:r}=await Promise.resolve().then(()=>(wI(),_I));this.compatibility||=new r(this.options),await this.compatibility.preload(e)}}async decompress(e){if(this.options.useNative!==!1){let r=await Er(e,"zstd");if(r)return r}return gr("zstd-codec")&&await this.preload(this.options.modules),this.decompressSync(e)}decompressSync(e){if(this.compatibility)return this.compatibility.decompressSync(e);if(gr("zstd-codec"))throw new Error("zstd: call preload() before synchronous decompression with zstd-codec");return super.decompressSync(e)}async*decompressBatches(e){if(this.options.useNative!==!1){let r=yn(e,"zstd");if(r){yield*r;return}}if(gr("zstd-codec")){yield this.decompress(await this.concatenate(e));return}yield*super.decompressBatches(e)}}});var nN,iN,Ds,As,II=m(()=>{"use strict";lI();Fo();nN={name:"gzip",extensions:["gz"],contentEncodings:["gzip"]},iN={name:"zstd",extensions:["zst"],contentEncodings:["zstd"]},Ds=class extends $s{constructor(e={}){super(nN,async()=>(await Promise.resolve().then(()=>(pI(),fI))).GZipDecompressor,e,"gzip")}},As=class extends $s{constructor(e={}){super(iN,async()=>(await Promise.resolve().then(()=>(xI(),$I))).ZstdDecompressor,e,"zstd",r=>!r.modules?.["zstd-codec"]&&!gr("zstd-codec"))}}});var SI=m(()=>{"use strict";II()});function DI(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function T(t,e,r,i){function n(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{u(i.next(l))}catch(d){a(d)}}function c(l){try{u(i.throw(l))}catch(d){a(d)}}function u(l){l.done?o(l.value):n(l.value).then(s,c)}u((i=i.apply(t,e||[])).next())})}function kI(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function re(t){return this instanceof re?(this.v=t,this):new re(t)}function Rt(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(p){return function(h){return Promise.resolve(h).then(p,d)}}function s(p,h){i[p]&&(n[p]=function(y){return new Promise(function(_,D){o.push([p,y,_,D])>1||c(p,y)})},h&&(n[p]=h(n[p])))}function c(p,h){try{u(i[p](h))}catch(y){f(o[0][3],y)}}function u(p){p.value instanceof re?Promise.resolve(p.value.v).then(l,d):f(o[0][2],p)}function l(p){c("next",p)}function d(p){c("throw",p)}function f(p,h){p(h),o.shift(),o.length&&c(o[0][0],o[0][1])}}function jo(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=t[n]?function(a){return(r=!r)?{value:re(t[n](a)),done:!1}:o?o(a):a}:o}}function vr(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof kI=="function"?kI(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,c){a=t[o](a),n(s,c,a.done,a.value)})}}function n(o,a,s,c){Promise.resolve(c).then(function(u){o({value:u,done:s})},a)}}var Vt=m(()=>{});var AI,Mo,oN,Zt,vn=m(()=>{AI=new TextDecoder("utf-8"),Mo=AI.decode.bind(AI),oN=new TextEncoder,Zt=t=>oN.encode(t)});var aN,zI,Xe,_t,br,_r,ir,Il,Sl,kl,Dl,Al,OI,zs,BI,zl,TI,Oi=m(()=>{aN=t=>typeof t=="number",zI=t=>typeof t=="boolean",Xe=t=>typeof t=="function",_t=t=>t!=null&&Object(t)===t,br=t=>_t(t)&&Xe(t.then),_r=t=>_t(t)&&Xe(t[Symbol.iterator]),ir=t=>_t(t)&&Xe(t[Symbol.asyncIterator]),Il=t=>_t(t)&&_t(t.schema),Sl=t=>_t(t)&&"done"in t&&"value"in t,kl=t=>_t(t)&&Xe(t.stat)&&aN(t.fd),Dl=t=>_t(t)&&zs(t.body),Al=t=>"_getDOMStream"in t&&"_getNodeStream"in t,OI=t=>_t(t)&&Xe(t.abort)&&Xe(t.getWriter)&&!Al(t),zs=t=>_t(t)&&Xe(t.cancel)&&Xe(t.getReader)&&!Al(t),BI=t=>_t(t)&&Xe(t.end)&&Xe(t.write)&&zI(t.writable)&&!Al(t),zl=t=>_t(t)&&Xe(t.read)&&Xe(t.pipe)&&zI(t.readable)&&!Al(t),TI=t=>_t(t)&&Xe(t.clear)&&Xe(t.bytes)&&Xe(t.position)&&Xe(t.setPosition)&&Xe(t.capacity)&&Xe(t.getBufferIdentifier)&&Xe(t.createLong)});var sh={};Ie(sh,{compareArrayLike:()=>ah,joinUint8Arrays:()=>Wt,memcpy:()=>Os,rebaseValueOffsets:()=>Ol,toArrayBufferView:()=>ne,toArrayBufferViewAsyncIterator:()=>wr,toArrayBufferViewIterator:()=>Cr,toBigInt64Array:()=>Bs,toBigUint64Array:()=>fN,toFloat32Array:()=>pN,toFloat32ArrayAsyncIterator:()=>zN,toFloat32ArrayIterator:()=>wN,toFloat64Array:()=>mN,toFloat64ArrayAsyncIterator:()=>ON,toFloat64ArrayIterator:()=>$N,toInt16Array:()=>uN,toInt16ArrayAsyncIterator:()=>SN,toInt16ArrayIterator:()=>yN,toInt32Array:()=>Bi,toInt32ArrayAsyncIterator:()=>kN,toInt32ArrayIterator:()=>vN,toInt8Array:()=>cN,toInt8ArrayAsyncIterator:()=>IN,toInt8ArrayIterator:()=>gN,toUint16Array:()=>lN,toUint16ArrayAsyncIterator:()=>DN,toUint16ArrayIterator:()=>bN,toUint32Array:()=>dN,toUint32ArrayAsyncIterator:()=>AN,toUint32ArrayIterator:()=>_N,toUint8Array:()=>C,toUint8ArrayAsyncIterator:()=>oh,toUint8ArrayIterator:()=>ih,toUint8ClampedArray:()=>hN,toUint8ClampedArrayAsyncIterator:()=>BN,toUint8ClampedArrayIterator:()=>xN});function sN(t){let e=t[0]?[t[0]]:[],r,i,n,o;for(let a,s,c=0,u=0,l=t.length;++c<l;){if(a=e[u],s=t[c],!a||!s||a.buffer!==s.buffer||s.byteOffset<a.byteOffset){s&&(e[++u]=s);continue}if({byteOffset:r,byteLength:n}=a,{byteOffset:i,byteLength:o}=s,r+n<i||i+o<r){s&&(e[++u]=s);continue}e[u]=new Uint8Array(a.buffer,r,i-r+o)}return e}function Os(t,e,r=0,i=e.byteLength){let n=t.byteLength,o=new Uint8Array(t.buffer,t.byteOffset,n),a=new Uint8Array(e.buffer,e.byteOffset,Math.min(i,n));return o.set(a,r),t}function Wt(t,e){let r=sN(t),i=r.reduce((l,d)=>l+d.byteLength,0),n,o,a,s=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,i);for(let l=r.length;++c<l;){if(n=r[c],o=n.subarray(0,Math.min(n.length,u-s)),u<=s+o.length){o.length<n.length?r[c]=n.subarray(o.length):o.length===n.length&&c++,a?Os(a,o,s):a=o;break}Os(a||(a=new Uint8Array(u)),o,s),s+=o.length}return[a||new Uint8Array(0),r.slice(c),i-(a?a.byteLength:0)]}function ne(t,e){let r=Sl(e)?e.value:e;return r instanceof t?t===Uint8Array?new t(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=Zt(r)),r instanceof ArrayBuffer?new t(r):r instanceof nh?new t(r):TI(r)?ne(t,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new t(0):new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):t.from(r)):new t(0)}function*Cr(t,e){let r=function*(n){yield n},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof nh?r(e):_r(e)?e:r(e);return yield*rh((function*(n){let o=null;do o=n.next(yield ne(t,o));while(!o.done)})(i[Symbol.iterator]())),new t}function wr(t,e){return Rt(this,arguments,function*(){if(br(e))return yield re(yield re(yield*jo(vr(wr(t,yield re(e))))));let i=function(a){return Rt(this,arguments,function*(){yield yield re(yield re(a))})},n=function(a){return Rt(this,arguments,function*(){yield re(yield*jo(vr(rh((function*(s){let c=null;do c=s.next(yield c?.value);while(!c.done)})(a[Symbol.iterator]())))))})},o=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof nh?i(e):_r(e)?n(e):ir(e)?e:i(e);return yield re(yield*jo(vr(rh((function(a){return Rt(this,arguments,function*(){let s=null;do s=yield re(a.next(yield yield re(ne(t,s))));while(!s.done)})})(o[Symbol.asyncIterator]()))))),yield re(new t)})}function Ol(t,e,r){if(t!==0){r=r.slice(0,e);let i=typeof r[0]=="bigint"?BigInt(t):t;for(let n=-1,o=r.length;++n<o;)r[n]+=i}return r.subarray(0,e)}function ah(t,e){let r=0,i=t.length;if(i!==e.length)return!1;if(i>0)do if(t[r]!==e[r])return!1;while(++r<i);return!0}var nh,cN,uN,Bi,Bs,C,lN,dN,fN,pN,mN,hN,rh,gN,yN,vN,ih,bN,_N,wN,$N,xN,IN,SN,kN,oh,DN,AN,zN,ON,BN,qe=m(()=>{Vt();vn();Oi();nh=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;cN=t=>ne(Int8Array,t),uN=t=>ne(Int16Array,t),Bi=t=>ne(Int32Array,t),Bs=t=>ne(BigInt64Array,t),C=t=>ne(Uint8Array,t),lN=t=>ne(Uint16Array,t),dN=t=>ne(Uint32Array,t),fN=t=>ne(BigUint64Array,t),pN=t=>ne(Float32Array,t),mN=t=>ne(Float64Array,t),hN=t=>ne(Uint8ClampedArray,t),rh=t=>(t.next(),t);gN=t=>Cr(Int8Array,t),yN=t=>Cr(Int16Array,t),vN=t=>Cr(Int32Array,t),ih=t=>Cr(Uint8Array,t),bN=t=>Cr(Uint16Array,t),_N=t=>Cr(Uint32Array,t),wN=t=>Cr(Float32Array,t),$N=t=>Cr(Float64Array,t),xN=t=>Cr(Uint8ClampedArray,t);IN=t=>wr(Int8Array,t),SN=t=>wr(Int16Array,t),kN=t=>wr(Int32Array,t),oh=t=>wr(Uint8Array,t),DN=t=>wr(Uint16Array,t),AN=t=>wr(Uint32Array,t),zN=t=>wr(Float32Array,t),ON=t=>wr(Float64Array,t),BN=t=>wr(Uint8ClampedArray,t)});function*TN(t){let e,r=!1,i=[],n,o,a,s=0;function c(){return o==="peek"?Wt(i,a)[0]:([n,i,s]=Wt(i,a),n)}({cmd:o,size:a}=(yield null)||{cmd:"read",size:0});let u=ih(t)[Symbol.iterator]();try{do if({done:e,value:n}=Number.isNaN(a-s)?u.next():u.next(a-s),!e&&n.byteLength>0&&(i.push(n),s+=n.byteLength),e||a<=s)do({cmd:o,size:a}=yield c());while(a<s);while(!e)}catch(l){r=!0,typeof u.throw=="function"&&u.throw(l)}finally{r===!1&&typeof u.return=="function"&&u.return(null)}return null}function NN(t){return Rt(this,arguments,function*(){let r,i=!1,n=[],o,a,s,c=0;function u(){return a==="peek"?Wt(n,s)[0]:([o,n,c]=Wt(n,s),o)}({cmd:a,size:s}=(yield yield re(null))||{cmd:"read",size:0});let l=oh(t)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(s-c)?yield re(l.next()):yield re(l.next(s-c)),!r&&o.byteLength>0&&(n.push(o),c+=o.byteLength),r||s<=c)do({cmd:a,size:s}=yield yield re(u()));while(s<c);while(!r)}catch(d){i=!0,typeof l.throw=="function"&&(yield re(l.throw(d)))}finally{i===!1&&typeof l.return=="function"&&(yield re(l.return(new Uint8Array(0))))}return yield re(null)})}function UN(t){return Rt(this,arguments,function*(){let r=!1,i=!1,n=[],o,a,s,c=0;function u(){return a==="peek"?Wt(n,s)[0]:([o,n,c]=Wt(n,s),o)}({cmd:a,size:s}=(yield yield re(null))||{cmd:"read",size:0});let l=new uh(t);try{do if({done:r,value:o}=Number.isNaN(s-c)?yield re(l.read()):yield re(l.read(s-c)),!r&&o.byteLength>0&&(n.push(C(o)),c+=o.byteLength),r||s<=c)do({cmd:a,size:s}=yield yield re(u()));while(s<c);while(!r)}catch(d){i=!0,yield re(l.cancel(d))}finally{i===!1?yield re(l.cancel()):t.locked&&l.releaseLock()}return yield re(null)})}function PN(t){return Rt(this,arguments,function*(){let r=[],i="error",n=!1,o=null,a,s,c=0,u=[],l;function d(){return a==="peek"?Wt(u,s)[0]:([l,u,c]=Wt(u,s),l)}if({cmd:a,size:s}=(yield yield re(null))||{cmd:"read",size:0},t.isTTY)return yield yield re(new Uint8Array(0)),yield re(null);try{r[0]=ch(t,"end"),r[1]=ch(t,"error");do{if(r[2]=ch(t,"readable"),[i,o]=yield re(Promise.race(r.map(p=>p[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(s-c)?(l=C(t.read(s-c)),l.byteLength<s-c&&(l=C(t.read()))):l=C(t.read()),l.byteLength>0&&(u.push(l),c+=l.byteLength)),n||s<=c)do({cmd:a,size:s}=yield yield re(d()));while(s<c)}while(!n)}finally{yield re(f(r,i==="error"?o:null))}return yield re(null);function f(p,h){return l=u=null,new Promise((y,_)=>{for(let[D,I]of p)t.off(D,I);try{let D=t.destroy;D&&D.call(t,h),h=void 0}catch(D){h=D||h}finally{h!=null?_(h):y()}})}})}var it,Bl,uh,ch,Ts=m(()=>{Vt();qe();it={fromIterable(t){return Bl(TN(t))},fromAsyncIterable(t){return Bl(NN(t))},fromDOMStream(t){return Bl(UN(t))},fromNodeStream(t){return Bl(PN(t))},toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}},Bl=t=>(t.next(),t);uh=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return T(this,void 0,void 0,function*(){let{reader:r,source:i}=this;r&&(yield r.cancel(e).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(e){return T(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=C(r)),r})}},ch=(t,e)=>{let r=n=>i([e,n]),i;return[e,r,new Promise(n=>(i=n)&&t.once(e,r))]}});var be,Tl=m(()=>{(function(t){t[t.V1=0]="V1",t[t.V2=1]="V2",t[t.V3=2]="V3",t[t.V4=3]="V4",t[t.V5=4]="V5"})(be||(be={}))});var Ae,lh=m(()=>{(function(t){t[t.Sparse=0]="Sparse",t[t.Dense=1]="Dense"})(Ae||(Ae={}))});var Se,dh=m(()=>{(function(t){t[t.HALF=0]="HALF",t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE"})(Se||(Se={}))});var Ve,fh=m(()=>{(function(t){t[t.DAY=0]="DAY",t[t.MILLISECOND=1]="MILLISECOND"})(Ve||(Ve={}))});var E,Ns=m(()=>{(function(t){t[t.SECOND=0]="SECOND",t[t.MILLISECOND=1]="MILLISECOND",t[t.MICROSECOND=2]="MICROSECOND",t[t.NANOSECOND=3]="NANOSECOND"})(E||(E={}))});var Te,ph=m(()=>{(function(t){t[t.YEAR_MONTH=0]="YEAR_MONTH",t[t.DAY_TIME=1]="DAY_TIME",t[t.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Te||(Te={}))});var Nl=m(()=>{});var Fr,Ul,Pl,Ro,mh=m(()=>{Fr=new Int32Array(2),Ul=new Float32Array(Fr.buffer),Pl=new Float64Array(Fr.buffer),Ro=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Us,hh=m(()=>{(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})(Us||(Us={}))});var ot,gh=m(()=>{Nl();hh();mh();ot=class t{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new t(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Fr[0]=this.readInt32(e),Ul[0]}readFloat64(e){return Fr[Ro?0:1]=this.readInt32(e),Fr[Ro?1:0]=this.readInt32(e+4),Pl[0]}writeInt8(e,r){this.bytes_[e]=r}writeUint8(e,r){this.bytes_[e]=r}writeInt16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeUint16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeInt32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeUint32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeInt64(e,r){this.writeInt32(e,Number(BigInt.asIntN(32,r))),this.writeInt32(e+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(e,r){this.writeUint32(e,Number(BigInt.asUintN(32,r))),this.writeUint32(e+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(e,r){Ul[0]=r,this.writeInt32(e,Fr[0])}writeFloat64(e,r){Pl[0]=r,this.writeInt32(e,Fr[Ro?0:1]),this.writeInt32(e+4,Fr[Ro?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let r=0;r<4;r++)e+=String.fromCharCode(this.readInt8(this.position_+4+r));return e}__offset(e,r){let i=e-this.readInt32(e);return r<this.readInt16(i)?this.readInt16(i+r):0}__union(e,r){return e.bb_pos=r+this.readInt32(r),e.bb=this,e}__string(e,r){e+=this.readInt32(e);let i=this.readInt32(e);e+=4;let n=this.bytes_.subarray(e,e+i);return r===Us.UTF8_BYTES?n:this.text_decoder_.decode(n)}__union_with_string(e,r){return typeof e=="string"?this.__string(r):this.__union(e,r)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let r=0;r<4;r++)if(e.charCodeAt(r)!=this.readInt8(this.position()+4+r))return!1;return!0}createScalarList(e,r){let i=[];for(let n=0;n<r;++n){let o=e(n);o!==null&&i.push(o)}return i}createObjList(e,r){let i=[];for(let n=0;n<r;++n){let o=e(n);o!==null&&i.push(o.unpack())}return i}}});var Ti,NI=m(()=>{gh();Nl();Ti=class t{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;e?r=e:r=1024,this.bb=ot.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,r){e>this.minalign&&(this.minalign=e);let i=~(this.bb.capacity()-this.space+r)+1&e-1;for(;this.space<i+e+r;){let n=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(e){for(let r=0;r<e;r++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,r,i){(this.force_defaults||r!=i)&&(this.addInt8(r),this.slot(e))}addFieldInt16(e,r,i){(this.force_defaults||r!=i)&&(this.addInt16(r),this.slot(e))}addFieldInt32(e,r,i){(this.force_defaults||r!=i)&&(this.addInt32(r),this.slot(e))}addFieldInt64(e,r,i){(this.force_defaults||r!==i)&&(this.addInt64(r),this.slot(e))}addFieldFloat32(e,r,i){(this.force_defaults||r!=i)&&(this.addFloat32(r),this.slot(e))}addFieldFloat64(e,r,i){(this.force_defaults||r!=i)&&(this.addFloat64(r),this.slot(e))}addFieldOffset(e,r,i){(this.force_defaults||r!=i)&&(this.addOffset(r),this.slot(e))}addFieldStruct(e,r,i){r!=i&&(this.nested(r),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let r=e.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let i=r<<1,n=ot.allocate(i);return n.setPosition(i-r),n.bytes().set(e.bytes(),i-r),n}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let r=0;r<e;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let i=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?e-this.vtable[r]:0);let n=2;this.addInt16(e-this.object_start);let o=(i+n)*2;this.addInt16(o);let a=0,s=this.space;e:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];if(o==this.bb.readInt16(c)){for(let u=2;u<o;u+=2)if(this.bb.readInt16(s+u)!=this.bb.readInt16(c+u))continue e;a=this.vtables[r];break}}return a?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,a-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,r,i){let n=i?4:0;if(r){let o=r;if(this.prep(this.minalign,8+n),o.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+n),this.addOffset(e),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,r){this.finish(e,r,!0)}requiredField(e,r){let i=this.bb.capacity()-e,n=i-this.bb.readInt32(i);if(!(r<this.bb.readInt16(n)&&this.bb.readInt16(n+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(e,r,i){this.notNested(),this.vector_num_elems=r,this.prep(4,e*r),this.prep(i,e*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let r=this.createString(e);return this.string_maps.set(e,r),r}createString(e){if(e==null)return 0;let r;return e instanceof Uint8Array?r=e:r=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let r=[];for(let i=0;i<e.length;++i){let n=e[i];if(n!==null)r.push(this.createObjectOffset(n));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(e,r){return r(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var de=m(()=>{Nl();mh();NI();gh();hh()});var Ni,yh=m(()=>{(function(t){t[t.BUFFER=0]="BUFFER"})(Ni||(Ni={}))});var wt,Ps=m(()=>{(function(t){t[t.LZ4_FRAME=0]="LZ4_FRAME",t[t.ZSTD=1]="ZSTD"})(wt||(wt={}))});var bn,vh=m(()=>{de();yh();Ps();bn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBodyCompression(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):wt.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Ni.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,r){e.addFieldInt8(0,r,wt.LZ4_FRAME)}static addMethod(e,r){e.addFieldInt8(1,r,Ni.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,r,i){return t.startBodyCompression(e),t.addCodec(e,r),t.addMethod(e,i),t.endBodyCompression(e)}}});var Vo,bh=m(()=>{Vo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,r,i){return e.prep(8,16),e.writeInt64(BigInt(i??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var Zo,_h=m(()=>{Zo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,r,i){return e.prep(8,16),e.writeInt64(BigInt(i??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var lt,wh=m(()=>{de();vh();bh();_h();lt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsRecordBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,r){let i=this.bb.__offset(this.bb_pos,6);return i?(r||new Zo).__init(this.bb.__vector(this.bb_pos+i)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new Vo).__init(this.bb.__vector(this.bb_pos+i)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new bn).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addNodes(e,r){e.addFieldOffset(1,r,0)}static startNodesVector(e,r){e.startVector(16,r,8)}static addBuffers(e,r){e.addFieldOffset(2,r,0)}static startBuffersVector(e,r){e.startVector(16,r,8)}static addCompression(e,r){e.addFieldOffset(3,r,0)}static addVariadicBufferCounts(e,r){e.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(e,r){e.startVector(8,r.length,8);for(let i=r.length-1;i>=0;i--)e.addInt64(r[i]);return e.endVector()}static startVariadicBufferCountsVector(e,r){e.startVector(8,r,8)}static endRecordBatch(e){return e.endObject()}}});var _n,UI=m(()=>{de();wh();_n=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new lt).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addData(e,r){e.addFieldOffset(1,r,0)}static addIsDelta(e,r){e.addFieldInt8(2,+r,0)}static endDictionaryBatch(e){return e.endObject()}}});var Wn,$h=m(()=>{(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(Wn||(Wn={}))});var Ls,PI=m(()=>{(function(t){t[t.DenseArray=0]="DenseArray"})(Ls||(Ls={}))});var xr,El=m(()=>{de();xr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInt(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,r){e.addFieldInt32(0,r,0)}static addIsSigned(e,r){e.addFieldInt8(1,+r,0)}static endInt(e){return e.endObject()}static createInt(e,r,i){return t.startInt(e),t.addBitWidth(e,r),t.addIsSigned(e,i),t.endInt(e)}}});var jr,xh=m(()=>{de();PI();El();jr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryEncoding(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new xr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Ls.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addIndexType(e,r){e.addFieldOffset(1,r,0)}static addIsOrdered(e,r){e.addFieldInt8(2,+r,0)}static addDictionaryKind(e,r){e.addFieldInt16(3,r,Ls.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Ce,Wo=m(()=>{de();Ce=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsKeyValue(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}key(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}value(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,r){e.addFieldOffset(0,r,0)}static addValue(e,r){e.addFieldOffset(1,r,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,r,i){return t.startKeyValue(e),t.addKey(e,r),t.addValue(e,i),t.endKeyValue(e)}}});var Es,LI=m(()=>{de();Es=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return t.startBinary(e),t.endBinary(e)}}});var Cs,EI=m(()=>{de();Cs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinaryView(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return t.startBinaryView(e),t.endBinaryView(e)}}});var Fs,CI=m(()=>{de();Fs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBool(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return t.startBool(e),t.endBool(e)}}});var Jn,Ih=m(()=>{de();fh();Jn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDate(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ve.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,Ve.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,r){return t.startDate(e),t.addUnit(e,r),t.endDate(e)}}});var Mr,Sh=m(()=>{de();Mr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDecimal(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,r){e.addFieldInt32(0,r,0)}static addScale(e,r){e.addFieldInt32(1,r,0)}static addBitWidth(e,r){e.addFieldInt32(2,r,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,r,i,n){return t.startDecimal(e),t.addPrecision(e,r),t.addScale(e,i),t.addBitWidth(e,n),t.endDecimal(e)}}});var Gn,kh=m(()=>{de();Ns();Gn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDuration(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,E.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,r){return t.startDuration(e),t.addUnit(e,r),t.endDuration(e)}}});var Hn,Dh=m(()=>{de();Hn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,r){return t.startFixedSizeBinary(e),t.addByteWidth(e,r),t.endFixedSizeBinary(e)}}});var Kn,Ah=m(()=>{de();Kn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,r){return t.startFixedSizeList(e),t.addListSize(e,r),t.endFixedSizeList(e)}}});var Yn,zh=m(()=>{de();dh();Yn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFloatingPoint(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Se.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,r){e.addFieldInt16(0,r,Se.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,r){return t.startFloatingPoint(e),t.addPrecision(e,r),t.endFloatingPoint(e)}}});var Xn,Oh=m(()=>{de();ph();Xn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInterval(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Te.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,Te.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,r){return t.startInterval(e),t.addUnit(e,r),t.endInterval(e)}}});var js,FI=m(()=>{de();js=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return t.startLargeBinary(e),t.endLargeBinary(e)}}});var Ms,jI=m(()=>{de();Ms=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return t.startLargeList(e),t.endLargeList(e)}}});var Rs,MI=m(()=>{de();Rs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return t.startLargeUtf8(e),t.endLargeUtf8(e)}}});var Vs,RI=m(()=>{de();Vs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return t.startList(e),t.endList(e)}}});var qn,Bh=m(()=>{de();qn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMap(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,r){e.addFieldInt8(0,+r,0)}static endMap(e){return e.endObject()}static createMap(e,r){return t.startMap(e),t.addKeysSorted(e,r),t.endMap(e)}}});var Zs,VI=m(()=>{de();Zs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsNull(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return t.startNull(e),t.endNull(e)}}});var Ws,ZI=m(()=>{de();Ws=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsStruct_(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return t.startStruct_(e),t.endStruct_(e)}}});var wn,Th=m(()=>{de();Ns();wn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTime(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,E.MILLISECOND)}static addBitWidth(e,r){e.addFieldInt32(1,r,32)}static endTime(e){return e.endObject()}static createTime(e,r,i){return t.startTime(e),t.addUnit(e,r),t.addBitWidth(e,i),t.endTime(e)}}});var $n,Nh=m(()=>{de();Ns();$n=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTimestamp(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.SECOND}timezone(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,E.SECOND)}static addTimezone(e,r){e.addFieldOffset(1,r,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,r,i){return t.startTimestamp(e),t.addUnit(e,r),t.addTimezone(e,i),t.endTimestamp(e)}}});var Ir,Uh=m(()=>{de();lh();Ir=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUnion(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ae.Sparse}typeIds(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,r){e.addFieldInt16(0,r,Ae.Sparse)}static addTypeIds(e,r){e.addFieldOffset(1,r,0)}static createTypeIdsVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addInt32(r[i]);return e.endVector()}static startTypeIdsVector(e,r){e.startVector(4,r,4)}static endUnion(e){return e.endObject()}static createUnion(e,r,i){return t.startUnion(e),t.addMode(e,r),t.addTypeIds(e,i),t.endUnion(e)}}});var Js,WI=m(()=>{de();Js=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return t.startUtf8(e),t.endUtf8(e)}}});var Gs,JI=m(()=>{de();Gs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8View(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return t.startUtf8View(e),t.endUtf8View(e)}}});var ye,Ph=m(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.FloatingPoint=3]="FloatingPoint",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct_=13]="Struct_",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.RunEndEncoded=22]="RunEndEncoded",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.ListView=25]="ListView",t[t.LargeListView=26]="LargeListView"})(ye||(ye={}))});var dt,Lh=m(()=>{de();xh();Wo();Ph();dt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsField(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):ye.NONE}type(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(e,this.bb_pos+r):null}dictionary(e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new jr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(e,r){let i=this.bb.__offset(this.bb_pos,14);return i?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let i=this.bb.__offset(this.bb_pos,16);return i?(r||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,r){e.addFieldOffset(0,r,0)}static addNullable(e,r){e.addFieldInt8(1,+r,0)}static addTypeType(e,r){e.addFieldInt8(2,r,ye.NONE)}static addType(e,r){e.addFieldOffset(3,r,0)}static addDictionary(e,r){e.addFieldOffset(4,r,0)}static addChildren(e,r){e.addFieldOffset(5,r,0)}static createChildrenVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startChildrenVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(6,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endField(e){return e.endObject()}}});var Ot,Eh=m(()=>{de();$h();Lh();Wo();Ot=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsSchema(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Wn.Little}fields(e,r){let i=this.bb.__offset(this.bb_pos,6);return i?(r||new dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,r){e.addFieldInt16(0,r,Wn.Little)}static addFields(e,r){e.addFieldOffset(1,r,0)}static createFieldsVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startFieldsVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(2,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static addFeatures(e,r){e.addFieldOffset(3,r,0)}static createFeaturesVector(e,r){e.startVector(8,r.length,8);for(let i=r.length-1;i>=0;i--)e.addInt64(r[i]);return e.endVector()}static startFeaturesVector(e,r){e.startVector(8,r,8)}static endSchema(e){return e.endObject()}static createSchema(e,r,i,n,o){return t.startSchema(e),t.addEndianness(e,r),t.addFields(e,i),t.addCustomMetadata(e,n),t.addFeatures(e,o),t.endSchema(e)}}});var ue,Ch=m(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor",t[t.SparseTensor=5]="SparseTensor"})(ue||(ue={}))});var g,Jt,Qe=m(()=>{Tl();lh();dh();fh();Ns();ph();Ch();(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t[t.DurationSecond=-27]="DurationSecond",t[t.DurationMillisecond=-28]="DurationMillisecond",t[t.DurationMicrosecond=-29]="DurationMicrosecond",t[t.DurationNanosecond=-30]="DurationNanosecond",t[t.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(g||(g={}));(function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"})(Jt||(Jt={}))});var Fh={};Ie(Fh,{valueToString:()=>Sr});function Sr(t){if(t===null)return"null";if(t===void 0)return"undefined";switch(typeof t){case"number":return`${t}`;case"bigint":return`${t}`;case"string":return`"${t}"`}return typeof t[Symbol.toPrimitive]=="function"?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?t instanceof BigInt64Array||t instanceof BigUint64Array?`[${[...t].map(e=>Sr(e))}]`:`[${t}]`:ArrayBuffer.isView(t)?`[${t}]`:JSON.stringify(t,(e,r)=>typeof r=="bigint"?`${r}`:r)}var Hs=m(()=>{});function ie(t){if(typeof t=="bigint"&&(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER))throw new TypeError(`${t} is not safe to convert to a number.`);return Number(t)}function jh(t,e){return ie(t/e)+ie(t%e)/ie(e)}var Rr=m(()=>{});var Vh={};Ie(Vh,{BN:()=>Ys,bigNumToBigInt:()=>HI,bigNumToNumber:()=>Rh,bigNumToString:()=>Ho,isArrowBigNumSymbol:()=>GI});function kr(t,...e){return e.length===0?Object.setPrototypeOf(ne(this.TypedArray,t),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(t,...e),this.constructor.prototype)}function Jo(...t){return kr.apply(this,t)}function Go(...t){return kr.apply(this,t)}function Ks(...t){return kr.apply(this,t)}function Rh(t,e){let{buffer:r,byteOffset:i,byteLength:n,signed:o}=t,a=new BigUint64Array(r,i,n/8),s=o&&a.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(s){for(let l of a)c|=(l^EN)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let l of a)c|=l*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let l=BigInt("1".padEnd(e+1,"0")),d=c/l,f=s?-(c%l):c%l,p=ie(d),h=`${f}`.padStart(e,"0");return+`${s&&p===0?"-":""}${p}.${h}`}return ie(c)}function Ho(t){if(t.byteLength===8)return`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`;if(!t.signed)return Mh(t);let e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return Mh(t);e=e.slice();let i=1;for(let o=0;o<e.length;o++){let a=e[o],s=~a+i;e[o]=s,i&=a===0?1:0}return`-${Mh(e)}`}function HI(t){return t.byteLength===8?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:Ho(t)}function Mh(t){let e="",r=new Uint32Array(2),i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=new Uint32Array((i=new Uint16Array(i).reverse()).buffer),o=-1,a=i.length-1;do{for(r[0]=i[o=0];o<a;)i[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+i[o];i[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,e=`${r[0]}${e}`}while(n[0]||n[1]||n[2]||n[3]);return e??"0"}var GI,LN,EN,Ys,Zh=m(()=>{qe();Rr();GI=Symbol.for("isArrowBigNum");kr.prototype[GI]=!0;kr.prototype.toJSON=function(){return`"${Ho(this)}"`};kr.prototype.valueOf=function(t){return Rh(this,t)};kr.prototype.toString=function(){return Ho(this)};kr.prototype[Symbol.toPrimitive]=function(t="default"){switch(t){case"number":return Rh(this);case"string":return Ho(this);case"default":return HI(this)}return Ho(this)};Object.setPrototypeOf(Jo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Go.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ks.prototype,Object.create(Uint32Array.prototype));Object.assign(Jo.prototype,kr.prototype,{constructor:Jo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Go.prototype,kr.prototype,{constructor:Go,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Ks.prototype,kr.prototype,{constructor:Ks,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});LN=BigInt(4294967296)*BigInt(4294967296),EN=LN-BigInt(1);Ys=class t{static new(e,r){switch(r){case!0:return new Jo(e);case!1:return new Go(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Jo(e)}return e.byteLength===16?new Ks(e):new Go(e)}static signed(e){return new Jo(e)}static unsigned(e){return new Go(e)}static decimal(e){return new Ks(e)}constructor(e,r){return t.new(e,r)}}});function Kt(t){let e=t;switch(t.typeId){case g.Decimal:return t.bitWidth/32;case g.Interval:return e.unit===Te.MONTH_DAY_NANO?4:1+e.unit;case g.BinaryView:case g.Utf8View:return 16;case g.FixedSizeList:return e.listSize;case g.FixedSizeBinary:return e.byteWidth;default:return 1}}var KI,YI,XI,qI,QI,eS,tS,rS,nS,iS,oS,aS,sS,cS,uS,lS,dS,fS,pS,mS,hS,gS,yS,vS,bS,_S,z,ft,Ge,Ui,Pi,Gt,Li,Ei,Ci,Fi,ji,Ht,Xs,Mi,Ri,Vr,te,Zr,Wr,Bt,Jr,Gr,Hr,Kr,Yr,Xr,qr,Qr,ar,sr,ze,cr,en,Tt,ur,CN,Nt,ke=m(()=>{Rr();Qe();_S=Symbol.for("apache-arrow/DataType"),z=class t{static isDataType(e){return e?.[_S]===!0}static isNull(e){return e?.typeId===g.Null}static isInt(e){return e?.typeId===g.Int}static isFloat(e){return e?.typeId===g.Float}static isBinary(e){return e?.typeId===g.Binary}static isBinaryView(e){return e?.typeId===g.BinaryView}static isLargeBinary(e){return e?.typeId===g.LargeBinary}static isUtf8(e){return e?.typeId===g.Utf8}static isUtf8View(e){return e?.typeId===g.Utf8View}static isLargeUtf8(e){return e?.typeId===g.LargeUtf8}static isBool(e){return e?.typeId===g.Bool}static isDecimal(e){return e?.typeId===g.Decimal}static isDate(e){return e?.typeId===g.Date}static isTime(e){return e?.typeId===g.Time}static isTimestamp(e){return e?.typeId===g.Timestamp}static isInterval(e){return e?.typeId===g.Interval}static isDuration(e){return e?.typeId===g.Duration}static isList(e){return e?.typeId===g.List}static isLargeList(e){return e?.typeId===g.LargeList}static isStruct(e){return e?.typeId===g.Struct}static isUnion(e){return e?.typeId===g.Union}static isFixedSizeBinary(e){return e?.typeId===g.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===g.FixedSizeList}static isMap(e){return e?.typeId===g.Map}static isDictionary(e){return e?.typeId===g.Dictionary}static isDenseUnion(e){return t.isUnion(e)&&e.mode===Ae.Dense}static isSparseUnion(e){return t.isUnion(e)&&e.mode===Ae.Sparse}constructor(e){this.typeId=e}};KI=Symbol.toStringTag;z[KI]=(t=>(t.children=null,t.ArrayType=Array,t.OffsetArrayType=Int32Array,t[_S]=!0,t[Symbol.toStringTag]="DataType"))(z.prototype);ft=class extends z{constructor(){super(g.Null)}toString(){return"Null"}};YI=Symbol.toStringTag;ft[YI]=(t=>t[Symbol.toStringTag]="Null")(ft.prototype);Ge=class extends z{constructor(e,r){super(g.Int),this.isSigned=e,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};XI=Symbol.toStringTag;Ge[XI]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(Ge.prototype);Ui=class extends Ge{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Pi=class extends Ge{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Gt=class extends Ge{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Li=class extends Ge{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Ei=class extends Ge{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Ci=class extends Ge{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Fi=class extends Ge{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},ji=class extends Ge{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Ui.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Pi.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Gt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Li.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ei.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Ci.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Fi.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(ji.prototype,"ArrayType",{value:BigUint64Array});Ht=class extends z{constructor(e){super(g.Float),this.precision=e}get ArrayType(){switch(this.precision){case Se.HALF:return Uint16Array;case Se.SINGLE:return Float32Array;case Se.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};qI=Symbol.toStringTag;Ht[qI]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(Ht.prototype);Xs=class extends Ht{constructor(){super(Se.HALF)}},Mi=class extends Ht{constructor(){super(Se.SINGLE)}},Ri=class extends Ht{constructor(){super(Se.DOUBLE)}};Object.defineProperty(Xs.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Mi.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ri.prototype,"ArrayType",{value:Float64Array});Vr=class extends z{constructor(){super(g.Binary)}toString(){return"Binary"}};QI=Symbol.toStringTag;Vr[QI]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(Vr.prototype);te=class extends z{constructor(){super(g.BinaryView)}toString(){return"BinaryView"}};eS=Symbol.toStringTag;te.ELEMENT_WIDTH=16;te.INLINE_CAPACITY=12;te.LENGTH_OFFSET=0;te.INLINE_OFFSET=4;te.BUFFER_INDEX_OFFSET=8;te.BUFFER_OFFSET_OFFSET=12;te[eS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="BinaryView"))(te.prototype);Zr=class extends z{constructor(){super(g.LargeBinary)}toString(){return"LargeBinary"}};tS=Symbol.toStringTag;Zr[tS]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeBinary"))(Zr.prototype);Wr=class extends z{constructor(){super(g.Utf8)}toString(){return"Utf8"}};rS=Symbol.toStringTag;Wr[rS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(Wr.prototype);Bt=class extends z{constructor(){super(g.Utf8View)}toString(){return"Utf8View"}};nS=Symbol.toStringTag;Bt.ELEMENT_WIDTH=te.ELEMENT_WIDTH;Bt.INLINE_CAPACITY=te.INLINE_CAPACITY;Bt[nS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8View"))(Bt.prototype);Jr=class extends z{constructor(){super(g.LargeUtf8)}toString(){return"LargeUtf8"}};iS=Symbol.toStringTag;Jr[iS]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeUtf8"))(Jr.prototype);Gr=class extends z{constructor(){super(g.Bool)}toString(){return"Bool"}};oS=Symbol.toStringTag;Gr[oS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(Gr.prototype);Hr=class extends z{constructor(e,r,i=128){super(g.Decimal),this.scale=e,this.precision=r,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};aS=Symbol.toStringTag;Hr[aS]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(Hr.prototype);Kr=class extends z{constructor(e){super(g.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${Ve[this.unit]}>`}get ArrayType(){return this.unit===Ve.DAY?Int32Array:BigInt64Array}};sS=Symbol.toStringTag;Kr[sS]=(t=>(t.unit=null,t[Symbol.toStringTag]="Date"))(Kr.prototype);Yr=class extends z{constructor(e,r){super(g.Time),this.unit=e,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${E[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};cS=Symbol.toStringTag;Yr[cS]=(t=>(t.unit=null,t.bitWidth=null,t[Symbol.toStringTag]="Time"))(Yr.prototype);Xr=class extends z{constructor(e,r){super(g.Timestamp),this.unit=e,this.timezone=r}toString(){return`Timestamp<${E[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};uS=Symbol.toStringTag;Xr[uS]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Timestamp"))(Xr.prototype);qr=class extends z{constructor(e){super(g.Interval),this.unit=e}toString(){return`Interval<${Te[this.unit]}>`}};lS=Symbol.toStringTag;qr[lS]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(qr.prototype);Qr=class extends z{constructor(e){super(g.Duration),this.unit=e}toString(){return`Duration<${E[this.unit]}>`}};dS=Symbol.toStringTag;Qr[dS]=(t=>(t.unit=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Duration"))(Qr.prototype);ar=class extends z{constructor(e){super(g.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};fS=Symbol.toStringTag;ar[fS]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(ar.prototype);sr=class extends z{constructor(e){super(g.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};pS=Symbol.toStringTag;sr[pS]=(t=>(t.children=null,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeList"))(sr.prototype);ze=class extends z{constructor(e){super(g.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};mS=Symbol.toStringTag;ze[mS]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(ze.prototype);cr=class extends z{constructor(e,r,i){super(g.Union),this.mode=e,this.children=i,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((n,o,a)=>(n[o]=a)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};hS=Symbol.toStringTag;cr[hS]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(cr.prototype);en=class extends z{constructor(e){super(g.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};gS=Symbol.toStringTag;en[gS]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(en.prototype);Tt=class extends z{constructor(e,r){super(g.FixedSizeList),this.listSize=e,this.children=[r]}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}>`}};yS=Symbol.toStringTag;Tt[yS]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(Tt.prototype);ur=class extends z{constructor(e,r=!1){var i,n,o;if(super(g.Map),this.children=[e],this.keysSorted=r,e&&(e.name="entries",!((i=e?.type)===null||i===void 0)&&i.children)){let a=(n=e?.type)===null||n===void 0?void 0:n.children[0];a&&(a.name="key");let s=(o=e?.type)===null||o===void 0?void 0:o.children[1];s&&(s.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};vS=Symbol.toStringTag;ur[vS]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(ur.prototype);CN=(t=>()=>++t)(-1),Nt=class extends z{constructor(e,r,i,n){super(g.Dictionary),this.indices=r,this.dictionary=e,this.isOrdered=n||!1,this.id=i==null?CN():ie(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};bS=Symbol.toStringTag;Nt[bS]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(Nt.prototype)});function jN(t,e,r=!0){return typeof e=="number"?Ko(t,e,r):typeof e=="string"&&e in g?Ko(t,g[e],r):e&&e instanceof z?Ko(t,wS(e),r):e?.type&&e.type instanceof z?Ko(t,wS(e.type),r):Ko(t,g.NONE,r)}function Ko(t,e,r=!0){let i=null;switch(e){case g.Null:i=t.visitNull;break;case g.Bool:i=t.visitBool;break;case g.Int:i=t.visitInt;break;case g.Int8:i=t.visitInt8||t.visitInt;break;case g.Int16:i=t.visitInt16||t.visitInt;break;case g.Int32:i=t.visitInt32||t.visitInt;break;case g.Int64:i=t.visitInt64||t.visitInt;break;case g.Uint8:i=t.visitUint8||t.visitInt;break;case g.Uint16:i=t.visitUint16||t.visitInt;break;case g.Uint32:i=t.visitUint32||t.visitInt;break;case g.Uint64:i=t.visitUint64||t.visitInt;break;case g.Float:i=t.visitFloat;break;case g.Float16:i=t.visitFloat16||t.visitFloat;break;case g.Float32:i=t.visitFloat32||t.visitFloat;break;case g.Float64:i=t.visitFloat64||t.visitFloat;break;case g.Utf8:i=t.visitUtf8;break;case g.LargeUtf8:i=t.visitLargeUtf8;break;case g.Utf8View:i=t.visitUtf8View||t.visitUtf8;break;case g.Binary:i=t.visitBinary;break;case g.LargeBinary:i=t.visitLargeBinary;break;case g.BinaryView:i=t.visitBinaryView||t.visitBinary;break;case g.FixedSizeBinary:i=t.visitFixedSizeBinary;break;case g.Date:i=t.visitDate;break;case g.DateDay:i=t.visitDateDay||t.visitDate;break;case g.DateMillisecond:i=t.visitDateMillisecond||t.visitDate;break;case g.Timestamp:i=t.visitTimestamp;break;case g.TimestampSecond:i=t.visitTimestampSecond||t.visitTimestamp;break;case g.TimestampMillisecond:i=t.visitTimestampMillisecond||t.visitTimestamp;break;case g.TimestampMicrosecond:i=t.visitTimestampMicrosecond||t.visitTimestamp;break;case g.TimestampNanosecond:i=t.visitTimestampNanosecond||t.visitTimestamp;break;case g.Time:i=t.visitTime;break;case g.TimeSecond:i=t.visitTimeSecond||t.visitTime;break;case g.TimeMillisecond:i=t.visitTimeMillisecond||t.visitTime;break;case g.TimeMicrosecond:i=t.visitTimeMicrosecond||t.visitTime;break;case g.TimeNanosecond:i=t.visitTimeNanosecond||t.visitTime;break;case g.Decimal:i=t.visitDecimal;break;case g.List:i=t.visitList;break;case g.LargeList:i=t.visitLargeList;break;case g.Struct:i=t.visitStruct;break;case g.Union:i=t.visitUnion;break;case g.DenseUnion:i=t.visitDenseUnion||t.visitUnion;break;case g.SparseUnion:i=t.visitSparseUnion||t.visitUnion;break;case g.Dictionary:i=t.visitDictionary;break;case g.Interval:i=t.visitInterval;break;case g.IntervalDayTime:i=t.visitIntervalDayTime||t.visitInterval;break;case g.IntervalYearMonth:i=t.visitIntervalYearMonth||t.visitInterval;break;case g.IntervalMonthDayNano:i=t.visitIntervalMonthDayNano||t.visitInterval;break;case g.Duration:i=t.visitDuration;break;case g.DurationSecond:i=t.visitDurationSecond||t.visitDuration;break;case g.DurationMillisecond:i=t.visitDurationMillisecond||t.visitDuration;break;case g.DurationMicrosecond:i=t.visitDurationMicrosecond||t.visitDuration;break;case g.DurationNanosecond:i=t.visitDurationNanosecond||t.visitDuration;break;case g.FixedSizeList:i=t.visitFixedSizeList;break;case g.Map:i=t.visitMap;break}if(typeof i=="function")return i;if(!r)return()=>null;throw new Error(`Unrecognized type '${g[e]}'`)}function wS(t){switch(t.typeId){case g.Null:return g.Null;case g.Int:{let{bitWidth:e,isSigned:r}=t;switch(e){case 8:return r?g.Int8:g.Uint8;case 16:return r?g.Int16:g.Uint16;case 32:return r?g.Int32:g.Uint32;case 64:return r?g.Int64:g.Uint64}return g.Int}case g.Float:switch(t.precision){case Se.HALF:return g.Float16;case Se.SINGLE:return g.Float32;case Se.DOUBLE:return g.Float64}return g.Float;case g.Binary:return g.Binary;case g.LargeBinary:return g.LargeBinary;case g.BinaryView:return g.BinaryView;case g.Utf8:return g.Utf8;case g.LargeUtf8:return g.LargeUtf8;case g.Utf8View:return g.Utf8View;case g.Bool:return g.Bool;case g.Decimal:return g.Decimal;case g.Time:switch(t.unit){case E.SECOND:return g.TimeSecond;case E.MILLISECOND:return g.TimeMillisecond;case E.MICROSECOND:return g.TimeMicrosecond;case E.NANOSECOND:return g.TimeNanosecond}return g.Time;case g.Timestamp:switch(t.unit){case E.SECOND:return g.TimestampSecond;case E.MILLISECOND:return g.TimestampMillisecond;case E.MICROSECOND:return g.TimestampMicrosecond;case E.NANOSECOND:return g.TimestampNanosecond}return g.Timestamp;case g.Date:switch(t.unit){case Ve.DAY:return g.DateDay;case Ve.MILLISECOND:return g.DateMillisecond}return g.Date;case g.Interval:switch(t.unit){case Te.DAY_TIME:return g.IntervalDayTime;case Te.YEAR_MONTH:return g.IntervalYearMonth;case Te.MONTH_DAY_NANO:return g.IntervalMonthDayNano}return g.Interval;case g.Duration:switch(t.unit){case E.SECOND:return g.DurationSecond;case E.MILLISECOND:return g.DurationMillisecond;case E.MICROSECOND:return g.DurationMicrosecond;case E.NANOSECOND:return g.DurationNanosecond}return g.Duration;case g.Map:return g.Map;case g.List:return g.List;case g.LargeList:return g.LargeList;case g.Struct:return g.Struct;case g.Union:switch(t.mode){case Ae.Dense:return g.DenseUnion;case Ae.Sparse:return g.SparseUnion}return g.Union;case g.FixedSizeBinary:return g.FixedSizeBinary;case g.FixedSizeList:return g.FixedSizeList;case g.Dictionary:return g.Dictionary}throw new Error(`Unrecognized type '${g[t.typeId]}'`)}var J,Dr=m(()=>{Qe();ke();J=class{visitMany(e,...r){return e.map((i,n)=>this.visit(i,...r.map(o=>o[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,r=!0){return jN(this,e,r)}getVisitFnByTypeId(e,r=!0){return Ko(this,e,r)}visitNull(e,...r){return null}visitBool(e,...r){return null}visitInt(e,...r){return null}visitFloat(e,...r){return null}visitUtf8(e,...r){return null}visitLargeUtf8(e,...r){return null}visitUtf8View(e,...r){return null}visitBinary(e,...r){return null}visitLargeBinary(e,...r){return null}visitBinaryView(e,...r){return null}visitFixedSizeBinary(e,...r){return null}visitDate(e,...r){return null}visitTimestamp(e,...r){return null}visitTime(e,...r){return null}visitDecimal(e,...r){return null}visitList(e,...r){return null}visitLargeList(e,...r){return null}visitStruct(e,...r){return null}visitUnion(e,...r){return null}visitDictionary(e,...r){return null}visitInterval(e,...r){return null}visitDuration(e,...r){return null}visitFixedSizeList(e,...r){return null}visitMap(e,...r){return null}};J.prototype.visitInt8=null;J.prototype.visitInt16=null;J.prototype.visitInt32=null;J.prototype.visitInt64=null;J.prototype.visitUint8=null;J.prototype.visitUint16=null;J.prototype.visitUint32=null;J.prototype.visitUint64=null;J.prototype.visitFloat16=null;J.prototype.visitFloat32=null;J.prototype.visitFloat64=null;J.prototype.visitDateDay=null;J.prototype.visitDateMillisecond=null;J.prototype.visitTimestampSecond=null;J.prototype.visitTimestampMillisecond=null;J.prototype.visitTimestampMicrosecond=null;J.prototype.visitTimestampNanosecond=null;J.prototype.visitTimeSecond=null;J.prototype.visitTimeMillisecond=null;J.prototype.visitTimeMicrosecond=null;J.prototype.visitTimeNanosecond=null;J.prototype.visitDenseUnion=null;J.prototype.visitSparseUnion=null;J.prototype.visitIntervalDayTime=null;J.prototype.visitIntervalYearMonth=null;J.prototype.visitIntervalMonthDayNano=null;J.prototype.visitDuration=null;J.prototype.visitDurationSecond=null;J.prototype.visitDurationMillisecond=null;J.prototype.visitDurationMicrosecond=null;J.prototype.visitDurationNanosecond=null});var Wh={};Ie(Wh,{float64ToUint16:()=>qs,uint16ToFloat64:()=>Cl});function Cl(t){let e=(t&31744)>>10,r=(t&1023)/1024,i=Math.pow(-1,(t&32768)>>15);switch(e){case 31:return i*(r?Number.NaN:1/0);case 0:return i*(r?6103515625e-14*r:0)}return i*Math.pow(2,e-15)*(1+r)}function qs(t){if(t!==t)return 32256;$S[0]=t;let e=(Yo[1]&2147483648)>>16&65535,r=Yo[1]&2146435072,i=0;return r>=1089470464?Yo[0]>0?r=31744:(r=(r&2080374784)>>16,i=(Yo[1]&1048575)>>10):r<=1056964608?(i=1048576+(Yo[1]&1048575),i=1048576+(i<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,i=(Yo[1]&1048575)+512>>10),e|r|i&65535}var $S,Yo,Qs=m(()=>{$S=new Float64Array(1),Yo=new Uint32Array($S.buffer)});function K(t){return(e,r,i)=>{if(e.setValid(r,i!=null))return t(e,r,i)}}var V,MN,xS,RN,xn,Jh,IS,VN,Fl,jl,Gh,SS,ZN,kS,WN,DS,JN,Hh,Ml,Rl,Vl,Zl,Kh,Wl,Jl,Gl,Hl,Yh,Xh,AS,GN,HN,KN,YN,XN,qN,QN,zS,OS,eU,qh,Kl,Yl,Xl,ql,Ql,ed,td,Qh,tU,at,Yt=m(()=>{Ut();Dr();Rr();vn();Qs();Qe();ke();V=class extends J{};MN=(t,e,r)=>{t[e]=Math.floor(r/864e5)},xS=(t,e,r,i)=>{if(r+1<e.length){let n=ie(e[r]),o=ie(e[r+1]);t.set(i.subarray(0,o-n),n)}},RN=({offset:t,values:e},r,i)=>{let n=t+r;i?e[n>>3]|=1<<n%8:e[n>>3]&=~(1<<n%8)},xn=({values:t},e,r)=>{t[e]=r},Jh=({values:t},e,r)=>{t[e]=r},IS=({values:t},e,r)=>{t[e]=qs(r)},VN=(t,e,r)=>{switch(t.type.precision){case Se.HALF:return IS(t,e,r);case Se.SINGLE:case Se.DOUBLE:return Jh(t,e,r)}},Fl=({values:t},e,r)=>{MN(t,e,r.valueOf())},jl=({values:t},e,r)=>{t[e]=BigInt(r)},Gh=({stride:t,values:e},r,i)=>{e.set(i.subarray(0,t),t*r)},SS=({values:t,valueOffsets:e},r,i)=>xS(t,e,r,i),ZN=t=>{let e=t.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),t.variadicBuffers=e),e},kS=(t,e,r)=>{var i,n,o,a;let s=t.values;if(!s)throw new Error("BinaryView data is missing view buffer");let c=te.ELEMENT_WIDTH,u=e*c,l=u+c;if(u<0||l>s.length)throw new RangeError(`BinaryView index ${e} out of bounds`);s.fill(0,u,l);let d=new DataView(s.buffer,s.byteOffset+u,c),f=r.length;if(d.setInt32(te.LENGTH_OFFSET,f,!0),f<=te.INLINE_CAPACITY){s.set(r,u+te.INLINE_OFFSET);return}let p=((i=r[0])!==null&&i!==void 0?i:0)|((n=r[1])!==null&&n!==void 0?n:0)<<8|((o=r[2])!==null&&o!==void 0?o:0)<<16|((a=r[3])!==null&&a!==void 0?a:0)<<24;d.setUint32(te.INLINE_OFFSET,p>>>0,!0);let h=ZN(t),y=r.slice(),_=h.push(y)-1;d.setInt32(te.BUFFER_INDEX_OFFSET,_,!0),d.setInt32(te.BUFFER_OFFSET_OFFSET,0,!0)},WN=(t,e,r)=>{let i=r instanceof Uint8Array?r:new Uint8Array(r);kS(t,e,i)},DS=({values:t,valueOffsets:e},r,i)=>xS(t,e,r,Zt(i)),JN=(t,e,r)=>{let i=Zt(r);kS(t,e,i)},Hh=(t,e,r)=>{t.type.unit===Ve.DAY?Fl(t,e,r):jl(t,e,r)},Ml=({values:t},e,r)=>{t[e]=BigInt(r/1e3)},Rl=({values:t},e,r)=>{t[e]=BigInt(r)},Vl=({values:t},e,r)=>{t[e]=BigInt(r*1e3)},Zl=({values:t},e,r)=>{t[e]=BigInt(r*1e6)},Kh=(t,e,r)=>{switch(t.type.unit){case E.SECOND:return Ml(t,e,r);case E.MILLISECOND:return Rl(t,e,r);case E.MICROSECOND:return Vl(t,e,r);case E.NANOSECOND:return Zl(t,e,r)}},Wl=({values:t},e,r)=>{t[e]=r},Jl=({values:t},e,r)=>{t[e]=r},Gl=({values:t},e,r)=>{t[e]=r},Hl=({values:t},e,r)=>{t[e]=r},Yh=(t,e,r)=>{switch(t.type.unit){case E.SECOND:return Wl(t,e,r);case E.MILLISECOND:return Jl(t,e,r);case E.MICROSECOND:return Gl(t,e,r);case E.NANOSECOND:return Hl(t,e,r)}},Xh=({values:t,stride:e},r,i)=>{t.set(i.subarray(0,e),e*r)},AS=(t,e,r)=>{let i=t.children[0],n=t.valueOffsets,o=at.getVisitFn(i),a=ie(n[e]),s=ie(n[e+1]);if(Array.isArray(r))for(let c=-1,u=a;u<s;)o(i,u++,r[++c]);else for(let c=-1,u=a;u<s;)o(i,u++,r.get(++c))},GN=(t,e,r)=>{let i=t.children[0],{valueOffsets:n}=t,o=at.getVisitFn(i),{[e]:a,[e+1]:s}=n,c=r instanceof Map?r.entries():Object.entries(r);for(let u of c)if(o(i,a,u),++a>=s)break},HN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e[o]),KN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e.get(o)),YN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e.get(n.name)),XN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e[n.name]),qN=(t,e,r)=>{let i=t.type.children.map(o=>at.getVisitFn(o.type)),n=r instanceof Map?YN(e,r):r instanceof P?KN(e,r):Array.isArray(r)?HN(e,r):XN(e,r);t.type.children.forEach((o,a)=>n(i[a],t.children[a],o,a))},QN=(t,e,r)=>{t.type.mode===Ae.Dense?zS(t,e,r):OS(t,e,r)},zS=(t,e,r)=>{let i=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[i];at.visit(n,t.valueOffsets[e],r)},OS=(t,e,r)=>{let i=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[i];at.visit(n,e,r)},eU=(t,e,r)=>{var i;(i=t.dictionary)===null||i===void 0||i.set(t.values[e],r)},qh=(t,e,r)=>{switch(t.type.unit){case Te.YEAR_MONTH:return Yl(t,e,r);case Te.DAY_TIME:return Kl(t,e,r);case Te.MONTH_DAY_NANO:return Xl(t,e,r)}},Kl=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},Yl=({values:t},e,r)=>{t[e]=r[0]*12+r[1]%12},Xl=({values:t,stride:e},r,i)=>{t.set(i.subarray(0,e),e*r)},ql=({values:t},e,r)=>{t[e]=r},Ql=({values:t},e,r)=>{t[e]=r},ed=({values:t},e,r)=>{t[e]=r},td=({values:t},e,r)=>{t[e]=r},Qh=(t,e,r)=>{switch(t.type.unit){case E.SECOND:return ql(t,e,r);case E.MILLISECOND:return Ql(t,e,r);case E.MICROSECOND:return ed(t,e,r);case E.NANOSECOND:return td(t,e,r)}},tU=(t,e,r)=>{let{stride:i}=t,n=t.children[0],o=at.getVisitFn(n);if(Array.isArray(r))for(let a=-1,s=e*i;++a<i;)o(n,s+a,r[a]);else for(let a=-1,s=e*i;++a<i;)o(n,s+a,r.get(a))};V.prototype.visitBool=K(RN);V.prototype.visitInt=K(xn);V.prototype.visitInt8=K(xn);V.prototype.visitInt16=K(xn);V.prototype.visitInt32=K(xn);V.prototype.visitInt64=K(xn);V.prototype.visitUint8=K(xn);V.prototype.visitUint16=K(xn);V.prototype.visitUint32=K(xn);V.prototype.visitUint64=K(xn);V.prototype.visitFloat=K(VN);V.prototype.visitFloat16=K(IS);V.prototype.visitFloat32=K(Jh);V.prototype.visitFloat64=K(Jh);V.prototype.visitUtf8=K(DS);V.prototype.visitLargeUtf8=K(DS);V.prototype.visitUtf8View=K(JN);V.prototype.visitBinary=K(SS);V.prototype.visitLargeBinary=K(SS);V.prototype.visitBinaryView=K(WN);V.prototype.visitFixedSizeBinary=K(Gh);V.prototype.visitDate=K(Hh);V.prototype.visitDateDay=K(Fl);V.prototype.visitDateMillisecond=K(jl);V.prototype.visitTimestamp=K(Kh);V.prototype.visitTimestampSecond=K(Ml);V.prototype.visitTimestampMillisecond=K(Rl);V.prototype.visitTimestampMicrosecond=K(Vl);V.prototype.visitTimestampNanosecond=K(Zl);V.prototype.visitTime=K(Yh);V.prototype.visitTimeSecond=K(Wl);V.prototype.visitTimeMillisecond=K(Jl);V.prototype.visitTimeMicrosecond=K(Gl);V.prototype.visitTimeNanosecond=K(Hl);V.prototype.visitDecimal=K(Xh);V.prototype.visitList=K(AS);V.prototype.visitLargeList=K(AS);V.prototype.visitStruct=K(qN);V.prototype.visitUnion=K(QN);V.prototype.visitDenseUnion=K(zS);V.prototype.visitSparseUnion=K(OS);V.prototype.visitDictionary=K(eU);V.prototype.visitInterval=K(qh);V.prototype.visitIntervalDayTime=K(Kl);V.prototype.visitIntervalYearMonth=K(Yl);V.prototype.visitIntervalMonthDayNano=K(Xl);V.prototype.visitDuration=K(Qh);V.prototype.visitDurationSecond=K(ql);V.prototype.visitDurationMillisecond=K(Ql);V.prototype.visitDurationMicrosecond=K(ed);V.prototype.visitDurationNanosecond=K(td);V.prototype.visitFixedSizeList=K(tU);V.prototype.visitMap=K(GN);at=new V});var Ar,Xo,Qn,eg,tg,rU,rg=m(()=>{Hs();Vi();Yt();Ar=Symbol.for("parent"),Xo=Symbol.for("rowIndex"),Qn=class{constructor(e,r){return this[Ar]=e,this[Xo]=r,new Proxy(this,rU)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Xo],r=this[Ar],i=r.type.children,n={};for(let o=-1,a=i.length;++o<a;)n[i[o].name]=He.visit(r.children[o],e);return n}toString(){return`{${[...this].map(([e,r])=>`${Sr(e)}: ${Sr(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new eg(this[Ar],this[Xo])}},eg=class{constructor(e,r){this.childIndex=0,this.children=e.children,this.rowIndex=r,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,He.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Qn.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ar]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xo]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});tg=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Ar].type.children.map(r=>r.name)}has(e,r){return e[Ar].type.children.some(i=>i.name===r)}getOwnPropertyDescriptor(e,r){if(e[Ar].type.children.some(i=>i.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let i=e[Ar].type.children.findIndex(n=>n.name===r);if(i!==-1){let n=He.visit(e[Ar].children[i],e[Xo]);return Reflect.set(e,r,n),n}}set(e,r,i){let n=e[Ar].type.children.findIndex(o=>o.name===r);return n!==-1?(at.visit(e[Ar].children[n],e[Xo],i),Reflect.set(e,r,i)):Reflect.has(e,r)||typeof r=="symbol"?Reflect.set(e,r,i):!1}},rU=new tg});function G(t){return(e,r)=>e.getValid(r)?t(e,r):null}var F,nU,qo,iU,oU,BS,aU,TS,NS,ei,sU,US,cU,PS,LS,uU,ES,lU,dU,fU,pU,CS,FS,jS,MS,mU,RS,VS,ZS,WS,hU,gU,JS,yU,vU,bU,GS,HS,_U,wU,KS,YS,XS,qS,QS,e0,t0,$U,xU,He,Vi=m(()=>{Zh();Ut();Dr();rd();rg();Rr();vn();Qs();Qe();F=class extends J{};nU=(t,e)=>864e5*t[e],qo=16,iU=12,oU=(t,e)=>null,BS=(t,e,r)=>{if(r+1>=e.length)return null;let i=ie(e[r]),n=ie(e[r+1]);return t.subarray(i,n)},aU=({offset:t,values:e},r)=>{let i=t+r;return(e[i>>3]&1<<i%8)!==0},TS=({values:t},e)=>nU(t,e),NS=({values:t},e)=>ie(t[e]),ei=({stride:t,values:e},r)=>e[t*r],sU=({stride:t,values:e},r)=>Cl(e[t*r]),US=({values:t},e)=>t[e],cU=({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1)),PS=({values:t,valueOffsets:e},r)=>BS(t,e,r),LS=(t,e)=>{var r;let i=t.values;if(!i)throw new Error("BinaryView data is missing view buffer");let n=e*qo,o=n+qo;if(n<0||o>i.length)throw new Error(`BinaryView data buffer is too short: expected ${qo} bytes, got ${Math.max(0,i.length-n)}`);let a=i.subarray(n,o);if(a.length<qo)throw new Error(`BinaryView data buffer is too short: expected ${qo} bytes, got ${a.length}`);let s=new DataView(i.buffer,a.byteOffset,qo),c=s.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=iU)return a.subarray(4,4+c);let u=s.getInt32(8,!0),l=s.getInt32(12,!0),d=(r=t.variadicBuffers)===null||r===void 0?void 0:r[u];if(!d)throw new Error(`BinaryView variadic buffer ${u} is missing`);return d.subarray(l,l+c)},uU=(t,e)=>LS(t,e),ES=({values:t,valueOffsets:e},r)=>{let i=BS(t,e,r);return i!==null?Mo(i):null},lU=(t,e)=>{let r=LS(t,e);return Mo(r)},dU=({values:t},e)=>t[e],fU=({type:t,values:e},r)=>t.precision!==Se.HALF?e[r]:Cl(e[r]),pU=(t,e)=>t.type.unit===Ve.DAY?TS(t,e):NS(t,e),CS=({values:t},e)=>1e3*ie(t[e]),FS=({values:t},e)=>ie(t[e]),jS=({values:t},e)=>jh(t[e],BigInt(1e3)),MS=({values:t},e)=>jh(t[e],BigInt(1e6)),mU=(t,e)=>{switch(t.type.unit){case E.SECOND:return CS(t,e);case E.MILLISECOND:return FS(t,e);case E.MICROSECOND:return jS(t,e);case E.NANOSECOND:return MS(t,e)}},RS=({values:t},e)=>t[e],VS=({values:t},e)=>t[e],ZS=({values:t},e)=>t[e],WS=({values:t},e)=>t[e],hU=(t,e)=>{switch(t.type.unit){case E.SECOND:return RS(t,e);case E.MILLISECOND:return VS(t,e);case E.MICROSECOND:return ZS(t,e);case E.NANOSECOND:return WS(t,e)}},gU=({values:t,stride:e},r)=>Ys.decimal(t.subarray(e*r,e*(r+1))),JS=(t,e)=>{let{valueOffsets:r,stride:i,children:n}=t,o=ie(r[e*i]),a=ie(r[e*i+1]),c=n[0].slice(o,a-o);return new P([c])},yU=(t,e)=>{let{valueOffsets:r,children:i}=t,{[e]:n,[e+1]:o}=r,a=i[0];return new tn(a.slice(n,o-n))},vU=(t,e)=>new Qn(t,e),bU=(t,e)=>t.type.mode===Ae.Dense?GS(t,e):HS(t,e),GS=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[r];return He.visit(i,t.valueOffsets[e])},HS=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[r];return He.visit(i,e)},_U=(t,e)=>{var r;return(r=t.dictionary)===null||r===void 0?void 0:r.get(t.values[e])},wU=(t,e)=>t.type.unit===Te.MONTH_DAY_NANO?XS(t,e):t.type.unit===Te.DAY_TIME?KS(t,e):YS(t,e),KS=({values:t},e)=>t.subarray(2*e,2*(e+1)),YS=({values:t},e)=>{let r=t[e],i=new Int32Array(2);return i[0]=Math.trunc(r/12),i[1]=Math.trunc(r%12),i},XS=({values:t},e)=>t.subarray(4*e,4*(e+1)),qS=({values:t},e)=>t[e],QS=({values:t},e)=>t[e],e0=({values:t},e)=>t[e],t0=({values:t},e)=>t[e],$U=(t,e)=>{switch(t.type.unit){case E.SECOND:return qS(t,e);case E.MILLISECOND:return QS(t,e);case E.MICROSECOND:return e0(t,e);case E.NANOSECOND:return t0(t,e)}},xU=(t,e)=>{let{stride:r,children:i}=t,o=i[0].slice(e*r,r);return new P([o])};F.prototype.visitNull=G(oU);F.prototype.visitBool=G(aU);F.prototype.visitInt=G(dU);F.prototype.visitInt8=G(ei);F.prototype.visitInt16=G(ei);F.prototype.visitInt32=G(ei);F.prototype.visitInt64=G(US);F.prototype.visitUint8=G(ei);F.prototype.visitUint16=G(ei);F.prototype.visitUint32=G(ei);F.prototype.visitUint64=G(US);F.prototype.visitFloat=G(fU);F.prototype.visitFloat16=G(sU);F.prototype.visitFloat32=G(ei);F.prototype.visitFloat64=G(ei);F.prototype.visitUtf8=G(ES);F.prototype.visitLargeUtf8=G(ES);F.prototype.visitUtf8View=G(lU);F.prototype.visitBinary=G(PS);F.prototype.visitLargeBinary=G(PS);F.prototype.visitBinaryView=G(uU);F.prototype.visitFixedSizeBinary=G(cU);F.prototype.visitDate=G(pU);F.prototype.visitDateDay=G(TS);F.prototype.visitDateMillisecond=G(NS);F.prototype.visitTimestamp=G(mU);F.prototype.visitTimestampSecond=G(CS);F.prototype.visitTimestampMillisecond=G(FS);F.prototype.visitTimestampMicrosecond=G(jS);F.prototype.visitTimestampNanosecond=G(MS);F.prototype.visitTime=G(hU);F.prototype.visitTimeSecond=G(RS);F.prototype.visitTimeMillisecond=G(VS);F.prototype.visitTimeMicrosecond=G(ZS);F.prototype.visitTimeNanosecond=G(WS);F.prototype.visitDecimal=G(gU);F.prototype.visitList=G(JS);F.prototype.visitLargeList=G(JS);F.prototype.visitStruct=G(vU);F.prototype.visitUnion=G(bU);F.prototype.visitDenseUnion=G(GS);F.prototype.visitSparseUnion=G(HS);F.prototype.visitDictionary=G(_U);F.prototype.visitInterval=G(wU);F.prototype.visitIntervalDayTime=G(KS);F.prototype.visitIntervalYearMonth=G(YS);F.prototype.visitIntervalMonthDayNano=G(XS);F.prototype.visitDuration=G($U);F.prototype.visitDurationSecond=G(qS);F.prototype.visitDurationMillisecond=G(QS);F.prototype.visitDurationMicrosecond=G(e0);F.prototype.visitDurationNanosecond=G(t0);F.prototype.visitFixedSizeList=G(xU);F.prototype.visitMap=G(yU);He=new F});var ti,ea,Qo,ng,tn,ig,og,rd=m(()=>{Ut();Hs();Vi();Yt();ti=Symbol.for("keys"),ea=Symbol.for("vals"),Qo=Symbol.for("kKeysAsStrings"),ng=Symbol.for("_kKeysAsStrings"),tn=class{constructor(e){return this[ti]=new P([e.children[0]]).memoize(),this[ea]=e.children[1],new Proxy(this,new og)}get[Qo](){return this[ng]||(this[ng]=Array.from(this[ti].toArray(),String))}[Symbol.iterator](){return new ig(this[ti],this[ea])}get size(){return this[ti].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ti],r=this[ea],i={};for(let n=-1,o=e.length;++n<o;)i[e.get(n)]=He.visit(r,n);return i}toString(){return`{${[...this].map(([e,r])=>`${Sr(e)}: ${Sr(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},ig=class{constructor(e,r){this.keys=e,this.vals=r,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),He.visit(this.vals,e)]})}},og=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Qo]}has(e,r){return e[Qo].includes(r)}getOwnPropertyDescriptor(e,r){if(e[Qo].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let i=e[Qo].indexOf(r);if(i!==-1){let n=He.visit(Reflect.get(e,ea),i);return Reflect.set(e,r,n),n}}set(e,r,i){let n=e[Qo].indexOf(r);return n!==-1?(at.visit(Reflect.get(e,ea),n,i),Reflect.set(e,r,i)):Reflect.has(e,r)?Reflect.set(e,r,i):!1}};Object.defineProperties(tn.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ti]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ea]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ng]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var ag={};Ie(ag,{clampRange:()=>ec,createElementComparator:()=>ri,wrapIndex:()=>Zi});function ec(t,e,r,i){let{length:n=0}=t,o=typeof e!="number"?0:e,a=typeof r!="number"?n:r;return o<0&&(o=(o%n+n)%n),a<0&&(a=(a%n+n)%n),a<o&&(r0=o,o=a,a=r0),a>n&&(a=n),i?i(t,o,a):[o,a]}function ri(t){if(typeof t!=="object"||t===null)return n0(t)?n0:r=>r===t;if(t instanceof Date){let r=t.valueOf();return i=>i instanceof Date?i.valueOf()===r:!1}return ArrayBuffer.isView(t)?r=>r?ah(t,r):!1:t instanceof Map?SU(t):Array.isArray(t)?IU(t):t instanceof P?kU(t):DU(t,!0)}function IU(t){let e=[];for(let r=-1,i=t.length;++r<i;)e[r]=ri(t[r]);return nd(e)}function SU(t){let e=-1,r=[];for(let i of t.values())r[++e]=ri(i);return nd(r)}function kU(t){let e=[];for(let r=-1,i=t.length;++r<i;)e[r]=ri(t.get(r));return nd(e)}function DU(t,e=!1){let r=Object.keys(t);if(!e&&r.length===0)return()=>!1;let i=[];for(let n=-1,o=r.length;++n<o;)i[n]=ri(t[r[n]]);return nd(i,r)}function nd(t,e){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return AU(t,r);case Map:return i0(t,r,r.keys());case tn:case Qn:case Object:case void 0:return i0(t,r,e||Object.keys(r))}return r instanceof P?zU(t,r):!1}}function AU(t,e){let r=t.length;if(e.length!==r)return!1;for(let i=-1;++i<r;)if(!t[i](e[i]))return!1;return!0}function zU(t,e){let r=t.length;if(e.length!==r)return!1;for(let i=-1;++i<r;)if(!t[i](e.get(i)))return!1;return!0}function i0(t,e,r){let i=r[Symbol.iterator](),n=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),o=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),a=0,s=t.length,c=o.next(),u=i.next(),l=n.next();for(;a<s&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!t[a](c.value));++a,u=i.next(),l=n.next(),c=o.next());return a===s&&u.done&&l.done&&c.done?!0:(i.return&&i.return(),n.return&&n.return(),o.return&&o.return(),!1)}var r0,Zi,n0,ta=m(()=>{Ut();rd();rg();qe();Zi=(t,e)=>t<0?e+t:t,n0=t=>t!==t});var sg={};Ie(sg,{BitIterator:()=>Wi,getBit:()=>o0,getBool:()=>od,packBools:()=>Gi,popcnt_array:()=>a0,popcnt_bit_range:()=>tc,popcnt_uint32:()=>id,setBool:()=>OU,truncateBitmap:()=>Ji});function od(t,e,r,i){return(r&1<<i)!==0}function o0(t,e,r,i){return(r&1<<i)>>i}function OU(t,e,r){return r?!!(t[e>>3]|=1<<e%8)||!0:!(t[e>>3]&=~(1<<e%8))&&!1}function Ji(t,e,r){let i=r.byteLength+7&-8;if(t>0||r.byteLength<i){let n=new Uint8Array(i);return n.set(t%8===0?r.subarray(t>>3):Gi(new Wi(r,t,e,null,od)).subarray(0,i)),n}return r}function Gi(t){let e=[],r=0,i=0,n=0;for(let a of t)a&&(n|=1<<i),++i===8&&(e[r++]=n,n=i=0);(r===0||i>0)&&(e[r++]=n);let o=new Uint8Array(e.length+7&-8);return o.set(e),o}function tc(t,e,r){if(r-e<=0)return 0;if(r-e<8){let o=0;for(let a of new Wi(t,e,r-e,t,o0))o+=a;return o}let i=r>>3<<3,n=e+(e%8===0?0:8-e%8);return tc(t,e,n)+tc(t,i,r)+a0(t,n>>3,i-n>>3)}function a0(t,e,r){let i=0,n=Math.trunc(e),o=new DataView(t.buffer,t.byteOffset,t.byteLength),a=r===void 0?t.byteLength:n+r;for(;a-n>=4;)i+=id(o.getUint32(n)),n+=4;for(;a-n>=2;)i+=id(o.getUint16(n)),n+=2;for(;a-n>=1;)i+=id(o.getUint8(n)),n+=1;return i}function id(t){let e=Math.trunc(t);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var Wi,ra=m(()=>{Wi=class{constructor(e,r,i,n,o){this.bytes=e,this.length=i,this.context=n,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function U(t){return TU.visit(t)}var BU,s0,Q,cg,TU,zr=m(()=>{Ut();Qe();ke();ra();ke();Dr();qe();BU=-1,s0=Symbol.for("apache-arrow/Data"),Q=class t{static isData(e){return e?.[s0]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return z.isSparseUnion(e)?this.children.some(r=>r.nullable):z.isDenseUnion(e)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:r,values:i,nullBitmap:n,typeIds:o}=this;return r&&(e+=r.byteLength),i&&(e+=i.byteLength),n&&(e+=n.byteLength),o&&(e+=o.byteLength),e+=this.variadicBuffers.reduce((a,s)=>{var c;return a+((c=s?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((a,s)=>a+s.byteLength,e)}get nullCount(){if(z.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let e=this._nullCount,r;return e<=BU&&(r=this.nullBitmap)&&(this._nullCount=e=r.length===0?0:this.length-tc(r,this.offset,this.offset+this.length)),e}constructor(e,r,i,n,o,a=[],s,c=[]){var u;this.type=e,this.children=a,this.dictionary=s,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;o instanceof t?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets,this.variadicBuffers=o.variadicBuffers):(this.stride=Kt(e),o&&((l=o[0])&&(this.valueOffsets=l),(l=o[1])&&(this.values=l),(l=o[2])&&(this.nullBitmap=l),(l=o[3])&&(this.typeIds=l)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:r}=this;if(z.isUnion(r)){let i=r,n=this.typeIds[e],o=i.typeIdToChildIndex[n],a=this.children[o],s=this.valueOffsets,c=i.mode===Ae.Dense&&s?Number(s[e]):e;return a.getValid(c)}if(this.nullable&&this.nullCount>0){let i=this.offset+e;return(this.nullBitmap[i>>3]&1<<i%8)!==0}return!0}setValid(e,r){let i,{type:n}=this;if(z.isUnion(n)){let o=n,a=this.typeIds[e],s=o.typeIdToChildIndex[a],c=this.children[s],u=this.valueOffsets,l=o.mode===Ae.Dense&&u?Number(u[e]):e;i=c.getValid(l),c.setValid(l,r)}else{let{nullBitmap:o}=this,{offset:a,length:s}=this,c=a+e,u=1<<c%8,l=c>>3;(!o||o.byteLength<=l)&&(o=new Uint8Array((a+s+63&-64)>>3).fill(255),this.nullCount>0?(o.set(Ji(a,s,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let d=o[l];i=(d&u)!==0,o[l]=r?d|u:d&~u}return i!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(e=this.type,r=this.offset,i=this.length,n=this._nullCount,o=this,a=this.children,s=this.variadicBuffers){return new t(e,r,i,n,o,a,this.dictionary,s)}slice(e,r){let{stride:i,typeId:n,children:o}=this,a=+(this._nullCount===0)-1,s=n===16?i:1,c=this._sliceBuffers(e,r,i,n);return this.clone(this.type,this.offset+e,r,a,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,s*e,s*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===g.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:i}=this,n=new Uint8Array((e+63&-64)>>3).fill(255,0,r>>3);n[r>>3]=(1<<r-(r&-8))-1,i>0&&n.set(Ji(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Jt.VALIDITY]=n,this.clone(this.type,0,e,i+(e-r),o,this.children,this.variadicBuffers)}_sliceBuffers(e,r,i,n){let o,{buffers:a}=this;if((o=a[Jt.TYPE])&&(a[Jt.TYPE]=o.subarray(e,e+r)),z.isBinaryView(this.type)||z.isUtf8View(this.type)){let s=te.ELEMENT_WIDTH;(o=a[Jt.DATA])&&(a[Jt.DATA]=o.subarray(e*s,(e+r)*s))}else(o=a[Jt.OFFSET])&&(a[Jt.OFFSET]=o.subarray(e,e+r+1))||(o=a[Jt.DATA])&&(a[Jt.DATA]=n===6?o:o.subarray(i*e,i*(e+r)));return a}_sliceChildren(e,r,i){return e.map(n=>n.slice(r,i))}};Q.prototype.children=Object.freeze([]);Q.prototype[s0]=!0;Object.defineProperty(Q,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Q&&Q.isData(e)}});cg=class t extends J{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:r,["offset"]:i=0,["length"]:n=0}=e;return new Q(r,i,n,n)}visitBool(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length>>3,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitInt(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitFloat(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitUtf8(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitUtf8View(e){var r;let{["type"]:i,["offset"]:n=0}=e,o=ne(i.ArrayType,e.views),a=C(e.nullBitmap),s=(e.variadicBuffers||[]).map(l=>C(l)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/Bt.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new Q(i,n,c,u,[void 0,o,a],[],void 0,s)}visitLargeUtf8(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bs(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitBinary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitBinaryView(e){var r;let{["type"]:i,["offset"]:n=0}=e,o=ne(i.ArrayType,e.views),a=C(e.nullBitmap),s=(e.variadicBuffers||[]).map(l=>C(l)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/te.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new Q(i,n,c,u,[void 0,o,a],[],void 0,s)}visitLargeBinary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bs(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitFixedSizeBinary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitDate(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitTimestamp(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitTime(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitDecimal(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitList(e){let{["type"]:r,["offset"]:i=0,["child"]:n}=e,o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,void 0,o],[n])}visitLargeList(e){let{["type"]:r,["offset"]:i=0,["child"]:n}=e,o=C(e.nullBitmap),a=Bs(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,void 0,o],[n])}visitStruct(e){let{["type"]:r,["offset"]:i=0,["children"]:n=[]}=e,o=C(e.nullBitmap),{length:a=n.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,void 0,o],n)}visitUnion(e){let{["type"]:r,["offset"]:i=0,["children"]:n=[]}=e,o=ne(r.ArrayType,e.typeIds),{["length"]:a=o.length,["nullCount"]:s=-1}=e;if(z.isSparseUnion(r))return new Q(r,i,a,s,[void 0,void 0,void 0,o],n);let c=Bi(e.valueOffsets);return new Q(r,i,a,s,[c,void 0,void 0,o],n)}visitDictionary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.indices.ArrayType,e.data),{["dictionary"]:a=new P([new t().visit({type:r.dictionary})])}=e,{["length"]:s=o.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[void 0,o,n],[],a)}visitInterval(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitDuration(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitFixedSizeList(e){let{["type"]:r,["offset"]:i=0,["child"]:n=new t().visit({type:r.valueType})}=e,o=C(e.nullBitmap),{["length"]:a=n.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,void 0,o],[n])}visitMap(e){let{["type"]:r,["offset"]:i=0,["child"]:n=new t().visit({type:r.childType})}=e,o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,void 0,o],[n])}},TU=new cg});function c0(t){return t.some(e=>e.nullable)}function ad(t){return t.reduce((e,r)=>e+r.nullCount,0)}function sd(t){return t.reduce((e,r,i)=>(e[i+1]=e[i]+r.length,e),new Uint32Array(t.length+1))}function cd(t,e,r,i){let n=[];for(let o=-1,a=t.length;++o<a;){let s=t[o],c=e[o],{length:u}=s;if(c>=i)break;if(r>=c+u)continue;if(c>=r&&c+u<=i){n.push(s);continue}let l=Math.max(0,r-c),d=Math.min(i-c,u);n.push(s.slice(l,d-l))}return n.length===0&&n.push(t[0].slice(0,0)),n}function ug(t,e,r,i){let n=0,o=0,a=e.length-1;do{if(n>=a-1)return r<e[a]?i(t,n,r-e[n]):null;o=n+Math.trunc((a-n)*.5),r<e[o]?a=o:n=o}while(n<a)}function nc(t,e){return t.getValid(e)}function na(t){function e(r,i,n){return t(r[i],n)}return function(r){let i=this.data;return ug(i,this._offsets,r,e)}}function ud(t){let e;function r(i,n,o){return t(i[n],o,e)}return function(i,n){let o=this.data;e=n;let a=ug(o,this._offsets,i,r);return e=void 0,a}}function ld(t){let e;function r(i,n,o){let a=o,s=0,c=0;for(let u=n-1,l=i.length;++u<l;){let d=i[u];if(~(s=t(d,e,a)))return c+s;a=0,c+=d.length}return-1}return function(i,n){e=i;let o=this.data,a=typeof n!="number"?r(o,0,0):ug(o,this._offsets,n,r);return e=void 0,a}}var rc,dd=m(()=>{rc=class{constructor(e=0,r){this.numChunks=e,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function NU(t,e){return e===null&&t.length>0?0:-1}function UU(t,e){let{nullBitmap:r}=t;if(!r||t.nullCount<=0)return-1;let i=0;for(let n of new Wi(r,t.offset+(e||0),t.length,r,od)){if(!n)return i;++i}return-1}function X(t,e,r){if(e===void 0)return-1;if(e===null)switch(t.typeId){case g.Union:break;case g.Dictionary:break;default:return UU(t,r)}let i=He.getVisitFn(t),n=ri(e);for(let o=(r||0)-1,a=t.length;++o<a;)if(n(i(t,o)))return o;return-1}function u0(t,e,r){let i=He.getVisitFn(t),n=ri(e);for(let o=(r||0)-1,a=t.length;++o<a;)if(n(i(t,o)))return o;return-1}var j,Hi,fd=m(()=>{Qe();Dr();Vi();ra();ta();j=class extends J{};j.prototype.visitNull=NU;j.prototype.visitBool=X;j.prototype.visitInt=X;j.prototype.visitInt8=X;j.prototype.visitInt16=X;j.prototype.visitInt32=X;j.prototype.visitInt64=X;j.prototype.visitUint8=X;j.prototype.visitUint16=X;j.prototype.visitUint32=X;j.prototype.visitUint64=X;j.prototype.visitFloat=X;j.prototype.visitFloat16=X;j.prototype.visitFloat32=X;j.prototype.visitFloat64=X;j.prototype.visitUtf8=X;j.prototype.visitLargeUtf8=X;j.prototype.visitUtf8View=X;j.prototype.visitBinary=X;j.prototype.visitLargeBinary=X;j.prototype.visitBinaryView=X;j.prototype.visitFixedSizeBinary=X;j.prototype.visitDate=X;j.prototype.visitDateDay=X;j.prototype.visitDateMillisecond=X;j.prototype.visitTimestamp=X;j.prototype.visitTimestampSecond=X;j.prototype.visitTimestampMillisecond=X;j.prototype.visitTimestampMicrosecond=X;j.prototype.visitTimestampNanosecond=X;j.prototype.visitTime=X;j.prototype.visitTimeSecond=X;j.prototype.visitTimeMillisecond=X;j.prototype.visitTimeMicrosecond=X;j.prototype.visitTimeNanosecond=X;j.prototype.visitDecimal=X;j.prototype.visitList=X;j.prototype.visitLargeList=X;j.prototype.visitStruct=X;j.prototype.visitUnion=X;j.prototype.visitDenseUnion=u0;j.prototype.visitSparseUnion=u0;j.prototype.visitDictionary=X;j.prototype.visitInterval=X;j.prototype.visitIntervalDayTime=X;j.prototype.visitIntervalYearMonth=X;j.prototype.visitIntervalMonthDayNano=X;j.prototype.visitDuration=X;j.prototype.visitDurationSecond=X;j.prototype.visitDurationMillisecond=X;j.prototype.visitDurationMicrosecond=X;j.prototype.visitDurationNanosecond=X;j.prototype.visitFixedSizeList=X;j.prototype.visitMap=X;Hi=new j});function H(t){let{type:e}=t;if(t.nullCount===0&&t.stride===1&&(z.isInt(e)&&e.bitWidth!==64||z.isTime(e)&&e.bitWidth!==64||z.isFloat(e)&&e.precision!==Se.HALF))return new rc(t.data.length,i=>{let n=t.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let r=0;return new rc(t.data.length,i=>{let o=t.data[i].length,a=t.slice(r,r+o);return r+=o,new lg(a)})}var M,lg,ia,pd=m(()=>{Dr();Qe();ke();dd();M=class extends J{};lg=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};M.prototype.visitNull=H;M.prototype.visitBool=H;M.prototype.visitInt=H;M.prototype.visitInt8=H;M.prototype.visitInt16=H;M.prototype.visitInt32=H;M.prototype.visitInt64=H;M.prototype.visitUint8=H;M.prototype.visitUint16=H;M.prototype.visitUint32=H;M.prototype.visitUint64=H;M.prototype.visitFloat=H;M.prototype.visitFloat16=H;M.prototype.visitFloat32=H;M.prototype.visitFloat64=H;M.prototype.visitUtf8=H;M.prototype.visitLargeUtf8=H;M.prototype.visitUtf8View=H;M.prototype.visitBinary=H;M.prototype.visitLargeBinary=H;M.prototype.visitBinaryView=H;M.prototype.visitFixedSizeBinary=H;M.prototype.visitDate=H;M.prototype.visitDateDay=H;M.prototype.visitDateMillisecond=H;M.prototype.visitTimestamp=H;M.prototype.visitTimestampSecond=H;M.prototype.visitTimestampMillisecond=H;M.prototype.visitTimestampMicrosecond=H;M.prototype.visitTimestampNanosecond=H;M.prototype.visitTime=H;M.prototype.visitTimeSecond=H;M.prototype.visitTimeMillisecond=H;M.prototype.visitTimeMicrosecond=H;M.prototype.visitTimeNanosecond=H;M.prototype.visitDecimal=H;M.prototype.visitList=H;M.prototype.visitLargeList=H;M.prototype.visitStruct=H;M.prototype.visitUnion=H;M.prototype.visitDenseUnion=H;M.prototype.visitSparseUnion=H;M.prototype.visitDictionary=H;M.prototype.visitInterval=H;M.prototype.visitIntervalDayTime=H;M.prototype.visitIntervalYearMonth=H;M.prototype.visitIntervalMonthDayNano=H;M.prototype.visitDuration=H;M.prototype.visitDurationSecond=H;M.prototype.visitDurationMillisecond=H;M.prototype.visitDurationMicrosecond=H;M.prototype.visitDurationNanosecond=H;M.prototype.visitFixedSizeList=H;M.prototype.visitMap=H;ia=new M});function Ki(t){if(t){if(t instanceof Q)return new P([t]);if(t instanceof P)return new P(t.data);if(t.type instanceof z)return new P([U(t)]);if(Array.isArray(t))return new P(t.flatMap(e=>PU(e)));if(ArrayBuffer.isView(t)){t instanceof DataView&&(t=new Uint8Array(t.buffer));let e={offset:0,length:t.length,nullCount:-1,data:t};if(t instanceof Int8Array)return new P([U(Object.assign(Object.assign({},e),{type:new Ui}))]);if(t instanceof Int16Array)return new P([U(Object.assign(Object.assign({},e),{type:new Pi}))]);if(t instanceof Int32Array)return new P([U(Object.assign(Object.assign({},e),{type:new Gt}))]);if(t instanceof BigInt64Array)return new P([U(Object.assign(Object.assign({},e),{type:new Li}))]);if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new P([U(Object.assign(Object.assign({},e),{type:new Ei}))]);if(t instanceof Uint16Array)return new P([U(Object.assign(Object.assign({},e),{type:new Ci}))]);if(t instanceof Uint32Array)return new P([U(Object.assign(Object.assign({},e),{type:new Fi}))]);if(t instanceof BigUint64Array)return new P([U(Object.assign(Object.assign({},e),{type:new ji}))]);if(t instanceof Float32Array)return new P([U(Object.assign(Object.assign({},e),{type:new Mi}))]);if(t instanceof Float64Array)return new P([U(Object.assign(Object.assign({},e),{type:new Ri}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function PU(t){return t instanceof Q?[t]:t instanceof P?t.data:Ki(t).data}var l0,d0,f0,p0,P,md,Ut=m(()=>{Qe();ta();ke();zr();dd();Vi();Yt();fd();pd();ke();d0=Symbol.for("apache-arrow/Vector"),f0={},p0={},P=class t{static isVector(e){return e?.[d0]===!0}constructor(e){var r,i,n;let o=e[0]instanceof t?e.flatMap(s=>s.data):e;if(o.length===0||o.some(s=>!(s instanceof Q)))throw new TypeError("Vector constructor expects an Array of Data instances.");let a=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:s,set:c,indexOf:u}=f0[a.typeId],l=o[0];this.isValid=d=>nc(l,d),this.get=d=>s(l,d),this.set=(d,f)=>c(l,d,f),this.indexOf=d=>u(l,d),this._offsets=[0,l.length];break}default:Object.setPrototypeOf(this,p0[a.typeId]),this._offsets=sd(o);break}this.data=o,this.type=a,this.stride=Kt(a),this.numChildren=(n=(i=a.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,r)=>e+r.byteLength,0)}get nullable(){return c0(this.data)}get nullCount(){return ad(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${g[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(Zi(e,this.length))}set(e,r){}indexOf(e,r){return-1}includes(e,r){return this.indexOf(e,r)>-1}[Symbol.iterator](){return ia.visit(this)}concat(...e){return new t(this.data.concat(e.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(e,r){return new t(ec(this,e,r,({data:i,_offsets:n},o,a)=>cd(i,n,o,a)))}toJSON(){return[...this]}toArray(){let{type:e,data:r,length:i,stride:n,ArrayType:o}=this;switch(e.typeId){case g.Int:case g.Float:case g.Decimal:case g.Time:case g.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,i*n);default:return r.reduce((a,{values:s,length:c})=>(a.array.set(s.subarray(0,c*n),a.offset),a.offset+=c*n,a),{array:new o(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(i=>i.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new t(this.data.map(({children:r})=>r[e])):null}get isMemoized(){return z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let e=new md(this.data[0].dictionary),r=this.data.map(i=>{let n=i.clone();return n.dictionary=e,n});return new t(r)}return new md(this)}unmemoize(){if(z.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),r=this.data.map(i=>{let n=i.clone();return n.dictionary=e,n});return new t(r)}return this}};l0=Symbol.toStringTag;P[l0]=(t=>{t.type=z.prototype,t.data=[],t.length=0,t.stride=1,t.numChildren=0,t._offsets=new Uint32Array([0]),t[Symbol.isConcatSpreadable]=!0,t[d0]=!0;let e=Object.keys(g).map(r=>g[r]).filter(r=>typeof r=="number"&&r!==g.NONE);for(let r of e){let i=He.getVisitFnByTypeId(r),n=at.getVisitFnByTypeId(r),o=Hi.getVisitFnByTypeId(r);f0[r]={get:i,set:n,indexOf:o},p0[r]=Object.create(t,{isValid:{value:na(nc)},get:{value:na(He.getVisitFnByTypeId(r))},set:{value:ud(at.getVisitFnByTypeId(r))},indexOf:{value:ld(Hi.getVisitFnByTypeId(r))}})}return"Vector"})(P.prototype);Object.defineProperty(P,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===P&&P.isVector(e)}});md=class t extends P{constructor(e){super(e.data);let r=this.get,i=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(a){let s=o[a];if(s!==void 0)return s;let c=r.call(this,a);return o[a]=c,c}}),Object.defineProperty(this,"set",{value(a,s){i.call(this,a,s),o[a]=s}}),Object.defineProperty(this,"slice",{value:(a,s)=>new t(n.call(this,a,s))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new P(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function m0(t){if(!t||t.length<=0)return function(n){return!0};let e="",r=t.filter(i=>i===i);return r.length>0&&(e=`
|
|
7
|
+
"use strict";var __exports__=(()=>{var JB=Object.create;var qu=Object.defineProperty;var GB=Object.getOwnPropertyDescriptor;var HB=Object.getOwnPropertyNames;var KB=Object.getPrototypeOf,YB=Object.prototype.hasOwnProperty;var m=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var XB=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ie=(t,e)=>{for(var r in e)qu(t,r,{get:e[r],enumerable:!0})},Xu=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of HB(e))!YB.call(t,n)&&n!==r&&qu(t,n,{get:()=>e[n],enumerable:!(i=GB(e,n))||i.enumerable});return t},Qu=(t,e,r)=>(Xu(t,e,"default"),r&&Xu(r,e,"default")),qB=(t,e,r)=>(r=t!=null?JB(KB(t)):{},Xu(e||!t||!t.__esModule?qu(r,"default",{value:t,enumerable:!0}):r,t)),QB=t=>Xu(qu({},"__esModule",{value:!0}),t);var q$=XB((AF,X$)=>{X$.exports=globalThis.loaders});var el,tl,rl,Po,$i=m(()=>{"use strict";el={name:"SPLAT",id:"splat",module:"splats",format:"splat",extensions:["splat"],mimeTypes:["application/octet-stream"],binary:!0},tl={name:"KSPLAT",id:"ksplat",module:"splats",format:"ksplat",extensions:["ksplat"],mimeTypes:["application/octet-stream"],binary:!0},rl={name:"SPZ",id:"spz",module:"splats",format:"spz",extensions:["spz"],mimeTypes:["application/octet-stream"],binary:!0,tests:[new Uint8Array([78,71,83,80]).buffer]},Po={name:"RAD",id:"rad",module:"splats",format:"rad",extensions:["rad"],mimeTypes:["application/octet-stream"],binary:!0,tests:[new Uint8Array([82,65,68,48]).buffer]}});var nl,eT,il,tT,OF,Q$=m(()=>{nl=globalThis,eT=globalThis.document||{},il=globalThis.process||{},tT=globalThis.console,OF=globalThis.navigator||{}});function ex(t){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;let e=typeof navigator<"u"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}var tx=m(()=>{});function xi(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||ex()}var rx=m(()=>{tx()});var Am,ol=m(()=>{Q$();rx();Am="4.1.1"});function Lo(t,e){if(!t)throw new Error(e||"Assertion failed")}var zm=m(()=>{});function Om(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Lo(Number.isFinite(e)&&e>=0),e}function nx(t){let{logLevel:e,message:r}=t;t.logLevel=Om(e);let i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&i.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let n=typeof t.message;return Lo(n==="string"||n==="object"),Object.assign(t,{args:i},t.opts)}var ix=m(()=>{zm()});var Ii,al,ox=m(()=>{ix();Ii=()=>{},al=class{constructor({level:e=0}={}){this.userData={},this._onceCache=new Set,this._level=e}set level(e){this.setLevel(e)}get level(){return this.getLevel()}setLevel(e){return this._level=e,this}getLevel(){return this._level}warn(e,...r){return this._log("warn",0,e,r,{once:!0})}error(e,...r){return this._log("error",0,e,r)}log(e,r,...i){return this._log("log",e,r,i)}info(e,r,...i){return this._log("info",e,r,i)}once(e,r,...i){return this._log("once",e,r,i,{once:!0})}_log(e,r,i,n,o={}){let a=nx({logLevel:r,message:i,args:this._buildArgs(r,i,n),opts:o});return this._createLogFunction(e,a,o)}_buildArgs(e,r,i){return[e,r,...i]}_createLogFunction(e,r,i){if(!this._shouldLog(r.logLevel))return Ii;let n=this._getOnceTag(i.tag??r.tag??r.message);if((i.once||r.once)&&n!==void 0){if(this._onceCache.has(n))return Ii;this._onceCache.add(n)}return this._emit(e,r)}_shouldLog(e){return this.getLevel()>=Om(e)}_getOnceTag(e){if(e!==void 0)try{return typeof e=="string"?e:String(e)}catch{return}}}});function nT(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var sl,ax=m(()=>{sl=class{constructor(e,r,i="sessionStorage"){this.storage=nT(i),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}}});function sx(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function cx(t,e=8){let r=Math.max(e-t.length,0);return`${" ".repeat(r)}${t}`}var ux=m(()=>{});function lx(t){return typeof t!="string"?t:(t=t.toUpperCase(),cl[t]||cl.WHITE)}function dx(t,e,r){return!xi&&typeof t=="string"&&(e&&(t=`\x1B[${lx(e)}m${t}\x1B[39m`),r&&(t=`\x1B[${lx(r)+iT}m${t}\x1B[49m`)),t}var cl,iT,fx=m(()=>{ol();(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(cl||(cl={}));iT=10});function px(t,e=["constructor"]){let r=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(r),n=t;for(let o of i){let a=n[o];typeof a=="function"&&(e.find(s=>o===s)||(n[o]=a.bind(t)))}}var mx=m(()=>{});function Eo(){let t;if(xi()&&nl.performance)t=nl?.performance?.now?.();else if("hrtime"in il){let e=il?.hrtime?.();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var hx=m(()=>{ol()});function oT(t,e,r){if(typeof e=="string"){let i=r.time?cx(sx(r.total)):"";e=r.time?`${t}: ${i} ${e}`:`${t}: ${e}`,e=dx(e,r.color,r.background)}return e}function aT(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var Co,Bm,mn,Tm=m(()=>{ol();ox();ax();ux();fx();mx();zm();hx();Co={debug:xi()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Bm={enabled:!0,level:0},mn=class extends al{constructor({id:e}={id:""}){super({level:0}),this.VERSION=Am,this._startTs=Eo(),this._deltaTs=Eo(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new sl(`__probe-${this.id}__`,{[this.id]:Bm}),this.timeStamp(`${this.id} started`),px(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((Eo()-this._startTs).toPrecision(10))}getDelta(){return Number((Eo()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._updateConfiguration({enabled:e}),this}setLevel(e){return this._updateConfiguration({level:e}),this}get(e){return this._getConfiguration()[e]}set(e,r){this._updateConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){if(!e)throw new Error(r||"Assertion failed")}warn(e,...r){return this._log("warn",0,e,r,{method:Co.warn,once:!0})}error(e,...r){return this._log("error",0,e,r,{method:Co.error})}deprecated(e,r){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(e,r){return this.error(`\`${e}\` has been removed. Use \`${r}\` instead`)}probe(e,r,...i){return this._log("log",e,r,i,{method:Co.log,time:!0,once:!0})}log(e,r,...i){return this._log("log",e,r,i,{method:Co.debug})}info(e,r,...i){return this._log("info",e,r,i,{method:console.info})}once(e,r,...i){return this._log("once",e,r,i,{method:Co.debug||Co.info,once:!0})}table(e,r,i){return r?this._log("table",e,r,i&&[i]||[],{method:console.table||Ii,tag:aT(r)}):Ii}time(e,r){return this._log("time",e,r,[],{method:console.time?console.time:console.info})}timeEnd(e,r){return this._log("time",e,r,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(e,r){return this._log("time",e,r,[],{method:console.timeStamp||Ii})}group(e,r,i={collapsed:!1}){let n=(i.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",e,r,[],{method:n})}groupCollapsed(e,r,i={}){return this.group(e,r,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._log("groupEnd",e,"",[],{method:console.groupEnd||Ii})}withGroup(e,r,i){this.group(e,r)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&super._shouldLog(e)}_emit(e,r){let i=r.method;Lo(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Eo();let n=oT(this.id,r.message,r);return i.bind(console,n,...r.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(Bm),this._storage.config[this.id]}_updateConfiguration(e){let r=this._storage.config[this.id]||{...Bm};this._storage.setConfiguration({[this.id]:{...r,...e}})}};mn.VERSION=Am});var gx=m(()=>{globalThis.probe={}});var aj,yx=m(()=>{Tm();Tm();gx();aj=new mn({id:"@probe.gl/log"})});function cT(){let t=new mn({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=t,globalThis.loaders.version=sT,globalThis.probe||={},globalThis.probe.loaders=t,t}var Nm,sT,vx,bx=m(()=>{"use strict";yx();Nm="5.0.0-alpha.9",sT=Nm[0]>="0"&&Nm[0]<="9"?`v${Nm}`:"";vx=cT()});var uT,_x,wx,Um=m(()=>{"use strict";uT=t=>t!==null&&typeof t=="object",_x=t=>uT(t)&&t.constructor==={}.constructor,wx=t=>typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer});function ul(t,e){return $x(t||{},e)}function $x(t,e,r=0){if(r>3)return e;let i={...t};for(let[n,o]of Object.entries(e))_x(o)?i[n]=$x(i[n]||{},e[n],r+1):i[n]=e[n];return i}var xx=m(()=>{"use strict";Um()});function hn(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function ll(t,e){let r=globalThis.loaders?.modules?.[t];if(!r)throw new Error(`${e}: ${t} library not installed`);return r}function gr(t){return globalThis.loaders?.modules?.[t]||null}var Pm=m(()=>{"use strict"});function Ix(...t){return lT(t)}function lT(t){let e=t.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=e.reduce((o,a)=>o+a.byteLength,0),i=new Uint8Array(r),n=0;for(let o of e)i.set(o,n),n+=o.byteLength;return i.buffer}var Sx=m(()=>{"use strict"});async function Lm(t){let e=[];for await(let r of t)e.push(dT(r));return Ix(...e)}function dT(t){if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)){let{buffer:e,byteOffset:r,byteLength:i}=t;return kx(e,r,i)}return kx(t)}function kx(t,e=0,r=t.byteLength-e){let i=new Uint8Array(t,e,r),n=new Uint8Array(i.length);return n.set(i),n.buffer}var Dx=m(()=>{"use strict";Sx()});function Cm(t,e=[]){return t.every(Em)?t:t.map((r,i)=>{if(Em(r))return r;let n=e.find(a=>a.type===r?.type);if(!n)throw new Error(`No authentication class registered for credential at index ${i}.`);let o;try{o=new n(r)}catch{throw new Error(`Invalid authentication configuration at index ${i}.`)}if(!Em(o))throw new Error(`Authentication class returned an invalid credential at index ${i}.`);return o})}function Fm(t){if(!t.core?.credentials?.length)return t;let e=Cm(t.core.credentials,t.core.authentications);return e===t.core.credentials?t:{...t,core:{...t.core,credentials:e}}}function Em(t){return!t||typeof t!="object"||typeof t.id!="string"||!Array.isArray(t.origins)?!1:t.type==="request"?typeof t.authenticate=="function":(t.type==="header"||t.type==="query-parameter")&&typeof t.name=="string"&&(typeof t.token=="string"||typeof t.token=="function")&&Array.isArray(t.refreshStatusCodes)}var jm=m(()=>{"use strict"});function fT(t){let e=t.fetch||((d,f)=>fetch(d,f)),r=e[Ax],i=new Map(r?.credentialResolutions),n=Cm(t.credentials.map(d=>i.get(d)||d),t.authentications);if(t.credentials.forEach((d,f)=>{i.set(d,n[f])}),!t.fetchOptions&&(!n.length||r?.credentials.length===n.length&&n.every((d,f)=>d===r.credentials[f])))return e;let o=r?.fetch||e,a=r?[...new Set([...n,...r.credentials])]:n,s=zx(r?.fetchOptions||{},t.fetchOptions),c=a.filter(d=>d.type!=="request"),u=a.filter(d=>d.type==="request");for(let d of u)Px(d.origins);let l=async(d,f={})=>{if(f=zx(s,f),f.signal?.aborted)throw vs();if(!a.length)return o(d,f);let p=hT(d),h=p?await Bx(p,f,c):{url:d,options:f,credentials:[]},y=await Ox(h,u,"request"),_=await o(y.url,y.options),D=h.credentials.filter(({credential:k})=>typeof k.token=="function"&&k.refreshStatusCodes.includes(_.status)),I=y.credentials.some(k=>k.refreshStatusCodes?.includes(_.status));if(!D.length&&!I||!Tx(f)||!Tx(y.options))return _;if(f.signal?.aborted)throw vs();let A=new Map;if(await Promise.all(D.map(async({credential:k})=>{let le=await pT(k,d,_);le&&A.set(k,le)})),!A.size&&!I)return _;if(await _.body?.cancel().catch(()=>{}),f.signal?.aborted)throw vs();let Z=p?await Bx(p,f,c,A,h.credentials):{url:d,options:f},L=await Ox(Z,u,"retry",_);return o(L.url,L.options)};return Object.defineProperty(l,Ax,{value:{fetch:o,credentials:a,credentialResolutions:i,fetchOptions:s}}),l}function Nx(t={}){let e=t.fetch??t.core?.fetch,r;return typeof e=="function"?r=e:r=(i,n)=>fetch(i,n),fT({fetch:r,fetchOptions:typeof e=="object"&&e?e:void 0,credentials:t.core?.credentials||[],authentications:t.core?.authentications})}function zx(t,e){let r={...t,...e};if(t.headers||e?.headers){let i=new Headers(t.headers);new Headers(e?.headers).forEach((n,o)=>i.set(o,n)),r.headers=i}return r}async function Ox(t,e,r,i){let n=[],o=t.options.signal;for(let a of e){let s=Ux(t.url);if(!s||!Px(a.origins).includes(s))continue;if(o?.aborted)throw vs();let c=await a.authenticate({url:t.url,options:{...t.options,headers:new Headers(t.options.headers)},reason:r,response:i?{status:i.status,headers:new Headers(i.headers)}:void 0});if(!c||typeof c.url!="string"||!c.options||typeof c.options!="object")throw new Error("Authentication callback returned an invalid request.");t={url:c.url,options:{...c.options,...o?{signal:o}:{}}},n.push(a)}if(o?.aborted)throw vs();return{...t,credentials:n}}function Ux(t){try{let e=new URL(t);return!e.host||e.username||e.password?null:e.origin!=="null"?e.origin:`${e.protocol}//${e.host}`}catch{return null}}function Px(t){if(!t.length)throw new Error("Request authentication requires at least one exact origin.");return t.map(e=>{let r=Ux(e),i;try{i=new URL(e)}catch{throw new Error("Invalid request authentication origin.")}if(!r||i.pathname&&i.pathname!=="/"||i.search||i.hash)throw new Error("Invalid request authentication origin.");return r})}async function Bx(t,e,r,i=new Map,n=[]){let o=new URL(t),a=new Headers(e.headers),s=[],c=new Map(n.map(({credential:u,token:l})=>[u,l]));for(let u of r){if(!u.origins.includes(o.origin))continue;let l=i.get(u),d=c.get(u),f=u.type==="query-parameter"&&d!==void 0,p=u.type==="header"&&d!==void 0;if(u.type==="query-parameter"&&o.searchParams.has(u.name)&&!f||u.type==="header"&&a.has(u.name)&&!p)continue;let h=l??d??await mT(u.token,{url:t.toString(),reason:"request"});h&&(u.type==="query-parameter"?o.searchParams.set(u.name,h):a.set(u.name,`${u.prefix||""}${h}`),s.push({credential:u,token:h}))}return{url:o.toString(),options:{...e,headers:a},credentials:s}}async function pT(t,e,r){let i=Mm.get(t);if(i)return i;let n=t.token,o=Promise.resolve(n({url:e,reason:"refresh",response:{status:r.status,headers:r.headers}})).finally(()=>Mm.delete(t));return Mm.set(t,o),o}async function mT(t,e){return typeof t=="function"?t(e):t}function hT(t){try{let e=new URL(t);return["http:","https:"].includes(e.protocol)?e:null}catch{return null}}function Tx(t){let e=(t.method||"GET").toUpperCase();return["GET","HEAD","OPTIONS","PUT","DELETE"].includes(e)?!(t.body&&typeof ReadableStream<"u"&&t.body instanceof ReadableStream):!1}function vs(){return new DOMException("The operation was aborted.","AbortError")}var Ax,Mm,Lx=m(()=>{"use strict";jm();Ax=Symbol("loaders.gl.authenticated-fetch"),Mm=new WeakMap});function Cx(t){for(let e in Ex)if(t.startsWith(e)){let r=Ex[e];t=t.replace(e,r)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${gT}${t}`),t}var gT,Ex,Fx=m(()=>{"use strict";gT="",Ex={}});function dl(t){if(t instanceof ArrayBuffer)return t;if(wx(t))return Rm(t);let{buffer:e,byteOffset:r,byteLength:i}=t;return e instanceof ArrayBuffer&&r===0&&i===e.byteLength?e:Rm(e,r,i)}function Rm(t,e=0,r=t.byteLength-e){let i=new Uint8Array(t,e,r),n=new Uint8Array(i.length);return n.set(i),n.buffer}var jx=m(()=>{"use strict";Um()});function Mx(t){return Nx(t)}function Rx(t){if(t.loadOptions!==void 0||t.core?.loadOptions!==void 0)throw new Error("Source loadOptions and core.loadOptions were removed. Use core and root loader namespaces directly.");let e={...t};if(t?.core){e.core={...t.core};let n=e.core;for(let o of["type","attributions","loaders","onError","loadOptions"])delete n[o];Object.keys(n).length===0&&delete e.core}let r=typeof e.baseUri=="string"?e.baseUri:void 0,i=typeof e.baseUrl=="string"?e.baseUrl:void 0;return(r!==void 0||i!==void 0)&&(e.core||={},e.core.baseUrl===void 0&&(e.core.baseUrl=i??r),delete e.baseUri,delete e.baseUrl),e}function vT(t,e){return t instanceof Error?t:typeof t=="string"?new Error(t):new Error(e)}function Si(t){return()=>{throw new Error(`CoreAPI.${t} is unavailable. Use @loaders.gl/core.createDataSource().`)}}var yT,bs,Vx=m(()=>{"use strict";xx();Fx();bx();Lx();jm();yT={fetchFile:Si("fetchFile"),parse:Si("parse"),parseFile:Si("parseFile"),parseSync:Si("parseSync"),parseInBatches:Si("parseInBatches"),load:Si("load"),loadInBatches:Si("loadInBatches")},bs=class t{static defaultOptions={core:{type:"auto",attributions:[],loaders:[],onError:void 0}};optionsType;options;data;url;loadOptions;fetch;coreApi;hasCoreApi;_needsRefresh=!0;constructor(e,r,i,n){this.options=ul(ul(t.defaultOptions,i||{}),r),this.data=e,this.url=typeof e=="string"?Cx(e):"";let o=Fm(Rx(this.options));this.loadOptions=o;let a=Mx(o);this.coreApi=n||yT,this.hasCoreApi=!!n,this.fetch=a}setProps(e){let r=ul(this.options,e),i=Fm(Rx(r));this.options=r,this.loadOptions=i,this.fetch=Mx(i),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){let r=this._needsRefresh;return e&&(this._needsRefresh=!1),r}reportError(e,r){let i=vT(e,r),n=this.options.core?.onError;return n?n(i,this):vx.warn(`${this.constructor.name}: ${i.message}`)(),i}}});var Fo=m(()=>{"use strict";Pm();Pm();Dx();jx();Vx()});var fl,pl,nr,ml,ki=m(()=>{"use strict";Fo();fl=class{async preload(e={}){hn(e)}concatenate(e){return Lm(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}},pl=class extends fl{constructor(e){super(),this.compressBatches=this.compressBatches.bind(this)}async compress(e){return await this.preload(),this.compressSync(e)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}},nr=class extends fl{constructor(e){super(),this.decompressBatches=this.decompressBatches.bind(this)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}},ml=class extends pl{constructor(e){super(e),this.decompressBatches=this.decompressBatches.bind(this)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}}});function Qx(t,e){return gl(t,e)}function tI(t,e){return gl(t.subarray(qx(t),-8),e||new bt(DT(t)))}function nI(t,e){return gl((AT(t),t.subarray(2,-4)),e)}var bt,Di,Zx,Wx,Jx,bT,Gx,Hx,Kx,_T,Yx,wT,Jj,Wm,gn,ge,_s,ws,ge,ge,ge,ge,Xx,ge,$T,xT,Vm,yr,Zm,IT,hl,ST,vt,gl,kT,qx,DT,AT,Zn,eI,rI,zT,OT,Jm=m(()=>{bt=Uint8Array,Di=Uint16Array,Zx=Uint32Array,Wx=new bt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Jx=new bt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),bT=new bt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gx=function(t,e){for(var r=new Di(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];for(var n=new Zx(r[30]),i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},Hx=Gx(Wx,2),Kx=Hx[0],_T=Hx[1];Kx[28]=258,_T[258]=28;Yx=Gx(Jx,0),wT=Yx[0],Jj=Yx[1],Wm=new Di(32768);for(ge=0;ge<32768;++ge)gn=(ge&43690)>>>1|(ge&21845)<<1,gn=(gn&52428)>>>2|(gn&13107)<<2,gn=(gn&61680)>>>4|(gn&3855)<<4,Wm[ge]=((gn&65280)>>>8|(gn&255)<<8)>>>1;_s=(function(t,e,r){for(var i=t.length,n=0,o=new Di(e);n<i;++n)t[n]&&++o[t[n]-1];var a=new Di(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;var s;if(r){s=new Di(1<<e);var c=15-e;for(n=0;n<i;++n)if(t[n])for(var u=n<<4|t[n],l=e-t[n],d=a[t[n]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)s[Wm[d]>>>c]=u}else for(s=new Di(i),n=0;n<i;++n)t[n]&&(s[n]=Wm[a[t[n]-1]++]>>>15-t[n]);return s}),ws=new bt(288);for(ge=0;ge<144;++ge)ws[ge]=8;for(ge=144;ge<256;++ge)ws[ge]=9;for(ge=256;ge<280;++ge)ws[ge]=7;for(ge=280;ge<288;++ge)ws[ge]=8;Xx=new bt(32);for(ge=0;ge<32;++ge)Xx[ge]=5;$T=_s(ws,9,1),xT=_s(Xx,5,1),Vm=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},yr=function(t,e,r){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(e&7)&r},Zm=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},IT=function(t){return(t+7)/8|0},hl=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new(t.BYTES_PER_ELEMENT==2?Di:t.BYTES_PER_ELEMENT==4?Zx:bt)(r-e);return i.set(t.subarray(e,r)),i},ST=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],vt=function(t,e,r){var i=new Error(e||ST[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,vt),!r)throw i;return i},gl=function(t,e,r){var i=t.length;if(!i||r&&r.f&&!r.l)return e||new bt(0);var n=!e||r,o=!r||r.i;r||(r={}),e||(e=new bt(i*3));var a=function(hs){var Lr=e.length;if(hs>Lr){var Vn=new bt(Math.max(Lr*2,hs));Vn.set(e),e=Vn}},s=r.f||0,c=r.p||0,u=r.b||0,l=r.l,d=r.d,f=r.m,p=r.n,h=i*8;do{if(!l){s=yr(t,c,1);var y=yr(t,c+1,3);if(c+=3,y)if(y==1)l=$T,d=xT,f=9,p=5;else if(y==2){var A=yr(t,c,31)+257,Z=yr(t,c+10,15)+4,L=A+yr(t,c+5,31)+1;c+=14;for(var k=new bt(L),le=new bt(19),he=0;he<Z;++he)le[bT[he]]=yr(t,c+he*3,7);c+=Z*3;for(var ut=Vm(le),Ze=(1<<ut)-1,gt=_s(le,ut,1),he=0;he<L;){var yt=gt[yr(t,c,Ze)];c+=yt&15;var _=yt>>>4;if(_<16)k[he++]=_;else{var We=0,me=0;for(_==16?(me=3+yr(t,c,3),c+=2,We=k[he-1]):_==17?(me=3+yr(t,c,7),c+=3):_==18&&(me=11+yr(t,c,127),c+=7);me--;)k[he++]=We}}var ce=k.subarray(0,A),Ee=k.subarray(A);f=Vm(ce),p=Vm(Ee),l=_s(ce,f,1),d=_s(Ee,p,1)}else vt(1);else{var _=IT(c)+4,D=t[_-4]|t[_-3]<<8,I=_+D;if(I>i){o&&vt(0);break}n&&a(u+D),e.set(t.subarray(_,I),u),r.b=u+=D,r.p=c=I*8,r.f=s;continue}if(c>h){o&&vt(0);break}}n&&a(u+131072);for(var Bo=(1<<f)-1,To=(1<<p)-1,Rn=c;;Rn=c){var We=l[Zm(t,c)&Bo],Pr=We>>>4;if(c+=We&15,c>h){o&&vt(0);break}if(We||vt(2),Pr<256)e[u++]=Pr;else if(Pr==256){Rn=c,l=null;break}else{var ps=Pr-254;if(Pr>264){var he=Pr-257,pn=Wx[he];ps=yr(t,c,(1<<pn)-1)+Kx[he],c+=pn}var No=d[Zm(t,c)&To],Uo=No>>>4;No||vt(3),c+=No&15;var Ee=wT[Uo];if(Uo>3){var pn=Jx[Uo];Ee+=Zm(t,c)&(1<<pn)-1,c+=pn}if(c>h){o&&vt(0);break}n&&a(u+131072);for(var ms=u+ps;u<ms;u+=4)e[u]=e[u-Ee],e[u+1]=e[u+1-Ee],e[u+2]=e[u+2-Ee],e[u+3]=e[u+3-Ee];u=ms}}r.l=l,r.p=Rn,r.b=u,r.f=s,l&&(s=1,r.m=f,r.d=d,r.n=p)}while(!s);return u==e.length?e:hl(e,0,u)},kT=new bt(0),qx=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&vt(6,"invalid gzip data");var e=t[3],r=10;e&4&&(r+=t[10]|(t[11]<<8)+2);for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[r++]);return r+(e&2)},DT=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},AT=function(t){((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&vt(6,"invalid zlib data"),t[1]&32&&vt(6,"invalid zlib data: preset dictionaries not supported")},Zn=(function(){function t(e){this.s={},this.p=new bt(0),this.ondata=e}return t.prototype.e=function(e){this.ondata||vt(5),this.d&&vt(4);var r=this.p.length,i=new bt(r+e.length);i.set(this.p),i.set(e,r),this.p=i},t.prototype.c=function(e){this.d=this.s.i=e||!1;var r=this.s.b,i=gl(this.p,this.o,this.s);this.ondata(hl(i,r,this.s.b),this.d),this.o=hl(i,this.s.b-32768),this.s.b=this.o.length,this.p=hl(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,r){this.e(e),this.c(r)},t})();eI=(function(){function t(e){this.v=1,Zn.call(this,e)}return t.prototype.push=function(e,r){if(Zn.prototype.e.call(this,e),this.v){var i=this.p.length>3?qx(this.p):4;if(i>=this.p.length&&!r)return;this.p=this.p.subarray(i),this.v=0}r&&(this.p.length<8&&vt(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Zn.prototype.c.call(this,r)},t})();rI=(function(){function t(e){this.v=1,Zn.call(this,e)}return t.prototype.push=function(e,r){if(Zn.prototype.e.call(this,e),this.v){if(this.p.length<2&&!r)return;this.p=this.p.subarray(2),this.v=0}r&&(this.p.length<4&&vt(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Zn.prototype.c.call(this,r)},t})();zT=typeof TextDecoder<"u"&&new TextDecoder,OT=0;try{zT.decode(kT,{stream:!0}),OT=1}catch{}});async function iI(t,e){let r=BT([t],e);return r?await PT(r):null}function BT(t,e){let r=TT(e);return r?NT(t,r):null}function TT(t){if(typeof globalThis.CompressionStream>"u")return null;try{let e=globalThis.CompressionStream;return new e(t)}catch(e){if(e instanceof TypeError||e?.name==="TypeError")return null;throw e}}async function*NT(t,e){let r=e.writable.getWriter(),i=e.readable.getReader(),n=UT(t,r);n.catch(()=>{});let o=!1;try{for(;;){let{done:a,value:s}=await i.read();if(a){o=!0;break}yield new Uint8Array(s).buffer}await n}finally{o||(await i.cancel().catch(()=>{}),await r.abort().catch(()=>{}),await n.catch(()=>{})),i.releaseLock()}}async function UT(t,e){try{for await(let r of t)await e.write(new Uint8Array(r));await e.close()}catch(r){throw await e.abort(r).catch(()=>{}),r}}async function PT(t){let e=[],r=0;for await(let o of t){let a=new Uint8Array(o);e.push(a),r+=a.byteLength}let i=new Uint8Array(r),n=0;for(let o of e)i.set(o,n),n+=o.byteLength;return i.buffer}var oI=m(()=>{"use strict"});async function Er(t,e){let r=yn([t],e);return r?await ET(r):null}function yn(t,e){let r=sI(e);return r?LT(t,r):null}function aI(t){return!!sI(t)}function sI(t){if(typeof globalThis.DecompressionStream>"u"||globalThis.process?.release?.name==="node"&&typeof globalThis.Buffer>"u")return null;try{let e=globalThis.DecompressionStream;return new e(t)}catch(e){if(e instanceof TypeError||e?.name==="TypeError")return null;throw e}}async function*LT(t,e){let r=e.writable.getWriter(),i=e.readable.getReader(),n=FT(t,r);n.catch(()=>{});let o=!1;try{for(;;){let{done:a,value:s}=await i.read();if(a){o=!0;break}yield CT(s)}await n}finally{o||(await i.cancel().catch(()=>{}),await r.abort().catch(()=>{}),await n.catch(()=>{})),i.releaseLock()}}async function ET(t){let e=[],r=0;for await(let o of t){let a=new Uint8Array(o);e.push(a),r+=a.byteLength}let i=new Uint8Array(r),n=0;for(let o of e)i.set(o,n),n+=o.byteLength;return i.buffer}function CT(t){return new Uint8Array(t).buffer}async function FT(t,e){try{for await(let r of t)await e.write(new Uint8Array(r));await e.close()}catch(r){throw await e.abort(r).catch(()=>{}),r}}var Ai=m(()=>{"use strict"});var cI={};Ie(cI,{NativeDecompressor:()=>Gm});var Gm,uI=m(()=>{"use strict";ki();Ai();Gm=class extends nr{name;extensions;contentEncodings;isSupported=!0;format;constructor(e,r,i={}){super(i),this.name=e.name,this.extensions=[...e.extensions],this.contentEncodings=[...e.contentEncodings],this.format=r}async decompress(e){let r=await Er(e,this.format);if(!r)throw new Error(`${this.name}: built-in decompression is no longer available`);return r}async*decompressBatches(e){let r=yn(e,this.format);if(!r)throw new Error(`${this.name}: built-in decompression is no longer available`);yield*r}}});function jT(t,e){return{...t,modules:{...t.modules,...e}}}var $s,lI=m(()=>{"use strict";ki();Ai();$s=class extends nr{name;extensions;contentEncodings;isSupported=!0;options;nativeFormat;shouldUseNative;loadFallback;implementation=null;implementationPromise=null;constructor(e,r,i={},n=null,o=()=>!0){super(i),this.name=e.name,this.extensions=[...e.extensions],this.contentEncodings=[...e.contentEncodings],this.options=i,this.nativeFormat=n,this.shouldUseNative=o,this.loadFallback=r}async preload(e={}){if(this.implementation)return this.implementation;let r=jT(this.options,e);this.implementationPromise||=this.loadImplementation(r);try{return this.implementation=await this.implementationPromise,this.implementation}catch(i){throw this.implementationPromise=null,i}}async loadImplementation(e){if(e.useNative!==!1&&this.nativeFormat&&this.shouldUseNative(e)&&aI(this.nativeFormat)){let{NativeDecompressor:n}=await Promise.resolve().then(()=>(uI(),cI));return new n(this,this.nativeFormat,e)}let r=await this.loadFallback(),i=new r({...e,useNative:!1});return await i.preload(e.modules),i}async decompress(e,r){return(await this.preload()).decompress(e,r)}decompressSync(e,r){if(!this.implementation)throw new Error(`${this.name}: call preload() before decompressSync()`);return this.implementation.decompressSync(e,r)}async*decompressBatches(e){yield*(await this.preload()).decompressBatches(e)}}});async function*yl(t,e){let r=[];t.ondata=i=>{r.push(i.slice().buffer)};for await(let i of e)t.push(new Uint8Array(i),!1),yield*r.splice(0);t.push(new Uint8Array(0),!0),yield*r}var Hm=m(()=>{"use strict"});var vl,dI=m(()=>{"use strict";Jm();ki();Hm();vl=class extends nr{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e={}){super(e)}decompressSync(e){return tI(new Uint8Array(e)).slice().buffer}async*decompressBatches(e){yield*yl(new eI,e)}}});var fI={};Ie(fI,{GZipDecompressor:()=>Km});var Km,pI=m(()=>{"use strict";dI();Ai();Km=class extends vl{options;constructor(e={}){super(e),this.options=e}async decompress(e){if(this.options.useNative!==!1){let r=await Er(e,"gzip");if(r)return r}return this.decompressSync(e)}async*decompressBatches(e){if(this.options.useNative!==!1){let r=yn(e,"gzip");if(r){yield*r;return}}yield*super.decompressBatches(e)}}});function wl(t,e){for(var r=[],i=+!e,n=0,o=0;t.length;){var a=JT(t,i||e);if(typeof a=="object"){for(i?(e=null,a.w.length==a.u&&(r.push(e=a.w),o+=a.u)):(r.push(e),a.e=0);!a.l;){var s=eN(t,a,e);s||Je(5),e?a.e=a.y:(r.push(s),o+=s.length,VT(a.w,0,s.length),a.w.set(s,a.w.length-s.length))}n=a.b+a.c*4}else n=a;t=t.subarray(n)}return tN(r,o)}var MT,Re,bl,RT,_l,Ym,Is,VT,ZT,Je,mI,WT,JT,zi,Ss,GT,HT,KT,YT,hI,Xm,XT,qm,qT,xs,QT,eN,tN,Qm=m(()=>{MT=ArrayBuffer,Re=Uint8Array,bl=Uint16Array,RT=Int16Array,_l=Int32Array,Ym=function(t,e,r){if(Re.prototype.slice)return Re.prototype.slice.call(t,e,r);(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new Re(r-e);return i.set(t.subarray(e,r)),i},Is=function(t,e,r,i){if(Re.prototype.fill)return Re.prototype.fill.call(t,e,r,i);for((r==null||r<0)&&(r=0),(i==null||i>t.length)&&(i=t.length);r<i;++r)t[r]=e;return t},VT=function(t,e,r,i){if(Re.prototype.copyWithin)return Re.prototype.copyWithin.call(t,e,r,i);for((r==null||r<0)&&(r=0),(i==null||i>t.length)&&(i=t.length);r<i;)t[e++]=t[r++]},ZT=["invalid zstd data","window size too large (>2046MB)","invalid block type","FSE accuracy too high","match distance too far back","unexpected EOF"],Je=function(t,e,r){var i=new Error(e||ZT[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,Je),!r)throw i;return i},mI=function(t,e,r){for(var i=0,n=0;i<r;++i)n|=t[e++]<<(i<<3);return n},WT=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},JT=function(t,e){var r=t[0]|t[1]<<8|t[2]<<16;if(r==3126568&&t[3]==253){var i=t[4],n=i>>5&1,o=i>>2&1,a=i&3,s=i>>6;i&8&&Je(0);var c=6-n,u=a==3?4:a,l=mI(t,c,u);c+=u;var d=s?1<<s:n,f=mI(t,c,d)+(s==1&&256),p=f;if(!n){var h=1<<10+(t[5]>>3);p=h+(h>>3)*(t[5]&7)}p>2145386496&&Je(1);var y=new Re((e==1?f||p:e?0:p)+12);return y[0]=1,y[4]=4,y[8]=8,{b:c+d,y:0,l:0,d:l,w:e&&e!=1?e:y.subarray(12),e:p,o:new _l(y.buffer,0,3),u:f,c:o,m:Math.min(131072,p)}}else if((r>>4|t[3]<<20)==25481893)return WT(t,4)+8;Je(0)},zi=function(t){for(var e=0;1<<e<=t;++e);return e-1},Ss=function(t,e,r){var i=(e<<3)+4,n=(t[e]&15)+5;n>r&&Je(3);for(var o=1<<n,a=o,s=-1,c=-1,u=-1,l=o,d=new MT(512+(o<<2)),f=new RT(d,0,256),p=new bl(d,0,256),h=new bl(d,512,o),y=512+(o<<1),_=new Re(d,y,o),D=new Re(d,y+o);s<255&&a>0;){var I=zi(a+1),A=i>>3,Z=(1<<I+1)-1,L=(t[A]|t[A+1]<<8|t[A+2]<<16)>>(i&7)&Z,k=(1<<I)-1,le=Z-a-1,he=L&k;if(he<le?(i+=I,L=he):(i+=I+1,L>k&&(L-=le)),f[++s]=--L,L==-1?(a+=L,_[--l]=s):a-=L,!L)do{var ut=i>>3;c=(t[ut]|t[ut+1]<<8)>>(i&7)&3,i+=2,s+=c}while(c==3)}(s>255||a)&&Je(0);for(var Ze=0,gt=(o>>1)+(o>>3)+3,yt=o-1,We=0;We<=s;++We){var me=f[We];if(me<1){p[We]=-me;continue}for(u=0;u<me;++u){_[Ze]=We;do Ze=Ze+gt&yt;while(Ze>=l)}}for(Ze&&Je(0),u=0;u<o;++u){var ce=p[_[u]]++,Ee=D[u]=n-zi(ce);h[u]=(ce<<Ee)-o}return[i+7>>3,{b:n,s:_,n:D,t:h}]},GT=function(t,e){var r=0,i=-1,n=new Re(292),o=t[e],a=n.subarray(0,256),s=n.subarray(256,268),c=new bl(n.buffer,268);if(o<128){var u=Ss(t,e+1,6),l=u[0],d=u[1];e+=o;var f=l<<3,p=t[e];p||Je(0);for(var h=0,y=0,_=d.b,D=_,I=(++e<<3)-8+zi(p);I-=_,!(I<f);){var A=I>>3;if(h+=(t[A]|t[A+1]<<8)>>(I&7)&(1<<_)-1,a[++i]=d.s[h],I-=D,I<f)break;A=I>>3,y+=(t[A]|t[A+1]<<8)>>(I&7)&(1<<D)-1,a[++i]=d.s[y],_=d.n[h],h=d.t[h],D=d.n[y],y=d.t[y]}++i>255&&Je(0)}else{for(i=o-127;r<i;r+=2){var Z=t[++e];a[r]=Z>>4,a[r+1]=Z&15}++e}var L=0;for(r=0;r<i;++r){var k=a[r];k>11&&Je(0),L+=k&&1<<k-1}var le=zi(L)+1,he=1<<le,ut=he-L;for(ut&ut-1&&Je(0),a[i++]=zi(ut)+1,r=0;r<i;++r){var k=a[r];++s[a[r]=k&&le+1-k]}var Ze=new Re(he<<1),gt=Ze.subarray(0,he),yt=Ze.subarray(he);for(c[le]=0,r=le;r>0;--r){var We=c[r];Is(yt,r,We,c[r-1]=We+s[r]*(1<<le-r))}for(c[0]!=he&&Je(0),r=0;r<i;++r){var me=a[r];if(me){var ce=c[me];Is(gt,r,ce,c[me]=ce+(1<<le-me))}}return[e,{n:yt,b:le,s:gt}]},HT=Ss(new Re([81,16,99,140,49,198,24,99,12,33,196,24,99,102,102,134,70,146,4]),0,6)[1],KT=Ss(new Re([33,20,196,24,99,140,33,132,16,66,8,33,132,16,66,8,33,68,68,68,68,68,68,68,68,36,9]),0,6)[1],YT=Ss(new Re([32,132,16,66,102,70,68,68,68,68,36,73,2]),0,5)[1],hI=function(t,e){for(var r=t.length,i=new _l(r),n=0;n<r;++n)i[n]=e,e+=1<<t[n];return i},Xm=new Re(new _l([0,0,0,0,16843009,50528770,134678020,202050057,269422093]).buffer,0,36),XT=hI(Xm,0),qm=new Re(new _l([0,0,0,0,0,0,0,0,16843009,50528770,117769220,185207048,252579084,16]).buffer,0,53),qT=hI(qm,3),xs=function(t,e,r){var i=t.length,n=e.length,o=t[i-1],a=(1<<r.b)-1,s=-r.b;o||Je(0);for(var c=0,u=r.b,l=(i<<3)-8+zi(o)-u,d=-1;l>s&&d<n;){var f=l>>3,p=(t[f]|t[f+1]<<8|t[f+2]<<16)>>(l&7);c=(c<<u|p)&a,e[++d]=r.s[c],l-=u=r.n[c]}(l!=s||d+1!=n)&&Je(0)},QT=function(t,e,r){var i=6,n=e.length,o=n+3>>2,a=o<<1,s=o+a;xs(t.subarray(i,i+=t[0]|t[1]<<8),e.subarray(0,o),r),xs(t.subarray(i,i+=t[2]|t[3]<<8),e.subarray(o,a),r),xs(t.subarray(i,i+=t[4]|t[5]<<8),e.subarray(a,s),r),xs(t.subarray(i),e.subarray(s),r)},eN=function(t,e,r){var i,n=e.b,o=t[n],a=o>>1&3;e.l=o&1;var s=o>>3|t[n+1]<<5|t[n+2]<<13,c=(n+=3)+s;if(a==1)return n>=t.length?void 0:(e.b=n+1,r?(Is(r,t[n],e.y,e.y+=s),r):Is(new Re(s),t[n]));if(!(c>t.length)){if(a==0)return e.b=c,r?(r.set(t.subarray(n,c),e.y),e.y+=s,r):Ym(t,n,c);if(a==2){var u=t[n],l=u&3,d=u>>2&3,f=u>>4,p=0,h=0;l<2?d&1?f|=t[++n]<<4|(d&2&&t[++n]<<12):f=u>>3:(h=d,d<2?(f|=(t[++n]&63)<<4,p=t[n]>>6|t[++n]<<2):d==2?(f|=t[++n]<<4|(t[++n]&3)<<12,p=t[n]>>2|t[++n]<<6):(f|=t[++n]<<4|(t[++n]&63)<<12,p=t[n]>>6|t[++n]<<2|t[++n]<<10)),++n;var y=r?r.subarray(e.y,e.y+e.m):new Re(e.m),_=y.length-f;if(l==0)y.set(t.subarray(n,n+=f),_);else if(l==1)Is(y,t[n++],_);else{var D=e.h;if(l==2){var I=GT(t,n);p+=n-(n=I[0]),e.h=D=I[1]}else D||Je(0);(h?QT:xs)(t.subarray(n,n+=p),y.subarray(_),D)}var A=t[n++];if(A){A==255?A=(t[n++]|t[n++]<<8)+32512:A>127&&(A=A-128<<8|t[n++]);var Z=t[n++];Z&3&&Je(0);for(var L=[KT,YT,HT],k=2;k>-1;--k){var le=Z>>(k<<1)+2&3;if(le==1){var he=new Re([0,0,t[n++]]);L[k]={s:he.subarray(2,3),n:he.subarray(0,1),t:new bl(he.buffer,0,1),b:0}}else le==2?(i=Ss(t,n,9-(k&1)),n=i[0],L[k]=i[1]):le==3&&(e.t||Je(0),L[k]=e.t[k])}var ut=e.t=L,Ze=ut[0],gt=ut[1],yt=ut[2],We=t[c-1];We||Je(0);var me=(c<<3)-8+zi(We)-yt.b,ce=me>>3,Ee=0,Bo=(t[ce]|t[ce+1]<<8)>>(me&7)&(1<<yt.b)-1;ce=(me-=gt.b)>>3;var To=(t[ce]|t[ce+1]<<8)>>(me&7)&(1<<gt.b)-1;ce=(me-=Ze.b)>>3;var Rn=(t[ce]|t[ce+1]<<8)>>(me&7)&(1<<Ze.b)-1;for(++A;--A;){var Pr=yt.s[Bo],ps=yt.n[Bo],pn=Ze.s[Rn],No=Ze.n[Rn],Uo=gt.s[To],ms=gt.n[To];ce=(me-=Uo)>>3;var hs=1<<Uo,Lr=hs+((t[ce]|t[ce+1]<<8|t[ce+2]<<16|t[ce+3]<<24)>>>(me&7)&hs-1);ce=(me-=qm[pn])>>3;var Vn=qT[pn]+((t[ce]|t[ce+1]<<8|t[ce+2]<<16)>>(me&7)&(1<<qm[pn])-1);ce=(me-=Xm[Pr])>>3;var Ku=XT[Pr]+((t[ce]|t[ce+1]<<8|t[ce+2]<<16)>>(me&7)&(1<<Xm[Pr])-1);if(ce=(me-=ps)>>3,Bo=yt.t[Bo]+((t[ce]|t[ce+1]<<8)>>(me&7)&(1<<ps)-1),ce=(me-=No)>>3,Rn=Ze.t[Rn]+((t[ce]|t[ce+1]<<8)>>(me&7)&(1<<No)-1),ce=(me-=ms)>>3,To=gt.t[To]+((t[ce]|t[ce+1]<<8)>>(me&7)&(1<<ms)-1),Lr>3)e.o[2]=e.o[1],e.o[1]=e.o[0],e.o[0]=Lr-=3;else{var Yu=Lr-(Ku!=0);Yu?(Lr=Yu==3?e.o[0]-1:e.o[Yu],Yu>1&&(e.o[2]=e.o[1]),e.o[1]=e.o[0],e.o[0]=Lr):Lr=e.o[0]}for(var k=0;k<Ku;++k)y[Ee+k]=y[_+k];Ee+=Ku,_+=Ku;var gs=Ee-Lr;if(gs<0){var ys=-gs,WB=e.e+gs;ys>Vn&&(ys=Vn);for(var k=0;k<ys;++k)y[Ee+k]=e.w[WB+k];Ee+=ys,Vn-=ys,gs=0}for(var k=0;k<Vn;++k)y[Ee+k]=y[gs+k];Ee+=Vn}if(Ee!=_)for(;_<y.length;)y[Ee++]=y[_++];else Ee=y.length;r?e.y+=Ee:y=Ym(y,0,Ee)}else if(r){if(e.y+=f,_)for(var k=0;k<f;++k)y[k]=y[_+k]}else _&&(y=Ym(y,_));return e.b=c,y}Je(2)}},tN=function(t,e){if(t.length==1)return t[0];for(var r=new Re(e),i=0,n=0;i<t.length;++i){var o=t[i];r.set(o,n),n+=o.length}return r}});var $l,gI=m(()=>{"use strict";ki();Qm();$l=class extends nr{name="zstd";extensions=["zst"];contentEncodings=["zstd"];isSupported=!0;constructor(e={}){super(e)}decompressSync(e){return wl(new Uint8Array(e)).slice().buffer}}});var yI={};Ie(yI,{decompressZstd:()=>rN});function rN(t){return wl(t)}var vI=m(()=>{"use strict";Qm()});var _I={};Ie(_I,{ZstdCompression:()=>eh});var bI,xl,ks,eh,wI=m(()=>{"use strict";ki();Fo();oI();Ai();bI=1e6,eh=class extends ml{name="zstd";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(e={}){super(e),this.options=e,hn(e?.modules)}async preload(e={}){hn(e);let r=gr("zstd-codec");!xl&&r&&(xl=new Promise(i=>r.run(n=>i(n)))),xl&&(ks=await xl)}compressSync(e){ll("zstd-codec",this.name);let r=new ks.Simple,i=new Uint8Array(e);return r.compress(i).buffer}async compress(e){if(this.options.useNative!==!1&&this.options.zstd?.useNative!==!1){let r=await iI(e,"zstd");if(r)return r}return await this.preload(),this.compressSync(e)}decompressSync(e){ll("zstd-codec",this.name);let r=new ks.Simple,i=new Uint8Array(e);return r.decompress(i).buffer}async decompress(e,r){if(!gr("zstd-codec")&&this.options.useNative!==!1&&this.options.zstd?.useNative!==!1){let s=await Er(e,"zstd");if(s)return s}await this.preload();let i=new Uint8Array(e);if(!ks){let{decompressZstd:s}=await Promise.resolve().then(()=>(vI(),yI));return dl(s(i))}let n=new ks.Streaming,o=[];for(let s=0;s<=i.length;s+=bI){let c=i.subarray(s,s+bI),u=dl(c);o.push(new Uint8Array(u))}return(await n.decompressChunks(o)).buffer}}});var $I={};Ie($I,{ZstdDecompressor:()=>th});var th,xI=m(()=>{"use strict";gI();Ai();Fo();th=class extends $l{options;compatibility=null;constructor(e={}){super(e),this.options=e,hn(e.modules)}async preload(e={}){if(hn(e),gr("zstd-codec")){let{ZstdCompression:r}=await Promise.resolve().then(()=>(wI(),_I));this.compatibility||=new r(this.options),await this.compatibility.preload(e)}}async decompress(e){if(this.options.useNative!==!1){let r=await Er(e,"zstd");if(r)return r}return gr("zstd-codec")&&await this.preload(this.options.modules),this.decompressSync(e)}decompressSync(e){if(this.compatibility)return this.compatibility.decompressSync(e);if(gr("zstd-codec"))throw new Error("zstd: call preload() before synchronous decompression with zstd-codec");return super.decompressSync(e)}async*decompressBatches(e){if(this.options.useNative!==!1){let r=yn(e,"zstd");if(r){yield*r;return}}if(gr("zstd-codec")){yield this.decompress(await this.concatenate(e));return}yield*super.decompressBatches(e)}}});var nN,iN,Ds,As,II=m(()=>{"use strict";lI();Fo();nN={name:"gzip",extensions:["gz"],contentEncodings:["gzip"]},iN={name:"zstd",extensions:["zst"],contentEncodings:["zstd"]},Ds=class extends $s{constructor(e={}){super(nN,async()=>(await Promise.resolve().then(()=>(pI(),fI))).GZipDecompressor,e,"gzip")}},As=class extends $s{constructor(e={}){super(iN,async()=>(await Promise.resolve().then(()=>(xI(),$I))).ZstdDecompressor,e,"zstd",r=>!r.modules?.["zstd-codec"]&&!gr("zstd-codec"))}}});var SI=m(()=>{"use strict";II()});function DI(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function T(t,e,r,i){function n(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{u(i.next(l))}catch(d){a(d)}}function c(l){try{u(i.throw(l))}catch(d){a(d)}}function u(l){l.done?o(l.value):n(l.value).then(s,c)}u((i=i.apply(t,e||[])).next())})}function kI(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function re(t){return this instanceof re?(this.v=t,this):new re(t)}function Rt(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(p){return function(h){return Promise.resolve(h).then(p,d)}}function s(p,h){i[p]&&(n[p]=function(y){return new Promise(function(_,D){o.push([p,y,_,D])>1||c(p,y)})},h&&(n[p]=h(n[p])))}function c(p,h){try{u(i[p](h))}catch(y){f(o[0][3],y)}}function u(p){p.value instanceof re?Promise.resolve(p.value.v).then(l,d):f(o[0][2],p)}function l(p){c("next",p)}function d(p){c("throw",p)}function f(p,h){p(h),o.shift(),o.length&&c(o[0][0],o[0][1])}}function jo(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=t[n]?function(a){return(r=!r)?{value:re(t[n](a)),done:!1}:o?o(a):a}:o}}function vr(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof kI=="function"?kI(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,c){a=t[o](a),n(s,c,a.done,a.value)})}}function n(o,a,s,c){Promise.resolve(c).then(function(u){o({value:u,done:s})},a)}}var Vt=m(()=>{});var AI,Mo,oN,Zt,vn=m(()=>{AI=new TextDecoder("utf-8"),Mo=AI.decode.bind(AI),oN=new TextEncoder,Zt=t=>oN.encode(t)});var aN,zI,Xe,_t,br,_r,ir,Il,Sl,kl,Dl,Al,OI,zs,BI,zl,TI,Oi=m(()=>{aN=t=>typeof t=="number",zI=t=>typeof t=="boolean",Xe=t=>typeof t=="function",_t=t=>t!=null&&Object(t)===t,br=t=>_t(t)&&Xe(t.then),_r=t=>_t(t)&&Xe(t[Symbol.iterator]),ir=t=>_t(t)&&Xe(t[Symbol.asyncIterator]),Il=t=>_t(t)&&_t(t.schema),Sl=t=>_t(t)&&"done"in t&&"value"in t,kl=t=>_t(t)&&Xe(t.stat)&&aN(t.fd),Dl=t=>_t(t)&&zs(t.body),Al=t=>"_getDOMStream"in t&&"_getNodeStream"in t,OI=t=>_t(t)&&Xe(t.abort)&&Xe(t.getWriter)&&!Al(t),zs=t=>_t(t)&&Xe(t.cancel)&&Xe(t.getReader)&&!Al(t),BI=t=>_t(t)&&Xe(t.end)&&Xe(t.write)&&zI(t.writable)&&!Al(t),zl=t=>_t(t)&&Xe(t.read)&&Xe(t.pipe)&&zI(t.readable)&&!Al(t),TI=t=>_t(t)&&Xe(t.clear)&&Xe(t.bytes)&&Xe(t.position)&&Xe(t.setPosition)&&Xe(t.capacity)&&Xe(t.getBufferIdentifier)&&Xe(t.createLong)});var sh={};Ie(sh,{compareArrayLike:()=>ah,joinUint8Arrays:()=>Wt,memcpy:()=>Os,rebaseValueOffsets:()=>Ol,toArrayBufferView:()=>ne,toArrayBufferViewAsyncIterator:()=>wr,toArrayBufferViewIterator:()=>Cr,toBigInt64Array:()=>Bs,toBigUint64Array:()=>fN,toFloat32Array:()=>pN,toFloat32ArrayAsyncIterator:()=>zN,toFloat32ArrayIterator:()=>wN,toFloat64Array:()=>mN,toFloat64ArrayAsyncIterator:()=>ON,toFloat64ArrayIterator:()=>$N,toInt16Array:()=>uN,toInt16ArrayAsyncIterator:()=>SN,toInt16ArrayIterator:()=>yN,toInt32Array:()=>Bi,toInt32ArrayAsyncIterator:()=>kN,toInt32ArrayIterator:()=>vN,toInt8Array:()=>cN,toInt8ArrayAsyncIterator:()=>IN,toInt8ArrayIterator:()=>gN,toUint16Array:()=>lN,toUint16ArrayAsyncIterator:()=>DN,toUint16ArrayIterator:()=>bN,toUint32Array:()=>dN,toUint32ArrayAsyncIterator:()=>AN,toUint32ArrayIterator:()=>_N,toUint8Array:()=>C,toUint8ArrayAsyncIterator:()=>oh,toUint8ArrayIterator:()=>ih,toUint8ClampedArray:()=>hN,toUint8ClampedArrayAsyncIterator:()=>BN,toUint8ClampedArrayIterator:()=>xN});function sN(t){let e=t[0]?[t[0]]:[],r,i,n,o;for(let a,s,c=0,u=0,l=t.length;++c<l;){if(a=e[u],s=t[c],!a||!s||a.buffer!==s.buffer||s.byteOffset<a.byteOffset){s&&(e[++u]=s);continue}if({byteOffset:r,byteLength:n}=a,{byteOffset:i,byteLength:o}=s,r+n<i||i+o<r){s&&(e[++u]=s);continue}e[u]=new Uint8Array(a.buffer,r,i-r+o)}return e}function Os(t,e,r=0,i=e.byteLength){let n=t.byteLength,o=new Uint8Array(t.buffer,t.byteOffset,n),a=new Uint8Array(e.buffer,e.byteOffset,Math.min(i,n));return o.set(a,r),t}function Wt(t,e){let r=sN(t),i=r.reduce((l,d)=>l+d.byteLength,0),n,o,a,s=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,i);for(let l=r.length;++c<l;){if(n=r[c],o=n.subarray(0,Math.min(n.length,u-s)),u<=s+o.length){o.length<n.length?r[c]=n.subarray(o.length):o.length===n.length&&c++,a?Os(a,o,s):a=o;break}Os(a||(a=new Uint8Array(u)),o,s),s+=o.length}return[a||new Uint8Array(0),r.slice(c),i-(a?a.byteLength:0)]}function ne(t,e){let r=Sl(e)?e.value:e;return r instanceof t?t===Uint8Array?new t(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=Zt(r)),r instanceof ArrayBuffer?new t(r):r instanceof nh?new t(r):TI(r)?ne(t,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new t(0):new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):t.from(r)):new t(0)}function*Cr(t,e){let r=function*(n){yield n},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof nh?r(e):_r(e)?e:r(e);return yield*rh((function*(n){let o=null;do o=n.next(yield ne(t,o));while(!o.done)})(i[Symbol.iterator]())),new t}function wr(t,e){return Rt(this,arguments,function*(){if(br(e))return yield re(yield re(yield*jo(vr(wr(t,yield re(e))))));let i=function(a){return Rt(this,arguments,function*(){yield yield re(yield re(a))})},n=function(a){return Rt(this,arguments,function*(){yield re(yield*jo(vr(rh((function*(s){let c=null;do c=s.next(yield c?.value);while(!c.done)})(a[Symbol.iterator]())))))})},o=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof nh?i(e):_r(e)?n(e):ir(e)?e:i(e);return yield re(yield*jo(vr(rh((function(a){return Rt(this,arguments,function*(){let s=null;do s=yield re(a.next(yield yield re(ne(t,s))));while(!s.done)})})(o[Symbol.asyncIterator]()))))),yield re(new t)})}function Ol(t,e,r){if(t!==0){r=r.slice(0,e);let i=typeof r[0]=="bigint"?BigInt(t):t;for(let n=-1,o=r.length;++n<o;)r[n]+=i}return r.subarray(0,e)}function ah(t,e){let r=0,i=t.length;if(i!==e.length)return!1;if(i>0)do if(t[r]!==e[r])return!1;while(++r<i);return!0}var nh,cN,uN,Bi,Bs,C,lN,dN,fN,pN,mN,hN,rh,gN,yN,vN,ih,bN,_N,wN,$N,xN,IN,SN,kN,oh,DN,AN,zN,ON,BN,qe=m(()=>{Vt();vn();Oi();nh=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;cN=t=>ne(Int8Array,t),uN=t=>ne(Int16Array,t),Bi=t=>ne(Int32Array,t),Bs=t=>ne(BigInt64Array,t),C=t=>ne(Uint8Array,t),lN=t=>ne(Uint16Array,t),dN=t=>ne(Uint32Array,t),fN=t=>ne(BigUint64Array,t),pN=t=>ne(Float32Array,t),mN=t=>ne(Float64Array,t),hN=t=>ne(Uint8ClampedArray,t),rh=t=>(t.next(),t);gN=t=>Cr(Int8Array,t),yN=t=>Cr(Int16Array,t),vN=t=>Cr(Int32Array,t),ih=t=>Cr(Uint8Array,t),bN=t=>Cr(Uint16Array,t),_N=t=>Cr(Uint32Array,t),wN=t=>Cr(Float32Array,t),$N=t=>Cr(Float64Array,t),xN=t=>Cr(Uint8ClampedArray,t);IN=t=>wr(Int8Array,t),SN=t=>wr(Int16Array,t),kN=t=>wr(Int32Array,t),oh=t=>wr(Uint8Array,t),DN=t=>wr(Uint16Array,t),AN=t=>wr(Uint32Array,t),zN=t=>wr(Float32Array,t),ON=t=>wr(Float64Array,t),BN=t=>wr(Uint8ClampedArray,t)});function*TN(t){let e,r=!1,i=[],n,o,a,s=0;function c(){return o==="peek"?Wt(i,a)[0]:([n,i,s]=Wt(i,a),n)}({cmd:o,size:a}=(yield null)||{cmd:"read",size:0});let u=ih(t)[Symbol.iterator]();try{do if({done:e,value:n}=Number.isNaN(a-s)?u.next():u.next(a-s),!e&&n.byteLength>0&&(i.push(n),s+=n.byteLength),e||a<=s)do({cmd:o,size:a}=yield c());while(a<s);while(!e)}catch(l){r=!0,typeof u.throw=="function"&&u.throw(l)}finally{r===!1&&typeof u.return=="function"&&u.return(null)}return null}function NN(t){return Rt(this,arguments,function*(){let r,i=!1,n=[],o,a,s,c=0;function u(){return a==="peek"?Wt(n,s)[0]:([o,n,c]=Wt(n,s),o)}({cmd:a,size:s}=(yield yield re(null))||{cmd:"read",size:0});let l=oh(t)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(s-c)?yield re(l.next()):yield re(l.next(s-c)),!r&&o.byteLength>0&&(n.push(o),c+=o.byteLength),r||s<=c)do({cmd:a,size:s}=yield yield re(u()));while(s<c);while(!r)}catch(d){i=!0,typeof l.throw=="function"&&(yield re(l.throw(d)))}finally{i===!1&&typeof l.return=="function"&&(yield re(l.return(new Uint8Array(0))))}return yield re(null)})}function UN(t){return Rt(this,arguments,function*(){let r=!1,i=!1,n=[],o,a,s,c=0;function u(){return a==="peek"?Wt(n,s)[0]:([o,n,c]=Wt(n,s),o)}({cmd:a,size:s}=(yield yield re(null))||{cmd:"read",size:0});let l=new uh(t);try{do if({done:r,value:o}=Number.isNaN(s-c)?yield re(l.read()):yield re(l.read(s-c)),!r&&o.byteLength>0&&(n.push(C(o)),c+=o.byteLength),r||s<=c)do({cmd:a,size:s}=yield yield re(u()));while(s<c);while(!r)}catch(d){i=!0,yield re(l.cancel(d))}finally{i===!1?yield re(l.cancel()):t.locked&&l.releaseLock()}return yield re(null)})}function PN(t){return Rt(this,arguments,function*(){let r=[],i="error",n=!1,o=null,a,s,c=0,u=[],l;function d(){return a==="peek"?Wt(u,s)[0]:([l,u,c]=Wt(u,s),l)}if({cmd:a,size:s}=(yield yield re(null))||{cmd:"read",size:0},t.isTTY)return yield yield re(new Uint8Array(0)),yield re(null);try{r[0]=ch(t,"end"),r[1]=ch(t,"error");do{if(r[2]=ch(t,"readable"),[i,o]=yield re(Promise.race(r.map(p=>p[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(s-c)?(l=C(t.read(s-c)),l.byteLength<s-c&&(l=C(t.read()))):l=C(t.read()),l.byteLength>0&&(u.push(l),c+=l.byteLength)),n||s<=c)do({cmd:a,size:s}=yield yield re(d()));while(s<c)}while(!n)}finally{yield re(f(r,i==="error"?o:null))}return yield re(null);function f(p,h){return l=u=null,new Promise((y,_)=>{for(let[D,I]of p)t.off(D,I);try{let D=t.destroy;D&&D.call(t,h),h=void 0}catch(D){h=D||h}finally{h!=null?_(h):y()}})}})}var it,Bl,uh,ch,Ts=m(()=>{Vt();qe();it={fromIterable(t){return Bl(TN(t))},fromAsyncIterable(t){return Bl(NN(t))},fromDOMStream(t){return Bl(UN(t))},fromNodeStream(t){return Bl(PN(t))},toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}},Bl=t=>(t.next(),t);uh=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return T(this,void 0,void 0,function*(){let{reader:r,source:i}=this;r&&(yield r.cancel(e).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(e){return T(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=C(r)),r})}},ch=(t,e)=>{let r=n=>i([e,n]),i;return[e,r,new Promise(n=>(i=n)&&t.once(e,r))]}});var be,Tl=m(()=>{(function(t){t[t.V1=0]="V1",t[t.V2=1]="V2",t[t.V3=2]="V3",t[t.V4=3]="V4",t[t.V5=4]="V5"})(be||(be={}))});var Ae,lh=m(()=>{(function(t){t[t.Sparse=0]="Sparse",t[t.Dense=1]="Dense"})(Ae||(Ae={}))});var Se,dh=m(()=>{(function(t){t[t.HALF=0]="HALF",t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE"})(Se||(Se={}))});var Ve,fh=m(()=>{(function(t){t[t.DAY=0]="DAY",t[t.MILLISECOND=1]="MILLISECOND"})(Ve||(Ve={}))});var E,Ns=m(()=>{(function(t){t[t.SECOND=0]="SECOND",t[t.MILLISECOND=1]="MILLISECOND",t[t.MICROSECOND=2]="MICROSECOND",t[t.NANOSECOND=3]="NANOSECOND"})(E||(E={}))});var Te,ph=m(()=>{(function(t){t[t.YEAR_MONTH=0]="YEAR_MONTH",t[t.DAY_TIME=1]="DAY_TIME",t[t.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Te||(Te={}))});var Nl=m(()=>{});var Fr,Ul,Pl,Ro,mh=m(()=>{Fr=new Int32Array(2),Ul=new Float32Array(Fr.buffer),Pl=new Float64Array(Fr.buffer),Ro=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Us,hh=m(()=>{(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})(Us||(Us={}))});var ot,gh=m(()=>{Nl();hh();mh();ot=class t{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new t(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Fr[0]=this.readInt32(e),Ul[0]}readFloat64(e){return Fr[Ro?0:1]=this.readInt32(e),Fr[Ro?1:0]=this.readInt32(e+4),Pl[0]}writeInt8(e,r){this.bytes_[e]=r}writeUint8(e,r){this.bytes_[e]=r}writeInt16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeUint16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeInt32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeUint32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeInt64(e,r){this.writeInt32(e,Number(BigInt.asIntN(32,r))),this.writeInt32(e+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(e,r){this.writeUint32(e,Number(BigInt.asUintN(32,r))),this.writeUint32(e+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(e,r){Ul[0]=r,this.writeInt32(e,Fr[0])}writeFloat64(e,r){Pl[0]=r,this.writeInt32(e,Fr[Ro?0:1]),this.writeInt32(e+4,Fr[Ro?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let r=0;r<4;r++)e+=String.fromCharCode(this.readInt8(this.position_+4+r));return e}__offset(e,r){let i=e-this.readInt32(e);return r<this.readInt16(i)?this.readInt16(i+r):0}__union(e,r){return e.bb_pos=r+this.readInt32(r),e.bb=this,e}__string(e,r){e+=this.readInt32(e);let i=this.readInt32(e);e+=4;let n=this.bytes_.subarray(e,e+i);return r===Us.UTF8_BYTES?n:this.text_decoder_.decode(n)}__union_with_string(e,r){return typeof e=="string"?this.__string(r):this.__union(e,r)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let r=0;r<4;r++)if(e.charCodeAt(r)!=this.readInt8(this.position()+4+r))return!1;return!0}createScalarList(e,r){let i=[];for(let n=0;n<r;++n){let o=e(n);o!==null&&i.push(o)}return i}createObjList(e,r){let i=[];for(let n=0;n<r;++n){let o=e(n);o!==null&&i.push(o.unpack())}return i}}});var Ti,NI=m(()=>{gh();Nl();Ti=class t{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;e?r=e:r=1024,this.bb=ot.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,r){e>this.minalign&&(this.minalign=e);let i=~(this.bb.capacity()-this.space+r)+1&e-1;for(;this.space<i+e+r;){let n=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(e){for(let r=0;r<e;r++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,r,i){(this.force_defaults||r!=i)&&(this.addInt8(r),this.slot(e))}addFieldInt16(e,r,i){(this.force_defaults||r!=i)&&(this.addInt16(r),this.slot(e))}addFieldInt32(e,r,i){(this.force_defaults||r!=i)&&(this.addInt32(r),this.slot(e))}addFieldInt64(e,r,i){(this.force_defaults||r!==i)&&(this.addInt64(r),this.slot(e))}addFieldFloat32(e,r,i){(this.force_defaults||r!=i)&&(this.addFloat32(r),this.slot(e))}addFieldFloat64(e,r,i){(this.force_defaults||r!=i)&&(this.addFloat64(r),this.slot(e))}addFieldOffset(e,r,i){(this.force_defaults||r!=i)&&(this.addOffset(r),this.slot(e))}addFieldStruct(e,r,i){r!=i&&(this.nested(r),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let r=e.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let i=r<<1,n=ot.allocate(i);return n.setPosition(i-r),n.bytes().set(e.bytes(),i-r),n}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let r=0;r<e;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let i=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?e-this.vtable[r]:0);let n=2;this.addInt16(e-this.object_start);let o=(i+n)*2;this.addInt16(o);let a=0,s=this.space;e:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];if(o==this.bb.readInt16(c)){for(let u=2;u<o;u+=2)if(this.bb.readInt16(s+u)!=this.bb.readInt16(c+u))continue e;a=this.vtables[r];break}}return a?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,a-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,r,i){let n=i?4:0;if(r){let o=r;if(this.prep(this.minalign,8+n),o.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+n),this.addOffset(e),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,r){this.finish(e,r,!0)}requiredField(e,r){let i=this.bb.capacity()-e,n=i-this.bb.readInt32(i);if(!(r<this.bb.readInt16(n)&&this.bb.readInt16(n+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(e,r,i){this.notNested(),this.vector_num_elems=r,this.prep(4,e*r),this.prep(i,e*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let r=this.createString(e);return this.string_maps.set(e,r),r}createString(e){if(e==null)return 0;let r;return e instanceof Uint8Array?r=e:r=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let r=[];for(let i=0;i<e.length;++i){let n=e[i];if(n!==null)r.push(this.createObjectOffset(n));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(e,r){return r(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var de=m(()=>{Nl();mh();NI();gh();hh()});var Ni,yh=m(()=>{(function(t){t[t.BUFFER=0]="BUFFER"})(Ni||(Ni={}))});var wt,Ps=m(()=>{(function(t){t[t.LZ4_FRAME=0]="LZ4_FRAME",t[t.ZSTD=1]="ZSTD"})(wt||(wt={}))});var bn,vh=m(()=>{de();yh();Ps();bn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBodyCompression(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):wt.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Ni.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,r){e.addFieldInt8(0,r,wt.LZ4_FRAME)}static addMethod(e,r){e.addFieldInt8(1,r,Ni.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,r,i){return t.startBodyCompression(e),t.addCodec(e,r),t.addMethod(e,i),t.endBodyCompression(e)}}});var Vo,bh=m(()=>{Vo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,r,i){return e.prep(8,16),e.writeInt64(BigInt(i??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var Zo,_h=m(()=>{Zo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,r,i){return e.prep(8,16),e.writeInt64(BigInt(i??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var lt,wh=m(()=>{de();vh();bh();_h();lt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsRecordBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,r){let i=this.bb.__offset(this.bb_pos,6);return i?(r||new Zo).__init(this.bb.__vector(this.bb_pos+i)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new Vo).__init(this.bb.__vector(this.bb_pos+i)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new bn).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addNodes(e,r){e.addFieldOffset(1,r,0)}static startNodesVector(e,r){e.startVector(16,r,8)}static addBuffers(e,r){e.addFieldOffset(2,r,0)}static startBuffersVector(e,r){e.startVector(16,r,8)}static addCompression(e,r){e.addFieldOffset(3,r,0)}static addVariadicBufferCounts(e,r){e.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(e,r){e.startVector(8,r.length,8);for(let i=r.length-1;i>=0;i--)e.addInt64(r[i]);return e.endVector()}static startVariadicBufferCountsVector(e,r){e.startVector(8,r,8)}static endRecordBatch(e){return e.endObject()}}});var _n,UI=m(()=>{de();wh();_n=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new lt).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addData(e,r){e.addFieldOffset(1,r,0)}static addIsDelta(e,r){e.addFieldInt8(2,+r,0)}static endDictionaryBatch(e){return e.endObject()}}});var Wn,$h=m(()=>{(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(Wn||(Wn={}))});var Ls,PI=m(()=>{(function(t){t[t.DenseArray=0]="DenseArray"})(Ls||(Ls={}))});var xr,El=m(()=>{de();xr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInt(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,r){e.addFieldInt32(0,r,0)}static addIsSigned(e,r){e.addFieldInt8(1,+r,0)}static endInt(e){return e.endObject()}static createInt(e,r,i){return t.startInt(e),t.addBitWidth(e,r),t.addIsSigned(e,i),t.endInt(e)}}});var jr,xh=m(()=>{de();PI();El();jr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryEncoding(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new xr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Ls.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addIndexType(e,r){e.addFieldOffset(1,r,0)}static addIsOrdered(e,r){e.addFieldInt8(2,+r,0)}static addDictionaryKind(e,r){e.addFieldInt16(3,r,Ls.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Ce,Wo=m(()=>{de();Ce=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsKeyValue(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}key(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}value(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,r){e.addFieldOffset(0,r,0)}static addValue(e,r){e.addFieldOffset(1,r,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,r,i){return t.startKeyValue(e),t.addKey(e,r),t.addValue(e,i),t.endKeyValue(e)}}});var Es,LI=m(()=>{de();Es=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return t.startBinary(e),t.endBinary(e)}}});var Cs,EI=m(()=>{de();Cs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinaryView(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return t.startBinaryView(e),t.endBinaryView(e)}}});var Fs,CI=m(()=>{de();Fs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBool(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return t.startBool(e),t.endBool(e)}}});var Jn,Ih=m(()=>{de();fh();Jn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDate(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ve.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,Ve.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,r){return t.startDate(e),t.addUnit(e,r),t.endDate(e)}}});var Mr,Sh=m(()=>{de();Mr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDecimal(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,r){e.addFieldInt32(0,r,0)}static addScale(e,r){e.addFieldInt32(1,r,0)}static addBitWidth(e,r){e.addFieldInt32(2,r,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,r,i,n){return t.startDecimal(e),t.addPrecision(e,r),t.addScale(e,i),t.addBitWidth(e,n),t.endDecimal(e)}}});var Gn,kh=m(()=>{de();Ns();Gn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDuration(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,E.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,r){return t.startDuration(e),t.addUnit(e,r),t.endDuration(e)}}});var Hn,Dh=m(()=>{de();Hn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,r){return t.startFixedSizeBinary(e),t.addByteWidth(e,r),t.endFixedSizeBinary(e)}}});var Kn,Ah=m(()=>{de();Kn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,r){return t.startFixedSizeList(e),t.addListSize(e,r),t.endFixedSizeList(e)}}});var Yn,zh=m(()=>{de();dh();Yn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFloatingPoint(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Se.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,r){e.addFieldInt16(0,r,Se.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,r){return t.startFloatingPoint(e),t.addPrecision(e,r),t.endFloatingPoint(e)}}});var Xn,Oh=m(()=>{de();ph();Xn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInterval(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Te.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,Te.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,r){return t.startInterval(e),t.addUnit(e,r),t.endInterval(e)}}});var js,FI=m(()=>{de();js=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return t.startLargeBinary(e),t.endLargeBinary(e)}}});var Ms,jI=m(()=>{de();Ms=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return t.startLargeList(e),t.endLargeList(e)}}});var Rs,MI=m(()=>{de();Rs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return t.startLargeUtf8(e),t.endLargeUtf8(e)}}});var Vs,RI=m(()=>{de();Vs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return t.startList(e),t.endList(e)}}});var qn,Bh=m(()=>{de();qn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMap(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,r){e.addFieldInt8(0,+r,0)}static endMap(e){return e.endObject()}static createMap(e,r){return t.startMap(e),t.addKeysSorted(e,r),t.endMap(e)}}});var Zs,VI=m(()=>{de();Zs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsNull(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return t.startNull(e),t.endNull(e)}}});var Ws,ZI=m(()=>{de();Ws=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsStruct_(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return t.startStruct_(e),t.endStruct_(e)}}});var wn,Th=m(()=>{de();Ns();wn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTime(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,E.MILLISECOND)}static addBitWidth(e,r){e.addFieldInt32(1,r,32)}static endTime(e){return e.endObject()}static createTime(e,r,i){return t.startTime(e),t.addUnit(e,r),t.addBitWidth(e,i),t.endTime(e)}}});var $n,Nh=m(()=>{de();Ns();$n=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTimestamp(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.SECOND}timezone(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,E.SECOND)}static addTimezone(e,r){e.addFieldOffset(1,r,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,r,i){return t.startTimestamp(e),t.addUnit(e,r),t.addTimezone(e,i),t.endTimestamp(e)}}});var Ir,Uh=m(()=>{de();lh();Ir=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUnion(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ae.Sparse}typeIds(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,r){e.addFieldInt16(0,r,Ae.Sparse)}static addTypeIds(e,r){e.addFieldOffset(1,r,0)}static createTypeIdsVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addInt32(r[i]);return e.endVector()}static startTypeIdsVector(e,r){e.startVector(4,r,4)}static endUnion(e){return e.endObject()}static createUnion(e,r,i){return t.startUnion(e),t.addMode(e,r),t.addTypeIds(e,i),t.endUnion(e)}}});var Js,WI=m(()=>{de();Js=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return t.startUtf8(e),t.endUtf8(e)}}});var Gs,JI=m(()=>{de();Gs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8View(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return t.startUtf8View(e),t.endUtf8View(e)}}});var ye,Ph=m(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.FloatingPoint=3]="FloatingPoint",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct_=13]="Struct_",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.RunEndEncoded=22]="RunEndEncoded",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.ListView=25]="ListView",t[t.LargeListView=26]="LargeListView"})(ye||(ye={}))});var dt,Lh=m(()=>{de();xh();Wo();Ph();dt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsField(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):ye.NONE}type(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(e,this.bb_pos+r):null}dictionary(e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new jr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(e,r){let i=this.bb.__offset(this.bb_pos,14);return i?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let i=this.bb.__offset(this.bb_pos,16);return i?(r||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,r){e.addFieldOffset(0,r,0)}static addNullable(e,r){e.addFieldInt8(1,+r,0)}static addTypeType(e,r){e.addFieldInt8(2,r,ye.NONE)}static addType(e,r){e.addFieldOffset(3,r,0)}static addDictionary(e,r){e.addFieldOffset(4,r,0)}static addChildren(e,r){e.addFieldOffset(5,r,0)}static createChildrenVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startChildrenVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(6,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endField(e){return e.endObject()}}});var Ot,Eh=m(()=>{de();$h();Lh();Wo();Ot=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsSchema(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Wn.Little}fields(e,r){let i=this.bb.__offset(this.bb_pos,6);return i?(r||new dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,r){e.addFieldInt16(0,r,Wn.Little)}static addFields(e,r){e.addFieldOffset(1,r,0)}static createFieldsVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startFieldsVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(2,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static addFeatures(e,r){e.addFieldOffset(3,r,0)}static createFeaturesVector(e,r){e.startVector(8,r.length,8);for(let i=r.length-1;i>=0;i--)e.addInt64(r[i]);return e.endVector()}static startFeaturesVector(e,r){e.startVector(8,r,8)}static endSchema(e){return e.endObject()}static createSchema(e,r,i,n,o){return t.startSchema(e),t.addEndianness(e,r),t.addFields(e,i),t.addCustomMetadata(e,n),t.addFeatures(e,o),t.endSchema(e)}}});var ue,Ch=m(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor",t[t.SparseTensor=5]="SparseTensor"})(ue||(ue={}))});var g,Jt,Qe=m(()=>{Tl();lh();dh();fh();Ns();ph();Ch();(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t[t.DurationSecond=-27]="DurationSecond",t[t.DurationMillisecond=-28]="DurationMillisecond",t[t.DurationMicrosecond=-29]="DurationMicrosecond",t[t.DurationNanosecond=-30]="DurationNanosecond",t[t.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(g||(g={}));(function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"})(Jt||(Jt={}))});var Fh={};Ie(Fh,{valueToString:()=>Sr});function Sr(t){if(t===null)return"null";if(t===void 0)return"undefined";switch(typeof t){case"number":return`${t}`;case"bigint":return`${t}`;case"string":return`"${t}"`}return typeof t[Symbol.toPrimitive]=="function"?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?t instanceof BigInt64Array||t instanceof BigUint64Array?`[${[...t].map(e=>Sr(e))}]`:`[${t}]`:ArrayBuffer.isView(t)?`[${t}]`:JSON.stringify(t,(e,r)=>typeof r=="bigint"?`${r}`:r)}var Hs=m(()=>{});function ie(t){if(typeof t=="bigint"&&(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER))throw new TypeError(`${t} is not safe to convert to a number.`);return Number(t)}function jh(t,e){return ie(t/e)+ie(t%e)/ie(e)}var Rr=m(()=>{});var Vh={};Ie(Vh,{BN:()=>Ys,bigNumToBigInt:()=>HI,bigNumToNumber:()=>Rh,bigNumToString:()=>Ho,isArrowBigNumSymbol:()=>GI});function kr(t,...e){return e.length===0?Object.setPrototypeOf(ne(this.TypedArray,t),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(t,...e),this.constructor.prototype)}function Jo(...t){return kr.apply(this,t)}function Go(...t){return kr.apply(this,t)}function Ks(...t){return kr.apply(this,t)}function Rh(t,e){let{buffer:r,byteOffset:i,byteLength:n,signed:o}=t,a=new BigUint64Array(r,i,n/8),s=o&&a.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(s){for(let l of a)c|=(l^EN)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let l of a)c|=l*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let l=BigInt("1".padEnd(e+1,"0")),d=c/l,f=s?-(c%l):c%l,p=ie(d),h=`${f}`.padStart(e,"0");return+`${s&&p===0?"-":""}${p}.${h}`}return ie(c)}function Ho(t){if(t.byteLength===8)return`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`;if(!t.signed)return Mh(t);let e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return Mh(t);e=e.slice();let i=1;for(let o=0;o<e.length;o++){let a=e[o],s=~a+i;e[o]=s,i&=a===0?1:0}return`-${Mh(e)}`}function HI(t){return t.byteLength===8?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:Ho(t)}function Mh(t){let e="",r=new Uint32Array(2),i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=new Uint32Array((i=new Uint16Array(i).reverse()).buffer),o=-1,a=i.length-1;do{for(r[0]=i[o=0];o<a;)i[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+i[o];i[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,e=`${r[0]}${e}`}while(n[0]||n[1]||n[2]||n[3]);return e??"0"}var GI,LN,EN,Ys,Zh=m(()=>{qe();Rr();GI=Symbol.for("isArrowBigNum");kr.prototype[GI]=!0;kr.prototype.toJSON=function(){return`"${Ho(this)}"`};kr.prototype.valueOf=function(t){return Rh(this,t)};kr.prototype.toString=function(){return Ho(this)};kr.prototype[Symbol.toPrimitive]=function(t="default"){switch(t){case"number":return Rh(this);case"string":return Ho(this);case"default":return HI(this)}return Ho(this)};Object.setPrototypeOf(Jo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Go.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ks.prototype,Object.create(Uint32Array.prototype));Object.assign(Jo.prototype,kr.prototype,{constructor:Jo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Go.prototype,kr.prototype,{constructor:Go,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Ks.prototype,kr.prototype,{constructor:Ks,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});LN=BigInt(4294967296)*BigInt(4294967296),EN=LN-BigInt(1);Ys=class t{static new(e,r){switch(r){case!0:return new Jo(e);case!1:return new Go(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Jo(e)}return e.byteLength===16?new Ks(e):new Go(e)}static signed(e){return new Jo(e)}static unsigned(e){return new Go(e)}static decimal(e){return new Ks(e)}constructor(e,r){return t.new(e,r)}}});function Kt(t){let e=t;switch(t.typeId){case g.Decimal:return t.bitWidth/32;case g.Interval:return e.unit===Te.MONTH_DAY_NANO?4:1+e.unit;case g.BinaryView:case g.Utf8View:return 16;case g.FixedSizeList:return e.listSize;case g.FixedSizeBinary:return e.byteWidth;default:return 1}}var KI,YI,XI,qI,QI,eS,tS,rS,nS,iS,oS,aS,sS,cS,uS,lS,dS,fS,pS,mS,hS,gS,yS,vS,bS,_S,z,ft,Ge,Ui,Pi,Gt,Li,Ei,Ci,Fi,ji,Ht,Xs,Mi,Ri,Vr,te,Zr,Wr,Bt,Jr,Gr,Hr,Kr,Yr,Xr,qr,Qr,ar,sr,ze,cr,en,Tt,ur,CN,Nt,ke=m(()=>{Rr();Qe();_S=Symbol.for("apache-arrow/DataType"),z=class t{static isDataType(e){return e?.[_S]===!0}static isNull(e){return e?.typeId===g.Null}static isInt(e){return e?.typeId===g.Int}static isFloat(e){return e?.typeId===g.Float}static isBinary(e){return e?.typeId===g.Binary}static isBinaryView(e){return e?.typeId===g.BinaryView}static isLargeBinary(e){return e?.typeId===g.LargeBinary}static isUtf8(e){return e?.typeId===g.Utf8}static isUtf8View(e){return e?.typeId===g.Utf8View}static isLargeUtf8(e){return e?.typeId===g.LargeUtf8}static isBool(e){return e?.typeId===g.Bool}static isDecimal(e){return e?.typeId===g.Decimal}static isDate(e){return e?.typeId===g.Date}static isTime(e){return e?.typeId===g.Time}static isTimestamp(e){return e?.typeId===g.Timestamp}static isInterval(e){return e?.typeId===g.Interval}static isDuration(e){return e?.typeId===g.Duration}static isList(e){return e?.typeId===g.List}static isLargeList(e){return e?.typeId===g.LargeList}static isStruct(e){return e?.typeId===g.Struct}static isUnion(e){return e?.typeId===g.Union}static isFixedSizeBinary(e){return e?.typeId===g.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===g.FixedSizeList}static isMap(e){return e?.typeId===g.Map}static isDictionary(e){return e?.typeId===g.Dictionary}static isDenseUnion(e){return t.isUnion(e)&&e.mode===Ae.Dense}static isSparseUnion(e){return t.isUnion(e)&&e.mode===Ae.Sparse}constructor(e){this.typeId=e}};KI=Symbol.toStringTag;z[KI]=(t=>(t.children=null,t.ArrayType=Array,t.OffsetArrayType=Int32Array,t[_S]=!0,t[Symbol.toStringTag]="DataType"))(z.prototype);ft=class extends z{constructor(){super(g.Null)}toString(){return"Null"}};YI=Symbol.toStringTag;ft[YI]=(t=>t[Symbol.toStringTag]="Null")(ft.prototype);Ge=class extends z{constructor(e,r){super(g.Int),this.isSigned=e,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};XI=Symbol.toStringTag;Ge[XI]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(Ge.prototype);Ui=class extends Ge{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Pi=class extends Ge{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Gt=class extends Ge{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Li=class extends Ge{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Ei=class extends Ge{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Ci=class extends Ge{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Fi=class extends Ge{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},ji=class extends Ge{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Ui.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Pi.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Gt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Li.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ei.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Ci.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Fi.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(ji.prototype,"ArrayType",{value:BigUint64Array});Ht=class extends z{constructor(e){super(g.Float),this.precision=e}get ArrayType(){switch(this.precision){case Se.HALF:return Uint16Array;case Se.SINGLE:return Float32Array;case Se.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};qI=Symbol.toStringTag;Ht[qI]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(Ht.prototype);Xs=class extends Ht{constructor(){super(Se.HALF)}},Mi=class extends Ht{constructor(){super(Se.SINGLE)}},Ri=class extends Ht{constructor(){super(Se.DOUBLE)}};Object.defineProperty(Xs.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Mi.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ri.prototype,"ArrayType",{value:Float64Array});Vr=class extends z{constructor(){super(g.Binary)}toString(){return"Binary"}};QI=Symbol.toStringTag;Vr[QI]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(Vr.prototype);te=class extends z{constructor(){super(g.BinaryView)}toString(){return"BinaryView"}};eS=Symbol.toStringTag;te.ELEMENT_WIDTH=16;te.INLINE_CAPACITY=12;te.LENGTH_OFFSET=0;te.INLINE_OFFSET=4;te.BUFFER_INDEX_OFFSET=8;te.BUFFER_OFFSET_OFFSET=12;te[eS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="BinaryView"))(te.prototype);Zr=class extends z{constructor(){super(g.LargeBinary)}toString(){return"LargeBinary"}};tS=Symbol.toStringTag;Zr[tS]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeBinary"))(Zr.prototype);Wr=class extends z{constructor(){super(g.Utf8)}toString(){return"Utf8"}};rS=Symbol.toStringTag;Wr[rS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(Wr.prototype);Bt=class extends z{constructor(){super(g.Utf8View)}toString(){return"Utf8View"}};nS=Symbol.toStringTag;Bt.ELEMENT_WIDTH=te.ELEMENT_WIDTH;Bt.INLINE_CAPACITY=te.INLINE_CAPACITY;Bt[nS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8View"))(Bt.prototype);Jr=class extends z{constructor(){super(g.LargeUtf8)}toString(){return"LargeUtf8"}};iS=Symbol.toStringTag;Jr[iS]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeUtf8"))(Jr.prototype);Gr=class extends z{constructor(){super(g.Bool)}toString(){return"Bool"}};oS=Symbol.toStringTag;Gr[oS]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(Gr.prototype);Hr=class extends z{constructor(e,r,i=128){super(g.Decimal),this.scale=e,this.precision=r,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};aS=Symbol.toStringTag;Hr[aS]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(Hr.prototype);Kr=class extends z{constructor(e){super(g.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${Ve[this.unit]}>`}get ArrayType(){return this.unit===Ve.DAY?Int32Array:BigInt64Array}};sS=Symbol.toStringTag;Kr[sS]=(t=>(t.unit=null,t[Symbol.toStringTag]="Date"))(Kr.prototype);Yr=class extends z{constructor(e,r){super(g.Time),this.unit=e,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${E[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};cS=Symbol.toStringTag;Yr[cS]=(t=>(t.unit=null,t.bitWidth=null,t[Symbol.toStringTag]="Time"))(Yr.prototype);Xr=class extends z{constructor(e,r){super(g.Timestamp),this.unit=e,this.timezone=r}toString(){return`Timestamp<${E[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};uS=Symbol.toStringTag;Xr[uS]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Timestamp"))(Xr.prototype);qr=class extends z{constructor(e){super(g.Interval),this.unit=e}toString(){return`Interval<${Te[this.unit]}>`}};lS=Symbol.toStringTag;qr[lS]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(qr.prototype);Qr=class extends z{constructor(e){super(g.Duration),this.unit=e}toString(){return`Duration<${E[this.unit]}>`}};dS=Symbol.toStringTag;Qr[dS]=(t=>(t.unit=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Duration"))(Qr.prototype);ar=class extends z{constructor(e){super(g.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};fS=Symbol.toStringTag;ar[fS]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(ar.prototype);sr=class extends z{constructor(e){super(g.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};pS=Symbol.toStringTag;sr[pS]=(t=>(t.children=null,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeList"))(sr.prototype);ze=class extends z{constructor(e){super(g.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};mS=Symbol.toStringTag;ze[mS]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(ze.prototype);cr=class extends z{constructor(e,r,i){super(g.Union),this.mode=e,this.children=i,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((n,o,a)=>(n[o]=a)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};hS=Symbol.toStringTag;cr[hS]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(cr.prototype);en=class extends z{constructor(e){super(g.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};gS=Symbol.toStringTag;en[gS]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(en.prototype);Tt=class extends z{constructor(e,r){super(g.FixedSizeList),this.listSize=e,this.children=[r]}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}>`}};yS=Symbol.toStringTag;Tt[yS]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(Tt.prototype);ur=class extends z{constructor(e,r=!1){var i,n,o;if(super(g.Map),this.children=[e],this.keysSorted=r,e&&(e.name="entries",!((i=e?.type)===null||i===void 0)&&i.children)){let a=(n=e?.type)===null||n===void 0?void 0:n.children[0];a&&(a.name="key");let s=(o=e?.type)===null||o===void 0?void 0:o.children[1];s&&(s.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};vS=Symbol.toStringTag;ur[vS]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(ur.prototype);CN=(t=>()=>++t)(-1),Nt=class extends z{constructor(e,r,i,n){super(g.Dictionary),this.indices=r,this.dictionary=e,this.isOrdered=n||!1,this.id=i==null?CN():ie(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};bS=Symbol.toStringTag;Nt[bS]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(Nt.prototype)});function jN(t,e,r=!0){return typeof e=="number"?Ko(t,e,r):typeof e=="string"&&e in g?Ko(t,g[e],r):e&&e instanceof z?Ko(t,wS(e),r):e?.type&&e.type instanceof z?Ko(t,wS(e.type),r):Ko(t,g.NONE,r)}function Ko(t,e,r=!0){let i=null;switch(e){case g.Null:i=t.visitNull;break;case g.Bool:i=t.visitBool;break;case g.Int:i=t.visitInt;break;case g.Int8:i=t.visitInt8||t.visitInt;break;case g.Int16:i=t.visitInt16||t.visitInt;break;case g.Int32:i=t.visitInt32||t.visitInt;break;case g.Int64:i=t.visitInt64||t.visitInt;break;case g.Uint8:i=t.visitUint8||t.visitInt;break;case g.Uint16:i=t.visitUint16||t.visitInt;break;case g.Uint32:i=t.visitUint32||t.visitInt;break;case g.Uint64:i=t.visitUint64||t.visitInt;break;case g.Float:i=t.visitFloat;break;case g.Float16:i=t.visitFloat16||t.visitFloat;break;case g.Float32:i=t.visitFloat32||t.visitFloat;break;case g.Float64:i=t.visitFloat64||t.visitFloat;break;case g.Utf8:i=t.visitUtf8;break;case g.LargeUtf8:i=t.visitLargeUtf8;break;case g.Utf8View:i=t.visitUtf8View||t.visitUtf8;break;case g.Binary:i=t.visitBinary;break;case g.LargeBinary:i=t.visitLargeBinary;break;case g.BinaryView:i=t.visitBinaryView||t.visitBinary;break;case g.FixedSizeBinary:i=t.visitFixedSizeBinary;break;case g.Date:i=t.visitDate;break;case g.DateDay:i=t.visitDateDay||t.visitDate;break;case g.DateMillisecond:i=t.visitDateMillisecond||t.visitDate;break;case g.Timestamp:i=t.visitTimestamp;break;case g.TimestampSecond:i=t.visitTimestampSecond||t.visitTimestamp;break;case g.TimestampMillisecond:i=t.visitTimestampMillisecond||t.visitTimestamp;break;case g.TimestampMicrosecond:i=t.visitTimestampMicrosecond||t.visitTimestamp;break;case g.TimestampNanosecond:i=t.visitTimestampNanosecond||t.visitTimestamp;break;case g.Time:i=t.visitTime;break;case g.TimeSecond:i=t.visitTimeSecond||t.visitTime;break;case g.TimeMillisecond:i=t.visitTimeMillisecond||t.visitTime;break;case g.TimeMicrosecond:i=t.visitTimeMicrosecond||t.visitTime;break;case g.TimeNanosecond:i=t.visitTimeNanosecond||t.visitTime;break;case g.Decimal:i=t.visitDecimal;break;case g.List:i=t.visitList;break;case g.LargeList:i=t.visitLargeList;break;case g.Struct:i=t.visitStruct;break;case g.Union:i=t.visitUnion;break;case g.DenseUnion:i=t.visitDenseUnion||t.visitUnion;break;case g.SparseUnion:i=t.visitSparseUnion||t.visitUnion;break;case g.Dictionary:i=t.visitDictionary;break;case g.Interval:i=t.visitInterval;break;case g.IntervalDayTime:i=t.visitIntervalDayTime||t.visitInterval;break;case g.IntervalYearMonth:i=t.visitIntervalYearMonth||t.visitInterval;break;case g.IntervalMonthDayNano:i=t.visitIntervalMonthDayNano||t.visitInterval;break;case g.Duration:i=t.visitDuration;break;case g.DurationSecond:i=t.visitDurationSecond||t.visitDuration;break;case g.DurationMillisecond:i=t.visitDurationMillisecond||t.visitDuration;break;case g.DurationMicrosecond:i=t.visitDurationMicrosecond||t.visitDuration;break;case g.DurationNanosecond:i=t.visitDurationNanosecond||t.visitDuration;break;case g.FixedSizeList:i=t.visitFixedSizeList;break;case g.Map:i=t.visitMap;break}if(typeof i=="function")return i;if(!r)return()=>null;throw new Error(`Unrecognized type '${g[e]}'`)}function wS(t){switch(t.typeId){case g.Null:return g.Null;case g.Int:{let{bitWidth:e,isSigned:r}=t;switch(e){case 8:return r?g.Int8:g.Uint8;case 16:return r?g.Int16:g.Uint16;case 32:return r?g.Int32:g.Uint32;case 64:return r?g.Int64:g.Uint64}return g.Int}case g.Float:switch(t.precision){case Se.HALF:return g.Float16;case Se.SINGLE:return g.Float32;case Se.DOUBLE:return g.Float64}return g.Float;case g.Binary:return g.Binary;case g.LargeBinary:return g.LargeBinary;case g.BinaryView:return g.BinaryView;case g.Utf8:return g.Utf8;case g.LargeUtf8:return g.LargeUtf8;case g.Utf8View:return g.Utf8View;case g.Bool:return g.Bool;case g.Decimal:return g.Decimal;case g.Time:switch(t.unit){case E.SECOND:return g.TimeSecond;case E.MILLISECOND:return g.TimeMillisecond;case E.MICROSECOND:return g.TimeMicrosecond;case E.NANOSECOND:return g.TimeNanosecond}return g.Time;case g.Timestamp:switch(t.unit){case E.SECOND:return g.TimestampSecond;case E.MILLISECOND:return g.TimestampMillisecond;case E.MICROSECOND:return g.TimestampMicrosecond;case E.NANOSECOND:return g.TimestampNanosecond}return g.Timestamp;case g.Date:switch(t.unit){case Ve.DAY:return g.DateDay;case Ve.MILLISECOND:return g.DateMillisecond}return g.Date;case g.Interval:switch(t.unit){case Te.DAY_TIME:return g.IntervalDayTime;case Te.YEAR_MONTH:return g.IntervalYearMonth;case Te.MONTH_DAY_NANO:return g.IntervalMonthDayNano}return g.Interval;case g.Duration:switch(t.unit){case E.SECOND:return g.DurationSecond;case E.MILLISECOND:return g.DurationMillisecond;case E.MICROSECOND:return g.DurationMicrosecond;case E.NANOSECOND:return g.DurationNanosecond}return g.Duration;case g.Map:return g.Map;case g.List:return g.List;case g.LargeList:return g.LargeList;case g.Struct:return g.Struct;case g.Union:switch(t.mode){case Ae.Dense:return g.DenseUnion;case Ae.Sparse:return g.SparseUnion}return g.Union;case g.FixedSizeBinary:return g.FixedSizeBinary;case g.FixedSizeList:return g.FixedSizeList;case g.Dictionary:return g.Dictionary}throw new Error(`Unrecognized type '${g[t.typeId]}'`)}var J,Dr=m(()=>{Qe();ke();J=class{visitMany(e,...r){return e.map((i,n)=>this.visit(i,...r.map(o=>o[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,r=!0){return jN(this,e,r)}getVisitFnByTypeId(e,r=!0){return Ko(this,e,r)}visitNull(e,...r){return null}visitBool(e,...r){return null}visitInt(e,...r){return null}visitFloat(e,...r){return null}visitUtf8(e,...r){return null}visitLargeUtf8(e,...r){return null}visitUtf8View(e,...r){return null}visitBinary(e,...r){return null}visitLargeBinary(e,...r){return null}visitBinaryView(e,...r){return null}visitFixedSizeBinary(e,...r){return null}visitDate(e,...r){return null}visitTimestamp(e,...r){return null}visitTime(e,...r){return null}visitDecimal(e,...r){return null}visitList(e,...r){return null}visitLargeList(e,...r){return null}visitStruct(e,...r){return null}visitUnion(e,...r){return null}visitDictionary(e,...r){return null}visitInterval(e,...r){return null}visitDuration(e,...r){return null}visitFixedSizeList(e,...r){return null}visitMap(e,...r){return null}};J.prototype.visitInt8=null;J.prototype.visitInt16=null;J.prototype.visitInt32=null;J.prototype.visitInt64=null;J.prototype.visitUint8=null;J.prototype.visitUint16=null;J.prototype.visitUint32=null;J.prototype.visitUint64=null;J.prototype.visitFloat16=null;J.prototype.visitFloat32=null;J.prototype.visitFloat64=null;J.prototype.visitDateDay=null;J.prototype.visitDateMillisecond=null;J.prototype.visitTimestampSecond=null;J.prototype.visitTimestampMillisecond=null;J.prototype.visitTimestampMicrosecond=null;J.prototype.visitTimestampNanosecond=null;J.prototype.visitTimeSecond=null;J.prototype.visitTimeMillisecond=null;J.prototype.visitTimeMicrosecond=null;J.prototype.visitTimeNanosecond=null;J.prototype.visitDenseUnion=null;J.prototype.visitSparseUnion=null;J.prototype.visitIntervalDayTime=null;J.prototype.visitIntervalYearMonth=null;J.prototype.visitIntervalMonthDayNano=null;J.prototype.visitDuration=null;J.prototype.visitDurationSecond=null;J.prototype.visitDurationMillisecond=null;J.prototype.visitDurationMicrosecond=null;J.prototype.visitDurationNanosecond=null});var Wh={};Ie(Wh,{float64ToUint16:()=>qs,uint16ToFloat64:()=>Cl});function Cl(t){let e=(t&31744)>>10,r=(t&1023)/1024,i=Math.pow(-1,(t&32768)>>15);switch(e){case 31:return i*(r?Number.NaN:1/0);case 0:return i*(r?6103515625e-14*r:0)}return i*Math.pow(2,e-15)*(1+r)}function qs(t){if(t!==t)return 32256;$S[0]=t;let e=(Yo[1]&2147483648)>>16&65535,r=Yo[1]&2146435072,i=0;return r>=1089470464?Yo[0]>0?r=31744:(r=(r&2080374784)>>16,i=(Yo[1]&1048575)>>10):r<=1056964608?(i=1048576+(Yo[1]&1048575),i=1048576+(i<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,i=(Yo[1]&1048575)+512>>10),e|r|i&65535}var $S,Yo,Qs=m(()=>{$S=new Float64Array(1),Yo=new Uint32Array($S.buffer)});function K(t){return(e,r,i)=>{if(e.setValid(r,i!=null))return t(e,r,i)}}var V,MN,xS,RN,xn,Jh,IS,VN,Fl,jl,Gh,SS,ZN,kS,WN,DS,JN,Hh,Ml,Rl,Vl,Zl,Kh,Wl,Jl,Gl,Hl,Yh,Xh,AS,GN,HN,KN,YN,XN,qN,QN,zS,OS,eU,qh,Kl,Yl,Xl,ql,Ql,ed,td,Qh,tU,at,Yt=m(()=>{Ut();Dr();Rr();vn();Qs();Qe();ke();V=class extends J{};MN=(t,e,r)=>{t[e]=Math.floor(r/864e5)},xS=(t,e,r,i)=>{if(r+1<e.length){let n=ie(e[r]),o=ie(e[r+1]);t.set(i.subarray(0,o-n),n)}},RN=({offset:t,values:e},r,i)=>{let n=t+r;i?e[n>>3]|=1<<n%8:e[n>>3]&=~(1<<n%8)},xn=({values:t},e,r)=>{t[e]=r},Jh=({values:t},e,r)=>{t[e]=r},IS=({values:t},e,r)=>{t[e]=qs(r)},VN=(t,e,r)=>{switch(t.type.precision){case Se.HALF:return IS(t,e,r);case Se.SINGLE:case Se.DOUBLE:return Jh(t,e,r)}},Fl=({values:t},e,r)=>{MN(t,e,r.valueOf())},jl=({values:t},e,r)=>{t[e]=BigInt(r)},Gh=({stride:t,values:e},r,i)=>{e.set(i.subarray(0,t),t*r)},SS=({values:t,valueOffsets:e},r,i)=>xS(t,e,r,i),ZN=t=>{let e=t.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),t.variadicBuffers=e),e},kS=(t,e,r)=>{var i,n,o,a;let s=t.values;if(!s)throw new Error("BinaryView data is missing view buffer");let c=te.ELEMENT_WIDTH,u=e*c,l=u+c;if(u<0||l>s.length)throw new RangeError(`BinaryView index ${e} out of bounds`);s.fill(0,u,l);let d=new DataView(s.buffer,s.byteOffset+u,c),f=r.length;if(d.setInt32(te.LENGTH_OFFSET,f,!0),f<=te.INLINE_CAPACITY){s.set(r,u+te.INLINE_OFFSET);return}let p=((i=r[0])!==null&&i!==void 0?i:0)|((n=r[1])!==null&&n!==void 0?n:0)<<8|((o=r[2])!==null&&o!==void 0?o:0)<<16|((a=r[3])!==null&&a!==void 0?a:0)<<24;d.setUint32(te.INLINE_OFFSET,p>>>0,!0);let h=ZN(t),y=r.slice(),_=h.push(y)-1;d.setInt32(te.BUFFER_INDEX_OFFSET,_,!0),d.setInt32(te.BUFFER_OFFSET_OFFSET,0,!0)},WN=(t,e,r)=>{let i=r instanceof Uint8Array?r:new Uint8Array(r);kS(t,e,i)},DS=({values:t,valueOffsets:e},r,i)=>xS(t,e,r,Zt(i)),JN=(t,e,r)=>{let i=Zt(r);kS(t,e,i)},Hh=(t,e,r)=>{t.type.unit===Ve.DAY?Fl(t,e,r):jl(t,e,r)},Ml=({values:t},e,r)=>{t[e]=BigInt(r/1e3)},Rl=({values:t},e,r)=>{t[e]=BigInt(r)},Vl=({values:t},e,r)=>{t[e]=BigInt(r*1e3)},Zl=({values:t},e,r)=>{t[e]=BigInt(r*1e6)},Kh=(t,e,r)=>{switch(t.type.unit){case E.SECOND:return Ml(t,e,r);case E.MILLISECOND:return Rl(t,e,r);case E.MICROSECOND:return Vl(t,e,r);case E.NANOSECOND:return Zl(t,e,r)}},Wl=({values:t},e,r)=>{t[e]=r},Jl=({values:t},e,r)=>{t[e]=r},Gl=({values:t},e,r)=>{t[e]=r},Hl=({values:t},e,r)=>{t[e]=r},Yh=(t,e,r)=>{switch(t.type.unit){case E.SECOND:return Wl(t,e,r);case E.MILLISECOND:return Jl(t,e,r);case E.MICROSECOND:return Gl(t,e,r);case E.NANOSECOND:return Hl(t,e,r)}},Xh=({values:t,stride:e},r,i)=>{t.set(i.subarray(0,e),e*r)},AS=(t,e,r)=>{let i=t.children[0],n=t.valueOffsets,o=at.getVisitFn(i),a=ie(n[e]),s=ie(n[e+1]);if(Array.isArray(r))for(let c=-1,u=a;u<s;)o(i,u++,r[++c]);else for(let c=-1,u=a;u<s;)o(i,u++,r.get(++c))},GN=(t,e,r)=>{let i=t.children[0],{valueOffsets:n}=t,o=at.getVisitFn(i),{[e]:a,[e+1]:s}=n,c=r instanceof Map?r.entries():Object.entries(r);for(let u of c)if(o(i,a,u),++a>=s)break},HN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e[o]),KN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e.get(o)),YN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e.get(n.name)),XN=(t,e)=>(r,i,n,o)=>i&&r(i,t,e[n.name]),qN=(t,e,r)=>{let i=t.type.children.map(o=>at.getVisitFn(o.type)),n=r instanceof Map?YN(e,r):r instanceof P?KN(e,r):Array.isArray(r)?HN(e,r):XN(e,r);t.type.children.forEach((o,a)=>n(i[a],t.children[a],o,a))},QN=(t,e,r)=>{t.type.mode===Ae.Dense?zS(t,e,r):OS(t,e,r)},zS=(t,e,r)=>{let i=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[i];at.visit(n,t.valueOffsets[e],r)},OS=(t,e,r)=>{let i=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[i];at.visit(n,e,r)},eU=(t,e,r)=>{var i;(i=t.dictionary)===null||i===void 0||i.set(t.values[e],r)},qh=(t,e,r)=>{switch(t.type.unit){case Te.YEAR_MONTH:return Yl(t,e,r);case Te.DAY_TIME:return Kl(t,e,r);case Te.MONTH_DAY_NANO:return Xl(t,e,r)}},Kl=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},Yl=({values:t},e,r)=>{t[e]=r[0]*12+r[1]%12},Xl=({values:t,stride:e},r,i)=>{t.set(i.subarray(0,e),e*r)},ql=({values:t},e,r)=>{t[e]=r},Ql=({values:t},e,r)=>{t[e]=r},ed=({values:t},e,r)=>{t[e]=r},td=({values:t},e,r)=>{t[e]=r},Qh=(t,e,r)=>{switch(t.type.unit){case E.SECOND:return ql(t,e,r);case E.MILLISECOND:return Ql(t,e,r);case E.MICROSECOND:return ed(t,e,r);case E.NANOSECOND:return td(t,e,r)}},tU=(t,e,r)=>{let{stride:i}=t,n=t.children[0],o=at.getVisitFn(n);if(Array.isArray(r))for(let a=-1,s=e*i;++a<i;)o(n,s+a,r[a]);else for(let a=-1,s=e*i;++a<i;)o(n,s+a,r.get(a))};V.prototype.visitBool=K(RN);V.prototype.visitInt=K(xn);V.prototype.visitInt8=K(xn);V.prototype.visitInt16=K(xn);V.prototype.visitInt32=K(xn);V.prototype.visitInt64=K(xn);V.prototype.visitUint8=K(xn);V.prototype.visitUint16=K(xn);V.prototype.visitUint32=K(xn);V.prototype.visitUint64=K(xn);V.prototype.visitFloat=K(VN);V.prototype.visitFloat16=K(IS);V.prototype.visitFloat32=K(Jh);V.prototype.visitFloat64=K(Jh);V.prototype.visitUtf8=K(DS);V.prototype.visitLargeUtf8=K(DS);V.prototype.visitUtf8View=K(JN);V.prototype.visitBinary=K(SS);V.prototype.visitLargeBinary=K(SS);V.prototype.visitBinaryView=K(WN);V.prototype.visitFixedSizeBinary=K(Gh);V.prototype.visitDate=K(Hh);V.prototype.visitDateDay=K(Fl);V.prototype.visitDateMillisecond=K(jl);V.prototype.visitTimestamp=K(Kh);V.prototype.visitTimestampSecond=K(Ml);V.prototype.visitTimestampMillisecond=K(Rl);V.prototype.visitTimestampMicrosecond=K(Vl);V.prototype.visitTimestampNanosecond=K(Zl);V.prototype.visitTime=K(Yh);V.prototype.visitTimeSecond=K(Wl);V.prototype.visitTimeMillisecond=K(Jl);V.prototype.visitTimeMicrosecond=K(Gl);V.prototype.visitTimeNanosecond=K(Hl);V.prototype.visitDecimal=K(Xh);V.prototype.visitList=K(AS);V.prototype.visitLargeList=K(AS);V.prototype.visitStruct=K(qN);V.prototype.visitUnion=K(QN);V.prototype.visitDenseUnion=K(zS);V.prototype.visitSparseUnion=K(OS);V.prototype.visitDictionary=K(eU);V.prototype.visitInterval=K(qh);V.prototype.visitIntervalDayTime=K(Kl);V.prototype.visitIntervalYearMonth=K(Yl);V.prototype.visitIntervalMonthDayNano=K(Xl);V.prototype.visitDuration=K(Qh);V.prototype.visitDurationSecond=K(ql);V.prototype.visitDurationMillisecond=K(Ql);V.prototype.visitDurationMicrosecond=K(ed);V.prototype.visitDurationNanosecond=K(td);V.prototype.visitFixedSizeList=K(tU);V.prototype.visitMap=K(GN);at=new V});var Ar,Xo,Qn,eg,tg,rU,rg=m(()=>{Hs();Vi();Yt();Ar=Symbol.for("parent"),Xo=Symbol.for("rowIndex"),Qn=class{constructor(e,r){return this[Ar]=e,this[Xo]=r,new Proxy(this,rU)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Xo],r=this[Ar],i=r.type.children,n={};for(let o=-1,a=i.length;++o<a;)n[i[o].name]=He.visit(r.children[o],e);return n}toString(){return`{${[...this].map(([e,r])=>`${Sr(e)}: ${Sr(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new eg(this[Ar],this[Xo])}},eg=class{constructor(e,r){this.childIndex=0,this.children=e.children,this.rowIndex=r,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,He.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Qn.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ar]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xo]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});tg=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Ar].type.children.map(r=>r.name)}has(e,r){return e[Ar].type.children.some(i=>i.name===r)}getOwnPropertyDescriptor(e,r){if(e[Ar].type.children.some(i=>i.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let i=e[Ar].type.children.findIndex(n=>n.name===r);if(i!==-1){let n=He.visit(e[Ar].children[i],e[Xo]);return Reflect.set(e,r,n),n}}set(e,r,i){let n=e[Ar].type.children.findIndex(o=>o.name===r);return n!==-1?(at.visit(e[Ar].children[n],e[Xo],i),Reflect.set(e,r,i)):Reflect.has(e,r)||typeof r=="symbol"?Reflect.set(e,r,i):!1}},rU=new tg});function G(t){return(e,r)=>e.getValid(r)?t(e,r):null}var F,nU,qo,iU,oU,BS,aU,TS,NS,ei,sU,US,cU,PS,LS,uU,ES,lU,dU,fU,pU,CS,FS,jS,MS,mU,RS,VS,ZS,WS,hU,gU,JS,yU,vU,bU,GS,HS,_U,wU,KS,YS,XS,qS,QS,e0,t0,$U,xU,He,Vi=m(()=>{Zh();Ut();Dr();rd();rg();Rr();vn();Qs();Qe();F=class extends J{};nU=(t,e)=>864e5*t[e],qo=16,iU=12,oU=(t,e)=>null,BS=(t,e,r)=>{if(r+1>=e.length)return null;let i=ie(e[r]),n=ie(e[r+1]);return t.subarray(i,n)},aU=({offset:t,values:e},r)=>{let i=t+r;return(e[i>>3]&1<<i%8)!==0},TS=({values:t},e)=>nU(t,e),NS=({values:t},e)=>ie(t[e]),ei=({stride:t,values:e},r)=>e[t*r],sU=({stride:t,values:e},r)=>Cl(e[t*r]),US=({values:t},e)=>t[e],cU=({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1)),PS=({values:t,valueOffsets:e},r)=>BS(t,e,r),LS=(t,e)=>{var r;let i=t.values;if(!i)throw new Error("BinaryView data is missing view buffer");let n=e*qo,o=n+qo;if(n<0||o>i.length)throw new Error(`BinaryView data buffer is too short: expected ${qo} bytes, got ${Math.max(0,i.length-n)}`);let a=i.subarray(n,o);if(a.length<qo)throw new Error(`BinaryView data buffer is too short: expected ${qo} bytes, got ${a.length}`);let s=new DataView(i.buffer,a.byteOffset,qo),c=s.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=iU)return a.subarray(4,4+c);let u=s.getInt32(8,!0),l=s.getInt32(12,!0),d=(r=t.variadicBuffers)===null||r===void 0?void 0:r[u];if(!d)throw new Error(`BinaryView variadic buffer ${u} is missing`);return d.subarray(l,l+c)},uU=(t,e)=>LS(t,e),ES=({values:t,valueOffsets:e},r)=>{let i=BS(t,e,r);return i!==null?Mo(i):null},lU=(t,e)=>{let r=LS(t,e);return Mo(r)},dU=({values:t},e)=>t[e],fU=({type:t,values:e},r)=>t.precision!==Se.HALF?e[r]:Cl(e[r]),pU=(t,e)=>t.type.unit===Ve.DAY?TS(t,e):NS(t,e),CS=({values:t},e)=>1e3*ie(t[e]),FS=({values:t},e)=>ie(t[e]),jS=({values:t},e)=>jh(t[e],BigInt(1e3)),MS=({values:t},e)=>jh(t[e],BigInt(1e6)),mU=(t,e)=>{switch(t.type.unit){case E.SECOND:return CS(t,e);case E.MILLISECOND:return FS(t,e);case E.MICROSECOND:return jS(t,e);case E.NANOSECOND:return MS(t,e)}},RS=({values:t},e)=>t[e],VS=({values:t},e)=>t[e],ZS=({values:t},e)=>t[e],WS=({values:t},e)=>t[e],hU=(t,e)=>{switch(t.type.unit){case E.SECOND:return RS(t,e);case E.MILLISECOND:return VS(t,e);case E.MICROSECOND:return ZS(t,e);case E.NANOSECOND:return WS(t,e)}},gU=({values:t,stride:e},r)=>Ys.decimal(t.subarray(e*r,e*(r+1))),JS=(t,e)=>{let{valueOffsets:r,stride:i,children:n}=t,o=ie(r[e*i]),a=ie(r[e*i+1]),c=n[0].slice(o,a-o);return new P([c])},yU=(t,e)=>{let{valueOffsets:r,children:i}=t,{[e]:n,[e+1]:o}=r,a=i[0];return new tn(a.slice(n,o-n))},vU=(t,e)=>new Qn(t,e),bU=(t,e)=>t.type.mode===Ae.Dense?GS(t,e):HS(t,e),GS=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[r];return He.visit(i,t.valueOffsets[e])},HS=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[r];return He.visit(i,e)},_U=(t,e)=>{var r;return(r=t.dictionary)===null||r===void 0?void 0:r.get(t.values[e])},wU=(t,e)=>t.type.unit===Te.MONTH_DAY_NANO?XS(t,e):t.type.unit===Te.DAY_TIME?KS(t,e):YS(t,e),KS=({values:t},e)=>t.subarray(2*e,2*(e+1)),YS=({values:t},e)=>{let r=t[e],i=new Int32Array(2);return i[0]=Math.trunc(r/12),i[1]=Math.trunc(r%12),i},XS=({values:t},e)=>t.subarray(4*e,4*(e+1)),qS=({values:t},e)=>t[e],QS=({values:t},e)=>t[e],e0=({values:t},e)=>t[e],t0=({values:t},e)=>t[e],$U=(t,e)=>{switch(t.type.unit){case E.SECOND:return qS(t,e);case E.MILLISECOND:return QS(t,e);case E.MICROSECOND:return e0(t,e);case E.NANOSECOND:return t0(t,e)}},xU=(t,e)=>{let{stride:r,children:i}=t,o=i[0].slice(e*r,r);return new P([o])};F.prototype.visitNull=G(oU);F.prototype.visitBool=G(aU);F.prototype.visitInt=G(dU);F.prototype.visitInt8=G(ei);F.prototype.visitInt16=G(ei);F.prototype.visitInt32=G(ei);F.prototype.visitInt64=G(US);F.prototype.visitUint8=G(ei);F.prototype.visitUint16=G(ei);F.prototype.visitUint32=G(ei);F.prototype.visitUint64=G(US);F.prototype.visitFloat=G(fU);F.prototype.visitFloat16=G(sU);F.prototype.visitFloat32=G(ei);F.prototype.visitFloat64=G(ei);F.prototype.visitUtf8=G(ES);F.prototype.visitLargeUtf8=G(ES);F.prototype.visitUtf8View=G(lU);F.prototype.visitBinary=G(PS);F.prototype.visitLargeBinary=G(PS);F.prototype.visitBinaryView=G(uU);F.prototype.visitFixedSizeBinary=G(cU);F.prototype.visitDate=G(pU);F.prototype.visitDateDay=G(TS);F.prototype.visitDateMillisecond=G(NS);F.prototype.visitTimestamp=G(mU);F.prototype.visitTimestampSecond=G(CS);F.prototype.visitTimestampMillisecond=G(FS);F.prototype.visitTimestampMicrosecond=G(jS);F.prototype.visitTimestampNanosecond=G(MS);F.prototype.visitTime=G(hU);F.prototype.visitTimeSecond=G(RS);F.prototype.visitTimeMillisecond=G(VS);F.prototype.visitTimeMicrosecond=G(ZS);F.prototype.visitTimeNanosecond=G(WS);F.prototype.visitDecimal=G(gU);F.prototype.visitList=G(JS);F.prototype.visitLargeList=G(JS);F.prototype.visitStruct=G(vU);F.prototype.visitUnion=G(bU);F.prototype.visitDenseUnion=G(GS);F.prototype.visitSparseUnion=G(HS);F.prototype.visitDictionary=G(_U);F.prototype.visitInterval=G(wU);F.prototype.visitIntervalDayTime=G(KS);F.prototype.visitIntervalYearMonth=G(YS);F.prototype.visitIntervalMonthDayNano=G(XS);F.prototype.visitDuration=G($U);F.prototype.visitDurationSecond=G(qS);F.prototype.visitDurationMillisecond=G(QS);F.prototype.visitDurationMicrosecond=G(e0);F.prototype.visitDurationNanosecond=G(t0);F.prototype.visitFixedSizeList=G(xU);F.prototype.visitMap=G(yU);He=new F});var ti,ea,Qo,ng,tn,ig,og,rd=m(()=>{Ut();Hs();Vi();Yt();ti=Symbol.for("keys"),ea=Symbol.for("vals"),Qo=Symbol.for("kKeysAsStrings"),ng=Symbol.for("_kKeysAsStrings"),tn=class{constructor(e){return this[ti]=new P([e.children[0]]).memoize(),this[ea]=e.children[1],new Proxy(this,new og)}get[Qo](){return this[ng]||(this[ng]=Array.from(this[ti].toArray(),String))}[Symbol.iterator](){return new ig(this[ti],this[ea])}get size(){return this[ti].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ti],r=this[ea],i={};for(let n=-1,o=e.length;++n<o;)i[e.get(n)]=He.visit(r,n);return i}toString(){return`{${[...this].map(([e,r])=>`${Sr(e)}: ${Sr(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},ig=class{constructor(e,r){this.keys=e,this.vals=r,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),He.visit(this.vals,e)]})}},og=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Qo]}has(e,r){return e[Qo].includes(r)}getOwnPropertyDescriptor(e,r){if(e[Qo].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let i=e[Qo].indexOf(r);if(i!==-1){let n=He.visit(Reflect.get(e,ea),i);return Reflect.set(e,r,n),n}}set(e,r,i){let n=e[Qo].indexOf(r);return n!==-1?(at.visit(Reflect.get(e,ea),n,i),Reflect.set(e,r,i)):Reflect.has(e,r)?Reflect.set(e,r,i):!1}};Object.defineProperties(tn.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ti]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ea]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ng]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var ag={};Ie(ag,{clampRange:()=>ec,createElementComparator:()=>ri,wrapIndex:()=>Zi});function ec(t,e,r,i){let{length:n=0}=t,o=typeof e!="number"?0:e,a=typeof r!="number"?n:r;return o<0&&(o=(o%n+n)%n),a<0&&(a=(a%n+n)%n),a<o&&(r0=o,o=a,a=r0),a>n&&(a=n),i?i(t,o,a):[o,a]}function ri(t){if(typeof t!=="object"||t===null)return n0(t)?n0:r=>r===t;if(t instanceof Date){let r=t.valueOf();return i=>i instanceof Date?i.valueOf()===r:!1}return ArrayBuffer.isView(t)?r=>r?ah(t,r):!1:t instanceof Map?SU(t):Array.isArray(t)?IU(t):t instanceof P?kU(t):DU(t,!0)}function IU(t){let e=[];for(let r=-1,i=t.length;++r<i;)e[r]=ri(t[r]);return nd(e)}function SU(t){let e=-1,r=[];for(let i of t.values())r[++e]=ri(i);return nd(r)}function kU(t){let e=[];for(let r=-1,i=t.length;++r<i;)e[r]=ri(t.get(r));return nd(e)}function DU(t,e=!1){let r=Object.keys(t);if(!e&&r.length===0)return()=>!1;let i=[];for(let n=-1,o=r.length;++n<o;)i[n]=ri(t[r[n]]);return nd(i,r)}function nd(t,e){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return AU(t,r);case Map:return i0(t,r,r.keys());case tn:case Qn:case Object:case void 0:return i0(t,r,e||Object.keys(r))}return r instanceof P?zU(t,r):!1}}function AU(t,e){let r=t.length;if(e.length!==r)return!1;for(let i=-1;++i<r;)if(!t[i](e[i]))return!1;return!0}function zU(t,e){let r=t.length;if(e.length!==r)return!1;for(let i=-1;++i<r;)if(!t[i](e.get(i)))return!1;return!0}function i0(t,e,r){let i=r[Symbol.iterator](),n=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),o=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),a=0,s=t.length,c=o.next(),u=i.next(),l=n.next();for(;a<s&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!t[a](c.value));++a,u=i.next(),l=n.next(),c=o.next());return a===s&&u.done&&l.done&&c.done?!0:(i.return&&i.return(),n.return&&n.return(),o.return&&o.return(),!1)}var r0,Zi,n0,ta=m(()=>{Ut();rd();rg();qe();Zi=(t,e)=>t<0?e+t:t,n0=t=>t!==t});var sg={};Ie(sg,{BitIterator:()=>Wi,getBit:()=>o0,getBool:()=>od,packBools:()=>Gi,popcnt_array:()=>a0,popcnt_bit_range:()=>tc,popcnt_uint32:()=>id,setBool:()=>OU,truncateBitmap:()=>Ji});function od(t,e,r,i){return(r&1<<i)!==0}function o0(t,e,r,i){return(r&1<<i)>>i}function OU(t,e,r){return r?!!(t[e>>3]|=1<<e%8)||!0:!(t[e>>3]&=~(1<<e%8))&&!1}function Ji(t,e,r){let i=r.byteLength+7&-8;if(t>0||r.byteLength<i){let n=new Uint8Array(i);return n.set(t%8===0?r.subarray(t>>3):Gi(new Wi(r,t,e,null,od)).subarray(0,i)),n}return r}function Gi(t){let e=[],r=0,i=0,n=0;for(let a of t)a&&(n|=1<<i),++i===8&&(e[r++]=n,n=i=0);(r===0||i>0)&&(e[r++]=n);let o=new Uint8Array(e.length+7&-8);return o.set(e),o}function tc(t,e,r){if(r-e<=0)return 0;if(r-e<8){let o=0;for(let a of new Wi(t,e,r-e,t,o0))o+=a;return o}let i=r>>3<<3,n=e+(e%8===0?0:8-e%8);return tc(t,e,n)+tc(t,i,r)+a0(t,n>>3,i-n>>3)}function a0(t,e,r){let i=0,n=Math.trunc(e),o=new DataView(t.buffer,t.byteOffset,t.byteLength),a=r===void 0?t.byteLength:n+r;for(;a-n>=4;)i+=id(o.getUint32(n)),n+=4;for(;a-n>=2;)i+=id(o.getUint16(n)),n+=2;for(;a-n>=1;)i+=id(o.getUint8(n)),n+=1;return i}function id(t){let e=Math.trunc(t);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var Wi,ra=m(()=>{Wi=class{constructor(e,r,i,n,o){this.bytes=e,this.length=i,this.context=n,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function U(t){return TU.visit(t)}var BU,s0,Q,cg,TU,zr=m(()=>{Ut();Qe();ke();ra();ke();Dr();qe();BU=-1,s0=Symbol.for("apache-arrow/Data"),Q=class t{static isData(e){return e?.[s0]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return z.isSparseUnion(e)?this.children.some(r=>r.nullable):z.isDenseUnion(e)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:r,values:i,nullBitmap:n,typeIds:o}=this;return r&&(e+=r.byteLength),i&&(e+=i.byteLength),n&&(e+=n.byteLength),o&&(e+=o.byteLength),e+=this.variadicBuffers.reduce((a,s)=>{var c;return a+((c=s?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((a,s)=>a+s.byteLength,e)}get nullCount(){if(z.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let e=this._nullCount,r;return e<=BU&&(r=this.nullBitmap)&&(this._nullCount=e=r.length===0?0:this.length-tc(r,this.offset,this.offset+this.length)),e}constructor(e,r,i,n,o,a=[],s,c=[]){var u;this.type=e,this.children=a,this.dictionary=s,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;o instanceof t?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets,this.variadicBuffers=o.variadicBuffers):(this.stride=Kt(e),o&&((l=o[0])&&(this.valueOffsets=l),(l=o[1])&&(this.values=l),(l=o[2])&&(this.nullBitmap=l),(l=o[3])&&(this.typeIds=l)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:r}=this;if(z.isUnion(r)){let i=r,n=this.typeIds[e],o=i.typeIdToChildIndex[n],a=this.children[o],s=this.valueOffsets,c=i.mode===Ae.Dense&&s?Number(s[e]):e;return a.getValid(c)}if(this.nullable&&this.nullCount>0){let i=this.offset+e;return(this.nullBitmap[i>>3]&1<<i%8)!==0}return!0}setValid(e,r){let i,{type:n}=this;if(z.isUnion(n)){let o=n,a=this.typeIds[e],s=o.typeIdToChildIndex[a],c=this.children[s],u=this.valueOffsets,l=o.mode===Ae.Dense&&u?Number(u[e]):e;i=c.getValid(l),c.setValid(l,r)}else{let{nullBitmap:o}=this,{offset:a,length:s}=this,c=a+e,u=1<<c%8,l=c>>3;(!o||o.byteLength<=l)&&(o=new Uint8Array((a+s+63&-64)>>3).fill(255),this.nullCount>0?(o.set(Ji(a,s,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let d=o[l];i=(d&u)!==0,o[l]=r?d|u:d&~u}return i!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(e=this.type,r=this.offset,i=this.length,n=this._nullCount,o=this,a=this.children,s=this.variadicBuffers){return new t(e,r,i,n,o,a,this.dictionary,s)}slice(e,r){let{stride:i,typeId:n,children:o}=this,a=+(this._nullCount===0)-1,s=n===16?i:1,c=this._sliceBuffers(e,r,i,n);return this.clone(this.type,this.offset+e,r,a,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,s*e,s*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===g.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:i}=this,n=new Uint8Array((e+63&-64)>>3).fill(255,0,r>>3);n[r>>3]=(1<<r-(r&-8))-1,i>0&&n.set(Ji(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Jt.VALIDITY]=n,this.clone(this.type,0,e,i+(e-r),o,this.children,this.variadicBuffers)}_sliceBuffers(e,r,i,n){let o,{buffers:a}=this;if((o=a[Jt.TYPE])&&(a[Jt.TYPE]=o.subarray(e,e+r)),z.isBinaryView(this.type)||z.isUtf8View(this.type)){let s=te.ELEMENT_WIDTH;(o=a[Jt.DATA])&&(a[Jt.DATA]=o.subarray(e*s,(e+r)*s))}else(o=a[Jt.OFFSET])&&(a[Jt.OFFSET]=o.subarray(e,e+r+1))||(o=a[Jt.DATA])&&(a[Jt.DATA]=n===6?o:o.subarray(i*e,i*(e+r)));return a}_sliceChildren(e,r,i){return e.map(n=>n.slice(r,i))}};Q.prototype.children=Object.freeze([]);Q.prototype[s0]=!0;Object.defineProperty(Q,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Q&&Q.isData(e)}});cg=class t extends J{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:r,["offset"]:i=0,["length"]:n=0}=e;return new Q(r,i,n,n)}visitBool(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length>>3,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitInt(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitFloat(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitUtf8(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitUtf8View(e){var r;let{["type"]:i,["offset"]:n=0}=e,o=ne(i.ArrayType,e.views),a=C(e.nullBitmap),s=(e.variadicBuffers||[]).map(l=>C(l)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/Bt.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new Q(i,n,c,u,[void 0,o,a],[],void 0,s)}visitLargeUtf8(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bs(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitBinary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitBinaryView(e){var r;let{["type"]:i,["offset"]:n=0}=e,o=ne(i.ArrayType,e.views),a=C(e.nullBitmap),s=(e.variadicBuffers||[]).map(l=>C(l)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/te.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new Q(i,n,c,u,[void 0,o,a],[],void 0,s)}visitLargeBinary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.data),o=C(e.nullBitmap),a=Bs(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,n,o])}visitFixedSizeBinary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitDate(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitTimestamp(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitTime(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitDecimal(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitList(e){let{["type"]:r,["offset"]:i=0,["child"]:n}=e,o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,void 0,o],[n])}visitLargeList(e){let{["type"]:r,["offset"]:i=0,["child"]:n}=e,o=C(e.nullBitmap),a=Bs(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,void 0,o],[n])}visitStruct(e){let{["type"]:r,["offset"]:i=0,["children"]:n=[]}=e,o=C(e.nullBitmap),{length:a=n.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,void 0,o],n)}visitUnion(e){let{["type"]:r,["offset"]:i=0,["children"]:n=[]}=e,o=ne(r.ArrayType,e.typeIds),{["length"]:a=o.length,["nullCount"]:s=-1}=e;if(z.isSparseUnion(r))return new Q(r,i,a,s,[void 0,void 0,void 0,o],n);let c=Bi(e.valueOffsets);return new Q(r,i,a,s,[c,void 0,void 0,o],n)}visitDictionary(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.indices.ArrayType,e.data),{["dictionary"]:a=new P([new t().visit({type:r.dictionary})])}=e,{["length"]:s=o.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[void 0,o,n],[],a)}visitInterval(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitDuration(e){let{["type"]:r,["offset"]:i=0}=e,n=C(e.nullBitmap),o=ne(r.ArrayType,e.data),{["length"]:a=o.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,o,n])}visitFixedSizeList(e){let{["type"]:r,["offset"]:i=0,["child"]:n=new t().visit({type:r.valueType})}=e,o=C(e.nullBitmap),{["length"]:a=n.length/Kt(r),["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Q(r,i,a,s,[void 0,void 0,o],[n])}visitMap(e){let{["type"]:r,["offset"]:i=0,["child"]:n=new t().visit({type:r.childType})}=e,o=C(e.nullBitmap),a=Bi(e.valueOffsets),{["length"]:s=a.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new Q(r,i,s,c,[a,void 0,o],[n])}},TU=new cg});function c0(t){return t.some(e=>e.nullable)}function ad(t){return t.reduce((e,r)=>e+r.nullCount,0)}function sd(t){return t.reduce((e,r,i)=>(e[i+1]=e[i]+r.length,e),new Uint32Array(t.length+1))}function cd(t,e,r,i){let n=[];for(let o=-1,a=t.length;++o<a;){let s=t[o],c=e[o],{length:u}=s;if(c>=i)break;if(r>=c+u)continue;if(c>=r&&c+u<=i){n.push(s);continue}let l=Math.max(0,r-c),d=Math.min(i-c,u);n.push(s.slice(l,d-l))}return n.length===0&&n.push(t[0].slice(0,0)),n}function ug(t,e,r,i){let n=0,o=0,a=e.length-1;do{if(n>=a-1)return r<e[a]?i(t,n,r-e[n]):null;o=n+Math.trunc((a-n)*.5),r<e[o]?a=o:n=o}while(n<a)}function nc(t,e){return t.getValid(e)}function na(t){function e(r,i,n){return t(r[i],n)}return function(r){let i=this.data;return ug(i,this._offsets,r,e)}}function ud(t){let e;function r(i,n,o){return t(i[n],o,e)}return function(i,n){let o=this.data;e=n;let a=ug(o,this._offsets,i,r);return e=void 0,a}}function ld(t){let e;function r(i,n,o){let a=o,s=0,c=0;for(let u=n-1,l=i.length;++u<l;){let d=i[u];if(~(s=t(d,e,a)))return c+s;a=0,c+=d.length}return-1}return function(i,n){e=i;let o=this.data,a=typeof n!="number"?r(o,0,0):ug(o,this._offsets,n,r);return e=void 0,a}}var rc,dd=m(()=>{rc=class{constructor(e=0,r){this.numChunks=e,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function NU(t,e){return e===null&&t.length>0?0:-1}function UU(t,e){let{nullBitmap:r}=t;if(!r||t.nullCount<=0)return-1;let i=0;for(let n of new Wi(r,t.offset+(e||0),t.length,r,od)){if(!n)return i;++i}return-1}function X(t,e,r){if(e===void 0)return-1;if(e===null)switch(t.typeId){case g.Union:break;case g.Dictionary:break;default:return UU(t,r)}let i=He.getVisitFn(t),n=ri(e);for(let o=(r||0)-1,a=t.length;++o<a;)if(n(i(t,o)))return o;return-1}function u0(t,e,r){let i=He.getVisitFn(t),n=ri(e);for(let o=(r||0)-1,a=t.length;++o<a;)if(n(i(t,o)))return o;return-1}var j,Hi,fd=m(()=>{Qe();Dr();Vi();ra();ta();j=class extends J{};j.prototype.visitNull=NU;j.prototype.visitBool=X;j.prototype.visitInt=X;j.prototype.visitInt8=X;j.prototype.visitInt16=X;j.prototype.visitInt32=X;j.prototype.visitInt64=X;j.prototype.visitUint8=X;j.prototype.visitUint16=X;j.prototype.visitUint32=X;j.prototype.visitUint64=X;j.prototype.visitFloat=X;j.prototype.visitFloat16=X;j.prototype.visitFloat32=X;j.prototype.visitFloat64=X;j.prototype.visitUtf8=X;j.prototype.visitLargeUtf8=X;j.prototype.visitUtf8View=X;j.prototype.visitBinary=X;j.prototype.visitLargeBinary=X;j.prototype.visitBinaryView=X;j.prototype.visitFixedSizeBinary=X;j.prototype.visitDate=X;j.prototype.visitDateDay=X;j.prototype.visitDateMillisecond=X;j.prototype.visitTimestamp=X;j.prototype.visitTimestampSecond=X;j.prototype.visitTimestampMillisecond=X;j.prototype.visitTimestampMicrosecond=X;j.prototype.visitTimestampNanosecond=X;j.prototype.visitTime=X;j.prototype.visitTimeSecond=X;j.prototype.visitTimeMillisecond=X;j.prototype.visitTimeMicrosecond=X;j.prototype.visitTimeNanosecond=X;j.prototype.visitDecimal=X;j.prototype.visitList=X;j.prototype.visitLargeList=X;j.prototype.visitStruct=X;j.prototype.visitUnion=X;j.prototype.visitDenseUnion=u0;j.prototype.visitSparseUnion=u0;j.prototype.visitDictionary=X;j.prototype.visitInterval=X;j.prototype.visitIntervalDayTime=X;j.prototype.visitIntervalYearMonth=X;j.prototype.visitIntervalMonthDayNano=X;j.prototype.visitDuration=X;j.prototype.visitDurationSecond=X;j.prototype.visitDurationMillisecond=X;j.prototype.visitDurationMicrosecond=X;j.prototype.visitDurationNanosecond=X;j.prototype.visitFixedSizeList=X;j.prototype.visitMap=X;Hi=new j});function H(t){let{type:e}=t;if(t.nullCount===0&&t.stride===1&&(z.isInt(e)&&e.bitWidth!==64||z.isTime(e)&&e.bitWidth!==64||z.isFloat(e)&&e.precision!==Se.HALF))return new rc(t.data.length,i=>{let n=t.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let r=0;return new rc(t.data.length,i=>{let o=t.data[i].length,a=t.slice(r,r+o);return r+=o,new lg(a)})}var M,lg,ia,pd=m(()=>{Dr();Qe();ke();dd();M=class extends J{};lg=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};M.prototype.visitNull=H;M.prototype.visitBool=H;M.prototype.visitInt=H;M.prototype.visitInt8=H;M.prototype.visitInt16=H;M.prototype.visitInt32=H;M.prototype.visitInt64=H;M.prototype.visitUint8=H;M.prototype.visitUint16=H;M.prototype.visitUint32=H;M.prototype.visitUint64=H;M.prototype.visitFloat=H;M.prototype.visitFloat16=H;M.prototype.visitFloat32=H;M.prototype.visitFloat64=H;M.prototype.visitUtf8=H;M.prototype.visitLargeUtf8=H;M.prototype.visitUtf8View=H;M.prototype.visitBinary=H;M.prototype.visitLargeBinary=H;M.prototype.visitBinaryView=H;M.prototype.visitFixedSizeBinary=H;M.prototype.visitDate=H;M.prototype.visitDateDay=H;M.prototype.visitDateMillisecond=H;M.prototype.visitTimestamp=H;M.prototype.visitTimestampSecond=H;M.prototype.visitTimestampMillisecond=H;M.prototype.visitTimestampMicrosecond=H;M.prototype.visitTimestampNanosecond=H;M.prototype.visitTime=H;M.prototype.visitTimeSecond=H;M.prototype.visitTimeMillisecond=H;M.prototype.visitTimeMicrosecond=H;M.prototype.visitTimeNanosecond=H;M.prototype.visitDecimal=H;M.prototype.visitList=H;M.prototype.visitLargeList=H;M.prototype.visitStruct=H;M.prototype.visitUnion=H;M.prototype.visitDenseUnion=H;M.prototype.visitSparseUnion=H;M.prototype.visitDictionary=H;M.prototype.visitInterval=H;M.prototype.visitIntervalDayTime=H;M.prototype.visitIntervalYearMonth=H;M.prototype.visitIntervalMonthDayNano=H;M.prototype.visitDuration=H;M.prototype.visitDurationSecond=H;M.prototype.visitDurationMillisecond=H;M.prototype.visitDurationMicrosecond=H;M.prototype.visitDurationNanosecond=H;M.prototype.visitFixedSizeList=H;M.prototype.visitMap=H;ia=new M});function Ki(t){if(t){if(t instanceof Q)return new P([t]);if(t instanceof P)return new P(t.data);if(t.type instanceof z)return new P([U(t)]);if(Array.isArray(t))return new P(t.flatMap(e=>PU(e)));if(ArrayBuffer.isView(t)){t instanceof DataView&&(t=new Uint8Array(t.buffer));let e={offset:0,length:t.length,nullCount:-1,data:t};if(t instanceof Int8Array)return new P([U(Object.assign(Object.assign({},e),{type:new Ui}))]);if(t instanceof Int16Array)return new P([U(Object.assign(Object.assign({},e),{type:new Pi}))]);if(t instanceof Int32Array)return new P([U(Object.assign(Object.assign({},e),{type:new Gt}))]);if(t instanceof BigInt64Array)return new P([U(Object.assign(Object.assign({},e),{type:new Li}))]);if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new P([U(Object.assign(Object.assign({},e),{type:new Ei}))]);if(t instanceof Uint16Array)return new P([U(Object.assign(Object.assign({},e),{type:new Ci}))]);if(t instanceof Uint32Array)return new P([U(Object.assign(Object.assign({},e),{type:new Fi}))]);if(t instanceof BigUint64Array)return new P([U(Object.assign(Object.assign({},e),{type:new ji}))]);if(t instanceof Float32Array)return new P([U(Object.assign(Object.assign({},e),{type:new Mi}))]);if(t instanceof Float64Array)return new P([U(Object.assign(Object.assign({},e),{type:new Ri}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function PU(t){return t instanceof Q?[t]:t instanceof P?t.data:Ki(t).data}var l0,d0,f0,p0,P,md,Ut=m(()=>{Qe();ta();ke();zr();dd();Vi();Yt();fd();pd();ke();d0=Symbol.for("apache-arrow/Vector"),f0={},p0={},P=class t{static isVector(e){return e?.[d0]===!0}constructor(e){var r,i,n;let o=e[0]instanceof t?e.flatMap(s=>s.data):e;if(o.length===0||o.some(s=>!(s instanceof Q)))throw new TypeError("Vector constructor expects an Array of Data instances.");let a=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:s,set:c,indexOf:u}=f0[a.typeId],l=o[0];this.isValid=d=>nc(l,d),this.get=d=>s(l,d),this.set=(d,f)=>c(l,d,f),this.indexOf=d=>u(l,d),this._offsets=[0,l.length];break}default:Object.setPrototypeOf(this,p0[a.typeId]),this._offsets=sd(o);break}this.data=o,this.type=a,this.stride=Kt(a),this.numChildren=(n=(i=a.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,r)=>e+r.byteLength,0)}get nullable(){return c0(this.data)}get nullCount(){return ad(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${g[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(Zi(e,this.length))}set(e,r){}indexOf(e,r){return-1}includes(e,r){return this.indexOf(e,r)>-1}[Symbol.iterator](){return ia.visit(this)}concat(...e){return new t(this.data.concat(e.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(e,r){return new t(ec(this,e,r,({data:i,_offsets:n},o,a)=>cd(i,n,o,a)))}toJSON(){return[...this]}toArray(){let{type:e,data:r,length:i,stride:n,ArrayType:o}=this;switch(e.typeId){case g.Int:case g.Float:case g.Decimal:case g.Time:case g.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,i*n);default:return r.reduce((a,{values:s,length:c})=>(a.array.set(s.subarray(0,c*n),a.offset),a.offset+=c*n,a),{array:new o(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(i=>i.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new t(this.data.map(({children:r})=>r[e])):null}get isMemoized(){return z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let e=new md(this.data[0].dictionary),r=this.data.map(i=>{let n=i.clone();return n.dictionary=e,n});return new t(r)}return new md(this)}unmemoize(){if(z.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),r=this.data.map(i=>{let n=i.clone();return n.dictionary=e,n});return new t(r)}return this}};l0=Symbol.toStringTag;P[l0]=(t=>{t.type=z.prototype,t.data=[],t.length=0,t.stride=1,t.numChildren=0,t._offsets=new Uint32Array([0]),t[Symbol.isConcatSpreadable]=!0,t[d0]=!0;let e=Object.keys(g).map(r=>g[r]).filter(r=>typeof r=="number"&&r!==g.NONE);for(let r of e){let i=He.getVisitFnByTypeId(r),n=at.getVisitFnByTypeId(r),o=Hi.getVisitFnByTypeId(r);f0[r]={get:i,set:n,indexOf:o},p0[r]=Object.create(t,{isValid:{value:na(nc)},get:{value:na(He.getVisitFnByTypeId(r))},set:{value:ud(at.getVisitFnByTypeId(r))},indexOf:{value:ld(Hi.getVisitFnByTypeId(r))}})}return"Vector"})(P.prototype);Object.defineProperty(P,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===P&&P.isVector(e)}});md=class t extends P{constructor(e){super(e.data);let r=this.get,i=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(a){let s=o[a];if(s!==void 0)return s;let c=r.call(this,a);return o[a]=c,c}}),Object.defineProperty(this,"set",{value(a,s){i.call(this,a,s),o[a]=s}}),Object.defineProperty(this,"slice",{value:(a,s)=>new t(n.call(this,a,s))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new P(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function m0(t){if(!t||t.length<=0)return function(n){return!0};let e="",r=t.filter(i=>i===i);return r.length>0&&(e=`
|
|
8
8
|
switch (x) {${r.map(i=>`
|
|
9
9
|
case ${LU(i)}:`).join("")}
|
|
10
10
|
return false;
|
|
@@ -13,7 +13,7 @@ ${e}`),new Function("x",`${e}
|
|
|
13
13
|
return true;`)}function LU(t){return typeof t!="bigint"?Sr(t):`${Sr(t)}n`}var h0=m(()=>{Hs()});function dg(t,e){let r=Math.ceil(t)*e-1;return(r-r%64+64||64)/e}function g0(t,e=0){return t.length>=e?t.subarray(0,e):Os(new t.constructor(e),t,0)}var Pt,In,oa,ni,Or=m(()=>{qe();Pt=class{constructor(e,r=0,i=1){this.length=Math.ceil(r/i),this.buffer=new e(this.length),this.stride=i,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,r){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let r=this.stride,i=this.length*r,n=this.buffer.length;i>=n&&this._resize(n===0?dg(i*1,this.BYTES_PER_ELEMENT):dg(i*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=dg(e*this.stride,this.BYTES_PER_ELEMENT);let r=g0(this.buffer,e);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=g0(this.buffer,e)}},In=class extends Pt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,r){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=r,this}},oa=class extends In{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,r){let{buffer:i}=this.reserve(e-this.length+1),n=e>>3,o=e%8,a=i[n]>>o&1;return r?a===0&&(i[n]|=1<<o,++this.numValid):a===1&&(i[n]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},ni=class extends In{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,r){let i=this.length-1,n=this.reserve(e-i+1).buffer;return i<e++&&i>=0&&n.fill(n[i],i,e),n[e]=n[e-1]+r,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}}});var Oe,Ke,pt,Pe=m(()=>{Ut();zr();rd();ke();h0();Or();Oe=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:r}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=r,this.stride=Kt(e),this._nulls=new oa,r&&r.length>0&&(this._isValid=m0(r))}toVector(){return new P([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:r,_values:i,_nulls:n,_typeIds:o,children:a}=this;return r&&(e+=r.byteLength),i&&(e+=i.byteLength),n&&(e+=n.byteLength),o&&(e+=o.byteLength),a.reduce((s,c)=>s+c.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((r,i)=>r+i.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,r){return this.setValid(e,this.isValid(r))&&this.setValue(e,r),this}setValue(e,r){this._setValue(this,e,r)}setValid(e,r){return this.length=this._nulls.set(e,+r).length,r}addChild(e,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e,r,i,n,{type:o,length:a,nullCount:s,_typeIds:c,_offsets:u,_values:l,_nulls:d}=this;(r=c?.flush(a))?n=u?.flush(a):(n=u?.flush(a))?e=l?.flush(u.last()):e=l?.flush(a),s>0&&(i=d?.flush(a));let f=this.children.map(p=>p.flush());return this.clear(),U({type:o,length:a,nullCount:s,children:f,child:f[0],data:e,typeIds:r,nullBitmap:i,valueOffsets:n})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,r,i,n;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(r=this._values)===null||r===void 0||r.clear(),(i=this._offsets)===null||i===void 0||i.clear(),(n=this._typeIds)===null||n===void 0||n.clear();for(let o of this.children)o.clear();return this}};Oe.prototype.length=1;Oe.prototype.stride=1;Oe.prototype.children=null;Oe.prototype.finished=!1;Oe.prototype.nullValues=null;Oe.prototype._isValid=()=>!0;Ke=class extends Oe{constructor(e){super(e),this._values=new In(this.ArrayType,0,this.stride)}setValue(e,r){let i=this._values;return i.reserve(e-i.length+1),super.setValue(e,r)}},pt=class extends Oe{constructor(e){super(e),this._pendingLength=0,this._offsets=new ni(e.type)}setValue(e,r){let i=this._pending||(this._pending=new Map),n=i.get(e);n&&(this._pendingLength-=n.length),this._pendingLength+=r instanceof tn?r[ti].length:r.length,i.set(e,r)}setValid(e,r){return super.setValid(e,r)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,r),this}}});var Yi,fg=m(()=>{Yi=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,r,i,n){return e.prep(8,24),e.writeInt64(BigInt(n??0)),e.pad(4),e.writeInt32(i),e.writeInt64(BigInt(r??0)),e.offset()}}});var Xt,y0=m(()=>{de();fg();Wo();Tl();Eh();Xt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFooter(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):be.V1}schema(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Ot).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(e,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new Yi).__init(this.bb.__vector(this.bb_pos+i)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,r){let i=this.bb.__offset(this.bb_pos,10);return i?(r||new Yi).__init(this.bb.__vector(this.bb_pos+i)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let i=this.bb.__offset(this.bb_pos,12);return i?(r||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,be.V1)}static addSchema(e,r){e.addFieldOffset(1,r,0)}static addDictionaries(e,r){e.addFieldOffset(2,r,0)}static startDictionariesVector(e,r){e.startVector(24,r,8)}static addRecordBatches(e,r){e.addFieldOffset(3,r,0)}static startRecordBatchesVector(e,r){e.startVector(24,r,8)}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,r){e.finish(r)}static finishSizePrefixedFooterBuffer(e,r){e.finish(r,void 0,!0)}}});function hd(t,e){return new Map([...t||new Map,...e||new Map])}function pg(t,e=new Map){for(let r=-1,i=t.length;++r<i;){let o=t[r].type;if(z.isDictionary(o)){if(!e.has(o.id))e.set(o.id,o.dictionary);else if(e.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&&pg(o.children,e)}return e}var v0,b0,se,Y,$t=m(()=>{Qe();ke();v0=Symbol.for("apache-arrow/Schema"),b0=Symbol.for("apache-arrow/Field"),se=class t{static isSchema(e){return e?.[v0]===!0}constructor(e=[],r,i,n=be.V5){this.fields=e||[],this.metadata=r||new Map,i||(i=pg(this.fields)),this.dictionaries=i,this.metadataVersion=n}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,r)=>`${r}: ${e}`).join(", ")} }>`}select(e){let r=new Set(e),i=this.fields.filter(n=>r.has(n.name));return new t(i,this.metadata)}selectAt(e){let r=e.map(i=>this.fields[i]).filter(Boolean);return new t(r,this.metadata)}assign(...e){let r=e[0]instanceof t?e[0]:Array.isArray(e[0])?new t(e[0]):new t(e),i=[...this.fields],n=hd(hd(new Map,this.metadata),r.metadata),o=r.fields.filter(s=>{let c=i.findIndex(u=>u.name===s.name);return~c?(i[c]=s.clone({metadata:hd(hd(new Map,i[c].metadata),s.metadata)}))&&!1:!0}),a=pg(o,new Map);return new t([...i,...o],n,new Map([...this.dictionaries,...a]))}};se.prototype.fields=null;se.prototype.metadata=null;se.prototype.dictionaries=null;se.prototype[v0]=!0;Object.defineProperty(se,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===se&&se.isSchema(e)}});Y=class t{static isField(e){return e?.[b0]===!0}static new(...e){let[r,i,n,o]=e;return e[0]&&typeof e[0]=="object"&&({name:r}=e[0],i===void 0&&(i=e[0].type),n===void 0&&(n=e[0].nullable),o===void 0&&(o=e[0].metadata)),new t(`${r}`,i,n,o)}constructor(e,r,i=!1,n){this.name=e,this.type=r,this.nullable=i,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[r,i,n,o]=e;return!e[0]||typeof e[0]!="object"?[r=this.name,i=this.type,n=this.nullable,o=this.metadata]=e:{name:r=this.name,type:i=this.type,nullable:n=this.nullable,metadata:o=this.metadata}=e[0],t.new(r,i,n,o)}};Y.prototype.type=null;Y.prototype.name=null;Y.prototype.nullable=null;Y.prototype.metadata=null;Y.prototype[b0]=!0;Object.defineProperty(Y,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Y&&Y.isField(e)}})});var EU,CU,Sn,mg,kn,hg=m(()=>{fg();y0();de();$t();Qe();qe();Rr();EU=Ti,CU=ot,Sn=class{static decode(e){e=new CU(C(e));let r=Xt.getRootAsFooter(e),i=se.decode(r.schema(),new Map,r.version());return new mg(i,r)}static encode(e){let r=new EU,i=se.encode(r,e.schema);Xt.startRecordBatchesVector(r,e.numRecordBatches);for(let a of[...e.recordBatches()].slice().reverse())kn.encode(r,a);let n=r.endVector();Xt.startDictionariesVector(r,e.numDictionaries);for(let a of[...e.dictionaryBatches()].slice().reverse())kn.encode(r,a);let o=r.endVector();return Xt.startFooter(r),Xt.addSchema(r,i),Xt.addVersion(r,be.V5),Xt.addRecordBatches(r,n),Xt.addDictionaries(r,o),Xt.finishFooterBuffer(r,Xt.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,r=be.V5,i,n){this.schema=e,this.version=r,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let e,r=-1,i=this.numRecordBatches;++r<i;)(e=this.getRecordBatch(r))&&(yield e)}*dictionaryBatches(){for(let e,r=-1,i=this.numDictionaries;++r<i;)(e=this.getDictionaryBatch(r))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}},mg=class extends Sn{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,r){super(e,r.version()),this._footer=r}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let r=this._footer.recordBatches(e);if(r)return kn.decode(r)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let r=this._footer.dictionaries(e);if(r)return kn.decode(r)}return null}},kn=class t{static decode(e){return new t(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,r){let{metaDataLength:i}=r,n=BigInt(r.offset),o=BigInt(r.bodyLength);return Yi.createBlock(e,n,i,o)}constructor(e,r,i){this.metaDataLength=e,this.offset=ie(i),this.bodyLength=ie(r)}}});var qt,_0=m(()=>{de();Wo();Ch();Tl();qt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMessage(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):be.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ue.NONE}header(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(e,this.bb_pos+r):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,r){let i=this.bb.__offset(this.bb_pos,12);return i?(r||new Ce).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,be.V1)}static addHeaderType(e,r){e.addFieldInt8(1,r,ue.NONE)}static addHeader(e,r){e.addFieldOffset(2,r,0)}static addBodyLength(e,r){e.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)e.addOffset(r[i]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,r){e.finish(r)}static finishSizePrefixedMessageBuffer(e,r){e.finish(r,void 0,!0)}static createMessage(e,r,i,n,o,a){return t.startMessage(e),t.addVersion(e,r),t.addHeaderType(e,i),t.addHeader(e,n),t.addBodyLength(e,o),t.addCustomMetadata(e,a),t.endMessage(e)}}});var gg,gd,w0=m(()=>{Dr();VI();El();zh();LI();EI();FI();CI();WI();JI();MI();Sh();Ih();Th();Nh();Oh();kh();RI();jI();ZI();Uh();xh();Dh();Ah();Bh();gg=class extends J{visit(e,r){return e==null||r==null?void 0:super.visit(e,r)}visitNull(e,r){return Zs.startNull(r),Zs.endNull(r)}visitInt(e,r){return xr.startInt(r),xr.addBitWidth(r,e.bitWidth),xr.addIsSigned(r,e.isSigned),xr.endInt(r)}visitFloat(e,r){return Yn.startFloatingPoint(r),Yn.addPrecision(r,e.precision),Yn.endFloatingPoint(r)}visitBinary(e,r){return Es.startBinary(r),Es.endBinary(r)}visitBinaryView(e,r){return Cs.startBinaryView(r),Cs.endBinaryView(r)}visitLargeBinary(e,r){return js.startLargeBinary(r),js.endLargeBinary(r)}visitBool(e,r){return Fs.startBool(r),Fs.endBool(r)}visitUtf8(e,r){return Js.startUtf8(r),Js.endUtf8(r)}visitUtf8View(e,r){return Gs.startUtf8View(r),Gs.endUtf8View(r)}visitLargeUtf8(e,r){return Rs.startLargeUtf8(r),Rs.endLargeUtf8(r)}visitDecimal(e,r){return Mr.startDecimal(r),Mr.addScale(r,e.scale),Mr.addPrecision(r,e.precision),Mr.addBitWidth(r,e.bitWidth),Mr.endDecimal(r)}visitDate(e,r){return Jn.startDate(r),Jn.addUnit(r,e.unit),Jn.endDate(r)}visitTime(e,r){return wn.startTime(r),wn.addUnit(r,e.unit),wn.addBitWidth(r,e.bitWidth),wn.endTime(r)}visitTimestamp(e,r){let i=e.timezone&&r.createString(e.timezone)||void 0;return $n.startTimestamp(r),$n.addUnit(r,e.unit),i!==void 0&&$n.addTimezone(r,i),$n.endTimestamp(r)}visitInterval(e,r){return Xn.startInterval(r),Xn.addUnit(r,e.unit),Xn.endInterval(r)}visitDuration(e,r){return Gn.startDuration(r),Gn.addUnit(r,e.unit),Gn.endDuration(r)}visitList(e,r){return Vs.startList(r),Vs.endList(r)}visitLargeList(e,r){return Ms.startLargeList(r),Ms.endLargeList(r)}visitStruct(e,r){return Ws.startStruct_(r),Ws.endStruct_(r)}visitUnion(e,r){Ir.startTypeIdsVector(r,e.typeIds.length);let i=Ir.createTypeIdsVector(r,e.typeIds);return Ir.startUnion(r),Ir.addMode(r,e.mode),Ir.addTypeIds(r,i),Ir.endUnion(r)}visitDictionary(e,r){let i=this.visit(e.indices,r);return jr.startDictionaryEncoding(r),jr.addId(r,BigInt(e.id)),jr.addIsOrdered(r,e.isOrdered),i!==void 0&&jr.addIndexType(r,i),jr.endDictionaryEncoding(r)}visitFixedSizeBinary(e,r){return Hn.startFixedSizeBinary(r),Hn.addByteWidth(r,e.byteWidth),Hn.endFixedSizeBinary(r)}visitFixedSizeList(e,r){return Kn.startFixedSizeList(r),Kn.addListSize(r,e.listSize),Kn.endFixedSizeList(r)}visitMap(e,r){return qn.startMap(r),qn.addKeysSorted(r,e.keysSorted),qn.endMap(r)}},gd=new gg});function S0(t,e=new Map){return new se(FU(t,e),yd(t.metadata),e)}function yg(t){return new Ye(t.count,D0(t.columns),A0(t.columns),null,z0(t.columns))}function k0(t){return new mt(yg(t.data),t.id,t.isDelta)}function FU(t,e){return(t.fields||[]).filter(Boolean).map(r=>Y.fromJSON(r,e))}function $0(t,e){return(t.children||[]).filter(Boolean).map(r=>Y.fromJSON(r,e))}function D0(t){return(t||[]).reduce((e,r)=>[...e,new lr(r.count,jU(r.VALIDITY)),...D0(r.children)],[])}function A0(t,e=[]){for(let r=-1,i=(t||[]).length;++r<i;){let n=t[r];if(n.VALIDITY&&e.push(new je(e.length,n.VALIDITY.length)),n.TYPE_ID&&e.push(new je(e.length,n.TYPE_ID.length)),n.OFFSET&&e.push(new je(e.length,n.OFFSET.length)),n.DATA&&e.push(new je(e.length,n.DATA.length)),n.VIEWS&&e.push(new je(e.length,n.VIEWS.length)),n.VARIADIC_DATA_BUFFERS)for(let o of n.VARIADIC_DATA_BUFFERS)e.push(new je(e.length,o.length));e=A0(n.children,e)}return e}function jU(t){return(t||[]).reduce((e,r)=>e+ +(r===0),0)}function z0(t){return(t||[]).reduce((e,r)=>[...e,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...z0(r.children)],[])}function O0(t,e){let r,i,n,o,a,s;return!e||!(o=t.dictionary)?(a=I0(t,$0(t,e)),n=new Y(t.name,a,t.nullable,yd(t.metadata))):e.has(r=o.id)?(i=(i=o.indexType)?x0(i):new Gt,s=new Nt(e.get(r),i,r,o.isOrdered),n=new Y(t.name,s,t.nullable,yd(t.metadata))):(i=(i=o.indexType)?x0(i):new Gt,e.set(r,a=I0(t,$0(t,e))),s=new Nt(a,i,r,o.isOrdered),n=new Y(t.name,s,t.nullable,yd(t.metadata))),n||null}function yd(t=[]){return new Map(t.map(({key:e,value:r})=>[e,r]))}function x0(t){return new Ge(t.isSigned,t.bitWidth)}function I0(t,e){let r=t.type.name;switch(r){case"NONE":return new ft;case"null":return new ft;case"binary":return new Vr;case"largebinary":return new Zr;case"binaryview":return new te;case"utf8":return new Wr;case"largeutf8":return new Jr;case"utf8view":return new Bt;case"bool":return new Gr;case"list":return new ar((e||[])[0]);case"largelist":return new sr((e||[])[0]);case"struct":return new ze(e||[]);case"struct_":return new ze(e||[])}switch(r){case"int":{let i=t.type;return new Ge(i.isSigned,i.bitWidth)}case"floatingpoint":{let i=t.type;return new Ht(Se[i.precision])}case"decimal":{let i=t.type;return new Hr(i.scale,i.precision,i.bitWidth)}case"date":{let i=t.type;return new Kr(Ve[i.unit])}case"time":{let i=t.type;return new Yr(E[i.unit],i.bitWidth)}case"timestamp":{let i=t.type;return new Xr(E[i.unit],i.timezone)}case"interval":{let i=t.type;return new qr(Te[i.unit])}case"duration":{let i=t.type;return new Qr(E[i.unit])}case"union":{let i=t.type,[n,...o]=(i.mode+"").toLowerCase(),a=n.toUpperCase()+o.join("");return new cr(Ae[a],i.typeIds||[],e||[])}case"fixedsizebinary":{let i=t.type;return new en(i.byteWidth)}case"fixedsizelist":{let i=t.type;return new Tt(i.listSize,(e||[])[0])}case"map":{let i=t.type;return new ur((e||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var B0=m(()=>{$t();ke();Xi();Qe()});function VU(t,e){return(()=>{switch(e){case ue.Schema:return se.fromJSON(t);case ue.RecordBatch:return Ye.fromJSON(t);case ue.DictionaryBatch:return mt.fromJSON(t)}throw new Error(`Unrecognized Message type: { name: ${ue[e]}, type: ${e} }`)})}function ZU(t,e){return(()=>{switch(e){case ue.Schema:return se.decode(t.header(new Ot),new Map,t.version());case ue.RecordBatch:return Ye.decode(t.header(new lt),t.version());case ue.DictionaryBatch:return mt.decode(t.header(new _n),t.version())}throw new Error(`Unrecognized Message type: { name: ${ue[e]}, type: ${e} }`)})}function WU(t,e=new Map,r=be.V5){let i=QU(t,e);return new se(i,vd(t),e,r)}function JU(t,e=be.V5){return new Ye(t.length(),YU(t),XU(t,e),P0(t.compression()),qU(t))}function GU(t,e=be.V5){return new mt(Ye.decode(t.data(),e),t.id(),t.isDelta())}function HU(t){return new je(t.offset(),t.length())}function KU(t){return new lr(t.length(),t.nullCount())}function YU(t){let e=[];for(let r,i=-1,n=-1,o=t.nodesLength();++i<o;)(r=t.nodes(i))&&(e[++n]=lr.decode(r));return e}function XU(t,e){let r=[];for(let i,n=-1,o=-1,a=t.buffersLength();++n<a;)(i=t.buffers(n))&&(e<be.V4&&(i.bb_pos+=8*(n+1)),r[++o]=je.decode(i));return r}function qU(t){let e=[],r=Math.trunc(t.variadicBufferCountsLength());for(let i=0;i<r;++i)e.push(ie(t.variadicBufferCounts(i)));return e}function QU(t,e){let r=[];for(let i,n=-1,o=-1,a=t.fieldsLength();++n<a;)(i=t.fields(n))&&(r[++o]=Y.decode(i,e));return r}function T0(t,e){let r=[];for(let i,n=-1,o=-1,a=t.childrenLength();++n<a;)(i=t.children(n))&&(r[++o]=Y.decode(i,e));return r}function e4(t,e){let r,i,n,o,a,s;return!e||!(s=t.dictionary())?(n=U0(t,T0(t,e)),i=new Y(t.name(),n,t.nullable(),vd(t))):e.has(r=ie(s.id()))?(o=(o=s.indexType())?N0(o):new Gt,a=new Nt(e.get(r),o,r,s.isOrdered()),i=new Y(t.name(),a,t.nullable(),vd(t))):(o=(o=s.indexType())?N0(o):new Gt,e.set(r,n=U0(t,T0(t,e))),a=new Nt(n,o,r,s.isOrdered()),i=new Y(t.name(),a,t.nullable(),vd(t))),i||null}function vd(t){let e=new Map;if(t)for(let r,i,n=-1,o=Math.trunc(t.customMetadataLength());++n<o;)(r=t.customMetadata(n))&&(i=r.key())!=null&&e.set(i,r.value());return e}function t4(t){let e=new Map;for(let r,i,n=-1,o=Math.trunc(t.customMetadataLength());++n<o;)(r=t.customMetadata(n))&&(i=r.key())!=null&&e.set(i,r.value());return e}function N0(t){return new Ge(t.isSigned(),t.bitWidth())}function U0(t,e){let r=t.typeType();switch(r){case ye.NONE:return new ft;case ye.Null:return new ft;case ye.Binary:return new Vr;case ye.LargeBinary:return new Zr;case ye.BinaryView:return new te;case ye.Utf8:return new Wr;case ye.LargeUtf8:return new Jr;case ye.Utf8View:return new Bt;case ye.Bool:return new Gr;case ye.List:return new ar((e||[])[0]);case ye.LargeList:return new sr((e||[])[0]);case ye.Struct_:return new ze(e||[])}switch(r){case ye.Int:{let i=t.type(new xr);return new Ge(i.isSigned(),i.bitWidth())}case ye.FloatingPoint:{let i=t.type(new Yn);return new Ht(i.precision())}case ye.Decimal:{let i=t.type(new Mr);return new Hr(i.scale(),i.precision(),i.bitWidth())}case ye.Date:{let i=t.type(new Jn);return new Kr(i.unit())}case ye.Time:{let i=t.type(new wn);return new Yr(i.unit(),i.bitWidth())}case ye.Timestamp:{let i=t.type(new $n);return new Xr(i.unit(),i.timezone())}case ye.Interval:{let i=t.type(new Xn);return new qr(i.unit())}case ye.Duration:{let i=t.type(new Gn);return new Qr(i.unit())}case ye.Union:{let i=t.type(new Ir);return new cr(i.mode(),i.typeIdsArray()||[],e||[])}case ye.FixedSizeBinary:{let i=t.type(new Hn);return new en(i.byteWidth())}case ye.FixedSizeList:{let i=t.type(new Kn);return new Tt(i.listSize(),(e||[])[0])}case ye.Map:{let i=t.type(new qn);return new ur((e||[])[0],i.keysSorted())}}throw new Error(`Unrecognized type: "${ye[r]}" (${r})`)}function P0(t){return t?new qi(t.codec(),t.method()):null}function r4(t,e){let r=e.fields.map(o=>Y.encode(t,o));Ot.startFieldsVector(t,r.length);let i=Ot.createFieldsVector(t,r),n=e.metadata&&e.metadata.size>0?Ot.createCustomMetadataVector(t,[...e.metadata].map(([o,a])=>{let s=t.createString(`${o}`),c=t.createString(`${a}`);return Ce.startKeyValue(t),Ce.addKey(t,s),Ce.addValue(t,c),Ce.endKeyValue(t)})):-1;return Ot.startSchema(t),Ot.addFields(t,i),Ot.addEndianness(t,c4?Wn.Little:Wn.Big),n!==-1&&Ot.addCustomMetadata(t,n),Ot.endSchema(t)}function n4(t,e){let r=-1,i=-1,n=-1,o=e.type,a=e.typeId;z.isDictionary(o)?(a=o.dictionary.typeId,n=gd.visit(o,t),i=gd.visit(o.dictionary,t)):i=gd.visit(o,t);let s=(o.children||[]).map(l=>Y.encode(t,l)),c=dt.createChildrenVector(t,s),u=e.metadata&&e.metadata.size>0?dt.createCustomMetadataVector(t,[...e.metadata].map(([l,d])=>{let f=t.createString(`${l}`),p=t.createString(`${d}`);return Ce.startKeyValue(t),Ce.addKey(t,f),Ce.addValue(t,p),Ce.endKeyValue(t)})):-1;return e.name&&(r=t.createString(e.name)),dt.startField(t),dt.addType(t,i),dt.addTypeType(t,a),dt.addChildren(t,c),dt.addNullable(t,!!e.nullable),r!==-1&&dt.addName(t,r),n!==-1&&dt.addDictionary(t,n),u!==-1&&dt.addCustomMetadata(t,u),dt.endField(t)}function i4(t,e){let r=e.nodes||[],i=e.buffers||[],n=e.variadicBufferCounts||[];lt.startNodesVector(t,r.length);for(let u of r.slice().reverse())lr.encode(t,u);let o=t.endVector();lt.startBuffersVector(t,i.length);for(let u of i.slice().reverse())je.encode(t,u);let a=t.endVector(),s=null;e.compression!==null&&(s=L0(t,e.compression));let c=-1;return n.length>0&&(c=lt.createVariadicBufferCountsVector(t,n.map(BigInt))),lt.startRecordBatch(t),lt.addLength(t,BigInt(e.length)),lt.addNodes(t,o),lt.addBuffers(t,a),e.compression!==null&&s&<.addCompression(t,s),c!==-1&<.addVariadicBufferCounts(t,c),lt.endRecordBatch(t)}function L0(t,e){return bn.startBodyCompression(t),bn.addCodec(t,e.type),bn.addMethod(t,e.method),bn.endBodyCompression(t)}function o4(t,e){let r=Ye.encode(t,e.data);return _n.startDictionaryBatch(t),_n.addId(t,BigInt(e.id)),_n.addIsDelta(t,e.isDelta),_n.addData(t,r),_n.endDictionaryBatch(t)}function a4(t,e){return Zo.createFieldNode(t,BigInt(e.length),BigInt(e.nullCount))}function s4(t,e){return Vo.createBuffer(t,BigInt(e.offset),BigInt(e.length))}var MU,RU,Lt,Ye,mt,je,lr,qi,c4,Xi=m(()=>{de();Eh();El();wh();UI();bh();Lh();_h();Ph();Wo();$h();zh();Sh();Ih();Th();Nh();Oh();kh();Uh();Dh();Ah();Bh();_0();vh();yh();$t();qe();Rr();Qe();w0();B0();ke();MU=Ti,RU=ot,Lt=class t{static fromJSON(e,r){let i=new t(0,be.V5,r);return i._createHeader=VU(e,r),i}static decode(e){e=new RU(C(e));let r=qt.getRootAsMessage(e),i=r.bodyLength(),n=r.version(),o=r.headerType(),a=t4(r),s=new t(i,n,o,void 0,a);return s._createHeader=ZU(r,o),s}static encode(e){let r=new MU,i=-1;e.isSchema()?i=se.encode(r,e.header()):e.isRecordBatch()?i=Ye.encode(r,e.header()):e.isDictionaryBatch()&&(i=mt.encode(r,e.header()));let n=e.metadata&&e.metadata.size>0?qt.createCustomMetadataVector(r,[...e.metadata].map(([o,a])=>{let s=r.createString(`${o}`),c=r.createString(`${a}`);return Ce.startKeyValue(r),Ce.addKey(r,s),Ce.addValue(r,c),Ce.endKeyValue(r)})):-1;return qt.startMessage(r),qt.addVersion(r,be.V5),qt.addHeader(r,i),qt.addHeaderType(r,e.headerType),qt.addBodyLength(r,BigInt(e.bodyLength)),n!==-1&&qt.addCustomMetadata(r,n),qt.finishMessageBuffer(r,qt.endMessage(r)),r.asUint8Array()}static from(e,r=0){if(e instanceof se)return new t(0,be.V5,ue.Schema,e);if(e instanceof Ye)return new t(r,be.V5,ue.RecordBatch,e,e.metadata);if(e instanceof mt)return new t(r,be.V5,ue.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===ue.Schema}isRecordBatch(){return this.headerType===ue.RecordBatch}isDictionaryBatch(){return this.headerType===ue.DictionaryBatch}constructor(e,r,i,n,o){this._version=r,this._headerType=i,this.body=new Uint8Array(0),this._compression=n?.compression,n&&(this._createHeader=()=>n),this._bodyLength=ie(e),this._metadata=o||new Map}},Ye=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(e,r,i,n,o=[],a){this._nodes=r,this._buffers=i,this._length=ie(e),this._compression=n,this._variadicBufferCounts=o,this._metadata=a||new Map}},mt=class{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(e,r,i=!1){this._data=e,this._isDelta=i,this._id=ie(r)}},je=class{constructor(e,r){this.offset=ie(e),this.length=ie(r)}},lr=class{constructor(e,r){this.length=ie(e),this.nullCount=ie(r)}},qi=class{constructor(e,r=Ni.BUFFER){this.type=e,this.method=r}};Y.encode=n4;Y.decode=e4;Y.fromJSON=O0;se.encode=r4;se.decode=WU;se.fromJSON=S0;Ye.encode=i4;Ye.decode=JU;Ye.fromJSON=yg;mt.encode=o4;mt.decode=GU;mt.fromJSON=k0;lr.encode=a4;lr.decode=KU;je.encode=s4;je.decode=HU;qi.encode=L0;qi.decode=P0;c4=(()=>{let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256})()});var Ne,ic,Qi,bd,oc=m(()=>{Vt();Ts();Ne=Object.freeze({done:!0,value:void 0}),ic=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Qi=class{tee(){return this._getDOMStream().tee()}pipe(e,r){return this._getNodeStream().pipe(e,r)}pipeTo(e,r){return this._getDOMStream().pipeTo(e,r)}pipeThrough(e,r){return this._getDOMStream().pipeThrough(e,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},bd=class extends Qi{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return T(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Ne);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return it.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return it.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return T(this,void 0,void 0,function*(){return yield this.abort(e),Ne})}return(e){return T(this,void 0,void 0,function*(){return yield this.close(),Ne})}read(e){return T(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return T(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,i)=>{this.resolvers.push({resolve:r,reject:i})}):Promise.resolve(Ne)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var rn,nn,dr,vg,Dn,eo=m(()=>{Vt();Ts();vn();oc();qe();Oi();rn=class extends bd{write(e){if((e=C(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Mo(this.toUint8Array(!0)):this.toUint8Array(!1).then(Mo)}toUint8Array(e=!1){return e?Wt(this._values)[0]:T(this,void 0,void 0,function*(){var r,i,n,o;let a=[],s=0;try{for(var c=!0,u=vr(this),l;l=yield u.next(),r=l.done,!r;c=!0){o=l.value,c=!1;let d=o;a.push(d),s+=d.byteLength}}catch(d){i={error:d}}finally{try{!c&&!r&&(n=u.return)&&(yield n.call(u))}finally{if(i)throw i.error}}return Wt(a,s)[0]})}},nn=class{constructor(e){e&&(this.source=new vg(it.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},dr=class t{constructor(e){e instanceof t?this.source=e.source:e instanceof rn?this.source=new Dn(it.fromAsyncIterable(e)):zl(e)?this.source=new Dn(it.fromNodeStream(e)):zs(e)?this.source=new Dn(it.fromDOMStream(e)):Dl(e)?this.source=new Dn(it.fromDOMStream(e.body)):_r(e)?this.source=new Dn(it.fromIterable(e)):br(e)?this.source=new Dn(it.fromAsyncIterable(e)):ir(e)&&(this.source=new Dn(it.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},vg=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,r="read"){return this.source.next({cmd:r,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Ne)}return(e){return Object.create(this.source.return&&this.source.return(e)||Ne)}},Dn=class{constructor(e){this.source=e,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(e){return T(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return T(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return T(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return T(this,arguments,void 0,function*(r,i="read"){return yield this.source.next({cmd:i,size:r})})}throw(e){return T(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(e))||Ne;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(e){return T(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(e))||Ne;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var ac,ii,bg=m(()=>{Vt();eo();qe();ac=class extends nn{constructor(e,r){super(),this.position=0,this.buffer=C(e),this.size=r===void 0?this.buffer.byteLength:r}readInt32(e){let{buffer:r,byteOffset:i}=this.readAt(e,4);return new DataView(r,i).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:r,size:i,position:n}=this;return r&&n<i?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(i,n+Math.min(i-n,e)),r.subarray(n,this.position)):null}readAt(e,r){let i=this.buffer,n=Math.min(this.size,e+r);return i?i.subarray(e,n):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},ii=class extends dr{constructor(e,r){super(),this.position=0,this._handle=e,typeof r=="number"?this.size=r:this._pending=T(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return T(this,void 0,void 0,function*(){let{buffer:r,byteOffset:i}=yield this.readAt(e,4);return new DataView(r,i).getInt32(0,!0)})}seek(e){return T(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return T(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:i,position:n}=this;if(r&&n<i){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let o=n,a=0,s=0,c=Math.min(i,o+Math.min(i-o,e)),u=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=s)<c&&(a+=s)<u.byteLength;)({bytesRead:s}=yield r.read(u,a,u.byteLength-a,o));return u}return null})}readAt(e,r){return T(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:i,size:n}=this;if(i&&e+r<n){let o=Math.min(n,e+r),a=new Uint8Array(o-e);return(yield i.read(a,0,r,e)).buffer}return new Uint8Array(r)})}close(){return T(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return T(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return T(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var wg={};Ie(wg,{BaseInt64:()=>sc,Int128:()=>cc,Int64:()=>An,Uint64:()=>Fe});function aa(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}var sa,_g,sc,Fe,An,cc,$g=m(()=>{sa=8,_g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],sc=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),n=r[3]*i[3];this.buffer[0]=n&65535;let o=n>>>16;return n=r[2]*i[3],o+=n,n=r[3]*i[2]>>>0,o+=n,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<n?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=r[1]*i[3]+r[2]*i[2]+r[3]*i[1],this.buffer[1]+=r[0]*i[3]+r[1]*i[2]+r[2]*i[1]+r[3]*i[0]<<16,this}_plus(e){let r=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${aa(this.buffer[1])} ${aa(this.buffer[0])}`}},Fe=class t extends sc{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let i=e.length,n=new t(r);for(let o=0;o<i;){let a=sa<i-o?sa:i-o,s=new t(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0])),c=new t(new Uint32Array([_g[a],0]));n.times(c),n.plus(s),o+=a}return n}static convertArray(e){let r=new Uint32Array(e.length*2);for(let i=-1,n=e.length;++i<n;)t.from(e[i],new Uint32Array(r.buffer,r.byteOffset+2*i*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},An=class t extends sc{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let r=this.buffer[1]<<0,i=e.buffer[1]<<0;return r<i||r===i&&this.buffer[0]<e.buffer[0]}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let i=e.startsWith("-"),n=e.length,o=new t(r);for(let a=i?1:0;a<n;){let s=sa<n-a?sa:n-a,c=new t(new Uint32Array([Number.parseInt(e.slice(a,a+s),10),0])),u=new t(new Uint32Array([_g[s],0]));o.times(u),o.plus(c),a+=s}return i?o.negate():o}static convertArray(e){let r=new Uint32Array(e.length*2);for(let i=-1,n=e.length;++i<n;)t.from(e[i],new Uint32Array(r.buffer,r.byteOffset+2*i*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},cc=class t{constructor(e){this.buffer=e}high(){return new An(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new An(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let r=new Fe(new Uint32Array([this.buffer[3],0])),i=new Fe(new Uint32Array([this.buffer[2],0])),n=new Fe(new Uint32Array([this.buffer[1],0])),o=new Fe(new Uint32Array([this.buffer[0],0])),a=new Fe(new Uint32Array([e.buffer[3],0])),s=new Fe(new Uint32Array([e.buffer[2],0])),c=new Fe(new Uint32Array([e.buffer[1],0])),u=new Fe(new Uint32Array([e.buffer[0],0])),l=Fe.multiply(o,u);this.buffer[0]=l.low();let d=new Fe(new Uint32Array([l.high(),0]));return l=Fe.multiply(n,u),d.plus(l),l=Fe.multiply(o,c),d.plus(l),this.buffer[1]=d.low(),this.buffer[3]=d.lessThan(l)?1:0,this.buffer[2]=d.high(),new Fe(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Fe.multiply(i,u)).plus(Fe.multiply(n,c)).plus(Fe.multiply(o,s)),this.buffer[3]+=Fe.multiply(r,u).plus(Fe.multiply(i,c)).plus(Fe.multiply(n,s)).plus(Fe.multiply(o,a)).low(),this}plus(e){let r=new Uint32Array(4);return r[3]=this.buffer[3]+e.buffer[3]>>>0,r[2]=this.buffer[2]+e.buffer[2]>>>0,r[1]=this.buffer[1]+e.buffer[1]>>>0,r[0]=this.buffer[0]+e.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${aa(this.buffer[3])} ${aa(this.buffer[2])} ${aa(this.buffer[1])} ${aa(this.buffer[0])}`}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}static from(e,r=new Uint32Array(4)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(4)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(4)){let i=e.startsWith("-"),n=e.length,o=new t(r);for(let a=i?1:0;a<n;){let s=sa<n-a?sa:n-a,c=new t(new Uint32Array([Number.parseInt(e.slice(a,a+s),10),0,0,0])),u=new t(new Uint32Array([_g[s],0,0,0]));o.times(u),o.plus(c),a+=s}return i?o.negate():o}static convertArray(e){let r=new Uint32Array(e.length*4);for(let i=-1,n=e.length;++i<n;)t.from(e[i],new Uint32Array(r.buffer,r.byteOffset+16*i,4));return r}}});var Sg={};Ie(Sg,{toIntervalDayTimeInt32Array:()=>xg,toIntervalDayTimeObjects:()=>u4,toIntervalMonthDayNanoInt32Array:()=>Ig,toIntervalMonthDayNanoObjects:()=>l4});function xg(t){var e,r;let i=t.length,n=new Int32Array(i*2);for(let o=0,a=0;o<i;o++){let s=t[o];n[a++]=(e=s.days)!==null&&e!==void 0?e:0,n[a++]=(r=s.milliseconds)!==null&&r!==void 0?r:0}return n}function Ig(t){var e,r;let i=t.length,n=new Int32Array(i*4);for(let o=0,a=0;o<i;o++){let s=t[o];n[a++]=(e=s.months)!==null&&e!==void 0?e:0,n[a++]=(r=s.days)!==null&&r!==void 0?r:0;let c=s.nanoseconds;if(c){let u=BigInt(c);n[a++]=Number(u&BigInt(4294967295))>>>0,n[a++]=Number(u>>BigInt(32))>>>0}else a+=2}return n}function u4(t){let e=t.length,r=new Array(e/2);for(let i=0,n=0;i<e;i+=2)r[n++]={days:t[i],milliseconds:t[i+1]};return r}function l4(t,e){let r=t.length,i=new Array(r/4);for(let n=0,o=0;n<r;n+=4){let a=BigInt(t[n+3])<<BigInt(32)|BigInt(t[n+2]>>>0);i[o++]={months:t[n],days:t[n+1],nanoseconds:e?`${a}`:a}}return i}var kg=m(()=>{});function C0(t){let e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r>>1]=Number.parseInt(t.slice(r,r+2),16);return e}function d4(t){return C0(t.join(""))}function F0(t,e){let r=new Uint8Array(t.length*16),i=new DataView(r.buffer);for(let[n,o]of t.entries()){let a=n*16,s=o.SIZE;if(i.setInt32(a,s,!0),o.INLINED!==void 0){let c=e(o.INLINED);for(let u=0;u<c.length&&u<12;u++)r[a+4+u]=c[u]}else{let c=o.PREFIX_HEX;for(let u=0;u<8&&u<c.length;u+=2)r[a+4+(u>>1)]=Number.parseInt(c.slice(u,u+2),16);i.setInt32(a+8,o.BUFFER_INDEX,!0),i.setInt32(a+12,o.OFFSET,!0)}}return r}function f4(t){return F0(t,e=>{let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i>>1]=Number.parseInt(e.slice(i,i+2),16);return r})}function p4(t){return F0(t,e=>new TextEncoder().encode(e))}var ca,_d,wd,j0=m(()=>{zr();$t();ke();Dr();ra();vn();$g();Qe();qe();kg();ca=class extends J{constructor(e,r,i,n,o=be.V5,a=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=e,this.nodes=r,this.buffers=i,this.dictionaries=n,this.metadataVersion=o,this.variadicBufferCounts=a}visit(e){return super.visit(e instanceof Y?e.type:e)}visitNull(e,{length:r}=this.nextFieldNode()){return U({type:e,length:r})}visitBool(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitInt(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitFloat(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitUtf8(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitUtf8View(e,{length:r,nullCount:i}=this.nextFieldNode()){let n=this.readNullBitmap(e,i),o=this.readData(e),a=this.readVariadicBuffers(this.nextVariadicBufferCount());return U({type:e,length:r,nullCount:i,nullBitmap:n,views:o,variadicBuffers:a})}visitBinary(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinaryView(e,{length:r,nullCount:i}=this.nextFieldNode()){let n=this.readNullBitmap(e,i),o=this.readData(e),a=this.readVariadicBuffers(this.nextVariadicBufferCount());return U({type:e,length:r,nullCount:i,nullBitmap:n,views:o,variadicBuffers:a})}visitFixedSizeBinary(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitDate(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitTimestamp(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitTime(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitDecimal(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitList(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitLargeList(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),children:this.visitMany(e.children)})}visitUnion(e,{length:r,nullCount:i}=this.nextFieldNode()){return this.metadataVersion<be.V5&&this.readNullBitmap(e,i),e.mode===Ae.Sparse?this.visitSparseUnion(e,{length:r,nullCount:i}):this.visitDenseUnion(e,{length:r,nullCount:i})}visitDenseUnion(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitDuration(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitFixedSizeList(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),child:this.visit(e.children[0])})}visitMap(e,{length:r,nullCount:i}=this.nextFieldNode()){return U({type:e,length:r,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,r,i=this.nextBufferRange()){return r>0&&this.readData(e,i)||new Uint8Array(0)}readOffsets(e,r){return this.readData(e,r)}readTypeIds(e,r){return this.readData(e,r)}readData(e,{length:r,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+r)}readVariadicBuffers(e){return Array.from({length:e},()=>this.readData(null))}nextVariadicBufferCount(){var e;return(e=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&e!==void 0?e:0}readDictionary(e){return this.dictionaries.get(e.id)}},_d=class extends ca{constructor(e,r,i,n,o,a=[]){super(new Uint8Array(0),r,i,n,o,a),this.sources=e}readNullBitmap(e,r,{offset:i}=this.nextBufferRange()){return r<=0?new Uint8Array(0):Gi(this.sources[i])}readOffsets(e,{offset:r}=this.nextBufferRange()){return ne(Uint8Array,ne(e.OffsetArrayType,this.sources[r]))}readTypeIds(e,{offset:r}=this.nextBufferRange()){return ne(Uint8Array,ne(e.ArrayType,this.sources[r]))}readData(e,{offset:r}=this.nextBufferRange()){let{sources:i}=this;if(z.isTimestamp(e))return ne(Uint8Array,An.convertArray(i[r]));if((z.isInt(e)||z.isTime(e))&&e.bitWidth===64||z.isDuration(e))return ne(Uint8Array,An.convertArray(i[r]));if(z.isDate(e)&&e.unit===Ve.MILLISECOND)return ne(Uint8Array,An.convertArray(i[r]));if(z.isDecimal(e))return ne(Uint8Array,cc.convertArray(i[r]));if(z.isBinary(e)||z.isLargeBinary(e)||z.isFixedSizeBinary(e))return d4(i[r]);if(z.isBinaryView(e))return f4(i[r]);if(z.isUtf8View(e))return p4(i[r]);if(z.isBool(e))return Gi(i[r]);if(z.isUtf8(e)||z.isLargeUtf8(e))return Zt(i[r].join(""));if(z.isInterval(e))switch(e.unit){case Te.DAY_TIME:return xg(i[r]);case Te.MONTH_DAY_NANO:return Ig(i[r]);default:break}return ne(Uint8Array,ne(e.ArrayType,i[r].map(n=>+n)))}readVariadicBuffers(e){let r=[];for(let i=0;i<e;i++){let{offset:n}=this.nextBufferRange(),o=this.sources[n];r.push(C0(o))}return r}};wd=class extends ca{constructor(e,r,i,n,o,a=[]){super(new Uint8Array(0),r,i,n,o,a),this.bodyChunks=e}readData(e,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var ua,Dg=m(()=>{Or();Pe();qe();ua=class extends pt{constructor(e){super(e),this._values=new Pt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,C(r))}_flushPending(e,r){let i=this._offsets,n=this._values.reserve(r).buffer,o=0;for(let[a,s]of e)if(s===void 0)i.set(a,0);else{let c=s.length;n.set(s,o),i.set(a,c),o+=c}}}});var la,Ag=m(()=>{qe();Or();Pe();la=class extends pt{constructor(e){super(e),this._values=new Pt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,C(r))}_flushPending(e,r){let i=this._offsets,n=this._values.reserve(r).buffer,o=0;for(let[a,s]of e)if(s===void 0)i.set(a,BigInt(0));else{let c=s.length;n.set(s,o),i.set(a,BigInt(c)),o+=c}}}});var $d,M0=m(()=>{Or();Pe();$d=class extends Oe{constructor(e){super(e),this._values=new oa}setValue(e,r){this._values.set(e,+r)}}});var to,uc,lc,R0=m(()=>{Pe();Yt();to=class extends Ke{};to.prototype._setValue=Hh;uc=class extends to{};uc.prototype._setValue=Fl;lc=class extends to{};lc.prototype._setValue=jl});var dc,V0=m(()=>{Pe();Yt();dc=class extends Ke{};dc.prototype._setValue=Xh});var xd,Z0=m(()=>{ke();Pe();zg();xd=class extends Oe{constructor({type:e,nullValues:r,dictionaryHashFunction:i}){super({type:new Nt(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=ro({type:this.type.indices,nullValues:r}),this.dictionary=ro({type:this.type.dictionary,nullValues:null}),typeof i=="function"&&(this.valueToKey=i)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,r){let i=this.indices;return r=i.setValid(e,r),this.length=i.length,r}setValue(e,r){let i=this._keysToIndices,n=this.valueToKey(r),o=i[n];return o===void 0&&(i[n]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(e,o)}flush(){let e=this.type,r=this._dictionary,i=this.dictionary.toVector(),n=this.indices.flush().clone(e);return n.dictionary=r?r.concat(i):i,this.finished||(this._dictionaryOffset+=i.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}}});var fc,W0=m(()=>{Pe();Yt();fc=class extends Ke{};fc.prototype._setValue=Gh});var Id,J0=m(()=>{$t();Pe();ke();Id=class extends Oe{setValue(e,r){let[i]=this.children,n=e*this.stride;for(let o=-1,a=this.stride;++o<a;)i.set(n+o,r[o])}setValid(e,r){return super.setValid(e,r)||this.children[0].setValid((e+1)*this.stride-1,!1),r}addChild(e,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let i=this.children.push(e);return this.type=new Tt(this.type.listSize,new Y(r,e.type,!0)),i}}});var no,Sd,kd,Dd,G0=m(()=>{Qs();Pe();no=class extends Ke{setValue(e,r){this._values.set(e,r)}},Sd=class extends no{setValue(e,r){super.setValue(e,qs(r))}},kd=class extends no{},Dd=class extends no{}});var oi,pc,mc,hc,H0=m(()=>{Pe();Yt();oi=class extends Ke{};oi.prototype._setValue=qh;pc=class extends oi{};pc.prototype._setValue=Kl;mc=class extends oi{};mc.prototype._setValue=Yl;hc=class extends oi{};hc.prototype._setValue=Xl});var zn,gc,yc,vc,bc,K0=m(()=>{Pe();Yt();zn=class extends Ke{};zn.prototype._setValue=Qh;gc=class extends zn{};gc.prototype._setValue=ql;yc=class extends zn{};yc.prototype._setValue=Ql;vc=class extends zn{};vc.prototype._setValue=ed;bc=class extends zn{};bc.prototype._setValue=td});var fr,Ad,zd,Od,Bd,Td,Nd,Ud,Pd,Y0=m(()=>{Pe();fr=class extends Ke{setValue(e,r){this._values.set(e,r)}},Ad=class extends fr{},zd=class extends fr{},Od=class extends fr{},Bd=class extends fr{},Td=class extends fr{},Nd=class extends fr{},Ud=class extends fr{},Pd=class extends fr{}});var Ld,X0=m(()=>{$t();ke();Or();Pe();Ld=class extends pt{constructor(e){super(e),this._offsets=new ni(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ar(new Y(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[i]=this.children;for(let[n,o]of e)if(typeof o>"u")r.set(n,0);else{let a=o,s=a.length,c=r.set(n,s).buffer[n];for(let u=-1;++u<s;)i.set(c+u,a[u])}}}});var Ed,q0=m(()=>{$t();ke();Or();Rr();Pe();Ed=class extends pt{constructor(e){super(e),this._offsets=new ni(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new sr(new Y(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[i]=this.children;for(let[n,o]of e)if(typeof o>"u")r.set(n,BigInt(0));else{let a=o,s=a.length,c=ie(r.set(n,BigInt(s)).buffer[n]);for(let u=-1;++u<s;)i.set(c+u,a[u])}}}});var Cd,Q0=m(()=>{$t();ke();Pe();Cd=class extends pt{set(e,r){return super.set(e,r)}setValue(e,r){let i=r instanceof Map?r:new Map(Object.entries(r)),n=this._pending||(this._pending=new Map),o=n.get(e);o&&(this._pendingLength-=o.size),this._pendingLength+=i.size,n.set(e,i)}addChild(e,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ur(new Y(r,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let r=this._offsets,[i]=this.children;for(let[n,o]of e)if(o===void 0)r.set(n,0);else{let{[n]:a,[n+1]:s}=r.set(n,o.size).buffer;for(let c of o.entries())if(i.set(a,c),++a>=s)break}}}});var Fd,ek=m(()=>{Pe();Fd=class extends Oe{setValue(e,r){}setValid(e,r){return this.length=Math.max(e+1,this.length),r}}});var jd,tk=m(()=>{$t();Pe();ke();jd=class extends Oe{setValue(e,r){let{children:i,type:n}=this;switch(Array.isArray(r)||r.constructor){case!0:return n.children.forEach((o,a)=>i[a].set(e,r[a]));case Map:return n.children.forEach((o,a)=>i[a].set(e,r.get(o.name)));default:return n.children.forEach((o,a)=>i[a].set(e,r[o.name]))}}setValid(e,r){return super.setValid(e,r)||this.children.forEach(i=>i.setValid(e,r)),r}addChild(e,r=`${this.numChildren}`){let i=this.children.push(e);return this.type=new ze([...this.type.children,new Y(r,e.type,!0)]),i}}});var On,_c,wc,$c,xc,rk=m(()=>{Pe();Yt();On=class extends Ke{};On.prototype._setValue=Kh;_c=class extends On{};_c.prototype._setValue=Ml;wc=class extends On{};wc.prototype._setValue=Rl;$c=class extends On{};$c.prototype._setValue=Vl;xc=class extends On{};xc.prototype._setValue=Zl});var Bn,Ic,Sc,kc,Dc,nk=m(()=>{Pe();Yt();Bn=class extends Ke{};Bn.prototype._setValue=Yh;Ic=class extends Bn{};Ic.prototype._setValue=Wl;Sc=class extends Bn{};Sc.prototype._setValue=Jl;kc=class extends Bn{};kc.prototype._setValue=Gl;Dc=class extends Bn{};Dc.prototype._setValue=Hl});var da,Md,Rd,ik=m(()=>{$t();Or();Pe();ke();da=class extends Oe{constructor(e){super(e),this._typeIds=new In(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,r){return this.set(this.length,e,r)}set(e,r,i){return i===void 0&&(i=this._valueToChildTypeId(this,r,e)),this.setValue(e,r,i),this}setValue(e,r,i){this._typeIds.set(e,i);let n=this.type.typeIdToChildIndex[i],o=this.children[n];o?.set(e,r),this.length=Math.max(e+1,this.length)}addChild(e,r=`${this.children.length}`){let i=this.children.push(e),{type:{children:n,mode:o,typeIds:a}}=this,s=[...n,new Y(r,e.type)];return this.type=new cr(o,[...a,i],s),i}_valueToChildTypeId(e,r,i){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.")}},Md=class extends da{},Rd=class extends da{constructor(e){super(e),this._offsets=new In(Int32Array)}setValue(e,r,i){let n=this._typeIds.set(e,i).buffer[e],o=this.getChildAt(this.type.typeIdToChildIndex[n]),a=this._offsets.set(e,o.length).buffer[e];o?.set(a,r),this.length=Math.max(e+1,this.length)}}});var Ac,ok=m(()=>{vn();Dg();Or();Pe();Ac=class extends pt{constructor(e){super(e),this._values=new Pt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,Zt(r))}_flushPending(e,r){}};Ac.prototype._flushPending=ua.prototype._flushPending});var zc,ak=m(()=>{vn();Or();Pe();Ag();zc=class extends pt{constructor(e){super(e),this._values=new Pt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,Zt(r))}_flushPending(e,r){}};zc.prototype._flushPending=la.prototype._flushPending});var fa,Og=m(()=>{ke();Pe();Or();qe();zr();fa=class extends Oe{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Pt(Uint8Array)}get byteLength(){let e=0;this._views&&(e+=this._views.byteLength),this._nulls&&(e+=this._nulls.byteLength);for(let r of this._variadicBuffers)e+=r.byteLength;return this._currentBuffer&&(e+=this._currentBuffer.byteLength),e}setValue(e,r){return this.writeBinaryValue(e,this.encodeValue(r))}writeBinaryValue(e,r){let i=r.length,n=(e+1)*te.ELEMENT_WIDTH,o=this._views.length;n>o&&this._views.reserve(n-o);let a=this._views.buffer,s=e*te.ELEMENT_WIDTH,c=new DataView(a.buffer,a.byteOffset+s,te.ELEMENT_WIDTH);if(c.setInt32(te.LENGTH_OFFSET,i,!0),i<=te.INLINE_CAPACITY){a.set(r,s+te.INLINE_OFFSET);for(let u=i;u<te.INLINE_CAPACITY;u++)a[s+te.INLINE_OFFSET+u]=0}else{let u=new DataView(r.buffer,r.byteOffset,Math.min(4,i));c.setUint32(te.INLINE_OFFSET,u.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+i>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new Pt(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(i).buffer.set(r,this._currentBufferOffset),c.setInt32(te.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(te.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=i}return this}encodeValue(e){return C(e)}setValid(e,r){let i=(e+1)*te.ELEMENT_WIDTH,n=this._views.length;i>n&&this._views.reserve(i-n);let o=super.setValid(e,r);if(!o){let a=this._views.buffer,s=e*te.ELEMENT_WIDTH;for(let c=0;c<te.ELEMENT_WIDTH;c++)a[s+c]=0}return o}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:e,length:r,nullCount:i,_views:n,_nulls:o}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let a=n.flush(r*te.ELEMENT_WIDTH),s=i>0?o.flush(r):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),U({type:e,length:r,nullCount:i,nullBitmap:s,views:a,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Vd,sk=m(()=>{Og();vn();Vd=class extends fa{constructor(e){super(e)}setValue(e,r){return this.writeBinaryValue(e,Zt(r))}}});var Bg,ck,uk=m(()=>{Dr();Dg();Ag();M0();R0();V0();Z0();W0();J0();G0();H0();K0();Y0();X0();q0();Q0();ek();tk();rk();nk();ik();ok();ak();Og();sk();Bg=class extends J{visitNull(){return Fd}visitBool(){return $d}visitInt(){return fr}visitInt8(){return Ad}visitInt16(){return zd}visitInt32(){return Od}visitInt64(){return Bd}visitUint8(){return Td}visitUint16(){return Nd}visitUint32(){return Ud}visitUint64(){return Pd}visitFloat(){return no}visitFloat16(){return Sd}visitFloat32(){return kd}visitFloat64(){return Dd}visitUtf8(){return Ac}visitLargeUtf8(){return zc}visitBinary(){return ua}visitLargeBinary(){return la}visitFixedSizeBinary(){return fc}visitDate(){return to}visitDateDay(){return uc}visitDateMillisecond(){return lc}visitTimestamp(){return On}visitTimestampSecond(){return _c}visitTimestampMillisecond(){return wc}visitTimestampMicrosecond(){return $c}visitTimestampNanosecond(){return xc}visitTime(){return Bn}visitTimeSecond(){return Ic}visitTimeMillisecond(){return Sc}visitTimeMicrosecond(){return kc}visitTimeNanosecond(){return Dc}visitDecimal(){return dc}visitList(){return Ld}visitLargeList(){return Ed}visitStruct(){return jd}visitUnion(){return da}visitDenseUnion(){return Rd}visitSparseUnion(){return Md}visitDictionary(){return xd}visitInterval(){return oi}visitIntervalDayTime(){return pc}visitIntervalYearMonth(){return mc}visitIntervalMonthDayNano(){return hc}visitDuration(){return zn}visitDurationSecond(){return gc}visitDurationMillisecond(){return yc}visitDurationMicrosecond(){return vc}visitDurationNanosecond(){return bc}visitFixedSizeList(){return Id}visitMap(){return Cd}visitBinaryView(){return fa}visitUtf8View(){return Vd}},ck=new Bg});function xt(t,e){return e instanceof t.constructor}function Tn(t,e){return t===e||xt(t,e)}function Nn(t,e){return t===e||xt(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function Zd(t,e){return t===e||xt(t,e)&&t.precision===e.precision}function m4(t,e){return t===e||xt(t,e)&&t.byteWidth===e.byteWidth}function Tg(t,e){return t===e||xt(t,e)&&t.unit===e.unit}function Oc(t,e){return t===e||xt(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function Bc(t,e){return t===e||xt(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function lk(t,e){return t===e||xt(t,e)&&t.children.length===e.children.length&&on.compareManyFields(t.children,e.children)}function h4(t,e){return t===e||xt(t,e)&&t.children.length===e.children.length&&on.compareManyFields(t.children,e.children)}function Ng(t,e){return t===e||xt(t,e)&&t.mode===e.mode&&t.typeIds.every((r,i)=>r===e.typeIds[i])&&on.compareManyFields(t.children,e.children)}function g4(t,e){return t===e||xt(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&on.visit(t.indices,e.indices)&&on.visit(t.dictionary,e.dictionary)}function Wd(t,e){return t===e||xt(t,e)&&t.unit===e.unit}function Tc(t,e){return t===e||xt(t,e)&&t.unit===e.unit}function y4(t,e){return t===e||xt(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&on.compareManyFields(t.children,e.children)}function v4(t,e){return t===e||xt(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&on.compareManyFields(t.children,e.children)}function io(t,e){return on.compareSchemas(t,e)}function dk(t,e){return on.compareFields(t,e)}function fk(t,e){return on.visit(t,e)}var R,on,Jd=m(()=>{Dr();R=class extends J{compareSchemas(e,r){return e===r||r instanceof e.constructor&&this.compareManyFields(e.fields,r.fields)}compareManyFields(e,r){return e===r||Array.isArray(e)&&Array.isArray(r)&&e.length===r.length&&e.every((i,n)=>this.compareFields(i,r[n]))}compareFields(e,r){return e===r||r instanceof e.constructor&&e.name===r.name&&e.nullable===r.nullable&&this.visit(e.type,r.type)}};R.prototype.visitNull=Tn;R.prototype.visitBool=Tn;R.prototype.visitInt=Nn;R.prototype.visitInt8=Nn;R.prototype.visitInt16=Nn;R.prototype.visitInt32=Nn;R.prototype.visitInt64=Nn;R.prototype.visitUint8=Nn;R.prototype.visitUint16=Nn;R.prototype.visitUint32=Nn;R.prototype.visitUint64=Nn;R.prototype.visitFloat=Zd;R.prototype.visitFloat16=Zd;R.prototype.visitFloat32=Zd;R.prototype.visitFloat64=Zd;R.prototype.visitUtf8=Tn;R.prototype.visitLargeUtf8=Tn;R.prototype.visitUtf8View=Tn;R.prototype.visitBinary=Tn;R.prototype.visitLargeBinary=Tn;R.prototype.visitBinaryView=Tn;R.prototype.visitFixedSizeBinary=m4;R.prototype.visitDate=Tg;R.prototype.visitDateDay=Tg;R.prototype.visitDateMillisecond=Tg;R.prototype.visitTimestamp=Oc;R.prototype.visitTimestampSecond=Oc;R.prototype.visitTimestampMillisecond=Oc;R.prototype.visitTimestampMicrosecond=Oc;R.prototype.visitTimestampNanosecond=Oc;R.prototype.visitTime=Bc;R.prototype.visitTimeSecond=Bc;R.prototype.visitTimeMillisecond=Bc;R.prototype.visitTimeMicrosecond=Bc;R.prototype.visitTimeNanosecond=Bc;R.prototype.visitDecimal=Tn;R.prototype.visitList=lk;R.prototype.visitLargeList=lk;R.prototype.visitStruct=h4;R.prototype.visitUnion=Ng;R.prototype.visitDenseUnion=Ng;R.prototype.visitSparseUnion=Ng;R.prototype.visitDictionary=g4;R.prototype.visitInterval=Wd;R.prototype.visitIntervalDayTime=Wd;R.prototype.visitIntervalYearMonth=Wd;R.prototype.visitIntervalMonthDayNano=Wd;R.prototype.visitDuration=Tc;R.prototype.visitDurationSecond=Tc;R.prototype.visitDurationMillisecond=Tc;R.prototype.visitDurationMicrosecond=Tc;R.prototype.visitDurationNanosecond=Tc;R.prototype.visitFixedSizeList=y4;R.prototype.visitMap=v4;on=new R});function ro(t){let e=t.type,r=new(ck.getVisitFn(e)())(t);if(e.children&&e.children.length>0){let i=t.children||[],n={nullValues:t.nullValues},o=Array.isArray(i)?((a,s)=>i[s]||n):(({name:a})=>i[a]||n);for(let[a,s]of e.children.entries()){let{type:c}=s,u=o(s,a);r.children.push(ro(Object.assign(Object.assign({},u),{type:c})))}}return r}var zg=m(()=>{uk()});function Gd(t,e){return b4(t,e.map(r=>r.data.concat()))}function b4(t,e){let r=[...t.fields],i=[],n={numBatches:e.reduce((d,f)=>Math.max(d,f.length),0)},o=0,a=0,s=-1,c=e.length,u,l=[];for(;n.numBatches-- >0;){for(a=Number.POSITIVE_INFINITY,s=-1;++s<c;)l[s]=u=e[s].shift(),a=Math.min(a,u?u.length:a);Number.isFinite(a)&&(l=_4(r,a,l,e,n),a>0&&(i[o++]=U({type:new ze(r),length:a,nullCount:0,children:l.slice()})))}return[t=t.assign(r),i.map(d=>new Be(t,d))]}function _4(t,e,r,i,n){var o;let a=(e+63&-64)>>3;for(let s=-1,c=i.length;++s<c;){let u=r[s],l=u?.length;if(l>=e)l===e?r[s]=u:(r[s]=u.slice(0,e),n.numBatches=Math.max(n.numBatches,i[s].unshift(u.slice(e,l-e))));else{let d=t[s];t[s]=d.clone({nullable:!0}),r[s]=(o=u?._changeLengthAndBackfillNullBitmap(e))!==null&&o!==void 0?o:U({type:d.type,length:e,nullCount:e,nullBitmap:new Uint8Array(a)})}}return r}var pk=m(()=>{zr();ke();oo()});var mk,hk,et,Nc=m(()=>{Qe();zr();Ut();$t();ke();Jd();pk();dd();Vi();Yt();fd();pd();ta();oo();hk=Symbol.for("apache-arrow/Table"),et=class t{static isTable(e){return e?.[hk]===!0}constructor(...e){var r,i;if(e.length===0)return this.batches=[],this.schema=new se([]),this._offsets=[0],this;let n,o;e[0]instanceof se&&(n=e.shift()),e.at(-1)instanceof Uint32Array&&(o=e.pop());let a=c=>{if(c){if(c instanceof Be)return[c];if(c instanceof t)return c.batches;if(c instanceof Q){if(c.type instanceof ze)return[new Be(new se(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>a(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>a(u));if(typeof c=="object"){let u=Object.keys(c),l=u.map(p=>new P([c[p]])),d=n??new se(u.map((p,h)=>new Y(String(p),l[h].type,l[h].nullable))),[,f]=Gd(d,l);return f.length===0?[new Be(c)]:f}}}return[]},s=e.flatMap(c=>a(c));if(n=(i=n??((r=s[0])===null||r===void 0?void 0:r.schema))!==null&&i!==void 0?i:new se([]),!(n instanceof se))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of s){if(!(c instanceof Be))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!io(n,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=s,this._offsets=o??sd(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,r)=>e+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=ad(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Zi(e,this.numRows))}set(e,r){}indexOf(e,r){return-1}[Symbol.iterator](){return this.batches.length>0?ia.visit(new P(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
14
14
|
${this.toArray().join(`,
|
|
15
15
|
`)}
|
|
16
|
-
]`}concat(...e){let r=this.schema,i=this.data.concat(e.flatMap(({data:n})=>n));return new t(r,i.map(n=>new Be(r,n)))}slice(e,r){let i=this.schema;[e,r]=ec({length:this.numRows},e,r);let n=cd(this.data,this._offsets,e,r);return new t(i,n.map(o=>new Be(i,o)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let r=this.data.map(i=>i.children[e]);if(r.length===0){let{type:i}=this.schema.fields[e],n=U({type:i,length:0,nullCount:0});r.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new P(r)}return null}setChild(e,r){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===e),r)}setChildAt(e,r){let i=this.schema,n=[...this.batches];if(e>-1&&e<this.numCols){r||(r=new P([U({type:new ft,length:this.numRows})]));let o=i.fields.slice(),a=o[e].clone({type:r.type}),s=this.schema.fields.map((c,u)=>this.getChildAt(u));[o[e],s[e]]=[a,r],[i,n]=Gd(i,s)}return new t(i,n)}select(e){let r=this.schema.fields.reduce((i,n,o)=>i.set(n.name,o),new Map);return this.selectAt(e.map(i=>r.get(i)).filter(i=>i>-1))}selectAt(e){let r=this.schema.selectAt(e),i=this.batches.map(n=>n.selectAt(e));return new t(r,i)}assign(e){let r=this.schema.fields,[i,n]=e.schema.fields.reduce((s,c,u)=>{let[l,d]=s,f=r.findIndex(p=>p.name===c.name);return~f?d[f]=u:l.push(u),s},[[],[]]),o=this.schema.assign(e.schema),a=[...r.map((s,c)=>[c,n[c]]).map(([s,c])=>c===void 0?this.getChildAt(s):e.getChildAt(c)),...i.map(s=>e.getChildAt(s))].filter(Boolean);return new t(...Gd(o,a))}};mk=Symbol.toStringTag;et[mk]=(t=>(t.schema=null,t.batches=[],t._offsets=new Uint32Array([0]),t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[hk]=!0,t.isValid=na(nc),t.get=na(He.getVisitFn(g.Struct)),t.set=ud(at.getVisitFn(g.Struct)),t.indexOf=ld(Hi.getVisitFn(g.Struct)),"Table"))(et.prototype);Object.defineProperty(et,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===et&&et.isTable(e)}})});function gk(t,e,r=e.reduce((i,n)=>Math.max(i,n.length),0)){var i;let n=[...t.fields],o=[...e],a=(r+63&-64)>>3;for(let[s,c]of t.fields.entries()){let u=e[s];(!u||u.length!==r)&&(n[s]=c.clone({nullable:!0}),o[s]=(i=u?._changeLengthAndBackfillNullBitmap(r))!==null&&i!==void 0?i:U({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(a)}))}return[t.assign(n),U({type:new ze(n),length:r,children:o})]}function bk(t,e,r=new Map){var i,n;if(((i=t?.length)!==null&&i!==void 0?i:0)>0&&t?.length===e?.length)for(let o=-1,a=t.length;++o<a;){let{type:s}=t[o],c=e[o];for(let u of[c,...((n=c?.dictionary)===null||n===void 0?void 0:n.data)||[]])bk(s.children,u?.children,r);if(z.isDictionary(s)){let{id:u}=s;if(!r.has(u))c?.dictionary&&r.set(u,c.dictionary);else if(r.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var yk,vk,Be,ao,oo=m(()=>{zr();Nc();Ut();$t();ke();ta();Vi();Yt();fd();pd();vk=Symbol.for("apache-arrow/RecordBatch"),Be=class t{static isRecordBatch(e){return e?.[vk]===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=U({nullCount:0,type:new ze(this.schema.fields),children:this.schema.fields.map(r=>U({type:r.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof Q))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=gk(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=e,{fields:i,children:n,length:o}=Object.keys(r).reduce((c,u,l)=>(c.children[l]=r[u],c.length=Math.max(c.length,r[u].length),c.fields[l]=Y.new({name:u,type:r[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),a=new se(i),s=U({type:new ze(i),length:o,children:n,nullCount:0});[this.schema,this.data]=gk(a,s.children,o),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=bk(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return He.visit(this.data,e)}at(e){return this.get(Zi(e,this.numRows))}set(e,r){return at.visit(this.data,e,r)}indexOf(e,r){return Hi.visit(this.data,e,r)}[Symbol.iterator](){return ia.visit(new P([this.data]))}toArray(){return[...this]}concat(...e){return new et(this.schema,[this,...e])}slice(e,r){let[i]=new P([this.data]).slice(e,r).data;return new t(this.schema,i,this._metadata)}getChild(e){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new P([this.data.children[e]]):null}setChild(e,r){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===e),r)}setChildAt(e,r){let i=this.schema,n=this.data;if(e>-1&&e<this.numCols){r||(r=new P([U({type:new ft,length:this.numRows})]));let o=i.fields.slice(),a=n.children.slice(),s=o[e].clone({type:r.type});[o[e],a[e]]=[s,r.data[0]],i=new se(o,new Map(this.schema.metadata)),n=U({type:new ze(o),length:n.length,children:a})}return new t(i,n,this._metadata)}select(e){let r=this.schema.select(e),i=new ze(r.fields),n=[];for(let o of e){let a=this.schema.fields.findIndex(s=>s.name===o);~a&&(n[a]=this.data.children[a])}return new t(r,U({type:i,length:this.numRows,children:n}),this._metadata)}selectAt(e){let r=this.schema.selectAt(e),i=e.map(o=>this.data.children[o]).filter(Boolean),n=U({type:new ze(r.fields),length:this.numRows,children:i});return new t(r,n,this._metadata)}};yk=Symbol.toStringTag;Be[yk]=(t=>(t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[vk]=!0,"RecordBatch"))(Be.prototype);Object.defineProperty(Be,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Be&&Be.isRecordBatch(e)}});ao=class extends Be{constructor(e,r){let i=e.fields.map(o=>U({type:o.type})),n=U({type:new ze(e.fields),length:0,nullCount:0,children:i});super(e,n,r||new Map)}}});function Kd(t,e=0){for(let r=-1,i=ma.length;++r<i;)if(ma[r]!==t[e+r])return!1;return!0}var Pg,Lg,_k,wk,pa,Uc,Pc,Hd,Ug,ma,ha,Eg,$k,Cg=m(()=>{Vt();Qe();de();Xi();Oi();bg();qe();eo();oc();Pg=t=>`Expected ${ue[t]} Message in stream, but was null or length 0.`,Lg=t=>`Header pointer of flatbuffer-encoded ${ue[t]} Message is null or length 0.`,_k=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,wk=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,pa=class{constructor(e){this.source=e instanceof nn?e:new nn(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?Ne:e.value===-1&&(e=this.readMetadataLength()).done?Ne:(e=this.readMetadata(e.value)).done?Ne:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Pg(e));return r.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let r=C(this.source.read(e));if(r.byteLength<e)throw new Error(wk(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(e=!1){let r=ue.Schema,i=this.readMessage(r),n=i?.header();if(e&&!n)throw new Error(Lg(r));return n}readMetadataLength(){let e=this.source.read(Hd),r=e&&new ot(e),i=r?.readInt32(0)||0;return{done:i===0,value:i}}readMetadata(e){let r=this.source.read(e);if(!r)return Ne;if(r.byteLength<e)throw new Error(_k(e,r.byteLength));return{done:!1,value:Lt.decode(r)}}},Uc=class{constructor(e,r){this.source=e instanceof dr?e:kl(e)?new ii(e,r):new dr(e)}[Symbol.asyncIterator](){return this}next(){return T(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?Ne:e.value===-1&&(e=yield this.readMetadataLength()).done?Ne:(e=yield this.readMetadata(e.value)).done?Ne:e})}throw(e){return T(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return T(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return T(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Pg(e));return r.value})}readMessageBody(e){return T(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let r=C(yield this.source.read(e));if(r.byteLength<e)throw new Error(wk(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return T(this,arguments,void 0,function*(e=!1){let r=ue.Schema,i=yield this.readMessage(r),n=i?.header();if(e&&!n)throw new Error(Lg(r));return n})}readMetadataLength(){return T(this,void 0,void 0,function*(){let e=yield this.source.read(Hd),r=e&&new ot(e),i=r?.readInt32(0)||0;return{done:i===0,value:i}})}readMetadata(e){return T(this,void 0,void 0,function*(){let r=yield this.source.read(e);if(!r)return Ne;if(r.byteLength<e)throw new Error(_k(e,r.byteLength));return{done:!1,value:Lt.decode(r)}})}},Pc=class extends pa{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof ic?e:new ic(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Lt.fromJSON(e.schema,ue.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let r=e.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:Lt.fromJSON(r,ue.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let r=e.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Lt.fromJSON(r,ue.RecordBatch)}}return this._body=[],Ne}readMessageBody(e){return r(this._body);function r(i){return(i||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...o.VIEWS&&[o.VIEWS]||[],...o.VARIADIC_DATA_BUFFERS||[],...r(o.children)],[])}}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Pg(e));return r.value}readSchema(){let e=ue.Schema,r=this.readMessage(e),i=r?.header();if(!r||!i)throw new Error(Lg(e));return i}},Hd=4,Ug="ARROW1",ma=new Uint8Array(Ug.length);for(let t=0;t<Ug.length;t+=1)ma[t]=Ug.codePointAt(t);ha=ma.length,Eg=ha+Hd,$k=ha*2+Hd});var Fg,jg,xk,Ik=m(()=>{Ps();Fg=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),i=e.encode(r);return this._isValidCompressed(i)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((r,i)=>e[i]===r)}_hasValidVersion(e){return(e[4]&192)>>6===1}},jg=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),i=e.encode(r);return this._isValidCompressed(i)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((r,i)=>e[i]===r)}},xk={[wt.LZ4_FRAME]:new Fg,[wt.ZSTD]:new jg}});var Mg,ga,Rg=m(()=>{Ps();Ik();Mg=class{constructor(){this.registry={}}set(e,r){if(r?.encode&&typeof r.encode=="function"&&!xk[e].isValidCodecEncode(r))throw new Error(`Encoder for ${wt[e]} is not valid.`);this.registry[e]=r}get(e){var r;return((r=this.registry)===null||r===void 0?void 0:r[e])||null}},ga=new Mg});function Ak(t,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:t.autoDestroy}function*Sk(t){let e=Br.from(t);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function kk(t){return Rt(this,arguments,function*(){let r=yield re(Br.from(t));try{if(!(yield re(r.open({autoDestroy:!1}))).closed)do yield yield re(r);while(!(yield re(r.reset().open())).closed)}finally{yield re(r.cancel())}})}function $4(t){return new Un(new Zg(t))}function x4(t){let e=t.peek(ha+7&-8);return e&&e.byteLength>=4?Kd(e)?new co(new qd(t.read())):new Un(new ya(t)):new Un(new ya((function*(){})()))}function I4(t){return T(this,void 0,void 0,function*(){let e=yield t.peek(ha+7&-8);return e&&e.byteLength>=4?Kd(e)?new co(new qd(yield t.read())):new so(new va(t)):new so(new va((function(){return Rt(this,arguments,function*(){})})()))})}function S4(t){return T(this,void 0,void 0,function*(){let{size:e}=yield t.stat(),r=new ii(t,e);return e>=$k&&Kd(yield r.readAt(0,ha+7&-8))?new Yd(new Vg(r)):new so(new va(r))})}var Br,Un,so,co,Yd,Xd,ya,va,qd,Vg,Zg,Wg=m(()=>{Vt();zr();Ut();ke();Qe();hg();Ts();Xi();eo();bg();j0();oo();oc();Cg();Oi();Rg();Rr();de();Br=class t extends Qi{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let r=this._impl.open(e);return br(r)?r.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return it.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return it.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof t?e:Il(e)?$4(e):kl(e)?S4(e):br(e)?T(this,void 0,void 0,function*(){return yield t.from(yield e)}):Dl(e)||zs(e)||zl(e)||ir(e)?I4(new dr(e)):x4(new nn(e))}static readAll(e){return e instanceof t?e.isSync()?Sk(e):kk(e):Il(e)||ArrayBuffer.isView(e)||_r(e)||Sl(e)?Sk(e):kk(e)}},Un=class extends Br{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Rt(this,arguments,function*(){yield re(yield*jo(vr(this[Symbol.iterator]())))})}},so=class extends Br{constructor(e){super(e),this._impl=e}readAll(){return T(this,void 0,void 0,function*(){var e,r,i,n;let o=new Array;try{for(var a=!0,s=vr(this),c;c=yield s.next(),e=c.done,!e;a=!0){n=c.value,a=!1;let u=n;o.push(u)}}catch(u){r={error:u}}finally{try{!a&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},co=class extends Un{constructor(e){super(e),this._impl=e}},Yd=class extends so{constructor(e){super(e),this._impl=e}},Xd=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,r,i){let n;if(e.compression!=null){let a=ga.get(e.compression.type);if(a?.decode&&typeof a.decode=="function"){let{decommpressedBody:s,buffers:c}=this._decompressBuffers(e,r,a);n=this._loadCompressedVectors(e,s,this.schema.fields),e=new Ye(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else n=this._loadVectors(e,r,this.schema.fields);let o=U({type:new ze(this.schema.fields),length:e.length,children:n});return new Be(this.schema,o,i)}_loadDictionaryBatch(e,r){let{id:i,isDelta:n}=e,{dictionaries:o,schema:a}=this,s=o.get(i),c=a.dictionaries.get(i),u;if(e.data.compression!=null){let l=ga.get(e.data.compression.type);if(l?.decode&&typeof l.decode=="function"){let{decommpressedBody:d,buffers:f}=this._decompressBuffers(e.data,r,l);u=this._loadCompressedVectors(e.data,d,[c]),e=new mt(new Ye(e.data.length,e.data.nodes,f,null,e.data.variadicBufferCounts),i,n)}else throw new Error("Dictionary batch is compressed but codec not found")}else u=this._loadVectors(e.data,r,[c]);return(s&&n?s.concat(new P(u)):new P(u)).memoize()}_loadVectors(e,r,i){return new ca(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(i)}_loadCompressedVectors(e,r,i){return new wd(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(i)}_decompressBuffers(e,r,i){let n=[],o=[],a=0;for(let{offset:s,length:c}of e.buffers){if(c===0){n.push(new Uint8Array(0)),o.push(new je(a,0));continue}let u=new ot(r.subarray(s,s+c)),l=ie(u.readInt64(0)),d=u.bytes().subarray(8),f=l===-1?d:i.decode(d);n.push(f);let p=(a+7&-8)-a;a+=p,o.push(new je(a,f.length)),a+=f.length}return{decommpressedBody:n,buffers:o}}},ya=class extends Xd{constructor(e,r){super(r),this._reader=Il(e)?new Pc(this._handle=e):new pa(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Ak(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Ne}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ne}next(){if(this.closed)return Ne;let e,{_reader:r}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let i=e.header(),n=r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let i=e.header(),n=r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ao(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},va=class extends Xd{constructor(e,r){super(r),this._reader=new Uc(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return T(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return T(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Ak(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return T(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ne})}return(e){return T(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ne})}next(){return T(this,void 0,void 0,function*(){if(this.closed)return Ne;let e,{_reader:r}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let i=e.header(),n=yield r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let i=e.header(),n=yield r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ao(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return T(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},qd=class extends ya{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,r){super(e instanceof ac?e:new ac(e),r)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var r;if(this.closed)return null;this._footer||this.open();let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(i&&this._handle.seek(i.offset)){let n=this._reader.readMessage(ue.RecordBatch);if(n?.isRecordBatch()){let o=n.header(),a=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,a,n.metadata)}}return null}_readDictionaryBatch(e){var r;let i=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(i&&this._handle.seek(i.offset)){let n=this._reader.readMessage(ue.DictionaryBatch);if(n?.isDictionaryBatch()){let o=n.header(),a=this._reader.readMessageBody(n.bodyLength),s=this._loadDictionaryBatch(o,a);this.dictionaries.set(o.id,s)}}}_readFooter(){let{_handle:e}=this,r=e.size-Eg,i=e.readInt32(r),n=e.readAt(r-i,i);return Sn.decode(n)}_readNextMessageAndValidate(e){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(i&&this._handle.seek(i.offset))return this._reader.readMessage(e)}return null}},Vg=class extends va{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...r){let i=typeof r[0]!="number"?r.shift():void 0,n=r[0]instanceof Map?r.shift():void 0;super(e instanceof ii?e:new ii(e,i),n)}isFile(){return!0}isAsync(){return!0}open(e){let r=Object.create(null,{open:{get:()=>super.open}});return T(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,e)})}readRecordBatch(e){return T(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(i&&(yield this._handle.seek(i.offset))){let n=yield this._reader.readMessage(ue.RecordBatch);if(n?.isRecordBatch()){let o=n.header(),a=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,a,n.metadata)}}return null})}_readDictionaryBatch(e){return T(this,void 0,void 0,function*(){var r;let i=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(i&&(yield this._handle.seek(i.offset))){let n=yield this._reader.readMessage(ue.DictionaryBatch);if(n?.isDictionaryBatch()){let o=n.header(),a=yield this._reader.readMessageBody(n.bodyLength),s=this._loadDictionaryBatch(o,a);this.dictionaries.set(o.id,s)}}})}_readFooter(){return T(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let r=e.size-Eg,i=yield e.readInt32(r),n=yield e.readAt(r-i,i);return Sn.decode(n)})}_readNextMessageAndValidate(e){return T(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(e)}return null})}},Zg=class extends ya{constructor(e,r){super(e,r)}_loadVectors(e,r,i){return new _d(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(i)}}});function Qt(t){let e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new je(this._byteLength,e)),this._byteLength+=e,this}function k4(t){var e;let{type:r,length:i,typeIds:n,valueOffsets:o}=t;if(Qt.call(this,n),r.mode===Ae.Sparse)return Jg.call(this,t);if(r.mode===Ae.Dense){if(t.offset<=0)return Qt.call(this,o),Jg.call(this,t);{let a=new Int32Array(i),s=Object.create(null),c=Object.create(null);for(let u,l,d=-1;++d<i;)(u=n[d])!==void 0&&((l=s[u])===void 0&&(l=s[u]=o[d]),a[d]=o[d]-l,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);Qt.call(this,a),this.visitMany(t.children.map((u,l)=>{let d=r.typeIds[l],f=s[d],p=c[d];return u.slice(f,Math.min(i,p))}))}}return this}function D4(t){let e;return t.nullCount>=t.length?Qt.call(this,new Uint8Array(t.length+7>>3)):(e=t.values)instanceof Uint8Array?Qt.call(this,Ji(t.offset,t.length,e)):Qt.call(this,Gi(t.values))}function Pn(t){return Qt.call(this,t.values.subarray(0,t.length*t.stride))}function Qd(t){let{length:e,values:r,valueOffsets:i}=t,n=ie(i[0]),o=ie(i[e]),a=Math.min(o-n,r.byteLength-n);return Qt.call(this,Ol(-n,e+1,i)),Qt.call(this,r.subarray(n,n+a)),this}function zk(t){let{offset:e,length:r,stride:i,values:n,variadicBuffers:o=[]}=t;if(!n)throw new Error("BinaryView data is missing view buffer");let a=e*i,s=a+r*i;Qt.call(this,n.subarray(a,s));for(let c of o)Qt.call(this,c);return this._variadicBufferCounts.push(o.length),this}function ef(t){let{length:e,valueOffsets:r}=t;if(r){let i=ie(r[0]),n=ie(r[e]);return Qt.call(this,Ol(-i,e+1,r)),this.visit(t.children[0].slice(i,n-i))}return this.visit(t.children[0])}function Jg(t){return this.visitMany(t.type.children.map((e,r)=>t.children[r]).filter(Boolean))[0]}var Ue,Ok=m(()=>{Ut();Dr();Qe();oo();qe();ra();Xi();ke();Rr();Ue=class t extends J{static assemble(...e){let r=n=>n.flatMap(o=>Array.isArray(o)?r(o):o instanceof Be?o.data.children:o.data),i=new t;return i.visitMany(r(e)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof P)return this.visitMany(e.data),this;let{type:r}=e;if(!z.isDictionary(r)){let{length:i}=e;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(z.isUnion(r))this.nodes.push(new lr(i,0));else{let{nullCount:n}=e;z.isNull(r)||Qt.call(this,n<=0?new Uint8Array(0):Ji(e.offset,i,e.nullBitmap)),this.nodes.push(new lr(i,n))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Ue.prototype.visitBool=D4;Ue.prototype.visitInt=Pn;Ue.prototype.visitFloat=Pn;Ue.prototype.visitUtf8=Qd;Ue.prototype.visitLargeUtf8=Qd;Ue.prototype.visitUtf8View=zk;Ue.prototype.visitBinary=Qd;Ue.prototype.visitLargeBinary=Qd;Ue.prototype.visitBinaryView=zk;Ue.prototype.visitFixedSizeBinary=Pn;Ue.prototype.visitDate=Pn;Ue.prototype.visitTimestamp=Pn;Ue.prototype.visitTime=Pn;Ue.prototype.visitDecimal=Pn;Ue.prototype.visitList=ef;Ue.prototype.visitLargeList=ef;Ue.prototype.visitStruct=Jg;Ue.prototype.visitUnion=k4;Ue.prototype.visitInterval=Pn;Ue.prototype.visitDuration=Pn;Ue.prototype.visitFixedSizeList=ef;Ue.prototype.visitMap=ef});function Gg(t,e){let r=e;e instanceof et&&(r=e.batches,t.reset(void 0,e.schema));for(let i of r)t.write(i);return t.finish()}function Hg(t,e){return T(this,void 0,void 0,function*(){var r,i,n,o,a,s,c;try{for(r=!0,i=vr(e);n=yield i.next(),o=n.done,!o;r=!0){c=n.value,r=!1;let u=c;t.write(u)}}catch(u){a={error:u}}finally{try{!r&&!o&&(s=i.return)&&(yield s.call(i))}finally{if(a)throw a.error}}return t.finish()})}var uo,Lc,Ec,Bk=m(()=>{Vt();Nc();Cg();Ut();Xi();Xi();hg();Qe();Jd();eo();Ok();qe();oo();oc();Oi();Ps();Rg();de();uo=class extends Qi{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}constructor(e){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new rn,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,_t(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(wt).includes(e.compressionType))this._compression=new qi(e.compressionType);else{let r=Object.values(wt).filter(i=>typeof i=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return br(e)?e.then(r=>this.writeAll(r)):ir(e)?Hg(this,e):Gg(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,r=null){return e===this._sink||e instanceof rn?this._sink=e:(this._sink=new rn,e&&OI(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&BI(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!io(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(e){let r=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof et&&!(r=e.schema))return this.finish()&&void 0;if(e instanceof Be&&!(r=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!io(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}e instanceof Be?e instanceof ao||this._writeRecordBatch(e):e instanceof et?this.writeAll(e.batches):_r(e)&&this.writeAll(e)}_writeMessage(e,r=8){let i=r-1,n=Lt.encode(e),o=n.byteLength,a=this._writeLegacyIpcFormat?4:8,s=o+a+i&~i,c=s-o-a;return e.headerType===ue.RecordBatch?this._recordBatchBlocks.push(new kn(s,e.bodyLength,this._position)):e.headerType===ue.DictionaryBatch&&this._dictionaryBlocks.push(new kn(s,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(s-a)),o>0&&this._write(n),this._writePadding(c)}_write(e){if(this._started){let r=C(e);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(e){return this._writeMessage(Lt.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ma)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:r,nodes:i,bufferRegions:n,buffers:o,variadicBufferCounts:a}=this._assembleRecordBatch(e),s=new Ye(e.numRows,i,n,this._compression,a,e.metadata),c=Lt.from(s,r);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(e){let{byteLength:r,nodes:i,bufferRegions:n,buffers:o,variadicBufferCounts:a}=Ue.assemble(e);return this._compression!=null&&({byteLength:r,bufferRegions:n,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:i,bufferRegions:n,buffers:o,variadicBufferCounts:a}}_compressBodyBuffers(e){let r=ga.get(this._compression.type);if(!r?.encode||typeof r.encode!="function")throw new Error(`Codec for compression type "${wt[this._compression.type]}" has invalid encode method`);let i=0,n=[],o=[];for(let s of e){let c=C(s);if(c.length===0){n.push(new Uint8Array(0),new Uint8Array(0)),o.push(new je(i,0));continue}let u=r.encode(c),l=u.length<c.length,d=l?u:c,f=l?d.length:-1,p=new ot(new Uint8Array(8));p.writeInt64(0,BigInt(f)),n.push(p.bytes(),new Uint8Array(d));let h=(i+7&-8)-i;i+=h;let y=8+d.length;o.push(new je(i,y)),i+=y}let a=(i+7&-8)-i;return i+=a,{byteLength:i,bufferRegions:o,buffers:n}}_writeDictionaryBatch(e,r,i=!1){let{byteLength:n,nodes:o,bufferRegions:a,buffers:s,variadicBufferCounts:c}=this._assembleRecordBatch(new P([e])),u=new Ye(e.length,o,a,this._compression,c),l=new mt(u,r,i),d=Lt.from(l,n);return this._writeMessage(d)._writeBodyBuffers(s)}_writeBodyBuffers(e){let r=this._compression!=null?2:1,i=new Array(r);for(let n=0;n<e.length;n+=r){let o=0;for(let s=-1;++s<r;)i[s]=e[n+s],o+=i[s].byteLength;if(o===0)continue;for(let s of i)this._write(s);let a=(o+7&-8)-o;a>0&&this._writePadding(a)}return this}_writeDictionaries(e){var r,i;for(let[n,o]of e.dictionaries){let a=(r=o?.data)!==null&&r!==void 0?r:[],s=this._seenDictionaries.get(n),c=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!s||s.data[0]!==a[0])for(let[u,l]of a.entries())this._writeDictionaryBatch(l,n,u>0);else if(c<a.length)for(let u of a.slice(c))this._writeDictionaryBatch(u,n,!0);this._seenDictionaries.set(n,o),this._dictionaryDeltaOffsets.set(n,a.length)}return this}},Lc=class t extends uo{static writeAll(e,r){let i=new t(r);return br(e)?e.then(n=>i.writeAll(n)):ir(e)?Hg(i,e):Gg(i,e)}},Ec=class t extends uo{static writeAll(e,r){let i=new t(r);return br(e)?e.then(n=>i.writeAll(n)):ir(e)?Hg(i,e):Gg(i,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,r,i=!1){if(!i&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,r,i)}_writeFooter(e){let r=Sn.encode(new Sn(e,be.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}}});function Tk(t,e){if(ir(t))return z4(t,e);if(_r(t))return A4(t,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function A4(t,e){let r=null,i=e?.type==="bytes"||!1,n=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){o(a,r||(r=t[Symbol.iterator]()))},pull(a){r?o(a,r):a.close()},cancel(){r?.return&&r.return(),r=null}}),Object.assign({highWaterMark:i?n:void 0},e));function o(a,s){let c,u=null,l=a.desiredSize||null;for(;!(u=s.next(i?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=C(u.value))&&(l!=null&&i&&(l=l-c.byteLength+1),u.value=c),a.enqueue(u.value),l!=null&&--l<=0)return;a.close()}}function z4(t,e){let r=null,i=e?.type==="bytes"||!1,n=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){return T(this,void 0,void 0,function*(){yield o(a,r||(r=t[Symbol.asyncIterator]()))})},pull(a){return T(this,void 0,void 0,function*(){r?yield o(a,r):a.close()})},cancel(){return T(this,void 0,void 0,function*(){r?.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:i?n:void 0},e));function o(a,s){return T(this,void 0,void 0,function*(){let c,u=null,l=a.desiredSize||null;for(;!(u=yield s.next(i?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=C(u.value))&&(l!=null&&i&&(l=l-c.byteLength+1),u.value=c),a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}var Nk=m(()=>{Vt();qe();Oi()});function Lk(t){return new Kg(t)}var Kg,Uk,Pk,Ek=m(()=>{Vt();zg();Kg=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:i,["queueingStrategy"]:n="count"}=e,o=DI(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=ro(o),this._getSize=n!=="bytes"?Uk:Pk;let{["highWaterMark"]:a=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:s=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},i);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:a,size:n!=="bytes"?Uk:Pk}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:s,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-r}_maybeFlush(e,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(e,r){this._bufferedSize=0,this._controller=null,r==null?e.close():e.enqueue(r)}},Uk=t=>{var e;return(e=t?.length)!==null&&e!==void 0?e:0},Pk=t=>{var e;return(e=t?.byteLength)!==null&&e!==void 0?e:0}});function tf(t,e){let r=new rn,i=null,n=new ReadableStream({cancel(){return T(this,void 0,void 0,function*(){yield r.close()})},start(s){return T(this,void 0,void 0,function*(){yield a(s,i||(i=yield o()))})},pull(s){return T(this,void 0,void 0,function*(){i?yield a(s,i):s.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},t)),readable:n};function o(){return T(this,void 0,void 0,function*(){return yield(yield Br.from(r)).open(e)})}function a(s,c){return T(this,void 0,void 0,function*(){let u=s.desiredSize,l=null;for(;!(l=yield c.next()).done;)if(s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}var Ck=m(()=>{Vt();eo();Wg()});function rf(t,e){let r=new this(t),i=new dr(r),n=new ReadableStream({cancel(){return T(this,void 0,void 0,function*(){yield i.cancel()})},pull(a){return T(this,void 0,void 0,function*(){yield o(a)})},start(a){return T(this,void 0,void 0,function*(){yield o(a)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(r,t),readable:n};function o(a){return T(this,void 0,void 0,function*(){let s=null,c=a.desiredSize;for(;s=yield i.read(c||null);)if(a.enqueue(s),c!=null&&(c-=s.byteLength)<=0)return;a.close()})}}var Fk=m(()=>{Vt();eo()});var Yg={};Ie(Yg,{isArrowData:()=>Vk,isArrowDataType:()=>Rk,isArrowField:()=>Mk,isArrowRecordBatch:()=>Wk,isArrowSchema:()=>jk,isArrowTable:()=>Jk,isArrowVector:()=>Zk});function jk(t){return se.isSchema(t)}function Mk(t){return Y.isField(t)}function Rk(t){return z.isDataType(t)}function Vk(t){return Q.isData(t)}function Zk(t){return P.isVector(t)}function Wk(t){return Be.isRecordBatch(t)}function Jk(t){return et.isTable(t)}var Gk=m(()=>{$t();ke();zr();Ut();oo();Nc()});var X4,Hk=m(()=>{zr();ke();Nc();Ut();$t();Zh();$g();ra();Qs();qe();ta();Hs();kg();Gk();Jd();X4=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vh),wg),sg),Wh),sh),ag),Fh),Sg),Yg),{compareSchemas:io,compareFields:dk,compareTypes:fk})});var Kk=m(()=>{Ts();Pe();Wg();Bk();Nk();Ek();Ck();Fk();Hk();it.toDOMStream=Tk;Oe.throughDOM=Lk;Br.throughDOM=tf;co.throughDOM=tf;Un.throughDOM=tf;uo.throughDOM=rf;Ec.throughDOM=rf;Lc.throughDOM=rf});function nf(t){return(t/255-.5)/Xg}function of(t){return Math.min(Math.max(t/255,0),1)}function an(t,e,r,i){let n=Math.hypot(t,e,r,i);return!Number.isFinite(n)||n<=Number.EPSILON?[1,0,0,0]:[t/n,e/n,r/n,i/n]}function Cc(t){return(t-128)/128}function Fc(t){let e=t&32768?-1:1,r=t>>10&31,i=t&1023;return r===0?e*Math.pow(2,-14)*(i/1024):r===31?i?Number.NaN:e*Number.POSITIVE_INFINITY:e*Math.pow(2,r-15)*(1+i/1024)}var Xg,ba=m(()=>{"use strict";Xg=.28209479177387814});function sn(t){let e={},r=[],i=[];Xk(e,r,i,"POSITION",e6(t.positions,3),{type:"fixed-size-list",listSize:3,children:[{name:"value",type:"float32"}]});let n=t6(t);_a(e,r,i,"f_dc_0",n[0],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"0","loaders_gl.gaussian_splats.encoding":"coefficient"}),_a(e,r,i,"f_dc_1",n[1],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"1","loaders_gl.gaussian_splats.encoding":"coefficient"}),_a(e,r,i,"f_dc_2",n[2],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"2","loaders_gl.gaussian_splats.encoding":"coefficient"}),_a(e,r,i,"opacity",t.opacities,{"loaders_gl.gaussian_splats.semantic":"opacity","loaders_gl.gaussian_splats.encoding":"linear"}),Yk(e,r,i,"scale",t.scales,3,{"loaders_gl.gaussian_splats.semantic":"scale","loaders_gl.gaussian_splats.encoding":"linear"}),Yk(e,r,i,"rot",t.rotations,4,{"loaders_gl.gaussian_splats.semantic":"rotation","loaders_gl.gaussian_splats.encoding":"quaternion"}),t.sphericalHarmonics&&t.sphericalHarmonicsComponentCount&&Q4(e,r,i,t.sphericalHarmonics,t.sphericalHarmonicsComponentCount);let o=new Map([["loaders_gl.semantic_type","gaussian-splats"],["loaders_gl.gaussian_splats.version","1"],["loaders_gl.gaussian_splats.source_format",t.format],["topology","point-list"],["mode","0"]]),a=new se(r,o);return{shape:"arrow-table",schema:{fields:i,metadata:Object.fromEntries(o)},data:new et(a,e),topology:"point-list",loaderData:t.loaderData}}function Yk(t,e,r,i,n,o,a){for(let s=0;s<o;s++){let c=new Float32Array(n.length/o);for(let u=0;u<c.length;u++)c[u]=n[u*o+s];_a(t,e,r,`${i}_${s}`,c,{...a,"loaders_gl.gaussian_splats.component":String(s)})}}function Q4(t,e,r,i,n){for(let o=0;o<n;o++){let a=new Float32Array(i.length/n);for(let s=0;s<a.length;s++)a[s]=i[s*n+o];_a(t,e,r,`f_rest_${o}`,a,{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_rest","loaders_gl.gaussian_splats.component":String(o),"loaders_gl.gaussian_splats.encoding":"coefficient"})}}function _a(t,e,r,i,n,o){Xk(t,e,r,i,Ki(n),"float32",o)}function Xk(t,e,r,i,n,o,a={}){t[i]=n,e.push(new Y(i,n.type,!1,new Map(Object.entries(a)))),r.push({name:i,type:o,nullable:!1,metadata:a})}function e6(t,e){let i=Ki(t).data[0],n=new Tt(e,new Y("value",i.type,!1)),o=new Q(n,0,t.length/e,0,{},[i]);return new P([o])}function t6(t){let e=t.splatCount,r=new Float32Array(e),i=new Float32Array(e),n=new Float32Array(e);for(let o=0;o<e;o++)t.sphericalHarmonicDcs?(r[o]=t.sphericalHarmonicDcs[o*3+0],i[o]=t.sphericalHarmonicDcs[o*3+1],n[o]=t.sphericalHarmonicDcs[o*3+2]):(r[o]=nf(t.colors[o*3+0]),i[o]=nf(t.colors[o*3+1]),n[o]=nf(t.colors[o*3+2]));return[r,i,n]}var wa=m(()=>{"use strict";Kk();ba()});async function af(t,e){return sn(await Qg(t,e))}async function Qg(t,e){let r=i6(t);if(r===0)return await o6(t,e);if(r!==tD)throw new Error(`SPZLoader: version ${r} is not supported.`);let i=s6(t),n=c6(t,i,u6(i)),o=n.map(c=>t.slice(c.compressedOffset,c.compressedOffset+c.compressedSize)),a=new As({modules:e?.modules}),s=await Promise.all(o.map((c,u)=>a.decompress(c,n[u].uncompressedSize)));return l6(s,n),ey(d6(i,s,t),e?.splats?.sourceCoordinateSystem??"RUB",e?.splats?.targetCoordinateSystem??e?.splats?.sourceCoordinateSystem??"RUB")}function i6(t){if(t.byteLength<8)throw new Error("SPZLoader: file must contain at least an 8-byte header.");let e=new Uint8Array(t);if(e[0]===31&&e[1]===139)return 0;if(t.byteLength<$a)throw new Error("SPZLoader: file must contain a 32-byte header.");return new DataView(t).getUint32(4,!0)}async function o6(t,e){let r=await new Ds({modules:e?.modules,useNative:!0}).decompress(t);if(r.byteLength<16)throw new Error("SPZLoader: legacy payload must contain a 16-byte header.");let i=new DataView(r),n={magic:i.getUint32(0,!0),version:i.getUint32(4,!0),numPoints:i.getUint32(8,!0),shDegree:i.getUint8(12),fractionalBits:i.getUint8(13),flags:i.getUint8(14)};if(n.magic!==eD)throw new Error("SPZLoader: NGSP magic header not found.");if(n.version!==2&&n.version!==3)throw new Error(`SPZLoader: version ${n.version} is not supported.`);if(i.getUint8(15)!==0)throw new Error("SPZLoader: legacy header reserved byte must be zero.");if(n.shDegree>3)throw new Error(`SPZLoader: spherical harmonics degree ${n.shDegree} is not supported.`);let o=n.numPoints,a=ty(n.shDegree),s=o*9,c=o,u=o*3,l=o*3,d=o*(n.version===2?3:4),f=o*a,p=s+c+u+l+d+f;if(r.byteLength-16!==p)throw new Error(`SPZLoader: legacy payload has ${r.byteLength-16} bytes, expected ${p}.`);let h=16,y=new Float32Array(o*3),_=new Float32Array(o),D=new Uint8Array(o*3),I=new Float32Array(o*3),A=new Float32Array(o*4),Z=new Float32Array(o*3),L=a?new Float32Array(o*a):void 0;return nD(new Uint8Array(r,h,s),y,n.fractionalBits),h+=s,sD(new Uint8Array(r,h,c),_),h+=c,aD(new Uint8Array(r,h,u),D,Z),h+=u,iD(new Uint8Array(r,h,l),I),h+=l,n.version===2?a6(new Uint8Array(r,h,d),A):oD(new Uint8Array(r,h,d),A),h+=d,L&&cD(new Uint8Array(r,h,f),L),ey({format:"spz",splatCount:o,positions:y,scales:I,rotations:A,colors:D,sphericalHarmonicDcs:Z,opacities:_,sphericalHarmonics:L,sphericalHarmonicsComponentCount:a||void 0,loaderData:{...n,legacy:!0}},e?.splats?.sourceCoordinateSystem??"RUB",e?.splats?.targetCoordinateSystem??e?.splats?.sourceCoordinateSystem??"RUB")}function a6(t,e){for(let r=0;r<e.length/4;r++){let i=r*3,n=qg(t[i])/127,o=qg(t[i+1])/127,a=qg(t[i+2])/127,s=Math.sqrt(Math.max(0,1-n*n-o*o-a*a)),c=an(s,n,o,a);e.set(c,r*4)}}function qg(t){return t>127?t-256:t}function ey(t,e,r){if(e===r||e==="UNSPECIFIED"||r==="UNSPECIFIED")return t;if(e==="RUB"&&r==="LUF"){for(let i=0;i<t.positions.length;i+=3)t.positions[i]=-t.positions[i],t.positions[i+2]=-t.positions[i+2];for(let i=0;i<t.rotations.length;i+=4)t.rotations[i+1]=-t.rotations[i+1],t.rotations[i+3]=-t.rotations[i+3];return t}if(e==="LUF"&&r==="RUB")return ey(t,"RUB","LUF");throw new Error(`SPZLoader: coordinate conversion ${e} -> ${r} is not supported.`)}function s6(t){if(t.byteLength<$a)throw new Error(`SPZLoader: file must contain a ${$a}-byte header.`);let e=new DataView(t),r={magic:e.getUint32(0,!0),version:e.getUint32(4,!0),numPoints:e.getUint32(8,!0),shDegree:e.getUint8(12),fractionalBits:e.getUint8(13),flags:e.getUint8(14),numStreams:e.getUint8(15),tocByteOffset:e.getUint32(16,!0)};if(r.magic!==eD)throw new Error("SPZLoader: NGSP magic header not found.");if(r.version!==tD)throw new Error(`SPZLoader: version ${r.version} is not supported.`);if(r.shDegree>4)throw new Error(`SPZLoader: spherical harmonics degree ${r.shDegree} is not supported.`);if(r.tocByteOffset<$a||r.tocByteOffset>t.byteLength)throw new Error("SPZLoader: invalid table of contents byte offset.");return r}function c6(t,e,r){if(e.numStreams!==r.length)throw new Error(`SPZLoader: expected ${r.length} streams, found ${e.numStreams}.`);let i=e.numStreams*16,n=e.tocByteOffset+i;if(n>t.byteLength)throw new Error("SPZLoader: table of contents exceeds file byte length.");let o=new DataView(t),a=n,s=[];for(let c=0;c<e.numStreams;c++){let u=e.tocByteOffset+c*16,l=Qk(o,u),d=Qk(o,u+8),f=r[c];if(d!==f)throw new Error(`SPZLoader: stream ${c} has ${d} uncompressed bytes, expected ${f}.`);if(a+l>t.byteLength)throw new Error(`SPZLoader: stream ${c} exceeds file byte length.`);s.push({compressedSize:l,uncompressedSize:d,compressedOffset:a}),a+=l}if(a!==t.byteLength)throw new Error("SPZLoader: compressed stream byte lengths do not match file byte length.");return s}function Qk(t,e){let r=t.getBigUint64(e,!0);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("SPZLoader: stream byte length exceeds Number.MAX_SAFE_INTEGER.");return Number(r)}function u6(t){return[t.numPoints*9,t.numPoints,t.numPoints*3,t.numPoints*3,t.numPoints*4,t.numPoints*ty(t.shDegree)].filter(e=>e>0)}function l6(t,e){for(let r=0;r<t.length;r++)if(t[r].byteLength!==e[r].uncompressedSize)throw new Error(`SPZLoader: decompressed stream ${r} has unexpected byte length.`)}function d6(t,e,r){let i=t.numPoints,n=new Float32Array(i*3),o=new Float32Array(i*3),a=new Float32Array(i*4),s=new Uint8Array(i*3),c=new Float32Array(i*3),u=new Float32Array(i),l=ty(t.shDegree),d=l?new Float32Array(i*l):void 0,[f,p,h,y,_,D]=e.map(I=>new Uint8Array(I));return nD(f,n,t.fractionalBits),iD(y,o),oD(_,a),aD(h,s,c),sD(p,u),d&&D&&cD(D,d),{format:"spz",splatCount:i,positions:n,scales:o,rotations:a,colors:s,sphericalHarmonicDcs:c,opacities:u,sphericalHarmonics:d,sphericalHarmonicsComponentCount:l,loaderData:{format:"spz",...t,antialiased:!!(t.flags&1),extensionByteLength:uD(t),extensionBytes:m6(r,t)}}}function nD(t,e,r){let i=1/2**r;for(let n=0;n<e.length;n++){let o=n*3,a=t[o]|t[o+1]<<8|t[o+2]<<16;a|=a&8388608?4278190080:0,e[n]=a*i}}function iD(t,e){for(let r=0;r<e.length;r++)e[r]=Math.exp(t[r]/16-10)}function oD(t,e){for(let r=0;r<e.length/4;r++){let i=r*4,n=t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24,o=f6(n>>>0),[a,s,c,u]=an(o[3],o[0],o[1],o[2]),l=r*4;e[l+0]=a,e[l+1]=s,e[l+2]=c,e[l+3]=u}}function f6(t){let e=[0,0,0,0],r=t>>>30,i=t,n=0;for(let o=3;o>=0;o--)if(o!==r){let a=i&qk,s=i>>>9&1;i>>>=10;let c=n6*a/qk;s&&(c=-c),e[o]=c,n+=c*c}return e[r]=Math.sqrt(Math.max(0,1-n)),e}function aD(t,e,r){for(let i=0;i<e.length;i++)r[i]=(t[i]/255-.5)/rD,e[i]=p6(r[i])}function sD(t,e){for(let r=0;r<e.length;r++)e[r]=t[r]/255}function cD(t,e){for(let r=0;r<e.length;r++)e[r]=(t[r]-128)/128}function p6(t){return Math.min(Math.max(Math.round((t*rD+.5)*255),0),255)}function ty(t){switch(t){case 0:return 0;case 1:return 9;case 2:return 24;case 3:return 45;case 4:return 72;default:throw new Error(`SPZLoader: spherical harmonics degree ${t} is not supported.`)}}function uD(t){return t.flags&r6?t.tocByteOffset-$a:0}function m6(t,e){return uD(e)?new Uint8Array(t.slice($a,e.tocByteOffset)):void 0}var $a,eD,tD,r6,rD,n6,qk,ry=m(()=>{"use strict";SI();wa();ba();$a=32,eD=1347635022,tD=4,r6=2,rD=.15,n6=Math.SQRT1_2,qk=511});function ny(t){return sn(h6(t))}function h6(t){if(t.byteLength%jc!==0)throw new Error(`SPLATLoader: byte length must be a multiple of ${jc}.`);let e=t.byteLength/jc,r=new DataView(t),i=new Float32Array(e*3),n=new Float32Array(e*3),o=new Float32Array(e*4),a=new Uint8Array(e*3),s=new Float32Array(e);for(let c=0;c<e;c++){let u=c*jc,l=c*3,d=c*4;i[l+0]=r.getFloat32(u+0,!0),i[l+1]=r.getFloat32(u+4,!0),i[l+2]=r.getFloat32(u+8,!0),n[l+0]=r.getFloat32(u+12,!0),n[l+1]=r.getFloat32(u+16,!0),n[l+2]=r.getFloat32(u+20,!0),a[l+0]=r.getUint8(u+24),a[l+1]=r.getUint8(u+25),a[l+2]=r.getUint8(u+26),s[c]=of(r.getUint8(u+27));let[f,p,h,y]=an(Cc(r.getUint8(u+28)),Cc(r.getUint8(u+29)),Cc(r.getUint8(u+30)),Cc(r.getUint8(u+31)));o[d+0]=f,o[d+1]=p,o[d+2]=h,o[d+3]=y}return{format:"splat",splatCount:e,positions:i,scales:n,rotations:o,colors:a,opacities:s,loaderData:{format:"splat",splatCount:e,rowByteLength:jc}}}var jc,lD=m(()=>{"use strict";wa();ba();jc=32});var dD={};Ie(dD,{SPLATLoaderWithParser:()=>y6});var YH,g6,y6,fD=m(()=>{"use strict";lD();iy();({preload:YH,...g6}=sf),y6={...g6,parse:async t=>ny(t),parseSync:t=>ny(t)}});async function b6(){let{SPLATLoaderWithParser:t}=await Promise.resolve().then(()=>(fD(),dD));return t}var v6,sf,iy=m(()=>{"use strict";$i();v6="5.0.0-alpha.8";sf={dataType:null,batchType:null,...el,version:v6,options:{splats:{shape:"arrow-table"}},preload:b6}});function sy(t){return sn($6(t))}function $6(t){if(t.byteLength<xa)throw new Error(`KSPLATLoader: file must contain a ${xa}-byte header.`);let e=I6(t);S6(e);let r=k6(t,e),i=T6(e,r),n=Math.max(0,...r.slice(0,uf(e)).map(f=>cy(f.sphericalHarmonicsDegree))),o=new Float32Array(i*3),a=new Float32Array(i*3),s=new Float32Array(i*4),c=new Uint8Array(i*3),u=new Float32Array(i),l=n?new Float32Array(i*n):void 0,d=0;for(let f of r.slice(0,uf(e))){N6(t,f);for(let p=0;p<f.splatCount&&d<i;p++)x6(t,e,f,p,d,o,a,s,c,u,l,n),d++}return{format:"ksplat",splatCount:i,positions:o,scales:a,rotations:s,colors:c,opacities:u,sphericalHarmonics:l,sphericalHarmonicsComponentCount:n,loaderData:{format:"ksplat",...e,sections:r.slice(0,uf(e)).map(f=>({splatCount:f.splatCount,maxSplatCount:f.maxSplatCount,sphericalHarmonicsDegree:f.sphericalHarmonicsDegree}))}}}function x6(t,e,r,i,n,o,a,s,c,u,l,d){let f=ay[e.compressionLevel],p=r.dataBase+r.bytesPerSplat*i,h=n*3,y=n*4,_=A6(t,r,i);o[h+0]=oy(t,p,0,e,r,_[0]),o[h+1]=oy(t,p,1,e,r,_[1]),o[h+2]=oy(t,p,2,e,r,_[2]),a[h+0]=ai(t,p+f.scaleOffsetBytes,0,e.compressionLevel),a[h+1]=ai(t,p+f.scaleOffsetBytes,1,e.compressionLevel),a[h+2]=ai(t,p+f.scaleOffsetBytes,2,e.compressionLevel);let[D,I,A,Z]=an(ai(t,p+f.scaleOffsetBytes,3,e.compressionLevel),ai(t,p+f.scaleOffsetBytes,4,e.compressionLevel),ai(t,p+f.scaleOffsetBytes,5,e.compressionLevel),ai(t,p+f.scaleOffsetBytes,6,e.compressionLevel));s[y+0]=D,s[y+1]=I,s[y+2]=A,s[y+3]=Z;let L=p+f.colorOffsetBytes,k=new Uint8Array(t,L,4);c[h+0]=k[0],c[h+1]=k[1],c[h+2]=k[2],u[n]=of(k[3]),l&&d&&O6(t,p+f.sphericalHarmonicsOffsetBytes,e,r,n,l,d)}function I6(t){let e=new DataView(t,0,xa),r=e.getUint16(20,!0);if(r!==0&&r!==1&&r!==2)throw new Error(`KSPLATLoader: unsupported compression level ${r}.`);return{versionMajor:e.getUint8(0),versionMinor:e.getUint8(1),maxSectionCount:e.getUint32(4,!0),sectionCount:e.getUint32(8,!0),maxSplatCount:e.getUint32(12,!0),splatCount:e.getUint32(16,!0),compressionLevel:r,minSphericalHarmonicsCoeff:e.getFloat32(36,!0)||-mD,maxSphericalHarmonicsCoeff:e.getFloat32(40,!0)||mD}}function S6(t){if(!(t.versionMajor===pD?t.versionMinor>=_6:t.versionMajor>pD))throw new Error(`KSPLATLoader: version ${t.versionMajor}.${t.versionMinor} is not supported.`)}function k6(t,e){if(t.byteLength<xa+e.maxSectionCount*cf)throw new Error("KSPLATLoader: file does not contain all section headers.");let r=[],i=xa+e.maxSectionCount*cf,n=0;for(let o=0;o<e.maxSectionCount;o++){let a=xa+o*cf,s=new DataView(t,a,cf),c=s.getUint32(0,!0),u=s.getUint32(4,!0),l=s.getUint32(8,!0),d=s.getUint32(12,!0),f=s.getFloat32(16,!0),p=s.getUint16(20,!0),h=s.getUint32(24,!0)||ay[e.compressionLevel].scaleRange,y=s.getUint32(32,!0),_=s.getUint32(36,!0),D=s.getUint16(40,!0),I=B6(e.compressionLevel,D),A=_*4,Z=p*d+A,L=I*u+Z;r.push({bytesPerSplat:I,splatCountOffset:n,splatCount:c||u,maxSplatCount:u,bucketSize:l,bucketCount:d,bucketStorageSizeBytes:p,bucketsStorageSizeBytes:Z,compressionScaleRange:h,compressionScaleFactor:f/2/h,base:i,bucketsBase:i+A,dataBase:i+Z,fullBucketCount:y,partiallyFilledBucketCount:_,sphericalHarmonicsDegree:D}),i+=L,n+=u}return r}function oy(t,e,r,i,n,o){let a=D6(t,e,r,i.compressionLevel);return i.compressionLevel>=1?(a-n.compressionScaleRange)*n.compressionScaleFactor+o:a}function D6(t,e,r,i){let n=new DataView(t);return i===0?n.getFloat32(e+r*4,!0):n.getUint16(e+r*2,!0)}function A6(t,e,r){if(!e.bucketCount)return[0,0,0];let i=z6(t,e,r),n=e.bucketsBase+i*e.bucketStorageSizeBytes,o=new DataView(t,n,12);return[o.getFloat32(0,!0),o.getFloat32(4,!0),o.getFloat32(8,!0)]}function z6(t,e,r){let i=e.fullBucketCount*e.bucketSize;if(r<i)return Math.floor(r/e.bucketSize);let n=i,o=e.fullBucketCount;for(let a=0;a<e.partiallyFilledBucketCount;a++){let s=new DataView(t,e.base+a*4,4).getUint32(0,!0);if(r<n+s)return o;n+=s,o++}return Math.max(o-1,0)}function O6(t,e,r,i,n,o,a){let s=cy(i.sphericalHarmonicsDegree),c=n*a;for(let u=0;u<s;u++)o[c+u]=ai(t,e,u,r.compressionLevel,!0,r.minSphericalHarmonicsCoeff,r.maxSphericalHarmonicsCoeff)}function ai(t,e,r,i,n=!1,o=0,a=0){let s=new DataView(t);return i===0?s.getFloat32(e+r*4,!0):i===1||!n?Fc(s.getUint16(e+r*2,!0)):s.getUint8(e+r)/255*(a-o)+o}function B6(t,e){let r=ay[t];return r.bytesPerCenter+r.bytesPerScale+r.bytesPerRotation+r.bytesPerColor+r.bytesPerSphericalHarmonicsComponent*cy(e)}function cy(t){switch(t){case 0:return 0;case 1:return 9;case 2:return 24;case 3:return 45;default:throw new Error(`KSPLATLoader: unsupported spherical harmonics degree ${t}.`)}}function uf(t){return t.sectionCount||t.maxSectionCount}function T6(t,e){let r=e.slice(0,uf(t)).reduce((i,n)=>i+n.splatCount,0);return t.splatCount?Math.min(t.splatCount,r||t.splatCount):r}function N6(t,e){if(e.dataBase+e.bytesPerSplat*e.splatCount>t.byteLength)throw new Error("KSPLATLoader: section data extends beyond the file length.")}var pD,_6,xa,cf,w6,mD,ay,hD=m(()=>{"use strict";wa();ba();pD=0,_6=1,xa=4096,cf=1024,w6=3,mD=w6/2,ay={0:{bytesPerCenter:12,bytesPerScale:12,bytesPerRotation:16,bytesPerColor:4,scaleOffsetBytes:12,colorOffsetBytes:40,sphericalHarmonicsOffsetBytes:44,scaleRange:1,bytesPerSphericalHarmonicsComponent:4},1:{bytesPerCenter:6,bytesPerScale:6,bytesPerRotation:8,bytesPerColor:4,scaleOffsetBytes:6,colorOffsetBytes:20,sphericalHarmonicsOffsetBytes:24,scaleRange:32767,bytesPerSphericalHarmonicsComponent:2},2:{bytesPerCenter:6,bytesPerScale:6,bytesPerRotation:8,bytesPerColor:4,scaleOffsetBytes:6,colorOffsetBytes:20,sphericalHarmonicsOffsetBytes:24,scaleRange:32767,bytesPerSphericalHarmonicsComponent:1}}});var gD={};Ie(gD,{KSPLATLoaderWithParser:()=>P6});var i9,U6,P6,yD=m(()=>{"use strict";hD();uy();({preload:i9,...U6}=lf),P6={...U6,parse:async t=>sy(t),parseSync:t=>sy(t)}});async function E6(){let{KSPLATLoaderWithParser:t}=await Promise.resolve().then(()=>(yD(),gD));return t}var L6,lf,uy=m(()=>{"use strict";$i();L6="5.0.0-alpha.8";lf={dataType:null,batchType:null,...tl,version:L6,options:{splats:{shape:"arrow-table"}},preload:E6}});var vD={};Ie(vD,{SPZLoaderWithParser:()=>F6});var u9,C6,F6,bD=m(()=>{"use strict";ry();ly();({preload:u9,...C6}=df),F6={...C6,parse:async(t,e)=>af(t,e)}});async function M6(){let{SPZLoaderWithParser:t}=await Promise.resolve().then(()=>(bD(),vD));return t}var j6,df,ly=m(()=>{"use strict";$i();j6="5.0.0-alpha.8";df={dataType:null,batchType:null,...rl,version:j6,options:{splats:{shape:"arrow-table"}},preload:M6}});var w={};Ie(w,{BIGINT_FORMAT_RANGES:()=>Jc,CONSTANT_CATCH:()=>gf,Class:()=>py,NUMBER_FORMAT_RANGES:()=>Wc,aborted:()=>St,allowsEval:()=>gy,assert:()=>J6,assertEqual:()=>R6,assertIs:()=>Z6,assertNever:()=>W6,assertNotEqual:()=>V6,assignProp:()=>st,attachSchema:()=>hf,base64ToUint8Array:()=>ID,base64urlToUint8Array:()=>dP,cached:()=>Da,captureStackTrace:()=>pf,cleanEnum:()=>lP,cleanRegex:()=>En,clone:()=>_e,cloneDef:()=>K6,codePointLength:()=>po,constantCatch:()=>wy,createTransparentProxy:()=>tP,defineLazy:()=>my,defineLazyInternal:()=>ae,derived:()=>hP,esc:()=>It,escapeRegex:()=>mr,explicitlyAborted:()=>by,extend:()=>iP,finalizeIssue:()=>Ct,floatSafeRemainder:()=>Rc,getElementAtPath:()=>Y6,getEnumValues:()=>Sa,getLengthableOrigin:()=>Hc,getParsedType:()=>eP,getSizableOrigin:()=>Gc,hexToUint8Array:()=>pP,hide:()=>Kc,installLazyProp:()=>bP,isObject:()=>fo,isPlainObject:()=>pr,issue:()=>za,joinValues:()=>b,jsonStringifyReplacer:()=>ka,members:()=>_y,merge:()=>aP,mergeDefs:()=>Tr,normalizeParams:()=>S,nullish:()=>ff,numKeys:()=>Q6,objectClone:()=>G6,omit:()=>nP,optionalKeys:()=>vy,own:()=>ci,parsedType:()=>x,partial:()=>sP,pick:()=>rP,prefixIssues:()=>Et,primitiveTypes:()=>yy,promiseAllObject:()=>X6,propertyKeyTypes:()=>Zc,randomString:()=>q6,rawShape:()=>Aa,required:()=>cP,safeExtend:()=>oP,shallowClone:()=>Vc,slugify:()=>hy,stringifyPrimitive:()=>$,toZod:()=>Mc,uint8ArrayToBase64:()=>SD,uint8ArrayToBase64url:()=>fP,uint8ArrayToHex:()=>mP,unwrapMessage:()=>Ia});function R6(t){return t}function V6(t){return t}function Mc(){return t=>t}function Z6(t){}function W6(t){throw new Error("Unexpected value in exhaustive check")}function J6(t){}function Sa(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function b(t,e="|"){return t.map(r=>$(r)).join(e)}function ka(t,e){return typeof e=="bigint"?e.toString():e}function Da(t){return new fy(t)}function ff(t){return t==null}function En(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Rc(t,e){let r=t/e,i=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}function my(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==_D)return i===void 0&&(i=_D,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function G6(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function st(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Aa(t){let e=Object.getOwnPropertyDescriptor(t,"shape");return e?.get?e.get.raw:e?.value}function Ln(t){return Aa(t._zod.def)??t._zod.def.shape}function wD(t,e,r){Object.defineProperty(t,e,{get(){let i=r();return st(this,e,i),i},enumerable:!0,configurable:!0})}function $D(t,e,r){e in t?st(t,e,r):t[e]=r}function lo(t,e,r,i){let n=Ln(e);for(let o of r){let a=Object.getOwnPropertyDescriptor(n,o);a.enumerable&&(a.get?wD(t,o,()=>{let s=e._zod.def.shape[o];return i?i(s,o):s}):$D(t,o,i?i(a.value,o):a.value))}}function H6(t,e){for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);i.enumerable&&(i.get?wD(t,r,()=>e[r]):$D(t,r,i.value))}}function Tr(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function K6(t){return Tr(t._zod.def)}function Y6(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function X6(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function q6(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function It(t){return JSON.stringify(t)}function hy(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function fo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function pr(t){if(fo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(fo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Vc(t){return pr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Q6(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function mr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _e(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function S(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function tP(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function $(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function vy(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}function rP(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return lo(o,t,mf(t,e)),_e(t,Tr(r,{shape:o,checks:[]}))}function mf(t,e){let r=Ln(t),i=[];for(let n of Reflect.ownKeys(e)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);e[n]&&i.push(n)}return i}function nP(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(mf(t,e)),a={};return lo(a,t,Reflect.ownKeys(Ln(t)).filter(s=>!o.has(s))),_e(t,Tr(r,{shape:a,checks:[]}))}function iP(t,e){if(!pr(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let n=Ln(t);for(let o of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _e(t,Tr(t._zod.def,{shape:xD(t,e)}))}function xD(t,e){let r={};return lo(r,t,Reflect.ownKeys(Ln(t))),H6(r,e),r}function oP(t,e){if(!pr(e))throw new Error("Invalid input to safeExtend: expected a plain object");return _e(t,Tr(t._zod.def,{shape:xD(t,e)}))}function aP(t,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};lo(r,t,Reflect.ownKeys(Ln(t))),lo(r,e,Reflect.ownKeys(Ln(e)));let i=Tr(t._zod.def,{shape:r,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return _e(t,i)}function sP(t,e,r,i="partial"){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=r?new Set(mf(e,r)):void 0,c={};return lo(c,e,Reflect.ownKeys(Ln(e)),t&&((u,l)=>s&&!s.has(l)?u:new t({type:"optional",innerType:u}))),_e(e,Tr(e._zod.def,{shape:c,checks:[]}))}function cP(t,e,r){let i=r?new Set(mf(e,r)):void 0,n={};return lo(n,e,Reflect.ownKeys(Ln(e)),(o,a)=>i&&!i.has(a)?o:new t({type:"nonoptional",innerType:o})),_e(e,Tr(e._zod.def,{shape:n}))}function St(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function by(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Et(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function Ia(t){return typeof t=="string"?t:t?.message}function hf(t,e,r){var i;for(let n=e;n<t.length;n++)(i=t[n]).schema??(i.schema=r)}function Ct(t,e,r){var i;let n=t.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(i=t).schema??(i.schema=t.inst):t.schema=t.inst);let o=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,a=t.message?t.message:Ia(t.inst?._zod.def?.error?.(t))??Ia(o?.(t))??Ia(e?.error?.(t))??Ia(r.customError?.(t))??Ia(r.localeError?.(t))??"Invalid input",s={};for(let c of Object.keys(t))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(s[c]=t[c]);return s.path??(s.path=[]),s.message=a,e?.reportInput&&(s.input=t.input),s}function Gc(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function po(t){let e=t.length;if(!uP.test(t))return e;let r=e;for(let i=0;i<e-1;i++)(t.charCodeAt(i)&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320&&(r--,i++);return r}function Hc(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function x(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function za(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function lP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ID(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function SD(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function dP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return ID(e+r)}function fP(t){return SD(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pP(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function mP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function _y(t,e){for(let r in e){let i=Object.getOwnPropertyDescriptor(e,r);i.get?Object.defineProperty(t,r,{...i,enumerable:!1}):gP(t,r,i.value)}}function ci(t,e,r,i=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:i,value:r}),r}function Kc(t,e,r){return ci(t,e,r,!1)}function hP(t,e){for(let r in t){let i=t[r];Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){return ci(this,r,i(this))},set(n){ci(this,r,n)}})}return e}function gP(t,e,r){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?r:ci(this,e,r.bind(this))},set(i){ci(this,e,i)}})}function yP(t,e){let r=Object.getPrototypeOf(t);return e in r?void 0:r}function ae(t,e,r){let i=Object.getPrototypeOf(t._zod);if(e in i&&dy!==t._zod){dy=void 0;return}dy=t._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,vP);let n=si;si=!1;try{let o=r(this);return si?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o}),si=si||n,o}catch(o){throw delete this[e],si=si||n,o}},set(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}function bP(t,e,r,i){let n=yP(t,e);n&&Object.defineProperty(n,e,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,e,o),o.value=r(this),Object.defineProperty(this,e,o),o.value},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:i,value:o})}})}function wy(t){let e=()=>t;return e[gf]=!0,e}var fy,_D,pf,gy,eP,Zc,yy,Wc,Jc,uP,py,dy,si,vP,gf,O=m(()=>{ui();fy=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};_D=Symbol("evaluating");pf="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};gy=Da(()=>{if(nt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});eP=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Zc=new Set(["string","number","symbol"]),yy=new Set(["string","number","bigint","boolean","symbol","undefined"]);Wc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Jc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};uP=/[\uD800-\uDBFF]/;py=class{constructor(...e){}};si=!1,vP={configurable:!0,get(){si=!0}};gf="~constantCatch"});function _P(t){let e=DD;if(e){let r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return DD=null,new t}try{return new t}finally{e.stackTraceLimit=r}}}return new t}function v(t,e,r,i){let n={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=n;let a=r,s=a&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(t))return}else{$y.value=new o(p);try{Object.defineProperty(f,"_zod",$y)}finally{$y.value=void 0}}if(f._zod.traits.add(t),e(f,p),s){let y=Object.getPrototypeOf(f),_=f._zod.constr.prototype,D=y;for(;D&&D!==_;)D=Object.getPrototypeOf(D);let I=D??y;s.has(I)||(s.add(I),_y(I,a))}let h=d.prototype;for(let y in h)Object.prototype.hasOwnProperty.call(h,y)&&(y in f||(f[y]=h[y].bind(f)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:t});function d(f){let p=i?.Parent?_P(l):this;c(p,f);let h=p._zod.deferred;if(h){for(let _ of h)_();p._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(t)}),Object.defineProperty(d,"name",{value:t}),d}function Me(t){return t&&Object.assign(nt,t),nt}var kD,xy,$y,DD,Iy,Ft,li,nt,ui=m(()=>{O();xy=Object.freeze({status:"aborted"}),$y={value:void 0,enumerable:!1},DD="captureStackTrace"in Error?Error:null;Iy=Symbol("zod_brand"),Ft=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},li=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(kD=globalThis).__zod_globalConfig??(kD.__zod_globalConfig={});nt=globalThis.__zod_globalConfig});function wP(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,ka,2)),t.message}function $P(t){this._zod.message=t}function IP(t,e,r){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):t[e]=r()),t[e]}function Yc(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?IP(r,n.path[0],()=>[]).push(e(n)):i.push(e(n));return{formErrors:i,fieldErrors:r}}function Xc(t,e=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)r._errors.push(e(a));else{let c=r,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(e(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(e(a)),c=f,u++}}}};return i(t),r}function Ay(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var a;for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0){r.errors.push(e(s));continue}let u=r,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(e(s)),l++}}};return i(t),r}function OD(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function zy(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${OD(i.path)}`);return e.join(`
|
|
16
|
+
]`}concat(...e){let r=this.schema,i=this.data.concat(e.flatMap(({data:n})=>n));return new t(r,i.map(n=>new Be(r,n)))}slice(e,r){let i=this.schema;[e,r]=ec({length:this.numRows},e,r);let n=cd(this.data,this._offsets,e,r);return new t(i,n.map(o=>new Be(i,o)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let r=this.data.map(i=>i.children[e]);if(r.length===0){let{type:i}=this.schema.fields[e],n=U({type:i,length:0,nullCount:0});r.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new P(r)}return null}setChild(e,r){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===e),r)}setChildAt(e,r){let i=this.schema,n=[...this.batches];if(e>-1&&e<this.numCols){r||(r=new P([U({type:new ft,length:this.numRows})]));let o=i.fields.slice(),a=o[e].clone({type:r.type}),s=this.schema.fields.map((c,u)=>this.getChildAt(u));[o[e],s[e]]=[a,r],[i,n]=Gd(i,s)}return new t(i,n)}select(e){let r=this.schema.fields.reduce((i,n,o)=>i.set(n.name,o),new Map);return this.selectAt(e.map(i=>r.get(i)).filter(i=>i>-1))}selectAt(e){let r=this.schema.selectAt(e),i=this.batches.map(n=>n.selectAt(e));return new t(r,i)}assign(e){let r=this.schema.fields,[i,n]=e.schema.fields.reduce((s,c,u)=>{let[l,d]=s,f=r.findIndex(p=>p.name===c.name);return~f?d[f]=u:l.push(u),s},[[],[]]),o=this.schema.assign(e.schema),a=[...r.map((s,c)=>[c,n[c]]).map(([s,c])=>c===void 0?this.getChildAt(s):e.getChildAt(c)),...i.map(s=>e.getChildAt(s))].filter(Boolean);return new t(...Gd(o,a))}};mk=Symbol.toStringTag;et[mk]=(t=>(t.schema=null,t.batches=[],t._offsets=new Uint32Array([0]),t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[hk]=!0,t.isValid=na(nc),t.get=na(He.getVisitFn(g.Struct)),t.set=ud(at.getVisitFn(g.Struct)),t.indexOf=ld(Hi.getVisitFn(g.Struct)),"Table"))(et.prototype);Object.defineProperty(et,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===et&&et.isTable(e)}})});function gk(t,e,r=e.reduce((i,n)=>Math.max(i,n.length),0)){var i;let n=[...t.fields],o=[...e],a=(r+63&-64)>>3;for(let[s,c]of t.fields.entries()){let u=e[s];(!u||u.length!==r)&&(n[s]=c.clone({nullable:!0}),o[s]=(i=u?._changeLengthAndBackfillNullBitmap(r))!==null&&i!==void 0?i:U({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(a)}))}return[t.assign(n),U({type:new ze(n),length:r,children:o})]}function bk(t,e,r=new Map){var i,n;if(((i=t?.length)!==null&&i!==void 0?i:0)>0&&t?.length===e?.length)for(let o=-1,a=t.length;++o<a;){let{type:s}=t[o],c=e[o];for(let u of[c,...((n=c?.dictionary)===null||n===void 0?void 0:n.data)||[]])bk(s.children,u?.children,r);if(z.isDictionary(s)){let{id:u}=s;if(!r.has(u))c?.dictionary&&r.set(u,c.dictionary);else if(r.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var yk,vk,Be,ao,oo=m(()=>{zr();Nc();Ut();$t();ke();ta();Vi();Yt();fd();pd();vk=Symbol.for("apache-arrow/RecordBatch"),Be=class t{static isRecordBatch(e){return e?.[vk]===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=U({nullCount:0,type:new ze(this.schema.fields),children:this.schema.fields.map(r=>U({type:r.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof Q))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=gk(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=e,{fields:i,children:n,length:o}=Object.keys(r).reduce((c,u,l)=>(c.children[l]=r[u],c.length=Math.max(c.length,r[u].length),c.fields[l]=Y.new({name:u,type:r[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),a=new se(i),s=U({type:new ze(i),length:o,children:n,nullCount:0});[this.schema,this.data]=gk(a,s.children,o),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=bk(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return He.visit(this.data,e)}at(e){return this.get(Zi(e,this.numRows))}set(e,r){return at.visit(this.data,e,r)}indexOf(e,r){return Hi.visit(this.data,e,r)}[Symbol.iterator](){return ia.visit(new P([this.data]))}toArray(){return[...this]}concat(...e){return new et(this.schema,[this,...e])}slice(e,r){let[i]=new P([this.data]).slice(e,r).data;return new t(this.schema,i,this._metadata)}getChild(e){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new P([this.data.children[e]]):null}setChild(e,r){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===e),r)}setChildAt(e,r){let i=this.schema,n=this.data;if(e>-1&&e<this.numCols){r||(r=new P([U({type:new ft,length:this.numRows})]));let o=i.fields.slice(),a=n.children.slice(),s=o[e].clone({type:r.type});[o[e],a[e]]=[s,r.data[0]],i=new se(o,new Map(this.schema.metadata)),n=U({type:new ze(o),length:n.length,children:a})}return new t(i,n,this._metadata)}select(e){let r=this.schema.select(e),i=new ze(r.fields),n=[];for(let o of e){let a=this.schema.fields.findIndex(s=>s.name===o);~a&&(n[a]=this.data.children[a])}return new t(r,U({type:i,length:this.numRows,children:n}),this._metadata)}selectAt(e){let r=this.schema.selectAt(e),i=e.map(o=>this.data.children[o]).filter(Boolean),n=U({type:new ze(r.fields),length:this.numRows,children:i});return new t(r,n,this._metadata)}};yk=Symbol.toStringTag;Be[yk]=(t=>(t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[vk]=!0,"RecordBatch"))(Be.prototype);Object.defineProperty(Be,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Be&&Be.isRecordBatch(e)}});ao=class extends Be{constructor(e,r){let i=e.fields.map(o=>U({type:o.type})),n=U({type:new ze(e.fields),length:0,nullCount:0,children:i});super(e,n,r||new Map)}}});function Kd(t,e=0){for(let r=-1,i=ma.length;++r<i;)if(ma[r]!==t[e+r])return!1;return!0}var Pg,Lg,_k,wk,pa,Uc,Pc,Hd,Ug,ma,ha,Eg,$k,Cg=m(()=>{Vt();Qe();de();Xi();Oi();bg();qe();eo();oc();Pg=t=>`Expected ${ue[t]} Message in stream, but was null or length 0.`,Lg=t=>`Header pointer of flatbuffer-encoded ${ue[t]} Message is null or length 0.`,_k=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,wk=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,pa=class{constructor(e){this.source=e instanceof nn?e:new nn(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?Ne:e.value===-1&&(e=this.readMetadataLength()).done?Ne:(e=this.readMetadata(e.value)).done?Ne:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Pg(e));return r.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let r=C(this.source.read(e));if(r.byteLength<e)throw new Error(wk(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(e=!1){let r=ue.Schema,i=this.readMessage(r),n=i?.header();if(e&&!n)throw new Error(Lg(r));return n}readMetadataLength(){let e=this.source.read(Hd),r=e&&new ot(e),i=r?.readInt32(0)||0;return{done:i===0,value:i}}readMetadata(e){let r=this.source.read(e);if(!r)return Ne;if(r.byteLength<e)throw new Error(_k(e,r.byteLength));return{done:!1,value:Lt.decode(r)}}},Uc=class{constructor(e,r){this.source=e instanceof dr?e:kl(e)?new ii(e,r):new dr(e)}[Symbol.asyncIterator](){return this}next(){return T(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?Ne:e.value===-1&&(e=yield this.readMetadataLength()).done?Ne:(e=yield this.readMetadata(e.value)).done?Ne:e})}throw(e){return T(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return T(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return T(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Pg(e));return r.value})}readMessageBody(e){return T(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let r=C(yield this.source.read(e));if(r.byteLength<e)throw new Error(wk(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return T(this,arguments,void 0,function*(e=!1){let r=ue.Schema,i=yield this.readMessage(r),n=i?.header();if(e&&!n)throw new Error(Lg(r));return n})}readMetadataLength(){return T(this,void 0,void 0,function*(){let e=yield this.source.read(Hd),r=e&&new ot(e),i=r?.readInt32(0)||0;return{done:i===0,value:i}})}readMetadata(e){return T(this,void 0,void 0,function*(){let r=yield this.source.read(e);if(!r)return Ne;if(r.byteLength<e)throw new Error(_k(e,r.byteLength));return{done:!1,value:Lt.decode(r)}})}},Pc=class extends pa{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof ic?e:new ic(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Lt.fromJSON(e.schema,ue.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let r=e.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:Lt.fromJSON(r,ue.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let r=e.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Lt.fromJSON(r,ue.RecordBatch)}}return this._body=[],Ne}readMessageBody(e){return r(this._body);function r(i){return(i||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...o.VIEWS&&[o.VIEWS]||[],...o.VARIADIC_DATA_BUFFERS||[],...r(o.children)],[])}}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Pg(e));return r.value}readSchema(){let e=ue.Schema,r=this.readMessage(e),i=r?.header();if(!r||!i)throw new Error(Lg(e));return i}},Hd=4,Ug="ARROW1",ma=new Uint8Array(Ug.length);for(let t=0;t<Ug.length;t+=1)ma[t]=Ug.codePointAt(t);ha=ma.length,Eg=ha+Hd,$k=ha*2+Hd});var Fg,jg,xk,Ik=m(()=>{Ps();Fg=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),i=e.encode(r);return this._isValidCompressed(i)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((r,i)=>e[i]===r)}_hasValidVersion(e){return(e[4]&192)>>6===1}},jg=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),i=e.encode(r);return this._isValidCompressed(i)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((r,i)=>e[i]===r)}},xk={[wt.LZ4_FRAME]:new Fg,[wt.ZSTD]:new jg}});var Mg,ga,Rg=m(()=>{Ps();Ik();Mg=class{constructor(){this.registry={}}set(e,r){if(r?.encode&&typeof r.encode=="function"&&!xk[e].isValidCodecEncode(r))throw new Error(`Encoder for ${wt[e]} is not valid.`);this.registry[e]=r}get(e){var r;return((r=this.registry)===null||r===void 0?void 0:r[e])||null}},ga=new Mg});function Ak(t,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:t.autoDestroy}function*Sk(t){let e=Br.from(t);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function kk(t){return Rt(this,arguments,function*(){let r=yield re(Br.from(t));try{if(!(yield re(r.open({autoDestroy:!1}))).closed)do yield yield re(r);while(!(yield re(r.reset().open())).closed)}finally{yield re(r.cancel())}})}function $4(t){return new Un(new Zg(t))}function x4(t){let e=t.peek(ha+7&-8);return e&&e.byteLength>=4?Kd(e)?new co(new qd(t.read())):new Un(new ya(t)):new Un(new ya((function*(){})()))}function I4(t){return T(this,void 0,void 0,function*(){let e=yield t.peek(ha+7&-8);return e&&e.byteLength>=4?Kd(e)?new co(new qd(yield t.read())):new so(new va(t)):new so(new va((function(){return Rt(this,arguments,function*(){})})()))})}function S4(t){return T(this,void 0,void 0,function*(){let{size:e}=yield t.stat(),r=new ii(t,e);return e>=$k&&Kd(yield r.readAt(0,ha+7&-8))?new Yd(new Vg(r)):new so(new va(r))})}var Br,Un,so,co,Yd,Xd,ya,va,qd,Vg,Zg,Wg=m(()=>{Vt();zr();Ut();ke();Qe();hg();Ts();Xi();eo();bg();j0();oo();oc();Cg();Oi();Rg();Rr();de();Br=class t extends Qi{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let r=this._impl.open(e);return br(r)?r.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return it.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return it.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof t?e:Il(e)?$4(e):kl(e)?S4(e):br(e)?T(this,void 0,void 0,function*(){return yield t.from(yield e)}):Dl(e)||zs(e)||zl(e)||ir(e)?I4(new dr(e)):x4(new nn(e))}static readAll(e){return e instanceof t?e.isSync()?Sk(e):kk(e):Il(e)||ArrayBuffer.isView(e)||_r(e)||Sl(e)?Sk(e):kk(e)}},Un=class extends Br{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Rt(this,arguments,function*(){yield re(yield*jo(vr(this[Symbol.iterator]())))})}},so=class extends Br{constructor(e){super(e),this._impl=e}readAll(){return T(this,void 0,void 0,function*(){var e,r,i,n;let o=new Array;try{for(var a=!0,s=vr(this),c;c=yield s.next(),e=c.done,!e;a=!0){n=c.value,a=!1;let u=n;o.push(u)}}catch(u){r={error:u}}finally{try{!a&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},co=class extends Un{constructor(e){super(e),this._impl=e}},Yd=class extends so{constructor(e){super(e),this._impl=e}},Xd=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,r,i){let n;if(e.compression!=null){let a=ga.get(e.compression.type);if(a?.decode&&typeof a.decode=="function"){let{decommpressedBody:s,buffers:c}=this._decompressBuffers(e,r,a);n=this._loadCompressedVectors(e,s,this.schema.fields),e=new Ye(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else n=this._loadVectors(e,r,this.schema.fields);let o=U({type:new ze(this.schema.fields),length:e.length,children:n});return new Be(this.schema,o,i)}_loadDictionaryBatch(e,r){let{id:i,isDelta:n}=e,{dictionaries:o,schema:a}=this,s=o.get(i),c=a.dictionaries.get(i),u;if(e.data.compression!=null){let l=ga.get(e.data.compression.type);if(l?.decode&&typeof l.decode=="function"){let{decommpressedBody:d,buffers:f}=this._decompressBuffers(e.data,r,l);u=this._loadCompressedVectors(e.data,d,[c]),e=new mt(new Ye(e.data.length,e.data.nodes,f,null,e.data.variadicBufferCounts),i,n)}else throw new Error("Dictionary batch is compressed but codec not found")}else u=this._loadVectors(e.data,r,[c]);return(s&&n?s.concat(new P(u)):new P(u)).memoize()}_loadVectors(e,r,i){return new ca(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(i)}_loadCompressedVectors(e,r,i){return new wd(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(i)}_decompressBuffers(e,r,i){let n=[],o=[],a=0;for(let{offset:s,length:c}of e.buffers){if(c===0){n.push(new Uint8Array(0)),o.push(new je(a,0));continue}let u=new ot(r.subarray(s,s+c)),l=ie(u.readInt64(0)),d=u.bytes().subarray(8),f=l===-1?d:i.decode(d);n.push(f);let p=(a+7&-8)-a;a+=p,o.push(new je(a,f.length)),a+=f.length}return{decommpressedBody:n,buffers:o}}},ya=class extends Xd{constructor(e,r){super(r),this._reader=Il(e)?new Pc(this._handle=e):new pa(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Ak(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Ne}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ne}next(){if(this.closed)return Ne;let e,{_reader:r}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let i=e.header(),n=r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let i=e.header(),n=r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ao(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},va=class extends Xd{constructor(e,r){super(r),this._reader=new Uc(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return T(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return T(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Ak(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return T(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ne})}return(e){return T(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ne})}next(){return T(this,void 0,void 0,function*(){if(this.closed)return Ne;let e,{_reader:r}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let i=e.header(),n=yield r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let i=e.header(),n=yield r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ao(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return T(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},qd=class extends ya{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,r){super(e instanceof ac?e:new ac(e),r)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var r;if(this.closed)return null;this._footer||this.open();let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(i&&this._handle.seek(i.offset)){let n=this._reader.readMessage(ue.RecordBatch);if(n?.isRecordBatch()){let o=n.header(),a=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,a,n.metadata)}}return null}_readDictionaryBatch(e){var r;let i=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(i&&this._handle.seek(i.offset)){let n=this._reader.readMessage(ue.DictionaryBatch);if(n?.isDictionaryBatch()){let o=n.header(),a=this._reader.readMessageBody(n.bodyLength),s=this._loadDictionaryBatch(o,a);this.dictionaries.set(o.id,s)}}}_readFooter(){let{_handle:e}=this,r=e.size-Eg,i=e.readInt32(r),n=e.readAt(r-i,i);return Sn.decode(n)}_readNextMessageAndValidate(e){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(i&&this._handle.seek(i.offset))return this._reader.readMessage(e)}return null}},Vg=class extends va{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...r){let i=typeof r[0]!="number"?r.shift():void 0,n=r[0]instanceof Map?r.shift():void 0;super(e instanceof ii?e:new ii(e,i),n)}isFile(){return!0}isAsync(){return!0}open(e){let r=Object.create(null,{open:{get:()=>super.open}});return T(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,e)})}readRecordBatch(e){return T(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(i&&(yield this._handle.seek(i.offset))){let n=yield this._reader.readMessage(ue.RecordBatch);if(n?.isRecordBatch()){let o=n.header(),a=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,a,n.metadata)}}return null})}_readDictionaryBatch(e){return T(this,void 0,void 0,function*(){var r;let i=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(i&&(yield this._handle.seek(i.offset))){let n=yield this._reader.readMessage(ue.DictionaryBatch);if(n?.isDictionaryBatch()){let o=n.header(),a=yield this._reader.readMessageBody(n.bodyLength),s=this._loadDictionaryBatch(o,a);this.dictionaries.set(o.id,s)}}})}_readFooter(){return T(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let r=e.size-Eg,i=yield e.readInt32(r),n=yield e.readAt(r-i,i);return Sn.decode(n)})}_readNextMessageAndValidate(e){return T(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(e)}return null})}},Zg=class extends ya{constructor(e,r){super(e,r)}_loadVectors(e,r,i){return new _d(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(i)}}});function Qt(t){let e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new je(this._byteLength,e)),this._byteLength+=e,this}function k4(t){var e;let{type:r,length:i,typeIds:n,valueOffsets:o}=t;if(Qt.call(this,n),r.mode===Ae.Sparse)return Jg.call(this,t);if(r.mode===Ae.Dense){if(t.offset<=0)return Qt.call(this,o),Jg.call(this,t);{let a=new Int32Array(i),s=Object.create(null),c=Object.create(null);for(let u,l,d=-1;++d<i;)(u=n[d])!==void 0&&((l=s[u])===void 0&&(l=s[u]=o[d]),a[d]=o[d]-l,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);Qt.call(this,a),this.visitMany(t.children.map((u,l)=>{let d=r.typeIds[l],f=s[d],p=c[d];return u.slice(f,Math.min(i,p))}))}}return this}function D4(t){let e;return t.nullCount>=t.length?Qt.call(this,new Uint8Array(t.length+7>>3)):(e=t.values)instanceof Uint8Array?Qt.call(this,Ji(t.offset,t.length,e)):Qt.call(this,Gi(t.values))}function Pn(t){return Qt.call(this,t.values.subarray(0,t.length*t.stride))}function Qd(t){let{length:e,values:r,valueOffsets:i}=t,n=ie(i[0]),o=ie(i[e]),a=Math.min(o-n,r.byteLength-n);return Qt.call(this,Ol(-n,e+1,i)),Qt.call(this,r.subarray(n,n+a)),this}function zk(t){let{offset:e,length:r,stride:i,values:n,variadicBuffers:o=[]}=t;if(!n)throw new Error("BinaryView data is missing view buffer");let a=e*i,s=a+r*i;Qt.call(this,n.subarray(a,s));for(let c of o)Qt.call(this,c);return this._variadicBufferCounts.push(o.length),this}function ef(t){let{length:e,valueOffsets:r}=t;if(r){let i=ie(r[0]),n=ie(r[e]);return Qt.call(this,Ol(-i,e+1,r)),this.visit(t.children[0].slice(i,n-i))}return this.visit(t.children[0])}function Jg(t){return this.visitMany(t.type.children.map((e,r)=>t.children[r]).filter(Boolean))[0]}var Ue,Ok=m(()=>{Ut();Dr();Qe();oo();qe();ra();Xi();ke();Rr();Ue=class t extends J{static assemble(...e){let r=n=>n.flatMap(o=>Array.isArray(o)?r(o):o instanceof Be?o.data.children:o.data),i=new t;return i.visitMany(r(e)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof P)return this.visitMany(e.data),this;let{type:r}=e;if(!z.isDictionary(r)){let{length:i}=e;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(z.isUnion(r))this.nodes.push(new lr(i,0));else{let{nullCount:n}=e;z.isNull(r)||Qt.call(this,n<=0?new Uint8Array(0):Ji(e.offset,i,e.nullBitmap)),this.nodes.push(new lr(i,n))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Ue.prototype.visitBool=D4;Ue.prototype.visitInt=Pn;Ue.prototype.visitFloat=Pn;Ue.prototype.visitUtf8=Qd;Ue.prototype.visitLargeUtf8=Qd;Ue.prototype.visitUtf8View=zk;Ue.prototype.visitBinary=Qd;Ue.prototype.visitLargeBinary=Qd;Ue.prototype.visitBinaryView=zk;Ue.prototype.visitFixedSizeBinary=Pn;Ue.prototype.visitDate=Pn;Ue.prototype.visitTimestamp=Pn;Ue.prototype.visitTime=Pn;Ue.prototype.visitDecimal=Pn;Ue.prototype.visitList=ef;Ue.prototype.visitLargeList=ef;Ue.prototype.visitStruct=Jg;Ue.prototype.visitUnion=k4;Ue.prototype.visitInterval=Pn;Ue.prototype.visitDuration=Pn;Ue.prototype.visitFixedSizeList=ef;Ue.prototype.visitMap=ef});function Gg(t,e){let r=e;e instanceof et&&(r=e.batches,t.reset(void 0,e.schema));for(let i of r)t.write(i);return t.finish()}function Hg(t,e){return T(this,void 0,void 0,function*(){var r,i,n,o,a,s,c;try{for(r=!0,i=vr(e);n=yield i.next(),o=n.done,!o;r=!0){c=n.value,r=!1;let u=c;t.write(u)}}catch(u){a={error:u}}finally{try{!r&&!o&&(s=i.return)&&(yield s.call(i))}finally{if(a)throw a.error}}return t.finish()})}var uo,Lc,Ec,Bk=m(()=>{Vt();Nc();Cg();Ut();Xi();Xi();hg();Qe();Jd();eo();Ok();qe();oo();oc();Oi();Ps();Rg();de();uo=class extends Qi{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}constructor(e){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new rn,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,_t(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(wt).includes(e.compressionType))this._compression=new qi(e.compressionType);else{let r=Object.values(wt).filter(i=>typeof i=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return br(e)?e.then(r=>this.writeAll(r)):ir(e)?Hg(this,e):Gg(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,r=null){return e===this._sink||e instanceof rn?this._sink=e:(this._sink=new rn,e&&OI(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&BI(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!io(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(e){let r=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof et&&!(r=e.schema))return this.finish()&&void 0;if(e instanceof Be&&!(r=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!io(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}e instanceof Be?e instanceof ao||this._writeRecordBatch(e):e instanceof et?this.writeAll(e.batches):_r(e)&&this.writeAll(e)}_writeMessage(e,r=8){let i=r-1,n=Lt.encode(e),o=n.byteLength,a=this._writeLegacyIpcFormat?4:8,s=o+a+i&~i,c=s-o-a;return e.headerType===ue.RecordBatch?this._recordBatchBlocks.push(new kn(s,e.bodyLength,this._position)):e.headerType===ue.DictionaryBatch&&this._dictionaryBlocks.push(new kn(s,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(s-a)),o>0&&this._write(n),this._writePadding(c)}_write(e){if(this._started){let r=C(e);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(e){return this._writeMessage(Lt.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ma)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:r,nodes:i,bufferRegions:n,buffers:o,variadicBufferCounts:a}=this._assembleRecordBatch(e),s=new Ye(e.numRows,i,n,this._compression,a,e.metadata),c=Lt.from(s,r);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(e){let{byteLength:r,nodes:i,bufferRegions:n,buffers:o,variadicBufferCounts:a}=Ue.assemble(e);return this._compression!=null&&({byteLength:r,bufferRegions:n,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:i,bufferRegions:n,buffers:o,variadicBufferCounts:a}}_compressBodyBuffers(e){let r=ga.get(this._compression.type);if(!r?.encode||typeof r.encode!="function")throw new Error(`Codec for compression type "${wt[this._compression.type]}" has invalid encode method`);let i=0,n=[],o=[];for(let s of e){let c=C(s);if(c.length===0){n.push(new Uint8Array(0),new Uint8Array(0)),o.push(new je(i,0));continue}let u=r.encode(c),l=u.length<c.length,d=l?u:c,f=l?d.length:-1,p=new ot(new Uint8Array(8));p.writeInt64(0,BigInt(f)),n.push(p.bytes(),new Uint8Array(d));let h=(i+7&-8)-i;i+=h;let y=8+d.length;o.push(new je(i,y)),i+=y}let a=(i+7&-8)-i;return i+=a,{byteLength:i,bufferRegions:o,buffers:n}}_writeDictionaryBatch(e,r,i=!1){let{byteLength:n,nodes:o,bufferRegions:a,buffers:s,variadicBufferCounts:c}=this._assembleRecordBatch(new P([e])),u=new Ye(e.length,o,a,this._compression,c),l=new mt(u,r,i),d=Lt.from(l,n);return this._writeMessage(d)._writeBodyBuffers(s)}_writeBodyBuffers(e){let r=this._compression!=null?2:1,i=new Array(r);for(let n=0;n<e.length;n+=r){let o=0;for(let s=-1;++s<r;)i[s]=e[n+s],o+=i[s].byteLength;if(o===0)continue;for(let s of i)this._write(s);let a=(o+7&-8)-o;a>0&&this._writePadding(a)}return this}_writeDictionaries(e){var r,i;for(let[n,o]of e.dictionaries){let a=(r=o?.data)!==null&&r!==void 0?r:[],s=this._seenDictionaries.get(n),c=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!s||s.data[0]!==a[0])for(let[u,l]of a.entries())this._writeDictionaryBatch(l,n,u>0);else if(c<a.length)for(let u of a.slice(c))this._writeDictionaryBatch(u,n,!0);this._seenDictionaries.set(n,o),this._dictionaryDeltaOffsets.set(n,a.length)}return this}},Lc=class t extends uo{static writeAll(e,r){let i=new t(r);return br(e)?e.then(n=>i.writeAll(n)):ir(e)?Hg(i,e):Gg(i,e)}},Ec=class t extends uo{static writeAll(e,r){let i=new t(r);return br(e)?e.then(n=>i.writeAll(n)):ir(e)?Hg(i,e):Gg(i,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,r,i=!1){if(!i&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,r,i)}_writeFooter(e){let r=Sn.encode(new Sn(e,be.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}}});function Tk(t,e){if(ir(t))return z4(t,e);if(_r(t))return A4(t,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function A4(t,e){let r=null,i=e?.type==="bytes"||!1,n=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){o(a,r||(r=t[Symbol.iterator]()))},pull(a){r?o(a,r):a.close()},cancel(){r?.return&&r.return(),r=null}}),Object.assign({highWaterMark:i?n:void 0},e));function o(a,s){let c,u=null,l=a.desiredSize||null;for(;!(u=s.next(i?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=C(u.value))&&(l!=null&&i&&(l=l-c.byteLength+1),u.value=c),a.enqueue(u.value),l!=null&&--l<=0)return;a.close()}}function z4(t,e){let r=null,i=e?.type==="bytes"||!1,n=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){return T(this,void 0,void 0,function*(){yield o(a,r||(r=t[Symbol.asyncIterator]()))})},pull(a){return T(this,void 0,void 0,function*(){r?yield o(a,r):a.close()})},cancel(){return T(this,void 0,void 0,function*(){r?.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:i?n:void 0},e));function o(a,s){return T(this,void 0,void 0,function*(){let c,u=null,l=a.desiredSize||null;for(;!(u=yield s.next(i?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=C(u.value))&&(l!=null&&i&&(l=l-c.byteLength+1),u.value=c),a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}var Nk=m(()=>{Vt();qe();Oi()});function Lk(t){return new Kg(t)}var Kg,Uk,Pk,Ek=m(()=>{Vt();zg();Kg=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:i,["queueingStrategy"]:n="count"}=e,o=DI(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=ro(o),this._getSize=n!=="bytes"?Uk:Pk;let{["highWaterMark"]:a=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:s=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},i);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:a,size:n!=="bytes"?Uk:Pk}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:s,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-r}_maybeFlush(e,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(e,r){this._bufferedSize=0,this._controller=null,r==null?e.close():e.enqueue(r)}},Uk=t=>{var e;return(e=t?.length)!==null&&e!==void 0?e:0},Pk=t=>{var e;return(e=t?.byteLength)!==null&&e!==void 0?e:0}});function tf(t,e){let r=new rn,i=null,n=new ReadableStream({cancel(){return T(this,void 0,void 0,function*(){yield r.close()})},start(s){return T(this,void 0,void 0,function*(){yield a(s,i||(i=yield o()))})},pull(s){return T(this,void 0,void 0,function*(){i?yield a(s,i):s.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},t)),readable:n};function o(){return T(this,void 0,void 0,function*(){return yield(yield Br.from(r)).open(e)})}function a(s,c){return T(this,void 0,void 0,function*(){let u=s.desiredSize,l=null;for(;!(l=yield c.next()).done;)if(s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}var Ck=m(()=>{Vt();eo();Wg()});function rf(t,e){let r=new this(t),i=new dr(r),n=new ReadableStream({cancel(){return T(this,void 0,void 0,function*(){yield i.cancel()})},pull(a){return T(this,void 0,void 0,function*(){yield o(a)})},start(a){return T(this,void 0,void 0,function*(){yield o(a)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(r,t),readable:n};function o(a){return T(this,void 0,void 0,function*(){let s=null,c=a.desiredSize;for(;s=yield i.read(c||null);)if(a.enqueue(s),c!=null&&(c-=s.byteLength)<=0)return;a.close()})}}var Fk=m(()=>{Vt();eo()});var Yg={};Ie(Yg,{isArrowData:()=>Vk,isArrowDataType:()=>Rk,isArrowField:()=>Mk,isArrowRecordBatch:()=>Wk,isArrowSchema:()=>jk,isArrowTable:()=>Jk,isArrowVector:()=>Zk});function jk(t){return se.isSchema(t)}function Mk(t){return Y.isField(t)}function Rk(t){return z.isDataType(t)}function Vk(t){return Q.isData(t)}function Zk(t){return P.isVector(t)}function Wk(t){return Be.isRecordBatch(t)}function Jk(t){return et.isTable(t)}var Gk=m(()=>{$t();ke();zr();Ut();oo();Nc()});var X4,Hk=m(()=>{zr();ke();Nc();Ut();$t();Zh();$g();ra();Qs();qe();ta();Hs();kg();Gk();Jd();X4=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vh),wg),sg),Wh),sh),ag),Fh),Sg),Yg),{compareSchemas:io,compareFields:dk,compareTypes:fk})});var Kk=m(()=>{Ts();Pe();Wg();Bk();Nk();Ek();Ck();Fk();Hk();it.toDOMStream=Tk;Oe.throughDOM=Lk;Br.throughDOM=tf;co.throughDOM=tf;Un.throughDOM=tf;uo.throughDOM=rf;Ec.throughDOM=rf;Lc.throughDOM=rf});function nf(t){return(t/255-.5)/Xg}function of(t){return Math.min(Math.max(t/255,0),1)}function an(t,e,r,i){let n=Math.hypot(t,e,r,i);return!Number.isFinite(n)||n<=Number.EPSILON?[1,0,0,0]:[t/n,e/n,r/n,i/n]}function Cc(t){return(t-128)/128}function Fc(t){let e=t&32768?-1:1,r=t>>10&31,i=t&1023;return r===0?e*Math.pow(2,-14)*(i/1024):r===31?i?Number.NaN:e*Number.POSITIVE_INFINITY:e*Math.pow(2,r-15)*(1+i/1024)}var Xg,ba=m(()=>{"use strict";Xg=.28209479177387814});function sn(t){let e={},r=[],i=[];Xk(e,r,i,"POSITION",e6(t.positions,3),{type:"fixed-size-list",listSize:3,children:[{name:"value",type:"float32"}]});let n=t6(t);_a(e,r,i,"f_dc_0",n[0],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"0","loaders_gl.gaussian_splats.encoding":"coefficient"}),_a(e,r,i,"f_dc_1",n[1],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"1","loaders_gl.gaussian_splats.encoding":"coefficient"}),_a(e,r,i,"f_dc_2",n[2],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"2","loaders_gl.gaussian_splats.encoding":"coefficient"}),_a(e,r,i,"opacity",t.opacities,{"loaders_gl.gaussian_splats.semantic":"opacity","loaders_gl.gaussian_splats.encoding":"linear"}),Yk(e,r,i,"scale",t.scales,3,{"loaders_gl.gaussian_splats.semantic":"scale","loaders_gl.gaussian_splats.encoding":"linear"}),Yk(e,r,i,"rot",t.rotations,4,{"loaders_gl.gaussian_splats.semantic":"rotation","loaders_gl.gaussian_splats.encoding":"quaternion"}),t.sphericalHarmonics&&t.sphericalHarmonicsComponentCount&&Q4(e,r,i,t.sphericalHarmonics,t.sphericalHarmonicsComponentCount);let o=new Map([["loaders_gl.semantic_type","gaussian-splats"],["loaders_gl.gaussian_splats.version","1"],["loaders_gl.gaussian_splats.source_format",t.format],["topology","point-list"],["mode","0"]]),a=new se(r,o);return{shape:"arrow-table",schema:{fields:i,metadata:Object.fromEntries(o)},data:new et(a,e),topology:"point-list",loaderData:t.loaderData}}function Yk(t,e,r,i,n,o,a){for(let s=0;s<o;s++){let c=new Float32Array(n.length/o);for(let u=0;u<c.length;u++)c[u]=n[u*o+s];_a(t,e,r,`${i}_${s}`,c,{...a,"loaders_gl.gaussian_splats.component":String(s)})}}function Q4(t,e,r,i,n){for(let o=0;o<n;o++){let a=new Float32Array(i.length/n);for(let s=0;s<a.length;s++)a[s]=i[s*n+o];_a(t,e,r,`f_rest_${o}`,a,{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_rest","loaders_gl.gaussian_splats.component":String(o),"loaders_gl.gaussian_splats.encoding":"coefficient"})}}function _a(t,e,r,i,n,o){Xk(t,e,r,i,Ki(n),"float32",o)}function Xk(t,e,r,i,n,o,a={}){t[i]=n,e.push(new Y(i,n.type,!1,new Map(Object.entries(a)))),r.push({name:i,type:o,nullable:!1,metadata:a})}function e6(t,e){let i=Ki(t).data[0],n=new Tt(e,new Y("value",i.type,!1)),o=new Q(n,0,t.length/e,0,{},[i]);return new P([o])}function t6(t){let e=t.splatCount,r=new Float32Array(e),i=new Float32Array(e),n=new Float32Array(e);for(let o=0;o<e;o++)t.sphericalHarmonicDcs?(r[o]=t.sphericalHarmonicDcs[o*3+0],i[o]=t.sphericalHarmonicDcs[o*3+1],n[o]=t.sphericalHarmonicDcs[o*3+2]):(r[o]=nf(t.colors[o*3+0]),i[o]=nf(t.colors[o*3+1]),n[o]=nf(t.colors[o*3+2]));return[r,i,n]}var wa=m(()=>{"use strict";Kk();ba()});async function af(t,e){return sn(await Qg(t,e))}async function Qg(t,e){let r=i6(t);if(r===0)return await o6(t,e);if(r!==tD)throw new Error(`SPZLoader: version ${r} is not supported.`);let i=s6(t),n=c6(t,i,u6(i)),o=n.map(c=>t.slice(c.compressedOffset,c.compressedOffset+c.compressedSize)),a=new As({modules:e?.modules}),s=await Promise.all(o.map((c,u)=>a.decompress(c,n[u].uncompressedSize)));return l6(s,n),ey(d6(i,s,t),e?.splats?.sourceCoordinateSystem??"RUB",e?.splats?.targetCoordinateSystem??e?.splats?.sourceCoordinateSystem??"RUB")}function i6(t){if(t.byteLength<8)throw new Error("SPZLoader: file must contain at least an 8-byte header.");let e=new Uint8Array(t);if(e[0]===31&&e[1]===139)return 0;if(t.byteLength<$a)throw new Error("SPZLoader: file must contain a 32-byte header.");return new DataView(t).getUint32(4,!0)}async function o6(t,e){let r=await new Ds({modules:e?.modules,useNative:!0}).decompress(t);if(r.byteLength<16)throw new Error("SPZLoader: legacy payload must contain a 16-byte header.");let i=new DataView(r),n={magic:i.getUint32(0,!0),version:i.getUint32(4,!0),numPoints:i.getUint32(8,!0),shDegree:i.getUint8(12),fractionalBits:i.getUint8(13),flags:i.getUint8(14)};if(n.magic!==eD)throw new Error("SPZLoader: NGSP magic header not found.");if(n.version!==2&&n.version!==3)throw new Error(`SPZLoader: version ${n.version} is not supported.`);if(i.getUint8(15)!==0)throw new Error("SPZLoader: legacy header reserved byte must be zero.");if(n.shDegree>3)throw new Error(`SPZLoader: spherical harmonics degree ${n.shDegree} is not supported.`);let o=n.numPoints,a=ty(n.shDegree),s=o*9,c=o,u=o*3,l=o*3,d=o*(n.version===2?3:4),f=o*a,p=s+c+u+l+d+f;if(r.byteLength-16!==p)throw new Error(`SPZLoader: legacy payload has ${r.byteLength-16} bytes, expected ${p}.`);let h=16,y=new Float32Array(o*3),_=new Float32Array(o),D=new Uint8Array(o*3),I=new Float32Array(o*3),A=new Float32Array(o*4),Z=new Float32Array(o*3),L=a?new Float32Array(o*a):void 0;return nD(new Uint8Array(r,h,s),y,n.fractionalBits),h+=s,sD(new Uint8Array(r,h,c),_),h+=c,aD(new Uint8Array(r,h,u),D,Z),h+=u,iD(new Uint8Array(r,h,l),I),h+=l,n.version===2?a6(new Uint8Array(r,h,d),A):oD(new Uint8Array(r,h,d),A),h+=d,L&&cD(new Uint8Array(r,h,f),L),ey({format:"spz",splatCount:o,positions:y,scales:I,rotations:A,colors:D,sphericalHarmonicDcs:Z,opacities:_,sphericalHarmonics:L,sphericalHarmonicsComponentCount:a||void 0,loaderData:{...n,legacy:!0}},e?.splats?.sourceCoordinateSystem??"RUB",e?.splats?.targetCoordinateSystem??e?.splats?.sourceCoordinateSystem??"RUB")}function a6(t,e){for(let r=0;r<e.length/4;r++){let i=r*3,n=qg(t[i])/127,o=qg(t[i+1])/127,a=qg(t[i+2])/127,s=Math.sqrt(Math.max(0,1-n*n-o*o-a*a)),c=an(s,n,o,a);e.set(c,r*4)}}function qg(t){return t>127?t-256:t}function ey(t,e,r){if(e===r||e==="UNSPECIFIED"||r==="UNSPECIFIED")return t;if(e==="RUB"&&r==="LUF"){for(let i=0;i<t.positions.length;i+=3)t.positions[i]=-t.positions[i],t.positions[i+2]=-t.positions[i+2];for(let i=0;i<t.rotations.length;i+=4)t.rotations[i+1]=-t.rotations[i+1],t.rotations[i+3]=-t.rotations[i+3];return t}if(e==="LUF"&&r==="RUB")return ey(t,"RUB","LUF");throw new Error(`SPZLoader: coordinate conversion ${e} -> ${r} is not supported.`)}function s6(t){if(t.byteLength<$a)throw new Error(`SPZLoader: file must contain a ${$a}-byte header.`);let e=new DataView(t),r={magic:e.getUint32(0,!0),version:e.getUint32(4,!0),numPoints:e.getUint32(8,!0),shDegree:e.getUint8(12),fractionalBits:e.getUint8(13),flags:e.getUint8(14),numStreams:e.getUint8(15),tocByteOffset:e.getUint32(16,!0)};if(r.magic!==eD)throw new Error("SPZLoader: NGSP magic header not found.");if(r.version!==tD)throw new Error(`SPZLoader: version ${r.version} is not supported.`);if(r.shDegree>4)throw new Error(`SPZLoader: spherical harmonics degree ${r.shDegree} is not supported.`);if(r.tocByteOffset<$a||r.tocByteOffset>t.byteLength)throw new Error("SPZLoader: invalid table of contents byte offset.");return r}function c6(t,e,r){if(e.numStreams!==r.length)throw new Error(`SPZLoader: expected ${r.length} streams, found ${e.numStreams}.`);let i=e.numStreams*16,n=e.tocByteOffset+i;if(n>t.byteLength)throw new Error("SPZLoader: table of contents exceeds file byte length.");let o=new DataView(t),a=n,s=[];for(let c=0;c<e.numStreams;c++){let u=e.tocByteOffset+c*16,l=Qk(o,u),d=Qk(o,u+8),f=r[c];if(d!==f)throw new Error(`SPZLoader: stream ${c} has ${d} uncompressed bytes, expected ${f}.`);if(a+l>t.byteLength)throw new Error(`SPZLoader: stream ${c} exceeds file byte length.`);s.push({compressedSize:l,uncompressedSize:d,compressedOffset:a}),a+=l}if(a!==t.byteLength)throw new Error("SPZLoader: compressed stream byte lengths do not match file byte length.");return s}function Qk(t,e){let r=t.getBigUint64(e,!0);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("SPZLoader: stream byte length exceeds Number.MAX_SAFE_INTEGER.");return Number(r)}function u6(t){return[t.numPoints*9,t.numPoints,t.numPoints*3,t.numPoints*3,t.numPoints*4,t.numPoints*ty(t.shDegree)].filter(e=>e>0)}function l6(t,e){for(let r=0;r<t.length;r++)if(t[r].byteLength!==e[r].uncompressedSize)throw new Error(`SPZLoader: decompressed stream ${r} has unexpected byte length.`)}function d6(t,e,r){let i=t.numPoints,n=new Float32Array(i*3),o=new Float32Array(i*3),a=new Float32Array(i*4),s=new Uint8Array(i*3),c=new Float32Array(i*3),u=new Float32Array(i),l=ty(t.shDegree),d=l?new Float32Array(i*l):void 0,[f,p,h,y,_,D]=e.map(I=>new Uint8Array(I));return nD(f,n,t.fractionalBits),iD(y,o),oD(_,a),aD(h,s,c),sD(p,u),d&&D&&cD(D,d),{format:"spz",splatCount:i,positions:n,scales:o,rotations:a,colors:s,sphericalHarmonicDcs:c,opacities:u,sphericalHarmonics:d,sphericalHarmonicsComponentCount:l,loaderData:{format:"spz",...t,antialiased:!!(t.flags&1),extensionByteLength:uD(t),extensionBytes:m6(r,t)}}}function nD(t,e,r){let i=1/2**r;for(let n=0;n<e.length;n++){let o=n*3,a=t[o]|t[o+1]<<8|t[o+2]<<16;a|=a&8388608?4278190080:0,e[n]=a*i}}function iD(t,e){for(let r=0;r<e.length;r++)e[r]=Math.exp(t[r]/16-10)}function oD(t,e){for(let r=0;r<e.length/4;r++){let i=r*4,n=t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24,o=f6(n>>>0),[a,s,c,u]=an(o[3],o[0],o[1],o[2]),l=r*4;e[l+0]=a,e[l+1]=s,e[l+2]=c,e[l+3]=u}}function f6(t){let e=[0,0,0,0],r=t>>>30,i=t,n=0;for(let o=3;o>=0;o--)if(o!==r){let a=i&qk,s=i>>>9&1;i>>>=10;let c=n6*a/qk;s&&(c=-c),e[o]=c,n+=c*c}return e[r]=Math.sqrt(Math.max(0,1-n)),e}function aD(t,e,r){for(let i=0;i<e.length;i++)r[i]=(t[i]/255-.5)/rD,e[i]=p6(r[i])}function sD(t,e){for(let r=0;r<e.length;r++)e[r]=t[r]/255}function cD(t,e){for(let r=0;r<e.length;r++)e[r]=(t[r]-128)/128}function p6(t){return Math.min(Math.max(Math.round((t*rD+.5)*255),0),255)}function ty(t){switch(t){case 0:return 0;case 1:return 9;case 2:return 24;case 3:return 45;case 4:return 72;default:throw new Error(`SPZLoader: spherical harmonics degree ${t} is not supported.`)}}function uD(t){return t.flags&r6?t.tocByteOffset-$a:0}function m6(t,e){return uD(e)?new Uint8Array(t.slice($a,e.tocByteOffset)):void 0}var $a,eD,tD,r6,rD,n6,qk,ry=m(()=>{"use strict";SI();wa();ba();$a=32,eD=1347635022,tD=4,r6=2,rD=.15,n6=Math.SQRT1_2,qk=511});function ny(t){return sn(h6(t))}function h6(t){if(t.byteLength%jc!==0)throw new Error(`SPLATLoader: byte length must be a multiple of ${jc}.`);let e=t.byteLength/jc,r=new DataView(t),i=new Float32Array(e*3),n=new Float32Array(e*3),o=new Float32Array(e*4),a=new Uint8Array(e*3),s=new Float32Array(e);for(let c=0;c<e;c++){let u=c*jc,l=c*3,d=c*4;i[l+0]=r.getFloat32(u+0,!0),i[l+1]=r.getFloat32(u+4,!0),i[l+2]=r.getFloat32(u+8,!0),n[l+0]=r.getFloat32(u+12,!0),n[l+1]=r.getFloat32(u+16,!0),n[l+2]=r.getFloat32(u+20,!0),a[l+0]=r.getUint8(u+24),a[l+1]=r.getUint8(u+25),a[l+2]=r.getUint8(u+26),s[c]=of(r.getUint8(u+27));let[f,p,h,y]=an(Cc(r.getUint8(u+28)),Cc(r.getUint8(u+29)),Cc(r.getUint8(u+30)),Cc(r.getUint8(u+31)));o[d+0]=f,o[d+1]=p,o[d+2]=h,o[d+3]=y}return{format:"splat",splatCount:e,positions:i,scales:n,rotations:o,colors:a,opacities:s,loaderData:{format:"splat",splatCount:e,rowByteLength:jc}}}var jc,lD=m(()=>{"use strict";wa();ba();jc=32});var dD={};Ie(dD,{SPLATLoaderWithParser:()=>y6});var YG,g6,y6,fD=m(()=>{"use strict";lD();iy();({preload:YG,...g6}=sf),y6={...g6,parse:async t=>ny(t),parseSync:t=>ny(t)}});async function b6(){let{SPLATLoaderWithParser:t}=await Promise.resolve().then(()=>(fD(),dD));return t}var v6,sf,iy=m(()=>{"use strict";$i();v6="5.0.0-alpha.9";sf={dataType:null,batchType:null,...el,version:v6,options:{splats:{shape:"arrow-table"}},preload:b6}});function sy(t){return sn($6(t))}function $6(t){if(t.byteLength<xa)throw new Error(`KSPLATLoader: file must contain a ${xa}-byte header.`);let e=I6(t);S6(e);let r=k6(t,e),i=T6(e,r),n=Math.max(0,...r.slice(0,uf(e)).map(f=>cy(f.sphericalHarmonicsDegree))),o=new Float32Array(i*3),a=new Float32Array(i*3),s=new Float32Array(i*4),c=new Uint8Array(i*3),u=new Float32Array(i),l=n?new Float32Array(i*n):void 0,d=0;for(let f of r.slice(0,uf(e))){N6(t,f);for(let p=0;p<f.splatCount&&d<i;p++)x6(t,e,f,p,d,o,a,s,c,u,l,n),d++}return{format:"ksplat",splatCount:i,positions:o,scales:a,rotations:s,colors:c,opacities:u,sphericalHarmonics:l,sphericalHarmonicsComponentCount:n,loaderData:{format:"ksplat",...e,sections:r.slice(0,uf(e)).map(f=>({splatCount:f.splatCount,maxSplatCount:f.maxSplatCount,sphericalHarmonicsDegree:f.sphericalHarmonicsDegree}))}}}function x6(t,e,r,i,n,o,a,s,c,u,l,d){let f=ay[e.compressionLevel],p=r.dataBase+r.bytesPerSplat*i,h=n*3,y=n*4,_=A6(t,r,i);o[h+0]=oy(t,p,0,e,r,_[0]),o[h+1]=oy(t,p,1,e,r,_[1]),o[h+2]=oy(t,p,2,e,r,_[2]),a[h+0]=ai(t,p+f.scaleOffsetBytes,0,e.compressionLevel),a[h+1]=ai(t,p+f.scaleOffsetBytes,1,e.compressionLevel),a[h+2]=ai(t,p+f.scaleOffsetBytes,2,e.compressionLevel);let[D,I,A,Z]=an(ai(t,p+f.scaleOffsetBytes,3,e.compressionLevel),ai(t,p+f.scaleOffsetBytes,4,e.compressionLevel),ai(t,p+f.scaleOffsetBytes,5,e.compressionLevel),ai(t,p+f.scaleOffsetBytes,6,e.compressionLevel));s[y+0]=D,s[y+1]=I,s[y+2]=A,s[y+3]=Z;let L=p+f.colorOffsetBytes,k=new Uint8Array(t,L,4);c[h+0]=k[0],c[h+1]=k[1],c[h+2]=k[2],u[n]=of(k[3]),l&&d&&O6(t,p+f.sphericalHarmonicsOffsetBytes,e,r,n,l,d)}function I6(t){let e=new DataView(t,0,xa),r=e.getUint16(20,!0);if(r!==0&&r!==1&&r!==2)throw new Error(`KSPLATLoader: unsupported compression level ${r}.`);return{versionMajor:e.getUint8(0),versionMinor:e.getUint8(1),maxSectionCount:e.getUint32(4,!0),sectionCount:e.getUint32(8,!0),maxSplatCount:e.getUint32(12,!0),splatCount:e.getUint32(16,!0),compressionLevel:r,minSphericalHarmonicsCoeff:e.getFloat32(36,!0)||-mD,maxSphericalHarmonicsCoeff:e.getFloat32(40,!0)||mD}}function S6(t){if(!(t.versionMajor===pD?t.versionMinor>=_6:t.versionMajor>pD))throw new Error(`KSPLATLoader: version ${t.versionMajor}.${t.versionMinor} is not supported.`)}function k6(t,e){if(t.byteLength<xa+e.maxSectionCount*cf)throw new Error("KSPLATLoader: file does not contain all section headers.");let r=[],i=xa+e.maxSectionCount*cf,n=0;for(let o=0;o<e.maxSectionCount;o++){let a=xa+o*cf,s=new DataView(t,a,cf),c=s.getUint32(0,!0),u=s.getUint32(4,!0),l=s.getUint32(8,!0),d=s.getUint32(12,!0),f=s.getFloat32(16,!0),p=s.getUint16(20,!0),h=s.getUint32(24,!0)||ay[e.compressionLevel].scaleRange,y=s.getUint32(32,!0),_=s.getUint32(36,!0),D=s.getUint16(40,!0),I=B6(e.compressionLevel,D),A=_*4,Z=p*d+A,L=I*u+Z;r.push({bytesPerSplat:I,splatCountOffset:n,splatCount:c||u,maxSplatCount:u,bucketSize:l,bucketCount:d,bucketStorageSizeBytes:p,bucketsStorageSizeBytes:Z,compressionScaleRange:h,compressionScaleFactor:f/2/h,base:i,bucketsBase:i+A,dataBase:i+Z,fullBucketCount:y,partiallyFilledBucketCount:_,sphericalHarmonicsDegree:D}),i+=L,n+=u}return r}function oy(t,e,r,i,n,o){let a=D6(t,e,r,i.compressionLevel);return i.compressionLevel>=1?(a-n.compressionScaleRange)*n.compressionScaleFactor+o:a}function D6(t,e,r,i){let n=new DataView(t);return i===0?n.getFloat32(e+r*4,!0):n.getUint16(e+r*2,!0)}function A6(t,e,r){if(!e.bucketCount)return[0,0,0];let i=z6(t,e,r),n=e.bucketsBase+i*e.bucketStorageSizeBytes,o=new DataView(t,n,12);return[o.getFloat32(0,!0),o.getFloat32(4,!0),o.getFloat32(8,!0)]}function z6(t,e,r){let i=e.fullBucketCount*e.bucketSize;if(r<i)return Math.floor(r/e.bucketSize);let n=i,o=e.fullBucketCount;for(let a=0;a<e.partiallyFilledBucketCount;a++){let s=new DataView(t,e.base+a*4,4).getUint32(0,!0);if(r<n+s)return o;n+=s,o++}return Math.max(o-1,0)}function O6(t,e,r,i,n,o,a){let s=cy(i.sphericalHarmonicsDegree),c=n*a;for(let u=0;u<s;u++)o[c+u]=ai(t,e,u,r.compressionLevel,!0,r.minSphericalHarmonicsCoeff,r.maxSphericalHarmonicsCoeff)}function ai(t,e,r,i,n=!1,o=0,a=0){let s=new DataView(t);return i===0?s.getFloat32(e+r*4,!0):i===1||!n?Fc(s.getUint16(e+r*2,!0)):s.getUint8(e+r)/255*(a-o)+o}function B6(t,e){let r=ay[t];return r.bytesPerCenter+r.bytesPerScale+r.bytesPerRotation+r.bytesPerColor+r.bytesPerSphericalHarmonicsComponent*cy(e)}function cy(t){switch(t){case 0:return 0;case 1:return 9;case 2:return 24;case 3:return 45;default:throw new Error(`KSPLATLoader: unsupported spherical harmonics degree ${t}.`)}}function uf(t){return t.sectionCount||t.maxSectionCount}function T6(t,e){let r=e.slice(0,uf(t)).reduce((i,n)=>i+n.splatCount,0);return t.splatCount?Math.min(t.splatCount,r||t.splatCount):r}function N6(t,e){if(e.dataBase+e.bytesPerSplat*e.splatCount>t.byteLength)throw new Error("KSPLATLoader: section data extends beyond the file length.")}var pD,_6,xa,cf,w6,mD,ay,hD=m(()=>{"use strict";wa();ba();pD=0,_6=1,xa=4096,cf=1024,w6=3,mD=w6/2,ay={0:{bytesPerCenter:12,bytesPerScale:12,bytesPerRotation:16,bytesPerColor:4,scaleOffsetBytes:12,colorOffsetBytes:40,sphericalHarmonicsOffsetBytes:44,scaleRange:1,bytesPerSphericalHarmonicsComponent:4},1:{bytesPerCenter:6,bytesPerScale:6,bytesPerRotation:8,bytesPerColor:4,scaleOffsetBytes:6,colorOffsetBytes:20,sphericalHarmonicsOffsetBytes:24,scaleRange:32767,bytesPerSphericalHarmonicsComponent:2},2:{bytesPerCenter:6,bytesPerScale:6,bytesPerRotation:8,bytesPerColor:4,scaleOffsetBytes:6,colorOffsetBytes:20,sphericalHarmonicsOffsetBytes:24,scaleRange:32767,bytesPerSphericalHarmonicsComponent:1}}});var gD={};Ie(gD,{KSPLATLoaderWithParser:()=>P6});var iH,U6,P6,yD=m(()=>{"use strict";hD();uy();({preload:iH,...U6}=lf),P6={...U6,parse:async t=>sy(t),parseSync:t=>sy(t)}});async function E6(){let{KSPLATLoaderWithParser:t}=await Promise.resolve().then(()=>(yD(),gD));return t}var L6,lf,uy=m(()=>{"use strict";$i();L6="5.0.0-alpha.9";lf={dataType:null,batchType:null,...tl,version:L6,options:{splats:{shape:"arrow-table"}},preload:E6}});var vD={};Ie(vD,{SPZLoaderWithParser:()=>F6});var uH,C6,F6,bD=m(()=>{"use strict";ry();ly();({preload:uH,...C6}=df),F6={...C6,parse:async(t,e)=>af(t,e)}});async function M6(){let{SPZLoaderWithParser:t}=await Promise.resolve().then(()=>(bD(),vD));return t}var j6,df,ly=m(()=>{"use strict";$i();j6="5.0.0-alpha.9";df={dataType:null,batchType:null,...rl,version:j6,options:{splats:{shape:"arrow-table"}},preload:M6}});var w={};Ie(w,{BIGINT_FORMAT_RANGES:()=>Jc,CONSTANT_CATCH:()=>gf,Class:()=>py,NUMBER_FORMAT_RANGES:()=>Wc,aborted:()=>St,allowsEval:()=>gy,assert:()=>J6,assertEqual:()=>R6,assertIs:()=>Z6,assertNever:()=>W6,assertNotEqual:()=>V6,assignProp:()=>st,attachSchema:()=>hf,base64ToUint8Array:()=>ID,base64urlToUint8Array:()=>dP,cached:()=>Da,captureStackTrace:()=>pf,cleanEnum:()=>lP,cleanRegex:()=>En,clone:()=>_e,cloneDef:()=>K6,codePointLength:()=>po,constantCatch:()=>wy,createTransparentProxy:()=>tP,defineLazy:()=>my,defineLazyInternal:()=>ae,derived:()=>hP,esc:()=>It,escapeRegex:()=>mr,explicitlyAborted:()=>by,extend:()=>iP,finalizeIssue:()=>Ct,floatSafeRemainder:()=>Rc,getElementAtPath:()=>Y6,getEnumValues:()=>Sa,getLengthableOrigin:()=>Hc,getParsedType:()=>eP,getSizableOrigin:()=>Gc,hexToUint8Array:()=>pP,hide:()=>Kc,installLazyProp:()=>bP,isObject:()=>fo,isPlainObject:()=>pr,issue:()=>za,joinValues:()=>b,jsonStringifyReplacer:()=>ka,members:()=>_y,merge:()=>aP,mergeDefs:()=>Tr,normalizeParams:()=>S,nullish:()=>ff,numKeys:()=>Q6,objectClone:()=>G6,omit:()=>nP,optionalKeys:()=>vy,own:()=>ci,parsedType:()=>x,partial:()=>sP,pick:()=>rP,prefixIssues:()=>Et,primitiveTypes:()=>yy,promiseAllObject:()=>X6,propertyKeyTypes:()=>Zc,randomString:()=>q6,rawShape:()=>Aa,required:()=>cP,safeExtend:()=>oP,shallowClone:()=>Vc,slugify:()=>hy,stringifyPrimitive:()=>$,toZod:()=>Mc,uint8ArrayToBase64:()=>SD,uint8ArrayToBase64url:()=>fP,uint8ArrayToHex:()=>mP,unwrapMessage:()=>Ia});function R6(t){return t}function V6(t){return t}function Mc(){return t=>t}function Z6(t){}function W6(t){throw new Error("Unexpected value in exhaustive check")}function J6(t){}function Sa(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function b(t,e="|"){return t.map(r=>$(r)).join(e)}function ka(t,e){return typeof e=="bigint"?e.toString():e}function Da(t){return new fy(t)}function ff(t){return t==null}function En(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Rc(t,e){let r=t/e,i=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}function my(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==_D)return i===void 0&&(i=_D,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function G6(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function st(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Aa(t){let e=Object.getOwnPropertyDescriptor(t,"shape");return e?.get?e.get.raw:e?.value}function Ln(t){return Aa(t._zod.def)??t._zod.def.shape}function wD(t,e,r){Object.defineProperty(t,e,{get(){let i=r();return st(this,e,i),i},enumerable:!0,configurable:!0})}function $D(t,e,r){e in t?st(t,e,r):t[e]=r}function lo(t,e,r,i){let n=Ln(e);for(let o of r){let a=Object.getOwnPropertyDescriptor(n,o);a.enumerable&&(a.get?wD(t,o,()=>{let s=e._zod.def.shape[o];return i?i(s,o):s}):$D(t,o,i?i(a.value,o):a.value))}}function H6(t,e){for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);i.enumerable&&(i.get?wD(t,r,()=>e[r]):$D(t,r,i.value))}}function Tr(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function K6(t){return Tr(t._zod.def)}function Y6(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function X6(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function q6(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function It(t){return JSON.stringify(t)}function hy(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function fo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function pr(t){if(fo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(fo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Vc(t){return pr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Q6(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function mr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _e(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function S(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function tP(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function $(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function vy(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}function rP(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return lo(o,t,mf(t,e)),_e(t,Tr(r,{shape:o,checks:[]}))}function mf(t,e){let r=Ln(t),i=[];for(let n of Reflect.ownKeys(e)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);e[n]&&i.push(n)}return i}function nP(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(mf(t,e)),a={};return lo(a,t,Reflect.ownKeys(Ln(t)).filter(s=>!o.has(s))),_e(t,Tr(r,{shape:a,checks:[]}))}function iP(t,e){if(!pr(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let n=Ln(t);for(let o of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _e(t,Tr(t._zod.def,{shape:xD(t,e)}))}function xD(t,e){let r={};return lo(r,t,Reflect.ownKeys(Ln(t))),H6(r,e),r}function oP(t,e){if(!pr(e))throw new Error("Invalid input to safeExtend: expected a plain object");return _e(t,Tr(t._zod.def,{shape:xD(t,e)}))}function aP(t,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};lo(r,t,Reflect.ownKeys(Ln(t))),lo(r,e,Reflect.ownKeys(Ln(e)));let i=Tr(t._zod.def,{shape:r,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return _e(t,i)}function sP(t,e,r,i="partial"){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=r?new Set(mf(e,r)):void 0,c={};return lo(c,e,Reflect.ownKeys(Ln(e)),t&&((u,l)=>s&&!s.has(l)?u:new t({type:"optional",innerType:u}))),_e(e,Tr(e._zod.def,{shape:c,checks:[]}))}function cP(t,e,r){let i=r?new Set(mf(e,r)):void 0,n={};return lo(n,e,Reflect.ownKeys(Ln(e)),(o,a)=>i&&!i.has(a)?o:new t({type:"nonoptional",innerType:o})),_e(e,Tr(e._zod.def,{shape:n}))}function St(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function by(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Et(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function Ia(t){return typeof t=="string"?t:t?.message}function hf(t,e,r){var i;for(let n=e;n<t.length;n++)(i=t[n]).schema??(i.schema=r)}function Ct(t,e,r){var i;let n=t.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(i=t).schema??(i.schema=t.inst):t.schema=t.inst);let o=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,a=t.message?t.message:Ia(t.inst?._zod.def?.error?.(t))??Ia(o?.(t))??Ia(e?.error?.(t))??Ia(r.customError?.(t))??Ia(r.localeError?.(t))??"Invalid input",s={};for(let c of Object.keys(t))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(s[c]=t[c]);return s.path??(s.path=[]),s.message=a,e?.reportInput&&(s.input=t.input),s}function Gc(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function po(t){let e=t.length;if(!uP.test(t))return e;let r=e;for(let i=0;i<e-1;i++)(t.charCodeAt(i)&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320&&(r--,i++);return r}function Hc(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function x(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function za(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function lP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ID(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function SD(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function dP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return ID(e+r)}function fP(t){return SD(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pP(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function mP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function _y(t,e){for(let r in e){let i=Object.getOwnPropertyDescriptor(e,r);i.get?Object.defineProperty(t,r,{...i,enumerable:!1}):gP(t,r,i.value)}}function ci(t,e,r,i=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:i,value:r}),r}function Kc(t,e,r){return ci(t,e,r,!1)}function hP(t,e){for(let r in t){let i=t[r];Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){return ci(this,r,i(this))},set(n){ci(this,r,n)}})}return e}function gP(t,e,r){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?r:ci(this,e,r.bind(this))},set(i){ci(this,e,i)}})}function yP(t,e){let r=Object.getPrototypeOf(t);return e in r?void 0:r}function ae(t,e,r){let i=Object.getPrototypeOf(t._zod);if(e in i&&dy!==t._zod){dy=void 0;return}dy=t._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,vP);let n=si;si=!1;try{let o=r(this);return si?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o}),si=si||n,o}catch(o){throw delete this[e],si=si||n,o}},set(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}function bP(t,e,r,i){let n=yP(t,e);n&&Object.defineProperty(n,e,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,e,o),o.value=r(this),Object.defineProperty(this,e,o),o.value},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:i,value:o})}})}function wy(t){let e=()=>t;return e[gf]=!0,e}var fy,_D,pf,gy,eP,Zc,yy,Wc,Jc,uP,py,dy,si,vP,gf,O=m(()=>{ui();fy=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};_D=Symbol("evaluating");pf="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};gy=Da(()=>{if(nt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});eP=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Zc=new Set(["string","number","symbol"]),yy=new Set(["string","number","bigint","boolean","symbol","undefined"]);Wc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Jc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};uP=/[\uD800-\uDBFF]/;py=class{constructor(...e){}};si=!1,vP={configurable:!0,get(){si=!0}};gf="~constantCatch"});function _P(t){let e=DD;if(e){let r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return DD=null,new t}try{return new t}finally{e.stackTraceLimit=r}}}return new t}function v(t,e,r,i){let n={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=n;let a=r,s=a&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(t))return}else{$y.value=new o(p);try{Object.defineProperty(f,"_zod",$y)}finally{$y.value=void 0}}if(f._zod.traits.add(t),e(f,p),s){let y=Object.getPrototypeOf(f),_=f._zod.constr.prototype,D=y;for(;D&&D!==_;)D=Object.getPrototypeOf(D);let I=D??y;s.has(I)||(s.add(I),_y(I,a))}let h=d.prototype;for(let y in h)Object.prototype.hasOwnProperty.call(h,y)&&(y in f||(f[y]=h[y].bind(f)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:t});function d(f){let p=i?.Parent?_P(l):this;c(p,f);let h=p._zod.deferred;if(h){for(let _ of h)_();p._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(t)}),Object.defineProperty(d,"name",{value:t}),d}function Me(t){return t&&Object.assign(nt,t),nt}var kD,xy,$y,DD,Iy,Ft,li,nt,ui=m(()=>{O();xy=Object.freeze({status:"aborted"}),$y={value:void 0,enumerable:!1},DD="captureStackTrace"in Error?Error:null;Iy=Symbol("zod_brand"),Ft=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},li=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(kD=globalThis).__zod_globalConfig??(kD.__zod_globalConfig={});nt=globalThis.__zod_globalConfig});function wP(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,ka,2)),t.message}function $P(t){this._zod.message=t}function IP(t,e,r){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):t[e]=r()),t[e]}function Yc(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?IP(r,n.path[0],()=>[]).push(e(n)):i.push(e(n));return{formErrors:i,fieldErrors:r}}function Xc(t,e=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)r._errors.push(e(a));else{let c=r,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(e(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(e(a)),c=f,u++}}}};return i(t),r}function Ay(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var a;for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0){r.errors.push(e(s));continue}let u=r,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(e(s)),l++}}};return i(t),r}function OD(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function zy(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${OD(i.path)}`);return e.join(`
|
|
17
17
|
`)}var xP,ky,AD,zD,Dy,jt,Oy=m(()=>{ui();O();xP={get:wP,set:$P,enumerable:!0,configurable:!0},ky={value:void 0,enumerable:!1},AD=new WeakSet([Object.prototype,Error.prototype]),zD=(t,e)=>{t.name="$ZodError",ky.value=e,Object.defineProperty(t,"issues",ky),ky.value=void 0,Object.defineProperty(t,"message",xP);let r=Object.getPrototypeOf(t);AD.has(r)||(AD.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},Dy=v("$ZodError",zD),jt=v("$ZodError",zD,void 0,{Parent:Error})});function yf(t,e){return{callee:e?.callee??t,Err:e?.Err}}function BD(t,e,r){let i;return{success:!1,get error(){return i||(i=new t(e.map(n=>Ct(n,r,Me()))),e=void 0,r=void 0),i},set error(n){i=n,e=void 0,r=void 0}}}function OP(t,e,r){let i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=t._zod.bag.fallbackRun,o;if(n?(i[zP]=!0,o=n({value:e,issues:[]},i)):o=t._zod.run({value:e,issues:[]},i),o instanceof Promise)throw new Ft;return o.issues.length===0}var Oa,vf,Ba,bf,Ta,kP,Na,DP,AP,zP,qc,Qc,_f,BP,wf,TP,$f,NP,xf,UP,If,PP,Sf,LP,kf,EP,Df,CP,By=m(()=>{ui();Oy();O();Oa=t=>{let e=(r,i,n,o)=>{let a=n?{...n,async:!1}:{async:!1},s=r._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw new Ft;if(s.issues.length){let c=new(o?.Err??t)(s.issues.map(u=>Ct(u,a,Me())));throw pf(c,o?.callee??e),c}return s.value};return e},vf=Oa(jt),Ba=t=>{let e=async(r,i,n,o)=>{let a=n?{...n,async:!0}:{async:!0},s=r._zod.run({value:i,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(o?.Err??t)(s.issues.map(u=>Ct(u,a,Me())));throw pf(c,o?.callee??e),c}return s.value};return e},bf=Ba(jt),Ta=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Ft;return o.issues.length?BD(t,o.issues,n):{success:!0,data:o.value}},kP=Ta(jt);Na=t=>async(e,r,i)=>{let n=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?BD(t,o.issues,n):{success:!0,data:o.value}},DP=Na(jt),AP=Symbol.for("zod.compile.invalid"),zP=Symbol.for("zod.compile.fallback"),qc=((t,e,r)=>{let i=t._zod.bag.validator;if(i!==void 0){if(i(e)!==AP)return!0;if(i.definite===!0&&r===void 0)return!1}return OP(t,e,r)});Qc=async(t,e,r)=>{let i=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=t._zod.run({value:e,issues:[]},i);return n instanceof Promise&&(n=await n),n.issues.length===0},_f=t=>{let e=Oa(t),r=(i,n,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return e(i,n,s,yf(r,a))};return r},BP=_f(jt),wf=t=>{let e=Oa(t),r=(i,n,o,a)=>e(i,n,o,yf(r,a));return r},TP=wf(jt),$f=t=>{let e=Ba(t),r=async(i,n,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return await e(i,n,s,yf(r,a))};return r},NP=$f(jt),xf=t=>{let e=Ba(t),r=async(i,n,o,a)=>await e(i,n,o,yf(r,a));return r},UP=xf(jt),If=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Ta(t)(e,r,n)},PP=If(jt),Sf=t=>(e,r,i)=>Ta(t)(e,r,i),LP=Sf(jt),kf=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Na(t)(e,r,n)},EP=kf(jt),Df=t=>async(e,r,i)=>Na(t)(e,r,i),CP=Df(jt)});var hr={};Ie(hr,{anyString:()=>iv,base64:()=>Ky,base64url:()=>Yy,bigint:()=>av,boolean:()=>sv,browserEmail:()=>JP,cidrv4:()=>Gy,cidrv6:()=>Hy,creditCard:()=>Af,cuid:()=>Ny,cuid2:()=>Uy,currencyCode:()=>ev,date:()=>tv,datetime:()=>nv,domain:()=>qy,duration:()=>jy,e164:()=>Qy,email:()=>Ry,emoji:()=>Vy,extendedDuration:()=>FP,guid:()=>My,hex:()=>fv,hostname:()=>Xy,html5Email:()=>VP,httpProtocol:()=>eu,iban:()=>zf,idnEmail:()=>WP,integer:()=>tu,ipv4:()=>Zy,ipv6:()=>Wy,ksuid:()=>Ey,lowercase:()=>lv,mac:()=>Jy,md5_base64:()=>YP,md5_base64url:()=>XP,md5_hex:()=>KP,nanoid:()=>Cy,nanoidOfLength:()=>Fy,null:()=>cv,number:()=>Cn,rfc5322Email:()=>ZP,sha1_base64:()=>QP,sha1_base64url:()=>eL,sha1_hex:()=>qP,sha256_base64:()=>rL,sha256_base64url:()=>nL,sha256_hex:()=>tL,sha384_base64:()=>oL,sha384_base64url:()=>aL,sha384_hex:()=>iL,sha512_base64:()=>cL,sha512_base64url:()=>uL,sha512_hex:()=>sL,string:()=>ov,time:()=>rv,ulid:()=>Py,undefined:()=>uv,unicodeEmail:()=>TD,uppercase:()=>dv,uuid:()=>mo,uuid4:()=>jP,uuid6:()=>MP,uuid7:()=>RP,xid:()=>Ly});function Fy(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}function Vy(){return new RegExp(GP,"u")}function HP(t){return new RegExp(`^${t}$`)}function Ty(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rv(t){return new RegExp(`^${Ty(t)}$`)}function nv(t){let e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ty({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,i=t.local?`${r}|${Ty({precision:t.precision})}`:r;return new RegExp(`^${ND}T(?:${i})$`)}function ru(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function nu(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Ny,Uy,Py,Ly,Ey,Cy,jy,FP,My,mo,jP,MP,RP,Ry,VP,ZP,TD,WP,JP,GP,Zy,Wy,Jy,Gy,Hy,Ky,Yy,Xy,qy,eu,Qy,Af,ev,zf,ND,tv,iv,ov,av,tu,Cn,sv,cv,uv,lv,dv,fv,KP,YP,XP,qP,QP,eL,tL,rL,nL,iL,oL,aL,sL,cL,uL,ho=m(()=>{O();Ny=/^[cC][0-9a-z]{6,}$/,Uy=/^[0-9a-z]+$/,Py=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ly=/^[0-9a-vA-V]{20}$/,Ey=/^[A-Za-z0-9]{27}$/,Cy=/^[a-zA-Z0-9_-]{21}$/;jy=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,FP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,My=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mo=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jP=mo(4),MP=mo(6),RP=mo(7),Ry=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,VP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ZP=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,TD=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,WP=TD,JP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,GP="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";Zy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Wy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Jy=t=>{let e=mr(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Gy=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Hy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ky=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yy=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Xy=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,qy=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,eu=/^https?$/,Qy=/^\+[1-9]\d{6,14}$/,Af=/^\d(?:[ -]?\d){11,18}$/,ev=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,zf=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,ND="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";tv=HP(ND);iv=/^[\s\S]{0,}$/,ov=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},av=/^-?\d+n?$/,tu=/^-?\d+$/,Cn=/^-?\d+(?:\.\d+)?$/,sv=/^(?:true|false)$/i,cv=/^null$/i,uv=/^undefined$/i,lv=/^[^A-Z]*$/,dv=/^[^a-z]*$/,fv=/^[0-9a-fA-F]*$/;KP=/^[0-9a-fA-F]{32}$/,YP=ru(22,"=="),XP=nu(22),qP=/^[0-9a-fA-F]{40}$/,QP=ru(27,"="),eL=nu(27),tL=/^[0-9a-fA-F]{64}$/,rL=ru(43,"="),nL=nu(43),iL=/^[0-9a-fA-F]{96}$/,oL=ru(64,""),aL=nu(64),sL=/^[0-9a-fA-F]{128}$/,cL=ru(86,"=="),uL=nu(86)});function Bf(t,e,r){t.issues.length&&e.issues.push(...Et(r,t.issues))}var De,pv,mv,Of,Tf,Nf,hv,gv,yv,vv,bv,_v,wv,$v,xv,Ua,Iv,Sv,kv,Dv,Av,zv,Ov,Bv,Tv,Nv,Uf=m(()=>{ui();ho();O();De=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),pv=t=>{let e=t.value;return!ff(e)&&e.size!==void 0},mv=t=>{let e=t.value;return!ff(e)&&e.length!==void 0},Of={number:"number",bigint:"bigint",object:"date"},Tf=v("$ZodCheckLessThan",(t,e)=>{De.init(t,e);let r=Of[typeof e.value];t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:Of[typeof i.value]??r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Nf=v("$ZodCheckGreaterThan",(t,e)=>{De.init(t,e);let r=Of[typeof e.value];t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:Of[typeof i.value]??r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),hv=v("$ZodCheckMultipleOf",(t,e)=>{De.init(t,e),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?e.value!==BigInt(0)&&r.value%e.value===BigInt(0):Rc(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),gv=v("$ZodCheckNumberFormat",(t,e)=>{De.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=Wc[e.format];t._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),yv=v("$ZodCheckBigIntFormat",(t,e)=>{De.init(t,e);let[r,i]=Jc[e.format];t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),vv=v("$ZodCheckMaxSize",(t,e)=>{var r;De.init(t,e),(r=t._zod.def).when??(r.when=pv),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Gc(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),bv=v("$ZodCheckMinSize",(t,e)=>{var r;De.init(t,e),(r=t._zod.def).when??(r.when=pv),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Gc(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),_v=v("$ZodCheckSizeEquals",(t,e)=>{var r;De.init(t,e),(r=t._zod.def).when??(r.when=pv),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let a=o>e.size;i.issues.push({origin:Gc(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),wv=v("$ZodCheckMaxLength",(t,e)=>{var r;De.init(t,e),(r=t._zod.def).when??(r.when=mv),t._zod.check=i=>{let n=i.value,o=n.length;if((typeof n=="string"&&o>e.maximum?po(n):o)<=e.maximum)return;let s=Hc(n);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),$v=v("$ZodCheckMinLength",(t,e)=>{var r;De.init(t,e),(r=t._zod.def).when??(r.when=mv),t._zod.check=i=>{let n=i.value,o=n.length;if((typeof n=="string"&&o>=e.minimum&&o<e.minimum*2?po(n):o)>=e.minimum)return;let s=Hc(n);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),xv=v("$ZodCheckLengthEquals",(t,e)=>{var r;De.init(t,e),(r=t._zod.def).when??(r.when=mv),t._zod.check=i=>{let n=i.value,o=n.length,a=typeof n=="string"&&o>=e.length&&o<=e.length*2?po(n):o;if(a===e.length)return;let s=Hc(n),c=a>e.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Ua=v("$ZodCheckStringFormat",(t,e)=>{var r,i;De.init(t,e),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),Iv=v("$ZodCheckRegex",(t,e)=>{Ua.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Sv=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=lv),Ua.init(t,e)}),kv=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=dv),Ua.init(t,e)}),Dv=v("$ZodCheckIncludes",(t,e)=>{De.init(t,e);let r=mr(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position},}${r}`:r);e.pattern=i,t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),Av=v("$ZodCheckStartsWith",(t,e)=>{De.init(t,e);let r=new RegExp(`^${mr(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),zv=v("$ZodCheckEndsWith",(t,e)=>{De.init(t,e);let r=new RegExp(`.*${mr(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});Ov=v("$ZodCheckProperty",(t,e)=>{De.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>Bf(n,r,e.property));Bf(i,r,e.property)}}),Bv=v("$ZodCheckProperties",(t,e)=>{De.init(t,e),Kc(t,Symbol.iterator,function*(){yield t});let r;t._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:t});return}r??(r=Reflect.ownKeys(e.shape).map(a=>[a,e.shape[a]]));let n=i.value,o;for(let[a,s]of r){let c=s._zod.run({value:n[a],issues:[]},{});c instanceof Promise?(o??(o=[]),o.push(c.then(u=>Bf(u,i,a)))):Bf(c,i,a)}if(o)return Promise.all(o).then(()=>{})}}),Tv=v("$ZodCheckMimeType",(t,e)=>{De.init(t,e);let r=new Set(e.mime);t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),Nv=v("$ZodCheckOverwrite",(t,e)=>{De.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var go,Pf=m(()=>{go=class{constructor(e=[],r={}){this.content=[],this.indent=0,this.args=e,this.closed=r}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
18
18
|
`).filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,r=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
19
19
|
${r.join(`
|
|
@@ -74,6 +74,6 @@ ${c}`:c:"",l=Function,d=`return (input) => {
|
|
|
74
74
|
${c}
|
|
75
75
|
}`,f;try{f=new l(...a,d)(...s)}catch(p){throw new fe(`this schema (generated code failed to evaluate: ${p.message})`)}return e?.debug&&(f.code=u),f.definite=i.definite,f}function q(t,e){for(let[i,n]of t.constants)if(n===e)return i;let r=`c${t.constantCounter++}`;return t.constants.set(r,e),r}function _o(t,e){return t.definite=!1,q(t,e)}function W(t){return`v${t.varCounter++}`}function BE(t,e){let r=t._zod.run({value:e,issues:[]},{});if(r&&typeof r.then=="function")return kt;let i=r;return i.issues.length===0?i.value:kt}function ht(t,e,r,i,n=!0){let o=t.content.length,a=e.constants.size,s=e.constantCounter,c=e.varCounter;try{return Le(t,e,r,i,n)}catch(u){if(!(u instanceof fe)||!u.islandable)throw u;if(t.content.length=o,e.constants.size>a){let l=Array.from(e.constants.keys()).slice(a);for(let d of l)e.constants.delete(d)}return e.constantCounter=s,e.varCounter=c,TE(t,e,r,i)}}function TE(t,e,r,i){e.definite=!1;let n=q(e,r),o=q(e,BE),a=W(e);return t.write(`const ${a} = ${o}(${n}, ${i});`),t.write(`if (${a} === INVALID) return INVALID;`),a}function UE(t,e,r,i){let n=r._zod.def.checks;if(!n||n.length===0)return i;let o=i;for(let a of n){let s=a._zod.def;if(s.when&&!NE.has(s.check))throw new fe('check with a custom "when" condition');switch(s.check){case"greater_than":PE(t,e,s,o);break;case"less_than":LE(t,e,s,o);break;case"multiple_of":EE(t,e,s,o);break;case"number_format":zz(t,s,o);break;case"min_length":{let c=vo(s.minimum,"min_length"),u=i_(t,e,o,`${o}.length >= ${c} && ${o}.length < ${s.minimum*2}`);t.write(`if (${u} < ${c}) return INVALID;`);break}case"max_length":{let c=vo(s.maximum,"max_length"),u=i_(t,e,o,`${o}.length > ${c}`);t.write(`if (${u} > ${c}) return INVALID;`);break}case"length_equals":{let c=vo(s.length,"length_equals"),u=i_(t,e,o,`${o}.length >= ${c} && ${o}.length <= ${s.length*2}`);t.write(`if (${u} !== ${c}) return INVALID;`);break}case"min_size":t.write(`if (${o}.size < ${vo(s.minimum,"min_size")}) return INVALID;`);break;case"max_size":t.write(`if (${o}.size > ${vo(s.maximum,"max_size")}) return INVALID;`);break;case"size_equals":t.write(`if (${o}.size !== ${vo(s.size,"size_equals")}) return INVALID;`);break;case"string_format":o=Oz(t,e,s,o);break;case"custom":o=VE(t,e,a,o);break;case"bigint_format":CE(t,s,o);break;case"mime_type":FE(t,e,s,o);break;case"property":ME(t,e,s,o);break;case"properties":jE(t,e,s,o);break;case"overwrite":{let c=W(e);RE(t,e,a,o,c),o=c;break}default:throw new fe(`check type ${s.check}`)}}return o}function i_(t,e,r,i){let n=q(e,po),o=W(e);return t.write(`const ${o} = typeof ${r} === "string" && ${i} ? ${n}(${r}) : ${r}.length;`),o}function vo(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new fe(`${e} bound of type ${typeof t}`);return`${t}`}function Az(t,e){if(typeof e=="bigint")return`${e}n`;if(typeof e=="number"){if(Number.isNaN(e))throw new fe("comparison check with NaN bound");return`${e}`}if(e instanceof Date){if(Number.isNaN(e.getTime()))throw new fe("comparison check with Invalid Date bound");return q(t,e)}throw new fe(`comparison check bound of type ${typeof e}`)}function PE(t,e,r,i){let n=r.inclusive?"<":"<=";t.write(`if (${i} ${n} ${Az(e,r.value)}) return INVALID;`)}function LE(t,e,r,i){let n=r.inclusive?">":">=";t.write(`if (${i} ${n} ${Az(e,r.value)}) return INVALID;`)}function EE(t,e,r,i){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new fe("multiple_of check with a zero divisor");t.write(`if (${i} % ${r.value}n !== 0n) return INVALID;`)}else{let n=q(e,Rc);t.write(`if (${n}(${i}, ${vo(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function zz(t,e,r){let i=e.format;switch(i){case"safeint":t.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":t.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":t.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":t.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":t.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new fe(`number format ${i}`)}}function CE(t,e,r){let i=e.format;if(i)switch(i){case"int64":t.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new fe(`bigint format ${i}`)}}function FE(t,e,r,i){let n=r.mime;if(n&&n.length>0){let o=q(e,new Set(n));t.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function jE(t,e,r,i){if(r.when)throw new fe('check with a custom "when" condition');t.write(`if (${i} == null) return INVALID;`);let n=r.shape;for(let o of Reflect.ownKeys(n)){let a=typeof o=="symbol"?q(e,o):It(o),s=W(e);t.write(`const ${s} = ${i}[${a}];`),ht(t,e,n[o],s,!1)}}function ME(t,e,r,i){let n=`${i}[${JSON.stringify(r.property)}]`;Le(t,e,r.schema,n)}function RE(t,e,r,i,n){let o=r._zod.def.tx;if(!o)throw new fe("overwrite check without a transform function");if(wo(o))throw new Nr("z.compile: async overwrite transforms are not supported");let a=q(e,o);t.write(`const ${n} = ${a}(${i});`)}function o_(){throw new Ft}function c_(t){this.issues.push(t)}function VE(t,e,r,i){let n=r._zod.def;if(n.fn){if(wo(n.fn))throw new Nr("z.compile: async .refine() predicates are not supported");let o=_o(e,n.fn),a=q(e,o_),s=W(e);return t.write(`const ${s} = ${o}(${i});`),t.write(`if (${s} instanceof Promise) ${a}();`),t.write(`if (!${s}) return INVALID;`),i}if(r._zod.check){if(wo(r._zod.check))throw new Nr("z.compile: async .superRefine() / check functions are not supported");let o=r._zod.check,s=_o(e,u=>{let l={value:u,issues:[],addIssue:c_};return o(l)instanceof Promise&&o_(),l.issues.length===0?l.value:kt}),c=W(e);return t.write(`const ${c} = ${s}(${i});`),t.write(`if (${c} === INVALID) return INVALID;`),c}throw new fe("custom check without a predicate or check function")}function Oz(t,e,r,i,n=!0){let o=r.format;if(o==="base64"){let u=q(e,su);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="base64url"){let u=q(e,Jf);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="jwt"){let u=q(e,Kf),l=q(e,r.alg??null);return t.write(`if (!${u}(${i}, ${l})) return INVALID;`),i}if(o==="ipv6"){let u=q(e,au);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="cidrv6"){let u=q(e,Zf);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="credit_card"){let u=q(e,Gf);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="iban"){let u=q(e,Hf);return t.write(`if (!${u}(${i})) return INVALID;`),i}let a=r;if(o==="url"||o==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let u=q(e,Mf),l=q(e,r),d=W(e),f=W(e);if(t.write(`const ${d} = ${i}.trim();`),t.write(`const ${f} = ${u}(${d}, ${l});`),t.write(`if (typeof ${f} === "number") return INVALID;`),a.hostname!==void 0){let y=q(e,Rf);t.write(`if (!${y}(${f}, ${l}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let y=q(e,Vf);t.write(`if (!${y}(${f}, ${l}.protocol)) return INVALID;`)}if(!n)return null;let p=W(e),h=a.normalize?`${f}.href`:`${q(e,ou)}(${d})`;return t.write(`const ${p} = ${h};`),p}let s=r.fn;if(s){if(wo(s))throw new fe(`async string format ${o}`);let u=q(e,s);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(ZE.has(o)&&r.pattern){let u=q(e,r.pattern);return t.write(`${u}.lastIndex = 0;`),t.write(`if (!${u}.test(${i})) return INVALID;`),i}let c=r.format;switch(c){case"regex":throw new fe("regex format without a pattern");case"lowercase":t.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":t.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":t.write(`if (!${i}.includes(${It(r.includes)})) return INVALID;`);break;case"starts_with":{let u=r.prefix;t.write(`if (${i}.slice(0, ${u.length}) !== ${It(u)}) return INVALID;`);break}case"ends_with":{let u=r.suffix;t.write(`if (${i}.slice(-${u.length}) !== ${It(u)}) return INVALID;`);break}default:throw new fe(`string format ${c}`)}return i}function Le(t,e,r,i,n=!0){let o=r._zod.def,a=o.type;if(o.coerce)throw new fe(`coercion (z.coerce.${a}())`);let s=n||!!o.checks?.length,c;switch(a){case"string":c=WE(t,e,r,i,s);break;case"number":c=JE(t,r,i);break;case"boolean":c=GE(t,i);break;case"bigint":c=HE(t,r,i);break;case"symbol":c=KE(t,i);break;case"undefined":c=YE(t,i);break;case"null":c=XE(t,i);break;case"any":case"unknown":c=i;break;case"never":t.write("return INVALID;"),c=i;break;case"void":c=qE(t,i);break;case"nan":c=QE(t,i);break;case"date":c=e2(t,i);break;case"object":c=t2(t,e,r,i,s);break;case"optional":c=r2(t,e,r,i,s);break;case"nullable":c=o2(t,e,r,i,s);break;case"array":c=a2(t,e,r,i,s);break;case"literal":c=s2(t,e,r,i);break;case"enum":c=c2(t,e,r,i);break;case"readonly":{let u=Sz(t,e,r,i),l=W(e);t.write(`const ${l} = Object.freeze(${u});`),c=l;break}case"success":Sz(t,e,r,i),c="true";break;case"default":case"prefault":c=u2(t,e,r,i);break;case"nonoptional":c=l2(t,e,r,i);break;case"tuple":c=d2(t,e,r,i);break;case"union":c=f2(t,e,r,i);break;case"intersection":c=h2(t,e,r,i);break;case"record":c=g2(t,e,r,i);break;case"map":c=v2(t,e,r,i);break;case"set":c=b2(t,e,r,i);break;case"file":c=_2(t,i);break;case"template_literal":c=w2(t,e,r,i);break;case"lazy":c=$2(t,e,r,i);break;case"pipe":c=x2(t,e,r,i);break;case"custom":c=I2(t,e,r,i);break;case"transform":c=D2(t,e,r,i);break;case"catch":c=k2(t,e,r,i);break;default:throw new fe(`schema type ${a}`)}return c===null?null:UE(t,e,r,c)}function WE(t,e,r,i,n=!0){t.write(`if (typeof ${i} !== "string") return INVALID;`);let o=r._zod.def;return o.format===void 0?i:Oz(t,e,o,i,n)}function JE(t,e,r){t.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let i=e._zod.def;return i.check==="number_format"&&i.format&&zz(t,{format:i.format},r),r}function GE(t,e){return t.write(`if (typeof ${e} !== "boolean") return INVALID;`),e}function HE(t,e,r){t.write(`if (typeof ${r} !== "bigint") return INVALID;`);let i=e._zod.def;if(i.format)switch(i.format){case"int64":t.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function KE(t,e){return t.write(`if (typeof ${e} !== "symbol") return INVALID;`),e}function YE(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function XE(t,e){return t.write(`if (${e} !== null) return INVALID;`),e}function qE(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function QE(t,e){return t.write(`if (typeof ${e} !== "number" || !Number.isNaN(${e})) return INVALID;`),e}function e2(t,e){return t.write(`if (!(${e} instanceof Date) || Number.isNaN(${e}.getTime())) return INVALID;`),e}function t2(t,e,r,i,n=!0){let o=r._zod.def;t.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let a=o.shape,s=Object.keys(a),c=Object.getOwnPropertySymbols(a),u=c.length?[...s,...c]:s,l=I=>typeof I=="symbol"?q(e,I):It(I),d=I=>typeof I=="symbol"?`[${l(I)}]`:It(I),f=a;if(s.includes("__proto__"))throw new fe('object shape key "__proto__"');let p=new Map;for(let I of u){let A=f[I],Z=l(I),L=W(e);if(t.write(`const ${L} = ${i}[${Z}];`),A._zod.optin!==void 0){let k=W(e);t.write(`let ${k} = (() => {`),t.indented(le=>{let he=ht(le,e,A,L);le.write(`return ${he};`)}),t.write("})();"),A._zod.optout==="optional"?(t.write(`if (${k} === INVALID) {`),t.indented(le=>{le.write(`if (${Z} in ${i}) return INVALID;`),le.write(`${k} = undefined;`)}),t.write("}")):t.write(`if (${k} === INVALID) return INVALID;`),p.set(I,k)}else{i2(A)&&t.write(`if (!(${Z} in ${i})) return INVALID;`);let k=ht(t,e,A,L,n);k!==null&&p.set(I,k)}}let h=o.catchall,y="none";if(h){let I=h._zod.def.type;if(I==="never"){let A=s.map(Z=>`k !== ${It(Z)}`).join(" && ")||"true";t.write(`for (const k in ${i}) {`),t.indented(Z=>{Z.write(`if (${A}) return INVALID;`)}),t.write("}")}else(I==="unknown"||I==="any")&&!h._zod.def.checks?.length?y="passthrough":y="schema"}let _=W(e),D=u.some(I=>Iz(f[I])||a_(f[I]));if(!n){if(y==="schema"){let I=s.length>0?q(e,new Set(s)):null;t.write(`for (const k in ${i}) {`),t.indented(A=>{A.write('if (k === "__proto__") continue;'),I&&A.write(`if (${I}.has(k)) continue;`);let Z=W(e);A.write(`const ${Z} = ${i}[k];`),ht(A,e,h,Z,!1)}),t.write("}")}return null}if(D){t.write(`const ${_} = {};`);for(let I of u){let A=l(I),Z=p.get(I);a_(f[I])?t.write(`if (${A} in ${i}) ${_}[${A}] = ${Z};`):Iz(f[I])?t.write(`if (${Z} !== undefined || ${A} in ${i}) ${_}[${A}] = ${Z};`):t.write(`${_}[${A}] = ${Z};`)}}else{let I=u.map(A=>`${d(A)}: ${p.get(A)}`).join(", ");t.write(`const ${_} = { ${I} };`)}if(y!=="none"){let I=s.length>0?q(e,new Set(s)):null;t.write(`for (const k in ${i}) {`),t.indented(A=>{if(A.write('if (k === "__proto__") continue;'),I&&A.write(`if (${I}.has(k)) continue;`),y==="passthrough")A.write(`${_}[k] = ${i}[k];`);else{let Z=W(e);A.write(`const ${Z} = ${i}[k];`);let L=ht(A,e,h,Z);A.write(`${_}[k] = ${L};`)}}),t.write("}")}return _}function r2(t,e,r,i,n=!0){let o=r._zod.def;if(n2(r))return Le(t,e,o.innerType,i,n);if(o.innerType._zod.optin==="defaulted"){let s=W(e),c=W(e);return t.write(`let ${s};`),t.write(`if (${i} === undefined) {`),t.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let d=Le(l,e,o.innerType,i);l.write(`return ${d};`)}),u.write("})();"),u.write(`if (${c} !== INVALID) ${s} = ${c};`)}),t.write("} else {"),t.indented(u=>{let l=Le(u,e,o.innerType,i);u.write(`${s} = ${l};`)}),t.write("}"),s}let a=n?W(e):null;return a&&t.write(`let ${a};`),t.write(`if (${i} !== undefined) {`),t.indented(s=>{let c=Le(s,e,o.innerType,i,n);a&&c!==null&&s.write(`${a} = ${c};`)}),t.write("}"),a}function n2(t){return t._zod.traits?.has("$ZodExactOptional")===!0}function i2(t){return t._zod.optin===void 0&&bo(t)}function bo(t){if(t._zod.def.coerce)return!0;let e=t._zod.def;switch(e.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return e.innerType?bo(e.innerType):!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return e.innerType?bo(e.innerType):!0;case"catch":return!0;case"union":return e.options?e.options.some(bo):!0;case"intersection":return!e.left||!e.right?!0:bo(e.left)&&bo(e.right);case"pipe":return e.in?bo(e.in):!0;default:return!0}}function a_(t){return t._zod.optin==="optional"&&t._zod.optout==="optional"}function Iz(t){return(t._zod.optin!=="defaulted"||t._zod.optout==="optional")&&Fa(t)}function Fa(t){let e=t._zod.def;switch(e.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return e.innerType?Fa(e.innerType):!0;case"union":return e.options?e.options.some(Fa):!0;case"intersection":return!e.left||!e.right||Fa(e.left)||Fa(e.right);case"pipe":return e.out?Fa(e.out):!0;default:return!0}}function o2(t,e,r,i,n=!0){let o=r._zod.def,a=n?W(e):null;return a&&t.write(`let ${a} = null;`),t.write(`if (${i} !== null) {`),t.indented(s=>{let c=Le(s,e,o.innerType,i,n);a&&c!==null&&s.write(`${a} = ${c};`)}),t.write("}"),a}function a2(t,e,r,i,n=!0){let o=r._zod.def;t.write(`if (!Array.isArray(${i})) return INVALID;`);let a=n?W(e):null,s=W(e),c=W(e);return a&&t.write(`const ${a} = new Array(${i}.length);`),t.write(`for (let ${s} = 0; ${s} < ${i}.length; ${s}++) {`),t.indented(u=>{u.write(`const ${c} = ${i}[${s}];`);let l=ht(u,e,o.element,c,n);a&&l!==null&&u.write(`${a}[${s}] = ${l};`)}),t.write("}"),a}function s2(t,e,r,i){let o=r._zod.def.values;if(o.length!==1){let s=q(e,new Set(o));return t.write(`if (!${s}.has(${i})) return INVALID;`),i}let a=o[0];if(typeof a=="number"&&Number.isNaN(a)){let s=q(e,new Set(o));return t.write(`if (!${s}.has(${i})) return INVALID;`),i}if(typeof a=="string")t.write(`if (${i} !== ${It(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")t.write(`if (${i} !== ${a}) return INVALID;`);else if(a===null)t.write(`if (${i} !== null) return INVALID;`);else if(a===void 0)t.write(`if (${i} !== undefined) return INVALID;`);else if(typeof a=="bigint")t.write(`if (${i} !== ${a}n) return INVALID;`);else throw new fe(`literal type ${typeof a}`);return i}function c2(t,e,r,i){let n=r._zod.values;if(!n)throw new fe("enum schema without enumerated values");let o=q(e,n);return t.write(`if (!${o}.has(${i})) return INVALID;`),i}function Sz(t,e,r,i){let n=r._zod.def;return Le(t,e,n.innerType,i)}function u2(t,e,r,i){let n=r._zod.def,a=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!a)return Le(t,e,n.innerType,i);let c=q(e,a),u=W(e);return t.write(`let ${u} = ${i};`),t.write(`if (${i} === undefined) ${u} = ${c}();`),Le(t,e,n.innerType,u)}let s=W(e);if(a){let c=q(e,a),u=q(e,Vc);t.write(`let ${s};`),t.write(`if (${i} === undefined) {`),t.indented(l=>{l.write(`${s} = ${u}(${c}());`)}),t.write("} else {"),t.indented(l=>{let d=Le(l,e,n.innerType,i);l.write(`${s} = ${d} === undefined ? ${u}(${c}()) : ${d};`)}),t.write("}")}else t.write(`let ${s};`),t.write(`if (${i} !== undefined) {`),t.indented(c=>{let u=Le(c,e,n.innerType,i);c.write(`${s} = ${u};`)}),t.write("}");return s}function l2(t,e,r,i){let n=r._zod.def,o=Le(t,e,n.innerType,i),a=W(e);return t.write(`const ${a} = ${o};`),t.write(`if (${a} === undefined) return INVALID;`),a}function d2(t,e,r,i){let n=r._zod.def,o=n.items,a=n.rest;t.write(`if (!Array.isArray(${i})) return INVALID;`);let s=kz(o,"optin"),c=kz(o,"optout");a?t.write(`if (${i}.length < ${s}) return INVALID;`):t.write(`if (${i}.length < ${s} || ${i}.length > ${o.length}) return INVALID;`);let u=W(e);t.write(`const ${u} = [];`);for(let l=0;l<o.length;l++){let d=o[l];if(l>=c)t.write(`if (${u}.length === ${l}) {`),t.indented(f=>{f.write(`if (${l} < ${i}.length) {`),f.indented(p=>{let h=W(e);p.write(`const ${h} = ${i}[${l}];`);let y=ht(p,e,d,h);p.write(`${u}[${l}] = ${y};`)}),f.write("} else {"),f.indented(p=>{if(a_(d)){p.write(`${u}.length = ${l};`);return}let h=W(e),y=W(e);p.write(`const ${h} = undefined;`),p.write(`const ${y} = (() => {`),p.indented(_=>{let D=ht(_,e,d,h);_.write(`return ${D};`)}),p.write("})();"),p.write(`if (${y} === INVALID || ${y} === undefined) ${u}.length = ${l};`),p.write(`else ${u}[${l}] = ${y};`)}),f.write("}")}),t.write("}");else{let f=W(e);t.write(`const ${f} = ${i}[${l}];`);let p=ht(t,e,d,f);t.write(`${u}[${l}] = ${p};`)}}if(a){let l=W(e),d=W(e);t.write(`for (let ${l} = ${o.length}; ${l} < ${i}.length; ${l}++) {`),t.indented(f=>{f.write(`const ${d} = ${i}[${l}];`);let p=ht(f,e,a,d);f.write(`${u}[${l}] = ${p};`)}),t.write("}")}return u}function kz(t,e){for(let r=t.length-1;r>=0;r--)if(!(e==="optin"?t[r]._zod.optin!==void 0:t[r]._zod.optout==="optional"))return r+1;return 0}function f2(t,e,r,i){let n=r._zod.def,o=n.options;if(n.discriminator)return p2(t,e,n,i);if(n.inclusive===!1)throw new fe("exclusive unions (z.xor)");if(o.length===0)return t.write("return INVALID;"),i;if(o.length===1)return Le(t,e,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(l=>l._zod.def.values)),u=q(e,c);return t.write(`if (!${u}.has(${i})) return INVALID;`),i}let s=W(e);t.write(`let ${s};`);for(let c=0;c<o.length;c++){let u=o[c];c===0?t.write(`${s} = (() => {`):t.write(`if (${s} === INVALID) ${s} = (() => {`),t.indented(l=>{let d=Le(l,e,u,i);l.write(`return ${d};`)}),t.write("})();")}return t.write(`if (${s} === INVALID) return INVALID;`),s}function p2(t,e,r,i){if(r.unionFallback)throw new fe("discriminated union with unionFallback");if(r.options.length===0)return t.write("return INVALID;"),i;let n=W(e),o=W(e);t.write(`const ${n} = ${i}?.[${It(r.discriminator)}];`),t.write(`let ${o};`);let a=!0,s=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new fe("discriminated union option without static discriminator values");for(let f of u){if(s.has(f))throw new fe(`duplicate discriminator value ${String(f)}`);s.add(f)}let l=Array.from(u,f=>m2(e,n,f)),d=a?"if":"else if";t.write(`${d} (${l.join(" || ")}) {`),t.indented(f=>{let p=Le(f,e,c,i);f.write(`${o} = ${p};`)}),t.write("}"),a=!1}return t.write("else { return INVALID; }"),o}function m2(t,e,r){if(typeof r=="string")return`${e} === ${It(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${e})`:`${e} === ${r}`;if(typeof r=="boolean")return`${e} === ${r}`;if(r===null)return`${e} === null`;if(r===void 0)return`${e} === undefined`;if(typeof r=="bigint")return`${e} === ${r}n`;if(typeof r=="symbol"){let i=q(t,r);return`${e} === ${i}`}throw new fe(`literal discriminator value ${String(r)}`)}function h2(t,e,r,i){let n=r._zod.def;e.definite=!1;let o=ht(t,e,n.left,i),a=ht(t,e,n.right,i),s=q(e,Pa),c=W(e);return t.write(`const ${c} = ${s}(${o}, ${a});`),t.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function g2(t,e,r,i){let n=r._zod.def,o=q(e,pr);t.write(`if (!${o}(${i})) return INVALID;`);let a=W(e),s=W(e),c=W(e);t.write(`const ${a} = {};`);let u=n,l=u.partial?void 0:n.keyType._zod.values;if(l){let p=[];for(let y of l){if(!(typeof y=="string"||typeof y=="number"||typeof y=="symbol"))throw new fe(`record key value ${String(y)}`);let _=typeof y=="number"?y.toString():y;if(_==="__proto__")throw new fe('record key "__proto__"');p.push(_);let D=q(e,y),I=Le(t,e,n.keyType,D),A=W(e);t.write(`const ${A} = ${i}[${y2(e,_)}];`);let Z=ht(t,e,n.valueType,A);t.write(`${a}[${I}] = ${Z};`)}let h=q(e,new Set(p));return t.write(`for (const ${s} in ${i}) {`),t.indented(y=>{y.write(`if (${h}.has(${s})) continue;`),u.mode==="loose"?y.write(`if (${s} !== "__proto__") ${a}[${s}] = ${i}[${s}];`):y.write("return INVALID;")}),t.write("}"),a}let d=n.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let p=n.mode==="loose",h=pp(n.keyType);h.definite===!1&&(e.definite=!1);let y=q(e,h),_=q(e,Cn),D=W(e);return Dz(t,e,i,s,I=>{I.write(`let ${D} = ${y}(${s});`),I.write(`if (${D} === INVALID && typeof ${s} === "string" && ${_}.test(${s})) ${D} = ${y}(Number(${s}));`),p?I.write(`if (${D} === INVALID) { ${a}[${s}] = ${i}[${s}]; continue; }`):I.write(`if (${D} === INVALID) return INVALID;`),I.write(`if (${D} === "__proto__") continue;`);let A=W(e);I.write(`const ${A} = ${i}[${s}];`);let Z=ht(I,e,n.valueType,A);I.write(`${a}[${D}] = ${Z};`)}),a}return Dz(t,e,i,s,p=>{p.write(`const ${c} = ${i}[${s}];`);let h=ht(p,e,n.valueType,c);p.write(`${a}[${s}] = ${h};`)},"return INVALID;"),a}function Dz(t,e,r,i,n,o){let a=q(e,Object.prototype.propertyIsEnumerable),s=W(e),c=W(e),u=W(e);t.write(`const ${s} = Object.getOwnPropertySymbols(${r});`),t.write(`const ${c} = Object.getOwnPropertyNames(${r});`),t.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),t.indented(l=>{l.write(`const ${i} = ${c}[${u}];`),l.write(`if (${i} === "__proto__" || !${a}.call(${r}, ${i})) continue;`),n(l)}),t.write("}"),t.write(`for (let ${u} = 0; ${u} < ${s}.length; ${u}++) {`),t.indented(l=>{l.write(`const ${i} = ${s}[${u}];`),l.write(`if (!${a}.call(${r}, ${i})) continue;`),o?l.write(o):n(l)}),t.write("}")}function y2(t,e){return typeof e=="string"?It(e):q(t,e)}function v2(t,e,r,i){let n=r._zod.def;t.write(`if (!(${i} instanceof Map)) return INVALID;`);let o=W(e),a=W(e),s=W(e);return t.write(`const ${o} = new Map();`),t.write(`for (const [${a}, ${s}] of ${i}) {`),t.indented(c=>{let u=Le(c,e,n.keyType,a),l=Le(c,e,n.valueType,s);c.write(`${o}.set(${u}, ${l});`)}),t.write("}"),o}function b2(t,e,r,i){let n=r._zod.def;t.write(`if (!(${i} instanceof Set)) return INVALID;`);let o=W(e),a=W(e);return t.write(`const ${o} = new Set();`),t.write(`for (const ${a} of ${i}) {`),t.indented(s=>{let c=Le(s,e,n.valueType,a);s.write(`${o}.add(${c});`)}),t.write("}"),o}function _2(t,e){return t.write(`if (!(${e} instanceof File)) return INVALID;`),e}function w2(t,e,r,i){t.write(`if (typeof ${i} !== "string") return INVALID;`);let n=r._zod.pattern;if(n){let o=q(e,n);t.write(`${o}.lastIndex = 0;`),t.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function $2(t,e,r,i){let n=r._zod.def,o=_o(e,n.getter),a=q(e,{parser:null});t.write(`if (!${a}.parser) {`),t.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${a}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),t.write("}");let s=W(e);return t.write(`const ${s} = ${a}.parser(${i});`),t.write(`if (${s} === INVALID) return INVALID;`),s}function x2(t,e,r,i){let n=r._zod.def,o=Le(t,e,n.in,i);if(n.transform){if(wo(n.transform))throw new Nr("z.compile: async transforms in pipes are not supported");let a=n.transform,c=_o(e,l=>{let d={value:l,issues:[],addIssue:c_},f=a(l,d);return f instanceof Promise?kt:d.issues.length===0?f:kt}),u=W(e);return t.write(`const ${u} = ${c}(${o});`),t.write(`if (${u} === INVALID) return INVALID;`),Le(t,e,n.out,u)}else return Le(t,e,n.out,o)}function wo(t){return typeof t=="function"&&(t.constructor.name==="AsyncFunction"||t[Symbol.toStringTag]==="AsyncFunction")}function I2(t,e,r,i){let n=r._zod.def;if(n.fn){if(wo(n.fn))throw new Nr("z.compile: async custom predicates are not supported");let o=_o(e,n.fn),a=q(e,o_),s=W(e);t.write(`const ${s} = ${o}(${i});`),t.write(`if (${s} instanceof Promise) ${a}();`),t.write(`if (!${s}) return INVALID;`)}else throw new fe("custom schema without a predicate function");return i}function S2(t,e,r){let i=t._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return kt;let n=i;return n.issues.length===0?n.value:e()}function k2(t,e,r,i){let n=r._zod.def;if(!n.catchValue[gf])throw new fe("catch with a callback (only a constant catch value compiles)",!1);let o=W(e);t.write(`let ${o} = (() => {`),t.indented(u=>{let l=ht(u,e,n.innerType,i);u.write(`return ${l};`)}),t.write("})();");let a=q(e,n.innerType),s=_o(e,n.catchValue),c=q(e,S2);return t.write(`if (${o} === INVALID) {`),t.indented(u=>{u.write(`${o} = ${c}(${a}, ${s}, ${i});`),u.write(`if (${o} === INVALID) return INVALID;`)}),t.write("}"),o}function D2(t,e,r,i){let n=r._zod.def;if(n.transform){if(wo(n.transform))throw new Nr("z.compile: async transforms are not supported");let o=n.transform,s=_o(e,u=>{let l={value:u,issues:[],addIssue:c_},d=o(u,l);return d instanceof Promise?kt:l.issues.length===0?d:kt}),c=W(e);return t.write(`const ${c} = ${s}(${i});`),t.write(`if (${c} === INVALID) return INVALID;`),c}return i}var kt,xz,Nr,fe,NE,ZE,Bz=m(()=>{ui();Pf();Xb();ho();La();O();kt=Symbol.for("zod.compile.invalid"),xz=Symbol.for("zod.compile.fallback"),Nr=class extends Error{constructor(e="z.compile does not support async refinements, transforms, or checks"){super(e),this.name="ZodCompileAsyncError"}},fe=class extends Error{constructor(e,r=!0){super(`z.compile does not support ${e}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};NE=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);ZE=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function mp(t){return t.checks&&(t.checks=[...t.checks]),t}function u_(t,e){return new t(mp({type:"string",...S(e)}))}function l_(t,e){return new t(mp({type:"string",coerce:!0,...S(e)}))}function hp(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...S(e)})}function gp(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...S(e)})}function yp(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...S(e)})}function vp(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(e)})}function bp(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(e)})}function _p(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(e)})}function bu(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...S(e)})}function wp(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...S(e)})}function $p(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(e)})}function xp(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...S(e)})}function Ip(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(e)})}function Sp(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...S(e)})}function kp(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...S(e)})}function Dp(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(e)})}function Ap(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(e)})}function zp(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(e)})}function d_(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...S(e)})}function Op(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(e)})}function Bp(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(e)})}function Tp(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...S(e)})}function Np(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...S(e)})}function Up(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...S(e)})}function f_(t,e){return new t({type:"string",format:"credit_card",check:"string_format",abort:!1,...S(e)})}function p_(t,e){return new t({type:"string",format:"iban",check:"string_format",abort:!1,...S(e)})}function Pp(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...S(e)})}function _u(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(e)})}function wu(t,e){return new t({type:"string",format:"date",check:"string_format",...S(e)})}function $u(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...S(e)})}function xu(t,e){return new t({type:"string",format:"duration",check:"string_format",...S(e)})}function h_(t,e){return new t(mp({type:"number",checks:[],...S(e)}))}function g_(t,e){return new t(mp({type:"number",coerce:!0,checks:[],...S(e)}))}function y_(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...S(e)})}function v_(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...S(e)})}function b_(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...S(e)})}function __(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...S(e)})}function w_(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...S(e)})}function $_(t,e){return new t({type:"boolean",...S(e)})}function x_(t,e){return new t({type:"boolean",coerce:!0,...S(e)})}function I_(t,e){return new t({type:"bigint",...S(e)})}function S_(t,e){return new t({type:"bigint",coerce:!0,...S(e)})}function k_(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(e)})}function D_(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(e)})}function A_(t,e){return new t({type:"symbol",...S(e)})}function z_(t,e){return new t({type:"undefined",...S(e)})}function O_(t,e){return new t({type:"null",...S(e)})}function B_(t){return new t({type:"any"})}function T_(t){return new t({type:"unknown"})}function N_(t,e){return new t({type:"never",...S(e)})}function U_(t,e){return new t({type:"void",...S(e)})}function P_(t,e){return new t({type:"date",...S(e)})}function L_(t,e){return new t({type:"date",coerce:!0,...S(e)})}function E_(t,e){return new t({type:"nan",...S(e)})}function cn(t,e){return new Tf({check:"less_than",...S(e),value:t,inclusive:!1})}function er(t,e){return new Tf({check:"less_than",...S(e),value:t,inclusive:!0})}function un(t,e){return new Nf({check:"greater_than",...S(e),value:t,inclusive:!1})}function tr(t,e){return new Nf({check:"greater_than",...S(e),value:t,inclusive:!0})}function Lp(t){return un(0,t)}function Ep(t){return cn(0,t)}function Cp(t){return er(0,t)}function Fp(t){return tr(0,t)}function di(t,e){return new hv({check:"multiple_of",...S(e),value:t})}function fi(t,e){return new vv({check:"max_size",...S(e),maximum:t})}function ln(t,e){return new bv({check:"min_size",...S(e),minimum:t})}function $o(t,e){return new _v({check:"size_equals",...S(e),size:t})}function xo(t,e){return new wv({check:"max_length",...S(e),maximum:t})}function Fn(t,e){return new $v({check:"min_length",...S(e),minimum:t})}function Io(t,e){return new xv({check:"length_equals",...S(e),length:t})}function ja(t,e){return new Iv({check:"string_format",format:"regex",...S(e),pattern:t})}function Ma(t){return new Sv({check:"string_format",format:"lowercase",...S(t)})}function Ra(t){return new kv({check:"string_format",format:"uppercase",...S(t)})}function Va(t,e){return new Dv({check:"string_format",format:"includes",...S(e),includes:t})}function Za(t,e){return new Av({check:"string_format",format:"starts_with",...S(e),prefix:t})}function Wa(t,e){return new zv({check:"string_format",format:"ends_with",...S(e),suffix:t})}function jp(t,e,r){return new Ov({check:"property",property:t,schema:e,...S(r)})}function Ja(t,e){return new Bv({check:"properties",shape:t,...S(e)})}function Ga(t,e){return new Tv({check:"mime_type",mime:t,...S(e)})}function Ur(t){return new Nv({check:"overwrite",tx:t})}function Ha(t){return Ur(e=>e.normalize(t))}function Ka(){return Ur(t=>t.trim())}function Ya(){return Ur(t=>t.toLowerCase())}function Xa(){return Ur(t=>t.toUpperCase())}function qa(){return Ur(t=>hy(t))}function C_(t,e,r){return new t({type:"array",element:e,...S(r)})}function A2(t,e,r){return new t({type:"union",options:e,...S(r)})}function z2(t,e,r){return new t({type:"union",options:e,inclusive:!1,...S(r)})}function O2(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...S(i)})}function B2(t,e,r){return new t({type:"intersection",left:e,right:r})}function T2(t,e,r,i){let n=r instanceof ee,o=n?i:r,a=n?r:null;return new t({type:"tuple",items:e,rest:a,...S(o)})}function N2(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...S(i)})}function U2(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...S(i)})}function P2(t,e,r){return new t({type:"set",valueType:e,...S(r)})}function L2(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...S(r)})}function E2(t,e,r){return new t({type:"enum",entries:e,...S(r)})}function C2(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...S(r)})}function F_(t,e){return new t({type:"file",...S(e)})}function F2(t,e){return new t({type:"transform",transform:e})}function j2(t,e){return new t({type:"optional",innerType:e})}function M2(t,e){return new t({type:"nullable",innerType:e})}function R2(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Vc(r)}})}function V2(t,e,r){return new t({type:"nonoptional",innerType:e,...S(r)})}function Z2(t,e){return new t({type:"success",innerType:e})}function W2(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:wy(r)})}function J2(t,e,r){return new t({type:"pipe",in:e,out:r})}function G2(t,e){return new t({type:"readonly",innerType:e})}function H2(t,e,r){return new t({type:"template_literal",parts:e,...S(r)})}function K2(t,e){return new t({type:"lazy",getter:e})}function Y2(t,e){return new t({type:"promise",innerType:e})}function j_(t,e,r){let i=S(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function M_(t,e,r){return new t({type:"custom",check:"custom",fn:e,...S(r)})}function R_(t,e){let r=Tz(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(za(n,i.value,r._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(za(o))}},t(i.value,i)),e);return r}function Tz(t,e){let r=new De({check:"custom",...S(e)});return r._zod.check=t,r}function V_(t){let e=new De({check:"describe"});return e._zod.onattach=[r=>{let i=ct.get(r)??{};ct.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function Z_(t){let e=new De({check:"meta"});return e._zod.onattach=[r=>{let i=ct.get(r)??{};ct.add(r,{...i,...t})}],e._zod.check=()=>{},e}function W_(t,e){let r=S(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(i),a=new Set(n),s=t.Codec??du,c=t.Boolean??uu,u=t.String??yo,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new s({type:"pipe",in:l,out:d,transform:((p,h)=>{let y=p;return r.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:a.has(y)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:h.value,inst:f,continue:!1}),{})}),reverseTransform:((p,h)=>p===!0?i[0]||"true":n[0]||"false"),error:r.error});return f._zod.bag.truthy=i,f._zod.bag.falsy=n,f._zod.bag.case=r.case??"insensitive",f}function So(t,e,r,i={}){let n=S(i),o={check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}var m_,Nz=m(()=>{Uf();vu();La();O();m_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Iu(t,...e){for(let r of e)for(let i of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,i)&&st(t,i,r[i]);return t}function pi(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ct,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function tt(t,e,r,i,n){let o=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:i.path,message:n}):e.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(n);return Object.assign(r,o),!0}function $e(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;let s=t._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,l);else{let f=a.schema,p=e.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(t,e,f,l)}let d=t._zod.parent;d&&(a.ref||(a.ref=d),$e(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Iu(a.schema,c),e.io==="input"&&Dt(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function Uz(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function mi(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let i=new Map;for(let a of t.seen.entries()){let s=t.metadataRegistry.get(a[0])?.id;if(s){let c=i.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let n=a=>{let s=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(a[0])?.id,f=t.external.uri??(h=>h);if(d)return{ref:f(d)};let p=a[1].defId??a[1].schema.id??`schema${t.counter++}`;return a[1].defId=p,{defId:p,ref:`${f("__shared")}#/${s}/${Uz(p)}`}}let c="#",u=`${c}/${s}/`;if(a[1]===r&&!a[1].schema.id)return{ref:c};let l=a[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+Uz(l)}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);let l=s.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let a of t.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
76
76
|
|
|
77
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of t.seen.entries()){let s=a[1];if(e===a[0]){o(a);continue}if(t.external){let u=t.external.registry.get(a[0])?.id;if(e!==a[0]&&u){o(a);continue}}if(t.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}s.count>1&&t.reused==="ref"&&o(a)}t.external&&(t.sharedDefsExtractedFor=t.external)}function Ez(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let r=[];for(let i of e){if(!i||typeof i!="object")return;Ez(i);let n=Object.keys(i);if(n.length!==1||n[0]!=="type")return;let o=i.type;for(let a of Array.isArray(o)?o:[o]){if(typeof a!="string")return;r.includes(a)||r.push(a)}}delete t.anyOf,t.type=r.length===1?r[0]:r}function Lz(t){let e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function J_(t){let e=[];for(let o of t){if(typeof o!="object"||o.type!=="object")return null;for(let a in o)if(!Cz.has(a))return null;e.push(o)}let r={},i=new Set;for(let o of e){for(let a in o.properties){if(Object.prototype.hasOwnProperty.call(r,a))continue;let s=[];for(let u of e){let l=u.properties?.[a]??Lz(u);l!=null&&(s.some(d=>JSON.stringify(d)===JSON.stringify(l))||s.push(l))}let c=s.length===1?s[0]:J_(s)??{allOf:s};st(r,a,c)}for(let a of o.required??[])i.add(a)}let n={type:"object",properties:r};if(i.size&&(n.required=[...i]),e.every(o=>o.additionalProperties===!1))n.additionalProperties=!1;else{let o=[];for(let a of e){let s=Lz(a);s&&!o.some(c=>JSON.stringify(c)===JSON.stringify(s))&&o.push(s)}o.length===1?n.additionalProperties=o[0]:o.length>1&&(n.additionalProperties={allOf:o})}return n}function X2(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let n of Cz)if(n in t)return;let r=e.filter(n=>Pz.some(o=>Array.isArray(n[o]))),i=null;if(!r.length)i=J_(e);else{let n=r[0],o=Pz.find(c=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let a=e.filter(c=>c!==n),s=n[o].map(c=>J_([...a,c]));if(s.some(c=>!c))return;i={[o]:s}}i&&(delete t.allOf,Iu(t,i))}function hi(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let c=t.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){i(d);let p=t.seen.get(d),h=p.schema;if(h.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Iu(u,h),Iu(u,l),s._zod.parent===d)for(let _ in u)_==="$ref"||_==="allOf"||_ in l||delete u[_];if(h.$ref&&p.def)for(let _ in u)_==="$ref"||_==="allOf"||_ in p.def&&JSON.stringify(u[_])===JSON.stringify(p.def[_])&&delete u[_]}let f=s._zod.parent;if(f&&f!==d){i(f);let p=t.seen.get(f);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}t.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let s of[...t.seen.entries()].reverse())i(s[0]);if(t.target!=="openapi-3.0")for(let s of t.seen.entries())Ez(s[1].def??s[1].schema);for(let s of t.deferred)s();if(t.intersections.length){let s=new Map;for(let c of t.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=s.get(l);d?d.push(u):s.set(l,[u])}for(let c of t.intersections)for(let u of s.get(c)??[])X2(u)}}let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(s)}Iu(n,r.defId?r.schema:r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&n.id===o&&delete n.id;let a=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let s of t.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,st(a,c.defId,c.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Qa(e,"input",t.processors),output:Qa(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Dt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Dt(i.element,r);if(i.type==="set")return Dt(i.valueType,r);if(i.type==="lazy")return Dt(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return Dt(i.innerType,r);if(i.type==="intersection")return Dt(i.left,r)||Dt(i.right,r);if(i.type==="record"||i.type==="map")return Dt(i.keyType,r)||Dt(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Dt(i.in,r)||Dt(i.out,r);if(i.type==="object"){for(let n in i.shape)if(Dt(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(Dt(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(Dt(n,r))return!0;return!!(i.rest&&Dt(i.rest,r))}return!1}var Cz,Pz,G_,Qa,Su=m(()=>{vu();O();Cz=new Set(["type","properties","required","additionalProperties"]),Pz=["oneOf","anyOf"];G_=(t,e={})=>r=>{let i=pi({...r,processors:e});return $e(t,i),mi(i,t),hi(i,t)},Qa=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},a=pi({...n??{},target:o,io:e,processors:r});return $e(t,a),mi(a,t),hi(a,t)}});function rt(t){let e={},r=t._zod.def,i=t._zod.traits.has("$ZodCheck")?[t,...r.checks??[]]:r.checks??[];for(let o of i)q2[o._zod.def.check]?.(e,o._zod.def);let n=t._zod.bag;n.minimum!==void 0&&es(e,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&es(e,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&ts(e,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&ts(e,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&Vz(e,n.multipleOf),n.format!==void 0&&(e.format??(e.format=n.format),n.format.includes("int")&&(e.isInt=!0)),n.mime&&Wz(e,n.mime);for(let o of n.patterns??[])Zz(e,o);return e}function ku(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?ku(e.out):e.type==="catch"?ku(e.innerType):t._zod.optin}function H_(t,e,r){if(e.$ref){if(r.has(e))return e;r.add(e);let h=t.get(e)?.def;if(!h)return e;let y=H_(t,h,r);return y===h?e:y}for(let h of["anyOf","oneOf"]){let y=e[h];if(!Array.isArray(y))continue;let _=y.map(D=>H_(t,D,r));_.some((D,I)=>D!==y[I])&&(e={...e,[h]:_})}let i=Array.isArray(e.type)?e.type:[e.type],n=!i.includes("string")&&i.some(h=>h==="number"||h==="integer"),o=e.enum??(e.const!==void 0?[e.const]:void 0);if(!n&&!o?.some(h=>typeof h=="number"))return e;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:f,...p}=e;return p.enum?p.enum=p.enum.map(h=>typeof h=="number"?String(h):h):typeof p.const=="number"&&(p.const=String(p.const)),n&&(p.type="string",o||(p.pattern=(i.includes("number")?Cn:tu).source)),p}function tC(t){let e=new Map;for(let i of t.seen.values())i.def&&!e.has(i.schema)&&e.set(i.schema,i);let r=new Map;for(let i of K_.get(t)??[]){let n=t.seen.get(i),o=(n?.def??n?.schema)?.propertyNames;if(!o||o===!0||r.has(o))continue;let a=H_(e,o,new Set);a!==o&&r.set(o,a)}if(r.size)for(let i of t.seen.values())for(let n of[i.schema,i.def]){let o=n&&r.get(n.propertyNames);o&&(n.propertyNames=o)}}function Hz(t,e,r,i,n){let o=!1,a=JSON.stringify(t,(s,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(tt(e,r,i,n,"BigInt defaults cannot be represented in JSON Schema"),kw):JSON.parse(a)}function Zp(t,e){if("_idmap"in t){let i=t,n=pi({...e,processors:Mp}),o={};for(let c of i._idmap.entries()){let[u,l]=c;$e(l,n)}let a={},s={registry:i,uri:e?.uri,defs:o};n.external=s;for(let c of i._idmap.entries()){let[u,l]=c;mi(n,l),st(a,u,hi(n,l))}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let r=pi({...e,processors:Mp});return $e(t,r),mi(r,t),hi(r,t)}var es,ts,Fz,Vz,Zz,Wz,Jz,jz,Mz,Rz,q2,Q2,eC,Gz,Y_,X_,q_,Q_,ew,tw,rw,nw,iw,ow,aw,sw,cw,uw,lw,dw,fw,pw,mw,hw,gw,yw,vw,bw,_w,Rp,ww,$w,K_,xw,Iw,Sw,kw,Dw,Aw,zw,Ow,Bw,Tw,Vp,Nw,Mp,Du=m(()=>{ho();La();Su();O();es=(t,e,r)=>{(t[e]===void 0||r>t[e])&&(t[e]=r)},ts=(t,e,r)=>{(t[e]===void 0||r<t[e])&&(t[e]=r)},Fz=(t,e)=>{es(t,"minimum",e),ts(t,"maximum",e)},Vz=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},Zz=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},Wz=(t,e)=>{t.mime=t.mime?t.mime.filter(r=>e.includes(r)):[...e]},Jz=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},jz=(t,e)=>es(t,"minimum",e.minimum),Mz=(t,e)=>ts(t,"maximum",e.maximum),Rz=t=>(e,r)=>{Jz(e,r.format);let[i,n]=t[r.format];es(e,"minimum",i),ts(e,"maximum",n)},q2={greater_than:(t,e)=>es(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>ts(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>Vz(t,e.value),number_format:Rz(Wc),bigint_format:Rz(Jc),min_length:jz,max_length:Mz,length_equals:(t,e)=>Fz(t,e.length),min_size:jz,max_size:Mz,size_equals:(t,e)=>Fz(t,e.size),string_format:(t,e)=>{Jz(t,e.format),e.pattern&&Zz(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>Wz(t,e.mime)};Q2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},eC=new Map([[Wf,Ky],[cu,Yy]]),Gz=t=>eC.get(t)??t,Y_=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:u,laxFormat:l}=rt(t);if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=Q2[s]??s,n.format===""&&delete n.format,(s==="time"||l)&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let d=[...c].map(Gz);d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(f=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},X_=(t,e,r,i)=>{let n=r,{minimum:o,maximum:a,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=rt(t);n.type=l?"integer":"number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";if(d?p?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof o=="number"&&(n.minimum=o),f?p?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof a=="number"&&(n.maximum=a),s){let h=new Set;for(let D of s)Number.isFinite(D)&&D!==0?h.add(Math.abs(D)):tt(t,e,n,i,`A multipleOf divisor of ${D} cannot be represented in JSON Schema`);let[y,..._]=h;y!==void 0&&(n.multipleOf=y),_.length&&(n.allOf=[...n.allOf??[],..._.map(D=>({multipleOf:D}))])}},q_=(t,e,r,i)=>{r.type="boolean"},Q_=(t,e,r,i)=>{tt(t,e,r,i,"BigInt cannot be represented in JSON Schema")},ew=(t,e,r,i)=>{tt(t,e,r,i,"Symbols cannot be represented in JSON Schema")},tw=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},rw=(t,e,r,i)=>{tt(t,e,r,i,"Undefined cannot be represented in JSON Schema")},nw=(t,e,r,i)=>{tt(t,e,r,i,"Void cannot be represented in JSON Schema")},iw=(t,e,r,i)=>{r.not={}},ow=(t,e,r,i)=>{},aw=(t,e,r,i)=>{},sw=(t,e,r,i)=>{tt(t,e,r,i,"Date cannot be represented in JSON Schema")},cw=(t,e,r,i)=>{let n=t._zod.def,o=Sa(n.entries);if(o.length===0){r.not={};return}o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},uw=(t,e,r,i)=>{let n=t._zod.def;if(n.values.length===0){r.not={};return}let o=[];for(let a of n.values)if(a===void 0){if(tt(t,e,r,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(tt(t,e,r,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},lw=(t,e,r,i)=>{tt(t,e,r,i,"NaN cannot be represented in JSON Schema")},dw=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},fw=(t,e,r,i)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:o,maximum:a,mime:s}=rt(t);o!==void 0&&(n.minLength=o),a!==void 0&&(n.maxLength=a),s&&(s.length===0?n.not={}:s.length===1?n.contentMediaType=s[0]:n.anyOf=s.map(c=>({contentMediaType:c})))},pw=(t,e,r,i)=>{r.type="boolean"},mw=(t,e,r,i)=>{tt(t,e,r,i,"Custom types cannot be represented in JSON Schema")},hw=(t,e,r,i)=>{tt(t,e,r,i,"Function types cannot be represented in JSON Schema")},gw=(t,e,r,i)=>{tt(t,e,r,i,"Transforms cannot be represented in JSON Schema")},yw=(t,e,r,i)=>{tt(t,e,r,i,"Map cannot be represented in JSON Schema")},vw=(t,e,r,i)=>{tt(t,e,r,i,"Set cannot be represented in JSON Schema")},bw=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:a,maximum:s}=rt(t);typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=$e(o.element,e,{...i,path:[...i.path,"items"]})};_w=(t,e,r,i)=>{let n=r,o=t._zod.def,a=o.shape;if(Object.getOwnPropertySymbols(a).length&&tt(t,e,n,i,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in a)st(n.properties,u,$e(a[u],e,{...i,path:[...i.path,"properties",u]}));let c=[];for(let u of Object.keys(a)){let l=o.shape[u];(e.io==="input"?ku(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(n.required=c),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=$e(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},Rp=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,a=n.options.map((s,c)=>$e(s,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=a:r.anyOf=a},ww=(t,e,r,i)=>{let n=t._zod.def,o=$e(n.left,e,{...i,path:[...i.path,"allOf",0]}),a=$e(n.right,e,{...i,path:[...i.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=c,e.intersections.push(c)},$w=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let a=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((y,_)=>$e(y,e,{...i,path:[...i.path,a,_]})),u=o.rest?$e(o.rest,e,{...i,path:[...i.path,s,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null,l=o.items.length;for(;l>0;){let y=o.items[l-1];if(!(e.io==="input"?ku(y)!==void 0:y._zod.optout==="optional"))break;l--}let d=o.items.length,f=!o.rest;e.target==="draft-2020-12"?(n.prefixItems=c,f?n.items=!1:u&&(n.items=u),l>0&&(n.minItems=l),f&&(n.maxItems=d)):e.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),l>0&&(n.minItems=l),f&&(n.maxItems=d)):(n.items=c,f?n.additionalItems=!1:u&&(n.additionalItems=u),l>0&&(n.minItems=l),f&&(n.maxItems=d));let{minimum:p,maximum:h}=rt(t);typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)};K_=new WeakMap;xw=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let a=o.keyType,s=rt(a).patterns;if(o.mode==="loose"&&s&&s.size>0){let l=$e(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of s)st(n.patternProperties,Gz(d).source,l)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){n.propertyNames=$e(o.keyType,e,{...i,path:[...i.path,"propertyNames"]});let l=K_.get(e);l||(l=[],K_.set(e,l),e.deferred.push(()=>tC(e))),l.push(t)}n.additionalProperties=$e(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]})}let c=a._zod.values,u=e.io==="input"&&ku(o.valueType)!==void 0;if(c&&!o.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l.map(String))}},Iw=(t,e,r,i)=>{let n=t._zod.def,o=$e(n.innerType,e,i),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Sw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},kw=Symbol();Dw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let a=Hz(n.defaultValue,t,e,r,i);a!==kw&&(r.default=a)},Aw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);if(o.ref=n.innerType,e.io!=="input")return;let a=Hz(n.defaultValue,t,e,r,i);a!==kw&&(r._prefault=a)},zw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{tt(t,e,r,i,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},Ow=(t,e,r,i)=>{let n=t._zod.def,o=n.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?o?n.out:n.in:n.out;$e(a,e,i);let s=e.seen.get(t);s.ref=a},Bw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},Tw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Vp=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Nw=(t,e,r,i)=>{let n=t._zod.innerType;$e(n,e,i);let o=e.seen.get(t);o.ref=n},Mp={string:Y_,number:X_,boolean:q_,bigint:Q_,symbol:ew,null:tw,undefined:rw,void:nw,never:iw,any:ow,unknown:aw,date:sw,enum:cw,literal:uw,nan:lw,template_literal:dw,file:fw,success:pw,custom:mw,function:hw,transform:gw,map:yw,set:vw,array:bw,object:_w,union:Rp,intersection:ww,tuple:$w,record:xw,nullable:Iw,nonoptional:Sw,default:Dw,prefault:Aw,catch:zw,pipe:Ow,readonly:Bw,promise:Tw,optional:Vp,lazy:Nw}});var Wp,Kz=m(()=>{Du();Su();Wp=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=pi({processors:Mp,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return $e(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,mi(this.ctx,e);let i=hi(this.ctx,e),{"~standard":n,...o}=i;return o}}});var Yz={};var Xz=m(()=>{});var jn={};Ie(jn,{$ZodAny:()=>yb,$ZodArray:()=>$b,$ZodAsyncError:()=>Ft,$ZodBase64:()=>ob,$ZodBase64URL:()=>ab,$ZodBigInt:()=>Xf,$ZodBigIntFormat:()=>pb,$ZodBoolean:()=>uu,$ZodCIDRv4:()=>nb,$ZodCIDRv6:()=>ib,$ZodCUID:()=>Wv,$ZodCUID2:()=>Jv,$ZodCatch:()=>Mb,$ZodCheck:()=>De,$ZodCheckBigIntFormat:()=>yv,$ZodCheckEndsWith:()=>zv,$ZodCheckGreaterThan:()=>Nf,$ZodCheckIncludes:()=>Dv,$ZodCheckLengthEquals:()=>xv,$ZodCheckLessThan:()=>Tf,$ZodCheckLowerCase:()=>Sv,$ZodCheckMaxLength:()=>wv,$ZodCheckMaxSize:()=>vv,$ZodCheckMimeType:()=>Tv,$ZodCheckMinLength:()=>$v,$ZodCheckMinSize:()=>bv,$ZodCheckMultipleOf:()=>hv,$ZodCheckNumberFormat:()=>gv,$ZodCheckOverwrite:()=>Nv,$ZodCheckProperties:()=>Bv,$ZodCheckProperty:()=>Ov,$ZodCheckRegex:()=>Iv,$ZodCheckSizeEquals:()=>_v,$ZodCheckStartsWith:()=>Av,$ZodCheckStringFormat:()=>Ua,$ZodCheckUpperCase:()=>kv,$ZodCodec:()=>du,$ZodCreditCard:()=>cb,$ZodCustom:()=>Hb,$ZodCustomStringFormat:()=>db,$ZodCyclicError:()=>ip,$ZodDate:()=>wb,$ZodDefault:()=>Eb,$ZodDiscriminatedUnion:()=>kb,$ZodE164:()=>sb,$ZodEmail:()=>Fv,$ZodEmoji:()=>Vv,$ZodEncodeError:()=>li,$ZodEnum:()=>Bb,$ZodError:()=>Dy,$ZodExactOptional:()=>Pb,$ZodFile:()=>Nb,$ZodFunction:()=>Jb,$ZodGUID:()=>Ev,$ZodIBAN:()=>ub,$ZodIPv4:()=>eb,$ZodIPv6:()=>tb,$ZodISODate:()=>Xv,$ZodISODateTime:()=>Yv,$ZodISODuration:()=>Qv,$ZodISOTime:()=>qv,$ZodIntersection:()=>Db,$ZodJWT:()=>lb,$ZodKSUID:()=>Kv,$ZodLazy:()=>fu,$ZodLiteral:()=>Tb,$ZodMAC:()=>rb,$ZodMap:()=>zb,$ZodNaN:()=>Rb,$ZodNanoID:()=>Zv,$ZodNever:()=>bb,$ZodNonOptional:()=>Fb,$ZodNull:()=>gb,$ZodNullable:()=>Lb,$ZodNumber:()=>Yf,$ZodNumberFormat:()=>fb,$ZodObject:()=>eA,$ZodObjectJIT:()=>xb,$ZodOptional:()=>Qf,$ZodPipe:()=>ep,$ZodPrefault:()=>Cb,$ZodPreprocess:()=>Vb,$ZodPromise:()=>Gb,$ZodReadonly:()=>Zb,$ZodRealError:()=>jt,$ZodRecord:()=>Ab,$ZodRegistry:()=>lp,$ZodSet:()=>Ob,$ZodString:()=>yo,$ZodStringFormat:()=>we,$ZodSuccess:()=>jb,$ZodSymbol:()=>mb,$ZodTemplateLiteral:()=>Wb,$ZodTransform:()=>Ub,$ZodTuple:()=>qf,$ZodType:()=>ee,$ZodULID:()=>Gv,$ZodURL:()=>Rv,$ZodUUID:()=>Cv,$ZodUndefined:()=>hb,$ZodUnion:()=>lu,$ZodUnknown:()=>vb,$ZodVoid:()=>_b,$ZodXID:()=>Hv,$ZodXor:()=>Ib,$brand:()=>Iy,$constructor:()=>v,$input:()=>n_,$output:()=>r_,Doc:()=>go,INVALID:()=>kt,JSONSchema:()=>Yz,JSONSchemaGenerator:()=>Wp,NEVER:()=>xy,TimePrecision:()=>m_,URL_BAD_FORMAT:()=>jv,URL_UNPARSEABLE:()=>iu,ZodCompileAsyncError:()=>Nr,ZodCompileUnsupportedError:()=>fe,_any:()=>B_,_array:()=>C_,_base64:()=>Tp,_base64url:()=>Np,_bigint:()=>I_,_boolean:()=>$_,_catch:()=>W2,_check:()=>Tz,_cidrv4:()=>Op,_cidrv6:()=>Bp,_coercedBigint:()=>S_,_coercedBoolean:()=>x_,_coercedDate:()=>L_,_coercedNumber:()=>g_,_coercedString:()=>l_,_creditCard:()=>f_,_cuid:()=>xp,_cuid2:()=>Ip,_custom:()=>j_,_date:()=>P_,_decode:()=>wf,_decodeAsync:()=>xf,_default:()=>R2,_discriminatedUnion:()=>O2,_e164:()=>Up,_email:()=>hp,_emoji:()=>wp,_encode:()=>_f,_encodeAsync:()=>$f,_endsWith:()=>Wa,_enum:()=>L2,_file:()=>F_,_float32:()=>v_,_float64:()=>b_,_gt:()=>un,_gte:()=>tr,_guid:()=>gp,_iban:()=>p_,_includes:()=>Va,_int:()=>y_,_int32:()=>__,_int64:()=>k_,_intersection:()=>B2,_ipv4:()=>Ap,_ipv6:()=>zp,_isoDate:()=>wu,_isoDateTime:()=>_u,_isoDuration:()=>xu,_isoTime:()=>$u,_jwt:()=>Pp,_ksuid:()=>Dp,_lazy:()=>K2,_length:()=>Io,_literal:()=>C2,_lowercase:()=>Ma,_lt:()=>cn,_lte:()=>er,_mac:()=>d_,_map:()=>U2,_max:()=>er,_maxLength:()=>xo,_maxSize:()=>fi,_mime:()=>Ga,_min:()=>tr,_minLength:()=>Fn,_minSize:()=>ln,_multipleOf:()=>di,_nan:()=>E_,_nanoid:()=>$p,_nativeEnum:()=>E2,_negative:()=>Ep,_never:()=>N_,_nonnegative:()=>Fp,_nonoptional:()=>V2,_nonpositive:()=>Cp,_normalize:()=>Ha,_null:()=>O_,_nullable:()=>M2,_number:()=>h_,_optional:()=>j2,_overwrite:()=>Ur,_parse:()=>Oa,_parseAsync:()=>Ba,_pipe:()=>J2,_positive:()=>Lp,_promise:()=>Y2,_properties:()=>Ja,_property:()=>jp,_readonly:()=>G2,_record:()=>N2,_refine:()=>M_,_regex:()=>ja,_safeDecode:()=>Sf,_safeDecodeAsync:()=>Df,_safeEncode:()=>If,_safeEncodeAsync:()=>kf,_safeParse:()=>Ta,_safeParseAsync:()=>Na,_set:()=>P2,_size:()=>$o,_slugify:()=>qa,_startsWith:()=>Za,_string:()=>u_,_stringFormat:()=>So,_stringbool:()=>W_,_success:()=>Z2,_superRefine:()=>R_,_symbol:()=>A_,_templateLiteral:()=>H2,_toLowerCase:()=>Ya,_toUpperCase:()=>Xa,_transform:()=>F2,_trim:()=>Ka,_tuple:()=>T2,_uint32:()=>w_,_uint64:()=>D_,_ulid:()=>Sp,_undefined:()=>z_,_union:()=>A2,_unknown:()=>T_,_uppercase:()=>Ra,_url:()=>bu,_uuid:()=>yp,_uuidv4:()=>vp,_uuidv6:()=>bp,_uuidv7:()=>_p,_void:()=>U_,_xid:()=>kp,_xor:()=>z2,base64Charset:()=>Wf,base64urlCharset:()=>cu,canParseURL:()=>Mv,clone:()=>_e,compile:()=>s_,compileFn:()=>pp,config:()=>Me,createStandardJSONSchemaMethod:()=>Qa,createToJSONSchemaMethod:()=>G_,decode:()=>TP,decodeAsync:()=>UP,describe:()=>V_,encode:()=>BP,encodeAsync:()=>NP,extractDefs:()=>mi,finalize:()=>hi,flattenError:()=>Yc,formatError:()=>Xc,getDiscriminatedOption:()=>Sb,globalConfig:()=>nt,globalRegistry:()=>ct,handleUnrepresentable:()=>tt,initializeContext:()=>pi,isBackEdge:()=>ap,isRecursiveSchema:()=>op,isValidBase64:()=>su,isValidBase64URL:()=>Jf,isValidCIDRv6:()=>Zf,isValidCreditCard:()=>Gf,isValidIBAN:()=>Hf,isValidIPv6:()=>au,isValidJWT:()=>Kf,locales:()=>yu,memoizer:()=>hu,mergeValues:()=>Pa,meta:()=>Z_,parse:()=>vf,parseAsync:()=>bf,parseURLObject:()=>XD,prettifyError:()=>zy,process:()=>$e,processSchema:()=>$e,regexes:()=>hr,registry:()=>dp,safeDecode:()=>LP,safeDecodeAsync:()=>CP,safeEncode:()=>PP,safeEncodeAsync:()=>EP,safeParse:()=>kP,safeParseAsync:()=>DP,standardProps:()=>jf,stripTabAndNewline:()=>ou,toDotPath:()=>OD,toJSONSchema:()=>Zp,toZod:()=>Mc,treeifyError:()=>Ay,urlHostnameOk:()=>Rf,urlProtocolOk:()=>Vf,util:()=>w,validate:()=>qc,validateAsync:()=>Qc,validateURL:()=>Mf,version:()=>Uv,withParser:()=>fp});var rr=m(()=>{ui();By();Oy();La();Xb();Uf();Pv();O();O();ho();t_();vu();Pf();Bz();Nz();Su();Du();Kz();Xz()});var Jp={};Ie(Jp,{endsWith:()=>Wa,gt:()=>un,gte:()=>tr,includes:()=>Va,length:()=>Io,lowercase:()=>Ma,lt:()=>cn,lte:()=>er,maxLength:()=>xo,maxSize:()=>fi,mime:()=>Ga,minLength:()=>Fn,minSize:()=>ln,multipleOf:()=>di,negative:()=>Ep,nonnegative:()=>Fp,nonpositive:()=>Cp,normalize:()=>Ha,overwrite:()=>Ur,positive:()=>Lp,properties:()=>Ja,property:()=>jp,regex:()=>ja,size:()=>$o,slugify:()=>qa,startsWith:()=>Za,toLowerCase:()=>Ya,toUpperCase:()=>Xa,trim:()=>Ka,uppercase:()=>Ra});var Gp=m(()=>{rr()});function Hp(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){let i=r(this);return Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0})}})}var qz,Qz,nC,Mt,Uw=m(()=>{rr();rr();O();qz=new WeakSet([Object.prototype,Error.prototype]);Qz=(t,e)=>{Dy.init(t,e),t.name="ZodError";let r=Object.getPrototypeOf(t);qz.has(r)||(qz.add(r),Hp(r,"format",i=>n=>Xc(i,n)),Hp(r,"flatten",i=>n=>Yc(i,n)),Hp(r,"addIssue",i=>n=>{i.issues.push(n),i.message=JSON.stringify(i.issues,ka,2)}),Hp(r,"addIssues",i=>n=>{i.issues.push(...n),i.message=JSON.stringify(i.issues,ka,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},nC=v("ZodError",Qz),Mt=v("ZodError",Qz,void 0,{Parent:Error})});var Pw,Lw,Ew,Cw,Fw,jw,Mw,Rw,Vw,Zw,Ww,Jw,Gw=m(()=>{rr();Uw();rr();Pw=Oa(Mt),Lw=Ba(Mt),Ew=Ta(Mt),Cw=Na(Mt),Fw=_f(Mt),jw=wf(Mt),Mw=$f(Mt),Rw=xf(Mt),Vw=If(Mt),Zw=Sf(Mt),Ww=kf(Mt),Jw=Df(Mt)});var us={};Ie(us,{ZodAny:()=>n$,ZodArray:()=>s$,ZodBase64:()=>dm,ZodBase64URL:()=>fm,ZodBigInt:()=>ss,ZodBigIntFormat:()=>hm,ZodBoolean:()=>as,ZodCIDRv4:()=>um,ZodCIDRv6:()=>lm,ZodCUID:()=>rm,ZodCUID2:()=>nm,ZodCatch:()=>A$,ZodCodec:()=>Eu,ZodCreditCard:()=>Kw,ZodCustom:()=>Cu,ZodCustomStringFormat:()=>zo,ZodDate:()=>Bu,ZodDefault:()=>$$,ZodDiscriminatedUnion:()=>u$,ZodE164:()=>pm,ZodEmail:()=>qp,ZodEmoji:()=>em,ZodEnum:()=>ns,ZodExactOptional:()=>bm,ZodFile:()=>v$,ZodFunction:()=>C$,ZodGUID:()=>Qp,ZodIBAN:()=>Yw,ZodIPv4:()=>sm,ZodIPv6:()=>cm,ZodISODate:()=>yi,ZodISODateTime:()=>gi,ZodISODuration:()=>bi,ZodISOTime:()=>vi,ZodInstanceOf:()=>M$,ZodIntersection:()=>l$,ZodJWT:()=>mm,ZodKSUID:()=>am,ZodLazy:()=>P$,ZodLiteral:()=>y$,ZodMAC:()=>Hw,ZodMap:()=>h$,ZodNaN:()=>O$,ZodNanoID:()=>tm,ZodNever:()=>o$,ZodNonOptional:()=>_m,ZodNull:()=>t$,ZodNullable:()=>w$,ZodNumber:()=>os,ZodNumberFormat:()=>Oo,ZodObject:()=>Nu,ZodOptional:()=>Pu,ZodPipe:()=>Lu,ZodPrefault:()=>I$,ZodPreprocess:()=>B$,ZodPromise:()=>E$,ZodReadonly:()=>T$,ZodRecord:()=>rs,ZodSet:()=>g$,ZodString:()=>is,ZodStringFormat:()=>xe,ZodSuccess:()=>D$,ZodSymbol:()=>Qw,ZodTemplateLiteral:()=>U$,ZodTransform:()=>b$,ZodTuple:()=>f$,ZodType:()=>oe,ZodULID:()=>im,ZodURL:()=>Ou,ZodUUID:()=>dn,ZodUndefined:()=>e$,ZodUnion:()=>Uu,ZodUnknown:()=>i$,ZodVoid:()=>a$,ZodXID:()=>om,ZodXor:()=>c$,_ZodString:()=>Xp,_default:()=>x$,_function:()=>uB,any:()=>jO,array:()=>Tu,base64:()=>_O,base64url:()=>wO,bigint:()=>PO,boolean:()=>qw,catch:()=>z$,check:()=>lB,cidrv4:()=>vO,cidrv6:()=>bO,codec:()=>oB,creditCard:()=>xO,cuid:()=>lO,cuid2:()=>dO,currencyCode:()=>zO,custom:()=>dB,date:()=>RO,describe:()=>fB,discriminatedUnion:()=>HO,e164:()=>$O,email:()=>eO,emoji:()=>cO,enum:()=>ym,exactOptional:()=>_$,file:()=>tB,float32:()=>BO,float64:()=>TO,function:()=>uB,guid:()=>tO,hash:()=>OO,hex:()=>AO,hostname:()=>DO,httpUrl:()=>sO,iban:()=>IO,instanceof:()=>mB,int:()=>Kp,int32:()=>NO,int64:()=>LO,intersection:()=>d$,invertCodec:()=>aB,ipv4:()=>hO,ipv6:()=>yO,json:()=>gB,jwt:()=>SO,keyof:()=>VO,ksuid:()=>mO,lazy:()=>L$,literal:()=>eB,looseObject:()=>JO,looseRecord:()=>YO,mac:()=>gO,map:()=>XO,meta:()=>pB,nan:()=>iB,nanoid:()=>uO,nativeEnum:()=>QO,never:()=>gm,nonoptional:()=>k$,null:()=>r$,nullable:()=>zu,nullish:()=>rB,number:()=>Xw,object:()=>ZO,optional:()=>Do,partialRecord:()=>KO,pipe:()=>Yp,prefault:()=>S$,preprocess:()=>yB,promise:()=>cB,readonly:()=>N$,record:()=>m$,refine:()=>F$,set:()=>qO,strictObject:()=>WO,string:()=>Au,stringFormat:()=>kO,stringbool:()=>hB,success:()=>nB,superRefine:()=>j$,symbol:()=>CO,templateLiteral:()=>sB,transform:()=>vm,tuple:()=>p$,uint32:()=>UO,uint64:()=>EO,ulid:()=>fO,undefined:()=>FO,union:()=>cs,unknown:()=>ko,url:()=>aO,uuid:()=>rO,uuidv4:()=>nO,uuidv6:()=>iO,uuidv7:()=>oO,void:()=>MO,xid:()=>pO,xor:()=>GO});function oC(){nt.localeError||Me(sp())}function Ao(){nt.memoizer||Me({memoizer:hu()})}function Au(t){return u_(is,t)}function eO(t){return hp(qp,t)}function tO(t){return gp(Qp,t)}function rO(t){return yp(dn,t)}function nO(t){return vp(dn,t)}function iO(t){return bp(dn,t)}function oO(t){return _p(dn,t)}function aO(t){return bu(Ou,t)}function sO(t){return bu(Ou,{protocol:eu,hostname:qy,...w.normalizeParams(t)})}function cO(t){return wp(em,t)}function uO(t){return $p(tm,t)}function lO(t){return xp(rm,t)}function dO(t){return Ip(nm,t)}function fO(t){return Sp(im,t)}function pO(t){return kp(om,t)}function mO(t){return Dp(am,t)}function hO(t){return Ap(sm,t)}function gO(t){return d_(Hw,t)}function yO(t){return zp(cm,t)}function vO(t){return Op(um,t)}function bO(t){return Bp(lm,t)}function _O(t){return Tp(dm,t)}function wO(t){return Np(fm,t)}function $O(t){return Up(pm,t)}function xO(t){return f_(Kw,t)}function IO(t){return p_(Yw,t)}function SO(t){return Pp(mm,t)}function kO(t,e,r={}){return So(zo,t,e,r)}function DO(t){return So(zo,"hostname",Xy,t)}function AO(t){return So(zo,"hex",fv,t)}function zO(t){return So(zo,"currency_code",ev,t)}function OO(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=hr[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return So(zo,i,n,e)}function Xw(t){return h_(os,t)}function Kp(t){return y_(Oo,t)}function BO(t){return v_(Oo,t)}function TO(t){return b_(Oo,t)}function NO(t){return __(Oo,t)}function UO(t){return w_(Oo,t)}function qw(t){return $_(as,t)}function PO(t){return I_(ss,t)}function LO(t){return k_(hm,t)}function EO(t){return D_(hm,t)}function CO(t){return A_(Qw,t)}function FO(t){return z_(e$,t)}function r$(t){return O_(t$,t)}function jO(){return B_(n$)}function ko(){return T_(i$)}function gm(t){return N_(o$,t)}function MO(t){return U_(a$,t)}function RO(t){return P_(Bu,t)}function Tu(t,e){return C_(s$,t,e)}function VO(t){let e=t._zod.def.shape;return ym(Object.keys(e))}function ZO(t,e){let r={type:"object",shape:t??{},...w.normalizeParams(e)};return new Nu(r)}function WO(t,e){return new Nu({type:"object",shape:t,catchall:gm(),...w.normalizeParams(e)})}function JO(t,e){return new Nu({type:"object",shape:t,catchall:ko(),...w.normalizeParams(e)})}function cs(t,e){return new Uu({type:"union",options:t,...w.normalizeParams(e)})}function GO(t,e){return new c$({type:"union",options:t,inclusive:!1,...w.normalizeParams(e)})}function HO(t,e,r){return new u$({type:"union",options:e,discriminator:t,...w.normalizeParams(r)})}function d$(t,e){return new l$({type:"intersection",left:t,right:e})}function p$(t,e,r){let i=e instanceof ee,n=i?r:e,o=i?e:null;return new f$({type:"tuple",items:t,rest:o,...w.normalizeParams(n)})}function m$(t,e,r){return!e||!e._zod?new rs({type:"record",keyType:Au(),valueType:t,...w.normalizeParams(e)}):new rs({type:"record",keyType:t,valueType:e,...w.normalizeParams(r)})}function KO(t,e,r){return new rs({type:"record",keyType:t,valueType:e,...w.normalizeParams(r),partial:!0})}function YO(t,e,r){return new rs({type:"record",keyType:t,valueType:e,mode:"loose",...w.normalizeParams(r)})}function XO(t,e,r){return new h$({type:"map",keyType:t,valueType:e,...w.normalizeParams(r)})}function qO(t,e){return new g$({type:"set",valueType:t,...w.normalizeParams(e)})}function ym(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new ns({type:"enum",entries:r,...w.normalizeParams(e)})}function QO(t,e){return new ns({type:"enum",entries:t,...w.normalizeParams(e)})}function eB(t,e){return new y$({type:"literal",values:Array.isArray(t)?t:[t],...w.normalizeParams(e)})}function tB(t){return F_(v$,t)}function vm(t){return new b$({type:"transform",transform:t})}function Do(t){return new Pu({type:"optional",innerType:t})}function _$(t){return new bm({type:"optional",innerType:t})}function zu(t){return new w$({type:"nullable",innerType:t})}function rB(t){return Do(zu(t))}function x$(t,e){return new $$({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():w.shallowClone(e)}})}function S$(t,e){return new I$({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():w.shallowClone(e)}})}function k$(t,e){return new _m({type:"nonoptional",innerType:t,...w.normalizeParams(e)})}function nB(t){return new D$({type:"success",innerType:t})}function z$(t,e){return new A$({type:"catch",innerType:t,catchValue:typeof e=="function"?e:w.constantCatch(e)})}function iB(t){return E_(O$,t)}function Yp(t,e){return new Lu({type:"pipe",in:t,out:e})}function oB(t,e,r){return new Eu({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function aB(t){let e=t._zod.def;return new Eu({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function N$(t){return new T$({type:"readonly",innerType:t})}function sB(t,e){return new U$({type:"template_literal",parts:t,...w.normalizeParams(e)})}function L$(t){return new P$({type:"lazy",getter:t})}function cB(t){return new E$({type:"promise",innerType:t})}function uB(t){return new C$({type:"function",input:Array.isArray(t?.input)?p$(t?.input):t?.input??Tu(ko()),output:t?.output??ko()})}function lB(t){let e=new De({check:"custom"});return e._zod.check=t,e}function dB(t,e){return j_(Cu,t??(()=>!0),e)}function F$(t,e={}){return M_(Cu,t,e)}function j$(t,e){return R_(t,e)}function mB(t,e={}){let r=new M$({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...w.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}function gB(t){let e=L$(()=>cs([Au(t),Xw(),qw(),r$(),Tu(e),m$(Au(),e)]));return e}function yB(t,e){return new B$({type:"pipe",in:vm(t),out:e})}var oe,Xp,is,xe,gi,yi,vi,bi,qp,Qp,dn,Ou,em,tm,rm,nm,im,om,am,sm,Hw,cm,um,lm,dm,fm,pm,Kw,Yw,mm,zo,os,Oo,as,ss,hm,Qw,e$,t$,n$,i$,o$,a$,Bu,s$,Nu,Uu,c$,u$,l$,f$,rs,h$,g$,ns,y$,v$,b$,Pu,bm,w$,$$,I$,_m,D$,A$,O$,Lu,Eu,B$,T$,U$,P$,E$,C$,Cu,fB,pB,M$,hB,_i=m(()=>{rr();rr();Du();ho();Su();qb();Gp();Gw();oe=v("ZodType",(t,e)=>(oC(),ee.init(t,e),t.def=e,t.type=e.type,t),{check(...t){let e=this.def;return this.clone(w.mergeDefs(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return _e(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(F$(t,e))},superRefine(t,e){return this.check(j$(t,e))},overwrite(t){return this.check(Ur(t))},optional(){return Do(this)},exactOptional(){return _$(this)},nullable(){return zu(this)},nullish(){return Do(zu(this))},nonoptional(t){return k$(this,t)},array(){return Tu(this)},or(t){return cs([this,t])},and(t){return d$(this,t)},transform(t){return Yp(this,vm(t))},default(t){return x$(this,t)},prefault(t){return S$(this,t)},catch(t){return z$(this,t)},pipe(t){return Yp(this,t)},readonly(){return N$(this)},describe(t){let e=this.clone();return ct.add(e,{description:t}),e},meta(...t){if(t.length===0)return ct.get(this);let e=this.clone();return ct.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return w.hide(this,"~standard",{...jf(this),jsonSchema:{input:Qa(this,"input"),output:Qa(this,"output")}})},set"~standard"(t){w.own(this,"~standard",t)},parse:function t(e,r){return Pw(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await Lw(this,e,r,{callee:t})},safeParse(t,e){return Ew(this,t,e)},async safeParseAsync(t,e){return Cw(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){w.own(this,"spa",t)},validate(t,e){return qc(this,t,e)},validateAsync(t,e){return Qc(this,t,e)},encode:function t(e,r){return Fw(this,e,r,{callee:t})},decode:function t(e,r){return jw(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await Mw(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await Rw(this,e,r,{callee:t})},safeEncode(t,e){return Vw(this,t,e)},safeDecode(t,e){return Zw(this,t,e)},async safeEncodeAsync(t,e){return Ww(this,t,e)},async safeDecodeAsync(t,e){return Jw(this,t,e)},toJSONSchema(t){return G_(this,{})(t)},get description(){return ct.get(this)?.description},get _def(){return this._zod.def}}),Xp=v("_ZodString",(t,e)=>{yo.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Y_(t,r,i,n)},w.derived({format:t=>rt(t).format??null,minLength:t=>rt(t).minimum??null,maxLength:t=>rt(t).maximum??null},{regex(...t){return this.check(ja(...t))},includes(...t){return this.check(Va(...t))},startsWith(...t){return this.check(Za(...t))},endsWith(...t){return this.check(Wa(...t))},min(...t){return this.check(Fn(...t))},max(...t){return this.check(xo(...t))},length(...t){return this.check(Io(...t))},nonempty(...t){return this.check(Fn(1,...t))},lowercase(t){return this.check(Ma(t))},uppercase(t){return this.check(Ra(t))},trim(){return this.check(Ka())},normalize(...t){return this.check(Ha(...t))},toLowerCase(){return this.check(Ya())},toUpperCase(){return this.check(Xa())},slugify(){return this.check(qa())}})),is=v("ZodString",(t,e)=>{yo.init(t,e),Xp.init(t,e)},{email(t){return this.check(hp(qp,t))},url(t){return this.check(bu(Ou,t))},jwt(t){return this.check(Pp(mm,t))},emoji(t){return this.check(wp(em,t))},guid(t){return this.check(gp(Qp,t))},uuid(t){return this.check(yp(dn,t))},uuidv4(t){return this.check(vp(dn,t))},uuidv6(t){return this.check(bp(dn,t))},uuidv7(t){return this.check(_p(dn,t))},nanoid(t){return this.check($p(tm,t))},cuid(t){return this.check(xp(rm,t))},cuid2(t){return this.check(Ip(nm,t))},ulid(t){return this.check(Sp(im,t))},base64(t){return this.check(Tp(dm,t))},base64url(t){return this.check(Np(fm,t))},xid(t){return this.check(kp(om,t))},ksuid(t){return this.check(Dp(am,t))},ipv4(t){return this.check(Ap(sm,t))},ipv6(t){return this.check(zp(cm,t))},cidrv4(t){return this.check(Op(um,t))},cidrv6(t){return this.check(Bp(lm,t))},e164(t){return this.check(Up(pm,t))},datetime(t){return this.check(_u(gi,t))},date(t){return this.check(wu(yi,t))},time(t){return this.check($u(vi,t))},duration(t){return this.check(xu(bi,t))}});xe=v("ZodStringFormat",(t,e)=>{we.init(t,e),Xp.init(t,e)}),gi=v("ZodISODateTime",(t,e)=>{Yv.init(t,e),xe.init(t,e)}),yi=v("ZodISODate",(t,e)=>{Xv.init(t,e),xe.init(t,e)}),vi=v("ZodISOTime",(t,e)=>{qv.init(t,e),xe.init(t,e)}),bi=v("ZodISODuration",(t,e)=>{Qv.init(t,e),xe.init(t,e)}),qp=v("ZodEmail",(t,e)=>{Fv.init(t,e),xe.init(t,e)});Qp=v("ZodGUID",(t,e)=>{Ev.init(t,e),xe.init(t,e)});dn=v("ZodUUID",(t,e)=>{Cv.init(t,e),xe.init(t,e)});Ou=v("ZodURL",(t,e)=>{Rv.init(t,e),xe.init(t,e)});em=v("ZodEmoji",(t,e)=>{Vv.init(t,e),xe.init(t,e)});tm=v("ZodNanoID",(t,e)=>{Zv.init(t,e),xe.init(t,e)});rm=v("ZodCUID",(t,e)=>{Wv.init(t,e),xe.init(t,e)});nm=v("ZodCUID2",(t,e)=>{Jv.init(t,e),xe.init(t,e)});im=v("ZodULID",(t,e)=>{Gv.init(t,e),xe.init(t,e)});om=v("ZodXID",(t,e)=>{Hv.init(t,e),xe.init(t,e)});am=v("ZodKSUID",(t,e)=>{Kv.init(t,e),xe.init(t,e)});sm=v("ZodIPv4",(t,e)=>{eb.init(t,e),xe.init(t,e)});Hw=v("ZodMAC",(t,e)=>{rb.init(t,e),xe.init(t,e)});cm=v("ZodIPv6",(t,e)=>{tb.init(t,e),xe.init(t,e)});um=v("ZodCIDRv4",(t,e)=>{nb.init(t,e),xe.init(t,e)});lm=v("ZodCIDRv6",(t,e)=>{ib.init(t,e),xe.init(t,e)});dm=v("ZodBase64",(t,e)=>{ob.init(t,e),xe.init(t,e)});fm=v("ZodBase64URL",(t,e)=>{ab.init(t,e),xe.init(t,e)});pm=v("ZodE164",(t,e)=>{sb.init(t,e),xe.init(t,e)});Kw=v("ZodCreditCard",(t,e)=>{cb.init(t,e),xe.init(t,e)});Yw=v("ZodIBAN",(t,e)=>{ub.init(t,e),xe.init(t,e)});mm=v("ZodJWT",(t,e)=>{lb.init(t,e),xe.init(t,e)});zo=v("ZodCustomStringFormat",(t,e)=>{db.init(t,e),xe.init(t,e)});os=v("ZodNumber",(t,e)=>{Yf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>X_(t,r,i,n),t.isFinite=!0},w.derived({minValue:t=>{let{minimum:e,exclusiveMinimum:r}=rt(t);return Math.max(e??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:t=>{let{maximum:e,exclusiveMaximum:r}=rt(t);return Math.min(e??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:t=>{let{isInt:e,multipleOf:r}=rt(t);return!!e||!!r?.some(Number.isSafeInteger)},format:t=>rt(t).format??null},{gt(t,e){return this.check(un(t,e))},gte(t,e){return this.check(tr(t,e))},min(t,e){return this.check(tr(t,e))},lt(t,e){return this.check(cn(t,e))},lte(t,e){return this.check(er(t,e))},max(t,e){return this.check(er(t,e))},int(t){return this.check(Kp(t))},safe(t){return this.check(Kp(t))},positive(t){return this.check(un(0,t))},nonnegative(t){return this.check(tr(0,t))},negative(t){return this.check(cn(0,t))},nonpositive(t){return this.check(er(0,t))},multipleOf(t,e){return this.check(di(t,e))},step(t,e){return this.check(di(t,e))},finite(){return this}}));Oo=v("ZodNumberFormat",(t,e)=>{fb.init(t,e),os.init(t,e)});as=v("ZodBoolean",(t,e)=>{uu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>q_(t,r,i,n)});ss=v("ZodBigInt",(t,e)=>{Xf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Q_(t,r,i,n)},w.derived({minValue:t=>rt(t).minimum??null,maxValue:t=>rt(t).maximum??null,format:t=>rt(t).format??null},{gte(t,e){return this.check(tr(t,e))},min(t,e){return this.check(tr(t,e))},gt(t,e){return this.check(un(t,e))},lt(t,e){return this.check(cn(t,e))},lte(t,e){return this.check(er(t,e))},max(t,e){return this.check(er(t,e))},positive(t){return this.check(un(BigInt(0),t))},negative(t){return this.check(cn(BigInt(0),t))},nonpositive(t){return this.check(er(BigInt(0),t))},nonnegative(t){return this.check(tr(BigInt(0),t))},multipleOf(t,e){return this.check(di(t,e))}}));hm=v("ZodBigIntFormat",(t,e)=>{pb.init(t,e),ss.init(t,e)});Qw=v("ZodSymbol",(t,e)=>{mb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ew(t,r,i,n)});e$=v("ZodUndefined",(t,e)=>{hb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rw(t,r,i,n)});t$=v("ZodNull",(t,e)=>{gb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tw(t,r,i,n)});n$=v("ZodAny",(t,e)=>{yb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ow(t,r,i,n)});i$=v("ZodUnknown",(t,e)=>{vb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>aw(t,r,i,n)});o$=v("ZodNever",(t,e)=>{bb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>iw(t,r,i,n)});a$=v("ZodVoid",(t,e)=>{_b.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nw(t,r,i,n)});Bu=v("ZodDate",(t,e)=>{wb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sw(t,r,i,n),t.min=(r,i)=>t.check(tr(r,i)),t.max=(r,i)=>t.check(er(r,i))},w.derived({minDate:t=>{let{minimum:e}=rt(t);return e?new Date(e):null},maxDate:t=>{let{maximum:e}=rt(t);return e?new Date(e):null}},{}));s$=v("ZodArray",(t,e)=>{Ao(),$b.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bw(t,r,i,n),t.element=e.element},{min(t,e){return this.check(Fn(t,e))},nonempty(t){return this.check(Fn(1,t))},max(t,e){return this.check(xo(t,e))},length(t,e){return this.check(Io(t,e))},unwrap(){return this.element}});Nu=v("ZodObject",(t,e)=>{Ao(),xb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_w(t,r,i,n),w.installLazyProp(t,"shape",r=>r._zod.def.shape,!1)},{keyof(){return ym(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(w.mergeDefs(this._zod.def,{catchall:t}))},passthrough(){return this.clone(w.mergeDefs(this._zod.def,{catchall:ko()}))},loose(){return this.clone(w.mergeDefs(this._zod.def,{catchall:ko()}))},strict(){return this.clone(w.mergeDefs(this._zod.def,{catchall:gm()}))},strip(){return this.clone(w.mergeDefs(this._zod.def,{catchall:void 0}))},extend(t){return w.extend(this,t)},safeExtend(t){return w.safeExtend(this,t)},merge(t){return w.merge(this,t)},pick(t){return w.pick(this,t)},omit(t){return w.omit(this,t)},partial(...t){return w.partial(Pu,this,t[0])},exactPartial(...t){return w.partial(bm,this,t[0],"exactPartial")},required(...t){return w.required(_m,this,t[0])}});Uu=v("ZodUnion",(t,e)=>{lu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rp(t,r,i,n),t.options=e.options});c$=v("ZodXor",(t,e)=>{Uu.init(t,e),Ib.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rp(t,r,i,n),t.options=e.options});u$=v("ZodDiscriminatedUnion",(t,e)=>{Uu.init(t,e),kb.init(t,e)});l$=v("ZodIntersection",(t,e)=>{Db.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ww(t,r,i,n)});f$=v("ZodTuple",(t,e)=>{Ao(),qf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$w(t,r,i,n)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map(e=>new Pu({type:"optional",innerType:e}))})}});rs=v("ZodRecord",(t,e)=>{Ao(),Ab.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xw(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});h$=v("ZodMap",(t,e)=>{Ao(),zb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yw(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(ln(...r)),t.nonempty=r=>t.check(ln(1,r)),t.max=(...r)=>t.check(fi(...r)),t.size=(...r)=>t.check($o(...r))});g$=v("ZodSet",(t,e)=>{Ao(),Ob.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vw(t,r,i,n),t.min=(...r)=>t.check(ln(...r)),t.nonempty=r=>t.check(ln(1,r)),t.max=(...r)=>t.check(fi(...r)),t.size=(...r)=>t.check($o(...r))});ns=v("ZodEnum",(t,e)=>{Bb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(i,n,o)=>cw(t,i,n,o),t.enum=e.entries,t.options=[...t._zod.values];let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let a of i)if(r.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ns({...e,checks:[],...w.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new ns({...e,checks:[],...w.normalizeParams(n),entries:o})}});y$=v("ZodLiteral",(t,e)=>{Tb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>uw(t,r,i,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});v$=v("ZodFile",(t,e)=>{Nb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>fw(t,r,i,n),t.min=(r,i)=>t.check(ln(r,i)),t.max=(r,i)=>t.check(fi(r,i)),t.mime=(r,i)=>t.check(Ga(Array.isArray(r)?r:[r],i))});b$=v("ZodTransform",(t,e)=>{Ao(),Ub.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gw(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new li(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(w.issue(o,r.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=r.value),a.inst??(a.inst=t),r.issues.push(w.issue(a))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});Pu=v("ZodOptional",(t,e)=>{Qf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});bm=v("ZodExactOptional",(t,e)=>{Pb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});w$=v("ZodNullable",(t,e)=>{Lb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Iw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});$$=v("ZodDefault",(t,e)=>{Eb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Dw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});I$=v("ZodPrefault",(t,e)=>{Cb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Aw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});_m=v("ZodNonOptional",(t,e)=>{Fb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});D$=v("ZodSuccess",(t,e)=>{jb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});A$=v("ZodCatch",(t,e)=>{Mb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});O$=v("ZodNaN",(t,e)=>{Rb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lw(t,r,i,n)});Lu=v("ZodPipe",(t,e)=>{ep.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ow(t,r,i,n),t.in=e.in,t.out=e.out});Eu=v("ZodCodec",(t,e)=>{Lu.init(t,e),du.init(t,e)});B$=v("ZodPreprocess",(t,e)=>{Lu.init(t,e),Vb.init(t,e)}),T$=v("ZodReadonly",(t,e)=>{Zb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Bw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});U$=v("ZodTemplateLiteral",(t,e)=>{Wb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dw(t,r,i,n)});P$=v("ZodLazy",(t,e)=>{fu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Nw(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});E$=v("ZodPromise",(t,e)=>{Gb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});C$=v("ZodFunction",(t,e)=>{Jb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hw(t,r,i,n)});Cu=v("ZodCustom",(t,e)=>{Hb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mw(t,r,i,n)});fB=V_,pB=Z_,M$=v("ZodInstanceOf",(t,e)=>{Cu.init(t,e)},{properties(t,e){return this.check(Ja(t,e))}});hB=(...t)=>W_({Codec:Eu,Boolean:as,String:is},...t)});function sC(t){Me({customError:t})}function cC(){return Me().customError}var aC,R$,vB=m(()=>{rr();aC={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};R$||(R$={})});var Fu={};Ie(Fu,{ZodISODate:()=>yi,ZodISODateTime:()=>gi,ZodISODuration:()=>bi,ZodISOTime:()=>vi,date:()=>lC,datetime:()=>uC,duration:()=>fC,time:()=>dC});function uC(t){return _u(gi,t)}function lC(t){return wu(yi,t)}function dC(t){return $u(vi,t)}function fC(t){return xu(bi,t)}var wm=m(()=>{rr();_i();_i()});function mC(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function bB(t,e){return t.map((r,i)=>i<e?r:r.optional())}function hC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function gC(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1]===void 0?void 0:hC(r[1]);if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function yC(t,e){return B.transform(i=>i).check(i=>{let n=i.value;if(typeof n!="object"||n===null||Array.isArray(n))return;let o=Object.getOwnPropertyNames(n);if(e.minProperties!==void 0&&o.length<e.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:e.minProperties,inclusive:!0,message:`Too small: expected object to have >=${e.minProperties} properties`,input:n,inst:t,continue:!0}),e.maxProperties!==void 0&&o.length>e.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:e.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${e.maxProperties} properties`,input:n,inst:t,continue:!0}),e.keySchema)for(let a of o){let s=e.keySchema.safeParse(a);s.success||i.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(t)}function V$(t,e){if(t===null)return"z";let r=typeof t;if(r!=="object"){if(r==="number"&&Number.isNaN(t))return null;let i=String(t);return`${r[0]}${i.length}:${i}`}if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let a of t){let s=V$(a,e);if(s===null)return null;o.push(s)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(t).sort(),n=[];for(let o of i){let a=V$(t[o],e);if(a===null)return null;n.push(`${o.length}:${o}=${a}`)}return`o${n.length}:{${n.join(",")}}`}finally{e.delete(t)}}function ju(t){return typeof t!="object"||t===null?!1:Array.isArray(t)?t.some(ju):typeof t.$ref=="string"?!0:Object.entries(t).some(([e,r])=>vC.has(e)?ju(r):!bC.has(e)||typeof r!="object"||r===null?!1:Object.values(r).some(ju))}function _B(t){return t===1?"element":"elements"}function _C(t,e){return B.transform(i=>i).check(i=>{let n=i.value;if(Array.isArray(n)){if(e.uniqueItems===!0){let o=new Map;for(let a=0;a<n.length;a++){let s=V$(n[a],new Set);if(s===null)continue;let c=o.get(s);if(c===void 0){o.set(s,a);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${c}`,input:n,path:[a],continue:!0})}}if(e.containsSchema){let o=e.minContains??1,a=e.maxContains!==void 0?e.maxContains+1:Number.POSITIVE_INFINITY,s=0;for(let c of n)if(e.containsSchema.safeParse(c).success&&++s>=a)break;s<o&&i.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${_B(o)}; found ${s}`,input:n,continue:!0}),e.maxContains!==void 0&&s>e.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${e.maxContains} matching ${_B(e.maxContains)}`,input:n,continue:!0})}}}).pipe(t)}function wB(t,e){if(t!==!1)return t===void 0||t===!0?B.any():At(t,e)}function $B(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return B.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return B.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=gC(n,e),a=At(o,e);return e.refs.set(n,a),e.processing.delete(n),a}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return B.null();if(n.length===0)return B.never();if(n.length===1)return B.literal(n[0]);if(n.every(a=>typeof a=="string"))return B.enum(n);let o=n.map(a=>B.literal(a));return o.length<2?o[0]:B.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return B.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let a={...t,type:o};return $B(a,e)});return n.length===0?B.never():n.length===1?n[0]:B.union(n)}if(!r)return B.any();let i;switch(r){case"string":{let n=B.string();if(t.format){let o=t.format;o==="email"?n=n.check(B.email()):o==="uri"||o==="uri-reference"?n=n.check(B.url()):o==="uuid"||o==="guid"?n=n.check(B.uuid()):o==="date-time"?n=n.check(B.iso.datetime({offset:!0})):o==="date"?n=n.check(B.iso.date()):o==="time"?n=n.check(B.regex(wC)):o==="duration"?n=n.check(B.iso.duration()):o==="hostname"?n=n.check(B.hostname()):o==="ipv4"?n=n.check(B.ipv4()):o==="ipv6"?n=n.check(B.ipv6()):o==="mac"?n=n.check(B.mac()):o==="cidr"?n=n.check(B.cidrv4()):o==="cidr-v6"?n=n.check(B.cidrv6()):o==="base64"?n=n.check(B.base64()):o==="base64url"?n=n.check(B.base64url()):o==="e164"?n=n.check(B.e164()):o==="credit_card"?n=n.check(B.creditCard()):o==="iban"?n=n.check(B.iban()):o==="jwt"?n=n.check(B.jwt()):o==="emoji"?n=n.check(B.emoji()):o==="nanoid"?n=n.check(B.nanoid()):o==="cuid"?n=n.check(B.cuid()):o==="cuid2"?n=n.check(B.cuid2()):o==="ulid"?n=n.check(B.ulid()):o==="xid"?n=n.check(B.xid()):o==="ksuid"&&(n=n.check(B.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?B.number().int():B.number();typeof t.minimum=="number"&&t.exclusiveMinimum!==!0&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&t.exclusiveMaximum!==!0&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=B.boolean();break}case"null":{i=B.null();break}case"object":{let n={},o=t.properties||{},a=new Set(t.required||[]),s=typeof t.additionalProperties=="object"?At(t.additionalProperties,e):void 0;for(let[d,f]of Object.entries(o)){let p=At(f,e);st(n,d,a.has(d)?p:p.optional())}if(t.patternProperties){let d=t.patternProperties,f=Object.keys(d),p=[];for(let y of f){let _=At(d[y],e),D=B.string().regex(new RegExp(y));p.push(B.looseRecord(D,_))}let h=[];if(Object.keys(n).length>0&&h.push(B.object(n).passthrough()),h.push(...p),h.length===0)i=B.object({}).passthrough();else if(h.length===1)i=h[0];else{let y=B.intersection(h[0],h[1]);for(let _=2;_<h.length;_++)y=B.intersection(y,h[_]);i=y}if(t.additionalProperties===!1){let y=Object.keys(n),_=f.map(I=>new RegExp(I)),D=i;i=i.check(I=>{if(!pr(I.value))return;let A=[];for(let Z of Object.keys(I.value))y.includes(Z)||_.some(L=>L.test(Z))||A.push(Z);A.length&&I.issues.push({code:"unrecognized_keys",keys:A,input:I.value,inst:D})})}}else{let d=B.object(n);t.additionalProperties===!1?i=d.strict():s?i=d.catchall(s):i=d.passthrough()}let c=t.propertyNames!==void 0&&t.propertyNames!==!0,u=typeof t.minProperties=="number"?t.minProperties:void 0,l=typeof t.maxProperties=="number"?t.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let d;if(c){let f=typeof t.propertyNames=="object"&&t.propertyNames.type===void 0?{type:"string",...t.propertyNames}:t.propertyNames;d=At(f,e)}i=yC(i,{keySchema:d,minProperties:u,maxProperties:l})}break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let a=typeof t.minItems=="number"?t.minItems:0,s=n.map(d=>At(d,e)),c=bB(s,a),u=Array.isArray(o)?void 0:wB(o,e),l=B.tuple(c);i=u?l.rest(u):l,typeof t.minItems=="number"&&(i=i.check(B.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(B.maxLength(t.maxItems)))}else if(Array.isArray(o)){let a=typeof t.minItems=="number"?t.minItems:0,s=o.map(d=>At(d,e)),c=bB(s,a),u=wB(t.additionalItems,e),l=B.tuple(c);i=u?l.rest(u):l,typeof t.minItems=="number"&&(i=i.check(B.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(B.maxLength(t.maxItems)))}else if(o!==void 0){let a=At(o,e),s=B.array(a);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),i=s}else i=B.array(B.any());(t.uniqueItems===!0||t.contains!==void 0)&&(i=_C(i,{uniqueItems:t.uniqueItems===!0,containsSchema:t.contains!==void 0?At(t.contains,e):void 0,minContains:typeof t.minContains=="number"?t.minContains:void 0,maxContains:typeof t.maxContains=="number"?t.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return i}function At(t,e){if(typeof t=="boolean")return t?B.any():B.never();let r=$B(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(u=>At(u,e)),c=B.union(s);r=i?B.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(u=>At(u,e)),c=B.xor(s);r=i?B.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:B.any();else{let s=i?r:At(t.allOf[0],e),c=i?0:1;for(let u=c;u<t.allOf.length;u++)s=B.intersection(s,At(t.allOf[u],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=B.nullable(r)),t.readOnly===!0&&(r=B.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in t&&(n[s]=t[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in t&&(n[s]=t[s]);if(t.type==="object"&&t.$ref===void 0){t.propertyNames!==void 0&&!ju(t.propertyNames)&&(n.propertyNames=t.propertyNames);for(let s of["minProperties","maxProperties"])t[s]!==void 0&&(n[s]=t[s])}if(t.type==="array"&&t.$ref===void 0){t.contains!==void 0&&!ju(t.contains)&&(n.contains=t.contains);for(let s of["uniqueItems","minContains","maxContains"])t[s]!==void 0&&(n[s]=t[s])}for(let s of Object.keys(t))pC.has(s)||st(n,s,t[s]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function xB(t,e){if(typeof t=="boolean")return t?B.any():B.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=mC(r,e?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ct};return At(r,o)}var B,pC,vC,bC,wC,IB=m(()=>{vu();O();Gp();wm();_i();B={...us,...Jp,iso:Fu},pC=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);vC=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),bC=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);wC=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function Mu(t,e){let r=typeof e=="function"?e:(a,s)=>{let c=e[a._zod.def.type];return c?c(a,s):a},i=new Map;function n(a){let s=i.get(a);if(s===SB)return new fu({type:"lazy",getter:()=>i.get(a)});if(s!==void 0)return s;i.set(a,SB);let c=o(a),u=r(c,c!==a);return i.set(a,u),u}function o(a){let s=a._zod.def,c=s.type;switch(c){case"object":{let u=s.shape,l=Object.keys(u),d=!1,f={};for(let h of l){let y=n(u[h]);y!==u[h]&&(d=!0),f[h]=y}let p=s.catchall;return s.catchall&&(p=n(s.catchall),p!==s.catchall&&(d=!0)),d?_e(a,{...s,shape:f,catchall:p}):a}case"array":{let u=n(s.element);return u===s.element?a:_e(a,{...s,element:u})}case"tuple":{let u=s.items,l=!1,d=[];for(let p of u){let h=n(p);h!==p&&(l=!0),d.push(h)}let f=s.rest;return s.rest&&(f=n(s.rest),f!==s.rest&&(l=!0)),l?_e(a,{...s,items:d,rest:f}):a}case"record":case"map":{let u=n(s.keyType),l=n(s.valueType);return u===s.keyType&&l===s.valueType?a:_e(a,{...s,keyType:u,valueType:l})}case"set":{let u=n(s.valueType);return u===s.valueType?a:_e(a,{...s,valueType:u})}case"union":{let u=s.options,l=!1,d=[];for(let f of u){let p=n(f);p!==f&&(l=!0),d.push(p)}return l?_e(a,{...s,options:d}):a}case"intersection":{let u=n(s.left),l=n(s.right);return u===s.left&&l===s.right?a:_e(a,{...s,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=n(s.innerType);return u===s.innerType?a:_e(a,{...s,innerType:u})}case"pipe":{let u=n(s.in),l=n(s.out);return u===s.in&&l===s.out?a:_e(a,{...s,in:u,out:l})}case"function":{let u=n(s.input),l=n(s.output);return u===s.input&&l===s.output?a:_e(a,{...s,input:u,output:l})}case"lazy":{let u=s.getter,{_cachedInner:l,...d}=s;return _e(a,{...d,getter:()=>n(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return n(t)}var SB,Z$=m(()=>{La();O();SB=Symbol("z.visit/resolving")});function kB(t){return Mu(t,{object:e=>e.partial(),union:e=>{let r=e._zod.def;return r.discriminator===void 0?e:cs(r.options)}})}var DB=m(()=>{Z$();_i()});function $C(t,e){if(!e?.length)return t;let r=t._zod.def;return _e(t,Tr(r,{checks:[...r.checks??[],...e]}),{parent:!0})}function AB(t){return $C(t.out,t.checks)}function xC(t){return t.in._zod.traits.has("$ZodTransform")?AB(t):t.in}function zB(t){return Mu(t,{pipe:e=>xC(e._zod.def),default:(e,r)=>r?Do(e._zod.def.innerType):e,catch:(e,r)=>r?e._zod.def.innerType:e})}function OB(t){return Mu(t,{pipe:e=>AB(e._zod.def),prefault:(e,r)=>r?e._zod.def.innerType:e})}var BB=m(()=>{O();Z$();_i()});var W$={};Ie(W$,{bigint:()=>DC,boolean:()=>kC,date:()=>AC,number:()=>SC,string:()=>IC});function IC(t){return l_(is,t)}function SC(t){return g_(os,t)}function kC(t){return x_(as,t)}function DC(t){return S_(ss,t)}function AC(t){return L_(Bu,t)}var TB=m(()=>{rr();_i()});var ve={};Ie(ve,{$brand:()=>Iy,$input:()=>n_,$output:()=>r_,INVALID:()=>kt,NEVER:()=>xy,TimePrecision:()=>m_,ZodAny:()=>n$,ZodArray:()=>s$,ZodBase64:()=>dm,ZodBase64URL:()=>fm,ZodBigInt:()=>ss,ZodBigIntFormat:()=>hm,ZodBoolean:()=>as,ZodCIDRv4:()=>um,ZodCIDRv6:()=>lm,ZodCUID:()=>rm,ZodCUID2:()=>nm,ZodCatch:()=>A$,ZodCodec:()=>Eu,ZodCompileAsyncError:()=>Nr,ZodCompileUnsupportedError:()=>fe,ZodCreditCard:()=>Kw,ZodCustom:()=>Cu,ZodCustomStringFormat:()=>zo,ZodDate:()=>Bu,ZodDefault:()=>$$,ZodDiscriminatedUnion:()=>u$,ZodE164:()=>pm,ZodEmail:()=>qp,ZodEmoji:()=>em,ZodEnum:()=>ns,ZodError:()=>nC,ZodExactOptional:()=>bm,ZodFile:()=>v$,ZodFirstPartyTypeKind:()=>R$,ZodFunction:()=>C$,ZodGUID:()=>Qp,ZodIBAN:()=>Yw,ZodIPv4:()=>sm,ZodIPv6:()=>cm,ZodISODate:()=>yi,ZodISODateTime:()=>gi,ZodISODuration:()=>bi,ZodISOTime:()=>vi,ZodInstanceOf:()=>M$,ZodIntersection:()=>l$,ZodIssueCode:()=>aC,ZodJWT:()=>mm,ZodKSUID:()=>am,ZodLazy:()=>P$,ZodLiteral:()=>y$,ZodMAC:()=>Hw,ZodMap:()=>h$,ZodNaN:()=>O$,ZodNanoID:()=>tm,ZodNever:()=>o$,ZodNonOptional:()=>_m,ZodNull:()=>t$,ZodNullable:()=>w$,ZodNumber:()=>os,ZodNumberFormat:()=>Oo,ZodObject:()=>Nu,ZodOptional:()=>Pu,ZodPipe:()=>Lu,ZodPrefault:()=>I$,ZodPreprocess:()=>B$,ZodPromise:()=>E$,ZodReadonly:()=>T$,ZodRealError:()=>Mt,ZodRecord:()=>rs,ZodSet:()=>g$,ZodString:()=>is,ZodStringFormat:()=>xe,ZodSuccess:()=>D$,ZodSymbol:()=>Qw,ZodTemplateLiteral:()=>U$,ZodTransform:()=>b$,ZodTuple:()=>f$,ZodType:()=>oe,ZodULID:()=>im,ZodURL:()=>Ou,ZodUUID:()=>dn,ZodUndefined:()=>e$,ZodUnion:()=>Uu,ZodUnknown:()=>i$,ZodVoid:()=>a$,ZodXID:()=>om,ZodXor:()=>c$,_ZodString:()=>Xp,_default:()=>x$,_function:()=>uB,any:()=>jO,array:()=>Tu,base64:()=>_O,base64url:()=>wO,bigint:()=>PO,boolean:()=>qw,catch:()=>z$,check:()=>lB,cidrv4:()=>vO,cidrv6:()=>bO,clone:()=>_e,codec:()=>oB,coerce:()=>W$,compile:()=>s_,config:()=>Me,core:()=>jn,creditCard:()=>xO,cuid:()=>lO,cuid2:()=>dO,currencyCode:()=>zO,custom:()=>dB,date:()=>RO,decode:()=>jw,decodeAsync:()=>Rw,deepPartial:()=>kB,describe:()=>fB,discriminatedUnion:()=>HO,e164:()=>$O,email:()=>eO,emoji:()=>cO,encode:()=>Fw,encodeAsync:()=>Mw,endsWith:()=>Wa,enum:()=>ym,exactOptional:()=>_$,file:()=>tB,flattenError:()=>Yc,float32:()=>BO,float64:()=>TO,formatError:()=>Xc,fromJSONSchema:()=>xB,function:()=>uB,getDiscriminatedOption:()=>Sb,getErrorMap:()=>cC,globalRegistry:()=>ct,gt:()=>un,gte:()=>tr,guid:()=>tO,hash:()=>OO,hex:()=>AO,hostname:()=>DO,httpUrl:()=>sO,iban:()=>IO,includes:()=>Va,input:()=>zB,instanceof:()=>mB,int:()=>Kp,int32:()=>NO,int64:()=>LO,intersection:()=>d$,invertCodec:()=>aB,ipv4:()=>hO,ipv6:()=>yO,iso:()=>Fu,json:()=>gB,jwt:()=>SO,keyof:()=>VO,ksuid:()=>mO,lazy:()=>L$,length:()=>Io,literal:()=>eB,locales:()=>yu,looseObject:()=>JO,looseRecord:()=>YO,lowercase:()=>Ma,lt:()=>cn,lte:()=>er,mac:()=>gO,map:()=>XO,maxLength:()=>xo,maxSize:()=>fi,memoizer:()=>hu,meta:()=>pB,mime:()=>Ga,minLength:()=>Fn,minSize:()=>ln,multipleOf:()=>di,nan:()=>iB,nanoid:()=>uO,nativeEnum:()=>QO,negative:()=>Ep,never:()=>gm,nonnegative:()=>Fp,nonoptional:()=>k$,nonpositive:()=>Cp,normalize:()=>Ha,null:()=>r$,nullable:()=>zu,nullish:()=>rB,number:()=>Xw,object:()=>ZO,optional:()=>Do,output:()=>OB,overwrite:()=>Ur,parse:()=>Pw,parseAsync:()=>Lw,partialRecord:()=>KO,pipe:()=>Yp,positive:()=>Lp,prefault:()=>S$,preprocess:()=>yB,prettifyError:()=>zy,promise:()=>cB,properties:()=>Ja,property:()=>jp,readonly:()=>N$,record:()=>m$,refine:()=>F$,regex:()=>ja,regexes:()=>hr,registry:()=>dp,safeDecode:()=>Zw,safeDecodeAsync:()=>Jw,safeEncode:()=>Vw,safeEncodeAsync:()=>Ww,safeParse:()=>Ew,safeParseAsync:()=>Cw,set:()=>qO,setErrorMap:()=>sC,size:()=>$o,slugify:()=>qa,startsWith:()=>Za,strictObject:()=>WO,string:()=>Au,stringFormat:()=>kO,stringbool:()=>hB,success:()=>nB,superRefine:()=>j$,symbol:()=>CO,templateLiteral:()=>sB,toJSONSchema:()=>Zp,toLowerCase:()=>Ya,toUpperCase:()=>Xa,toZod:()=>Mc,transform:()=>vm,treeifyError:()=>Ay,trim:()=>Ka,tuple:()=>p$,uint32:()=>UO,uint64:()=>EO,ulid:()=>fO,undefined:()=>FO,union:()=>cs,unknown:()=>ko,uppercase:()=>Ra,url:()=>aO,util:()=>w,uuid:()=>rO,uuidv4:()=>nO,uuidv6:()=>iO,uuidv7:()=>oO,validate:()=>qc,validateAsync:()=>Qc,void:()=>MO,withParser:()=>fp,xid:()=>pO,xor:()=>GO});var J$=m(()=>{rr();_i();Gp();Uw();Gw();vB();rr();Du();IB();DB();BB();t_();wm();wm();TB()});var NB=m(()=>{J$();J$()});var zt,UB,zC,PB,OC,LB,EB=m(()=>{"use strict";NB();zt=ve.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),UB=ve.object({rgbMin:ve.number().finite().optional(),rgbMax:ve.number().finite().optional(),lnScaleMin:ve.number().finite().optional(),lnScaleMax:ve.number().finite().optional(),sh1Max:ve.number().finite().optional(),sh2Max:ve.number().finite().optional(),sh3Max:ve.number().finite().optional(),lodOpacity:ve.boolean().optional()}).passthrough(),zC=ve.object({offset:zt,bytes:zt,base:zt.optional(),count:zt.optional(),filename:ve.string().optional()}).passthrough(),PB=ve.object({version:ve.literal(1),type:ve.literal("gsplat"),count:zt,maxSh:zt.optional(),lodTree:ve.boolean().optional(),chunkSize:zt.optional(),allChunkBytes:zt.optional(),chunks:ve.array(zC),splatEncoding:UB.optional(),shCodeCount:zt.optional(),comment:ve.string().optional()}).passthrough(),OC=ve.object({offset:zt,bytes:zt,property:ve.string(),encoding:ve.string(),compression:ve.string().optional(),min:ve.number().finite().optional(),max:ve.number().finite().optional()}).passthrough(),LB=ve.object({version:ve.literal(1),base:zt,count:zt,payloadBytes:zt,maxSh:zt.optional(),lodTree:ve.boolean().optional(),splatEncoding:UB.optional(),properties:ve.array(OC)}).passthrough()});function Ru(t){let e=ls(t);if(!e)throw new Error("RADLoader: file must contain a complete RAD metadata header.");return e}function ls(t){let e=FB(t);if(e.byteLength<wi)return null;let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0);if(i!==BC)throw new Error(`RADLoader: RAD0 magic header not found, received 0x${i.toString(16)}.`);let n=r.getUint32(4,!0),o=wi+n;if(e.byteLength<o)return null;let a=PB.parse(CB(e.subarray(wi,o),"RADLoader: failed to parse RAD metadata JSON."));return PC(a,n)}function ds(t){let e=FB(t);if(e.byteLength<wi)throw new Error("RADLoader: RADC chunk must contain an 8-byte metadata header.");let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0);if(i!==TC)throw new Error(`RADLoader: RADC magic header not found, received 0x${i.toString(16)}.`);let n=r.getUint32(4,!0),o=wi+n,a=wi+$m(n),s=a+NC;if(e.byteLength<s)throw new Error("RADLoader: RADC chunk must contain a complete metadata header.");let c=LB.parse(CB(e.subarray(wi,o),"RADLoader: failed to parse RADC metadata JSON.")),u=EC(r,a,"RADC payload byte length");return LC(c,n,s,u)}function $m(t){return t+7&-8}function PC(t,e){return{...t,headerJsonByteLength:e,chunksByteOffset:wi+$m(e)}}function LC(t,e,r,i){if(t.payloadBytes!==i)throw new Error("RADLoader: RADC metadata payload byte length does not match binary header.");return{...t,payloadBytes:i,headerJsonByteLength:e,payloadByteOffset:r,chunkByteLength:r+i}}function CB(t,e){try{return JSON.parse(UC.decode(t))}catch{throw new Error(e)}}function EC(t,e,r){let i=t.getBigUint64(e,!0);if(i>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`RADLoader: ${r} exceeds Number.MAX_SAFE_INTEGER.`);return Number(i)}function FB(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}var BC,TC,wi,NC,UC,Vu=m(()=>{"use strict";EB();BC=809779538,TC=1128546642,wi=8,NC=8,UC=new TextDecoder});var xm,jB=m(()=>{"use strict";Jm();ki();Hm();xm=class extends nr{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;constructor(e={}){super(e),this.options=e}decompressSync(e){let r=new Uint8Array(e);return(this.options.raw?Qx(r):nI(r)).slice().buffer}async*decompressBatches(e){let r=this.options.raw?new Zn:new rI;yield*yl(r,e)}}});var Zu,MB=m(()=>{"use strict";jB();Ai();Zu=class extends xm{constructor(e={}){super(e)}async decompress(e){if(this.options.useNative!==!1){let r=this.options.raw?"deflate-raw":"deflate",i=await Er(e,r);if(i)return i}return this.decompressSync(e)}async*decompressBatches(e){if(this.options.useNative!==!1){let r=this.options.raw?"deflate-raw":"deflate",i=yn(e,r);if(i){yield*i;return}}yield*super.decompressBatches(e)}}});function Im(t,e){return sn(Ju(t,e))}function Ju(t,e){let r=hF(t),i=lF(ds(r),e);if(r.byteLength<i.chunkByteLength)throw new Error("RADLoader: RADC chunk payload is incomplete.");let n=i.count,o=fs(r,i,uF(i,"center"),3),a=jC(r,i,n),s=RC(r,i,n),c=VC(r,i,n),u=ZC(r,i,n),{colors:l,sphericalHarmonicDcs:d}=oF(s),f=e?.radChunk?.includeLoDTree??!0,p=f?JC(r,i,"child_count"):null,h=f?GC(r,i,"child_start"):null,_=e?.radChunk?.includeSphericalHarmonics??!1?WC(r,i):null;return{format:"rad",splatCount:n,positions:o,scales:c,rotations:u,colors:l,sphericalHarmonicDcs:d,opacities:a,sphericalHarmonics:_?.values,sphericalHarmonicsComponentCount:_?.componentCount,loaderData:{format:"rad",base:i.base,count:i.count,maxSh:i.maxSh??0,lodTree:i.lodTree??!1,splatEncoding:i.splatEncoding,childCounts:p??void 0,childStarts:h??void 0}}}function jC(t,e,r){let i=fn(e,"alpha");if(!i)return new Float32Array(r).fill(1);let n=fs(t,e,i,1);for(let o=0;o<n.length;o++)n[o]=MC(n[o],e,i);return n}function MC(t,e,r){let i=Math.max(t,0);return!e.splatEncoding?.lodOpacity||r.encoding!=="r8"&&r.encoding!=="r8_delta"?i:i*2}function RC(t,e,r){let i=fn(e,"rgb");return i?fs(t,e,i,3):new Float32Array(r*3).fill(1)}function VC(t,e,r){let i=fn(e,"scales");return i?fs(t,e,i,3):new Float32Array(r*3).fill(1)}function ZC(t,e,r){let i=fn(e,"orientation");if(!i)return aF(r);let n=Sm(t,e,i);switch(i.encoding){case"oct88r8":return iF(n,r);case"f32":case"f16":{let o=fs(t,e,i,3),a=new Float32Array(r*4);for(let s=0;s<r;s++){let c=s*3,u=s*4,l=o[c+0],d=o[c+1],f=o[c+2],p=Math.sqrt(Math.max(0,1-l*l-d*d-f*f)),h=an(p,l,d,f);a.set(h,u)}return a}default:throw new Error(`RADLoader: unsupported orientation encoding ${i.encoding}.`)}}function WC(t,e){let r=[{property:fn(e,"sh1"),dimensions:9},{property:fn(e,"sh2"),dimensions:15},{property:fn(e,"sh3"),dimensions:21}].filter(a=>a.property!==void 0);if(r.length===0)return null;let i=r.map(a=>({values:fs(t,e,a.property,a.dimensions),dimensions:a.dimensions})),n=i.reduce((a,s)=>a+s.dimensions,0),o=new Float32Array(e.count*n);for(let a=0;a<e.count;a++){let s=a*n;for(let c of i){let u=a*c.dimensions;o.set(c.values.subarray(u,u+c.dimensions),s),s+=c.dimensions}}return{values:o,componentCount:n}}function fs(t,e,r,i){let n=Sm(t,e,r);switch(r.encoding){case"f32":return KC(n,i,e.count);case"f16":return RB(n,i,e.count);case"f32_lebytes":return YC(n,i,e.count);case"f16_lebytes":return XC(n,i,e.count);case"r8":return qC(n,i,e.count,G$(e,r),Wu(e,r));case"r8_delta":return QC(n,i,e.count,G$(e,r),Wu(e,r));case"s8":return eF(n,i,e.count,Wu(e,r));case"s8_delta":return tF(n,i,e.count,Wu(e,r));case"ln_0r8":return rF(n,i,e.count,G$(e,r),Wu(e,r));case"ln_f16":return nF(n,i,e.count);default:throw new Error(`RADLoader: unsupported ${r.property} encoding ${r.encoding}.`)}}function JC(t,e,r){let i=fn(e,r);if(!i)return null;if(i.encoding!=="u16")throw new Error(`RADLoader: unsupported ${r} encoding ${i.encoding}.`);let n=Sm(t,e,i),o=new Uint16Array(e.count);for(let a=0;a<e.count;a++)o[a]=n[a*2]|n[a*2+1]<<8;return o}function GC(t,e,r){let i=fn(e,r);if(!i)return null;if(i.encoding!=="u32")throw new Error(`RADLoader: unsupported ${r} encoding ${i.encoding}.`);let n=Sm(t,e,i),o=new DataView(n.buffer,n.byteOffset,n.byteLength),a=new Uint32Array(e.count);for(let s=0;s<e.count;s++)a[s]=o.getUint32(s*4,!0);return a}function Sm(t,e,r){let i=$m(r.bytes),n=e.payloadByteOffset+r.offset;if(n+i>t.byteLength||r.offset+i>e.payloadBytes)throw new Error(`RADLoader: property ${r.property} exceeds RADC payload byte length.`);let a=t.subarray(n,n+r.bytes);if(!r.compression)return a;if(r.compression!=="gz")throw new Error(`RADLoader: unsupported property compression ${r.compression}.`);return HC(a,r.property)}function HC(t,e){let r=mF(t);try{return new Uint8Array(CC.decompressSync(r))}catch{try{return new Uint8Array(FC.decompressSync(r))}catch{throw new Error(`RADLoader: failed to decompress RADC property ${e}.`)}}}function KC(t,e,r){let i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=new Float32Array(r*e);for(let o=0;o<r;o++)for(let a=0;a<e;a++)n[o*e+a]=i.getFloat32((a*r+o)*4,!0);return n}function RB(t,e,r){let i=new Float32Array(r*e);for(let n=0;n<r;n++)for(let o=0;o<e;o++){let a=(o*r+n)*2;i[n*e+o]=Fc(t[a]|t[a+1]<<8)}return i}function YC(t,e,r){let i=new Float32Array(r*e),n=r*e,o=new Uint8Array(4),a=new DataView(o.buffer);for(let s=0;s<r;s++)for(let c=0;c<e;c++){let u=c*r+s;for(let l=0;l<4;l++)o[l]=t[u+n*l];i[s*e+c]=a.getFloat32(0,!0)}return i}function XC(t,e,r){let i=new Float32Array(r*e),n=r*e;for(let o=0;o<r;o++)for(let a=0;a<e;a++){let s=a*r+o;i[o*e+a]=Fc(t[s]|t[s+n]<<8)}return i}function qC(t,e,r,i,n){let o=new Float32Array(r*e),a=n-i;for(let s=0;s<r;s++)for(let c=0;c<e;c++)o[s*e+c]=t[c*r+s]/255*a+i;return o}function QC(t,e,r,i,n){let o=new Float32Array(r*e),a=n-i,s=new Uint8Array(e);for(let c=0;c<r;c++)for(let u=0;u<e;u++){let l=u*r+c,d=s[u]+t[l]&255;s[u]=d,o[c*e+u]=d/255*a+i}return o}function eF(t,e,r,i){let n=new Float32Array(r*e);for(let o=0;o<r;o++)for(let a=0;a<e;a++){let s=t[a*r+o];n[o*e+a]=(s<<24>>24)/127*i}return n}function tF(t,e,r,i){let n=new Float32Array(r*e),o=new Uint8Array(e);for(let a=0;a<r;a++)for(let s=0;s<e;s++){let c=s*r+a,u=o[s]+t[c]&255;o[s]=u,n[a*e+s]=(u<<24>>24)/127*i}return n}function rF(t,e,r,i,n){let o=new Float32Array(r*e);for(let a=0;a<r;a++)for(let s=0;s<e;s++)o[a*e+s]=sF(t[s*r+a],i,n);return o}function nF(t,e,r){let i=RB(t,e,r);for(let n=0;n<i.length;n++)i[n]=Math.exp(i[n]);return i}function iF(t,e){let r=new Float32Array(e*4);for(let i=0;i<e;i++){let n=i*3,[o,a,s,c]=cF(t[n],t[n+1],t[n+2]);r.set(an(c,o,a,s),i*4)}return r}function oF(t){let e=new Uint8Array(t.length),r=new Float32Array(t.length);for(let i=0;i<t.length;i++){let n=t[i];e[i]=pF(n),r[i]=(n-.5)/Xg}return{colors:e,sphericalHarmonicDcs:r}}function aF(t){let e=new Float32Array(t*4);for(let r=0;r<t;r++)e[r*4]=1;return e}function sF(t,e,r){if(t===0)return 0;let i=(r-e)/254;return Math.exp(e+(t-1)*i)}function cF(t,e,r){let i=t/255*2-1,n=e/255*2-1,o=1-Math.abs(i)-Math.abs(n),a=Math.max(-o,0);i=i>=0?i-a:i+a,n=n>=0?n-a:n+a;let s=Math.hypot(i,n,o),c=s>Number.EPSILON?i/s:1,u=s>Number.EPSILON?n/s:0,l=s>Number.EPSILON?o/s:0,d=r/255*.5*Math.PI,f=Math.sin(d);return[c*f,u*f,l*f,Math.cos(d)]}function uF(t,e){let r=fn(t,e);if(!r)throw new Error(`RADLoader: RADC chunk is missing ${e} property.`);return r}function fn(t,e){return t.properties.find(r=>r.property===e)}function lF(t,e){let r=e?.radChunk?.splatEncoding;return r?{...t,splatEncoding:{...r,...t.splatEncoding}}:t}function G$(t,e){if(e.min===void 0){let r=dF(t.splatEncoding,e.property);if(r!==void 0)return r;throw new Error(`RADLoader: RADC property ${e.property} is missing min.`)}return e.min}function Wu(t,e){if(e.max===void 0){let r=fF(t.splatEncoding,e.property);if(r!==void 0)return r;throw new Error(`RADLoader: RADC property ${e.property} is missing max.`)}return e.max}function dF(t,e){switch(e){case"rgb":return t?.rgbMin;case"scales":return t?.lnScaleMin;default:return}}function fF(t,e){switch(e){case"rgb":return t?.rgbMax;case"scales":return t?.lnScaleMax;case"sh1":return t?.sh1Max;case"sh2":return t?.sh2Max;case"sh3":return t?.sh3Max;default:return}}function pF(t){return Math.round(Math.min(Math.max(t,0),1)*255)}function mF(t){let e=new Uint8Array(t.byteLength);return e.set(t),e.buffer}function hF(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}var CC,FC,H$=m(()=>{"use strict";MB();Vu();wa();ba();CC=new Zu({useNative:!1}),FC=new Zu({raw:!0,useNative:!1})});var VB={};Ie(VB,{RADLoaderWithParser:()=>yF,parseRADChunk:()=>Im,parseRADChunkHeader:()=>ds,parseRADChunkToGaussianSplats:()=>Ju,parseRADHeader:()=>Ru,tryParseRADHeader:()=>ls});var yX,gF,yF,ZB=m(()=>{"use strict";Vu();K$();Vu();H$();({preload:yX,...gF}=km),yF={...gF,parse:async t=>Ru(t),parseSync:t=>Ru(t)}});async function bF(){let{RADLoaderWithParser:t}=await Promise.resolve().then(()=>(ZB(),VB));return t}var vF,km,K$=m(()=>{"use strict";$i();vF="5.0.0-alpha.8";km={dataType:null,batchType:null,...Po,version:vF,options:{},preload:bF}});var Hu={};Ie(Hu,{KSPLATFormat:()=>tl,KSPLATLoader:()=>lf,RADFormat:()=>Po,RADLoader:()=>km,RADSource:()=>Gu,RADSourceLoader:()=>Y$,SPLATFormat:()=>el,SPLATLoader:()=>sf,SPZFormat:()=>rl,SPZLoader:()=>df,parseSPZ:()=>af,parseSPZToGaussianSplats:()=>Qg,resolveRADChunkUrl:()=>Dm});Qu(Hu,qB(q$(),1));$i();ry();iy();uy();ly();K$();Fo();$i();Vu();H$();wa();var _F=[64*1024,256*1024,1024*1024],wF=4,$F="5.0.0-alpha.8",Y$={dataType:null,batchType:null,...Po,name:"RADSourceLoader",version:$F,type:"rad",fromUrl:!0,fromBlob:!0,options:{rad:{headers:void 0,withCredentials:!1,headerByteLengths:void 0}},defaultOptions:{rad:{headers:void 0,withCredentials:!1,headerByteLengths:void 0}},testURL:t=>/\.rad(?:$|[?#])/i.test(t),createDataSource:(t,e,r)=>new Gu(t,e,r)},Gu=class extends bs{metadata;_metadataPromise=null;_chunkMetadataPromises=new Map;constructor(e,r,i){super(e,r,Y$.defaultOptions,i),this.metadata=this.getMetadata()}async initialize(){await this.getMetadata()}async getMetadata(){return this._metadataPromise||(this._metadataPromise=this._loadMetadata()),await this._metadataPromise}async getChunkCount(){return(await this.getMetadata()).chunks.length}async getChunkUrl(e){let r=await this.getMetadata(),i=this._getChunkRange(r,e);return i.filename?Dm(this.url,i.filename):typeof this.data=="string"?this.url:null}async getChunk(e,r={}){let i=await this.getMetadata(),n=this._getChunkRange(i,e);if(n.filename){if(typeof this.data!="string")throw new Error("RADSource: sidecar RADC chunks require a URL-backed RAD source.");return await this._fetchArrayBuffer(Dm(this.url,n.filename),void 0,{signal:r.signal})}if(n.bytes===0)return new ArrayBuffer(0);let o=i.chunksByteOffset+n.offset;return typeof this.data!="string"?await this.data.slice(o,o+n.bytes).arrayBuffer():await this._fetchArrayBuffer(this.url,{offset:o,bytes:n.bytes},{signal:r.signal})}async getChunkMetadata(e,r={}){let i=this._chunkMetadataPromises.get(e);return i||(i=this.getChunk(e,r).then(n=>ds(n)),this._chunkMetadataPromises.set(e,i)),await i}async getChunkSplats(e,r={}){let i=await this.getMetadata();return Ju(await this.getChunk(e,r),this._getChunkDecodeOptions(i,r))}async getChunkTable(e,r={}){let i=await this.getMetadata();return Im(await this.getChunk(e,r),this._getChunkDecodeOptions(i,r))}async*getChunkTables(e={}){let r=await this.getMetadata(),i=e.startChunkIndex??0,n=e.maxChunks??Number.POSITIVE_INFINITY,o=e.maxSplats??Number.POSITIVE_INFINITY,a=0,s=0;if(e.pruneLoadedLoDParents){let c=xF(r,i,n,o),u=await this._getChunkSplatsConcurrently(c,e),l=0;for(let d of u){a++,s+=d.splatCount;let f=SF(d);l=Math.max(l,f+d.splatCount)}for(let d of u)yield sn(kF(d,l));return}for(let c=i;c<r.chunks.length&&a<n&&s<o;c++){let u=await this.getChunkTable(c,e);a++,s+=u.data.numRows,yield u}}async _getChunkSplatsConcurrently(e,r){let i=new Array(e.length),n=IF(r.maxConcurrentChunkRequests),o=0;async function a(c){for(;o<e.length;){let u=o++,l=e[u];i[u]=await c.getChunkSplats(l,r)}}let s=Math.min(n,e.length);return await Promise.all(Array.from({length:s},()=>a(this))),i}_getChunkDecodeOptions(e,r){return{...r,radChunk:{splatEncoding:e.splatEncoding,...r.radChunk}}}async _loadMetadata(){let e=this.options.rad?.headerByteLengths?.length?this.options.rad.headerByteLengths:_F;if(typeof this.data!="string"){let r=Math.min(this.data.size,Math.max(...e)),i=ls(await this.data.slice(0,r).arrayBuffer());if(i)return i;throw new Error("RADSource: Blob does not contain a complete RAD metadata header.")}for(let r of e){let i=ls(await this._fetchArrayBuffer(this.url,{offset:0,bytes:r}));if(i)return i}throw new Error("RADSource: failed to load a complete RAD metadata header.")}_getChunkRange(e,r){if(!Number.isInteger(r)||r<0||r>=e.chunks.length)throw new Error(`RADSource: chunk index ${r} is outside 0-${e.chunks.length-1}.`);return e.chunks[r]}async _fetchArrayBuffer(e,r,i={}){let n=await this._fetchResponse(e,this._getRequestInit(r,i));if(!n.ok)throw new Error(`RADSource: failed to fetch ${e}: ${n.status} ${n.statusText}`);let o=await n.arrayBuffer();return r&&n.status!==206&&o.byteLength>=r.offset+r.bytes?o.slice(r.offset,r.offset+r.bytes):r&&o.byteLength>r.bytes?o.slice(0,r.bytes):o}async _fetchResponse(e,r){return this._hasCustomFetch()?await this.fetch(e,r):this.hasCoreApi?await this.coreApi.fetchFile(e,r):await this.fetch(e,r)}_hasCustomFetch(){return!!(this.loadOptions?.core?.fetch||this.loadOptions?.fetch)}_getRequestInit(e,r={}){let i=new Headers(this.options.rad?.headers);return e&&e.bytes>0&&i.set("Range",`bytes=${e.offset}-${e.offset+e.bytes-1}`),{headers:i,credentials:this.options.rad?.withCredentials?"include":"same-origin",signal:r.signal}}};function xF(t,e,r,i){let n=[],o=0;for(let a=e;a<t.chunks.length&&n.length<r&&o<i;a++){let s=t.chunks[a];n.push(a),o+=s?.count??t.chunkSize??0}return n}function IF(t){return Number.isFinite(t)&&t>0?Math.floor(t):wF}function SF(t){return typeof t.loaderData?.base=="number"?t.loaderData.base:0}function kF(t,e){let r=t.loaderData?.childCounts,i=t.loaderData?.childStarts;if(!(r instanceof Uint16Array)||!(i instanceof Uint32Array))return t;let n=new Uint32Array(t.splatCount),o=0;for(let c=0;c<t.splatCount;c++){let u=r[c],l=i[c];u>0&&l<e||(n[o++]=c)}if(o===t.splatCount)return t;let a=n.subarray(0,o),s=t.sphericalHarmonicsComponentCount??0;return{...t,splatCount:o,positions:Mn(t.positions,3,a),scales:Mn(t.scales,3,a),rotations:Mn(t.rotations,4,a),colors:Mn(t.colors,3,a),sphericalHarmonicDcs:t.sphericalHarmonicDcs?Mn(t.sphericalHarmonicDcs,3,a):void 0,opacities:Mn(t.opacities,1,a),sphericalHarmonics:t.sphericalHarmonics&&s?Mn(t.sphericalHarmonics,s,a):void 0,loaderData:{...t.loaderData,count:o,childCounts:Mn(r,1,a),childStarts:Mn(i,1,a)}}}function Mn(t,e,r){let i=new t.constructor(r.length*e);for(let n=0;n<r.length;n++){let o=r[n]*e,a=n*e;i.set(t.subarray(o,o+e),a)}return i}function Dm(t,e){if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("/"))return e;if(!t)throw new Error("RADSource: cannot resolve a sidecar RADC chunk without a RAD URL.");try{return new URL(e,t).toString()}catch{let[r,i=""]=t.split(/([?#].*)/,2),n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));return`${n>=0?r.slice(0,n+1):""}${e}${i}`}}return QB(Hu);})();
|
|
77
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of t.seen.entries()){let s=a[1];if(e===a[0]){o(a);continue}if(t.external){let u=t.external.registry.get(a[0])?.id;if(e!==a[0]&&u){o(a);continue}}if(t.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}s.count>1&&t.reused==="ref"&&o(a)}t.external&&(t.sharedDefsExtractedFor=t.external)}function Ez(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let r=[];for(let i of e){if(!i||typeof i!="object")return;Ez(i);let n=Object.keys(i);if(n.length!==1||n[0]!=="type")return;let o=i.type;for(let a of Array.isArray(o)?o:[o]){if(typeof a!="string")return;r.includes(a)||r.push(a)}}delete t.anyOf,t.type=r.length===1?r[0]:r}function Lz(t){let e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function J_(t){let e=[];for(let o of t){if(typeof o!="object"||o.type!=="object")return null;for(let a in o)if(!Cz.has(a))return null;e.push(o)}let r={},i=new Set;for(let o of e){for(let a in o.properties){if(Object.prototype.hasOwnProperty.call(r,a))continue;let s=[];for(let u of e){let l=u.properties?.[a]??Lz(u);l!=null&&(s.some(d=>JSON.stringify(d)===JSON.stringify(l))||s.push(l))}let c=s.length===1?s[0]:J_(s)??{allOf:s};st(r,a,c)}for(let a of o.required??[])i.add(a)}let n={type:"object",properties:r};if(i.size&&(n.required=[...i]),e.every(o=>o.additionalProperties===!1))n.additionalProperties=!1;else{let o=[];for(let a of e){let s=Lz(a);s&&!o.some(c=>JSON.stringify(c)===JSON.stringify(s))&&o.push(s)}o.length===1?n.additionalProperties=o[0]:o.length>1&&(n.additionalProperties={allOf:o})}return n}function X2(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let n of Cz)if(n in t)return;let r=e.filter(n=>Pz.some(o=>Array.isArray(n[o]))),i=null;if(!r.length)i=J_(e);else{let n=r[0],o=Pz.find(c=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let a=e.filter(c=>c!==n),s=n[o].map(c=>J_([...a,c]));if(s.some(c=>!c))return;i={[o]:s}}i&&(delete t.allOf,Iu(t,i))}function hi(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let c=t.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){i(d);let p=t.seen.get(d),h=p.schema;if(h.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Iu(u,h),Iu(u,l),s._zod.parent===d)for(let _ in u)_==="$ref"||_==="allOf"||_ in l||delete u[_];if(h.$ref&&p.def)for(let _ in u)_==="$ref"||_==="allOf"||_ in p.def&&JSON.stringify(u[_])===JSON.stringify(p.def[_])&&delete u[_]}let f=s._zod.parent;if(f&&f!==d){i(f);let p=t.seen.get(f);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}t.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let s of[...t.seen.entries()].reverse())i(s[0]);if(t.target!=="openapi-3.0")for(let s of t.seen.entries())Ez(s[1].def??s[1].schema);for(let s of t.deferred)s();if(t.intersections.length){let s=new Map;for(let c of t.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=s.get(l);d?d.push(u):s.set(l,[u])}for(let c of t.intersections)for(let u of s.get(c)??[])X2(u)}}let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(s)}Iu(n,r.defId?r.schema:r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&n.id===o&&delete n.id;let a=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let s of t.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,st(a,c.defId,c.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Qa(e,"input",t.processors),output:Qa(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Dt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Dt(i.element,r);if(i.type==="set")return Dt(i.valueType,r);if(i.type==="lazy")return Dt(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return Dt(i.innerType,r);if(i.type==="intersection")return Dt(i.left,r)||Dt(i.right,r);if(i.type==="record"||i.type==="map")return Dt(i.keyType,r)||Dt(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Dt(i.in,r)||Dt(i.out,r);if(i.type==="object"){for(let n in i.shape)if(Dt(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(Dt(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(Dt(n,r))return!0;return!!(i.rest&&Dt(i.rest,r))}return!1}var Cz,Pz,G_,Qa,Su=m(()=>{vu();O();Cz=new Set(["type","properties","required","additionalProperties"]),Pz=["oneOf","anyOf"];G_=(t,e={})=>r=>{let i=pi({...r,processors:e});return $e(t,i),mi(i,t),hi(i,t)},Qa=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},a=pi({...n??{},target:o,io:e,processors:r});return $e(t,a),mi(a,t),hi(a,t)}});function rt(t){let e={},r=t._zod.def,i=t._zod.traits.has("$ZodCheck")?[t,...r.checks??[]]:r.checks??[];for(let o of i)q2[o._zod.def.check]?.(e,o._zod.def);let n=t._zod.bag;n.minimum!==void 0&&es(e,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&es(e,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&ts(e,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&ts(e,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&Vz(e,n.multipleOf),n.format!==void 0&&(e.format??(e.format=n.format),n.format.includes("int")&&(e.isInt=!0)),n.mime&&Wz(e,n.mime);for(let o of n.patterns??[])Zz(e,o);return e}function ku(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?ku(e.out):e.type==="catch"?ku(e.innerType):t._zod.optin}function H_(t,e,r){if(e.$ref){if(r.has(e))return e;r.add(e);let h=t.get(e)?.def;if(!h)return e;let y=H_(t,h,r);return y===h?e:y}for(let h of["anyOf","oneOf"]){let y=e[h];if(!Array.isArray(y))continue;let _=y.map(D=>H_(t,D,r));_.some((D,I)=>D!==y[I])&&(e={...e,[h]:_})}let i=Array.isArray(e.type)?e.type:[e.type],n=!i.includes("string")&&i.some(h=>h==="number"||h==="integer"),o=e.enum??(e.const!==void 0?[e.const]:void 0);if(!n&&!o?.some(h=>typeof h=="number"))return e;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:f,...p}=e;return p.enum?p.enum=p.enum.map(h=>typeof h=="number"?String(h):h):typeof p.const=="number"&&(p.const=String(p.const)),n&&(p.type="string",o||(p.pattern=(i.includes("number")?Cn:tu).source)),p}function tC(t){let e=new Map;for(let i of t.seen.values())i.def&&!e.has(i.schema)&&e.set(i.schema,i);let r=new Map;for(let i of K_.get(t)??[]){let n=t.seen.get(i),o=(n?.def??n?.schema)?.propertyNames;if(!o||o===!0||r.has(o))continue;let a=H_(e,o,new Set);a!==o&&r.set(o,a)}if(r.size)for(let i of t.seen.values())for(let n of[i.schema,i.def]){let o=n&&r.get(n.propertyNames);o&&(n.propertyNames=o)}}function Hz(t,e,r,i,n){let o=!1,a=JSON.stringify(t,(s,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(tt(e,r,i,n,"BigInt defaults cannot be represented in JSON Schema"),kw):JSON.parse(a)}function Zp(t,e){if("_idmap"in t){let i=t,n=pi({...e,processors:Mp}),o={};for(let c of i._idmap.entries()){let[u,l]=c;$e(l,n)}let a={},s={registry:i,uri:e?.uri,defs:o};n.external=s;for(let c of i._idmap.entries()){let[u,l]=c;mi(n,l),st(a,u,hi(n,l))}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let r=pi({...e,processors:Mp});return $e(t,r),mi(r,t),hi(r,t)}var es,ts,Fz,Vz,Zz,Wz,Jz,jz,Mz,Rz,q2,Q2,eC,Gz,Y_,X_,q_,Q_,ew,tw,rw,nw,iw,ow,aw,sw,cw,uw,lw,dw,fw,pw,mw,hw,gw,yw,vw,bw,_w,Rp,ww,$w,K_,xw,Iw,Sw,kw,Dw,Aw,zw,Ow,Bw,Tw,Vp,Nw,Mp,Du=m(()=>{ho();La();Su();O();es=(t,e,r)=>{(t[e]===void 0||r>t[e])&&(t[e]=r)},ts=(t,e,r)=>{(t[e]===void 0||r<t[e])&&(t[e]=r)},Fz=(t,e)=>{es(t,"minimum",e),ts(t,"maximum",e)},Vz=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},Zz=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},Wz=(t,e)=>{t.mime=t.mime?t.mime.filter(r=>e.includes(r)):[...e]},Jz=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},jz=(t,e)=>es(t,"minimum",e.minimum),Mz=(t,e)=>ts(t,"maximum",e.maximum),Rz=t=>(e,r)=>{Jz(e,r.format);let[i,n]=t[r.format];es(e,"minimum",i),ts(e,"maximum",n)},q2={greater_than:(t,e)=>es(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>ts(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>Vz(t,e.value),number_format:Rz(Wc),bigint_format:Rz(Jc),min_length:jz,max_length:Mz,length_equals:(t,e)=>Fz(t,e.length),min_size:jz,max_size:Mz,size_equals:(t,e)=>Fz(t,e.size),string_format:(t,e)=>{Jz(t,e.format),e.pattern&&Zz(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>Wz(t,e.mime)};Q2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},eC=new Map([[Wf,Ky],[cu,Yy]]),Gz=t=>eC.get(t)??t,Y_=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:u,laxFormat:l}=rt(t);if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=Q2[s]??s,n.format===""&&delete n.format,(s==="time"||l)&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let d=[...c].map(Gz);d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(f=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},X_=(t,e,r,i)=>{let n=r,{minimum:o,maximum:a,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=rt(t);n.type=l?"integer":"number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";if(d?p?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof o=="number"&&(n.minimum=o),f?p?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof a=="number"&&(n.maximum=a),s){let h=new Set;for(let D of s)Number.isFinite(D)&&D!==0?h.add(Math.abs(D)):tt(t,e,n,i,`A multipleOf divisor of ${D} cannot be represented in JSON Schema`);let[y,..._]=h;y!==void 0&&(n.multipleOf=y),_.length&&(n.allOf=[...n.allOf??[],..._.map(D=>({multipleOf:D}))])}},q_=(t,e,r,i)=>{r.type="boolean"},Q_=(t,e,r,i)=>{tt(t,e,r,i,"BigInt cannot be represented in JSON Schema")},ew=(t,e,r,i)=>{tt(t,e,r,i,"Symbols cannot be represented in JSON Schema")},tw=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},rw=(t,e,r,i)=>{tt(t,e,r,i,"Undefined cannot be represented in JSON Schema")},nw=(t,e,r,i)=>{tt(t,e,r,i,"Void cannot be represented in JSON Schema")},iw=(t,e,r,i)=>{r.not={}},ow=(t,e,r,i)=>{},aw=(t,e,r,i)=>{},sw=(t,e,r,i)=>{tt(t,e,r,i,"Date cannot be represented in JSON Schema")},cw=(t,e,r,i)=>{let n=t._zod.def,o=Sa(n.entries);if(o.length===0){r.not={};return}o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},uw=(t,e,r,i)=>{let n=t._zod.def;if(n.values.length===0){r.not={};return}let o=[];for(let a of n.values)if(a===void 0){if(tt(t,e,r,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(tt(t,e,r,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},lw=(t,e,r,i)=>{tt(t,e,r,i,"NaN cannot be represented in JSON Schema")},dw=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},fw=(t,e,r,i)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:o,maximum:a,mime:s}=rt(t);o!==void 0&&(n.minLength=o),a!==void 0&&(n.maxLength=a),s&&(s.length===0?n.not={}:s.length===1?n.contentMediaType=s[0]:n.anyOf=s.map(c=>({contentMediaType:c})))},pw=(t,e,r,i)=>{r.type="boolean"},mw=(t,e,r,i)=>{tt(t,e,r,i,"Custom types cannot be represented in JSON Schema")},hw=(t,e,r,i)=>{tt(t,e,r,i,"Function types cannot be represented in JSON Schema")},gw=(t,e,r,i)=>{tt(t,e,r,i,"Transforms cannot be represented in JSON Schema")},yw=(t,e,r,i)=>{tt(t,e,r,i,"Map cannot be represented in JSON Schema")},vw=(t,e,r,i)=>{tt(t,e,r,i,"Set cannot be represented in JSON Schema")},bw=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:a,maximum:s}=rt(t);typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=$e(o.element,e,{...i,path:[...i.path,"items"]})};_w=(t,e,r,i)=>{let n=r,o=t._zod.def,a=o.shape;if(Object.getOwnPropertySymbols(a).length&&tt(t,e,n,i,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in a)st(n.properties,u,$e(a[u],e,{...i,path:[...i.path,"properties",u]}));let c=[];for(let u of Object.keys(a)){let l=o.shape[u];(e.io==="input"?ku(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(n.required=c),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=$e(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},Rp=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,a=n.options.map((s,c)=>$e(s,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=a:r.anyOf=a},ww=(t,e,r,i)=>{let n=t._zod.def,o=$e(n.left,e,{...i,path:[...i.path,"allOf",0]}),a=$e(n.right,e,{...i,path:[...i.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=c,e.intersections.push(c)},$w=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let a=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((y,_)=>$e(y,e,{...i,path:[...i.path,a,_]})),u=o.rest?$e(o.rest,e,{...i,path:[...i.path,s,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null,l=o.items.length;for(;l>0;){let y=o.items[l-1];if(!(e.io==="input"?ku(y)!==void 0:y._zod.optout==="optional"))break;l--}let d=o.items.length,f=!o.rest;e.target==="draft-2020-12"?(n.prefixItems=c,f?n.items=!1:u&&(n.items=u),l>0&&(n.minItems=l),f&&(n.maxItems=d)):e.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),l>0&&(n.minItems=l),f&&(n.maxItems=d)):(n.items=c,f?n.additionalItems=!1:u&&(n.additionalItems=u),l>0&&(n.minItems=l),f&&(n.maxItems=d));let{minimum:p,maximum:h}=rt(t);typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)};K_=new WeakMap;xw=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let a=o.keyType,s=rt(a).patterns;if(o.mode==="loose"&&s&&s.size>0){let l=$e(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of s)st(n.patternProperties,Gz(d).source,l)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){n.propertyNames=$e(o.keyType,e,{...i,path:[...i.path,"propertyNames"]});let l=K_.get(e);l||(l=[],K_.set(e,l),e.deferred.push(()=>tC(e))),l.push(t)}n.additionalProperties=$e(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]})}let c=a._zod.values,u=e.io==="input"&&ku(o.valueType)!==void 0;if(c&&!o.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l.map(String))}},Iw=(t,e,r,i)=>{let n=t._zod.def,o=$e(n.innerType,e,i),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Sw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},kw=Symbol();Dw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let a=Hz(n.defaultValue,t,e,r,i);a!==kw&&(r.default=a)},Aw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);if(o.ref=n.innerType,e.io!=="input")return;let a=Hz(n.defaultValue,t,e,r,i);a!==kw&&(r._prefault=a)},zw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{tt(t,e,r,i,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},Ow=(t,e,r,i)=>{let n=t._zod.def,o=n.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?o?n.out:n.in:n.out;$e(a,e,i);let s=e.seen.get(t);s.ref=a},Bw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},Tw=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Vp=(t,e,r,i)=>{let n=t._zod.def;$e(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Nw=(t,e,r,i)=>{let n=t._zod.innerType;$e(n,e,i);let o=e.seen.get(t);o.ref=n},Mp={string:Y_,number:X_,boolean:q_,bigint:Q_,symbol:ew,null:tw,undefined:rw,void:nw,never:iw,any:ow,unknown:aw,date:sw,enum:cw,literal:uw,nan:lw,template_literal:dw,file:fw,success:pw,custom:mw,function:hw,transform:gw,map:yw,set:vw,array:bw,object:_w,union:Rp,intersection:ww,tuple:$w,record:xw,nullable:Iw,nonoptional:Sw,default:Dw,prefault:Aw,catch:zw,pipe:Ow,readonly:Bw,promise:Tw,optional:Vp,lazy:Nw}});var Wp,Kz=m(()=>{Du();Su();Wp=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=pi({processors:Mp,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return $e(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,mi(this.ctx,e);let i=hi(this.ctx,e),{"~standard":n,...o}=i;return o}}});var Yz={};var Xz=m(()=>{});var jn={};Ie(jn,{$ZodAny:()=>yb,$ZodArray:()=>$b,$ZodAsyncError:()=>Ft,$ZodBase64:()=>ob,$ZodBase64URL:()=>ab,$ZodBigInt:()=>Xf,$ZodBigIntFormat:()=>pb,$ZodBoolean:()=>uu,$ZodCIDRv4:()=>nb,$ZodCIDRv6:()=>ib,$ZodCUID:()=>Wv,$ZodCUID2:()=>Jv,$ZodCatch:()=>Mb,$ZodCheck:()=>De,$ZodCheckBigIntFormat:()=>yv,$ZodCheckEndsWith:()=>zv,$ZodCheckGreaterThan:()=>Nf,$ZodCheckIncludes:()=>Dv,$ZodCheckLengthEquals:()=>xv,$ZodCheckLessThan:()=>Tf,$ZodCheckLowerCase:()=>Sv,$ZodCheckMaxLength:()=>wv,$ZodCheckMaxSize:()=>vv,$ZodCheckMimeType:()=>Tv,$ZodCheckMinLength:()=>$v,$ZodCheckMinSize:()=>bv,$ZodCheckMultipleOf:()=>hv,$ZodCheckNumberFormat:()=>gv,$ZodCheckOverwrite:()=>Nv,$ZodCheckProperties:()=>Bv,$ZodCheckProperty:()=>Ov,$ZodCheckRegex:()=>Iv,$ZodCheckSizeEquals:()=>_v,$ZodCheckStartsWith:()=>Av,$ZodCheckStringFormat:()=>Ua,$ZodCheckUpperCase:()=>kv,$ZodCodec:()=>du,$ZodCreditCard:()=>cb,$ZodCustom:()=>Hb,$ZodCustomStringFormat:()=>db,$ZodCyclicError:()=>ip,$ZodDate:()=>wb,$ZodDefault:()=>Eb,$ZodDiscriminatedUnion:()=>kb,$ZodE164:()=>sb,$ZodEmail:()=>Fv,$ZodEmoji:()=>Vv,$ZodEncodeError:()=>li,$ZodEnum:()=>Bb,$ZodError:()=>Dy,$ZodExactOptional:()=>Pb,$ZodFile:()=>Nb,$ZodFunction:()=>Jb,$ZodGUID:()=>Ev,$ZodIBAN:()=>ub,$ZodIPv4:()=>eb,$ZodIPv6:()=>tb,$ZodISODate:()=>Xv,$ZodISODateTime:()=>Yv,$ZodISODuration:()=>Qv,$ZodISOTime:()=>qv,$ZodIntersection:()=>Db,$ZodJWT:()=>lb,$ZodKSUID:()=>Kv,$ZodLazy:()=>fu,$ZodLiteral:()=>Tb,$ZodMAC:()=>rb,$ZodMap:()=>zb,$ZodNaN:()=>Rb,$ZodNanoID:()=>Zv,$ZodNever:()=>bb,$ZodNonOptional:()=>Fb,$ZodNull:()=>gb,$ZodNullable:()=>Lb,$ZodNumber:()=>Yf,$ZodNumberFormat:()=>fb,$ZodObject:()=>eA,$ZodObjectJIT:()=>xb,$ZodOptional:()=>Qf,$ZodPipe:()=>ep,$ZodPrefault:()=>Cb,$ZodPreprocess:()=>Vb,$ZodPromise:()=>Gb,$ZodReadonly:()=>Zb,$ZodRealError:()=>jt,$ZodRecord:()=>Ab,$ZodRegistry:()=>lp,$ZodSet:()=>Ob,$ZodString:()=>yo,$ZodStringFormat:()=>we,$ZodSuccess:()=>jb,$ZodSymbol:()=>mb,$ZodTemplateLiteral:()=>Wb,$ZodTransform:()=>Ub,$ZodTuple:()=>qf,$ZodType:()=>ee,$ZodULID:()=>Gv,$ZodURL:()=>Rv,$ZodUUID:()=>Cv,$ZodUndefined:()=>hb,$ZodUnion:()=>lu,$ZodUnknown:()=>vb,$ZodVoid:()=>_b,$ZodXID:()=>Hv,$ZodXor:()=>Ib,$brand:()=>Iy,$constructor:()=>v,$input:()=>n_,$output:()=>r_,Doc:()=>go,INVALID:()=>kt,JSONSchema:()=>Yz,JSONSchemaGenerator:()=>Wp,NEVER:()=>xy,TimePrecision:()=>m_,URL_BAD_FORMAT:()=>jv,URL_UNPARSEABLE:()=>iu,ZodCompileAsyncError:()=>Nr,ZodCompileUnsupportedError:()=>fe,_any:()=>B_,_array:()=>C_,_base64:()=>Tp,_base64url:()=>Np,_bigint:()=>I_,_boolean:()=>$_,_catch:()=>W2,_check:()=>Tz,_cidrv4:()=>Op,_cidrv6:()=>Bp,_coercedBigint:()=>S_,_coercedBoolean:()=>x_,_coercedDate:()=>L_,_coercedNumber:()=>g_,_coercedString:()=>l_,_creditCard:()=>f_,_cuid:()=>xp,_cuid2:()=>Ip,_custom:()=>j_,_date:()=>P_,_decode:()=>wf,_decodeAsync:()=>xf,_default:()=>R2,_discriminatedUnion:()=>O2,_e164:()=>Up,_email:()=>hp,_emoji:()=>wp,_encode:()=>_f,_encodeAsync:()=>$f,_endsWith:()=>Wa,_enum:()=>L2,_file:()=>F_,_float32:()=>v_,_float64:()=>b_,_gt:()=>un,_gte:()=>tr,_guid:()=>gp,_iban:()=>p_,_includes:()=>Va,_int:()=>y_,_int32:()=>__,_int64:()=>k_,_intersection:()=>B2,_ipv4:()=>Ap,_ipv6:()=>zp,_isoDate:()=>wu,_isoDateTime:()=>_u,_isoDuration:()=>xu,_isoTime:()=>$u,_jwt:()=>Pp,_ksuid:()=>Dp,_lazy:()=>K2,_length:()=>Io,_literal:()=>C2,_lowercase:()=>Ma,_lt:()=>cn,_lte:()=>er,_mac:()=>d_,_map:()=>U2,_max:()=>er,_maxLength:()=>xo,_maxSize:()=>fi,_mime:()=>Ga,_min:()=>tr,_minLength:()=>Fn,_minSize:()=>ln,_multipleOf:()=>di,_nan:()=>E_,_nanoid:()=>$p,_nativeEnum:()=>E2,_negative:()=>Ep,_never:()=>N_,_nonnegative:()=>Fp,_nonoptional:()=>V2,_nonpositive:()=>Cp,_normalize:()=>Ha,_null:()=>O_,_nullable:()=>M2,_number:()=>h_,_optional:()=>j2,_overwrite:()=>Ur,_parse:()=>Oa,_parseAsync:()=>Ba,_pipe:()=>J2,_positive:()=>Lp,_promise:()=>Y2,_properties:()=>Ja,_property:()=>jp,_readonly:()=>G2,_record:()=>N2,_refine:()=>M_,_regex:()=>ja,_safeDecode:()=>Sf,_safeDecodeAsync:()=>Df,_safeEncode:()=>If,_safeEncodeAsync:()=>kf,_safeParse:()=>Ta,_safeParseAsync:()=>Na,_set:()=>P2,_size:()=>$o,_slugify:()=>qa,_startsWith:()=>Za,_string:()=>u_,_stringFormat:()=>So,_stringbool:()=>W_,_success:()=>Z2,_superRefine:()=>R_,_symbol:()=>A_,_templateLiteral:()=>H2,_toLowerCase:()=>Ya,_toUpperCase:()=>Xa,_transform:()=>F2,_trim:()=>Ka,_tuple:()=>T2,_uint32:()=>w_,_uint64:()=>D_,_ulid:()=>Sp,_undefined:()=>z_,_union:()=>A2,_unknown:()=>T_,_uppercase:()=>Ra,_url:()=>bu,_uuid:()=>yp,_uuidv4:()=>vp,_uuidv6:()=>bp,_uuidv7:()=>_p,_void:()=>U_,_xid:()=>kp,_xor:()=>z2,base64Charset:()=>Wf,base64urlCharset:()=>cu,canParseURL:()=>Mv,clone:()=>_e,compile:()=>s_,compileFn:()=>pp,config:()=>Me,createStandardJSONSchemaMethod:()=>Qa,createToJSONSchemaMethod:()=>G_,decode:()=>TP,decodeAsync:()=>UP,describe:()=>V_,encode:()=>BP,encodeAsync:()=>NP,extractDefs:()=>mi,finalize:()=>hi,flattenError:()=>Yc,formatError:()=>Xc,getDiscriminatedOption:()=>Sb,globalConfig:()=>nt,globalRegistry:()=>ct,handleUnrepresentable:()=>tt,initializeContext:()=>pi,isBackEdge:()=>ap,isRecursiveSchema:()=>op,isValidBase64:()=>su,isValidBase64URL:()=>Jf,isValidCIDRv6:()=>Zf,isValidCreditCard:()=>Gf,isValidIBAN:()=>Hf,isValidIPv6:()=>au,isValidJWT:()=>Kf,locales:()=>yu,memoizer:()=>hu,mergeValues:()=>Pa,meta:()=>Z_,parse:()=>vf,parseAsync:()=>bf,parseURLObject:()=>XD,prettifyError:()=>zy,process:()=>$e,processSchema:()=>$e,regexes:()=>hr,registry:()=>dp,safeDecode:()=>LP,safeDecodeAsync:()=>CP,safeEncode:()=>PP,safeEncodeAsync:()=>EP,safeParse:()=>kP,safeParseAsync:()=>DP,standardProps:()=>jf,stripTabAndNewline:()=>ou,toDotPath:()=>OD,toJSONSchema:()=>Zp,toZod:()=>Mc,treeifyError:()=>Ay,urlHostnameOk:()=>Rf,urlProtocolOk:()=>Vf,util:()=>w,validate:()=>qc,validateAsync:()=>Qc,validateURL:()=>Mf,version:()=>Uv,withParser:()=>fp});var rr=m(()=>{ui();By();Oy();La();Xb();Uf();Pv();O();O();ho();t_();vu();Pf();Bz();Nz();Su();Du();Kz();Xz()});var Jp={};Ie(Jp,{endsWith:()=>Wa,gt:()=>un,gte:()=>tr,includes:()=>Va,length:()=>Io,lowercase:()=>Ma,lt:()=>cn,lte:()=>er,maxLength:()=>xo,maxSize:()=>fi,mime:()=>Ga,minLength:()=>Fn,minSize:()=>ln,multipleOf:()=>di,negative:()=>Ep,nonnegative:()=>Fp,nonpositive:()=>Cp,normalize:()=>Ha,overwrite:()=>Ur,positive:()=>Lp,properties:()=>Ja,property:()=>jp,regex:()=>ja,size:()=>$o,slugify:()=>qa,startsWith:()=>Za,toLowerCase:()=>Ya,toUpperCase:()=>Xa,trim:()=>Ka,uppercase:()=>Ra});var Gp=m(()=>{rr()});function Hp(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){let i=r(this);return Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0})}})}var qz,Qz,nC,Mt,Uw=m(()=>{rr();rr();O();qz=new WeakSet([Object.prototype,Error.prototype]);Qz=(t,e)=>{Dy.init(t,e),t.name="ZodError";let r=Object.getPrototypeOf(t);qz.has(r)||(qz.add(r),Hp(r,"format",i=>n=>Xc(i,n)),Hp(r,"flatten",i=>n=>Yc(i,n)),Hp(r,"addIssue",i=>n=>{i.issues.push(n),i.message=JSON.stringify(i.issues,ka,2)}),Hp(r,"addIssues",i=>n=>{i.issues.push(...n),i.message=JSON.stringify(i.issues,ka,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},nC=v("ZodError",Qz),Mt=v("ZodError",Qz,void 0,{Parent:Error})});var Pw,Lw,Ew,Cw,Fw,jw,Mw,Rw,Vw,Zw,Ww,Jw,Gw=m(()=>{rr();Uw();rr();Pw=Oa(Mt),Lw=Ba(Mt),Ew=Ta(Mt),Cw=Na(Mt),Fw=_f(Mt),jw=wf(Mt),Mw=$f(Mt),Rw=xf(Mt),Vw=If(Mt),Zw=Sf(Mt),Ww=kf(Mt),Jw=Df(Mt)});var us={};Ie(us,{ZodAny:()=>n$,ZodArray:()=>s$,ZodBase64:()=>dm,ZodBase64URL:()=>fm,ZodBigInt:()=>ss,ZodBigIntFormat:()=>hm,ZodBoolean:()=>as,ZodCIDRv4:()=>um,ZodCIDRv6:()=>lm,ZodCUID:()=>rm,ZodCUID2:()=>nm,ZodCatch:()=>A$,ZodCodec:()=>Eu,ZodCreditCard:()=>Kw,ZodCustom:()=>Cu,ZodCustomStringFormat:()=>zo,ZodDate:()=>Bu,ZodDefault:()=>$$,ZodDiscriminatedUnion:()=>u$,ZodE164:()=>pm,ZodEmail:()=>qp,ZodEmoji:()=>em,ZodEnum:()=>ns,ZodExactOptional:()=>bm,ZodFile:()=>v$,ZodFunction:()=>C$,ZodGUID:()=>Qp,ZodIBAN:()=>Yw,ZodIPv4:()=>sm,ZodIPv6:()=>cm,ZodISODate:()=>yi,ZodISODateTime:()=>gi,ZodISODuration:()=>bi,ZodISOTime:()=>vi,ZodInstanceOf:()=>M$,ZodIntersection:()=>l$,ZodJWT:()=>mm,ZodKSUID:()=>am,ZodLazy:()=>P$,ZodLiteral:()=>y$,ZodMAC:()=>Hw,ZodMap:()=>h$,ZodNaN:()=>O$,ZodNanoID:()=>tm,ZodNever:()=>o$,ZodNonOptional:()=>_m,ZodNull:()=>t$,ZodNullable:()=>w$,ZodNumber:()=>os,ZodNumberFormat:()=>Oo,ZodObject:()=>Nu,ZodOptional:()=>Pu,ZodPipe:()=>Lu,ZodPrefault:()=>I$,ZodPreprocess:()=>B$,ZodPromise:()=>E$,ZodReadonly:()=>T$,ZodRecord:()=>rs,ZodSet:()=>g$,ZodString:()=>is,ZodStringFormat:()=>xe,ZodSuccess:()=>D$,ZodSymbol:()=>Qw,ZodTemplateLiteral:()=>U$,ZodTransform:()=>b$,ZodTuple:()=>f$,ZodType:()=>oe,ZodULID:()=>im,ZodURL:()=>Ou,ZodUUID:()=>dn,ZodUndefined:()=>e$,ZodUnion:()=>Uu,ZodUnknown:()=>i$,ZodVoid:()=>a$,ZodXID:()=>om,ZodXor:()=>c$,_ZodString:()=>Xp,_default:()=>x$,_function:()=>uB,any:()=>jO,array:()=>Tu,base64:()=>_O,base64url:()=>wO,bigint:()=>PO,boolean:()=>qw,catch:()=>z$,check:()=>lB,cidrv4:()=>vO,cidrv6:()=>bO,codec:()=>oB,creditCard:()=>xO,cuid:()=>lO,cuid2:()=>dO,currencyCode:()=>zO,custom:()=>dB,date:()=>RO,describe:()=>fB,discriminatedUnion:()=>HO,e164:()=>$O,email:()=>eO,emoji:()=>cO,enum:()=>ym,exactOptional:()=>_$,file:()=>tB,float32:()=>BO,float64:()=>TO,function:()=>uB,guid:()=>tO,hash:()=>OO,hex:()=>AO,hostname:()=>DO,httpUrl:()=>sO,iban:()=>IO,instanceof:()=>mB,int:()=>Kp,int32:()=>NO,int64:()=>LO,intersection:()=>d$,invertCodec:()=>aB,ipv4:()=>hO,ipv6:()=>yO,json:()=>gB,jwt:()=>SO,keyof:()=>VO,ksuid:()=>mO,lazy:()=>L$,literal:()=>eB,looseObject:()=>JO,looseRecord:()=>YO,mac:()=>gO,map:()=>XO,meta:()=>pB,nan:()=>iB,nanoid:()=>uO,nativeEnum:()=>QO,never:()=>gm,nonoptional:()=>k$,null:()=>r$,nullable:()=>zu,nullish:()=>rB,number:()=>Xw,object:()=>ZO,optional:()=>Do,partialRecord:()=>KO,pipe:()=>Yp,prefault:()=>S$,preprocess:()=>yB,promise:()=>cB,readonly:()=>N$,record:()=>m$,refine:()=>F$,set:()=>qO,strictObject:()=>WO,string:()=>Au,stringFormat:()=>kO,stringbool:()=>hB,success:()=>nB,superRefine:()=>j$,symbol:()=>CO,templateLiteral:()=>sB,transform:()=>vm,tuple:()=>p$,uint32:()=>UO,uint64:()=>EO,ulid:()=>fO,undefined:()=>FO,union:()=>cs,unknown:()=>ko,url:()=>aO,uuid:()=>rO,uuidv4:()=>nO,uuidv6:()=>iO,uuidv7:()=>oO,void:()=>MO,xid:()=>pO,xor:()=>GO});function oC(){nt.localeError||Me(sp())}function Ao(){nt.memoizer||Me({memoizer:hu()})}function Au(t){return u_(is,t)}function eO(t){return hp(qp,t)}function tO(t){return gp(Qp,t)}function rO(t){return yp(dn,t)}function nO(t){return vp(dn,t)}function iO(t){return bp(dn,t)}function oO(t){return _p(dn,t)}function aO(t){return bu(Ou,t)}function sO(t){return bu(Ou,{protocol:eu,hostname:qy,...w.normalizeParams(t)})}function cO(t){return wp(em,t)}function uO(t){return $p(tm,t)}function lO(t){return xp(rm,t)}function dO(t){return Ip(nm,t)}function fO(t){return Sp(im,t)}function pO(t){return kp(om,t)}function mO(t){return Dp(am,t)}function hO(t){return Ap(sm,t)}function gO(t){return d_(Hw,t)}function yO(t){return zp(cm,t)}function vO(t){return Op(um,t)}function bO(t){return Bp(lm,t)}function _O(t){return Tp(dm,t)}function wO(t){return Np(fm,t)}function $O(t){return Up(pm,t)}function xO(t){return f_(Kw,t)}function IO(t){return p_(Yw,t)}function SO(t){return Pp(mm,t)}function kO(t,e,r={}){return So(zo,t,e,r)}function DO(t){return So(zo,"hostname",Xy,t)}function AO(t){return So(zo,"hex",fv,t)}function zO(t){return So(zo,"currency_code",ev,t)}function OO(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=hr[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return So(zo,i,n,e)}function Xw(t){return h_(os,t)}function Kp(t){return y_(Oo,t)}function BO(t){return v_(Oo,t)}function TO(t){return b_(Oo,t)}function NO(t){return __(Oo,t)}function UO(t){return w_(Oo,t)}function qw(t){return $_(as,t)}function PO(t){return I_(ss,t)}function LO(t){return k_(hm,t)}function EO(t){return D_(hm,t)}function CO(t){return A_(Qw,t)}function FO(t){return z_(e$,t)}function r$(t){return O_(t$,t)}function jO(){return B_(n$)}function ko(){return T_(i$)}function gm(t){return N_(o$,t)}function MO(t){return U_(a$,t)}function RO(t){return P_(Bu,t)}function Tu(t,e){return C_(s$,t,e)}function VO(t){let e=t._zod.def.shape;return ym(Object.keys(e))}function ZO(t,e){let r={type:"object",shape:t??{},...w.normalizeParams(e)};return new Nu(r)}function WO(t,e){return new Nu({type:"object",shape:t,catchall:gm(),...w.normalizeParams(e)})}function JO(t,e){return new Nu({type:"object",shape:t,catchall:ko(),...w.normalizeParams(e)})}function cs(t,e){return new Uu({type:"union",options:t,...w.normalizeParams(e)})}function GO(t,e){return new c$({type:"union",options:t,inclusive:!1,...w.normalizeParams(e)})}function HO(t,e,r){return new u$({type:"union",options:e,discriminator:t,...w.normalizeParams(r)})}function d$(t,e){return new l$({type:"intersection",left:t,right:e})}function p$(t,e,r){let i=e instanceof ee,n=i?r:e,o=i?e:null;return new f$({type:"tuple",items:t,rest:o,...w.normalizeParams(n)})}function m$(t,e,r){return!e||!e._zod?new rs({type:"record",keyType:Au(),valueType:t,...w.normalizeParams(e)}):new rs({type:"record",keyType:t,valueType:e,...w.normalizeParams(r)})}function KO(t,e,r){return new rs({type:"record",keyType:t,valueType:e,...w.normalizeParams(r),partial:!0})}function YO(t,e,r){return new rs({type:"record",keyType:t,valueType:e,mode:"loose",...w.normalizeParams(r)})}function XO(t,e,r){return new h$({type:"map",keyType:t,valueType:e,...w.normalizeParams(r)})}function qO(t,e){return new g$({type:"set",valueType:t,...w.normalizeParams(e)})}function ym(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new ns({type:"enum",entries:r,...w.normalizeParams(e)})}function QO(t,e){return new ns({type:"enum",entries:t,...w.normalizeParams(e)})}function eB(t,e){return new y$({type:"literal",values:Array.isArray(t)?t:[t],...w.normalizeParams(e)})}function tB(t){return F_(v$,t)}function vm(t){return new b$({type:"transform",transform:t})}function Do(t){return new Pu({type:"optional",innerType:t})}function _$(t){return new bm({type:"optional",innerType:t})}function zu(t){return new w$({type:"nullable",innerType:t})}function rB(t){return Do(zu(t))}function x$(t,e){return new $$({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():w.shallowClone(e)}})}function S$(t,e){return new I$({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():w.shallowClone(e)}})}function k$(t,e){return new _m({type:"nonoptional",innerType:t,...w.normalizeParams(e)})}function nB(t){return new D$({type:"success",innerType:t})}function z$(t,e){return new A$({type:"catch",innerType:t,catchValue:typeof e=="function"?e:w.constantCatch(e)})}function iB(t){return E_(O$,t)}function Yp(t,e){return new Lu({type:"pipe",in:t,out:e})}function oB(t,e,r){return new Eu({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function aB(t){let e=t._zod.def;return new Eu({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function N$(t){return new T$({type:"readonly",innerType:t})}function sB(t,e){return new U$({type:"template_literal",parts:t,...w.normalizeParams(e)})}function L$(t){return new P$({type:"lazy",getter:t})}function cB(t){return new E$({type:"promise",innerType:t})}function uB(t){return new C$({type:"function",input:Array.isArray(t?.input)?p$(t?.input):t?.input??Tu(ko()),output:t?.output??ko()})}function lB(t){let e=new De({check:"custom"});return e._zod.check=t,e}function dB(t,e){return j_(Cu,t??(()=>!0),e)}function F$(t,e={}){return M_(Cu,t,e)}function j$(t,e){return R_(t,e)}function mB(t,e={}){let r=new M$({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...w.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}function gB(t){let e=L$(()=>cs([Au(t),Xw(),qw(),r$(),Tu(e),m$(Au(),e)]));return e}function yB(t,e){return new B$({type:"pipe",in:vm(t),out:e})}var oe,Xp,is,xe,gi,yi,vi,bi,qp,Qp,dn,Ou,em,tm,rm,nm,im,om,am,sm,Hw,cm,um,lm,dm,fm,pm,Kw,Yw,mm,zo,os,Oo,as,ss,hm,Qw,e$,t$,n$,i$,o$,a$,Bu,s$,Nu,Uu,c$,u$,l$,f$,rs,h$,g$,ns,y$,v$,b$,Pu,bm,w$,$$,I$,_m,D$,A$,O$,Lu,Eu,B$,T$,U$,P$,E$,C$,Cu,fB,pB,M$,hB,_i=m(()=>{rr();rr();Du();ho();Su();qb();Gp();Gw();oe=v("ZodType",(t,e)=>(oC(),ee.init(t,e),t.def=e,t.type=e.type,t),{check(...t){let e=this.def;return this.clone(w.mergeDefs(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return _e(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(F$(t,e))},superRefine(t,e){return this.check(j$(t,e))},overwrite(t){return this.check(Ur(t))},optional(){return Do(this)},exactOptional(){return _$(this)},nullable(){return zu(this)},nullish(){return Do(zu(this))},nonoptional(t){return k$(this,t)},array(){return Tu(this)},or(t){return cs([this,t])},and(t){return d$(this,t)},transform(t){return Yp(this,vm(t))},default(t){return x$(this,t)},prefault(t){return S$(this,t)},catch(t){return z$(this,t)},pipe(t){return Yp(this,t)},readonly(){return N$(this)},describe(t){let e=this.clone();return ct.add(e,{description:t}),e},meta(...t){if(t.length===0)return ct.get(this);let e=this.clone();return ct.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return w.hide(this,"~standard",{...jf(this),jsonSchema:{input:Qa(this,"input"),output:Qa(this,"output")}})},set"~standard"(t){w.own(this,"~standard",t)},parse:function t(e,r){return Pw(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await Lw(this,e,r,{callee:t})},safeParse(t,e){return Ew(this,t,e)},async safeParseAsync(t,e){return Cw(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){w.own(this,"spa",t)},validate(t,e){return qc(this,t,e)},validateAsync(t,e){return Qc(this,t,e)},encode:function t(e,r){return Fw(this,e,r,{callee:t})},decode:function t(e,r){return jw(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await Mw(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await Rw(this,e,r,{callee:t})},safeEncode(t,e){return Vw(this,t,e)},safeDecode(t,e){return Zw(this,t,e)},async safeEncodeAsync(t,e){return Ww(this,t,e)},async safeDecodeAsync(t,e){return Jw(this,t,e)},toJSONSchema(t){return G_(this,{})(t)},get description(){return ct.get(this)?.description},get _def(){return this._zod.def}}),Xp=v("_ZodString",(t,e)=>{yo.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Y_(t,r,i,n)},w.derived({format:t=>rt(t).format??null,minLength:t=>rt(t).minimum??null,maxLength:t=>rt(t).maximum??null},{regex(...t){return this.check(ja(...t))},includes(...t){return this.check(Va(...t))},startsWith(...t){return this.check(Za(...t))},endsWith(...t){return this.check(Wa(...t))},min(...t){return this.check(Fn(...t))},max(...t){return this.check(xo(...t))},length(...t){return this.check(Io(...t))},nonempty(...t){return this.check(Fn(1,...t))},lowercase(t){return this.check(Ma(t))},uppercase(t){return this.check(Ra(t))},trim(){return this.check(Ka())},normalize(...t){return this.check(Ha(...t))},toLowerCase(){return this.check(Ya())},toUpperCase(){return this.check(Xa())},slugify(){return this.check(qa())}})),is=v("ZodString",(t,e)=>{yo.init(t,e),Xp.init(t,e)},{email(t){return this.check(hp(qp,t))},url(t){return this.check(bu(Ou,t))},jwt(t){return this.check(Pp(mm,t))},emoji(t){return this.check(wp(em,t))},guid(t){return this.check(gp(Qp,t))},uuid(t){return this.check(yp(dn,t))},uuidv4(t){return this.check(vp(dn,t))},uuidv6(t){return this.check(bp(dn,t))},uuidv7(t){return this.check(_p(dn,t))},nanoid(t){return this.check($p(tm,t))},cuid(t){return this.check(xp(rm,t))},cuid2(t){return this.check(Ip(nm,t))},ulid(t){return this.check(Sp(im,t))},base64(t){return this.check(Tp(dm,t))},base64url(t){return this.check(Np(fm,t))},xid(t){return this.check(kp(om,t))},ksuid(t){return this.check(Dp(am,t))},ipv4(t){return this.check(Ap(sm,t))},ipv6(t){return this.check(zp(cm,t))},cidrv4(t){return this.check(Op(um,t))},cidrv6(t){return this.check(Bp(lm,t))},e164(t){return this.check(Up(pm,t))},datetime(t){return this.check(_u(gi,t))},date(t){return this.check(wu(yi,t))},time(t){return this.check($u(vi,t))},duration(t){return this.check(xu(bi,t))}});xe=v("ZodStringFormat",(t,e)=>{we.init(t,e),Xp.init(t,e)}),gi=v("ZodISODateTime",(t,e)=>{Yv.init(t,e),xe.init(t,e)}),yi=v("ZodISODate",(t,e)=>{Xv.init(t,e),xe.init(t,e)}),vi=v("ZodISOTime",(t,e)=>{qv.init(t,e),xe.init(t,e)}),bi=v("ZodISODuration",(t,e)=>{Qv.init(t,e),xe.init(t,e)}),qp=v("ZodEmail",(t,e)=>{Fv.init(t,e),xe.init(t,e)});Qp=v("ZodGUID",(t,e)=>{Ev.init(t,e),xe.init(t,e)});dn=v("ZodUUID",(t,e)=>{Cv.init(t,e),xe.init(t,e)});Ou=v("ZodURL",(t,e)=>{Rv.init(t,e),xe.init(t,e)});em=v("ZodEmoji",(t,e)=>{Vv.init(t,e),xe.init(t,e)});tm=v("ZodNanoID",(t,e)=>{Zv.init(t,e),xe.init(t,e)});rm=v("ZodCUID",(t,e)=>{Wv.init(t,e),xe.init(t,e)});nm=v("ZodCUID2",(t,e)=>{Jv.init(t,e),xe.init(t,e)});im=v("ZodULID",(t,e)=>{Gv.init(t,e),xe.init(t,e)});om=v("ZodXID",(t,e)=>{Hv.init(t,e),xe.init(t,e)});am=v("ZodKSUID",(t,e)=>{Kv.init(t,e),xe.init(t,e)});sm=v("ZodIPv4",(t,e)=>{eb.init(t,e),xe.init(t,e)});Hw=v("ZodMAC",(t,e)=>{rb.init(t,e),xe.init(t,e)});cm=v("ZodIPv6",(t,e)=>{tb.init(t,e),xe.init(t,e)});um=v("ZodCIDRv4",(t,e)=>{nb.init(t,e),xe.init(t,e)});lm=v("ZodCIDRv6",(t,e)=>{ib.init(t,e),xe.init(t,e)});dm=v("ZodBase64",(t,e)=>{ob.init(t,e),xe.init(t,e)});fm=v("ZodBase64URL",(t,e)=>{ab.init(t,e),xe.init(t,e)});pm=v("ZodE164",(t,e)=>{sb.init(t,e),xe.init(t,e)});Kw=v("ZodCreditCard",(t,e)=>{cb.init(t,e),xe.init(t,e)});Yw=v("ZodIBAN",(t,e)=>{ub.init(t,e),xe.init(t,e)});mm=v("ZodJWT",(t,e)=>{lb.init(t,e),xe.init(t,e)});zo=v("ZodCustomStringFormat",(t,e)=>{db.init(t,e),xe.init(t,e)});os=v("ZodNumber",(t,e)=>{Yf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>X_(t,r,i,n),t.isFinite=!0},w.derived({minValue:t=>{let{minimum:e,exclusiveMinimum:r}=rt(t);return Math.max(e??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:t=>{let{maximum:e,exclusiveMaximum:r}=rt(t);return Math.min(e??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:t=>{let{isInt:e,multipleOf:r}=rt(t);return!!e||!!r?.some(Number.isSafeInteger)},format:t=>rt(t).format??null},{gt(t,e){return this.check(un(t,e))},gte(t,e){return this.check(tr(t,e))},min(t,e){return this.check(tr(t,e))},lt(t,e){return this.check(cn(t,e))},lte(t,e){return this.check(er(t,e))},max(t,e){return this.check(er(t,e))},int(t){return this.check(Kp(t))},safe(t){return this.check(Kp(t))},positive(t){return this.check(un(0,t))},nonnegative(t){return this.check(tr(0,t))},negative(t){return this.check(cn(0,t))},nonpositive(t){return this.check(er(0,t))},multipleOf(t,e){return this.check(di(t,e))},step(t,e){return this.check(di(t,e))},finite(){return this}}));Oo=v("ZodNumberFormat",(t,e)=>{fb.init(t,e),os.init(t,e)});as=v("ZodBoolean",(t,e)=>{uu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>q_(t,r,i,n)});ss=v("ZodBigInt",(t,e)=>{Xf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Q_(t,r,i,n)},w.derived({minValue:t=>rt(t).minimum??null,maxValue:t=>rt(t).maximum??null,format:t=>rt(t).format??null},{gte(t,e){return this.check(tr(t,e))},min(t,e){return this.check(tr(t,e))},gt(t,e){return this.check(un(t,e))},lt(t,e){return this.check(cn(t,e))},lte(t,e){return this.check(er(t,e))},max(t,e){return this.check(er(t,e))},positive(t){return this.check(un(BigInt(0),t))},negative(t){return this.check(cn(BigInt(0),t))},nonpositive(t){return this.check(er(BigInt(0),t))},nonnegative(t){return this.check(tr(BigInt(0),t))},multipleOf(t,e){return this.check(di(t,e))}}));hm=v("ZodBigIntFormat",(t,e)=>{pb.init(t,e),ss.init(t,e)});Qw=v("ZodSymbol",(t,e)=>{mb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ew(t,r,i,n)});e$=v("ZodUndefined",(t,e)=>{hb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rw(t,r,i,n)});t$=v("ZodNull",(t,e)=>{gb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tw(t,r,i,n)});n$=v("ZodAny",(t,e)=>{yb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ow(t,r,i,n)});i$=v("ZodUnknown",(t,e)=>{vb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>aw(t,r,i,n)});o$=v("ZodNever",(t,e)=>{bb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>iw(t,r,i,n)});a$=v("ZodVoid",(t,e)=>{_b.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nw(t,r,i,n)});Bu=v("ZodDate",(t,e)=>{wb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sw(t,r,i,n),t.min=(r,i)=>t.check(tr(r,i)),t.max=(r,i)=>t.check(er(r,i))},w.derived({minDate:t=>{let{minimum:e}=rt(t);return e?new Date(e):null},maxDate:t=>{let{maximum:e}=rt(t);return e?new Date(e):null}},{}));s$=v("ZodArray",(t,e)=>{Ao(),$b.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bw(t,r,i,n),t.element=e.element},{min(t,e){return this.check(Fn(t,e))},nonempty(t){return this.check(Fn(1,t))},max(t,e){return this.check(xo(t,e))},length(t,e){return this.check(Io(t,e))},unwrap(){return this.element}});Nu=v("ZodObject",(t,e)=>{Ao(),xb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_w(t,r,i,n),w.installLazyProp(t,"shape",r=>r._zod.def.shape,!1)},{keyof(){return ym(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(w.mergeDefs(this._zod.def,{catchall:t}))},passthrough(){return this.clone(w.mergeDefs(this._zod.def,{catchall:ko()}))},loose(){return this.clone(w.mergeDefs(this._zod.def,{catchall:ko()}))},strict(){return this.clone(w.mergeDefs(this._zod.def,{catchall:gm()}))},strip(){return this.clone(w.mergeDefs(this._zod.def,{catchall:void 0}))},extend(t){return w.extend(this,t)},safeExtend(t){return w.safeExtend(this,t)},merge(t){return w.merge(this,t)},pick(t){return w.pick(this,t)},omit(t){return w.omit(this,t)},partial(...t){return w.partial(Pu,this,t[0])},exactPartial(...t){return w.partial(bm,this,t[0],"exactPartial")},required(...t){return w.required(_m,this,t[0])}});Uu=v("ZodUnion",(t,e)=>{lu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rp(t,r,i,n),t.options=e.options});c$=v("ZodXor",(t,e)=>{Uu.init(t,e),Ib.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rp(t,r,i,n),t.options=e.options});u$=v("ZodDiscriminatedUnion",(t,e)=>{Uu.init(t,e),kb.init(t,e)});l$=v("ZodIntersection",(t,e)=>{Db.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ww(t,r,i,n)});f$=v("ZodTuple",(t,e)=>{Ao(),qf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$w(t,r,i,n)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map(e=>new Pu({type:"optional",innerType:e}))})}});rs=v("ZodRecord",(t,e)=>{Ao(),Ab.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xw(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});h$=v("ZodMap",(t,e)=>{Ao(),zb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yw(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(ln(...r)),t.nonempty=r=>t.check(ln(1,r)),t.max=(...r)=>t.check(fi(...r)),t.size=(...r)=>t.check($o(...r))});g$=v("ZodSet",(t,e)=>{Ao(),Ob.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vw(t,r,i,n),t.min=(...r)=>t.check(ln(...r)),t.nonempty=r=>t.check(ln(1,r)),t.max=(...r)=>t.check(fi(...r)),t.size=(...r)=>t.check($o(...r))});ns=v("ZodEnum",(t,e)=>{Bb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(i,n,o)=>cw(t,i,n,o),t.enum=e.entries,t.options=[...t._zod.values];let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let a of i)if(r.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ns({...e,checks:[],...w.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new ns({...e,checks:[],...w.normalizeParams(n),entries:o})}});y$=v("ZodLiteral",(t,e)=>{Tb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>uw(t,r,i,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});v$=v("ZodFile",(t,e)=>{Nb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>fw(t,r,i,n),t.min=(r,i)=>t.check(ln(r,i)),t.max=(r,i)=>t.check(fi(r,i)),t.mime=(r,i)=>t.check(Ga(Array.isArray(r)?r:[r],i))});b$=v("ZodTransform",(t,e)=>{Ao(),Ub.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gw(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new li(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(w.issue(o,r.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=r.value),a.inst??(a.inst=t),r.issues.push(w.issue(a))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});Pu=v("ZodOptional",(t,e)=>{Qf.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});bm=v("ZodExactOptional",(t,e)=>{Pb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});w$=v("ZodNullable",(t,e)=>{Lb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Iw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});$$=v("ZodDefault",(t,e)=>{Eb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Dw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});I$=v("ZodPrefault",(t,e)=>{Cb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Aw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});_m=v("ZodNonOptional",(t,e)=>{Fb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});D$=v("ZodSuccess",(t,e)=>{jb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});A$=v("ZodCatch",(t,e)=>{Mb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});O$=v("ZodNaN",(t,e)=>{Rb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lw(t,r,i,n)});Lu=v("ZodPipe",(t,e)=>{ep.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ow(t,r,i,n),t.in=e.in,t.out=e.out});Eu=v("ZodCodec",(t,e)=>{Lu.init(t,e),du.init(t,e)});B$=v("ZodPreprocess",(t,e)=>{Lu.init(t,e),Vb.init(t,e)}),T$=v("ZodReadonly",(t,e)=>{Zb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Bw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});U$=v("ZodTemplateLiteral",(t,e)=>{Wb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dw(t,r,i,n)});P$=v("ZodLazy",(t,e)=>{fu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Nw(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});E$=v("ZodPromise",(t,e)=>{Gb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});C$=v("ZodFunction",(t,e)=>{Jb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hw(t,r,i,n)});Cu=v("ZodCustom",(t,e)=>{Hb.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mw(t,r,i,n)});fB=V_,pB=Z_,M$=v("ZodInstanceOf",(t,e)=>{Cu.init(t,e)},{properties(t,e){return this.check(Ja(t,e))}});hB=(...t)=>W_({Codec:Eu,Boolean:as,String:is},...t)});function sC(t){Me({customError:t})}function cC(){return Me().customError}var aC,R$,vB=m(()=>{rr();aC={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};R$||(R$={})});var Fu={};Ie(Fu,{ZodISODate:()=>yi,ZodISODateTime:()=>gi,ZodISODuration:()=>bi,ZodISOTime:()=>vi,date:()=>lC,datetime:()=>uC,duration:()=>fC,time:()=>dC});function uC(t){return _u(gi,t)}function lC(t){return wu(yi,t)}function dC(t){return $u(vi,t)}function fC(t){return xu(bi,t)}var wm=m(()=>{rr();_i();_i()});function mC(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function bB(t,e){return t.map((r,i)=>i<e?r:r.optional())}function hC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function gC(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1]===void 0?void 0:hC(r[1]);if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function yC(t,e){return B.transform(i=>i).check(i=>{let n=i.value;if(typeof n!="object"||n===null||Array.isArray(n))return;let o=Object.getOwnPropertyNames(n);if(e.minProperties!==void 0&&o.length<e.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:e.minProperties,inclusive:!0,message:`Too small: expected object to have >=${e.minProperties} properties`,input:n,inst:t,continue:!0}),e.maxProperties!==void 0&&o.length>e.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:e.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${e.maxProperties} properties`,input:n,inst:t,continue:!0}),e.keySchema)for(let a of o){let s=e.keySchema.safeParse(a);s.success||i.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(t)}function V$(t,e){if(t===null)return"z";let r=typeof t;if(r!=="object"){if(r==="number"&&Number.isNaN(t))return null;let i=String(t);return`${r[0]}${i.length}:${i}`}if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let a of t){let s=V$(a,e);if(s===null)return null;o.push(s)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(t).sort(),n=[];for(let o of i){let a=V$(t[o],e);if(a===null)return null;n.push(`${o.length}:${o}=${a}`)}return`o${n.length}:{${n.join(",")}}`}finally{e.delete(t)}}function ju(t){return typeof t!="object"||t===null?!1:Array.isArray(t)?t.some(ju):typeof t.$ref=="string"?!0:Object.entries(t).some(([e,r])=>vC.has(e)?ju(r):!bC.has(e)||typeof r!="object"||r===null?!1:Object.values(r).some(ju))}function _B(t){return t===1?"element":"elements"}function _C(t,e){return B.transform(i=>i).check(i=>{let n=i.value;if(Array.isArray(n)){if(e.uniqueItems===!0){let o=new Map;for(let a=0;a<n.length;a++){let s=V$(n[a],new Set);if(s===null)continue;let c=o.get(s);if(c===void 0){o.set(s,a);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${c}`,input:n,path:[a],continue:!0})}}if(e.containsSchema){let o=e.minContains??1,a=e.maxContains!==void 0?e.maxContains+1:Number.POSITIVE_INFINITY,s=0;for(let c of n)if(e.containsSchema.safeParse(c).success&&++s>=a)break;s<o&&i.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${_B(o)}; found ${s}`,input:n,continue:!0}),e.maxContains!==void 0&&s>e.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${e.maxContains} matching ${_B(e.maxContains)}`,input:n,continue:!0})}}}).pipe(t)}function wB(t,e){if(t!==!1)return t===void 0||t===!0?B.any():At(t,e)}function $B(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return B.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return B.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=gC(n,e),a=At(o,e);return e.refs.set(n,a),e.processing.delete(n),a}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return B.null();if(n.length===0)return B.never();if(n.length===1)return B.literal(n[0]);if(n.every(a=>typeof a=="string"))return B.enum(n);let o=n.map(a=>B.literal(a));return o.length<2?o[0]:B.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return B.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let a={...t,type:o};return $B(a,e)});return n.length===0?B.never():n.length===1?n[0]:B.union(n)}if(!r)return B.any();let i;switch(r){case"string":{let n=B.string();if(t.format){let o=t.format;o==="email"?n=n.check(B.email()):o==="uri"||o==="uri-reference"?n=n.check(B.url()):o==="uuid"||o==="guid"?n=n.check(B.uuid()):o==="date-time"?n=n.check(B.iso.datetime({offset:!0})):o==="date"?n=n.check(B.iso.date()):o==="time"?n=n.check(B.regex(wC)):o==="duration"?n=n.check(B.iso.duration()):o==="hostname"?n=n.check(B.hostname()):o==="ipv4"?n=n.check(B.ipv4()):o==="ipv6"?n=n.check(B.ipv6()):o==="mac"?n=n.check(B.mac()):o==="cidr"?n=n.check(B.cidrv4()):o==="cidr-v6"?n=n.check(B.cidrv6()):o==="base64"?n=n.check(B.base64()):o==="base64url"?n=n.check(B.base64url()):o==="e164"?n=n.check(B.e164()):o==="credit_card"?n=n.check(B.creditCard()):o==="iban"?n=n.check(B.iban()):o==="jwt"?n=n.check(B.jwt()):o==="emoji"?n=n.check(B.emoji()):o==="nanoid"?n=n.check(B.nanoid()):o==="cuid"?n=n.check(B.cuid()):o==="cuid2"?n=n.check(B.cuid2()):o==="ulid"?n=n.check(B.ulid()):o==="xid"?n=n.check(B.xid()):o==="ksuid"&&(n=n.check(B.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?B.number().int():B.number();typeof t.minimum=="number"&&t.exclusiveMinimum!==!0&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&t.exclusiveMaximum!==!0&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=B.boolean();break}case"null":{i=B.null();break}case"object":{let n={},o=t.properties||{},a=new Set(t.required||[]),s=typeof t.additionalProperties=="object"?At(t.additionalProperties,e):void 0;for(let[d,f]of Object.entries(o)){let p=At(f,e);st(n,d,a.has(d)?p:p.optional())}if(t.patternProperties){let d=t.patternProperties,f=Object.keys(d),p=[];for(let y of f){let _=At(d[y],e),D=B.string().regex(new RegExp(y));p.push(B.looseRecord(D,_))}let h=[];if(Object.keys(n).length>0&&h.push(B.object(n).passthrough()),h.push(...p),h.length===0)i=B.object({}).passthrough();else if(h.length===1)i=h[0];else{let y=B.intersection(h[0],h[1]);for(let _=2;_<h.length;_++)y=B.intersection(y,h[_]);i=y}if(t.additionalProperties===!1){let y=Object.keys(n),_=f.map(I=>new RegExp(I)),D=i;i=i.check(I=>{if(!pr(I.value))return;let A=[];for(let Z of Object.keys(I.value))y.includes(Z)||_.some(L=>L.test(Z))||A.push(Z);A.length&&I.issues.push({code:"unrecognized_keys",keys:A,input:I.value,inst:D})})}}else{let d=B.object(n);t.additionalProperties===!1?i=d.strict():s?i=d.catchall(s):i=d.passthrough()}let c=t.propertyNames!==void 0&&t.propertyNames!==!0,u=typeof t.minProperties=="number"?t.minProperties:void 0,l=typeof t.maxProperties=="number"?t.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let d;if(c){let f=typeof t.propertyNames=="object"&&t.propertyNames.type===void 0?{type:"string",...t.propertyNames}:t.propertyNames;d=At(f,e)}i=yC(i,{keySchema:d,minProperties:u,maxProperties:l})}break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let a=typeof t.minItems=="number"?t.minItems:0,s=n.map(d=>At(d,e)),c=bB(s,a),u=Array.isArray(o)?void 0:wB(o,e),l=B.tuple(c);i=u?l.rest(u):l,typeof t.minItems=="number"&&(i=i.check(B.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(B.maxLength(t.maxItems)))}else if(Array.isArray(o)){let a=typeof t.minItems=="number"?t.minItems:0,s=o.map(d=>At(d,e)),c=bB(s,a),u=wB(t.additionalItems,e),l=B.tuple(c);i=u?l.rest(u):l,typeof t.minItems=="number"&&(i=i.check(B.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(B.maxLength(t.maxItems)))}else if(o!==void 0){let a=At(o,e),s=B.array(a);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),i=s}else i=B.array(B.any());(t.uniqueItems===!0||t.contains!==void 0)&&(i=_C(i,{uniqueItems:t.uniqueItems===!0,containsSchema:t.contains!==void 0?At(t.contains,e):void 0,minContains:typeof t.minContains=="number"?t.minContains:void 0,maxContains:typeof t.maxContains=="number"?t.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return i}function At(t,e){if(typeof t=="boolean")return t?B.any():B.never();let r=$B(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(u=>At(u,e)),c=B.union(s);r=i?B.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(u=>At(u,e)),c=B.xor(s);r=i?B.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:B.any();else{let s=i?r:At(t.allOf[0],e),c=i?0:1;for(let u=c;u<t.allOf.length;u++)s=B.intersection(s,At(t.allOf[u],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=B.nullable(r)),t.readOnly===!0&&(r=B.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in t&&(n[s]=t[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in t&&(n[s]=t[s]);if(t.type==="object"&&t.$ref===void 0){t.propertyNames!==void 0&&!ju(t.propertyNames)&&(n.propertyNames=t.propertyNames);for(let s of["minProperties","maxProperties"])t[s]!==void 0&&(n[s]=t[s])}if(t.type==="array"&&t.$ref===void 0){t.contains!==void 0&&!ju(t.contains)&&(n.contains=t.contains);for(let s of["uniqueItems","minContains","maxContains"])t[s]!==void 0&&(n[s]=t[s])}for(let s of Object.keys(t))pC.has(s)||st(n,s,t[s]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function xB(t,e){if(typeof t=="boolean")return t?B.any():B.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=mC(r,e?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ct};return At(r,o)}var B,pC,vC,bC,wC,IB=m(()=>{vu();O();Gp();wm();_i();B={...us,...Jp,iso:Fu},pC=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);vC=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),bC=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);wC=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function Mu(t,e){let r=typeof e=="function"?e:(a,s)=>{let c=e[a._zod.def.type];return c?c(a,s):a},i=new Map;function n(a){let s=i.get(a);if(s===SB)return new fu({type:"lazy",getter:()=>i.get(a)});if(s!==void 0)return s;i.set(a,SB);let c=o(a),u=r(c,c!==a);return i.set(a,u),u}function o(a){let s=a._zod.def,c=s.type;switch(c){case"object":{let u=s.shape,l=Object.keys(u),d=!1,f={};for(let h of l){let y=n(u[h]);y!==u[h]&&(d=!0),f[h]=y}let p=s.catchall;return s.catchall&&(p=n(s.catchall),p!==s.catchall&&(d=!0)),d?_e(a,{...s,shape:f,catchall:p}):a}case"array":{let u=n(s.element);return u===s.element?a:_e(a,{...s,element:u})}case"tuple":{let u=s.items,l=!1,d=[];for(let p of u){let h=n(p);h!==p&&(l=!0),d.push(h)}let f=s.rest;return s.rest&&(f=n(s.rest),f!==s.rest&&(l=!0)),l?_e(a,{...s,items:d,rest:f}):a}case"record":case"map":{let u=n(s.keyType),l=n(s.valueType);return u===s.keyType&&l===s.valueType?a:_e(a,{...s,keyType:u,valueType:l})}case"set":{let u=n(s.valueType);return u===s.valueType?a:_e(a,{...s,valueType:u})}case"union":{let u=s.options,l=!1,d=[];for(let f of u){let p=n(f);p!==f&&(l=!0),d.push(p)}return l?_e(a,{...s,options:d}):a}case"intersection":{let u=n(s.left),l=n(s.right);return u===s.left&&l===s.right?a:_e(a,{...s,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=n(s.innerType);return u===s.innerType?a:_e(a,{...s,innerType:u})}case"pipe":{let u=n(s.in),l=n(s.out);return u===s.in&&l===s.out?a:_e(a,{...s,in:u,out:l})}case"function":{let u=n(s.input),l=n(s.output);return u===s.input&&l===s.output?a:_e(a,{...s,input:u,output:l})}case"lazy":{let u=s.getter,{_cachedInner:l,...d}=s;return _e(a,{...d,getter:()=>n(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return n(t)}var SB,Z$=m(()=>{La();O();SB=Symbol("z.visit/resolving")});function kB(t){return Mu(t,{object:e=>e.partial(),union:e=>{let r=e._zod.def;return r.discriminator===void 0?e:cs(r.options)}})}var DB=m(()=>{Z$();_i()});function $C(t,e){if(!e?.length)return t;let r=t._zod.def;return _e(t,Tr(r,{checks:[...r.checks??[],...e]}),{parent:!0})}function AB(t){return $C(t.out,t.checks)}function xC(t){return t.in._zod.traits.has("$ZodTransform")?AB(t):t.in}function zB(t){return Mu(t,{pipe:e=>xC(e._zod.def),default:(e,r)=>r?Do(e._zod.def.innerType):e,catch:(e,r)=>r?e._zod.def.innerType:e})}function OB(t){return Mu(t,{pipe:e=>AB(e._zod.def),prefault:(e,r)=>r?e._zod.def.innerType:e})}var BB=m(()=>{O();Z$();_i()});var W$={};Ie(W$,{bigint:()=>DC,boolean:()=>kC,date:()=>AC,number:()=>SC,string:()=>IC});function IC(t){return l_(is,t)}function SC(t){return g_(os,t)}function kC(t){return x_(as,t)}function DC(t){return S_(ss,t)}function AC(t){return L_(Bu,t)}var TB=m(()=>{rr();_i()});var ve={};Ie(ve,{$brand:()=>Iy,$input:()=>n_,$output:()=>r_,INVALID:()=>kt,NEVER:()=>xy,TimePrecision:()=>m_,ZodAny:()=>n$,ZodArray:()=>s$,ZodBase64:()=>dm,ZodBase64URL:()=>fm,ZodBigInt:()=>ss,ZodBigIntFormat:()=>hm,ZodBoolean:()=>as,ZodCIDRv4:()=>um,ZodCIDRv6:()=>lm,ZodCUID:()=>rm,ZodCUID2:()=>nm,ZodCatch:()=>A$,ZodCodec:()=>Eu,ZodCompileAsyncError:()=>Nr,ZodCompileUnsupportedError:()=>fe,ZodCreditCard:()=>Kw,ZodCustom:()=>Cu,ZodCustomStringFormat:()=>zo,ZodDate:()=>Bu,ZodDefault:()=>$$,ZodDiscriminatedUnion:()=>u$,ZodE164:()=>pm,ZodEmail:()=>qp,ZodEmoji:()=>em,ZodEnum:()=>ns,ZodError:()=>nC,ZodExactOptional:()=>bm,ZodFile:()=>v$,ZodFirstPartyTypeKind:()=>R$,ZodFunction:()=>C$,ZodGUID:()=>Qp,ZodIBAN:()=>Yw,ZodIPv4:()=>sm,ZodIPv6:()=>cm,ZodISODate:()=>yi,ZodISODateTime:()=>gi,ZodISODuration:()=>bi,ZodISOTime:()=>vi,ZodInstanceOf:()=>M$,ZodIntersection:()=>l$,ZodIssueCode:()=>aC,ZodJWT:()=>mm,ZodKSUID:()=>am,ZodLazy:()=>P$,ZodLiteral:()=>y$,ZodMAC:()=>Hw,ZodMap:()=>h$,ZodNaN:()=>O$,ZodNanoID:()=>tm,ZodNever:()=>o$,ZodNonOptional:()=>_m,ZodNull:()=>t$,ZodNullable:()=>w$,ZodNumber:()=>os,ZodNumberFormat:()=>Oo,ZodObject:()=>Nu,ZodOptional:()=>Pu,ZodPipe:()=>Lu,ZodPrefault:()=>I$,ZodPreprocess:()=>B$,ZodPromise:()=>E$,ZodReadonly:()=>T$,ZodRealError:()=>Mt,ZodRecord:()=>rs,ZodSet:()=>g$,ZodString:()=>is,ZodStringFormat:()=>xe,ZodSuccess:()=>D$,ZodSymbol:()=>Qw,ZodTemplateLiteral:()=>U$,ZodTransform:()=>b$,ZodTuple:()=>f$,ZodType:()=>oe,ZodULID:()=>im,ZodURL:()=>Ou,ZodUUID:()=>dn,ZodUndefined:()=>e$,ZodUnion:()=>Uu,ZodUnknown:()=>i$,ZodVoid:()=>a$,ZodXID:()=>om,ZodXor:()=>c$,_ZodString:()=>Xp,_default:()=>x$,_function:()=>uB,any:()=>jO,array:()=>Tu,base64:()=>_O,base64url:()=>wO,bigint:()=>PO,boolean:()=>qw,catch:()=>z$,check:()=>lB,cidrv4:()=>vO,cidrv6:()=>bO,clone:()=>_e,codec:()=>oB,coerce:()=>W$,compile:()=>s_,config:()=>Me,core:()=>jn,creditCard:()=>xO,cuid:()=>lO,cuid2:()=>dO,currencyCode:()=>zO,custom:()=>dB,date:()=>RO,decode:()=>jw,decodeAsync:()=>Rw,deepPartial:()=>kB,describe:()=>fB,discriminatedUnion:()=>HO,e164:()=>$O,email:()=>eO,emoji:()=>cO,encode:()=>Fw,encodeAsync:()=>Mw,endsWith:()=>Wa,enum:()=>ym,exactOptional:()=>_$,file:()=>tB,flattenError:()=>Yc,float32:()=>BO,float64:()=>TO,formatError:()=>Xc,fromJSONSchema:()=>xB,function:()=>uB,getDiscriminatedOption:()=>Sb,getErrorMap:()=>cC,globalRegistry:()=>ct,gt:()=>un,gte:()=>tr,guid:()=>tO,hash:()=>OO,hex:()=>AO,hostname:()=>DO,httpUrl:()=>sO,iban:()=>IO,includes:()=>Va,input:()=>zB,instanceof:()=>mB,int:()=>Kp,int32:()=>NO,int64:()=>LO,intersection:()=>d$,invertCodec:()=>aB,ipv4:()=>hO,ipv6:()=>yO,iso:()=>Fu,json:()=>gB,jwt:()=>SO,keyof:()=>VO,ksuid:()=>mO,lazy:()=>L$,length:()=>Io,literal:()=>eB,locales:()=>yu,looseObject:()=>JO,looseRecord:()=>YO,lowercase:()=>Ma,lt:()=>cn,lte:()=>er,mac:()=>gO,map:()=>XO,maxLength:()=>xo,maxSize:()=>fi,memoizer:()=>hu,meta:()=>pB,mime:()=>Ga,minLength:()=>Fn,minSize:()=>ln,multipleOf:()=>di,nan:()=>iB,nanoid:()=>uO,nativeEnum:()=>QO,negative:()=>Ep,never:()=>gm,nonnegative:()=>Fp,nonoptional:()=>k$,nonpositive:()=>Cp,normalize:()=>Ha,null:()=>r$,nullable:()=>zu,nullish:()=>rB,number:()=>Xw,object:()=>ZO,optional:()=>Do,output:()=>OB,overwrite:()=>Ur,parse:()=>Pw,parseAsync:()=>Lw,partialRecord:()=>KO,pipe:()=>Yp,positive:()=>Lp,prefault:()=>S$,preprocess:()=>yB,prettifyError:()=>zy,promise:()=>cB,properties:()=>Ja,property:()=>jp,readonly:()=>N$,record:()=>m$,refine:()=>F$,regex:()=>ja,regexes:()=>hr,registry:()=>dp,safeDecode:()=>Zw,safeDecodeAsync:()=>Jw,safeEncode:()=>Vw,safeEncodeAsync:()=>Ww,safeParse:()=>Ew,safeParseAsync:()=>Cw,set:()=>qO,setErrorMap:()=>sC,size:()=>$o,slugify:()=>qa,startsWith:()=>Za,strictObject:()=>WO,string:()=>Au,stringFormat:()=>kO,stringbool:()=>hB,success:()=>nB,superRefine:()=>j$,symbol:()=>CO,templateLiteral:()=>sB,toJSONSchema:()=>Zp,toLowerCase:()=>Ya,toUpperCase:()=>Xa,toZod:()=>Mc,transform:()=>vm,treeifyError:()=>Ay,trim:()=>Ka,tuple:()=>p$,uint32:()=>UO,uint64:()=>EO,ulid:()=>fO,undefined:()=>FO,union:()=>cs,unknown:()=>ko,uppercase:()=>Ra,url:()=>aO,util:()=>w,uuid:()=>rO,uuidv4:()=>nO,uuidv6:()=>iO,uuidv7:()=>oO,validate:()=>qc,validateAsync:()=>Qc,void:()=>MO,withParser:()=>fp,xid:()=>pO,xor:()=>GO});var J$=m(()=>{rr();_i();Gp();Uw();Gw();vB();rr();Du();IB();DB();BB();t_();wm();wm();TB()});var NB=m(()=>{J$();J$()});var zt,UB,zC,PB,OC,LB,EB=m(()=>{"use strict";NB();zt=ve.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),UB=ve.object({rgbMin:ve.number().finite().optional(),rgbMax:ve.number().finite().optional(),lnScaleMin:ve.number().finite().optional(),lnScaleMax:ve.number().finite().optional(),sh1Max:ve.number().finite().optional(),sh2Max:ve.number().finite().optional(),sh3Max:ve.number().finite().optional(),lodOpacity:ve.boolean().optional()}).passthrough(),zC=ve.object({offset:zt,bytes:zt,base:zt.optional(),count:zt.optional(),filename:ve.string().optional()}).passthrough(),PB=ve.object({version:ve.literal(1),type:ve.literal("gsplat"),count:zt,maxSh:zt.optional(),lodTree:ve.boolean().optional(),chunkSize:zt.optional(),allChunkBytes:zt.optional(),chunks:ve.array(zC),splatEncoding:UB.optional(),shCodeCount:zt.optional(),comment:ve.string().optional()}).passthrough(),OC=ve.object({offset:zt,bytes:zt,property:ve.string(),encoding:ve.string(),compression:ve.string().optional(),min:ve.number().finite().optional(),max:ve.number().finite().optional()}).passthrough(),LB=ve.object({version:ve.literal(1),base:zt,count:zt,payloadBytes:zt,maxSh:zt.optional(),lodTree:ve.boolean().optional(),splatEncoding:UB.optional(),properties:ve.array(OC)}).passthrough()});function Ru(t){let e=ls(t);if(!e)throw new Error("RADLoader: file must contain a complete RAD metadata header.");return e}function ls(t){let e=FB(t);if(e.byteLength<wi)return null;let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0);if(i!==BC)throw new Error(`RADLoader: RAD0 magic header not found, received 0x${i.toString(16)}.`);let n=r.getUint32(4,!0),o=wi+n;if(e.byteLength<o)return null;let a=PB.parse(CB(e.subarray(wi,o),"RADLoader: failed to parse RAD metadata JSON."));return PC(a,n)}function ds(t){let e=FB(t);if(e.byteLength<wi)throw new Error("RADLoader: RADC chunk must contain an 8-byte metadata header.");let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0);if(i!==TC)throw new Error(`RADLoader: RADC magic header not found, received 0x${i.toString(16)}.`);let n=r.getUint32(4,!0),o=wi+n,a=wi+$m(n),s=a+NC;if(e.byteLength<s)throw new Error("RADLoader: RADC chunk must contain a complete metadata header.");let c=LB.parse(CB(e.subarray(wi,o),"RADLoader: failed to parse RADC metadata JSON.")),u=EC(r,a,"RADC payload byte length");return LC(c,n,s,u)}function $m(t){return t+7&-8}function PC(t,e){return{...t,headerJsonByteLength:e,chunksByteOffset:wi+$m(e)}}function LC(t,e,r,i){if(t.payloadBytes!==i)throw new Error("RADLoader: RADC metadata payload byte length does not match binary header.");return{...t,payloadBytes:i,headerJsonByteLength:e,payloadByteOffset:r,chunkByteLength:r+i}}function CB(t,e){try{return JSON.parse(UC.decode(t))}catch{throw new Error(e)}}function EC(t,e,r){let i=t.getBigUint64(e,!0);if(i>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`RADLoader: ${r} exceeds Number.MAX_SAFE_INTEGER.`);return Number(i)}function FB(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}var BC,TC,wi,NC,UC,Vu=m(()=>{"use strict";EB();BC=809779538,TC=1128546642,wi=8,NC=8,UC=new TextDecoder});var xm,jB=m(()=>{"use strict";Jm();ki();Hm();xm=class extends nr{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;constructor(e={}){super(e),this.options=e}decompressSync(e){let r=new Uint8Array(e);return(this.options.raw?Qx(r):nI(r)).slice().buffer}async*decompressBatches(e){let r=this.options.raw?new Zn:new rI;yield*yl(r,e)}}});var Zu,MB=m(()=>{"use strict";jB();Ai();Zu=class extends xm{constructor(e={}){super(e)}async decompress(e){if(this.options.useNative!==!1){let r=this.options.raw?"deflate-raw":"deflate",i=await Er(e,r);if(i)return i}return this.decompressSync(e)}async*decompressBatches(e){if(this.options.useNative!==!1){let r=this.options.raw?"deflate-raw":"deflate",i=yn(e,r);if(i){yield*i;return}}yield*super.decompressBatches(e)}}});function Im(t,e){return sn(Ju(t,e))}function Ju(t,e){let r=hF(t),i=lF(ds(r),e);if(r.byteLength<i.chunkByteLength)throw new Error("RADLoader: RADC chunk payload is incomplete.");let n=i.count,o=fs(r,i,uF(i,"center"),3),a=jC(r,i,n),s=RC(r,i,n),c=VC(r,i,n),u=ZC(r,i,n),{colors:l,sphericalHarmonicDcs:d}=oF(s),f=e?.radChunk?.includeLoDTree??!0,p=f?JC(r,i,"child_count"):null,h=f?GC(r,i,"child_start"):null,_=e?.radChunk?.includeSphericalHarmonics??!1?WC(r,i):null;return{format:"rad",splatCount:n,positions:o,scales:c,rotations:u,colors:l,sphericalHarmonicDcs:d,opacities:a,sphericalHarmonics:_?.values,sphericalHarmonicsComponentCount:_?.componentCount,loaderData:{format:"rad",base:i.base,count:i.count,maxSh:i.maxSh??0,lodTree:i.lodTree??!1,splatEncoding:i.splatEncoding,childCounts:p??void 0,childStarts:h??void 0}}}function jC(t,e,r){let i=fn(e,"alpha");if(!i)return new Float32Array(r).fill(1);let n=fs(t,e,i,1);for(let o=0;o<n.length;o++)n[o]=MC(n[o],e,i);return n}function MC(t,e,r){let i=Math.max(t,0);return!e.splatEncoding?.lodOpacity||r.encoding!=="r8"&&r.encoding!=="r8_delta"?i:i*2}function RC(t,e,r){let i=fn(e,"rgb");return i?fs(t,e,i,3):new Float32Array(r*3).fill(1)}function VC(t,e,r){let i=fn(e,"scales");return i?fs(t,e,i,3):new Float32Array(r*3).fill(1)}function ZC(t,e,r){let i=fn(e,"orientation");if(!i)return aF(r);let n=Sm(t,e,i);switch(i.encoding){case"oct88r8":return iF(n,r);case"f32":case"f16":{let o=fs(t,e,i,3),a=new Float32Array(r*4);for(let s=0;s<r;s++){let c=s*3,u=s*4,l=o[c+0],d=o[c+1],f=o[c+2],p=Math.sqrt(Math.max(0,1-l*l-d*d-f*f)),h=an(p,l,d,f);a.set(h,u)}return a}default:throw new Error(`RADLoader: unsupported orientation encoding ${i.encoding}.`)}}function WC(t,e){let r=[{property:fn(e,"sh1"),dimensions:9},{property:fn(e,"sh2"),dimensions:15},{property:fn(e,"sh3"),dimensions:21}].filter(a=>a.property!==void 0);if(r.length===0)return null;let i=r.map(a=>({values:fs(t,e,a.property,a.dimensions),dimensions:a.dimensions})),n=i.reduce((a,s)=>a+s.dimensions,0),o=new Float32Array(e.count*n);for(let a=0;a<e.count;a++){let s=a*n;for(let c of i){let u=a*c.dimensions;o.set(c.values.subarray(u,u+c.dimensions),s),s+=c.dimensions}}return{values:o,componentCount:n}}function fs(t,e,r,i){let n=Sm(t,e,r);switch(r.encoding){case"f32":return KC(n,i,e.count);case"f16":return RB(n,i,e.count);case"f32_lebytes":return YC(n,i,e.count);case"f16_lebytes":return XC(n,i,e.count);case"r8":return qC(n,i,e.count,G$(e,r),Wu(e,r));case"r8_delta":return QC(n,i,e.count,G$(e,r),Wu(e,r));case"s8":return eF(n,i,e.count,Wu(e,r));case"s8_delta":return tF(n,i,e.count,Wu(e,r));case"ln_0r8":return rF(n,i,e.count,G$(e,r),Wu(e,r));case"ln_f16":return nF(n,i,e.count);default:throw new Error(`RADLoader: unsupported ${r.property} encoding ${r.encoding}.`)}}function JC(t,e,r){let i=fn(e,r);if(!i)return null;if(i.encoding!=="u16")throw new Error(`RADLoader: unsupported ${r} encoding ${i.encoding}.`);let n=Sm(t,e,i),o=new Uint16Array(e.count);for(let a=0;a<e.count;a++)o[a]=n[a*2]|n[a*2+1]<<8;return o}function GC(t,e,r){let i=fn(e,r);if(!i)return null;if(i.encoding!=="u32")throw new Error(`RADLoader: unsupported ${r} encoding ${i.encoding}.`);let n=Sm(t,e,i),o=new DataView(n.buffer,n.byteOffset,n.byteLength),a=new Uint32Array(e.count);for(let s=0;s<e.count;s++)a[s]=o.getUint32(s*4,!0);return a}function Sm(t,e,r){let i=$m(r.bytes),n=e.payloadByteOffset+r.offset;if(n+i>t.byteLength||r.offset+i>e.payloadBytes)throw new Error(`RADLoader: property ${r.property} exceeds RADC payload byte length.`);let a=t.subarray(n,n+r.bytes);if(!r.compression)return a;if(r.compression!=="gz")throw new Error(`RADLoader: unsupported property compression ${r.compression}.`);return HC(a,r.property)}function HC(t,e){let r=mF(t);try{return new Uint8Array(CC.decompressSync(r))}catch{try{return new Uint8Array(FC.decompressSync(r))}catch{throw new Error(`RADLoader: failed to decompress RADC property ${e}.`)}}}function KC(t,e,r){let i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=new Float32Array(r*e);for(let o=0;o<r;o++)for(let a=0;a<e;a++)n[o*e+a]=i.getFloat32((a*r+o)*4,!0);return n}function RB(t,e,r){let i=new Float32Array(r*e);for(let n=0;n<r;n++)for(let o=0;o<e;o++){let a=(o*r+n)*2;i[n*e+o]=Fc(t[a]|t[a+1]<<8)}return i}function YC(t,e,r){let i=new Float32Array(r*e),n=r*e,o=new Uint8Array(4),a=new DataView(o.buffer);for(let s=0;s<r;s++)for(let c=0;c<e;c++){let u=c*r+s;for(let l=0;l<4;l++)o[l]=t[u+n*l];i[s*e+c]=a.getFloat32(0,!0)}return i}function XC(t,e,r){let i=new Float32Array(r*e),n=r*e;for(let o=0;o<r;o++)for(let a=0;a<e;a++){let s=a*r+o;i[o*e+a]=Fc(t[s]|t[s+n]<<8)}return i}function qC(t,e,r,i,n){let o=new Float32Array(r*e),a=n-i;for(let s=0;s<r;s++)for(let c=0;c<e;c++)o[s*e+c]=t[c*r+s]/255*a+i;return o}function QC(t,e,r,i,n){let o=new Float32Array(r*e),a=n-i,s=new Uint8Array(e);for(let c=0;c<r;c++)for(let u=0;u<e;u++){let l=u*r+c,d=s[u]+t[l]&255;s[u]=d,o[c*e+u]=d/255*a+i}return o}function eF(t,e,r,i){let n=new Float32Array(r*e);for(let o=0;o<r;o++)for(let a=0;a<e;a++){let s=t[a*r+o];n[o*e+a]=(s<<24>>24)/127*i}return n}function tF(t,e,r,i){let n=new Float32Array(r*e),o=new Uint8Array(e);for(let a=0;a<r;a++)for(let s=0;s<e;s++){let c=s*r+a,u=o[s]+t[c]&255;o[s]=u,n[a*e+s]=(u<<24>>24)/127*i}return n}function rF(t,e,r,i,n){let o=new Float32Array(r*e);for(let a=0;a<r;a++)for(let s=0;s<e;s++)o[a*e+s]=sF(t[s*r+a],i,n);return o}function nF(t,e,r){let i=RB(t,e,r);for(let n=0;n<i.length;n++)i[n]=Math.exp(i[n]);return i}function iF(t,e){let r=new Float32Array(e*4);for(let i=0;i<e;i++){let n=i*3,[o,a,s,c]=cF(t[n],t[n+1],t[n+2]);r.set(an(c,o,a,s),i*4)}return r}function oF(t){let e=new Uint8Array(t.length),r=new Float32Array(t.length);for(let i=0;i<t.length;i++){let n=t[i];e[i]=pF(n),r[i]=(n-.5)/Xg}return{colors:e,sphericalHarmonicDcs:r}}function aF(t){let e=new Float32Array(t*4);for(let r=0;r<t;r++)e[r*4]=1;return e}function sF(t,e,r){if(t===0)return 0;let i=(r-e)/254;return Math.exp(e+(t-1)*i)}function cF(t,e,r){let i=t/255*2-1,n=e/255*2-1,o=1-Math.abs(i)-Math.abs(n),a=Math.max(-o,0);i=i>=0?i-a:i+a,n=n>=0?n-a:n+a;let s=Math.hypot(i,n,o),c=s>Number.EPSILON?i/s:1,u=s>Number.EPSILON?n/s:0,l=s>Number.EPSILON?o/s:0,d=r/255*.5*Math.PI,f=Math.sin(d);return[c*f,u*f,l*f,Math.cos(d)]}function uF(t,e){let r=fn(t,e);if(!r)throw new Error(`RADLoader: RADC chunk is missing ${e} property.`);return r}function fn(t,e){return t.properties.find(r=>r.property===e)}function lF(t,e){let r=e?.radChunk?.splatEncoding;return r?{...t,splatEncoding:{...r,...t.splatEncoding}}:t}function G$(t,e){if(e.min===void 0){let r=dF(t.splatEncoding,e.property);if(r!==void 0)return r;throw new Error(`RADLoader: RADC property ${e.property} is missing min.`)}return e.min}function Wu(t,e){if(e.max===void 0){let r=fF(t.splatEncoding,e.property);if(r!==void 0)return r;throw new Error(`RADLoader: RADC property ${e.property} is missing max.`)}return e.max}function dF(t,e){switch(e){case"rgb":return t?.rgbMin;case"scales":return t?.lnScaleMin;default:return}}function fF(t,e){switch(e){case"rgb":return t?.rgbMax;case"scales":return t?.lnScaleMax;case"sh1":return t?.sh1Max;case"sh2":return t?.sh2Max;case"sh3":return t?.sh3Max;default:return}}function pF(t){return Math.round(Math.min(Math.max(t,0),1)*255)}function mF(t){let e=new Uint8Array(t.byteLength);return e.set(t),e.buffer}function hF(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}var CC,FC,H$=m(()=>{"use strict";MB();Vu();wa();ba();CC=new Zu({useNative:!1}),FC=new Zu({raw:!0,useNative:!1})});var VB={};Ie(VB,{RADLoaderWithParser:()=>yF,parseRADChunk:()=>Im,parseRADChunkHeader:()=>ds,parseRADChunkToGaussianSplats:()=>Ju,parseRADHeader:()=>Ru,tryParseRADHeader:()=>ls});var yX,gF,yF,ZB=m(()=>{"use strict";Vu();K$();Vu();H$();({preload:yX,...gF}=km),yF={...gF,parse:async t=>Ru(t),parseSync:t=>Ru(t)}});async function bF(){let{RADLoaderWithParser:t}=await Promise.resolve().then(()=>(ZB(),VB));return t}var vF,km,K$=m(()=>{"use strict";$i();vF="5.0.0-alpha.9";km={dataType:null,batchType:null,...Po,version:vF,options:{},preload:bF}});var Hu={};Ie(Hu,{KSPLATFormat:()=>tl,KSPLATLoader:()=>lf,RADFormat:()=>Po,RADLoader:()=>km,RADSource:()=>Gu,RADSourceLoader:()=>Y$,SPLATFormat:()=>el,SPLATLoader:()=>sf,SPZFormat:()=>rl,SPZLoader:()=>df,parseSPZ:()=>af,parseSPZToGaussianSplats:()=>Qg,resolveRADChunkUrl:()=>Dm});Qu(Hu,qB(q$(),1));$i();ry();iy();uy();ly();K$();Fo();$i();Vu();H$();wa();var _F=[64*1024,256*1024,1024*1024],wF=4,$F="5.0.0-alpha.9",Y$={dataType:null,batchType:null,...Po,name:"RADSourceLoader",version:$F,type:"rad",fromUrl:!0,fromBlob:!0,options:{rad:{headers:void 0,withCredentials:!1,headerByteLengths:void 0}},defaultOptions:{rad:{headers:void 0,withCredentials:!1,headerByteLengths:void 0}},testURL:t=>/\.rad(?:$|[?#])/i.test(t),createDataSource:(t,e,r)=>new Gu(t,e,r)},Gu=class extends bs{metadata;_metadataPromise=null;_chunkMetadataPromises=new Map;constructor(e,r,i){super(e,r,Y$.defaultOptions,i),this.metadata=this.getMetadata()}async initialize(){await this.getMetadata()}async getMetadata(){return this._metadataPromise||(this._metadataPromise=this._loadMetadata()),await this._metadataPromise}async getChunkCount(){return(await this.getMetadata()).chunks.length}async getChunkUrl(e){let r=await this.getMetadata(),i=this._getChunkRange(r,e);return i.filename?Dm(this.url,i.filename):typeof this.data=="string"?this.url:null}async getChunk(e,r={}){let i=await this.getMetadata(),n=this._getChunkRange(i,e);if(n.filename){if(typeof this.data!="string")throw new Error("RADSource: sidecar RADC chunks require a URL-backed RAD source.");return await this._fetchArrayBuffer(Dm(this.url,n.filename),void 0,{signal:r.signal})}if(n.bytes===0)return new ArrayBuffer(0);let o=i.chunksByteOffset+n.offset;return typeof this.data!="string"?await this.data.slice(o,o+n.bytes).arrayBuffer():await this._fetchArrayBuffer(this.url,{offset:o,bytes:n.bytes},{signal:r.signal})}async getChunkMetadata(e,r={}){let i=this._chunkMetadataPromises.get(e);return i||(i=this.getChunk(e,r).then(n=>ds(n)),this._chunkMetadataPromises.set(e,i)),await i}async getChunkSplats(e,r={}){let i=await this.getMetadata();return Ju(await this.getChunk(e,r),this._getChunkDecodeOptions(i,r))}async getChunkTable(e,r={}){let i=await this.getMetadata();return Im(await this.getChunk(e,r),this._getChunkDecodeOptions(i,r))}async*getChunkTables(e={}){let r=await this.getMetadata(),i=e.startChunkIndex??0,n=e.maxChunks??Number.POSITIVE_INFINITY,o=e.maxSplats??Number.POSITIVE_INFINITY,a=0,s=0;if(e.pruneLoadedLoDParents){let c=xF(r,i,n,o),u=await this._getChunkSplatsConcurrently(c,e),l=0;for(let d of u){a++,s+=d.splatCount;let f=SF(d);l=Math.max(l,f+d.splatCount)}for(let d of u)yield sn(kF(d,l));return}for(let c=i;c<r.chunks.length&&a<n&&s<o;c++){let u=await this.getChunkTable(c,e);a++,s+=u.data.numRows,yield u}}async _getChunkSplatsConcurrently(e,r){let i=new Array(e.length),n=IF(r.maxConcurrentChunkRequests),o=0;async function a(c){for(;o<e.length;){let u=o++,l=e[u];i[u]=await c.getChunkSplats(l,r)}}let s=Math.min(n,e.length);return await Promise.all(Array.from({length:s},()=>a(this))),i}_getChunkDecodeOptions(e,r){return{...r,radChunk:{splatEncoding:e.splatEncoding,...r.radChunk}}}async _loadMetadata(){let e=this.options.rad?.headerByteLengths?.length?this.options.rad.headerByteLengths:_F;if(typeof this.data!="string"){let r=Math.min(this.data.size,Math.max(...e)),i=ls(await this.data.slice(0,r).arrayBuffer());if(i)return i;throw new Error("RADSource: Blob does not contain a complete RAD metadata header.")}for(let r of e){let i=ls(await this._fetchArrayBuffer(this.url,{offset:0,bytes:r}));if(i)return i}throw new Error("RADSource: failed to load a complete RAD metadata header.")}_getChunkRange(e,r){if(!Number.isInteger(r)||r<0||r>=e.chunks.length)throw new Error(`RADSource: chunk index ${r} is outside 0-${e.chunks.length-1}.`);return e.chunks[r]}async _fetchArrayBuffer(e,r,i={}){let n=await this._fetchResponse(e,this._getRequestInit(r,i));if(!n.ok)throw new Error(`RADSource: failed to fetch ${e}: ${n.status} ${n.statusText}`);let o=await n.arrayBuffer();return r&&n.status!==206&&o.byteLength>=r.offset+r.bytes?o.slice(r.offset,r.offset+r.bytes):r&&o.byteLength>r.bytes?o.slice(0,r.bytes):o}async _fetchResponse(e,r){return this._hasCustomFetch()?await this.fetch(e,r):this.hasCoreApi?await this.coreApi.fetchFile(e,r):await this.fetch(e,r)}_hasCustomFetch(){return!!(this.loadOptions?.core?.fetch||this.loadOptions?.fetch)}_getRequestInit(e,r={}){let i=new Headers(this.options.rad?.headers);return e&&e.bytes>0&&i.set("Range",`bytes=${e.offset}-${e.offset+e.bytes-1}`),{headers:i,credentials:this.options.rad?.withCredentials?"include":"same-origin",signal:r.signal}}};function xF(t,e,r,i){let n=[],o=0;for(let a=e;a<t.chunks.length&&n.length<r&&o<i;a++){let s=t.chunks[a];n.push(a),o+=s?.count??t.chunkSize??0}return n}function IF(t){return Number.isFinite(t)&&t>0?Math.floor(t):wF}function SF(t){return typeof t.loaderData?.base=="number"?t.loaderData.base:0}function kF(t,e){let r=t.loaderData?.childCounts,i=t.loaderData?.childStarts;if(!(r instanceof Uint16Array)||!(i instanceof Uint32Array))return t;let n=new Uint32Array(t.splatCount),o=0;for(let c=0;c<t.splatCount;c++){let u=r[c],l=i[c];u>0&&l<e||(n[o++]=c)}if(o===t.splatCount)return t;let a=n.subarray(0,o),s=t.sphericalHarmonicsComponentCount??0;return{...t,splatCount:o,positions:Mn(t.positions,3,a),scales:Mn(t.scales,3,a),rotations:Mn(t.rotations,4,a),colors:Mn(t.colors,3,a),sphericalHarmonicDcs:t.sphericalHarmonicDcs?Mn(t.sphericalHarmonicDcs,3,a):void 0,opacities:Mn(t.opacities,1,a),sphericalHarmonics:t.sphericalHarmonics&&s?Mn(t.sphericalHarmonics,s,a):void 0,loaderData:{...t.loaderData,count:o,childCounts:Mn(r,1,a),childStarts:Mn(i,1,a)}}}function Mn(t,e,r){let i=new t.constructor(r.length*e);for(let n=0;n<r.length;n++){let o=r[n]*e,a=n*e;i.set(t.subarray(o,o+e),a)}return i}function Dm(t,e){if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("/"))return e;if(!t)throw new Error("RADSource: cannot resolve a sidecar RADC chunk without a RAD URL.");try{return new URL(e,t).toString()}catch{let[r,i=""]=t.split(/([?#].*)/,2),n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));return`${n>=0?r.slice(0,n+1):""}${e}${i}`}}return QB(Hu);})();
|
|
78
78
|
return __exports__;
|
|
79
79
|
});
|