sqlmesh 0.181.2.dev28__py3-none-any.whl → 0.182.1.dev2__py3-none-any.whl

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.
Files changed (52) hide show
  1. sqlmesh/_version.py +2 -2
  2. {sqlmesh-0.181.2.dev28.dist-info → sqlmesh-0.182.1.dev2.dist-info}/METADATA +1 -1
  3. {sqlmesh-0.181.2.dev28.dist-info → sqlmesh-0.182.1.dev2.dist-info}/RECORD +50 -50
  4. web/client/dist/assets/{Audits-CQSghR1z.js → Audits-sNYlBGyo.js} +1 -1
  5. web/client/dist/assets/{Banner-B0bpqtD_.js → Banner-DQLkKQf1.js} +1 -1
  6. web/client/dist/assets/{ChevronDownIcon-BCSgClK9.js → ChevronDownIcon-C8_judI9.js} +1 -1
  7. web/client/dist/assets/{ChevronRightIcon-Bcz9goZS.js → ChevronRightIcon-Y4yD8TZm.js} +1 -1
  8. web/client/dist/assets/{Content-BhpD1QIh.js → Content-BBF9m9Ox.js} +1 -1
  9. web/client/dist/assets/{Content-DcS8joWy.js → Content-VuErq_no.js} +1 -1
  10. web/client/dist/assets/{Data-Cx_yMlp4.js → Data-3L1ecmWi.js} +1 -1
  11. web/client/dist/assets/{DataCatalog-HXtPC12m.js → DataCatalog-DrAfqL4U.js} +1 -1
  12. web/client/dist/assets/{Editor-DlcCcxAF.js → Editor-BM8KFgVy.js} +1 -1
  13. web/client/dist/assets/{Editor-DOjTVzHs.js → Editor-MHaczmm6.js} +1 -1
  14. web/client/dist/assets/{Errors-RKQ2D8gd.js → Errors-DJscmqVa.js} +1 -1
  15. web/client/dist/assets/{FileExplorer-CstWOCnn.js → FileExplorer-CLG36HNc.js} +1 -1
  16. web/client/dist/assets/{Footer-CpMoFxgd.js → Footer-Bqwyjxx6.js} +1 -1
  17. web/client/dist/assets/{Header-mC2S0YQz.js → Header-ByzYcdnA.js} +1 -1
  18. web/client/dist/assets/{Input-BmfZ-VnW.js → Input-B8ocS4-7.js} +1 -1
  19. web/client/dist/assets/Lineage-LbDptVMs.js +1 -0
  20. web/client/dist/assets/{ListboxShow-CVN-1wre.js → ListboxShow-CgxqoVLl.js} +1 -1
  21. web/client/dist/assets/ModelLineage-BupppcuI.js +1 -0
  22. web/client/dist/assets/{Models-BMTG-GKX.js → Models-D9i15AXx.js} +1 -1
  23. web/client/dist/assets/{Page-DrM7FMiZ.js → Page-CeGJRgga.js} +1 -1
  24. web/client/dist/assets/{Plan-Cwr9Ts3u.js → Plan-Ci99V-DQ.js} +1 -1
  25. web/client/dist/assets/{PlusCircleIcon-DPJ5E9WX.js → PlusCircleIcon-CXn9capW.js} +1 -1
  26. web/client/dist/assets/{ReportErrors-DXdPHMbP.js → ReportErrors-sFkeXrKA.js} +1 -1
  27. web/client/dist/assets/{Root-DyEjo8XJ.js → Root-RMJAgu4n.js} +1 -1
  28. web/client/dist/assets/{SearchList-CJR2axiJ.js → SearchList-ByGvrOob.js} +1 -1
  29. web/client/dist/assets/{SelectEnvironment-BhhJ4ZjZ.js → SelectEnvironment-Dbh3hADo.js} +1 -1
  30. web/client/dist/assets/{SourceList-CXyYEJjr.js → SourceList-CxbQaPrp.js} +1 -1
  31. web/client/dist/assets/{SourceListItem-DVQwSGMy.js → SourceListItem-B-XJPxVQ.js} +1 -1
  32. web/client/dist/assets/{SplitPane-B5WJSZPo.js → SplitPane-B01X0T5e.js} +1 -1
  33. web/client/dist/assets/{Tests-BjGO6Jnt.js → Tests-LJHrn9AT.js} +1 -1
  34. web/client/dist/assets/{Welcome-DMIPcEFX.js → Welcome-yLt3zok6.js} +1 -1
  35. web/client/dist/assets/{context-DeHggMKx.js → context-BOWJ3y6O.js} +2 -2
  36. web/client/dist/assets/{context-Dwh4I8fp.js → context-CwSLzJoX.js} +1 -1
  37. web/client/dist/assets/{editor-intN6ort.js → editor-DCUemkCS.js} +1 -1
  38. web/client/dist/assets/{file-ZamfLSgo.js → file-CKN7I89z.js} +1 -1
  39. web/client/dist/assets/{floating-ui.react-dom-dR28niet.js → floating-ui.react-dom-DEe1nIQq.js} +1 -1
  40. web/client/dist/assets/{help-BzkjAMMJ.js → help-Dgc2HGTF.js} +1 -1
  41. web/client/dist/assets/{index-EyUZDtV7.js → index-Cxxri6jv.js} +1 -1
  42. web/client/dist/assets/{index-BObtdpsN.js → index-Zp5676Wn.js} +1 -1
  43. web/client/dist/assets/{plan-gWbTulhw.js → plan-aZVWL2yE.js} +1 -1
  44. web/client/dist/assets/{popover-CA0_-cE5.js → popover-Bi2UBBh6.js} +1 -1
  45. web/client/dist/assets/{project-BX-rNI7d.js → project-DNy5QteN.js} +1 -1
  46. web/client/dist/index.html +1 -1
  47. web/client/dist/assets/Lineage-VCDzvguV.js +0 -1
  48. web/client/dist/assets/ModelLineage-DxdKn0Xe.js +0 -1
  49. {sqlmesh-0.181.2.dev28.dist-info → sqlmesh-0.182.1.dev2.dist-info}/WHEEL +0 -0
  50. {sqlmesh-0.181.2.dev28.dist-info → sqlmesh-0.182.1.dev2.dist-info}/entry_points.txt +0 -0
  51. {sqlmesh-0.181.2.dev28.dist-info → sqlmesh-0.182.1.dev2.dist-info}/licenses/LICENSE +0 -0
  52. {sqlmesh-0.181.2.dev28.dist-info → sqlmesh-0.182.1.dev2.dist-info}/top_level.txt +0 -0
@@ -55,4 +55,4 @@ Error generating stack: `+h.message+`
55
55
  Please change the parent <Route path="${V}"> to <Route path="${V==="/"?"*":`${V}/*`}">.`)}let S=ro(),_;_=S;let D=_.pathname||"/",k=D;if(g!=="/"){let V=g.replace(/^\//,"").split("/");k="/"+D.replace(/^\//,"").split("/").slice(V.length).join("/")}let P=!u&&t&&t.matches&&t.matches.length>0?t.matches:ns(n,{pathname:k});return jt(v||P!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),jt(P==null||P[P.length-1].route.element!==void 0||P[P.length-1].route.Component!==void 0||P[P.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),VI(P&&P.map(V=>Object.assign({},V,{params:Object.assign({},p,V.params),pathname:Kr([g,a.encodeLocation?a.encodeLocation(V.pathname).pathname:V.pathname]),pathnameBase:V.pathnameBase==="/"?g:Kr([g,a.encodeLocation?a.encodeLocation(V.pathnameBase).pathname:V.pathnameBase])})),d,t,s)}function UI(){let n=qI(),e=Al(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=R.createElement(R.Fragment,null,R.createElement("p",null,"💿 Hey developer 👋"),R.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",R.createElement("code",{style:u},"ErrorBoundary")," or"," ",R.createElement("code",{style:u},"errorElement")," prop on your route.")),R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},e),t?R.createElement("pre",{style:a},t):null,d)}var jI=R.createElement(UI,null),zI=class extends R.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,e){return e.location!==n.location||e.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:e.error,location:e.location,revalidation:n.revalidation||e.revalidation}}componentDidCatch(n,e){console.error("React Router caught the following error during render",n,e)}render(){return this.state.error!==void 0?R.createElement(Or.Provider,{value:this.props.routeContext},R.createElement(up.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $I({routeContext:n,match:e,children:t}){let s=R.useContext(no);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),R.createElement(Or.Provider,{value:n},t)}function VI(n,e=[],t=null,s=null){if(n==null){if(!t)return null;if(t.errors)n=t.matches;else if(e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let a=n,u=t==null?void 0:t.errors;if(u!=null){let p=a.findIndex(m=>m.route.id&&(u==null?void 0:u[m.route.id])!==void 0);We(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let d=!1,f=-1;if(t)for(let p=0;p<a.length;p++){let m=a[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(f=p),m.route.id){let{loaderData:g,errors:v}=t,S=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||S){d=!0,f>=0?a=a.slice(0,f+1):a=[a[0]];break}}}return a.reduceRight((p,m,g)=>{let v,S=!1,_=null,D=null;t&&(v=u&&m.route.id?u[m.route.id]:void 0,_=m.route.errorElement||jI,d&&(f<0&&g===0?(L0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,D=null):f===g&&(S=!0,D=m.route.hydrateFallbackElement||null)));let k=e.concat(a.slice(0,g+1)),P=()=>{let B;return v?B=_:S?B=D:m.route.Component?B=R.createElement(m.route.Component,null):m.route.element?B=m.route.element:B=p,R.createElement($I,{match:m,routeContext:{outlet:p,matches:k,isDataRoute:t!=null},children:B})};return t&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?R.createElement(zI,{location:t.location,revalidation:t.revalidation,component:_,error:v,children:P(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):P()},null)}function cp(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function HI(n){let e=R.useContext(no);return We(e,cp(n)),e}function WI(n){let e=R.useContext(Vl);return We(e,cp(n)),e}function QI(n){let e=R.useContext(Or);return We(e,cp(n)),e}function dp(n){let e=QI(n),t=e.matches[e.matches.length-1];return We(t.route.id,`${n} can only be used on routes that contain a unique "id"`),t.route.id}function KI(){return dp("useRouteId")}function qI(){var s;let n=R.useContext(up),e=WI("useRouteError"),t=dp("useRouteError");return n!==void 0?n:(s=e.errors)==null?void 0:s[t]}function YI(){let{router:n}=HI("useNavigate"),e=dp("useNavigate"),t=R.useRef(!1);return M0(()=>{t.current=!0}),R.useCallback(async(a,u={})=>{jt(t.current,F0),t.current&&(typeof a=="number"?n.navigate(a):await n.navigate(a,{fromRouteId:e,...u}))},[n,e])}var Wg={};function L0(n,e,t){!e&&!Wg[n]&&(Wg[n]=!0,jt(!1,t))}var Qg={};function Kg(n,e){!n&&!Qg[e]&&(Qg[e]=!0,console.warn(e))}function GI(n){let e={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&jt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:R.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&jt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:R.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&jt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:R.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),e}var JI=["HydrateFallback","hydrateFallbackElement"],XI=class{constructor(){this.status="pending",this.promise=new Promise((n,e)=>{this.resolve=t=>{this.status==="pending"&&(this.status="resolved",n(t))},this.reject=t=>{this.status==="pending"&&(this.status="rejected",e(t))}})}};function ZI({router:n,flushSync:e}){let[t,s]=R.useState(n.state),[a,u]=R.useState(),[d,f]=R.useState({isTransitioning:!1}),[p,m]=R.useState(),[g,v]=R.useState(),[S,_]=R.useState(),D=R.useRef(new Map),k=R.useCallback((W,{deletedFetchers:q,flushSync:ee,viewTransitionOpts:L})=>{W.fetchers.forEach((he,ne)=>{he.data!==void 0&&D.current.set(ne,he.data)}),q.forEach(he=>D.current.delete(he)),Kg(ee===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Oe=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(Kg(L==null||Oe,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!L||!Oe){e&&ee?e(()=>s(W)):R.startTransition(()=>s(W));return}if(e&&ee){e(()=>{g&&(p&&p.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let he=n.window.document.startViewTransition(()=>{e(()=>s(W))});he.finished.finally(()=>{e(()=>{m(void 0),v(void 0),u(void 0),f({isTransitioning:!1})})}),e(()=>v(he));return}g?(p&&p.resolve(),g.skipTransition(),_({state:W,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(u(W),f({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,e,g,p]);R.useLayoutEffect(()=>n.subscribe(k),[n,k]),R.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new XI)},[d]),R.useEffect(()=>{if(p&&a&&n.window){let W=a,q=p.promise,ee=n.window.document.startViewTransition(async()=>{R.startTransition(()=>s(W)),await q});ee.finished.finally(()=>{m(void 0),v(void 0),u(void 0),f({isTransitioning:!1})}),v(ee)}},[a,p,n.window]),R.useEffect(()=>{p&&a&&t.location.key===a.location.key&&p.resolve()},[p,g,t.location,a]),R.useEffect(()=>{!d.isTransitioning&&S&&(u(S.state),f({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),_(void 0))},[d.isTransitioning,S]);let P=R.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:W=>n.navigate(W),push:(W,q,ee)=>n.navigate(W,{state:q,preventScrollReset:ee==null?void 0:ee.preventScrollReset}),replace:(W,q,ee)=>n.navigate(W,{replace:!0,state:q,preventScrollReset:ee==null?void 0:ee.preventScrollReset})}),[n]),B=n.basename||"/",V=R.useMemo(()=>({router:n,navigator:P,static:!1,basename:B}),[n,P,B]);return R.createElement(R.Fragment,null,R.createElement(no.Provider,{value:V},R.createElement(Vl.Provider,{value:t},R.createElement(R0.Provider,{value:D.current},R.createElement(lp.Provider,{value:d},R.createElement(nE,{basename:B,location:t.location,navigationType:t.historyAction,navigator:P},R.createElement(eE,{routes:n.routes,future:n.future,state:t})))))),null)}var eE=R.memo(tE);function tE({routes:n,future:e,state:t}){return BI(n,void 0,t,e)}function DO(n){return NI(n.context)}function nE({basename:n="/",children:e=null,location:t,navigationType:s="POP",navigator:a,static:u=!1}){We(!Hl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=n.replace(/^\/*/,"/"),f=R.useMemo(()=>({basename:d,navigator:a,static:u,future:{}}),[d,a,u]);typeof t=="string"&&(t=gs(t));let{pathname:p="/",search:m="",hash:g="",state:v=null,key:S="default"}=t,_=R.useMemo(()=>{let D=ir(p,d);return D==null?null:{location:{pathname:D,search:m,hash:g,state:v,key:S},navigationType:s}},[d,p,m,g,v,S,s]);return jt(_!=null,`<Router basename="${d}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:R.createElement(Jr.Provider,{value:f},R.createElement(fd.Provider,{children:e,value:_}))}var vc="get",wc="application/x-www-form-urlencoded";function hd(n){return n!=null&&typeof n.tagName=="string"}function rE(n){return hd(n)&&n.tagName.toLowerCase()==="button"}function iE(n){return hd(n)&&n.tagName.toLowerCase()==="form"}function sE(n){return hd(n)&&n.tagName.toLowerCase()==="input"}function oE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function aE(n,e){return n.button===0&&(!e||e==="_self")&&!oE(n)}var cc=null;function lE(){if(cc===null)try{new FormData(document.createElement("form"),0),cc=!1}catch{cc=!0}return cc}var uE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fh(n){return n!=null&&!uE.has(n)?(jt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wc}"`),null):n}function cE(n,e){let t,s,a,u,d;if(iE(n)){let f=n.getAttribute("action");s=f?ir(f,e):null,t=n.getAttribute("method")||vc,a=fh(n.getAttribute("enctype"))||wc,u=new FormData(n)}else if(rE(n)||sE(n)&&(n.type==="submit"||n.type==="image")){let f=n.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=n.getAttribute("formaction")||f.getAttribute("action");if(s=p?ir(p,e):null,t=n.getAttribute("formmethod")||f.getAttribute("method")||vc,a=fh(n.getAttribute("formenctype"))||fh(f.getAttribute("enctype"))||wc,u=new FormData(f,n),!lE()){let{name:m,type:g,value:v}=n;if(g==="image"){let S=m?`${m}.`:"";u.append(`${S}x`,"0"),u.append(`${S}y`,"0")}else m&&u.append(m,v)}}else{if(hd(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=vc,s=null,a=wc,d=n}return u&&a==="text/plain"&&(d=u,u=void 0),{action:s,method:t.toLowerCase(),encType:a,formData:u,body:d}}function fp(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}async function dE(n,e){if(n.id in e)return e[n.id];try{let t=await import(n.module);return e[n.id]=t,t}catch(t){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fE(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function hE(n,e,t){let s=await Promise.all(n.map(async a=>{let u=e.routes[a.route.id];if(u){let d=await dE(u,t);return d.links?d.links():[]}return[]}));return gE(s.flat(1).filter(fE).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function qg(n,e,t,s,a,u){let d=(p,m)=>t[m]?p.route.id!==t[m].route.id:!0,f=(p,m)=>{var g;return t[m].pathname!==p.pathname||((g=t[m].route.path)==null?void 0:g.endsWith("*"))&&t[m].params["*"]!==p.params["*"]};return u==="assets"?e.filter((p,m)=>d(p,m)||f(p,m)):u==="data"?e.filter((p,m)=>{var v;let g=s.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(d(p,m)||f(p,m))return!0;if(p.route.shouldRevalidate){let S=p.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((v=t[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function pE(n,e,{includeHydrateFallback:t}={}){return mE(n.map(s=>{let a=e.routes[s.route.id];if(!a)return[];let u=[a.module];return a.clientActionModule&&(u=u.concat(a.clientActionModule)),a.clientLoaderModule&&(u=u.concat(a.clientLoaderModule)),t&&a.hydrateFallbackModule&&(u=u.concat(a.hydrateFallbackModule)),a.imports&&(u=u.concat(a.imports)),u}).flat(1))}function mE(n){return[...new Set(n)]}function yE(n){let e={},t=Object.keys(n).sort();for(let s of t)e[s]=n[s];return e}function gE(n,e){let t=new Set;return new Set(e),n.reduce((s,a)=>{let u=JSON.stringify(yE(a));return t.has(u)||(t.add(u),s.push({key:u,link:a})),s},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var vE=new Set([100,101,204,205]);function wE(n,e){let t=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return t.pathname==="/"?t.pathname="_root.data":e&&ir(t.pathname,e)==="/"?t.pathname=`${e.replace(/\/$/,"")}/_root.data`:t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function A0(){let n=R.useContext(no);return fp(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function SE(){let n=R.useContext(Vl);return fp(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var hp=R.createContext(void 0);hp.displayName="FrameworkContext";function k0(){let n=R.useContext(hp);return fp(n,"You must render this element inside a <HydratedRouter> element"),n}function _E(n,e){let t=R.useContext(hp),[s,a]=R.useState(!1),[u,d]=R.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:m,onMouseLeave:g,onTouchStart:v}=e,S=R.useRef(null);R.useEffect(()=>{if(n==="render"&&d(!0),n==="viewport"){let k=B=>{B.forEach(V=>{d(V.isIntersecting)})},P=new IntersectionObserver(k,{threshold:.5});return S.current&&P.observe(S.current),()=>{P.disconnect()}}},[n]),R.useEffect(()=>{if(s){let k=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(k)}}},[s]);let _=()=>{a(!0)},D=()=>{a(!1),d(!1)};return t?n!=="intent"?[u,S,{}]:[u,S,{onFocus:ml(f,_),onBlur:ml(p,D),onMouseEnter:ml(m,_),onMouseLeave:ml(g,D),onTouchStart:ml(v,_)}]:[!1,S,{}]}function ml(n,e){return t=>{n&&n(t),t.defaultPrevented||e(t)}}function bE({page:n,...e}){let{router:t}=A0(),s=R.useMemo(()=>ns(t.routes,n,t.basename),[t.routes,n,t.basename]);return s?R.createElement(EE,{page:n,matches:s,...e}):null}function IE(n){let{manifest:e,routeModules:t}=k0(),[s,a]=R.useState([]);return R.useEffect(()=>{let u=!1;return hE(n,e,t).then(d=>{u||a(d)}),()=>{u=!0}},[n,e,t]),s}function EE({page:n,matches:e,...t}){let s=ro(),{manifest:a,routeModules:u}=k0(),{basename:d}=A0(),{loaderData:f,matches:p}=SE(),m=R.useMemo(()=>qg(n,e,p,a,s,"data"),[n,e,p,a,s]),g=R.useMemo(()=>qg(n,e,p,a,s,"assets"),[n,e,p,a,s]),v=R.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let D=new Set,k=!1;if(e.forEach(B=>{var W;let V=a.routes[B.route.id];!V||!V.hasLoader||(!m.some(q=>q.route.id===B.route.id)&&B.route.id in f&&((W=u[B.route.id])!=null&&W.shouldRevalidate)||V.hasClientLoader?k=!0:D.add(B.route.id))}),D.size===0)return[];let P=wE(n,d);return k&&D.size>0&&P.searchParams.set("_routes",e.filter(B=>D.has(B.route.id)).map(B=>B.route.id).join(",")),[P.pathname+P.search]},[d,f,s,a,m,e,n,u]),S=R.useMemo(()=>pE(g,a),[g,a]),_=IE(g);return R.createElement(R.Fragment,null,v.map(D=>R.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...t})),S.map(D=>R.createElement("link",{key:D,rel:"modulepreload",href:D,...t})),_.map(({key:D,link:k})=>R.createElement("link",{key:D,...k})))}function xE(...n){return e=>{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var P0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{P0&&(window.__reactRouterVersion="7.6.0")}catch{}function DE(n,e){return hI({basename:e==null?void 0:e.basename,unstable_getContext:e==null?void 0:e.unstable_getContext,future:e==null?void 0:e.future,history:kb({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||CE(),routes:n,mapRouteProperties:GI,hydrationRouteProperties:JI,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function CE(){let n=window==null?void 0:window.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:OE(n.errors)}),n}function OE(n){if(!n)return null;let e=Object.entries(n),t={};for(let[s,a]of e)if(a&&a.__type==="RouteErrorResponse")t[s]=new Ac(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let u=window[a.__subType];if(typeof u=="function")try{let d=new u(a.message);d.stack="",t[s]=d}catch{}}if(t[s]==null){let u=new Error(a.message);u.stack="",t[s]=u}}else t[s]=a;return t}var T0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pp=R.forwardRef(function({onClick:e,discover:t="render",prefetch:s="none",relative:a,reloadDocument:u,replace:d,state:f,target:p,to:m,preventScrollReset:g,viewTransition:v,...S},_){let{basename:D}=R.useContext(Jr),k=typeof m=="string"&&T0.test(m),P,B=!1;if(typeof m=="string"&&k&&(P=m,P0))try{let ne=new URL(window.location.href),Me=m.startsWith("//")?new URL(ne.protocol+m):new URL(m),mt=ir(Me.pathname,D);Me.origin===ne.origin&&mt!=null?m=mt+Me.search+Me.hash:B=!0}catch{jt(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let V=AI(m,{relative:a}),[W,q,ee]=_E(s,S),L=LE(m,{replace:d,state:f,target:p,preventScrollReset:g,relative:a,viewTransition:v});function Oe(ne){e&&e(ne),ne.defaultPrevented||L(ne)}let he=R.createElement("a",{...S,...ee,href:P||V,onClick:B||u?e:Oe,ref:xE(_,q),target:p,"data-discover":!k&&t==="render"?"true":void 0});return W&&!k?R.createElement(R.Fragment,null,he,R.createElement(bE,{page:V})):he});pp.displayName="Link";var RE=R.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:s="",end:a=!1,style:u,to:d,viewTransition:f,children:p,...m},g){let v=Wl(d,{relative:m.relative}),S=ro(),_=R.useContext(Vl),{navigator:D,basename:k}=R.useContext(Jr),P=_!=null&&NE(v)&&f===!0,B=D.encodeLocation?D.encodeLocation(v).pathname:v.pathname,V=S.pathname,W=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;t||(V=V.toLowerCase(),W=W?W.toLowerCase():null,B=B.toLowerCase()),W&&k&&(W=ir(W,k)||W);const q=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let ee=V===B||!a&&V.startsWith(B)&&V.charAt(q)==="/",L=W!=null&&(W===B||!a&&W.startsWith(B)&&W.charAt(B.length)==="/"),Oe={isActive:ee,isPending:L,isTransitioning:P},he=ee?e:void 0,ne;typeof s=="function"?ne=s(Oe):ne=[s,ee?"active":null,L?"pending":null,P?"transitioning":null].filter(Boolean).join(" ");let Me=typeof u=="function"?u(Oe):u;return R.createElement(pp,{...m,"aria-current":he,className:ne,ref:g,style:Me,to:d,viewTransition:f},typeof p=="function"?p(Oe):p)});RE.displayName="NavLink";var FE=R.forwardRef(({discover:n="render",fetcherKey:e,navigate:t,reloadDocument:s,replace:a,state:u,method:d=vc,action:f,onSubmit:p,relative:m,preventScrollReset:g,viewTransition:v,...S},_)=>{let D=PE(),k=TE(f,{relative:m}),P=d.toLowerCase()==="get"?"get":"post",B=typeof f=="string"&&T0.test(f),V=W=>{if(p&&p(W),W.defaultPrevented)return;W.preventDefault();let q=W.nativeEvent.submitter,ee=(q==null?void 0:q.getAttribute("formmethod"))||d;D(q||W.currentTarget,{fetcherKey:e,method:ee,navigate:t,replace:a,state:u,relative:m,preventScrollReset:g,viewTransition:v})};return R.createElement("form",{ref:_,method:P,action:k,onSubmit:s?p:V,...S,"data-discover":!B&&n==="render"?"true":void 0})});FE.displayName="Form";function ME(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function N0(n){let e=R.useContext(no);return We(e,ME(n)),e}function LE(n,{target:e,replace:t,state:s,preventScrollReset:a,relative:u,viewTransition:d}={}){let f=kI(),p=ro(),m=Wl(n,{relative:u});return R.useCallback(g=>{if(aE(g,e)){g.preventDefault();let v=t!==void 0?t:ps(p)===ps(m);f(n,{replace:v,state:s,preventScrollReset:a,relative:u,viewTransition:d})}},[p,f,m,t,s,e,n,a,u,d])}var AE=0,kE=()=>`__${String(++AE)}__`;function PE(){let{router:n}=N0("useSubmit"),{basename:e}=R.useContext(Jr),t=KI();return R.useCallback(async(s,a={})=>{let{action:u,method:d,encType:f,formData:p,body:m}=cE(s,e);if(a.navigate===!1){let g=a.fetcherKey||kE();await n.fetch(g,t,a.action||u,{preventScrollReset:a.preventScrollReset,formData:p,body:m,formMethod:a.method||d,formEncType:a.encType||f,flushSync:a.flushSync})}else await n.navigate(a.action||u,{preventScrollReset:a.preventScrollReset,formData:p,body:m,formMethod:a.method||d,formEncType:a.encType||f,replace:a.replace,state:a.state,fromRouteId:t,flushSync:a.flushSync,viewTransition:a.viewTransition})},[n,e,t])}function TE(n,{relative:e}={}){let{basename:t}=R.useContext(Jr),s=R.useContext(Or);We(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),u={...Wl(n||".",{relative:e})},d=ro();if(n==null){u.search=d.search;let f=new URLSearchParams(u.search),p=f.getAll("index");if(p.some(g=>g==="")){f.delete("index"),p.filter(v=>v).forEach(v=>f.append("index",v));let g=f.toString();u.search=g?`?${g}`:""}}return(!n||n===".")&&a.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(u.pathname=u.pathname==="/"?t:Kr([t,u.pathname])),ps(u)}function NE(n,e={}){let t=R.useContext(lp);We(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=N0("useViewTransitionState"),a=Wl(n,{relative:e.relative});if(!t.isTransitioning)return!1;let u=ir(t.currentLocation.pathname,s)||t.currentLocation.pathname,d=ir(t.nextLocation.pathname,s)||t.nextLocation.pathname;return Lc(a.pathname,d)!=null||Lc(a.pathname,u)!=null}[...vE];function B0(n){var e,t,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var a=n.length;for(e=0;e<a;e++)n[e]&&(t=B0(n[e]))&&(s&&(s+=" "),s+=t)}else for(t in n)n[t]&&(s&&(s+=" "),s+=t);return s}function qr(){for(var n,e,t=0,s="",a=arguments.length;t<a;t++)(n=arguments[t])&&(e=B0(n))&&(s&&(s+=" "),s+=e);return s}const Tt={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"},ft={Primary:"primary",Alternative:"alternative",Secondary:"secondary",Success:"success",Danger:"danger",Warning:"warning",Info:"info",Neutral:"neutral"},CO={Left:"left",Right:"right"},Yg=new Map([[Tt.sm,""],[Tt.md,"-2"],[Tt.lg,"-4"]]);function Gg({size:n=Tt.sm,orientation:e="horizontal",className:t}){return U.jsx("span",{className:qr(["block border-divider",e==="horizontal"&&`w-full border-b${Yg.get(n)??""}`,e==="vertical"&&`h-full border-r${Yg.get(n)??""}`],t)})}const U0=function({children:e}){return U.jsx(U.Fragment,{children:e})};function BE({children:n,layout:e="vertical"}){return U.jsx("div",{className:qr("font-sans w-full h-full flex overflow-hidden",e==="horizontal"?"flex-row":"flex-col"),children:n})}U0.Page=BE;const OO={Circle:"circle"},RO={Ghost:"ghost"},UE=new Map([["primary","border-primary-500 bg-primary-500 hover:bg-primary-400 active:bg-primary-400 text-light"],["alternative","border-neutral-300 bg-neutral-5 hover:bg-neutral-20 active:bg-neutral-200 text-neutral-600"],["secondary","border-secondary-500 bg-secondary-500 hover:bg-secondary-600 active:bg-secondary-400 text-neutral-100"],["success","border-success-500 bg-success-500 hover:bg-success-600 active:bg-success-400 text-neutral-100"],["danger","border-danger-500 bg-danger-500 hover:bg-danger-600 active:bg-danger-400 text-neutral-100"],["warning","border-warning-500 bg-warning-500 hover:bg-warning-600 active:bg-warning-400 text-neutral-100"],["neutral","border-neutral-200 bg-neutral-200 hover:bg-neutral-300 active:bg-neutral-300 text-primary-900"],["info","border-transparent bg-neutral-10 dark:bg-neutral-20 active:bg-neutral-10 text-neutral-700 dark:text-neutral-200"]]),jE=new Map([["rounded","rounded-md"],["square","rounded-none"],["circle","rounded-full"]]),zE=new Map([[Tt.xs,"text-xs leading-2 border"],[Tt.sm,"px-2 py-[0.125rem] text-xs leading-4 border-2"],[Tt.md,"px-3 py-2 text-base leading-6 border-2"],[Tt.lg,"px-4 py-3 text-lg border-4"]]),FO=j0(Xs.forwardRef(VE)),$E=j0(Xs.forwardRef(HE));function VE({type:n="button",disabled:e=!1,children:t=[],form:s,autoFocus:a,tabIndex:u,onClick:d,className:f},p){return U.jsx("button",{ref:p,type:n,autoFocus:a,tabIndex:u,form:s,disabled:e,onClick:d,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),m.stopPropagation(),d==null||d(m))},className:f,children:t})}function HE({children:n=[],autoFocus:e,tabIndex:t,className:s},a){return U.jsx("div",{ref:a,autoFocus:e,tabIndex:t,className:s,children:n})}function j0(n){return Xs.forwardRef(function({type:t="button",disabled:s=!1,variant:a="primary",shape:u="rounded",size:d=Tt.md,children:f=[],className:p,form:m,autoFocus:g,tabIndex:v,onClick:S},_){return U.jsx(n,{ref:_,type:t,disabled:s,form:m,autoFocus:g,tabIndex:v,onClick:S,className:qr("whitespace-nowrap flex m-1 items-center justify-center font-bold","focus:ring-4 focus:outline-none focus:border-secondary-500","ring-secondary-300 ring-opacity-60 ring-offset ring-offset-secondary-100",jE.get(u),zE.get(d),s?"opacity-50 bg-neutral-10 dark:bg-neutral-20 border-transparent text-prose cursor-not-allowed":UE.get(a),p),children:f})})}function Fn({description:n,link:e,headline:t="Not Found",message:s="Go Back Home"}){return U.jsx(U0.Page,{children:U.jsx("div",{className:"flex items-center justify-center w-full h-full",children:U.jsxs("div",{className:"text-center",children:[U.jsx("h1",{className:"text-[4rem] md:text-[6rem] lg:text-[9rem] text-secondary-10 dark:text-primary-10 mb-4",children:t}),yn(n)&&U.jsx("p",{className:"mb-10 py-5 px-4 text-neutral-70 dark:text-primary-70 w-full bg-primary-10 rounded-md",children:n}),yn(e)&&U.jsx("div",{className:"inline-block",children:U.jsx($E,{variant:ft.Alternative,children:U.jsx(pp,{to:e,children:s})})})]})})})}function zs({style:n,className:e,variant:t=ft.Info}){return U.jsxs("svg",{style:n,className:qr("animate-spin bg-transparent rounded-full",e),viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg","aria-label":"Loading",role:"img",children:[U.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 59.7128C31.3054 68.5494 50.8763 63.3054 59.7128 48C68.5494 32.6946 63.3054 13.1237 48 4.28719C32.6946 -4.54937 13.1237 0.694636 4.28719 16C-4.54937 31.3054 0.694637 50.8763 16 59.7128ZM23 47.5885C31.6093 52.559 42.6179 49.6093 47.5885 41C52.559 32.3907 49.6093 21.3821 41 16.4115C32.3907 11.441 21.3821 14.3907 16.4115 23C11.441 31.6093 14.3907 42.6179 23 47.5885Z",className:"fill-theme-lighter"}),U.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.5827 26.5161C49.2259 21.9157 46.1691 17.8082 41.6875 15.2208C37.4263 12.7606 32.6191 12.103 28.1488 13.0114L25.1365 1.76921C32.4854 0.0988895 40.4586 1.08788 47.5 5.15321C54.7617 9.34574 59.6854 16.0326 61.8138 23.5067L50.5827 26.5161Z",className:qr(t===ft.Primary&&"fill-primary-500",t===ft.Secondary&&"fill-secondary-500",t===ft.Success&&"fill-success-500",t===ft.Warning&&"fill-warning-500",t===ft.Danger&&"fill-danger-500",t===ft.Info&&"fill-neutral-500"),stroke:qr(t===ft.Primary&&"var(--color-primary-500)",t===ft.Secondary&&"var(--color-secondary-500)",t===ft.Success&&"var(--color-success-500)",t===ft.Warning&&"var(--color-warning-500)",t===ft.Danger&&"var(--color-danger-500)",t===ft.Info&&"var(--color-neutral-500)"),strokeWidth:"4"})]})}function WE({as:n="p",size:e=Tt.sm,variant:t=ft.Info,text:s,className:a}){const u=n;return U.jsx(u,{className:qr("font-bold whitespace-nowrap",t===ft.Primary&&"text-primary-600 dark:text-primary-400",t===ft.Secondary&&"text-secondary-600 dark:text-secondary-400",t===ft.Success&&"text-success-600 dark:text-success-400",t===ft.Warning&&"text-warning-600 dark:text-warning-400",t===ft.Danger&&"text-danger-600 dark:text-danger-400",t===ft.Info&&"text-neutral-600 dark:text-neutral-400",e===Tt.xs&&"text-xs",e===Tt.sm&&"text-md",e===Tt.md&&"text-lg",e===Tt.lg&&"text-2xl",e===Tt.xl&&"text-4xl",a),children:s})}function No({hasSpinner:n=!1,size:e=Tt.sm,variant:t=ft.Info,text:s,children:a,className:u}){return U.jsx("span",{className:qr(t===ft.Primary&&"text-primary-600 dark:text-primary-400",t===ft.Secondary&&"text-secondary-600 dark:text-secondary-400",t===ft.Success&&"text-success-600 dark:text-success-400",t===ft.Warning&&"text-warning-600 dark:text-warning-400",t===ft.Danger&&"text-danger-600 dark:text-danger-400",t===ft.Info&&"text-neutral-600 dark:text-neutral-400",u),children:U.jsxs("span",{className:"flex items-center w-full",children:[n&&U.jsx(zs,{variant:t,className:qr(e===Tt.xs&&"w-2 h-2 mr-2",e===Tt.sm&&"w-3 h-3 mr-2",e===Tt.md&&"w-4 h-4 mr-2",e===Tt.lg&&"w-5 h-5 mr-4",e===Tt.xl&&"w-6 h-6 mr-4")}),yn(s)?U.jsx(WE,{size:e,variant:t,text:s}):a]})})}var Jg=function(){return Jg=Object.assign||function(e){for(var t,s=1,a=arguments.length;s<a;s++){t=arguments[s];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u])}return e},Jg.apply(this,arguments)};function MO(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(n);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(n,s[a])&&(t[s[a]]=n[s[a]]);return t}function Pe(n,e,t,s){function a(u){return u instanceof t?u:new t(function(d){d(u)})}return new(t||(t=Promise))(function(u,d){function f(g){try{m(s.next(g))}catch(v){d(v)}}function p(g){try{m(s.throw(g))}catch(v){d(v)}}function m(g){g.done?u(g.value):a(g.value).then(f,p)}m((s=s.apply(n,e||[])).next())})}function Xg(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],s=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function LO(n,e,t){if(t||arguments.length===2)for(var s=0,a=e.length,u;s<a;s++)(u||!(s in e))&&(u||(u=Array.prototype.slice.call(e,0,s)),u[s]=e[s]);return n.concat(u||Array.prototype.slice.call(e))}function Be(n){return this instanceof Be?(this.v=n,this):new Be(n)}function Qr(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=t.apply(n,e||[]),a,u=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),f("next"),f("throw"),f("return",d),a[Symbol.asyncIterator]=function(){return this},a;function d(_){return function(D){return Promise.resolve(D).then(_,v)}}function f(_,D){s[_]&&(a[_]=function(k){return new Promise(function(P,B){u.push([_,k,P,B])>1||p(_,k)})},D&&(a[_]=D(a[_])))}function p(_,D){try{m(s[_](D))}catch(k){S(u[0][3],k)}}function m(_){_.value instanceof Be?Promise.resolve(_.value.v).then(g,v):S(u[0][2],_)}function g(_){p("next",_)}function v(_){p("throw",_)}function S(_,D){_(D),u.shift(),u.length&&p(u[0][0],u[0][1])}}function Sc(n){var e,t;return e={},s("next"),s("throw",function(a){throw a}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(a,u){e[a]=n[a]?function(d){return(t=!t)?{value:Be(n[a](d)),done:!1}:u?u(d):d}:u}}function Jo(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Xg=="function"?Xg(n):n[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(u){t[u]=n[u]&&function(d){return new Promise(function(f,p){d=n[u](d),a(f,p,d.done,d.value)})}}function a(u,d,f,p){Promise.resolve(p).then(function(m){u({value:m,done:f})},d)}}const QE=new TextDecoder("utf-8"),Bh=n=>QE.decode(n),KE=new TextEncoder,mp=n=>KE.encode(n),qE=n=>typeof n=="number",YE=n=>typeof n=="boolean",mn=n=>typeof n=="function",Dr=n=>n!=null&&Object(n)===n,kl=n=>Dr(n)&&mn(n.then),pd=n=>Dr(n)&&mn(n[Symbol.iterator]),yp=n=>Dr(n)&&mn(n[Symbol.asyncIterator]),Uh=n=>Dr(n)&&Dr(n.schema),z0=n=>Dr(n)&&"done"in n&&"value"in n,$0=n=>Dr(n)&&mn(n.stat)&&qE(n.fd),V0=n=>Dr(n)&&gp(n.body),H0=n=>"_getDOMStream"in n&&"_getNodeStream"in n,gp=n=>Dr(n)&&mn(n.cancel)&&mn(n.getReader)&&!H0(n),W0=n=>Dr(n)&&mn(n.read)&&mn(n.pipe)&&YE(n.readable)&&!H0(n),GE=n=>Dr(n)&&mn(n.clear)&&mn(n.bytes)&&mn(n.position)&&mn(n.setPosition)&&mn(n.capacity)&&mn(n.getBufferIdentifier)&&mn(n.createLong),vp=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function JE(n){const e=n[0]?[n[0]]:[];let t,s,a,u;for(let d,f,p=0,m=0,g=n.length;++p<g;){if(d=e[m],f=n[p],!d||!f||d.buffer!==f.buffer||f.byteOffset<d.byteOffset){f&&(e[++m]=f);continue}if({byteOffset:t,byteLength:a}=d,{byteOffset:s,byteLength:u}=f,t+a<s||s+u<t){f&&(e[++m]=f);continue}e[m]=new Uint8Array(d.buffer,t,s-t+u)}return e}function Zg(n,e,t=0,s=e.byteLength){const a=n.byteLength,u=new Uint8Array(n.buffer,n.byteOffset,a),d=new Uint8Array(e.buffer,e.byteOffset,Math.min(s,a));return u.set(d,t),n}function Yr(n,e){const t=JE(n),s=t.reduce((g,v)=>g+v.byteLength,0);let a,u,d,f=0,p=-1;const m=Math.min(e||Number.POSITIVE_INFINITY,s);for(const g=t.length;++p<g;){if(a=t[p],u=a.subarray(0,Math.min(a.length,m-f)),m<=f+u.length){u.length<a.length?t[p]=a.subarray(u.length):u.length===a.length&&p++,d?Zg(d,u,f):d=u;break}Zg(d||(d=new Uint8Array(m)),u,f),f+=u.length}return[d||new Uint8Array(0),t.slice(p),s-(d?d.byteLength:0)]}function ut(n,e){let t=z0(e)?e.value:e;return t instanceof n?n===Uint8Array?new n(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=mp(t)),t instanceof ArrayBuffer?new n(t):t instanceof vp?new n(t):GE(t)?ut(n,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new n(0):new n(t.buffer,t.byteOffset,t.byteLength/n.BYTES_PER_ELEMENT):n.from(t)):new n(0)}const yl=n=>ut(Int32Array,n),ev=n=>ut(BigInt64Array,n),Je=n=>ut(Uint8Array,n),jh=n=>(n.next(),n);function*XE(n,e){const t=function*(a){yield a},s=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof vp?t(e):pd(e)?e:t(e);return yield*jh(function*(a){let u=null;do u=a.next(yield ut(n,u));while(!u.done)}(s[Symbol.iterator]())),new n}const ZE=n=>XE(Uint8Array,n);function Q0(n,e){return Qr(this,arguments,function*(){if(kl(e))return yield Be(yield Be(yield*Sc(Jo(Q0(n,yield Be(e))))));const s=function(d){return Qr(this,arguments,function*(){yield yield Be(yield Be(d))})},a=function(d){return Qr(this,arguments,function*(){yield Be(yield*Sc(Jo(jh(function*(f){let p=null;do p=f.next(yield p==null?void 0:p.value);while(!p.done)}(d[Symbol.iterator]())))))})},u=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof vp?s(e):pd(e)?a(e):yp(e)?e:s(e);return yield Be(yield*Sc(Jo(jh(function(d){return Qr(this,arguments,function*(){let f=null;do f=yield Be(d.next(yield yield Be(ut(n,f))));while(!f.done)})}(u[Symbol.asyncIterator]()))))),yield Be(new n)})}const ex=n=>Q0(Uint8Array,n);function tx(n,e){let t=0;const s=n.length;if(s!==e.length)return!1;if(s>0)do if(n[t]!==e[t])return!1;while(++t<s);return!0}const er={fromIterable(n){return dc(nx(n))},fromAsyncIterable(n){return dc(rx(n))},fromDOMStream(n){return dc(ix(n))},fromNodeStream(n){return dc(ox(n))},toDOMStream(n,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(n,e){throw new Error('"toNodeStream" not available in this environment')}},dc=n=>(n.next(),n);function*nx(n){let e,t=!1,s=[],a,u,d,f=0;function p(){return u==="peek"?Yr(s,d)[0]:([a,s,f]=Yr(s,d),a)}({cmd:u,size:d}=(yield null)||{cmd:"read",size:0});const m=ZE(n)[Symbol.iterator]();try{do if({done:e,value:a}=Number.isNaN(d-f)?m.next():m.next(d-f),!e&&a.byteLength>0&&(s.push(a),f+=a.byteLength),e||d<=f)do({cmd:u,size:d}=yield p());while(d<f);while(!e)}catch(g){(t=!0)&&typeof m.throw=="function"&&m.throw(g)}finally{t===!1&&typeof m.return=="function"&&m.return(null)}return null}function rx(n){return Qr(this,arguments,function*(){let t,s=!1,a=[],u,d,f,p=0;function m(){return d==="peek"?Yr(a,f)[0]:([u,a,p]=Yr(a,f),u)}({cmd:d,size:f}=(yield yield Be(null))||{cmd:"read",size:0});const g=ex(n)[Symbol.asyncIterator]();try{do if({done:t,value:u}=Number.isNaN(f-p)?yield Be(g.next()):yield Be(g.next(f-p)),!t&&u.byteLength>0&&(a.push(u),p+=u.byteLength),t||f<=p)do({cmd:d,size:f}=yield yield Be(m()));while(f<p);while(!t)}catch(v){(s=!0)&&typeof g.throw=="function"&&(yield Be(g.throw(v)))}finally{s===!1&&typeof g.return=="function"&&(yield Be(g.return(new Uint8Array(0))))}return yield Be(null)})}function ix(n){return Qr(this,arguments,function*(){let t=!1,s=!1,a=[],u,d,f,p=0;function m(){return d==="peek"?Yr(a,f)[0]:([u,a,p]=Yr(a,f),u)}({cmd:d,size:f}=(yield yield Be(null))||{cmd:"read",size:0});const g=new sx(n);try{do if({done:t,value:u}=Number.isNaN(f-p)?yield Be(g.read()):yield Be(g.read(f-p)),!t&&u.byteLength>0&&(a.push(Je(u)),p+=u.byteLength),t||f<=p)do({cmd:d,size:f}=yield yield Be(m()));while(f<p);while(!t)}catch(v){(s=!0)&&(yield Be(g.cancel(v)))}finally{s===!1?yield Be(g.cancel()):n.locked&&g.releaseLock()}return yield Be(null)})}class sx{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 Pe(this,void 0,void 0,function*(){const{reader:t,source:s}=this;t&&(yield t.cancel(e).catch(()=>{})),s&&s.locked&&this.releaseLock()})}read(e){return Pe(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};const t=yield this.reader.read();return!t.done&&(t.value=Je(t)),t})}}const hh=(n,e)=>{const t=a=>s([e,a]);let s;return[e,t,new Promise(a=>(s=a)&&n.once(e,t))]};function ox(n){return Qr(this,arguments,function*(){const t=[];let s="error",a=!1,u=null,d,f,p=0,m=[],g;function v(){return d==="peek"?Yr(m,f)[0]:([g,m,p]=Yr(m,f),g)}if({cmd:d,size:f}=(yield yield Be(null))||{cmd:"read",size:0},n.isTTY)return yield yield Be(new Uint8Array(0)),yield Be(null);try{t[0]=hh(n,"end"),t[1]=hh(n,"error");do{if(t[2]=hh(n,"readable"),[s,u]=yield Be(Promise.race(t.map(_=>_[2]))),s==="error")break;if((a=s==="end")||(Number.isFinite(f-p)?(g=Je(n.read(f-p)),g.byteLength<f-p&&(g=Je(n.read()))):g=Je(n.read()),g.byteLength>0&&(m.push(g),p+=g.byteLength)),a||f<=p)do({cmd:d,size:f}=yield yield Be(v()));while(f<p)}while(!a)}finally{yield Be(S(t,s==="error"?u:null))}return yield Be(null);function S(_,D){return g=m=null,new Promise((k,P)=>{for(const[B,V]of _)n.off(B,V);try{const B=n.destroy;B&&B.call(n,D),D=void 0}catch(B){D=B||D}finally{D!=null?P(D):k()}})}})}var Ut;(function(n){n[n.V1=0]="V1",n[n.V2=1]="V2",n[n.V3=2]="V3",n[n.V4=3]="V4",n[n.V5=4]="V5"})(Ut||(Ut={}));var Pn;(function(n){n[n.Sparse=0]="Sparse",n[n.Dense=1]="Dense"})(Pn||(Pn={}));var an;(function(n){n[n.HALF=0]="HALF",n[n.SINGLE=1]="SINGLE",n[n.DOUBLE=2]="DOUBLE"})(an||(an={}));var sr;(function(n){n[n.DAY=0]="DAY",n[n.MILLISECOND=1]="MILLISECOND"})(sr||(sr={}));var Ie;(function(n){n[n.SECOND=0]="SECOND",n[n.MILLISECOND=1]="MILLISECOND",n[n.MICROSECOND=2]="MICROSECOND",n[n.NANOSECOND=3]="NANOSECOND"})(Ie||(Ie={}));var Gr;(function(n){n[n.YEAR_MONTH=0]="YEAR_MONTH",n[n.DAY_TIME=1]="DAY_TIME",n[n.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Gr||(Gr={}));const ph=2,Vr=4,yi=4,st=4,es=new Int32Array(2),tv=new Float32Array(es.buffer),nv=new Float64Array(es.buffer),fc=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var zh;(function(n){n[n.UTF8_BYTES=1]="UTF8_BYTES",n[n.UTF16_STRING=2]="UTF16_STRING"})(zh||(zh={}));let ma=class K0{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new K0(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 es[0]=this.readInt32(e),tv[0]}readFloat64(e){return es[fc?0:1]=this.readInt32(e),es[fc?1:0]=this.readInt32(e+4),nv[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){tv[0]=t,this.writeInt32(e,es[0])}writeFloat64(e,t){nv[0]=t,this.writeInt32(e,es[fc?0:1]),this.writeInt32(e+4,es[fc?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+Vr+yi)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<yi;t++)e+=String.fromCharCode(this.readInt8(this.position_+Vr+t));return e}__offset(e,t){const s=e-this.readInt32(e);return t<this.readInt16(s)?this.readInt16(s+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);const s=this.readInt32(e);e+=Vr;const a=this.bytes_.subarray(e,e+s);return t===zh.UTF8_BYTES?a:this.text_decoder_.decode(a)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+Vr}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=yi)throw new Error("FlatBuffers: file identifier must be length "+yi);for(let t=0;t<yi;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+Vr+t))return!1;return!0}createScalarList(e,t){const s=[];for(let a=0;a<t;++a){const u=e(a);u!==null&&s.push(u)}return s}createObjList(e,t){const s=[];for(let a=0;a<t;++a){const u=e(a);u!==null&&s.push(u.unpack())}return s}},q0=class Y0{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 t;e?t=e:t=1024,this.bb=ma.allocate(t),this.space=t}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,t){e>this.minalign&&(this.minalign=e);const s=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<s+e+t;){const a=this.bb.capacity();this.bb=Y0.growByteBuffer(this.bb),this.space+=this.bb.capacity()-a}this.pad(s)}pad(e){for(let t=0;t<e;t++)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,t,s){(this.force_defaults||t!=s)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,s){(this.force_defaults||t!=s)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,s){(this.force_defaults||t!=s)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,s){(this.force_defaults||t!==s)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,s){(this.force_defaults||t!=s)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,s){(this.force_defaults||t!=s)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,s){(this.force_defaults||t!=s)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,s){t!=s&&(this.nested(t),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){const t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const s=t<<1,a=ma.allocate(s);return a.setPosition(s-t),a.bytes().set(e.bytes(),s-t),a}addOffset(e){this.prep(Vr,0),this.writeInt32(this.offset()-e+Vr)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const e=this.offset();let t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);const s=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);const a=2;this.addInt16(e-this.object_start);const u=(s+a)*ph;this.addInt16(u);let d=0;const f=this.space;e:for(t=0;t<this.vtables.length;t++){const p=this.bb.capacity()-this.vtables[t];if(u==this.bb.readInt16(p)){for(let m=ph;m<u;m+=ph)if(this.bb.readInt16(f+m)!=this.bb.readInt16(p+m))continue e;d=this.vtables[t];break}}return d?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,d-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,s){const a=s?st:0;if(t){const u=t;if(this.prep(this.minalign,Vr+yi+a),u.length!=yi)throw new TypeError("FlatBuffers: file identifier must be length "+yi);for(let d=yi-1;d>=0;d--)this.writeInt8(u.charCodeAt(d))}this.prep(this.minalign,Vr+a),this.addOffset(e),a&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){const s=this.bb.capacity()-e,a=s-this.bb.readInt32(s);if(!(t<this.bb.readInt16(a)&&this.bb.readInt16(a+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,s){this.notNested(),this.vector_num_elems=t,this.prep(Vr,e*t),this.prep(s,e*t)}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);const t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,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){const t=[];for(let s=0;s<e.length;++s){const a=e[s];if(a!==null)t.push(this.createObjectOffset(a));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}};var Pc;(function(n){n[n.BUFFER=0]="BUFFER"})(Pc||(Pc={}));var Tc;(function(n){n[n.LZ4_FRAME=0]="LZ4_FRAME",n[n.ZSTD=1]="ZSTD"})(Tc||(Tc={}));class ts{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new ts).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+st),(t||new ts).__init(e.readInt32(e.position())+e.position(),e)}codec(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Tc.LZ4_FRAME}method(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Pc.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,Tc.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,Pc.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,s){return ts.startBodyCompression(e),ts.addCodec(e,t),ts.addMethod(e,s),ts.endBodyCompression(e)}}class G0{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,s){return e.prep(8,16),e.writeInt64(BigInt(s??0)),e.writeInt64(BigInt(t??0)),e.offset()}}let J0=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,s){return e.prep(8,16),e.writeInt64(BigInt(s??0)),e.writeInt64(BigInt(t??0)),e.offset()}},di=class $h{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new $h).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+st),(t||new $h).__init(e.readInt32(e.position())+e.position(),e)}length(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){const s=this.bb.__offset(this.bb_pos,6);return s?(t||new J0).__init(this.bb.__vector(this.bb_pos+s)+e*16,this.bb):null}nodesLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){const s=this.bb.__offset(this.bb_pos,8);return s?(t||new G0).__init(this.bb.__vector(this.bb_pos+s)+e*16,this.bb):null}buffersLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){const t=this.bb.__offset(this.bb_pos,10);return t?(e||new ts).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static endRecordBatch(e){return e.endObject()}},Bo=class Vh{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new Vh).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+st),(t||new Vh).__init(e.readInt32(e.position())+e.position(),e)}id(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){const t=this.bb.__offset(this.bb_pos,6);return t?(e||new di).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){const e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}};var ya;(function(n){n[n.Little=0]="Little",n[n.Big=1]="Big"})(ya||(ya={}));var Nc;(function(n){n[n.DenseArray=0]="DenseArray"})(Nc||(Nc={}));class Hn{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new Hn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+st),(t||new Hn).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,s){return Hn.startInt(e),Hn.addBitWidth(e,t),Hn.addIsSigned(e,s),Hn.endInt(e)}}class gi{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new gi).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+st),(t||new gi).__init(e.readInt32(e.position())+e.position(),e)}id(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){const t=this.bb.__offset(this.bb_pos,6);return t?(e||new Hn).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){const e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Nc.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,Nc.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}class Wt{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new Wt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+st),(t||new Wt).__init(e.readInt32(e.position())+e.position(),e)}key(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,s){return Wt.startKeyValue(e),Wt.addKey(e,t),Wt.addValue(e,s),Wt.endKeyValue(e)}}let rv=class _l{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new _l).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+st),(t||new _l).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return _l.startBinary(e),_l.endBinary(e)}},iv=class bl{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new bl).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+st),(t||new bl).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return bl.startBool(e),bl.endBool(e)}},_c=class Uo{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new Uo).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+st),(t||new Uo).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):sr.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,sr.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return Uo.startDate(e),Uo.addUnit(e,t),Uo.endDate(e)}},jo=class Zi{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new Zi).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+st),(t||new Zi).__init(e.readInt32(e.position())+e.position(),e)}precision(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,s,a){return Zi.startDecimal(e),Zi.addPrecision(e,t),Zi.addScale(e,s),Zi.addBitWidth(e,a),Zi.endDecimal(e)}},bc=class zo{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new zo).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+st),(t||new zo).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ie.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Ie.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return zo.startDuration(e),zo.addUnit(e,t),zo.endDuration(e)}},Ic=class $o{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new $o).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+st),(t||new $o).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return $o.startFixedSizeBinary(e),$o.addByteWidth(e,t),$o.endFixedSizeBinary(e)}},Ec=class Vo{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new Vo).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+st),(t||new Vo).__init(e.readInt32(e.position())+e.position(),e)}listSize(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return Vo.startFixedSizeList(e),Vo.addListSize(e,t),Vo.endFixedSizeList(e)}};class Hr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+st),(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}precision(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):an.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,an.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return Hr.startFloatingPoint(e),Hr.addPrecision(e,t),Hr.endFloatingPoint(e)}}class Wr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+st),(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Gr.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Gr.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return Wr.startInterval(e),Wr.addUnit(e,t),Wr.endInterval(e)}}let sv=class Il{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new Il).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+st),(t||new Il).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return Il.startLargeBinary(e),Il.endLargeBinary(e)}},ov=class El{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new El).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+st),(t||new El).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return El.startLargeUtf8(e),El.endLargeUtf8(e)}},av=class xl{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new xl).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+st),(t||new xl).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return xl.startList(e),xl.endList(e)}},xc=class Ho{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new Ho).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+st),(t||new Ho).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){const e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return Ho.startMap(e),Ho.addKeysSorted(e,t),Ho.endMap(e)}},lv=class Dl{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new Dl).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+st),(t||new Dl).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return Dl.startNull(e),Dl.endNull(e)}};class Vs{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new Vs).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+st),(t||new Vs).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return Vs.startStruct_(e),Vs.endStruct_(e)}}class tr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new tr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+st),(t||new tr).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ie.MILLISECOND}bitWidth(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Ie.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,s){return tr.startTime(e),tr.addUnit(e,t),tr.addBitWidth(e,s),tr.endTime(e)}}class nr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new nr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+st),(t||new nr).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ie.SECOND}timezone(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Ie.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,s){return nr.startTimestamp(e),nr.addUnit(e,t),nr.addTimezone(e,s),nr.endTimestamp(e)}}class kn{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+st),(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}mode(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Pn.Sparse}typeIds(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){const e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,Pn.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addInt32(t[s]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,s){return kn.startUnion(e),kn.addMode(e,t),kn.addTypeIds(e,s),kn.endUnion(e)}}let uv=class Cl{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new Cl).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+st),(t||new Cl).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return Cl.startUtf8(e),Cl.endUtf8(e)}};var vt;(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.FloatingPoint=3]="FloatingPoint",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct_=13]="Struct_",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Duration=18]="Duration",n[n.LargeBinary=19]="LargeBinary",n[n.LargeUtf8=20]="LargeUtf8",n[n.LargeList=21]="LargeList",n[n.RunEndEncoded=22]="RunEndEncoded"})(vt||(vt={}));let Jn=class Dc{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new Dc).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+st),(t||new Dc).__init(e.readInt32(e.position())+e.position(),e)}name(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):vt.NONE}type(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){const t=this.bb.__offset(this.bb_pos,12);return t?(e||new gi).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){const s=this.bb.__offset(this.bb_pos,14);return s?(t||new Dc).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}childrenLength(){const e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){const s=this.bb.__offset(this.bb_pos,16);return s?(t||new Wt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,vt.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addOffset(t[s]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addOffset(t[s]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}},Br=class ci{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new ci).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+st),(t||new ci).__init(e.readInt32(e.position())+e.position(),e)}endianness(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ya.Little}fields(e,t){const s=this.bb.__offset(this.bb_pos,6);return s?(t||new Jn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}fieldsLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){const s=this.bb.__offset(this.bb_pos,8);return s?(t||new Wt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,ya.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addOffset(t[s]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addOffset(t[s]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let s=t.length-1;s>=0;s--)e.addInt64(t[s]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,s,a,u){return ci.startSchema(e),ci.addEndianness(e,t),ci.addFields(e,s),ci.addCustomMetadata(e,a),ci.addFeatures(e,u),ci.endSchema(e)}};var nt;(function(n){n[n.NONE=0]="NONE",n[n.Schema=1]="Schema",n[n.DictionaryBatch=2]="DictionaryBatch",n[n.RecordBatch=3]="RecordBatch",n[n.Tensor=4]="Tensor",n[n.SparseTensor=5]="SparseTensor"})(nt||(nt={}));var C;(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Duration=18]="Duration",n[n.LargeBinary=19]="LargeBinary",n[n.LargeUtf8=20]="LargeUtf8",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth",n[n.DurationSecond=-27]="DurationSecond",n[n.DurationMillisecond=-28]="DurationMillisecond",n[n.DurationMicrosecond=-29]="DurationMicrosecond",n[n.DurationNanosecond=-30]="DurationNanosecond"})(C||(C={}));var fi;(function(n){n[n.OFFSET=0]="OFFSET",n[n.DATA=1]="DATA",n[n.VALIDITY=2]="VALIDITY",n[n.TYPE=3]="TYPE"})(fi||(fi={}));const ax=void 0;function Pl(n){if(n===null)return"null";if(n===ax)return"undefined";switch(typeof n){case"number":return`${n}`;case"bigint":return`${n}`;case"string":return`"${n}"`}return typeof n[Symbol.toPrimitive]=="function"?n[Symbol.toPrimitive]("string"):ArrayBuffer.isView(n)?n instanceof BigInt64Array||n instanceof BigUint64Array?`[${[...n].map(e=>Pl(e))}]`:`[${n}]`:ArrayBuffer.isView(n)?`[${n}]`:JSON.stringify(n,(e,t)=>typeof t=="bigint"?`${t}`:t)}function It(n){if(typeof n=="bigint"&&(n<Number.MIN_SAFE_INTEGER||n>Number.MAX_SAFE_INTEGER))throw new TypeError(`${n} is not safe to convert to a number.`);return Number(n)}function X0(n,e){return It(n/e)+It(n%e)/It(e)}const lx=Symbol.for("isArrowBigNum");function Rr(n,...e){return e.length===0?Object.setPrototypeOf(ut(this.TypedArray,n),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(n,...e),this.constructor.prototype)}Rr.prototype[lx]=!0;Rr.prototype.toJSON=function(){return`"${Nl(this)}"`};Rr.prototype.valueOf=function(n){return Z0(this,n)};Rr.prototype.toString=function(){return Nl(this)};Rr.prototype[Symbol.toPrimitive]=function(n="default"){switch(n){case"number":return Z0(this);case"string":return Nl(this);case"default":return dx(this)}return Nl(this)};function Xo(...n){return Rr.apply(this,n)}function Zo(...n){return Rr.apply(this,n)}function Tl(...n){return Rr.apply(this,n)}Object.setPrototypeOf(Xo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Zo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Tl.prototype,Object.create(Uint32Array.prototype));Object.assign(Xo.prototype,Rr.prototype,{constructor:Xo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Zo.prototype,Rr.prototype,{constructor:Zo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Tl.prototype,Rr.prototype,{constructor:Tl,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const ux=BigInt(4294967296)*BigInt(4294967296),cx=ux-BigInt(1);function Z0(n,e){const{buffer:t,byteOffset:s,byteLength:a,signed:u}=n,d=new BigUint64Array(t,s,a/8),f=u&&d.at(-1)&BigInt(1)<<BigInt(63);let p=BigInt(0),m=0;if(f){for(const g of d)p|=(g^cx)*(BigInt(1)<<BigInt(64*m++));p*=BigInt(-1),p-=BigInt(1)}else for(const g of d)p|=g*(BigInt(1)<<BigInt(64*m++));if(typeof e=="number"){const g=BigInt(Math.pow(10,e)),v=p/g,S=p%g;return It(v)+It(S)/It(g)}return It(p)}function Nl(n){if(n.byteLength===8)return`${new n.BigIntArray(n.buffer,n.byteOffset,1)[0]}`;if(!n.signed)return mh(n);let e=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return mh(n);e=e.slice();let s=1;for(let u=0;u<e.length;u++){const d=e[u],f=~d+s;e[u]=f,s&=d===0?1:0}return`-${mh(e)}`}function dx(n){return n.byteLength===8?new n.BigIntArray(n.buffer,n.byteOffset,1)[0]:Nl(n)}function mh(n){let e="";const t=new Uint32Array(2);let s=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2);const a=new Uint32Array((s=new Uint16Array(s).reverse()).buffer);let u=-1;const d=s.length-1;do{for(t[0]=s[u=0];u<d;)s[u++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+s[u];s[u]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(a[0]||a[1]||a[2]||a[3]);return e??"0"}class wp{static new(e,t){switch(t){case!0:return new Xo(e);case!1:return new Zo(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Xo(e)}return e.byteLength===16?new Tl(e):new Zo(e)}static signed(e){return new Xo(e)}static unsigned(e){return new Zo(e)}static decimal(e){return new Tl(e)}constructor(e,t){return wp.new(e,t)}}var ew,tw,nw,rw,iw,sw,ow,aw,lw,uw,cw,dw,fw,hw,pw,mw,yw,gw,vw,ww,Sw,_w;class de{static isNull(e){return(e==null?void 0:e.typeId)===C.Null}static isInt(e){return(e==null?void 0:e.typeId)===C.Int}static isFloat(e){return(e==null?void 0:e.typeId)===C.Float}static isBinary(e){return(e==null?void 0:e.typeId)===C.Binary}static isLargeBinary(e){return(e==null?void 0:e.typeId)===C.LargeBinary}static isUtf8(e){return(e==null?void 0:e.typeId)===C.Utf8}static isLargeUtf8(e){return(e==null?void 0:e.typeId)===C.LargeUtf8}static isBool(e){return(e==null?void 0:e.typeId)===C.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===C.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===C.Date}static isTime(e){return(e==null?void 0:e.typeId)===C.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===C.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===C.Interval}static isDuration(e){return(e==null?void 0:e.typeId)===C.Duration}static isList(e){return(e==null?void 0:e.typeId)===C.List}static isStruct(e){return(e==null?void 0:e.typeId)===C.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===C.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===C.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===C.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===C.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===C.Dictionary}static isDenseUnion(e){return de.isUnion(e)&&e.mode===Pn.Dense}static isSparseUnion(e){return de.isUnion(e)&&e.mode===Pn.Sparse}constructor(e){this.typeId=e}}ew=Symbol.toStringTag;de[ew]=(n=>(n.children=null,n.ArrayType=Array,n.OffsetArrayType=Int32Array,n[Symbol.toStringTag]="DataType"))(de.prototype);class ms extends de{constructor(){super(C.Null)}toString(){return"Null"}}tw=Symbol.toStringTag;ms[tw]=(n=>n[Symbol.toStringTag]="Null")(ms.prototype);class to extends de{constructor(e,t){super(C.Int),this.isSigned=e,this.bitWidth=t}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}`}}nw=Symbol.toStringTag;to[nw]=(n=>(n.isSigned=null,n.bitWidth=null,n[Symbol.toStringTag]="Int"))(to.prototype);class Bl extends to{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Bl.prototype,"ArrayType",{value:Int32Array});class Bc extends de{constructor(e){super(C.Float),this.precision=e}get ArrayType(){switch(this.precision){case an.HALF:return Uint16Array;case an.SINGLE:return Float32Array;case an.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}rw=Symbol.toStringTag;Bc[rw]=(n=>(n.precision=null,n[Symbol.toStringTag]="Float"))(Bc.prototype);class Uc extends de{constructor(){super(C.Binary)}toString(){return"Binary"}}iw=Symbol.toStringTag;Uc[iw]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Binary"))(Uc.prototype);class jc extends de{constructor(){super(C.LargeBinary)}toString(){return"LargeBinary"}}sw=Symbol.toStringTag;jc[sw]=(n=>(n.ArrayType=Uint8Array,n.OffsetArrayType=BigInt64Array,n[Symbol.toStringTag]="LargeBinary"))(jc.prototype);class zc extends de{constructor(){super(C.Utf8)}toString(){return"Utf8"}}ow=Symbol.toStringTag;zc[ow]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Utf8"))(zc.prototype);class $c extends de{constructor(){super(C.LargeUtf8)}toString(){return"LargeUtf8"}}aw=Symbol.toStringTag;$c[aw]=(n=>(n.ArrayType=Uint8Array,n.OffsetArrayType=BigInt64Array,n[Symbol.toStringTag]="LargeUtf8"))($c.prototype);class Vc extends de{constructor(){super(C.Bool)}toString(){return"Bool"}}lw=Symbol.toStringTag;Vc[lw]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Bool"))(Vc.prototype);class Hc extends de{constructor(e,t,s=128){super(C.Decimal),this.scale=e,this.precision=t,this.bitWidth=s}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}uw=Symbol.toStringTag;Hc[uw]=(n=>(n.scale=null,n.precision=null,n.ArrayType=Uint32Array,n[Symbol.toStringTag]="Decimal"))(Hc.prototype);class Wc extends de{constructor(e){super(C.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${sr[this.unit]}>`}get ArrayType(){return this.unit===sr.DAY?Int32Array:BigInt64Array}}cw=Symbol.toStringTag;Wc[cw]=(n=>(n.unit=null,n[Symbol.toStringTag]="Date"))(Wc.prototype);class Qc extends de{constructor(e,t){super(C.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${Ie[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}dw=Symbol.toStringTag;Qc[dw]=(n=>(n.unit=null,n.bitWidth=null,n[Symbol.toStringTag]="Time"))(Qc.prototype);class Kc extends de{constructor(e,t){super(C.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${Ie[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}fw=Symbol.toStringTag;Kc[fw]=(n=>(n.unit=null,n.timezone=null,n.ArrayType=BigInt64Array,n[Symbol.toStringTag]="Timestamp"))(Kc.prototype);class qc extends de{constructor(e){super(C.Interval),this.unit=e}toString(){return`Interval<${Gr[this.unit]}>`}}hw=Symbol.toStringTag;qc[hw]=(n=>(n.unit=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Interval"))(qc.prototype);class Yc extends de{constructor(e){super(C.Duration),this.unit=e}toString(){return`Duration<${Ie[this.unit]}>`}}pw=Symbol.toStringTag;Yc[pw]=(n=>(n.unit=null,n.ArrayType=BigInt64Array,n[Symbol.toStringTag]="Duration"))(Yc.prototype);class Gc extends de{constructor(e){super(C.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}}mw=Symbol.toStringTag;Gc[mw]=(n=>(n.children=null,n[Symbol.toStringTag]="List"))(Gc.prototype);class gn extends de{constructor(e){super(C.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}}yw=Symbol.toStringTag;gn[yw]=(n=>(n.children=null,n[Symbol.toStringTag]="Struct"))(gn.prototype);class Jc extends de{constructor(e,t,s){super(C.Union),this.mode=e,this.children=s,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((a,u,d)=>(a[u]=d)&&a||a,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}}gw=Symbol.toStringTag;Jc[gw]=(n=>(n.mode=null,n.typeIds=null,n.children=null,n.typeIdToChildIndex=null,n.ArrayType=Int8Array,n[Symbol.toStringTag]="Union"))(Jc.prototype);class Xc extends de{constructor(e){super(C.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}vw=Symbol.toStringTag;Xc[vw]=(n=>(n.byteWidth=null,n.ArrayType=Uint8Array,n[Symbol.toStringTag]="FixedSizeBinary"))(Xc.prototype);class Zc extends de{constructor(e,t){super(C.FixedSizeList),this.listSize=e,this.children=[t]}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}>`}}ww=Symbol.toStringTag;Zc[ww]=(n=>(n.children=null,n.listSize=null,n[Symbol.toStringTag]="FixedSizeList"))(Zc.prototype);class ed extends de{constructor(e,t=!1){var s,a,u;if(super(C.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((s=e==null?void 0:e.type)===null||s===void 0)&&s.children)){const d=(a=e==null?void 0:e.type)===null||a===void 0?void 0:a.children[0];d&&(d.name="key");const f=(u=e==null?void 0:e.type)===null||u===void 0?void 0:u.children[1];f&&(f.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(", ")}}>`}}Sw=Symbol.toStringTag;ed[Sw]=(n=>(n.children=null,n.keysSorted=null,n[Symbol.toStringTag]="Map_"))(ed.prototype);const fx=(n=>()=>++n)(-1);class ga extends de{constructor(e,t,s,a){super(C.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=a||!1,this.id=s==null?fx():It(s)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}_w=Symbol.toStringTag;ga[_w]=(n=>(n.id=null,n.indices=null,n.isOrdered=null,n.dictionary=null,n[Symbol.toStringTag]="Dictionary"))(ga.prototype);function hi(n){const e=n;switch(n.typeId){case C.Decimal:return n.bitWidth/32;case C.Interval:return 1+e.unit;case C.FixedSizeList:return e.listSize;case C.FixedSizeBinary:return e.byteWidth;default:return 1}}class Ve{visitMany(e,...t){return e.map((s,a)=>this.visit(s,...t.map(u=>u[a])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return hx(this,e,t)}getVisitFnByTypeId(e,t=!0){return Wo(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}}function hx(n,e,t=!0){return typeof e=="number"?Wo(n,e,t):typeof e=="string"&&e in C?Wo(n,C[e],t):e&&e instanceof de?Wo(n,cv(e),t):e!=null&&e.type&&e.type instanceof de?Wo(n,cv(e.type),t):Wo(n,C.NONE,t)}function Wo(n,e,t=!0){let s=null;switch(e){case C.Null:s=n.visitNull;break;case C.Bool:s=n.visitBool;break;case C.Int:s=n.visitInt;break;case C.Int8:s=n.visitInt8||n.visitInt;break;case C.Int16:s=n.visitInt16||n.visitInt;break;case C.Int32:s=n.visitInt32||n.visitInt;break;case C.Int64:s=n.visitInt64||n.visitInt;break;case C.Uint8:s=n.visitUint8||n.visitInt;break;case C.Uint16:s=n.visitUint16||n.visitInt;break;case C.Uint32:s=n.visitUint32||n.visitInt;break;case C.Uint64:s=n.visitUint64||n.visitInt;break;case C.Float:s=n.visitFloat;break;case C.Float16:s=n.visitFloat16||n.visitFloat;break;case C.Float32:s=n.visitFloat32||n.visitFloat;break;case C.Float64:s=n.visitFloat64||n.visitFloat;break;case C.Utf8:s=n.visitUtf8;break;case C.LargeUtf8:s=n.visitLargeUtf8;break;case C.Binary:s=n.visitBinary;break;case C.LargeBinary:s=n.visitLargeBinary;break;case C.FixedSizeBinary:s=n.visitFixedSizeBinary;break;case C.Date:s=n.visitDate;break;case C.DateDay:s=n.visitDateDay||n.visitDate;break;case C.DateMillisecond:s=n.visitDateMillisecond||n.visitDate;break;case C.Timestamp:s=n.visitTimestamp;break;case C.TimestampSecond:s=n.visitTimestampSecond||n.visitTimestamp;break;case C.TimestampMillisecond:s=n.visitTimestampMillisecond||n.visitTimestamp;break;case C.TimestampMicrosecond:s=n.visitTimestampMicrosecond||n.visitTimestamp;break;case C.TimestampNanosecond:s=n.visitTimestampNanosecond||n.visitTimestamp;break;case C.Time:s=n.visitTime;break;case C.TimeSecond:s=n.visitTimeSecond||n.visitTime;break;case C.TimeMillisecond:s=n.visitTimeMillisecond||n.visitTime;break;case C.TimeMicrosecond:s=n.visitTimeMicrosecond||n.visitTime;break;case C.TimeNanosecond:s=n.visitTimeNanosecond||n.visitTime;break;case C.Decimal:s=n.visitDecimal;break;case C.List:s=n.visitList;break;case C.Struct:s=n.visitStruct;break;case C.Union:s=n.visitUnion;break;case C.DenseUnion:s=n.visitDenseUnion||n.visitUnion;break;case C.SparseUnion:s=n.visitSparseUnion||n.visitUnion;break;case C.Dictionary:s=n.visitDictionary;break;case C.Interval:s=n.visitInterval;break;case C.IntervalDayTime:s=n.visitIntervalDayTime||n.visitInterval;break;case C.IntervalYearMonth:s=n.visitIntervalYearMonth||n.visitInterval;break;case C.Duration:s=n.visitDuration;break;case C.DurationSecond:s=n.visitDurationSecond||n.visitDuration;break;case C.DurationMillisecond:s=n.visitDurationMillisecond||n.visitDuration;break;case C.DurationMicrosecond:s=n.visitDurationMicrosecond||n.visitDuration;break;case C.DurationNanosecond:s=n.visitDurationNanosecond||n.visitDuration;break;case C.FixedSizeList:s=n.visitFixedSizeList;break;case C.Map:s=n.visitMap;break}if(typeof s=="function")return s;if(!t)return()=>null;throw new Error(`Unrecognized type '${C[e]}'`)}function cv(n){switch(n.typeId){case C.Null:return C.Null;case C.Int:{const{bitWidth:e,isSigned:t}=n;switch(e){case 8:return t?C.Int8:C.Uint8;case 16:return t?C.Int16:C.Uint16;case 32:return t?C.Int32:C.Uint32;case 64:return t?C.Int64:C.Uint64}return C.Int}case C.Float:switch(n.precision){case an.HALF:return C.Float16;case an.SINGLE:return C.Float32;case an.DOUBLE:return C.Float64}return C.Float;case C.Binary:return C.Binary;case C.LargeBinary:return C.LargeBinary;case C.Utf8:return C.Utf8;case C.LargeUtf8:return C.LargeUtf8;case C.Bool:return C.Bool;case C.Decimal:return C.Decimal;case C.Time:switch(n.unit){case Ie.SECOND:return C.TimeSecond;case Ie.MILLISECOND:return C.TimeMillisecond;case Ie.MICROSECOND:return C.TimeMicrosecond;case Ie.NANOSECOND:return C.TimeNanosecond}return C.Time;case C.Timestamp:switch(n.unit){case Ie.SECOND:return C.TimestampSecond;case Ie.MILLISECOND:return C.TimestampMillisecond;case Ie.MICROSECOND:return C.TimestampMicrosecond;case Ie.NANOSECOND:return C.TimestampNanosecond}return C.Timestamp;case C.Date:switch(n.unit){case sr.DAY:return C.DateDay;case sr.MILLISECOND:return C.DateMillisecond}return C.Date;case C.Interval:switch(n.unit){case Gr.DAY_TIME:return C.IntervalDayTime;case Gr.YEAR_MONTH:return C.IntervalYearMonth}return C.Interval;case C.Duration:switch(n.unit){case Ie.SECOND:return C.DurationSecond;case Ie.MILLISECOND:return C.DurationMillisecond;case Ie.MICROSECOND:return C.DurationMicrosecond;case Ie.NANOSECOND:return C.DurationNanosecond}return C.Duration;case C.Map:return C.Map;case C.List:return C.List;case C.Struct:return C.Struct;case C.Union:switch(n.mode){case Pn.Dense:return C.DenseUnion;case Pn.Sparse:return C.SparseUnion}return C.Union;case C.FixedSizeBinary:return C.FixedSizeBinary;case C.FixedSizeList:return C.FixedSizeList;case C.Dictionary:return C.Dictionary}throw new Error(`Unrecognized type '${C[n.typeId]}'`)}Ve.prototype.visitInt8=null;Ve.prototype.visitInt16=null;Ve.prototype.visitInt32=null;Ve.prototype.visitInt64=null;Ve.prototype.visitUint8=null;Ve.prototype.visitUint16=null;Ve.prototype.visitUint32=null;Ve.prototype.visitUint64=null;Ve.prototype.visitFloat16=null;Ve.prototype.visitFloat32=null;Ve.prototype.visitFloat64=null;Ve.prototype.visitDateDay=null;Ve.prototype.visitDateMillisecond=null;Ve.prototype.visitTimestampSecond=null;Ve.prototype.visitTimestampMillisecond=null;Ve.prototype.visitTimestampMicrosecond=null;Ve.prototype.visitTimestampNanosecond=null;Ve.prototype.visitTimeSecond=null;Ve.prototype.visitTimeMillisecond=null;Ve.prototype.visitTimeMicrosecond=null;Ve.prototype.visitTimeNanosecond=null;Ve.prototype.visitDenseUnion=null;Ve.prototype.visitSparseUnion=null;Ve.prototype.visitIntervalDayTime=null;Ve.prototype.visitIntervalYearMonth=null;Ve.prototype.visitDuration=null;Ve.prototype.visitDurationSecond=null;Ve.prototype.visitDurationMillisecond=null;Ve.prototype.visitDurationMicrosecond=null;Ve.prototype.visitDurationNanosecond=null;const bw=new Float64Array(1),ko=new Uint32Array(bw.buffer);function Iw(n){const e=(n&31744)>>10,t=(n&1023)/1024,s=Math.pow(-1,(n&32768)>>15);switch(e){case 31:return s*(t?Number.NaN:1/0);case 0:return s*(t?6103515625e-14*t:0)}return s*Math.pow(2,e-15)*(1+t)}function px(n){if(n!==n)return 32256;bw[0]=n;const e=(ko[1]&2147483648)>>16&65535;let t=ko[1]&2146435072,s=0;return t>=1089470464?ko[0]>0?t=31744:(t=(t&2080374784)>>16,s=(ko[1]&1048575)>>10):t<=1056964608?(s=1048576+(ko[1]&1048575),s=1048576+(s<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,s=(ko[1]&1048575)+512>>10),e|t|s&65535}class Ee extends Ve{}function Ce(n){return(e,t,s)=>{if(e.setValid(t,s!=null))return n(e,t,s)}}const mx=(n,e,t)=>{n[e]=Math.floor(t/864e5)},Ew=(n,e,t,s)=>{if(t+1<e.length){const a=It(e[t]),u=It(e[t+1]);n.set(s.subarray(0,u-a),a)}},yx=({offset:n,values:e},t,s)=>{const a=n+t;s?e[a>>3]|=1<<a%8:e[a>>3]&=~(1<<a%8)},Ii=({values:n},e,t)=>{n[e]=t},Sp=({values:n},e,t)=>{n[e]=t},xw=({values:n},e,t)=>{n[e]=px(t)},gx=(n,e,t)=>{switch(n.type.precision){case an.HALF:return xw(n,e,t);case an.SINGLE:case an.DOUBLE:return Sp(n,e,t)}},Dw=({values:n},e,t)=>{mx(n,e,t.valueOf())},Cw=({values:n},e,t)=>{n[e]=BigInt(t)},vx=({stride:n,values:e},t,s)=>{e.set(s.subarray(0,n),n*t)},Ow=({values:n,valueOffsets:e},t,s)=>Ew(n,e,t,s),Rw=({values:n,valueOffsets:e},t,s)=>Ew(n,e,t,mp(s)),wx=(n,e,t)=>{n.type.unit===sr.DAY?Dw(n,e,t):Cw(n,e,t)},Fw=({values:n},e,t)=>{n[e]=BigInt(t/1e3)},Mw=({values:n},e,t)=>{n[e]=BigInt(t)},Lw=({values:n},e,t)=>{n[e]=BigInt(t*1e3)},Aw=({values:n},e,t)=>{n[e]=BigInt(t*1e6)},Sx=(n,e,t)=>{switch(n.type.unit){case Ie.SECOND:return Fw(n,e,t);case Ie.MILLISECOND:return Mw(n,e,t);case Ie.MICROSECOND:return Lw(n,e,t);case Ie.NANOSECOND:return Aw(n,e,t)}},kw=({values:n},e,t)=>{n[e]=t},Pw=({values:n},e,t)=>{n[e]=t},Tw=({values:n},e,t)=>{n[e]=t},Nw=({values:n},e,t)=>{n[e]=t},_x=(n,e,t)=>{switch(n.type.unit){case Ie.SECOND:return kw(n,e,t);case Ie.MILLISECOND:return Pw(n,e,t);case Ie.MICROSECOND:return Tw(n,e,t);case Ie.NANOSECOND:return Nw(n,e,t)}},bx=({values:n,stride:e},t,s)=>{n.set(s.subarray(0,e),e*t)},Ix=(n,e,t)=>{const s=n.children[0],a=n.valueOffsets,u=or.getVisitFn(s);if(Array.isArray(t))for(let d=-1,f=a[e],p=a[e+1];f<p;)u(s,f++,t[++d]);else for(let d=-1,f=a[e],p=a[e+1];f<p;)u(s,f++,t.get(++d))},Ex=(n,e,t)=>{const s=n.children[0],{valueOffsets:a}=n,u=or.getVisitFn(s);let{[e]:d,[e+1]:f}=a;const p=t instanceof Map?t.entries():Object.entries(t);for(const m of p)if(u(s,d,m),++d>=f)break},xx=(n,e)=>(t,s,a,u)=>s&&t(s,n,e[u]),Dx=(n,e)=>(t,s,a,u)=>s&&t(s,n,e.get(u)),Cx=(n,e)=>(t,s,a,u)=>s&&t(s,n,e.get(a.name)),Ox=(n,e)=>(t,s,a,u)=>s&&t(s,n,e[a.name]),Rx=(n,e,t)=>{const s=n.type.children.map(u=>or.getVisitFn(u.type)),a=t instanceof Map?Cx(e,t):t instanceof ht?Dx(e,t):Array.isArray(t)?xx(e,t):Ox(e,t);n.type.children.forEach((u,d)=>a(s[d],n.children[d],u,d))},Fx=(n,e,t)=>{n.type.mode===Pn.Dense?Bw(n,e,t):Uw(n,e,t)},Bw=(n,e,t)=>{const s=n.type.typeIdToChildIndex[n.typeIds[e]],a=n.children[s];or.visit(a,n.valueOffsets[e],t)},Uw=(n,e,t)=>{const s=n.type.typeIdToChildIndex[n.typeIds[e]],a=n.children[s];or.visit(a,e,t)},Mx=(n,e,t)=>{var s;(s=n.dictionary)===null||s===void 0||s.set(n.values[e],t)},Lx=(n,e,t)=>{n.type.unit===Gr.DAY_TIME?jw(n,e,t):zw(n,e,t)},jw=({values:n},e,t)=>{n.set(t.subarray(0,2),2*e)},zw=({values:n},e,t)=>{n[e]=t[0]*12+t[1]%12},$w=({values:n},e,t)=>{n[e]=t},Vw=({values:n},e,t)=>{n[e]=t},Hw=({values:n},e,t)=>{n[e]=t},Ww=({values:n},e,t)=>{n[e]=t},Ax=(n,e,t)=>{switch(n.type.unit){case Ie.SECOND:return $w(n,e,t);case Ie.MILLISECOND:return Vw(n,e,t);case Ie.MICROSECOND:return Hw(n,e,t);case Ie.NANOSECOND:return Ww(n,e,t)}},kx=(n,e,t)=>{const{stride:s}=n,a=n.children[0],u=or.getVisitFn(a);if(Array.isArray(t))for(let d=-1,f=e*s;++d<s;)u(a,f+d,t[d]);else for(let d=-1,f=e*s;++d<s;)u(a,f+d,t.get(d))};Ee.prototype.visitBool=Ce(yx);Ee.prototype.visitInt=Ce(Ii);Ee.prototype.visitInt8=Ce(Ii);Ee.prototype.visitInt16=Ce(Ii);Ee.prototype.visitInt32=Ce(Ii);Ee.prototype.visitInt64=Ce(Ii);Ee.prototype.visitUint8=Ce(Ii);Ee.prototype.visitUint16=Ce(Ii);Ee.prototype.visitUint32=Ce(Ii);Ee.prototype.visitUint64=Ce(Ii);Ee.prototype.visitFloat=Ce(gx);Ee.prototype.visitFloat16=Ce(xw);Ee.prototype.visitFloat32=Ce(Sp);Ee.prototype.visitFloat64=Ce(Sp);Ee.prototype.visitUtf8=Ce(Rw);Ee.prototype.visitLargeUtf8=Ce(Rw);Ee.prototype.visitBinary=Ce(Ow);Ee.prototype.visitLargeBinary=Ce(Ow);Ee.prototype.visitFixedSizeBinary=Ce(vx);Ee.prototype.visitDate=Ce(wx);Ee.prototype.visitDateDay=Ce(Dw);Ee.prototype.visitDateMillisecond=Ce(Cw);Ee.prototype.visitTimestamp=Ce(Sx);Ee.prototype.visitTimestampSecond=Ce(Fw);Ee.prototype.visitTimestampMillisecond=Ce(Mw);Ee.prototype.visitTimestampMicrosecond=Ce(Lw);Ee.prototype.visitTimestampNanosecond=Ce(Aw);Ee.prototype.visitTime=Ce(_x);Ee.prototype.visitTimeSecond=Ce(kw);Ee.prototype.visitTimeMillisecond=Ce(Pw);Ee.prototype.visitTimeMicrosecond=Ce(Tw);Ee.prototype.visitTimeNanosecond=Ce(Nw);Ee.prototype.visitDecimal=Ce(bx);Ee.prototype.visitList=Ce(Ix);Ee.prototype.visitStruct=Ce(Rx);Ee.prototype.visitUnion=Ce(Fx);Ee.prototype.visitDenseUnion=Ce(Bw);Ee.prototype.visitSparseUnion=Ce(Uw);Ee.prototype.visitDictionary=Ce(Mx);Ee.prototype.visitInterval=Ce(Lx);Ee.prototype.visitIntervalDayTime=Ce(jw);Ee.prototype.visitIntervalYearMonth=Ce(zw);Ee.prototype.visitDuration=Ce(Ax);Ee.prototype.visitDurationSecond=Ce($w);Ee.prototype.visitDurationMillisecond=Ce(Vw);Ee.prototype.visitDurationMicrosecond=Ce(Hw);Ee.prototype.visitDurationNanosecond=Ce(Ww);Ee.prototype.visitFixedSizeList=Ce(kx);Ee.prototype.visitMap=Ce(Ex);const or=new Ee,br=Symbol.for("parent"),ea=Symbol.for("rowIndex");class _p{constructor(e,t){return this[br]=e,this[ea]=t,new Proxy(this,Nx)}toArray(){return Object.values(this.toJSON())}toJSON(){const e=this[ea],t=this[br],s=t.type.children,a={};for(let u=-1,d=s.length;++u<d;)a[s[u].name]=Tn.visit(t.children[u],e);return a}toString(){return`{${[...this].map(([e,t])=>`${Pl(e)}: ${Pl(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Px(this[br],this[ea])}}class Px{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,Tn.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(_p.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[br]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ea]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class Tx{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[br].type.children.map(t=>t.name)}has(e,t){return e[br].type.children.some(s=>s.name===t)}getOwnPropertyDescriptor(e,t){if(e[br].type.children.some(s=>s.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];const s=e[br].type.children.findIndex(a=>a.name===t);if(s!==-1){const a=Tn.visit(e[br].children[s],e[ea]);return Reflect.set(e,t,a),a}}set(e,t,s){const a=e[br].type.children.findIndex(u=>u.name===t);return a!==-1?(or.visit(e[br].children[a],e[ea],s),Reflect.set(e,t,s)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,s):!1}}const Nx=new Tx;class ve extends Ve{}function xe(n){return(e,t)=>e.getValid(t)?n(e,t):null}const Bx=(n,e)=>864e5*n[e],Ux=(n,e)=>null,Qw=(n,e,t)=>{if(t+1>=e.length)return null;const s=It(e[t]),a=It(e[t+1]);return n.subarray(s,a)},jx=({offset:n,values:e},t)=>{const s=n+t;return(e[s>>3]&1<<s%8)!==0},Kw=({values:n},e)=>Bx(n,e),qw=({values:n},e)=>It(n[e]),vs=({stride:n,values:e},t)=>e[n*t],zx=({stride:n,values:e},t)=>Iw(e[n*t]),Yw=({values:n},e)=>n[e],$x=({stride:n,values:e},t)=>e.subarray(n*t,n*(t+1)),Gw=({values:n,valueOffsets:e},t)=>Qw(n,e,t),Jw=({values:n,valueOffsets:e},t)=>{const s=Qw(n,e,t);return s!==null?Bh(s):null},Vx=({values:n},e)=>n[e],Hx=({type:n,values:e},t)=>n.precision!==an.HALF?e[t]:Iw(e[t]),Wx=(n,e)=>n.type.unit===sr.DAY?Kw(n,e):qw(n,e),Xw=({values:n},e)=>1e3*It(n[e]),Zw=({values:n},e)=>It(n[e]),eS=({values:n},e)=>X0(n[e],BigInt(1e3)),tS=({values:n},e)=>X0(n[e],BigInt(1e6)),Qx=(n,e)=>{switch(n.type.unit){case Ie.SECOND:return Xw(n,e);case Ie.MILLISECOND:return Zw(n,e);case Ie.MICROSECOND:return eS(n,e);case Ie.NANOSECOND:return tS(n,e)}},nS=({values:n},e)=>n[e],rS=({values:n},e)=>n[e],iS=({values:n},e)=>n[e],sS=({values:n},e)=>n[e],Kx=(n,e)=>{switch(n.type.unit){case Ie.SECOND:return nS(n,e);case Ie.MILLISECOND:return rS(n,e);case Ie.MICROSECOND:return iS(n,e);case Ie.NANOSECOND:return sS(n,e)}},qx=({values:n,stride:e},t)=>wp.decimal(n.subarray(e*t,e*(t+1))),Yx=(n,e)=>{const{valueOffsets:t,stride:s,children:a}=n,{[e*s]:u,[e*s+1]:d}=t,p=a[0].slice(u,d-u);return new ht([p])},Gx=(n,e)=>{const{valueOffsets:t,children:s}=n,{[e]:a,[e+1]:u}=t,d=s[0];return new bp(d.slice(a,u-a))},Jx=(n,e)=>new _p(n,e),Xx=(n,e)=>n.type.mode===Pn.Dense?oS(n,e):aS(n,e),oS=(n,e)=>{const t=n.type.typeIdToChildIndex[n.typeIds[e]],s=n.children[t];return Tn.visit(s,n.valueOffsets[e])},aS=(n,e)=>{const t=n.type.typeIdToChildIndex[n.typeIds[e]],s=n.children[t];return Tn.visit(s,e)},Zx=(n,e)=>{var t;return(t=n.dictionary)===null||t===void 0?void 0:t.get(n.values[e])},eD=(n,e)=>n.type.unit===Gr.DAY_TIME?lS(n,e):uS(n,e),lS=({values:n},e)=>n.subarray(2*e,2*(e+1)),uS=({values:n},e)=>{const t=n[e],s=new Int32Array(2);return s[0]=Math.trunc(t/12),s[1]=Math.trunc(t%12),s},cS=({values:n},e)=>n[e],dS=({values:n},e)=>n[e],fS=({values:n},e)=>n[e],hS=({values:n},e)=>n[e],tD=(n,e)=>{switch(n.type.unit){case Ie.SECOND:return cS(n,e);case Ie.MILLISECOND:return dS(n,e);case Ie.MICROSECOND:return fS(n,e);case Ie.NANOSECOND:return hS(n,e)}},nD=(n,e)=>{const{stride:t,children:s}=n,u=s[0].slice(e*t,t);return new ht([u])};ve.prototype.visitNull=xe(Ux);ve.prototype.visitBool=xe(jx);ve.prototype.visitInt=xe(Vx);ve.prototype.visitInt8=xe(vs);ve.prototype.visitInt16=xe(vs);ve.prototype.visitInt32=xe(vs);ve.prototype.visitInt64=xe(Yw);ve.prototype.visitUint8=xe(vs);ve.prototype.visitUint16=xe(vs);ve.prototype.visitUint32=xe(vs);ve.prototype.visitUint64=xe(Yw);ve.prototype.visitFloat=xe(Hx);ve.prototype.visitFloat16=xe(zx);ve.prototype.visitFloat32=xe(vs);ve.prototype.visitFloat64=xe(vs);ve.prototype.visitUtf8=xe(Jw);ve.prototype.visitLargeUtf8=xe(Jw);ve.prototype.visitBinary=xe(Gw);ve.prototype.visitLargeBinary=xe(Gw);ve.prototype.visitFixedSizeBinary=xe($x);ve.prototype.visitDate=xe(Wx);ve.prototype.visitDateDay=xe(Kw);ve.prototype.visitDateMillisecond=xe(qw);ve.prototype.visitTimestamp=xe(Qx);ve.prototype.visitTimestampSecond=xe(Xw);ve.prototype.visitTimestampMillisecond=xe(Zw);ve.prototype.visitTimestampMicrosecond=xe(eS);ve.prototype.visitTimestampNanosecond=xe(tS);ve.prototype.visitTime=xe(Kx);ve.prototype.visitTimeSecond=xe(nS);ve.prototype.visitTimeMillisecond=xe(rS);ve.prototype.visitTimeMicrosecond=xe(iS);ve.prototype.visitTimeNanosecond=xe(sS);ve.prototype.visitDecimal=xe(qx);ve.prototype.visitList=xe(Yx);ve.prototype.visitStruct=xe(Jx);ve.prototype.visitUnion=xe(Xx);ve.prototype.visitDenseUnion=xe(oS);ve.prototype.visitSparseUnion=xe(aS);ve.prototype.visitDictionary=xe(Zx);ve.prototype.visitInterval=xe(eD);ve.prototype.visitIntervalDayTime=xe(lS);ve.prototype.visitIntervalYearMonth=xe(uS);ve.prototype.visitDuration=xe(tD);ve.prototype.visitDurationSecond=xe(cS);ve.prototype.visitDurationMillisecond=xe(dS);ve.prototype.visitDurationMicrosecond=xe(fS);ve.prototype.visitDurationNanosecond=xe(hS);ve.prototype.visitFixedSizeList=xe(nD);ve.prototype.visitMap=xe(Gx);const Tn=new ve,Qo=Symbol.for("keys"),ta=Symbol.for("vals"),Ko=Symbol.for("kKeysAsStrings"),Hh=Symbol.for("_kKeysAsStrings");class bp{constructor(e){return this[Qo]=new ht([e.children[0]]).memoize(),this[ta]=e.children[1],new Proxy(this,new iD)}get[Ko](){return this[Hh]||(this[Hh]=Array.from(this[Qo].toArray(),String))}[Symbol.iterator](){return new rD(this[Qo],this[ta])}get size(){return this[Qo].length}toArray(){return Object.values(this.toJSON())}toJSON(){const e=this[Qo],t=this[ta],s={};for(let a=-1,u=e.length;++a<u;)s[e.get(a)]=Tn.visit(t,a);return s}toString(){return`{${[...this].map(([e,t])=>`${Pl(e)}: ${Pl(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class rD{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){const e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),Tn.visit(this.vals,e)]})}}class iD{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Ko]}has(e,t){return e[Ko].includes(t)}getOwnPropertyDescriptor(e,t){if(e[Ko].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];const s=e[Ko].indexOf(t);if(s!==-1){const a=Tn.visit(Reflect.get(e,ta),s);return Reflect.set(e,t,a),a}}set(e,t,s){const a=e[Ko].indexOf(t);return a!==-1?(or.visit(Reflect.get(e,ta),a,s),Reflect.set(e,t,s)):Reflect.has(e,t)?Reflect.set(e,t,s):!1}}Object.defineProperties(bp.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Qo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ta]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let dv;function pS(n,e,t,s){const{length:a=0}=n;let u=typeof e!="number"?0:e,d=typeof t!="number"?a:t;return u<0&&(u=(u%a+a)%a),d<0&&(d=(d%a+a)%a),d<u&&(dv=u,u=d,d=dv),d>a&&(d=a),s?s(n,u,d):[u,d]}const Ip=(n,e)=>n<0?e+n:n,fv=n=>n!==n;function ba(n){if(typeof n!=="object"||n===null)return fv(n)?fv:t=>t===n;if(n instanceof Date){const t=n.valueOf();return s=>s instanceof Date?s.valueOf()===t:!1}return ArrayBuffer.isView(n)?t=>t?tx(n,t):!1:n instanceof Map?oD(n):Array.isArray(n)?sD(n):n instanceof ht?aD(n):lD(n,!0)}function sD(n){const e=[];for(let t=-1,s=n.length;++t<s;)e[t]=ba(n[t]);return md(e)}function oD(n){let e=-1;const t=[];for(const s of n.values())t[++e]=ba(s);return md(t)}function aD(n){const e=[];for(let t=-1,s=n.length;++t<s;)e[t]=ba(n.get(t));return md(e)}function lD(n,e=!1){const t=Object.keys(n);if(!e&&t.length===0)return()=>!1;const s=[];for(let a=-1,u=t.length;++a<u;)s[a]=ba(n[t[a]]);return md(s,t)}function md(n,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return uD(n,t);case Map:return hv(n,t,t.keys());case bp:case _p:case Object:case void 0:return hv(n,t,e||Object.keys(t))}return t instanceof ht?cD(n,t):!1}}function uD(n,e){const t=n.length;if(e.length!==t)return!1;for(let s=-1;++s<t;)if(!n[s](e[s]))return!1;return!0}function cD(n,e){const t=n.length;if(e.length!==t)return!1;for(let s=-1;++s<t;)if(!n[s](e.get(s)))return!1;return!0}function hv(n,e,t){const s=t[Symbol.iterator](),a=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),u=e instanceof Map?e.values():Object.values(e)[Symbol.iterator]();let d=0;const f=n.length;let p=u.next(),m=s.next(),g=a.next();for(;d<f&&!m.done&&!g.done&&!p.done&&!(m.value!==g.value||!n[d](p.value));++d,m=s.next(),g=a.next(),p=u.next());return d===f&&m.done&&g.done&&p.done?!0:(s.return&&s.return(),a.return&&a.return(),u.return&&u.return(),!1)}function mS(n,e,t,s){return(t&1<<s)!==0}function dD(n,e,t,s){return(t&1<<s)>>s}function pv(n,e,t){const s=t.byteLength+7&-8;if(n>0||t.byteLength<s){const a=new Uint8Array(s);return a.set(n%8===0?t.subarray(n>>3):Wh(new Ep(t,n,e,null,mS)).subarray(0,s)),a}return t}function Wh(n){const e=[];let t=0,s=0,a=0;for(const d of n)d&&(a|=1<<s),++s===8&&(e[t++]=a,a=s=0);(t===0||s>0)&&(e[t++]=a);const u=new Uint8Array(e.length+7&-8);return u.set(e),u}class Ep{constructor(e,t,s,a,u){this.bytes=e,this.length=s,this.context=a,this.get=u,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function Qh(n,e,t){if(t-e<=0)return 0;if(t-e<8){let u=0;for(const d of new Ep(n,e,t-e,n,dD))u+=d;return u}const s=t>>3<<3,a=e+(e%8===0?0:8-e%8);return Qh(n,e,a)+Qh(n,s,t)+fD(n,a>>3,s-a>>3)}function fD(n,e,t){let s=0,a=Math.trunc(e);const u=new DataView(n.buffer,n.byteOffset,n.byteLength),d=t===void 0?n.byteLength:a+t;for(;d-a>=4;)s+=yh(u.getUint32(a)),a+=4;for(;d-a>=2;)s+=yh(u.getUint16(a)),a+=2;for(;d-a>=1;)s+=yh(u.getUint8(a)),a+=1;return s}function yh(n){let e=Math.trunc(n);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}const hD=-1;let wt=class Kh{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:e}=this;return de.isSparseUnion(e)?this.children.some(t=>t.nullable):de.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0;const{valueOffsets:t,values:s,nullBitmap:a,typeIds:u}=this;return t&&(e+=t.byteLength),s&&(e+=s.byteLength),a&&(e+=a.byteLength),u&&(e+=u.byteLength),this.children.reduce((d,f)=>d+f.byteLength,e)}get nullCount(){if(de.isUnion(this.type))return this.children.reduce((s,a)=>s+a.nullCount,0);let e=this._nullCount,t;return e<=hD&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Qh(t,this.offset,this.offset+this.length)),e}constructor(e,t,s,a,u,d=[],f){this.type=e,this.children=d,this.dictionary=f,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(s||0,0)),this._nullCount=Math.floor(Math.max(a||0,-1));let p;u instanceof Kh?(this.stride=u.stride,this.values=u.values,this.typeIds=u.typeIds,this.nullBitmap=u.nullBitmap,this.valueOffsets=u.valueOffsets):(this.stride=hi(e),u&&((p=u[0])&&(this.valueOffsets=p),(p=u[1])&&(this.values=p),(p=u[2])&&(this.nullBitmap=p),(p=u[3])&&(this.typeIds=p)))}getValid(e){const{type:t}=this;if(de.isUnion(t)){const s=t,a=this.children[s.typeIdToChildIndex[this.typeIds[e]]],u=s.mode===Pn.Dense?this.valueOffsets[e]:e;return a.getValid(u)}if(this.nullable&&this.nullCount>0){const s=this.offset+e;return(this.nullBitmap[s>>3]&1<<s%8)!==0}return!0}setValid(e,t){let s;const{type:a}=this;if(de.isUnion(a)){const u=a,d=this.children[u.typeIdToChildIndex[this.typeIds[e]]],f=u.mode===Pn.Dense?this.valueOffsets[e]:e;s=d.getValid(f),d.setValid(f,t)}else{let{nullBitmap:u}=this;const{offset:d,length:f}=this,p=d+e,m=1<<p%8,g=p>>3;(!u||u.byteLength<=g)&&(u=new Uint8Array((d+f+63&-64)>>3).fill(255),this.nullCount>0?(u.set(pv(d,f,this.nullBitmap),0),Object.assign(this,{nullBitmap:u})):Object.assign(this,{nullBitmap:u,_nullCount:0}));const v=u[g];s=(v&m)!==0,u[g]=t?v|m:v&~m}return s!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,s=this.length,a=this._nullCount,u=this,d=this.children){return new Kh(e,t,s,a,u,d,this.dictionary)}slice(e,t){const{stride:s,typeId:a,children:u}=this,d=+(this._nullCount===0)-1,f=a===16?s:1,p=this._sliceBuffers(e,t,s,a);return this.clone(this.type,this.offset+e,t,d,p,u.length===0||this.valueOffsets?u:this._sliceChildren(u,f*e,f*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===C.Null)return this.clone(this.type,0,e,0);const{length:t,nullCount:s}=this,a=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);a[t>>3]=(1<<t-(t&-8))-1,s>0&&a.set(pv(this.offset,t,this.nullBitmap),0);const u=this.buffers;return u[fi.VALIDITY]=a,this.clone(this.type,0,e,s+(e-t),u)}_sliceBuffers(e,t,s,a){let u;const{buffers:d}=this;return(u=d[fi.TYPE])&&(d[fi.TYPE]=u.subarray(e,e+t)),(u=d[fi.OFFSET])&&(d[fi.OFFSET]=u.subarray(e,e+t+1))||(u=d[fi.DATA])&&(d[fi.DATA]=a===6?u:u.subarray(s*e,s*(e+t))),d}_sliceChildren(e,t,s){return e.map(a=>a.slice(t,s))}};wt.prototype.children=Object.freeze([]);class Fl extends Ve{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){const{["type"]:t,["offset"]:s=0,["length"]:a=0}=e;return new wt(t,s,a,a)}visitBool(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length>>3,["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitInt(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length,["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitFloat(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length,["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitUtf8(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.data),u=Je(e.nullBitmap),d=yl(e.valueOffsets),{["length"]:f=d.length-1,["nullCount"]:p=e.nullBitmap?-1:0}=e;return new wt(t,s,f,p,[d,a,u])}visitLargeUtf8(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.data),u=Je(e.nullBitmap),d=ev(e.valueOffsets),{["length"]:f=d.length-1,["nullCount"]:p=e.nullBitmap?-1:0}=e;return new wt(t,s,f,p,[d,a,u])}visitBinary(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.data),u=Je(e.nullBitmap),d=yl(e.valueOffsets),{["length"]:f=d.length-1,["nullCount"]:p=e.nullBitmap?-1:0}=e;return new wt(t,s,f,p,[d,a,u])}visitLargeBinary(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.data),u=Je(e.nullBitmap),d=ev(e.valueOffsets),{["length"]:f=d.length-1,["nullCount"]:p=e.nullBitmap?-1:0}=e;return new wt(t,s,f,p,[d,a,u])}visitFixedSizeBinary(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length/hi(t),["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitDate(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length/hi(t),["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitTimestamp(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length/hi(t),["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitTime(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length/hi(t),["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitDecimal(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length/hi(t),["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitList(e){const{["type"]:t,["offset"]:s=0,["child"]:a}=e,u=Je(e.nullBitmap),d=yl(e.valueOffsets),{["length"]:f=d.length-1,["nullCount"]:p=e.nullBitmap?-1:0}=e;return new wt(t,s,f,p,[d,void 0,u],[a])}visitStruct(e){const{["type"]:t,["offset"]:s=0,["children"]:a=[]}=e,u=Je(e.nullBitmap),{length:d=a.reduce((p,{length:m})=>Math.max(p,m),0),nullCount:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,void 0,u],a)}visitUnion(e){const{["type"]:t,["offset"]:s=0,["children"]:a=[]}=e,u=ut(t.ArrayType,e.typeIds),{["length"]:d=u.length,["nullCount"]:f=-1}=e;if(de.isSparseUnion(t))return new wt(t,s,d,f,[void 0,void 0,void 0,u],a);const p=yl(e.valueOffsets);return new wt(t,s,d,f,[p,void 0,void 0,u],a)}visitDictionary(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.indices.ArrayType,e.data),{["dictionary"]:d=new ht([new Fl().visit({type:t.dictionary})])}=e,{["length"]:f=u.length,["nullCount"]:p=e.nullBitmap?-1:0}=e;return new wt(t,s,f,p,[void 0,u,a],[],d)}visitInterval(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length/hi(t),["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitDuration(e){const{["type"]:t,["offset"]:s=0}=e,a=Je(e.nullBitmap),u=ut(t.ArrayType,e.data),{["length"]:d=u.length,["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,u,a])}visitFixedSizeList(e){const{["type"]:t,["offset"]:s=0,["child"]:a=new Fl().visit({type:t.valueType})}=e,u=Je(e.nullBitmap),{["length"]:d=a.length/hi(t),["nullCount"]:f=e.nullBitmap?-1:0}=e;return new wt(t,s,d,f,[void 0,void 0,u],[a])}visitMap(e){const{["type"]:t,["offset"]:s=0,["child"]:a=new Fl().visit({type:t.childType})}=e,u=Je(e.nullBitmap),d=yl(e.valueOffsets),{["length"]:f=d.length-1,["nullCount"]:p=e.nullBitmap?-1:0}=e;return new wt(t,s,f,p,[d,void 0,u],[a])}}const pD=new Fl;function $e(n){return pD.visit(n)}class mv{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const 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 mD(n){return n.some(e=>e.nullable)}function yS(n){return n.reduce((e,t)=>e+t.nullCount,0)}function gS(n){return n.reduce((e,t,s)=>(e[s+1]=e[s]+t.length,e),new Uint32Array(n.length+1))}function vS(n,e,t,s){const a=[];for(let u=-1,d=n.length;++u<d;){const f=n[u],p=e[u],{length:m}=f;if(p>=s)break;if(t>=p+m)continue;if(p>=t&&p+m<=s){a.push(f);continue}const g=Math.max(0,t-p),v=Math.min(s-p,m);a.push(f.slice(g,v-g))}return a.length===0&&a.push(n[0].slice(0,0)),a}function xp(n,e,t,s){let a=0,u=0,d=e.length-1;do{if(a>=d-1)return t<e[d]?s(n,a,t-e[a]):null;u=a+Math.trunc((d-a)*.5),t<e[u]?d=u:a=u}while(a<d)}function Dp(n,e){return n.getValid(e)}function td(n){function e(t,s,a){return n(t[s],a)}return function(t){const s=this.data;return xp(s,this._offsets,t,e)}}function wS(n){let e;function t(s,a,u){return n(s[a],u,e)}return function(s,a){const u=this.data;e=a;const d=xp(u,this._offsets,s,t);return e=void 0,d}}function SS(n){let e;function t(s,a,u){let d=u,f=0,p=0;for(let m=a-1,g=s.length;++m<g;){const v=s[m];if(~(f=n(v,e,d)))return p+f;d=0,p+=v.length}return-1}return function(s,a){e=s;const u=this.data,d=typeof a!="number"?t(u,0,0):xp(u,this._offsets,a,t);return e=void 0,d}}class we extends Ve{}function yD(n,e){return e===null&&n.length>0?0:-1}function gD(n,e){const{nullBitmap:t}=n;if(!t||n.nullCount<=0)return-1;let s=0;for(const a of new Ep(t,n.offset+(e||0),n.length,t,mS)){if(!a)return s;++s}return-1}function Fe(n,e,t){if(e===void 0)return-1;if(e===null)switch(n.typeId){case C.Union:break;case C.Dictionary:break;default:return gD(n,t)}const s=Tn.getVisitFn(n),a=ba(e);for(let u=(t||0)-1,d=n.length;++u<d;)if(a(s(n,u)))return u;return-1}function _S(n,e,t){const s=Tn.getVisitFn(n),a=ba(e);for(let u=(t||0)-1,d=n.length;++u<d;)if(a(s(n,u)))return u;return-1}we.prototype.visitNull=yD;we.prototype.visitBool=Fe;we.prototype.visitInt=Fe;we.prototype.visitInt8=Fe;we.prototype.visitInt16=Fe;we.prototype.visitInt32=Fe;we.prototype.visitInt64=Fe;we.prototype.visitUint8=Fe;we.prototype.visitUint16=Fe;we.prototype.visitUint32=Fe;we.prototype.visitUint64=Fe;we.prototype.visitFloat=Fe;we.prototype.visitFloat16=Fe;we.prototype.visitFloat32=Fe;we.prototype.visitFloat64=Fe;we.prototype.visitUtf8=Fe;we.prototype.visitLargeUtf8=Fe;we.prototype.visitBinary=Fe;we.prototype.visitLargeBinary=Fe;we.prototype.visitFixedSizeBinary=Fe;we.prototype.visitDate=Fe;we.prototype.visitDateDay=Fe;we.prototype.visitDateMillisecond=Fe;we.prototype.visitTimestamp=Fe;we.prototype.visitTimestampSecond=Fe;we.prototype.visitTimestampMillisecond=Fe;we.prototype.visitTimestampMicrosecond=Fe;we.prototype.visitTimestampNanosecond=Fe;we.prototype.visitTime=Fe;we.prototype.visitTimeSecond=Fe;we.prototype.visitTimeMillisecond=Fe;we.prototype.visitTimeMicrosecond=Fe;we.prototype.visitTimeNanosecond=Fe;we.prototype.visitDecimal=Fe;we.prototype.visitList=Fe;we.prototype.visitStruct=Fe;we.prototype.visitUnion=Fe;we.prototype.visitDenseUnion=_S;we.prototype.visitSparseUnion=_S;we.prototype.visitDictionary=Fe;we.prototype.visitInterval=Fe;we.prototype.visitIntervalDayTime=Fe;we.prototype.visitIntervalYearMonth=Fe;we.prototype.visitDuration=Fe;we.prototype.visitDurationSecond=Fe;we.prototype.visitDurationMillisecond=Fe;we.prototype.visitDurationMicrosecond=Fe;we.prototype.visitDurationNanosecond=Fe;we.prototype.visitFixedSizeList=Fe;we.prototype.visitMap=Fe;const nd=new we;class Se extends Ve{}function De(n){const{type:e}=n;if(n.nullCount===0&&n.stride===1&&(de.isInt(e)&&e.bitWidth!==64||de.isTime(e)&&e.bitWidth!==64||de.isFloat(e)&&e.precision!==an.HALF))return new mv(n.data.length,s=>{const a=n.data[s];return a.values.subarray(0,a.length)[Symbol.iterator]()});let t=0;return new mv(n.data.length,s=>{const u=n.data[s].length,d=n.slice(t,t+u);return t+=u,new vD(d)})}class vD{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}}Se.prototype.visitNull=De;Se.prototype.visitBool=De;Se.prototype.visitInt=De;Se.prototype.visitInt8=De;Se.prototype.visitInt16=De;Se.prototype.visitInt32=De;Se.prototype.visitInt64=De;Se.prototype.visitUint8=De;Se.prototype.visitUint16=De;Se.prototype.visitUint32=De;Se.prototype.visitUint64=De;Se.prototype.visitFloat=De;Se.prototype.visitFloat16=De;Se.prototype.visitFloat32=De;Se.prototype.visitFloat64=De;Se.prototype.visitUtf8=De;Se.prototype.visitLargeUtf8=De;Se.prototype.visitBinary=De;Se.prototype.visitLargeBinary=De;Se.prototype.visitFixedSizeBinary=De;Se.prototype.visitDate=De;Se.prototype.visitDateDay=De;Se.prototype.visitDateMillisecond=De;Se.prototype.visitTimestamp=De;Se.prototype.visitTimestampSecond=De;Se.prototype.visitTimestampMillisecond=De;Se.prototype.visitTimestampMicrosecond=De;Se.prototype.visitTimestampNanosecond=De;Se.prototype.visitTime=De;Se.prototype.visitTimeSecond=De;Se.prototype.visitTimeMillisecond=De;Se.prototype.visitTimeMicrosecond=De;Se.prototype.visitTimeNanosecond=De;Se.prototype.visitDecimal=De;Se.prototype.visitList=De;Se.prototype.visitStruct=De;Se.prototype.visitUnion=De;Se.prototype.visitDenseUnion=De;Se.prototype.visitSparseUnion=De;Se.prototype.visitDictionary=De;Se.prototype.visitInterval=De;Se.prototype.visitIntervalDayTime=De;Se.prototype.visitIntervalYearMonth=De;Se.prototype.visitDuration=De;Se.prototype.visitDurationSecond=De;Se.prototype.visitDurationMillisecond=De;Se.prototype.visitDurationMicrosecond=De;Se.prototype.visitDurationNanosecond=De;Se.prototype.visitFixedSizeList=De;Se.prototype.visitMap=De;const Cp=new Se;var bS;const IS={},ES={};class ht{constructor(e){var t,s,a;const u=e[0]instanceof ht?e.flatMap(f=>f.data):e;if(u.length===0||u.some(f=>!(f instanceof wt)))throw new TypeError("Vector constructor expects an Array of Data instances.");const d=(t=u[0])===null||t===void 0?void 0:t.type;switch(u.length){case 0:this._offsets=[0];break;case 1:{const{get:f,set:p,indexOf:m}=IS[d.typeId],g=u[0];this.isValid=v=>Dp(g,v),this.get=v=>f(g,v),this.set=(v,S)=>p(g,v,S),this.indexOf=v=>m(g,v),this._offsets=[0,g.length];break}default:Object.setPrototypeOf(this,ES[d.typeId]),this._offsets=gS(u);break}this.data=u,this.type=d,this.stride=hi(d),this.numChildren=(a=(s=d.children)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return mD(this.data)}get nullCount(){return yS(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${C[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(Ip(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Cp.visit(this)}concat(...e){return new ht(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new ht(pS(this,e,t,({data:s,_offsets:a},u,d)=>vS(s,a,u,d)))}toJSON(){return[...this]}toArray(){const{type:e,data:t,length:s,stride:a,ArrayType:u}=this;switch(e.typeId){case C.Int:case C.Float:case C.Decimal:case C.Time:case C.Timestamp:switch(t.length){case 0:return new u;case 1:return t[0].values.subarray(0,s*a);default:return t.reduce((d,{values:f,length:p})=>(d.array.set(f.subarray(0,p*a),d.offset),d.offset+=p*a,d),{array:new u(s*a),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(s=>s.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new ht(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return de.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(de.isDictionary(this.type)){const e=new rd(this.data[0].dictionary),t=this.data.map(s=>{const a=s.clone();return a.dictionary=e,a});return new ht(t)}return new rd(this)}unmemoize(){if(de.isDictionary(this.type)&&this.isMemoized){const e=this.data[0].dictionary.unmemoize(),t=this.data.map(s=>{const a=s.clone();return a.dictionary=e,a});return new ht(t)}return this}}bS=Symbol.toStringTag;ht[bS]=(n=>{n.type=de.prototype,n.data=[],n.length=0,n.stride=1,n.numChildren=0,n._offsets=new Uint32Array([0]),n[Symbol.isConcatSpreadable]=!0;const e=Object.keys(C).map(t=>C[t]).filter(t=>typeof t=="number"&&t!==C.NONE);for(const t of e){const s=Tn.getVisitFnByTypeId(t),a=or.getVisitFnByTypeId(t),u=nd.getVisitFnByTypeId(t);IS[t]={get:s,set:a,indexOf:u},ES[t]=Object.create(n,{isValid:{value:td(Dp)},get:{value:td(Tn.getVisitFnByTypeId(t))},set:{value:wS(or.getVisitFnByTypeId(t))},indexOf:{value:SS(nd.getVisitFnByTypeId(t))}})}return"Vector"})(ht.prototype);class rd extends ht{constructor(e){super(e.data);const t=this.get,s=this.set,a=this.slice,u=new Array(this.length);Object.defineProperty(this,"get",{value(d){const f=u[d];if(f!==void 0)return f;const p=t.call(this,d);return u[d]=p,p}}),Object.defineProperty(this,"set",{value(d,f){s.call(this,d,f),u[d]=f}}),Object.defineProperty(this,"slice",{value:(d,f)=>new rd(a.call(this,d,f))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new ht(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class qh{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,s,a){return e.prep(8,24),e.writeInt64(BigInt(a??0)),e.pad(4),e.writeInt32(s),e.writeInt64(BigInt(t??0)),e.offset()}}let Pr=class Yh{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new Yh).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+st),(t||new Yh).__init(e.readInt32(e.position())+e.position(),e)}version(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ut.V1}schema(e){const t=this.bb.__offset(this.bb_pos,6);return t?(e||new Br).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){const s=this.bb.__offset(this.bb_pos,8);return s?(t||new qh).__init(this.bb.__vector(this.bb_pos+s)+e*24,this.bb):null}dictionariesLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){const s=this.bb.__offset(this.bb_pos,10);return s?(t||new qh).__init(this.bb.__vector(this.bb_pos+s)+e*24,this.bb):null}recordBatchesLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){const s=this.bb.__offset(this.bb_pos,12);return s?(t||new Wt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Ut.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addOffset(t[s]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}};class rt{constructor(e=[],t,s,a=Ut.V5){this.fields=e||[],this.metadata=t||new Map,s||(s=Gh(this.fields)),this.dictionaries=s,this.metadataVersion=a}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(e){const t=new Set(e),s=this.fields.filter(a=>t.has(a.name));return new rt(s,this.metadata)}selectAt(e){const t=e.map(s=>this.fields[s]).filter(Boolean);return new rt(t,this.metadata)}assign(...e){const t=e[0]instanceof rt?e[0]:Array.isArray(e[0])?new rt(e[0]):new rt(e),s=[...this.fields],a=hc(hc(new Map,this.metadata),t.metadata),u=t.fields.filter(f=>{const p=s.findIndex(m=>m.name===f.name);return~p?(s[p]=f.clone({metadata:hc(hc(new Map,s[p].metadata),f.metadata)}))&&!1:!0}),d=Gh(u,new Map);return new rt([...s,...u],a,new Map([...this.dictionaries,...d]))}}rt.prototype.fields=null;rt.prototype.metadata=null;rt.prototype.dictionaries=null;class Et{static new(...e){let[t,s,a,u]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],s===void 0&&(s=e[0].type),a===void 0&&(a=e[0].nullable),u===void 0&&(u=e[0].metadata)),new Et(`${t}`,s,a,u)}constructor(e,t,s=!1,a){this.name=e,this.type=t,this.nullable=s,this.metadata=a||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,s,a,u]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,s=this.type,a=this.nullable,u=this.metadata]=e:{name:t=this.name,type:s=this.type,nullable:a=this.nullable,metadata:u=this.metadata}=e[0],Et.new(t,s,a,u)}}Et.prototype.type=null;Et.prototype.name=null;Et.prototype.nullable=null;Et.prototype.metadata=null;function hc(n,e){return new Map([...n||new Map,...e||new Map])}function Gh(n,e=new Map){for(let t=-1,s=n.length;++t<s;){const u=n[t].type;if(de.isDictionary(u)){if(!e.has(u.id))e.set(u.id,u.dictionary);else if(e.get(u.id)!==u.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}u.children&&u.children.length>0&&Gh(u.children,e)}return e}var wD=q0,SD=ma;class Op{static decode(e){e=new SD(Je(e));const t=Pr.getRootAsFooter(e),s=rt.decode(t.schema(),new Map,t.version());return new _D(s,t)}static encode(e){const t=new wD,s=rt.encode(t,e.schema);Pr.startRecordBatchesVector(t,e.numRecordBatches);for(const d of[...e.recordBatches()].slice().reverse())va.encode(t,d);const a=t.endVector();Pr.startDictionariesVector(t,e.numDictionaries);for(const d of[...e.dictionaryBatches()].slice().reverse())va.encode(t,d);const u=t.endVector();return Pr.startFooter(t),Pr.addSchema(t,s),Pr.addVersion(t,Ut.V5),Pr.addRecordBatches(t,a),Pr.addDictionaries(t,u),Pr.finishFooterBuffer(t,Pr.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=Ut.V5,s,a){this.schema=e,this.version=t,s&&(this._recordBatches=s),a&&(this._dictionaryBatches=a)}*recordBatches(){for(let e,t=-1,s=this.numRecordBatches;++t<s;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,s=this.numDictionaries;++t<s;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}}class _D extends Op{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,t){super(e,t.version()),this._footer=t}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){const t=this._footer.recordBatches(e);if(t)return va.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){const t=this._footer.dictionaries(e);if(t)return va.decode(t)}return null}}class va{static decode(e){return new va(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){const{metaDataLength:s}=t,a=BigInt(t.offset),u=BigInt(t.bodyLength);return qh.createBlock(e,a,s,u)}constructor(e,t,s){this.metaDataLength=e,this.offset=It(s),this.bodyLength=It(t)}}const Ft=Object.freeze({done:!0,value:void 0});class yv{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class xS{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class bD extends xS{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return Pe(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){const{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Ft);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return er.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return er.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return Pe(this,void 0,void 0,function*(){return yield this.abort(e),Ft})}return(e){return Pe(this,void 0,void 0,function*(){return yield this.close(),Ft})}read(e){return Pe(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return Pe(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,s)=>{this.resolvers.push({resolve:t,reject:s})}):Promise.resolve(Ft)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class ID extends bD{write(e){if((e=Je(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Bh(this.toUint8Array(!0)):this.toUint8Array(!1).then(Bh)}toUint8Array(e=!1){return e?Yr(this._values)[0]:Pe(this,void 0,void 0,function*(){var t,s,a,u;const d=[];let f=0;try{for(var p=!0,m=Jo(this),g;g=yield m.next(),t=g.done,!t;p=!0){u=g.value,p=!1;const v=u;d.push(v),f+=v.byteLength}}catch(v){s={error:v}}finally{try{!p&&!t&&(a=m.return)&&(yield a.call(m))}finally{if(s)throw s.error}}return Yr(d,f)[0]})}}class id{constructor(e){e&&(this.source=new ED(er.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)}}class wa{constructor(e){e instanceof wa?this.source=e.source:e instanceof ID?this.source=new Us(er.fromAsyncIterable(e)):W0(e)?this.source=new Us(er.fromNodeStream(e)):gp(e)?this.source=new Us(er.fromDOMStream(e)):V0(e)?this.source=new Us(er.fromDOMStream(e.body)):pd(e)?this.source=new Us(er.fromIterable(e)):kl(e)?this.source=new Us(er.fromAsyncIterable(e)):yp(e)&&(this.source=new Us(er.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)}}class ED{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Ft)}return(e){return Object.create(this.source.return&&this.source.return(e)||Ft)}}class Us{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return Pe(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return Pe(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return Pe(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return Pe(this,arguments,void 0,function*(t,s="read"){return yield this.source.next({cmd:s,size:t})})}throw(e){return Pe(this,void 0,void 0,function*(){const t=this.source.throw&&(yield this.source.throw(e))||Ft;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return Pe(this,void 0,void 0,function*(){const t=this.source.return&&(yield this.source.return(e))||Ft;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}class gv extends id{constructor(e,t){super(),this.position=0,this.buffer=Je(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){const{buffer:t,byteOffset:s}=this.readAt(e,4);return new DataView(t,s).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){const{buffer:t,size:s,position:a}=this;return t&&a<s?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(s,a+Math.min(s-a,e)),t.subarray(a,this.position)):null}readAt(e,t){const s=this.buffer,a=Math.min(this.size,e+t);return s?s.subarray(e,a):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}}class sd extends wa{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=Pe(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return Pe(this,void 0,void 0,function*(){const{buffer:t,byteOffset:s}=yield this.readAt(e,4);return new DataView(t,s).getInt32(0,!0)})}seek(e){return Pe(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 Pe(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:t,size:s,position:a}=this;if(t&&a<s){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let u=a,d=0,f=0;const p=Math.min(s,u+Math.min(s-u,e)),m=new Uint8Array(Math.max(0,(this.position=p)-u));for(;(u+=f)<p&&(d+=f)<m.byteLength;)({bytesRead:f}=yield t.read(m,d,m.byteLength-d,u));return m}return null})}readAt(e,t){return Pe(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:s,size:a}=this;if(s&&e+t<a){const u=Math.min(a,e+t),d=new Uint8Array(u-e);return(yield s.read(d,0,t,e)).buffer}return new Uint8Array(t)})}close(){return Pe(this,void 0,void 0,function*(){const e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return Pe(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return Pe(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}const xD=65536;function qo(n){return n<0&&(n=4294967295+n+1),`0x${n.toString(16)}`}const Sa=8,Rp=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class DS{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){const t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),s=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]);let a=t[3]*s[3];this.buffer[0]=a&65535;let u=a>>>16;return a=t[2]*s[3],u+=a,a=t[3]*s[2]>>>0,u+=a,this.buffer[0]+=u<<16,this.buffer[1]=u>>>0<a?xD:0,this.buffer[1]+=u>>>16,this.buffer[1]+=t[1]*s[3]+t[2]*s[2]+t[3]*s[1],this.buffer[1]+=t[0]*s[3]+t[1]*s[2]+t[2]*s[1]+t[3]*s[0]<<16,this}_plus(e){const t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${qo(this.buffer[1])} ${qo(this.buffer[0])}`}}class lt extends DS{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return lt.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return lt.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){const s=e.length,a=new lt(t);for(let u=0;u<s;){const d=Sa<s-u?Sa:s-u,f=new lt(new Uint32Array([Number.parseInt(e.slice(u,u+d),10),0])),p=new lt(new Uint32Array([Rp[d],0]));a.times(p),a.plus(f),u+=d}return a}static convertArray(e){const t=new Uint32Array(e.length*2);for(let s=-1,a=e.length;++s<a;)lt.from(e[s],new Uint32Array(t.buffer,t.byteOffset+2*s*4,2));return t}static multiply(e,t){return new lt(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new lt(new Uint32Array(e.buffer)).plus(t)}}class An extends DS{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){const t=this.buffer[1]<<0,s=e.buffer[1]<<0;return t<s||t===s&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return An.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return An.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){const s=e.startsWith("-"),a=e.length,u=new An(t);for(let d=s?1:0;d<a;){const f=Sa<a-d?Sa:a-d,p=new An(new Uint32Array([Number.parseInt(e.slice(d,d+f),10),0])),m=new An(new Uint32Array([Rp[f],0]));u.times(m),u.plus(p),d+=f}return s?u.negate():u}static convertArray(e){const t=new Uint32Array(e.length*2);for(let s=-1,a=e.length;++s<a;)An.from(e[s],new Uint32Array(t.buffer,t.byteOffset+2*s*4,2));return t}static multiply(e,t){return new An(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new An(new Uint32Array(e.buffer)).plus(t)}}class Ur{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){const t=new lt(new Uint32Array([this.buffer[3],0])),s=new lt(new Uint32Array([this.buffer[2],0])),a=new lt(new Uint32Array([this.buffer[1],0])),u=new lt(new Uint32Array([this.buffer[0],0])),d=new lt(new Uint32Array([e.buffer[3],0])),f=new lt(new Uint32Array([e.buffer[2],0])),p=new lt(new Uint32Array([e.buffer[1],0])),m=new lt(new Uint32Array([e.buffer[0],0]));let g=lt.multiply(u,m);this.buffer[0]=g.low();const v=new lt(new Uint32Array([g.high(),0]));return g=lt.multiply(a,m),v.plus(g),g=lt.multiply(u,p),v.plus(g),this.buffer[1]=v.low(),this.buffer[3]=v.lessThan(g)?1:0,this.buffer[2]=v.high(),new lt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(lt.multiply(s,m)).plus(lt.multiply(a,p)).plus(lt.multiply(u,f)),this.buffer[3]+=lt.multiply(t,m).plus(lt.multiply(s,p)).plus(lt.multiply(a,f)).plus(lt.multiply(u,d)).low(),this}plus(e){const t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${qo(this.buffer[3])} ${qo(this.buffer[2])} ${qo(this.buffer[1])} ${qo(this.buffer[0])}`}static multiply(e,t){return new Ur(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new Ur(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return Ur.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return Ur.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){const s=e.startsWith("-"),a=e.length,u=new Ur(t);for(let d=s?1:0;d<a;){const f=Sa<a-d?Sa:a-d,p=new Ur(new Uint32Array([Number.parseInt(e.slice(d,d+f),10),0,0,0])),m=new Ur(new Uint32Array([Rp[f],0,0,0]));u.times(m),u.plus(p),d+=f}return s?u.negate():u}static convertArray(e){const t=new Uint32Array(e.length*4);for(let s=-1,a=e.length;++s<a;)Ur.from(e[s],new Uint32Array(t.buffer,t.byteOffset+4*4*s,4));return t}}class CS extends Ve{constructor(e,t,s,a,u=Ut.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=t,this.buffers=s,this.dictionaries=a,this.metadataVersion=u}visit(e){return super.visit(e instanceof Et?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return $e({type:e,length:t})}visitBool(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitInt(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinary(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitFixedSizeBinary(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitDate(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitTime(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitList(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),children:this.visitMany(e.children)})}visitUnion(e,{length:t,nullCount:s}=this.nextFieldNode()){return this.metadataVersion<Ut.V5&&this.readNullBitmap(e,s),e.mode===Pn.Sparse?this.visitSparseUnion(e,{length:t,nullCount:s}):this.visitDenseUnion(e,{length:t,nullCount:s})}visitDenseUnion(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitDuration(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),child:this.visit(e.children[0])})}visitMap(e,{length:t,nullCount:s}=this.nextFieldNode()){return $e({type:e,length:t,nullCount:s,nullBitmap:this.readNullBitmap(e,s),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,s=this.nextBufferRange()){return t>0&&this.readData(e,s)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:s}=this.nextBufferRange()){return this.bytes.subarray(s,s+t)}readDictionary(e){return this.dictionaries.get(e.id)}}class DD extends CS{constructor(e,t,s,a,u){super(new Uint8Array(0),t,s,a,u),this.sources=e}readNullBitmap(e,t,{offset:s}=this.nextBufferRange()){return t<=0?new Uint8Array(0):Wh(this.sources[s])}readOffsets(e,{offset:t}=this.nextBufferRange()){return ut(Uint8Array,ut(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return ut(Uint8Array,ut(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){const{sources:s}=this;return de.isTimestamp(e)||(de.isInt(e)||de.isTime(e))&&e.bitWidth===64||de.isDuration(e)||de.isDate(e)&&e.unit===sr.MILLISECOND?ut(Uint8Array,An.convertArray(s[t])):de.isDecimal(e)?ut(Uint8Array,Ur.convertArray(s[t])):de.isBinary(e)||de.isLargeBinary(e)||de.isFixedSizeBinary(e)?CD(s[t]):de.isBool(e)?Wh(s[t]):de.isUtf8(e)||de.isLargeUtf8(e)?mp(s[t].join("")):ut(Uint8Array,ut(e.ArrayType,s[t].map(a=>+a)))}}function CD(n){const e=n.join(""),t=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2)t[s>>1]=Number.parseInt(e.slice(s,s+2),16);return t}class _e extends Ve{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((s,a)=>this.compareFields(s,t[a]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}}function wn(n,e){return e instanceof n.constructor}function io(n,e){return n===e||wn(n,e)}function Ei(n,e){return n===e||wn(n,e)&&n.bitWidth===e.bitWidth&&n.isSigned===e.isSigned}function yd(n,e){return n===e||wn(n,e)&&n.precision===e.precision}function OD(n,e){return n===e||wn(n,e)&&n.byteWidth===e.byteWidth}function Fp(n,e){return n===e||wn(n,e)&&n.unit===e.unit}function Ql(n,e){return n===e||wn(n,e)&&n.unit===e.unit&&n.timezone===e.timezone}function Kl(n,e){return n===e||wn(n,e)&&n.unit===e.unit&&n.bitWidth===e.bitWidth}function RD(n,e){return n===e||wn(n,e)&&n.children.length===e.children.length&&ys.compareManyFields(n.children,e.children)}function FD(n,e){return n===e||wn(n,e)&&n.children.length===e.children.length&&ys.compareManyFields(n.children,e.children)}function Mp(n,e){return n===e||wn(n,e)&&n.mode===e.mode&&n.typeIds.every((t,s)=>t===e.typeIds[s])&&ys.compareManyFields(n.children,e.children)}function MD(n,e){return n===e||wn(n,e)&&n.id===e.id&&n.isOrdered===e.isOrdered&&ys.visit(n.indices,e.indices)&&ys.visit(n.dictionary,e.dictionary)}function Lp(n,e){return n===e||wn(n,e)&&n.unit===e.unit}function ql(n,e){return n===e||wn(n,e)&&n.unit===e.unit}function LD(n,e){return n===e||wn(n,e)&&n.listSize===e.listSize&&n.children.length===e.children.length&&ys.compareManyFields(n.children,e.children)}function AD(n,e){return n===e||wn(n,e)&&n.keysSorted===e.keysSorted&&n.children.length===e.children.length&&ys.compareManyFields(n.children,e.children)}_e.prototype.visitNull=io;_e.prototype.visitBool=io;_e.prototype.visitInt=Ei;_e.prototype.visitInt8=Ei;_e.prototype.visitInt16=Ei;_e.prototype.visitInt32=Ei;_e.prototype.visitInt64=Ei;_e.prototype.visitUint8=Ei;_e.prototype.visitUint16=Ei;_e.prototype.visitUint32=Ei;_e.prototype.visitUint64=Ei;_e.prototype.visitFloat=yd;_e.prototype.visitFloat16=yd;_e.prototype.visitFloat32=yd;_e.prototype.visitFloat64=yd;_e.prototype.visitUtf8=io;_e.prototype.visitLargeUtf8=io;_e.prototype.visitBinary=io;_e.prototype.visitLargeBinary=io;_e.prototype.visitFixedSizeBinary=OD;_e.prototype.visitDate=Fp;_e.prototype.visitDateDay=Fp;_e.prototype.visitDateMillisecond=Fp;_e.prototype.visitTimestamp=Ql;_e.prototype.visitTimestampSecond=Ql;_e.prototype.visitTimestampMillisecond=Ql;_e.prototype.visitTimestampMicrosecond=Ql;_e.prototype.visitTimestampNanosecond=Ql;_e.prototype.visitTime=Kl;_e.prototype.visitTimeSecond=Kl;_e.prototype.visitTimeMillisecond=Kl;_e.prototype.visitTimeMicrosecond=Kl;_e.prototype.visitTimeNanosecond=Kl;_e.prototype.visitDecimal=io;_e.prototype.visitList=RD;_e.prototype.visitStruct=FD;_e.prototype.visitUnion=Mp;_e.prototype.visitDenseUnion=Mp;_e.prototype.visitSparseUnion=Mp;_e.prototype.visitDictionary=MD;_e.prototype.visitInterval=Lp;_e.prototype.visitIntervalDayTime=Lp;_e.prototype.visitIntervalYearMonth=Lp;_e.prototype.visitDuration=ql;_e.prototype.visitDurationSecond=ql;_e.prototype.visitDurationMillisecond=ql;_e.prototype.visitDurationMicrosecond=ql;_e.prototype.visitDurationNanosecond=ql;_e.prototype.visitFixedSizeList=LD;_e.prototype.visitMap=AD;const ys=new _e;function kD(n,e){return ys.compareSchemas(n,e)}function gh(n,e){return PD(n,e.map(t=>t.data.concat()))}function PD(n,e){const t=[...n.fields],s=[],a={numBatches:e.reduce((v,S)=>Math.max(v,S.length),0)};let u=0,d=0,f=-1;const p=e.length;let m,g=[];for(;a.numBatches-- >0;){for(d=Number.POSITIVE_INFINITY,f=-1;++f<p;)g[f]=m=e[f].shift(),d=Math.min(d,m?m.length:d);Number.isFinite(d)&&(g=TD(t,d,g,e,a),d>0&&(s[u++]=$e({type:new gn(t),length:d,nullCount:0,children:g.slice()})))}return[n=n.assign(t),s.map(v=>new Er(n,v))]}function TD(n,e,t,s,a){var u;const d=(e+63&-64)>>3;for(let f=-1,p=s.length;++f<p;){const m=t[f],g=m==null?void 0:m.length;if(g>=e)g===e?t[f]=m:(t[f]=m.slice(0,e),a.numBatches=Math.max(a.numBatches,s[f].unshift(m.slice(e,g-e))));else{const v=n[f];n[f]=v.clone({nullable:!0}),t[f]=(u=m==null?void 0:m._changeLengthAndBackfillNullBitmap(e))!==null&&u!==void 0?u:$e({type:v.type,length:e,nullCount:e,nullBitmap:new Uint8Array(d)})}}return t}var OS;class rr{constructor(...e){var t,s;if(e.length===0)return this.batches=[],this.schema=new rt([]),this._offsets=[0],this;let a,u;e[0]instanceof rt&&(a=e.shift()),e.at(-1)instanceof Uint32Array&&(u=e.pop());const d=p=>{if(p){if(p instanceof Er)return[p];if(p instanceof rr)return p.batches;if(p instanceof wt){if(p.type instanceof gn)return[new Er(new rt(p.type.children),p)]}else{if(Array.isArray(p))return p.flatMap(m=>d(m));if(typeof p[Symbol.iterator]=="function")return[...p].flatMap(m=>d(m));if(typeof p=="object"){const m=Object.keys(p),g=m.map(_=>new ht([p[_]])),v=a??new rt(m.map((_,D)=>new Et(String(_),g[D].type,g[D].nullable))),[,S]=gh(v,g);return S.length===0?[new Er(p)]:S}}}return[]},f=e.flatMap(p=>d(p));if(a=(s=a??((t=f[0])===null||t===void 0?void 0:t.schema))!==null&&s!==void 0?s:new rt([]),!(a instanceof rt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const p of f){if(!(p instanceof Er))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!kD(a,p.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=a,this.batches=f,this._offsets=u??gS(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,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=yS(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Ip(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Cp.visit(new ht(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
56
56
  ${this.toArray().join(`,
57
57
  `)}
58
- ]`}concat(...e){const t=this.schema,s=this.data.concat(e.flatMap(({data:a})=>a));return new rr(t,s.map(a=>new Er(t,a)))}slice(e,t){const s=this.schema;[e,t]=pS({length:this.numRows},e,t);const a=vS(this.data,this._offsets,e,t);return new rr(s,a.map(u=>new Er(s,u)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){const t=this.data.map(s=>s.children[e]);if(t.length===0){const{type:s}=this.schema.fields[e],a=$e({type:s,length:0,nullCount:0});t.push(a._changeLengthAndBackfillNullBitmap(this.numRows))}return new ht(t)}return null}setChild(e,t){var s;return this.setChildAt((s=this.schema.fields)===null||s===void 0?void 0:s.findIndex(a=>a.name===e),t)}setChildAt(e,t){let s=this.schema,a=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new ht([$e({type:new ms,length:this.numRows})]));const u=s.fields.slice(),d=u[e].clone({type:t.type}),f=this.schema.fields.map((p,m)=>this.getChildAt(m));[u[e],f[e]]=[d,t],[s,a]=gh(s,f)}return new rr(s,a)}select(e){const t=this.schema.fields.reduce((s,a,u)=>s.set(a.name,u),new Map);return this.selectAt(e.map(s=>t.get(s)).filter(s=>s>-1))}selectAt(e){const t=this.schema.selectAt(e),s=this.batches.map(a=>a.selectAt(e));return new rr(t,s)}assign(e){const t=this.schema.fields,[s,a]=e.schema.fields.reduce((f,p,m)=>{const[g,v]=f,S=t.findIndex(_=>_.name===p.name);return~S?v[S]=m:g.push(m),f},[[],[]]),u=this.schema.assign(e.schema),d=[...t.map((f,p)=>[p,a[p]]).map(([f,p])=>p===void 0?this.getChildAt(f):e.getChildAt(p)),...s.map(f=>e.getChildAt(f))].filter(Boolean);return new rr(...gh(u,d))}}OS=Symbol.toStringTag;rr[OS]=(n=>(n.schema=null,n.batches=[],n._offsets=new Uint32Array([0]),n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,n.isValid=td(Dp),n.get=td(Tn.getVisitFn(C.Struct)),n.set=wS(or.getVisitFn(C.Struct)),n.indexOf=SS(nd.getVisitFn(C.Struct)),"Table"))(rr.prototype);var RS;let Er=class Ol{constructor(...e){switch(e.length){case 2:{if([this.schema]=e,!(this.schema instanceof rt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=$e({nullCount:0,type:new gn(this.schema.fields),children:this.schema.fields.map(t=>$e({type:t.type,nullCount:0}))})]=e,!(this.data instanceof wt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=vv(this.schema,this.data.children);break}case 1:{const[t]=e,{fields:s,children:a,length:u}=Object.keys(t).reduce((p,m,g)=>(p.children[g]=t[m],p.length=Math.max(p.length,t[m].length),p.fields[g]=Et.new({name:m,type:t[m].type,nullable:!0}),p),{length:0,fields:new Array,children:new Array}),d=new rt(s),f=$e({type:new gn(s),length:u,children:a,nullCount:0});[this.schema,this.data]=vv(d,f.children,u);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=FS(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 Tn.visit(this.data,e)}at(e){return this.get(Ip(e,this.numRows))}set(e,t){return or.visit(this.data,e,t)}indexOf(e,t){return nd.visit(this.data,e,t)}[Symbol.iterator](){return Cp.visit(new ht([this.data]))}toArray(){return[...this]}concat(...e){return new rr(this.schema,[this,...e])}slice(e,t){const[s]=new ht([this.data]).slice(e,t).data;return new Ol(this.schema,s)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(s=>s.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new ht([this.data.children[e]]):null}setChild(e,t){var s;return this.setChildAt((s=this.schema.fields)===null||s===void 0?void 0:s.findIndex(a=>a.name===e),t)}setChildAt(e,t){let s=this.schema,a=this.data;if(e>-1&&e<this.numCols){t||(t=new ht([$e({type:new ms,length:this.numRows})]));const u=s.fields.slice(),d=a.children.slice(),f=u[e].clone({type:t.type});[u[e],d[e]]=[f,t.data[0]],s=new rt(u,new Map(this.schema.metadata)),a=$e({type:new gn(u),children:d})}return new Ol(s,a)}select(e){const t=this.schema.select(e),s=new gn(t.fields),a=[];for(const u of e){const d=this.schema.fields.findIndex(f=>f.name===u);~d&&(a[d]=this.data.children[d])}return new Ol(t,$e({type:s,length:this.numRows,children:a}))}selectAt(e){const t=this.schema.selectAt(e),s=e.map(u=>this.data.children[u]).filter(Boolean),a=$e({type:new gn(t.fields),length:this.numRows,children:s});return new Ol(t,a)}};RS=Symbol.toStringTag;Er[RS]=(n=>(n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Er.prototype);function vv(n,e,t=e.reduce((s,a)=>Math.max(s,a.length),0)){var s;const a=[...n.fields],u=[...e],d=(t+63&-64)>>3;for(const[f,p]of n.fields.entries()){const m=e[f];(!m||m.length!==t)&&(a[f]=p.clone({nullable:!0}),u[f]=(s=m==null?void 0:m._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:$e({type:p.type,length:t,nullCount:t,nullBitmap:new Uint8Array(d)}))}return[n.assign(a),$e({type:new gn(a),length:t,children:u})]}function FS(n,e,t=new Map){var s,a;if(((s=n==null?void 0:n.length)!==null&&s!==void 0?s:0)>0&&(n==null?void 0:n.length)===(e==null?void 0:e.length))for(let u=-1,d=n.length;++u<d;){const{type:f}=n[u],p=e[u];for(const m of[p,...((a=p==null?void 0:p.dictionary)===null||a===void 0?void 0:a.data)||[]])FS(f.children,m==null?void 0:m.children,t);if(de.isDictionary(f)){const{id:m}=f;if(!t.has(m))p!=null&&p.dictionary&&t.set(m,p.dictionary);else if(t.get(m)!==p.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return t}class MS extends Er{constructor(e){const t=e.fields.map(a=>$e({type:a.type})),s=$e({type:new gn(e.fields),nullCount:0,children:t});super(e,s)}}let Gi=class Tr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new Tr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+st),(t||new Tr).__init(e.readInt32(e.position())+e.position(),e)}version(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ut.V1}headerType(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):nt.NONE}header(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){const s=this.bb.__offset(this.bb_pos,12);return s?(t||new Wt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Ut.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,nt.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addOffset(t[s]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,s,a,u,d){return Tr.startMessage(e),Tr.addVersion(e,t),Tr.addHeaderType(e,s),Tr.addHeader(e,a),Tr.addBodyLength(e,u),Tr.addCustomMetadata(e,d),Tr.endMessage(e)}};class ND extends Ve{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return lv.startNull(t),lv.endNull(t)}visitInt(e,t){return Hn.startInt(t),Hn.addBitWidth(t,e.bitWidth),Hn.addIsSigned(t,e.isSigned),Hn.endInt(t)}visitFloat(e,t){return Hr.startFloatingPoint(t),Hr.addPrecision(t,e.precision),Hr.endFloatingPoint(t)}visitBinary(e,t){return rv.startBinary(t),rv.endBinary(t)}visitLargeBinary(e,t){return sv.startLargeBinary(t),sv.endLargeBinary(t)}visitBool(e,t){return iv.startBool(t),iv.endBool(t)}visitUtf8(e,t){return uv.startUtf8(t),uv.endUtf8(t)}visitLargeUtf8(e,t){return ov.startLargeUtf8(t),ov.endLargeUtf8(t)}visitDecimal(e,t){return jo.startDecimal(t),jo.addScale(t,e.scale),jo.addPrecision(t,e.precision),jo.addBitWidth(t,e.bitWidth),jo.endDecimal(t)}visitDate(e,t){return _c.startDate(t),_c.addUnit(t,e.unit),_c.endDate(t)}visitTime(e,t){return tr.startTime(t),tr.addUnit(t,e.unit),tr.addBitWidth(t,e.bitWidth),tr.endTime(t)}visitTimestamp(e,t){const s=e.timezone&&t.createString(e.timezone)||void 0;return nr.startTimestamp(t),nr.addUnit(t,e.unit),s!==void 0&&nr.addTimezone(t,s),nr.endTimestamp(t)}visitInterval(e,t){return Wr.startInterval(t),Wr.addUnit(t,e.unit),Wr.endInterval(t)}visitDuration(e,t){return bc.startDuration(t),bc.addUnit(t,e.unit),bc.endDuration(t)}visitList(e,t){return av.startList(t),av.endList(t)}visitStruct(e,t){return Vs.startStruct_(t),Vs.endStruct_(t)}visitUnion(e,t){kn.startTypeIdsVector(t,e.typeIds.length);const s=kn.createTypeIdsVector(t,e.typeIds);return kn.startUnion(t),kn.addMode(t,e.mode),kn.addTypeIds(t,s),kn.endUnion(t)}visitDictionary(e,t){const s=this.visit(e.indices,t);return gi.startDictionaryEncoding(t),gi.addId(t,BigInt(e.id)),gi.addIsOrdered(t,e.isOrdered),s!==void 0&&gi.addIndexType(t,s),gi.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Ic.startFixedSizeBinary(t),Ic.addByteWidth(t,e.byteWidth),Ic.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Ec.startFixedSizeList(t),Ec.addListSize(t,e.listSize),Ec.endFixedSizeList(t)}visitMap(e,t){return xc.startMap(t),xc.addKeysSorted(t,e.keysSorted),xc.endMap(t)}}const vh=new ND;function BD(n,e=new Map){return new rt(jD(n,e),Cc(n.metadata),e)}function LS(n){return new Cr(n.count,AS(n.columns),kS(n.columns))}function UD(n){return new bi(LS(n.data),n.id,n.isDelta)}function jD(n,e){return(n.fields||[]).filter(Boolean).map(t=>Et.fromJSON(t,e))}function wv(n,e){return(n.children||[]).filter(Boolean).map(t=>Et.fromJSON(t,e))}function AS(n){return(n||[]).reduce((e,t)=>[...e,new Ia(t.count,zD(t.VALIDITY)),...AS(t.children)],[])}function kS(n,e=[]){for(let t=-1,s=(n||[]).length;++t<s;){const a=n[t];a.VALIDITY&&e.push(new wi(e.length,a.VALIDITY.length)),a.TYPE_ID&&e.push(new wi(e.length,a.TYPE_ID.length)),a.OFFSET&&e.push(new wi(e.length,a.OFFSET.length)),a.DATA&&e.push(new wi(e.length,a.DATA.length)),e=kS(a.children,e)}return e}function zD(n){return(n||[]).reduce((e,t)=>e+ +(t===0),0)}function $D(n,e){let t,s,a,u,d,f;return!e||!(u=n.dictionary)?(d=_v(n,wv(n,e)),a=new Et(n.name,d,n.nullable,Cc(n.metadata))):e.has(t=u.id)?(s=(s=u.indexType)?Sv(s):new Bl,f=new ga(e.get(t),s,t,u.isOrdered),a=new Et(n.name,f,n.nullable,Cc(n.metadata))):(s=(s=u.indexType)?Sv(s):new Bl,e.set(t,d=_v(n,wv(n,e))),f=new ga(d,s,t,u.isOrdered),a=new Et(n.name,f,n.nullable,Cc(n.metadata))),a||null}function Cc(n=[]){return new Map(n.map(({key:e,value:t})=>[e,t]))}function Sv(n){return new to(n.isSigned,n.bitWidth)}function _v(n,e){const t=n.type.name;switch(t){case"NONE":return new ms;case"null":return new ms;case"binary":return new Uc;case"largebinary":return new jc;case"utf8":return new zc;case"largeutf8":return new $c;case"bool":return new Vc;case"list":return new Gc((e||[])[0]);case"struct":return new gn(e||[]);case"struct_":return new gn(e||[])}switch(t){case"int":{const s=n.type;return new to(s.isSigned,s.bitWidth)}case"floatingpoint":{const s=n.type;return new Bc(an[s.precision])}case"decimal":{const s=n.type;return new Hc(s.scale,s.precision,s.bitWidth)}case"date":{const s=n.type;return new Wc(sr[s.unit])}case"time":{const s=n.type;return new Qc(Ie[s.unit],s.bitWidth)}case"timestamp":{const s=n.type;return new Kc(Ie[s.unit],s.timezone)}case"interval":{const s=n.type;return new qc(Gr[s.unit])}case"duration":{const s=n.type;return new Yc(Ie[s.unit])}case"union":{const s=n.type,[a,...u]=(s.mode+"").toLowerCase(),d=a.toUpperCase()+u.join("");return new Jc(Pn[d],s.typeIds||[],e||[])}case"fixedsizebinary":{const s=n.type;return new Xc(s.byteWidth)}case"fixedsizelist":{const s=n.type;return new Zc(s.listSize,(e||[])[0])}case"map":{const s=n.type;return new ed((e||[])[0],s.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}var VD=q0,HD=ma;class xr{static fromJSON(e,t){const s=new xr(0,Ut.V5,t);return s._createHeader=WD(e,t),s}static decode(e){e=new HD(Je(e));const t=Gi.getRootAsMessage(e),s=t.bodyLength(),a=t.version(),u=t.headerType(),d=new xr(s,a,u);return d._createHeader=QD(t,u),d}static encode(e){const t=new VD;let s=-1;return e.isSchema()?s=rt.encode(t,e.header()):e.isRecordBatch()?s=Cr.encode(t,e.header()):e.isDictionaryBatch()&&(s=bi.encode(t,e.header())),Gi.startMessage(t),Gi.addVersion(t,Ut.V5),Gi.addHeader(t,s),Gi.addHeaderType(t,e.headerType),Gi.addBodyLength(t,BigInt(e.bodyLength)),Gi.finishMessageBuffer(t,Gi.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof rt)return new xr(0,Ut.V5,nt.Schema,e);if(e instanceof Cr)return new xr(t,Ut.V5,nt.RecordBatch,e);if(e instanceof bi)return new xr(t,Ut.V5,nt.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===nt.Schema}isRecordBatch(){return this.headerType===nt.RecordBatch}isDictionaryBatch(){return this.headerType===nt.DictionaryBatch}constructor(e,t,s,a){this._version=t,this._headerType=s,this.body=new Uint8Array(0),a&&(this._createHeader=()=>a),this._bodyLength=It(e)}}class Cr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,s){this._nodes=t,this._buffers=s,this._length=It(e)}}class bi{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,t,s=!1){this._data=e,this._isDelta=s,this._id=It(t)}}class wi{constructor(e,t){this.offset=It(e),this.length=It(t)}}class Ia{constructor(e,t){this.length=It(e),this.nullCount=It(t)}}function WD(n,e){return()=>{switch(e){case nt.Schema:return rt.fromJSON(n);case nt.RecordBatch:return Cr.fromJSON(n);case nt.DictionaryBatch:return bi.fromJSON(n)}throw new Error(`Unrecognized Message type: { name: ${nt[e]}, type: ${e} }`)}}function QD(n,e){return()=>{switch(e){case nt.Schema:return rt.decode(n.header(new Br),new Map,n.version());case nt.RecordBatch:return Cr.decode(n.header(new di),n.version());case nt.DictionaryBatch:return bi.decode(n.header(new Bo),n.version())}throw new Error(`Unrecognized Message type: { name: ${nt[e]}, type: ${e} }`)}}Et.encode=rC;Et.decode=tC;Et.fromJSON=$D;rt.encode=nC;rt.decode=KD;rt.fromJSON=BD;Cr.encode=iC;Cr.decode=qD;Cr.fromJSON=LS;bi.encode=sC;bi.decode=YD;bi.fromJSON=UD;Ia.encode=oC;Ia.decode=JD;wi.encode=aC;wi.decode=GD;function KD(n,e=new Map,t=Ut.V5){const s=eC(n,e);return new rt(s,Oc(n),e,t)}function qD(n,e=Ut.V5){if(n.compression()!==null)throw new Error("Record batch compression not implemented");return new Cr(n.length(),XD(n),ZD(n,e))}function YD(n,e=Ut.V5){return new bi(Cr.decode(n.data(),e),n.id(),n.isDelta())}function GD(n){return new wi(n.offset(),n.length())}function JD(n){return new Ia(n.length(),n.nullCount())}function XD(n){const e=[];for(let t,s=-1,a=-1,u=n.nodesLength();++s<u;)(t=n.nodes(s))&&(e[++a]=Ia.decode(t));return e}function ZD(n,e){const t=[];for(let s,a=-1,u=-1,d=n.buffersLength();++a<d;)(s=n.buffers(a))&&(e<Ut.V4&&(s.bb_pos+=8*(a+1)),t[++u]=wi.decode(s));return t}function eC(n,e){const t=[];for(let s,a=-1,u=-1,d=n.fieldsLength();++a<d;)(s=n.fields(a))&&(t[++u]=Et.decode(s,e));return t}function bv(n,e){const t=[];for(let s,a=-1,u=-1,d=n.childrenLength();++a<d;)(s=n.children(a))&&(t[++u]=Et.decode(s,e));return t}function tC(n,e){let t,s,a,u,d,f;return!e||!(f=n.dictionary())?(a=Ev(n,bv(n,e)),s=new Et(n.name(),a,n.nullable(),Oc(n))):e.has(t=It(f.id()))?(u=(u=f.indexType())?Iv(u):new Bl,d=new ga(e.get(t),u,t,f.isOrdered()),s=new Et(n.name(),d,n.nullable(),Oc(n))):(u=(u=f.indexType())?Iv(u):new Bl,e.set(t,a=Ev(n,bv(n,e))),d=new ga(a,u,t,f.isOrdered()),s=new Et(n.name(),d,n.nullable(),Oc(n))),s||null}function Oc(n){const e=new Map;if(n)for(let t,s,a=-1,u=Math.trunc(n.customMetadataLength());++a<u;)(t=n.customMetadata(a))&&(s=t.key())!=null&&e.set(s,t.value());return e}function Iv(n){return new to(n.isSigned(),n.bitWidth())}function Ev(n,e){const t=n.typeType();switch(t){case vt.NONE:return new ms;case vt.Null:return new ms;case vt.Binary:return new Uc;case vt.LargeBinary:return new jc;case vt.Utf8:return new zc;case vt.LargeUtf8:return new $c;case vt.Bool:return new Vc;case vt.List:return new Gc((e||[])[0]);case vt.Struct_:return new gn(e||[])}switch(t){case vt.Int:{const s=n.type(new Hn);return new to(s.isSigned(),s.bitWidth())}case vt.FloatingPoint:{const s=n.type(new Hr);return new Bc(s.precision())}case vt.Decimal:{const s=n.type(new jo);return new Hc(s.scale(),s.precision(),s.bitWidth())}case vt.Date:{const s=n.type(new _c);return new Wc(s.unit())}case vt.Time:{const s=n.type(new tr);return new Qc(s.unit(),s.bitWidth())}case vt.Timestamp:{const s=n.type(new nr);return new Kc(s.unit(),s.timezone())}case vt.Interval:{const s=n.type(new Wr);return new qc(s.unit())}case vt.Duration:{const s=n.type(new bc);return new Yc(s.unit())}case vt.Union:{const s=n.type(new kn);return new Jc(s.mode(),s.typeIdsArray()||[],e||[])}case vt.FixedSizeBinary:{const s=n.type(new Ic);return new Xc(s.byteWidth())}case vt.FixedSizeList:{const s=n.type(new Ec);return new Zc(s.listSize(),(e||[])[0])}case vt.Map:{const s=n.type(new xc);return new ed((e||[])[0],s.keysSorted())}}throw new Error(`Unrecognized type: "${vt[t]}" (${t})`)}function nC(n,e){const t=e.fields.map(u=>Et.encode(n,u));Br.startFieldsVector(n,t.length);const s=Br.createFieldsVector(n,t),a=e.metadata&&e.metadata.size>0?Br.createCustomMetadataVector(n,[...e.metadata].map(([u,d])=>{const f=n.createString(`${u}`),p=n.createString(`${d}`);return Wt.startKeyValue(n),Wt.addKey(n,f),Wt.addValue(n,p),Wt.endKeyValue(n)})):-1;return Br.startSchema(n),Br.addFields(n,s),Br.addEndianness(n,lC?ya.Little:ya.Big),a!==-1&&Br.addCustomMetadata(n,a),Br.endSchema(n)}function rC(n,e){let t=-1,s=-1,a=-1;const u=e.type;let d=e.typeId;de.isDictionary(u)?(d=u.dictionary.typeId,a=vh.visit(u,n),s=vh.visit(u.dictionary,n)):s=vh.visit(u,n);const f=(u.children||[]).map(g=>Et.encode(n,g)),p=Jn.createChildrenVector(n,f),m=e.metadata&&e.metadata.size>0?Jn.createCustomMetadataVector(n,[...e.metadata].map(([g,v])=>{const S=n.createString(`${g}`),_=n.createString(`${v}`);return Wt.startKeyValue(n),Wt.addKey(n,S),Wt.addValue(n,_),Wt.endKeyValue(n)})):-1;return e.name&&(t=n.createString(e.name)),Jn.startField(n),Jn.addType(n,s),Jn.addTypeType(n,d),Jn.addChildren(n,p),Jn.addNullable(n,!!e.nullable),t!==-1&&Jn.addName(n,t),a!==-1&&Jn.addDictionary(n,a),m!==-1&&Jn.addCustomMetadata(n,m),Jn.endField(n)}function iC(n,e){const t=e.nodes||[],s=e.buffers||[];di.startNodesVector(n,t.length);for(const d of t.slice().reverse())Ia.encode(n,d);const a=n.endVector();di.startBuffersVector(n,s.length);for(const d of s.slice().reverse())wi.encode(n,d);const u=n.endVector();return di.startRecordBatch(n),di.addLength(n,BigInt(e.length)),di.addNodes(n,a),di.addBuffers(n,u),di.endRecordBatch(n)}function sC(n,e){const t=Cr.encode(n,e.data);return Bo.startDictionaryBatch(n),Bo.addId(n,BigInt(e.id)),Bo.addIsDelta(n,e.isDelta),Bo.addData(n,t),Bo.endDictionaryBatch(n)}function oC(n,e){return J0.createFieldNode(n,BigInt(e.length),BigInt(e.nullCount))}function aC(n,e){return G0.createBuffer(n,BigInt(e.offset),BigInt(e.length))}const lC=(()=>{const n=new ArrayBuffer(2);return new DataView(n).setInt16(0,256,!0),new Int16Array(n)[0]===256})(),Ap=n=>`Expected ${nt[n]} Message in stream, but was null or length 0.`,kp=n=>`Header pointer of flatbuffer-encoded ${nt[n]} Message is null or length 0.`,PS=(n,e)=>`Expected to read ${n} metadata bytes, but only read ${e}.`,TS=(n,e)=>`Expected to read ${n} bytes for message body, but only read ${e}.`;class NS{constructor(e){this.source=e instanceof id?e:new id(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Ft:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Ap(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);const t=Je(this.source.read(e));if(t.byteLength<e)throw new Error(TS(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){const t=nt.Schema,s=this.readMessage(t),a=s==null?void 0:s.header();if(e&&!a)throw new Error(kp(t));return a}readMetadataLength(){const e=this.source.read(gd),t=e&&new ma(e),s=(t==null?void 0:t.readInt32(0))||0;return{done:s===0,value:s}}readMetadata(e){const t=this.source.read(e);if(!t)return Ft;if(t.byteLength<e)throw new Error(PS(e,t.byteLength));return{done:!1,value:xr.decode(t)}}}class uC{constructor(e,t){this.source=e instanceof wa?e:$0(e)?new sd(e,t):new wa(e)}[Symbol.asyncIterator](){return this}next(){return Pe(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done||e.value===-1&&(e=yield this.readMetadataLength()).done||(e=yield this.readMetadata(e.value)).done?Ft:e})}throw(e){return Pe(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return Pe(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return Pe(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Ap(e));return t.value})}readMessageBody(e){return Pe(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);const t=Je(yield this.source.read(e));if(t.byteLength<e)throw new Error(TS(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return Pe(this,arguments,void 0,function*(e=!1){const t=nt.Schema,s=yield this.readMessage(t),a=s==null?void 0:s.header();if(e&&!a)throw new Error(kp(t));return a})}readMetadataLength(){return Pe(this,void 0,void 0,function*(){const e=yield this.source.read(gd),t=e&&new ma(e),s=(t==null?void 0:t.readInt32(0))||0;return{done:s===0,value:s}})}readMetadata(e){return Pe(this,void 0,void 0,function*(){const t=yield this.source.read(e);if(!t)return Ft;if(t.byteLength<e)throw new Error(PS(e,t.byteLength));return{done:!1,value:xr.decode(t)}})}}class cC extends NS{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof yv?e:new yv(e)}next(){const{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:xr.fromJSON(e.schema,nt.Schema)};if(this._dictionaryIndex<e.dictionaries.length){const t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:xr.fromJSON(t,nt.DictionaryBatch)}}if(this._batchIndex<e.batches.length){const t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:xr.fromJSON(t,nt.RecordBatch)}}return this._body=[],Ft}readMessageBody(e){return t(this._body);function t(s){return(s||[]).reduce((a,u)=>[...a,...u.VALIDITY&&[u.VALIDITY]||[],...u.TYPE_ID&&[u.TYPE_ID]||[],...u.OFFSET&&[u.OFFSET]||[],...u.DATA&&[u.DATA]||[],...t(u.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Ap(e));return t.value}readSchema(){const e=nt.Schema,t=this.readMessage(e),s=t==null?void 0:t.header();if(!t||!s)throw new Error(kp(e));return s}}const gd=4,Jh="ARROW1",od=new Uint8Array(Jh.length);for(let n=0;n<Jh.length;n+=1)od[n]=Jh.codePointAt(n);function Pp(n,e=0){for(let t=-1,s=od.length;++t<s;)if(od[t]!==n[e+t])return!1;return!0}const Yl=od.length,BS=Yl+gd,dC=Yl*2+gd;class Si extends xS{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){const t=this._impl.open(e);return kl(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return er.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return er.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof Si?e:Uh(e)?mC(e):$0(e)?vC(e):kl(e)?Pe(this,void 0,void 0,function*(){return yield Si.from(yield e)}):V0(e)||gp(e)||W0(e)||yp(e)?gC(new wa(e)):yC(new id(e))}static readAll(e){return e instanceof Si?e.isSync()?xv(e):Dv(e):Uh(e)||ArrayBuffer.isView(e)||pd(e)||z0(e)?xv(e):Dv(e)}}class ad extends Si{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Qr(this,arguments,function*(){yield Be(yield*Sc(Jo(this[Symbol.iterator]())))})}}class ld extends Si{constructor(e){super(e),this._impl=e}readAll(){return Pe(this,void 0,void 0,function*(){var e,t,s,a;const u=new Array;try{for(var d=!0,f=Jo(this),p;p=yield f.next(),e=p.done,!e;d=!0){a=p.value,d=!1;const m=a;u.push(m)}}catch(m){t={error:m}}finally{try{!d&&!e&&(s=f.return)&&(yield s.call(f))}finally{if(t)throw t.error}}return u})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class US extends ad{constructor(e){super(e),this._impl=e}}class fC extends ld{constructor(e){super(e),this._impl=e}}class jS{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,t){const s=this._loadVectors(e,t,this.schema.fields),a=$e({type:new gn(this.schema.fields),length:e.length,children:s});return new Er(this.schema,a)}_loadDictionaryBatch(e,t){const{id:s,isDelta:a}=e,{dictionaries:u,schema:d}=this,f=u.get(s),p=d.dictionaries.get(s),m=this._loadVectors(e.data,t,[p]);return(f&&a?f.concat(new ht(m)):new ht(m)).memoize()}_loadVectors(e,t,s){return new CS(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(s)}}class ud extends jS{constructor(e,t){super(t),this._reader=Uh(e)?new cC(this._handle=e):new NS(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=$S(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):Ft}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ft}next(){if(this.closed)return Ft;let e;const{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;const s=e.header(),a=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(s,a)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;const s=e.header(),a=t.readMessageBody(e.bodyLength),u=this._loadDictionaryBatch(s,a);this.dictionaries.set(s.id,u)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MS(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}}class cd extends jS{constructor(e,t){super(t),this._reader=new uC(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Pe(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 Pe(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=$S(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return Pe(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ft})}return(e){return Pe(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ft})}next(){return Pe(this,void 0,void 0,function*(){if(this.closed)return Ft;let e;const{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;const s=e.header(),a=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(s,a)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;const s=e.header(),a=yield t.readMessageBody(e.bodyLength),u=this._loadDictionaryBatch(s,a);this.dictionaries.set(s.id,u)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MS(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return Pe(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}}class zS extends ud{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,t){super(e instanceof gv?e:new gv(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();const s=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(s&&this._handle.seek(s.offset)){const a=this._reader.readMessage(nt.RecordBatch);if(a!=null&&a.isRecordBatch()){const u=a.header(),d=this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(u,d)}}return null}_readDictionaryBatch(e){var t;const s=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(s&&this._handle.seek(s.offset)){const a=this._reader.readMessage(nt.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){const u=a.header(),d=this._reader.readMessageBody(a.bodyLength),f=this._loadDictionaryBatch(u,d);this.dictionaries.set(u.id,f)}}}_readFooter(){const{_handle:e}=this,t=e.size-BS,s=e.readInt32(t),a=e.readAt(t-s,s);return Op.decode(a)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const s=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(s&&this._handle.seek(s.offset))return this._reader.readMessage(e)}return null}}class hC extends cd{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,...t){const s=typeof t[0]!="number"?t.shift():void 0,a=t[0]instanceof Map?t.shift():void 0;super(e instanceof sd?e:new sd(e,s),a)}isFile(){return!0}isAsync(){return!0}open(e){const t=Object.create(null,{open:{get:()=>super.open}});return Pe(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const s of this._footer.dictionaryBatches())s&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return Pe(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());const s=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(s&&(yield this._handle.seek(s.offset))){const a=yield this._reader.readMessage(nt.RecordBatch);if(a!=null&&a.isRecordBatch()){const u=a.header(),d=yield this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(u,d)}}return null})}_readDictionaryBatch(e){return Pe(this,void 0,void 0,function*(){var t;const s=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(s&&(yield this._handle.seek(s.offset))){const a=yield this._reader.readMessage(nt.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){const u=a.header(),d=yield this._reader.readMessageBody(a.bodyLength),f=this._loadDictionaryBatch(u,d);this.dictionaries.set(u.id,f)}}})}_readFooter(){return Pe(this,void 0,void 0,function*(){const{_handle:e}=this;e._pending&&(yield e._pending);const t=e.size-BS,s=yield e.readInt32(t),a=yield e.readAt(t-s,s);return Op.decode(a)})}_readNextMessageAndValidate(e){return Pe(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}}class pC extends ud{constructor(e,t){super(e,t)}_loadVectors(e,t,s){return new DD(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(s)}}function $S(n,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:n.autoDestroy}function*xv(n){const e=Si.from(n);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function Dv(n){return Qr(this,arguments,function*(){const t=yield Be(Si.from(n));try{if(!(yield Be(t.open({autoDestroy:!1}))).closed)do yield yield Be(t);while(!(yield Be(t.reset().open())).closed)}finally{yield Be(t.cancel())}})}function mC(n){return new ad(new pC(n))}function yC(n){const e=n.peek(Yl+7&-8);return e&&e.byteLength>=4?Pp(e)?new US(new zS(n.read())):new ad(new ud(n)):new ad(new ud(function*(){}()))}function gC(n){return Pe(this,void 0,void 0,function*(){const e=yield n.peek(Yl+7&-8);return e&&e.byteLength>=4?Pp(e)?new US(new zS(yield n.read())):new ld(new cd(n)):new ld(new cd(function(){return Qr(this,arguments,function*(){})}()))})}function vC(n){return Pe(this,void 0,void 0,function*(){const{size:e}=yield n.stat(),t=new sd(n,e);return e>=dC&&Pp(yield t.readAt(0,Yl+7&-8))?new fC(new hC(t)):new ld(new cd(t))})}function VS(n){const e=Si.from(n);return kl(e)?e.then(t=>VS(t)):e.isAsync()?e.readAll().then(t=>new rr(t)):new rr(e.readAll())}async function Nt(n,e){const{url:t,method:s,params:a,data:u,headers:d,credentials:f,mode:p,cache:m}=n,g=Object.keys({...a}).length>0,v=t.replace(/([^:]\/)\/+/g,"$1"),S=new URL(HS(v),window.location.origin);if(g){const _=Object.entries({...a}).reduce((D,[k,P])=>(P!=null&&(D[k]=String(P)),D),{});S.search=new URLSearchParams(_).toString()}return await new Promise((_,D)=>{fetch(S,{method:s,credentials:f,mode:p,cache:m,headers:wC(d),body:SC(u),signal:e==null?void 0:e.signal}).then(async k=>{if(k.status===204)return{ok:!0};const P=k.headers.get("Content-Type");if(Zt(P))return{ok:!1,message:"Empty response"};if(k.status>=400)try{const q=await k.json();throw q.status=q.status??k.status,q}catch(q){throw{message:k.statusText,...q}}const B=P.includes("text/event-stream"),V=P.includes("application/json"),W=P.includes("application/vnd.apache.arrow.stream");if(V)return await k.json();if(W)return await VS(k);if(B){const ee=(await k.text()).trim().replace("data: ","").trim();return JSON.parse(ee)}}).then(_).catch(D)})}function wC(n){return{"Content-Type":"application/json",...n??{}}}function SC(n){try{return JSON.stringify(n)}catch{return""}}function HS(n="/"){let e=`${Rl(window.__BASE_URL__)?"/":window.__BASE_URL__}/${n}`;for(;e.includes("//");)e=e.replaceAll("//","/");return e}const pc={python:"python",sql:"sql",seed:"seed",external:"external",source:"source"},Nr={editor:"editor",files:"files","data-catalog":"data-catalog",plans:"plans",tests:"tests",audits:"audits",errors:"errors",data:"data",lineage:"lineage"},kO={NUMBER_1:1,NUMBER_2:2,NUMBER_3:3},PO={init:"init",success:"success",fail:"fail"},_C=(n,e)=>Nt({url:"/api/commands/apply",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),bC=(n,e)=>Nt({url:"/api/commands/evaluate",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),IC=(n,e)=>Nt({url:"/api/commands/fetchdf",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),EC=(n,e)=>Nt({url:"/api/commands/render",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),xC=n=>Nt({url:"/api/files",method:"GET"},n),DC=(n,e)=>Nt({url:`/api/files/${n}`,method:"GET"},e),CC=(n,e,t)=>Nt({url:`/api/files/${n}`,method:"POST",headers:{"Content-Type":"application/json"},data:e},t),TO=(n,e)=>Nt({url:`/api/files/${n}`,method:"DELETE"},e),NO=(n,e,t)=>Nt({url:`/api/directories/${n}`,method:"POST",headers:{"Content-Type":"application/json"},data:e},t),BO=(n,e)=>Nt({url:`/api/directories/${n}`,method:"DELETE"},e),OC=(n,e)=>Nt({url:"/api/plan",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),RC=n=>Nt({url:"/api/plan/cancel",method:"POST"},n),FC=n=>Nt({url:"/api/environments",method:"GET"},n),UO=(n,e)=>Nt({url:`/api/environments/${n}`,method:"DELETE"},e),MC=(n,e,t,s)=>Nt({url:`/api/lineage/${n}/${e}`,method:"GET",params:t},s),LC=(n,e)=>Nt({url:`/api/lineage/${n}`,method:"GET"},e),AC=n=>Nt({url:"/api/models",method:"GET"},n),kC=(n,e)=>Nt({url:`/api/models/${n}`,method:"GET"},e),PC=n=>Nt({url:"/api/meta",method:"GET"},n),TC=n=>Nt({url:"/api/modules",method:"GET"},n),NC=(n,e)=>Nt({url:"/api/table_diff",method:"GET",params:n},e),li=R.lazy(()=>vn(()=>import("./Root-DyEjo8XJ.js"),[])),BC=R.lazy(()=>vn(()=>import("./Editor-DOjTVzHs.js"),[])),UC=R.lazy(()=>vn(()=>import("./Plan-Cwr9Ts3u.js"),[])),jC=R.lazy(()=>vn(()=>import("./Content-BhpD1QIh.js"),[])),zC=R.lazy(()=>vn(()=>import("./DataCatalog-HXtPC12m.js"),[])),$C=R.lazy(()=>vn(()=>import("./Tests-BjGO6Jnt.js"),[])),VC=R.lazy(()=>vn(()=>import("./Audits-CQSghR1z.js"),[])),HC=R.lazy(()=>vn(()=>import("./Data-Cx_yMlp4.js"),[])),wh=R.lazy(()=>vn(()=>import("./Models-BMTG-GKX.js"),[])),WC=R.lazy(()=>vn(()=>import("./Lineage-VCDzvguV.js"),[])),QC=R.lazy(()=>vn(()=>import("./Errors-RKQ2D8gd.js"),[])),KC=R.lazy(()=>vn(()=>import("./Content-DcS8joWy.js"),[])),wr=R.lazy(()=>vn(()=>import("./Welcome-DMIPcEFX.js"),[])),dt={Home:"/",Editor:"/editor",DataCatalog:"/data-catalog",DataCatalogModels:"/data-catalog/models",Data:"/data",Lineage:"/lineage",LineageModels:"/lineage/models",Tests:"/tests",Audits:"/audits",Errors:"/errors",Plan:"/plan",NotFound:"/not-found"},Cv={plan:[Nr.plans]};function qC(n){const e=[{path:"*",element:dd(n.list)?U.jsx(Fn,{link:dt.Home,message:"Back To Main"}):U.jsx(Fn,{headline:"Empty"})},{path:dt.Home,element:U.jsx(li,{})},...[{path:dt.Editor,element:U.jsx(li,{content:U.jsx(BC,{})})},{path:dt.DataCatalog,element:U.jsx(li,{content:U.jsx(wh,{route:dt.DataCatalog})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data Catalog",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.DataCatalog,message:"Back To Data Catalog"})},{path:"models",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data Catalog",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.DataCatalog,message:"Back To Data Catalog"})},{path:":modelName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(zC,{})})}]}]},{path:dt.Data,element:U.jsx(li,{content:U.jsx(wh,{route:dt.Data})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Data,message:"Back To Data"})},{path:"models",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Data,message:"Back To Data"})},{path:":modelName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(HC,{})})}]}]},{path:dt.Lineage,element:U.jsx(li,{content:U.jsx(wh,{route:dt.Lineage})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Lineage",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Lineage,message:"Back To Lineage"})},{path:"models",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Lineage",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Lineage,message:"Back To Lineage"})},{path:":modelName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(WC,{})})}]}]},{path:dt.Errors,element:U.jsx(li,{content:U.jsx(QC,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to errors report",tagline:"Here you can see all the errors that occurred."})},{path:"*",element:U.jsx(Fn,{link:dt.Errors,message:"Back To Errors"})},{path:":id",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(KC,{})})}]},{path:dt.Plan,element:U.jsx(li,{content:U.jsx(UC,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to plan",tagline:"Here you can run the plan and apply the changes."})},{path:"*",element:U.jsx(Fn,{link:dt.Plan,message:"Back To Plan"})},{path:"environments",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to plan",tagline:"Here you can run the plan and apply the changes."})},{path:"*",element:U.jsx(Fn,{link:dt.Plan,message:"Back To Plan"})},{path:":environmentName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(jC,{})})}]}]},{path:dt.Tests,element:U.jsx(li,{content:U.jsx($C,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to tests report",tagline:"Here you can run tests and see the results."})},{path:"*",element:U.jsx(Fn,{link:dt.Tests,message:"Back To Tests"})}]},{path:dt.Audits,element:U.jsx(li,{content:U.jsx(VC,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to audits report",tagline:"Here you can run audits and see the results."})},{path:"*",element:U.jsx(Fn,{link:dt.Audits,message:"Back To Audits"})}]}].filter(t=>{var a;const s=t.path.replace("/","");return Zt(Cv[s])?n.list.includes(s):(a=Cv[s])==null?void 0:a.some(u=>n.list.includes(u))})].filter(Boolean);return DE(e,{basename:HS()})}const Qt={API:"api",General:"general",RunPlan:"run-plan",ApplyPlan:"apply-plan",CancelPlan:"cancel-plan",Environments:"environments",Models:"models",Fetchdf:"fetchdf",EvaluateModel:"evaluate-model",RenderQuery:"render-query",ColumnLineage:"column-lineage",ModelLineage:"model-lineage",Meta:"meta",Modules:"modules",FileExplorer:"file-explorer",Table:"table",TableDiff:"table-diff",SaveFile:"save-file"},WS=R.createContext({errors:new Set,addError:()=>({removeError:()=>{},error:{}}),removeError:()=>{},clearErrors:()=>{}});function YC({children:n}){const[e,t]=R.useState(new Set);function s(d,f){const p={id:Sh(),key:d,status:f.status,timestamp:f.timestamp??Date.now(),message:f.message,description:f.description,type:f.type,origin:f.origin,trigger:f.trigger,stack:f.stack,traceback:f.traceback};return t(m=>new Set(m.add(p))),{removeError:()=>a(p),error:p}}function a(d){t(f=>(f.forEach(p=>{(p===d||p.key===d)&&f.delete(p)}),new Set(f)))}function u(){t(new Set)}return U.jsx(WS.Provider,{value:{errors:e,addError:s,removeError:a,clearErrors:u},children:n})}function Tp(){return R.useContext(WS)}const QS=60*1e3,GC=5*QS,vd=10*QS;function JC(n){return ln({queryKey:["/api/modules"],queryFn:TC,enabled:!0},{...n,errorKey:Qt.Modules,trigger:"API -> useApiModules"})}function jO(n){return ln({queryKey:["/api/meta"],queryFn:PC,enabled:!0},{...n,errorKey:Qt.Meta,trigger:"API -> useApiMeta"})}function zO(n){return ln({queryKey:["/api/models"],queryFn:AC},{...n,errorKey:Qt.Models,trigger:"API -> useApiModels"})}function $O(n,e){return ln({queryKey:["/api/models",n],queryFn:async({signal:t})=>await kC(n,{signal:t})},{...e,errorKey:Qt.Models,trigger:"API -> useApiModel"})}function VO(n){return ln({queryKey:["/api/files"],queryFn:xC},{...n,errorKey:Qt.FileExplorer,trigger:"API -> useApiFiles"})}function HO(n,e){return ln({queryKey:["/api/files",n],queryFn:async({signal:t})=>await DC(n,{signal:t})},{...e,errorKey:Qt.FileExplorer,trigger:"API -> useApiFileByPath"})}function WO(n,e){return ln({queryKey:["/api/lineage",n],queryFn:async({signal:t})=>await LC(n,{signal:t})},{...e,errorKey:Qt.ModelLineage,trigger:"API -> useApiModelLineage"})}function QO(n,e,t,s){return ln({queryKey:["/api/lineage",n,e],queryFn:async({signal:a})=>await MC(n,e,s,{signal:a})},{...t,errorKey:Qt.ColumnLineage,trigger:"API -> useApiColumnLineage"})}function KO(n){return ln({queryKey:["/api/environments"],queryFn:FC},{...n,errorKey:Qt.Environments,trigger:"API -> useApiEnvironments"})}function qO(n){return ln({queryKey:["/api/commands/apply"],queryFn:RC},{...n,errorKey:Qt.CancelPlan,trigger:"API -> useApiCancelPlan"})}function YO(n,e,t){return ln({queryKey:["/api/plan",n],async queryFn({signal:s}){return await OC({environment:n,plan_dates:e==null?void 0:e.planDates,plan_options:e==null?void 0:e.planOptions,categories:e==null?void 0:e.categories},{signal:s})}},{...t,errorKey:Qt.RunPlan,trigger:"API -> useApiPlanRun"})}function GO(n,e,t){return ln({queryKey:["/api/commands/apply",n],async queryFn({signal:s}){return await _C({environment:n,plan_dates:e==null?void 0:e.planDates,plan_options:e==null?void 0:e.planOptions,categories:e==null?void 0:e.categories},{signal:s})}},{...t,errorKey:Qt.ApplyPlan,trigger:"API -> useApiPlanApply"})}function JO(n,e){return ln({queryKey:["/api/commands/fetchd"],queryFn:async({signal:t})=>await IC(n,{signal:t})},{...e,errorKey:Qt.Fetchdf,trigger:"API -> useApiFetchdf",delay:vd})}function XO(n,e){return ln({queryKey:["/api/commands/render"],queryFn:async({signal:t})=>await EC(n,{signal:t})},{...e,errorKey:Qt.RenderQuery,trigger:"API -> useApiRender",delay:vd})}function ZO(n,e){return ln({queryKey:["/api/commands/table_diff"],queryFn:async({signal:t})=>await NC(n,{signal:t})},{...e,errorKey:Qt.TableDiff,trigger:"API -> useApiTableDiff",delay:vd})}function eR(n,e){return ln({queryKey:["/api/commands/evaluate"],queryFn:async({signal:t})=>await bC(n,{signal:t})},{...e,errorKey:Qt.EvaluateModel,trigger:"API -> useApiEvaluate",delay:vd})}function tR(n){const{addError:e}=Tp();return Ob({mutationFn:async({path:t,body:s})=>await CC(t,s),onError(t){e(Qt.SaveFile,t)},async onMutate({path:t}){await n.cancelQueries({queryKey:["/api/files",t]})}})}function ln(n,{delay:e=GC,removeTimeoutErrorAfter:t,errorKey:s=Qt.API,trigger:a}){const u=n.queryKey.join(" -> "),d=rp(),{addError:f}=Tp(),[p,m]=R.useState(!1);let g,v=function(){console.log(`[REQUEST TIMEOUT] ${u} id: ${String(g)} timed out after ${e}ms`);const{removeError:q}=f(s,{message:"Request timed out",description:`Request ${u} with timeoutId: ${String(g)} timed out after ${e}ms`,timestamp:Date.now(),origin:"useQueryTimeout",trigger:a});m(!0),D(),yn(t)&&setTimeout(()=>q(),t)};function S(){console.log(`[CLEAR TIMEOUT] ${u} id: ${String(g)} at ${Date.now()}`),clearTimeout(g),g=void 0,v=void 0}function _(){g=setTimeout(()=>{v==null||v()},e),console.log(`[START TIMEOUT] ${u} id: ${String(g)} at ${Date.now()}`)}function D(){S(),d.cancelQueries({queryKey:n.queryKey}),console.log(`[REQUEST CANCELED] ${u} at ${Date.now()}`)}function k(W){S(),mc(W)||W.name==="AbortError"?console.log(`[REQUEST ABORTED] ${u} aborted by React Query at ${Date.now()}`):(console.log(`[REQUEST FAILED] ${u} failed at ${Date.now()}`),f(s,W))}function P(){S(),console.log(`[REQUEST COMPLETED] ${u} completed at ${Date.now()}`)}async function B(...W){return _(),n.queryFn(...W)}const V=Cb({gcTime:0,enabled:!1,queryKey:n.queryKey,queryFn:B,meta:{...n.meta,onError:k,onSuccess:P}});return{...V,refetch:async(...W)=>new Promise(q=>{V.refetch(...W,{throwOnError:!0}).then(q).catch(ee=>ee)}),cancel:D,isTimeout:p}}class KS{constructor(e){Ct(this,"_initial");Ct(this,"isModel",!0);Zt(e)?this._initial=Object.assign({id:Sh()}):this._initial=yn(e==null?void 0:e.id)?e:new Proxy(Object.assign(e??{},{id:Sh()}),{set(){throw new Error("Cannot change initial file")}})}get initial(){return this._initial}get id(){return this.initial.id}}class Ov extends KS{constructor(t=[]){super();Ct(this,"modules",new Set);this.modules=new Set(t)}get list(){return Array.from(this.modules)}get isEmpty(){return this.modules.size===0}get hasErrors(){return this.modules.has(Nr.errors)}get hasEditor(){return this.modules.has(Nr.editor)}get hasFiles(){return this.modules.has(Nr.files)}get hasProjectEditor(){return this.hasEditor&&this.hasFiles}get hasOnlyProjectEditor(){return this.modules.size===2&&this.hasProjectEditor}get hasOnlyDataCatalog(){return this.modules.size===1&&this.hasDataCatalog}get hasProjectEditorAndModule(){return this.modules.size===3&&this.hasProjectEditor&&hs(this.hasErrors)}get hasDataCatalog(){return this.modules.has(Nr["data-catalog"])}get hasPlans(){return this.modules.has(Nr.plans)}get hasOnlyPlans(){return this.modules.size===1&&this.hasPlans}get hasOnlyPlansAndErrors(){return this.modules.size===2&&this.hasPlans&&this.hasErrors}get hasTests(){return this.modules.has(Nr.tests)}get hasAudits(){return this.modules.has(Nr.audits)}get hasData(){return this.modules.has(Nr.data)}get hasLineage(){return this.modules.has(Nr.lineage)}get hasModuleAndErrors(){return this.hasErrors&&(this.modules.size===2||this.modules.size===3&&this.hasProjectEditor)}get hasSingleModule(){return this.modules.size===1}get showModuleNavigation(){return this.isEmpty||this.hasSingleModule||this.hasOnlyProjectEditor||this.hasModuleAndErrors||this.hasOnlyDataCatalog?!1:this.hasProjectEditorAndModule?!0:hs(this.isEmpty)}get showHistoryNavigation(){return this.hasOnlyProjectEditor||this.hasModuleAndErrors||this.hasOnlyDataCatalog?!1:this.hasProjectEditorAndModule||this.hasDataCatalog?!0:hs(this.isEmpty)}get showNavigation(){return this.hasErrors||this.hasPlans||this.showHistoryNavigation}update(t=[]){this.modules=new Set(t)}defaultNavigationRoute(){return this.hasEditor?dt.Editor:this.hasPlans?dt.Plan:this.hasDataCatalog?dt.DataCatalog:dt.NotFound}}class XC extends KS{constructor(t){super(t!=null&&t.isModel?t.initial:{...t,dialect:(t==null?void 0:t.dialect)??"Default",columns:(t==null?void 0:t.columns)??[],details:(t==null?void 0:t.details)??{}});Ct(this,"_details",{});Ct(this,"_detailsIndex","");Ct(this,"name");Ct(this,"fqn");Ct(this,"path");Ct(this,"full_path");Ct(this,"dialect");Ct(this,"type");Ct(this,"columns");Ct(this,"default_catalog");Ct(this,"description");Ct(this,"sql");Ct(this,"definition");Ct(this,"hash");this.name=encodeURI(this.initial.name),this.fqn=encodeURI(this.initial.fqn),this.default_catalog=this.initial.default_catalog,this.path=this.initial.path,this.full_path=this.initial.full_path,this.dialect=this.initial.dialect,this.description=this.initial.description,this.sql=this.initial.sql,this.definition=this.initial.definition,this.columns=this.initial.columns??[],this.type=this.initial.type,this.hash=this.initial.hash,this.details=this.initial.details??{}}get defaultCatalog(){return this.default_catalog}get details(){return this._details}set details(t){const s=[];for(const a of Object.values(t))dd(a)?a.forEach(u=>{s.push(...Object.values(u))}):s.push(a);this._details=t,this._detailsIndex=s.join(" ")}get index(){return[this.displayName,this.path,this.type,...this.columns.map(t=>Object.values(t)).flat(),this._detailsIndex,this.dialect,this.description].filter(Boolean).join(" ").toLowerCase()}get isModelPython(){return this.type===pc.python}get isModelSQL(){return this.type===pc.sql}get isModelSeed(){return this.type===pc.seed}get isModelExternal(){return this.type===pc.external}get displayName(){return decodeURI(this.name)}update(t={}){for(const[s,a]of Object.entries(t))s==="columns"?this.columns=a:s==="details"?this.details=a:s==="name"?this.name=encodeURI(a):s==="fqn"?this.fqn=encodeURI(a):s==="type"?this.type=a:s==="default_catalog"?this.default_catalog=a:s==="description"?this.description=a:s in this&&(this[s]=a)}}const Rv=n=>{let e;const t=new Set,s=(m,g)=>{const v=typeof m=="function"?m(e):m;if(!Object.is(v,e)){const S=e;e=g??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(_=>_(e,S))}},a=()=>e,f={setState:s,getState:a,getInitialState:()=>p,subscribe:m=>(t.add(m),()=>t.delete(m))},p=e=n(s,a,f);return f},ZC=n=>n?Rv(n):Rv,eO=n=>n;function tO(n,e=eO){const t=Xs.useSyncExternalStore(n.subscribe,()=>e(n.getState()),()=>e(n.getInitialState()));return Xs.useDebugValue(t),t}const Fv=n=>{const e=ZC(n),t=s=>tO(e,s);return Object.assign(t,e),t},nO=n=>n?Fv(n):Fv,gl={Empty:"",Prod:"prod"},vi={Local:"local",Remote:"remote"},[Mv,rO]=Xv("profile");class on{constructor(e,t,s=gl.Prod,a=!1,u=!1){Ct(this,"_initial");Ct(this,"_type");Ct(this,"_createFrom");Ct(this,"_isPinned",!1);Ct(this,"_isDefault",!1);Ct(this,"isModel",!0);this._initial=e,this._type=t??vi.Local,this._createFrom=this._isDefault?gl.Empty:s,this._isPinned=a,this._isDefault=u}get id(){return this._initial.plan_id??""}get name(){return this._initial.name??gl.Empty}get type(){return this._type}get createFrom(){return this._createFrom}get isProd(){return this.name===gl.Prod}get isDefault(){return this._isDefault}set isDefault(e){this._isDefault=e}get isPinned(){return this._isPinned||this.isDefault||this.isProd}set isPinned(e){this._isPinned=e}get isInitial(){var e;return Rl((e=this._initial)==null?void 0:e.plan_id)}get isLocal(){return this._type===vi.Local}get isRemote(){return this._type===vi.Remote}get isSyncronized(){return this.isRemote&&hs(this.isInitial)}get isInitialProd(){return this.isInitial&&this.isProd}setType(e){this._type=e}setCreatedFrom(e){this._createFrom=e}update(e){this._initial=e}static save({environment:e,environments:t}){const s={};yn(e)&&(s.environment={name:e.name,plan_id:e.id,type:e.type,createFrom:e.createFrom,isPinned:e.isPinned,isDefault:e.isDefault}),yn(t)&&(s.environments=on.getOnlyLocal(t).map(a=>({name:a.name,plan_id:a.id,type:a.type,createFrom:a.createFrom,isPinned:a.isPinned,isDefault:a.isDefault}))),rO(s)}static getOnlyLocal(e=[]){return e.filter(t=>hs(Rl(t.name))&&t.isLocal)}static getOnlyRemote(e=[]){return e.filter(t=>hs(Rl(t.name))&&t.isRemote)}static getEnvironment(){const{environment:e}=Mv()??{};if(Zt(e))return;const{name:t,plan_id:s,type:a,createFrom:u,isPinned:d,isDefault:f}=e;return new on({name:t,plan_id:s},a,u,d,f)}static getEnvironments(){const e=Mv(),t=new Map;yn(e)&&yn(e.environment)&&t.set(e.environment.name,e.environment),yn(e)&&yn(e.environments)&&e.environments.forEach(a=>t.set(a.name,a));const s=[];return Array.from(t.entries()).forEach(([a,u])=>{s.push(new on({name:a,plan_id:u.plan_id},u.type,u.createFrom,u.isPinned,u.isDefault))}),Gv(s)&&s.push(new on({name:gl.Prod},vi.Local)),s}static sort(e){return e.sort(t=>t.isRemote?-1:1),e}}const Lv="prod",qS=new Set(on.getEnvironments()),Av=on.getEnvironment()??qS.values().next().value,kv=nO((n,e)=>({version:void 0,modules:new Ov,splitPaneSizes:[20,80],showConfirmation:!1,confirmations:[],environment:Av,environments:qS,initialStartDate:void 0,initialEndDate:void 0,models:new Map,lastSelectedModel:void 0,setLastSelectedModel(t){n(()=>({lastSelectedModel:t}))},setModules(t){n(()=>({modules:new Ov(t.list)}))},isModel(t){return e().models.has(t)},setSplitPaneSizes(t){n(()=>({splitPaneSizes:t}))},setVersion(t){n(()=>({version:t}))},setShowConfirmation(t){n(()=>({showConfirmation:t}))},addConfirmation(t){n(s=>(s.confirmations.push(t),{confirmations:Array.from(s.confirmations)}))},removeConfirmation(){const t=e();t.confirmations.shift(),n(()=>({confirmations:Array.from(t.confirmations)}))},setModels(t=[]){const s=e();n(()=>({models:t.reduce((a,u)=>{const d=new XC(u);let f=s.models.get(d.path)??s.models.get(d.name)??s.models.get(d.fqn);return Zt(f)?f=d:f.update(u),a.set(f.name,f),a.set(f.fqn,f),a.set(f.path,f),a},new Map)}))},getNextEnvironment(){return e().environments.values().next().value??Av},isExistingEnvironment(t){const s=e();if(t.isModel)return s.environments.has(t);let a=!1;return s.environments.forEach(u=>{u.name===t&&(a=!0)}),a},setEnvironment(t){n(()=>(on.save({environment:t}),{environment:t}))},addLocalEnvironment(t,s=Lv){n(a=>{if(Rl(t))return a;const u=new on({name:t},vi.Local,s);return a.environments.add(u),a.setEnvironment(u),on.save({environments:Array.from(a.environments)}),{environments:new Set(a.environments)}})},removeLocalEnvironment(t){n(s=>(s.environments.delete(t),on.save({environments:Array.from(s.environments)}),{environments:new Set(s.environments)}))},addRemoteEnvironments(t=[],s,a=[]){n(u=>{const d=Array.from(u.environments);t.forEach(_=>{let D=d.find(({name:k})=>_.name===k);Zt(D)?(D=new on(_,vi.Remote),d.push(D)):(D.update(_),D.setType(vi.Remote)),u.environment.name===_.name&&u.environment.update(_),D.isInitial&&D.isDefault&&u.setEnvironment(D)}),a.forEach(_=>{const D=d.find(({name:k})=>_===k);Zt(D)?d.push(new on({name:_},vi.Local,void 0,!0)):D.isPinned=!0});const f=on.getEnvironment();let p,m,g;d.forEach(_=>{switch(_.name){case Lv:p=_;break;case(f==null?void 0:f.name):m=_;break;case s:_.isDefault=!0,g=_}});const v=u.environment??m??g,S=B1(p==null?void 0:p.isInitial)?p:v;return on.save({environments:d,environment:S}),on.sort(d),{environment:S,environments:new Set(d)}})},hasRemoteEnvironments(){const t=e();return Array.from(t.environments).some(({type:s})=>s===vi.Remote)}}));function Pv({children:n,className:e}){return U.jsx("div",{className:qr("flex justify-center items-center w-full h-full",e),children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:n})]})})}const YS=!!(window.__IS_HEADLESS__??!1),Tv=YS?void 0:R.lazy(()=>vn(()=>import("./Header-mC2S0YQz.js"),[])),Nv=YS?void 0:R.lazy(()=>vn(()=>import("./Footer-CpMoFxgd.js"),[]));function iO(){const{addError:n}=Tp(),e=kv(f=>f.modules),t=kv(f=>f.setModules),{refetch:s,cancel:a,isFetching:u}=JC();R.useEffect(()=>(s().then(({data:f})=>{e.update(f),t(e)}).catch(f=>n(Qt.Modules,f)),()=>{a()}),[]);const d=qC(e);return U.jsxs(U.Fragment,{children:[yn(Tv)&&U.jsxs(U.Fragment,{children:[U.jsx(Tv,{}),U.jsx(Gg,{})]}),U.jsx("main",{className:"h-full overflow-hidden relative",children:u?U.jsx(Pv,{className:"absolute w-full h-full bg-theme z-10",children:"Building Modules..."}):U.jsx(R.Suspense,{fallback:U.jsx(Pv,{children:"Loading Page..."}),children:dd(e.list)?U.jsx(ZI,{router:d}):U.jsx(Fn,{description:"No Modules Found"})})}),yn(Nv)&&U.jsxs(U.Fragment,{children:[U.jsx(Gg,{}),U.jsx(Nv,{})]})]})}const sO=new cb({queryCache:new u0({onError(n,e){e.meta.onError(n)},onSuccess(n,e){e.meta.onSuccess()}}),defaultOptions:{queries:{networkMode:"always",refetchOnWindowFocus:!1,retry:!1,staleTime:1/0}}});Y1.createRoot(oO()).render(U.jsx(Xs.StrictMode,{children:U.jsx(mb,{client:sO,children:U.jsx($1,{children:U.jsx(YC,{children:U.jsx(iO,{})})})})}));function oO(){const n="root";let e=document.getElementById(n);if(yn(e))return e;const t=document.body,s=t.children[0];return e=document.createElement("div"),e.id=n,e.className="h-full w-full flex flex-col justify-start",s instanceof HTMLElement?t.insertBefore(e,s):t.appendChild(e),e}export{KS as $,PO as A,FO as B,cO as C,Gv as D,Po as E,Qt as F,U0 as G,Gg as H,Rl as I,kO as J,vO as K,No as L,on as M,RE as N,DO as O,yO as P,xO as Q,Xs as R,zs as S,WE as T,Fn as U,bO as V,fO as W,j0 as X,RO as Y,UO as Z,vn as _,kv as a,nO as a0,qv as a1,Yv as a2,$O as a3,mO as a4,XO as a5,eR as a6,Pv as a7,_O as a8,dO as a9,OO as aA,WO as aB,U1 as aa,NO as ab,CC as ac,TO as ad,BO as ae,ZO as af,JO as ag,IC as ah,lO as ai,Xh as aj,SO as ak,CO as al,rp as am,HO as an,tR as ao,wO as ap,hO as aq,QO as ar,pc as as,uO as at,Jg as au,MO as av,LO as aw,Q1 as ax,Xv as ay,Sh as az,hs as b,qr as c,Tp as d,dt as e,B1 as f,dd as g,KO as h,yn as i,U as j,YO as k,Tt as l,ft as m,pO as n,GO as o,qO as p,gO as q,R as r,kI as s,zO as t,IO as u,Zt as v,HS as w,ro as x,jO as y,VO as z};
58
+ ]`}concat(...e){const t=this.schema,s=this.data.concat(e.flatMap(({data:a})=>a));return new rr(t,s.map(a=>new Er(t,a)))}slice(e,t){const s=this.schema;[e,t]=pS({length:this.numRows},e,t);const a=vS(this.data,this._offsets,e,t);return new rr(s,a.map(u=>new Er(s,u)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){const t=this.data.map(s=>s.children[e]);if(t.length===0){const{type:s}=this.schema.fields[e],a=$e({type:s,length:0,nullCount:0});t.push(a._changeLengthAndBackfillNullBitmap(this.numRows))}return new ht(t)}return null}setChild(e,t){var s;return this.setChildAt((s=this.schema.fields)===null||s===void 0?void 0:s.findIndex(a=>a.name===e),t)}setChildAt(e,t){let s=this.schema,a=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new ht([$e({type:new ms,length:this.numRows})]));const u=s.fields.slice(),d=u[e].clone({type:t.type}),f=this.schema.fields.map((p,m)=>this.getChildAt(m));[u[e],f[e]]=[d,t],[s,a]=gh(s,f)}return new rr(s,a)}select(e){const t=this.schema.fields.reduce((s,a,u)=>s.set(a.name,u),new Map);return this.selectAt(e.map(s=>t.get(s)).filter(s=>s>-1))}selectAt(e){const t=this.schema.selectAt(e),s=this.batches.map(a=>a.selectAt(e));return new rr(t,s)}assign(e){const t=this.schema.fields,[s,a]=e.schema.fields.reduce((f,p,m)=>{const[g,v]=f,S=t.findIndex(_=>_.name===p.name);return~S?v[S]=m:g.push(m),f},[[],[]]),u=this.schema.assign(e.schema),d=[...t.map((f,p)=>[p,a[p]]).map(([f,p])=>p===void 0?this.getChildAt(f):e.getChildAt(p)),...s.map(f=>e.getChildAt(f))].filter(Boolean);return new rr(...gh(u,d))}}OS=Symbol.toStringTag;rr[OS]=(n=>(n.schema=null,n.batches=[],n._offsets=new Uint32Array([0]),n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,n.isValid=td(Dp),n.get=td(Tn.getVisitFn(C.Struct)),n.set=wS(or.getVisitFn(C.Struct)),n.indexOf=SS(nd.getVisitFn(C.Struct)),"Table"))(rr.prototype);var RS;let Er=class Ol{constructor(...e){switch(e.length){case 2:{if([this.schema]=e,!(this.schema instanceof rt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=$e({nullCount:0,type:new gn(this.schema.fields),children:this.schema.fields.map(t=>$e({type:t.type,nullCount:0}))})]=e,!(this.data instanceof wt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=vv(this.schema,this.data.children);break}case 1:{const[t]=e,{fields:s,children:a,length:u}=Object.keys(t).reduce((p,m,g)=>(p.children[g]=t[m],p.length=Math.max(p.length,t[m].length),p.fields[g]=Et.new({name:m,type:t[m].type,nullable:!0}),p),{length:0,fields:new Array,children:new Array}),d=new rt(s),f=$e({type:new gn(s),length:u,children:a,nullCount:0});[this.schema,this.data]=vv(d,f.children,u);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=FS(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 Tn.visit(this.data,e)}at(e){return this.get(Ip(e,this.numRows))}set(e,t){return or.visit(this.data,e,t)}indexOf(e,t){return nd.visit(this.data,e,t)}[Symbol.iterator](){return Cp.visit(new ht([this.data]))}toArray(){return[...this]}concat(...e){return new rr(this.schema,[this,...e])}slice(e,t){const[s]=new ht([this.data]).slice(e,t).data;return new Ol(this.schema,s)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(s=>s.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new ht([this.data.children[e]]):null}setChild(e,t){var s;return this.setChildAt((s=this.schema.fields)===null||s===void 0?void 0:s.findIndex(a=>a.name===e),t)}setChildAt(e,t){let s=this.schema,a=this.data;if(e>-1&&e<this.numCols){t||(t=new ht([$e({type:new ms,length:this.numRows})]));const u=s.fields.slice(),d=a.children.slice(),f=u[e].clone({type:t.type});[u[e],d[e]]=[f,t.data[0]],s=new rt(u,new Map(this.schema.metadata)),a=$e({type:new gn(u),children:d})}return new Ol(s,a)}select(e){const t=this.schema.select(e),s=new gn(t.fields),a=[];for(const u of e){const d=this.schema.fields.findIndex(f=>f.name===u);~d&&(a[d]=this.data.children[d])}return new Ol(t,$e({type:s,length:this.numRows,children:a}))}selectAt(e){const t=this.schema.selectAt(e),s=e.map(u=>this.data.children[u]).filter(Boolean),a=$e({type:new gn(t.fields),length:this.numRows,children:s});return new Ol(t,a)}};RS=Symbol.toStringTag;Er[RS]=(n=>(n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Er.prototype);function vv(n,e,t=e.reduce((s,a)=>Math.max(s,a.length),0)){var s;const a=[...n.fields],u=[...e],d=(t+63&-64)>>3;for(const[f,p]of n.fields.entries()){const m=e[f];(!m||m.length!==t)&&(a[f]=p.clone({nullable:!0}),u[f]=(s=m==null?void 0:m._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:$e({type:p.type,length:t,nullCount:t,nullBitmap:new Uint8Array(d)}))}return[n.assign(a),$e({type:new gn(a),length:t,children:u})]}function FS(n,e,t=new Map){var s,a;if(((s=n==null?void 0:n.length)!==null&&s!==void 0?s:0)>0&&(n==null?void 0:n.length)===(e==null?void 0:e.length))for(let u=-1,d=n.length;++u<d;){const{type:f}=n[u],p=e[u];for(const m of[p,...((a=p==null?void 0:p.dictionary)===null||a===void 0?void 0:a.data)||[]])FS(f.children,m==null?void 0:m.children,t);if(de.isDictionary(f)){const{id:m}=f;if(!t.has(m))p!=null&&p.dictionary&&t.set(m,p.dictionary);else if(t.get(m)!==p.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return t}class MS extends Er{constructor(e){const t=e.fields.map(a=>$e({type:a.type})),s=$e({type:new gn(e.fields),nullCount:0,children:t});super(e,s)}}let Gi=class Tr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new Tr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+st),(t||new Tr).__init(e.readInt32(e.position())+e.position(),e)}version(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ut.V1}headerType(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):nt.NONE}header(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){const s=this.bb.__offset(this.bb_pos,12);return s?(t||new Wt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Ut.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,nt.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let s=t.length-1;s>=0;s--)e.addOffset(t[s]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,s,a,u,d){return Tr.startMessage(e),Tr.addVersion(e,t),Tr.addHeaderType(e,s),Tr.addHeader(e,a),Tr.addBodyLength(e,u),Tr.addCustomMetadata(e,d),Tr.endMessage(e)}};class ND extends Ve{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return lv.startNull(t),lv.endNull(t)}visitInt(e,t){return Hn.startInt(t),Hn.addBitWidth(t,e.bitWidth),Hn.addIsSigned(t,e.isSigned),Hn.endInt(t)}visitFloat(e,t){return Hr.startFloatingPoint(t),Hr.addPrecision(t,e.precision),Hr.endFloatingPoint(t)}visitBinary(e,t){return rv.startBinary(t),rv.endBinary(t)}visitLargeBinary(e,t){return sv.startLargeBinary(t),sv.endLargeBinary(t)}visitBool(e,t){return iv.startBool(t),iv.endBool(t)}visitUtf8(e,t){return uv.startUtf8(t),uv.endUtf8(t)}visitLargeUtf8(e,t){return ov.startLargeUtf8(t),ov.endLargeUtf8(t)}visitDecimal(e,t){return jo.startDecimal(t),jo.addScale(t,e.scale),jo.addPrecision(t,e.precision),jo.addBitWidth(t,e.bitWidth),jo.endDecimal(t)}visitDate(e,t){return _c.startDate(t),_c.addUnit(t,e.unit),_c.endDate(t)}visitTime(e,t){return tr.startTime(t),tr.addUnit(t,e.unit),tr.addBitWidth(t,e.bitWidth),tr.endTime(t)}visitTimestamp(e,t){const s=e.timezone&&t.createString(e.timezone)||void 0;return nr.startTimestamp(t),nr.addUnit(t,e.unit),s!==void 0&&nr.addTimezone(t,s),nr.endTimestamp(t)}visitInterval(e,t){return Wr.startInterval(t),Wr.addUnit(t,e.unit),Wr.endInterval(t)}visitDuration(e,t){return bc.startDuration(t),bc.addUnit(t,e.unit),bc.endDuration(t)}visitList(e,t){return av.startList(t),av.endList(t)}visitStruct(e,t){return Vs.startStruct_(t),Vs.endStruct_(t)}visitUnion(e,t){kn.startTypeIdsVector(t,e.typeIds.length);const s=kn.createTypeIdsVector(t,e.typeIds);return kn.startUnion(t),kn.addMode(t,e.mode),kn.addTypeIds(t,s),kn.endUnion(t)}visitDictionary(e,t){const s=this.visit(e.indices,t);return gi.startDictionaryEncoding(t),gi.addId(t,BigInt(e.id)),gi.addIsOrdered(t,e.isOrdered),s!==void 0&&gi.addIndexType(t,s),gi.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Ic.startFixedSizeBinary(t),Ic.addByteWidth(t,e.byteWidth),Ic.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Ec.startFixedSizeList(t),Ec.addListSize(t,e.listSize),Ec.endFixedSizeList(t)}visitMap(e,t){return xc.startMap(t),xc.addKeysSorted(t,e.keysSorted),xc.endMap(t)}}const vh=new ND;function BD(n,e=new Map){return new rt(jD(n,e),Cc(n.metadata),e)}function LS(n){return new Cr(n.count,AS(n.columns),kS(n.columns))}function UD(n){return new bi(LS(n.data),n.id,n.isDelta)}function jD(n,e){return(n.fields||[]).filter(Boolean).map(t=>Et.fromJSON(t,e))}function wv(n,e){return(n.children||[]).filter(Boolean).map(t=>Et.fromJSON(t,e))}function AS(n){return(n||[]).reduce((e,t)=>[...e,new Ia(t.count,zD(t.VALIDITY)),...AS(t.children)],[])}function kS(n,e=[]){for(let t=-1,s=(n||[]).length;++t<s;){const a=n[t];a.VALIDITY&&e.push(new wi(e.length,a.VALIDITY.length)),a.TYPE_ID&&e.push(new wi(e.length,a.TYPE_ID.length)),a.OFFSET&&e.push(new wi(e.length,a.OFFSET.length)),a.DATA&&e.push(new wi(e.length,a.DATA.length)),e=kS(a.children,e)}return e}function zD(n){return(n||[]).reduce((e,t)=>e+ +(t===0),0)}function $D(n,e){let t,s,a,u,d,f;return!e||!(u=n.dictionary)?(d=_v(n,wv(n,e)),a=new Et(n.name,d,n.nullable,Cc(n.metadata))):e.has(t=u.id)?(s=(s=u.indexType)?Sv(s):new Bl,f=new ga(e.get(t),s,t,u.isOrdered),a=new Et(n.name,f,n.nullable,Cc(n.metadata))):(s=(s=u.indexType)?Sv(s):new Bl,e.set(t,d=_v(n,wv(n,e))),f=new ga(d,s,t,u.isOrdered),a=new Et(n.name,f,n.nullable,Cc(n.metadata))),a||null}function Cc(n=[]){return new Map(n.map(({key:e,value:t})=>[e,t]))}function Sv(n){return new to(n.isSigned,n.bitWidth)}function _v(n,e){const t=n.type.name;switch(t){case"NONE":return new ms;case"null":return new ms;case"binary":return new Uc;case"largebinary":return new jc;case"utf8":return new zc;case"largeutf8":return new $c;case"bool":return new Vc;case"list":return new Gc((e||[])[0]);case"struct":return new gn(e||[]);case"struct_":return new gn(e||[])}switch(t){case"int":{const s=n.type;return new to(s.isSigned,s.bitWidth)}case"floatingpoint":{const s=n.type;return new Bc(an[s.precision])}case"decimal":{const s=n.type;return new Hc(s.scale,s.precision,s.bitWidth)}case"date":{const s=n.type;return new Wc(sr[s.unit])}case"time":{const s=n.type;return new Qc(Ie[s.unit],s.bitWidth)}case"timestamp":{const s=n.type;return new Kc(Ie[s.unit],s.timezone)}case"interval":{const s=n.type;return new qc(Gr[s.unit])}case"duration":{const s=n.type;return new Yc(Ie[s.unit])}case"union":{const s=n.type,[a,...u]=(s.mode+"").toLowerCase(),d=a.toUpperCase()+u.join("");return new Jc(Pn[d],s.typeIds||[],e||[])}case"fixedsizebinary":{const s=n.type;return new Xc(s.byteWidth)}case"fixedsizelist":{const s=n.type;return new Zc(s.listSize,(e||[])[0])}case"map":{const s=n.type;return new ed((e||[])[0],s.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}var VD=q0,HD=ma;class xr{static fromJSON(e,t){const s=new xr(0,Ut.V5,t);return s._createHeader=WD(e,t),s}static decode(e){e=new HD(Je(e));const t=Gi.getRootAsMessage(e),s=t.bodyLength(),a=t.version(),u=t.headerType(),d=new xr(s,a,u);return d._createHeader=QD(t,u),d}static encode(e){const t=new VD;let s=-1;return e.isSchema()?s=rt.encode(t,e.header()):e.isRecordBatch()?s=Cr.encode(t,e.header()):e.isDictionaryBatch()&&(s=bi.encode(t,e.header())),Gi.startMessage(t),Gi.addVersion(t,Ut.V5),Gi.addHeader(t,s),Gi.addHeaderType(t,e.headerType),Gi.addBodyLength(t,BigInt(e.bodyLength)),Gi.finishMessageBuffer(t,Gi.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof rt)return new xr(0,Ut.V5,nt.Schema,e);if(e instanceof Cr)return new xr(t,Ut.V5,nt.RecordBatch,e);if(e instanceof bi)return new xr(t,Ut.V5,nt.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===nt.Schema}isRecordBatch(){return this.headerType===nt.RecordBatch}isDictionaryBatch(){return this.headerType===nt.DictionaryBatch}constructor(e,t,s,a){this._version=t,this._headerType=s,this.body=new Uint8Array(0),a&&(this._createHeader=()=>a),this._bodyLength=It(e)}}class Cr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,s){this._nodes=t,this._buffers=s,this._length=It(e)}}class bi{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,t,s=!1){this._data=e,this._isDelta=s,this._id=It(t)}}class wi{constructor(e,t){this.offset=It(e),this.length=It(t)}}class Ia{constructor(e,t){this.length=It(e),this.nullCount=It(t)}}function WD(n,e){return()=>{switch(e){case nt.Schema:return rt.fromJSON(n);case nt.RecordBatch:return Cr.fromJSON(n);case nt.DictionaryBatch:return bi.fromJSON(n)}throw new Error(`Unrecognized Message type: { name: ${nt[e]}, type: ${e} }`)}}function QD(n,e){return()=>{switch(e){case nt.Schema:return rt.decode(n.header(new Br),new Map,n.version());case nt.RecordBatch:return Cr.decode(n.header(new di),n.version());case nt.DictionaryBatch:return bi.decode(n.header(new Bo),n.version())}throw new Error(`Unrecognized Message type: { name: ${nt[e]}, type: ${e} }`)}}Et.encode=rC;Et.decode=tC;Et.fromJSON=$D;rt.encode=nC;rt.decode=KD;rt.fromJSON=BD;Cr.encode=iC;Cr.decode=qD;Cr.fromJSON=LS;bi.encode=sC;bi.decode=YD;bi.fromJSON=UD;Ia.encode=oC;Ia.decode=JD;wi.encode=aC;wi.decode=GD;function KD(n,e=new Map,t=Ut.V5){const s=eC(n,e);return new rt(s,Oc(n),e,t)}function qD(n,e=Ut.V5){if(n.compression()!==null)throw new Error("Record batch compression not implemented");return new Cr(n.length(),XD(n),ZD(n,e))}function YD(n,e=Ut.V5){return new bi(Cr.decode(n.data(),e),n.id(),n.isDelta())}function GD(n){return new wi(n.offset(),n.length())}function JD(n){return new Ia(n.length(),n.nullCount())}function XD(n){const e=[];for(let t,s=-1,a=-1,u=n.nodesLength();++s<u;)(t=n.nodes(s))&&(e[++a]=Ia.decode(t));return e}function ZD(n,e){const t=[];for(let s,a=-1,u=-1,d=n.buffersLength();++a<d;)(s=n.buffers(a))&&(e<Ut.V4&&(s.bb_pos+=8*(a+1)),t[++u]=wi.decode(s));return t}function eC(n,e){const t=[];for(let s,a=-1,u=-1,d=n.fieldsLength();++a<d;)(s=n.fields(a))&&(t[++u]=Et.decode(s,e));return t}function bv(n,e){const t=[];for(let s,a=-1,u=-1,d=n.childrenLength();++a<d;)(s=n.children(a))&&(t[++u]=Et.decode(s,e));return t}function tC(n,e){let t,s,a,u,d,f;return!e||!(f=n.dictionary())?(a=Ev(n,bv(n,e)),s=new Et(n.name(),a,n.nullable(),Oc(n))):e.has(t=It(f.id()))?(u=(u=f.indexType())?Iv(u):new Bl,d=new ga(e.get(t),u,t,f.isOrdered()),s=new Et(n.name(),d,n.nullable(),Oc(n))):(u=(u=f.indexType())?Iv(u):new Bl,e.set(t,a=Ev(n,bv(n,e))),d=new ga(a,u,t,f.isOrdered()),s=new Et(n.name(),d,n.nullable(),Oc(n))),s||null}function Oc(n){const e=new Map;if(n)for(let t,s,a=-1,u=Math.trunc(n.customMetadataLength());++a<u;)(t=n.customMetadata(a))&&(s=t.key())!=null&&e.set(s,t.value());return e}function Iv(n){return new to(n.isSigned(),n.bitWidth())}function Ev(n,e){const t=n.typeType();switch(t){case vt.NONE:return new ms;case vt.Null:return new ms;case vt.Binary:return new Uc;case vt.LargeBinary:return new jc;case vt.Utf8:return new zc;case vt.LargeUtf8:return new $c;case vt.Bool:return new Vc;case vt.List:return new Gc((e||[])[0]);case vt.Struct_:return new gn(e||[])}switch(t){case vt.Int:{const s=n.type(new Hn);return new to(s.isSigned(),s.bitWidth())}case vt.FloatingPoint:{const s=n.type(new Hr);return new Bc(s.precision())}case vt.Decimal:{const s=n.type(new jo);return new Hc(s.scale(),s.precision(),s.bitWidth())}case vt.Date:{const s=n.type(new _c);return new Wc(s.unit())}case vt.Time:{const s=n.type(new tr);return new Qc(s.unit(),s.bitWidth())}case vt.Timestamp:{const s=n.type(new nr);return new Kc(s.unit(),s.timezone())}case vt.Interval:{const s=n.type(new Wr);return new qc(s.unit())}case vt.Duration:{const s=n.type(new bc);return new Yc(s.unit())}case vt.Union:{const s=n.type(new kn);return new Jc(s.mode(),s.typeIdsArray()||[],e||[])}case vt.FixedSizeBinary:{const s=n.type(new Ic);return new Xc(s.byteWidth())}case vt.FixedSizeList:{const s=n.type(new Ec);return new Zc(s.listSize(),(e||[])[0])}case vt.Map:{const s=n.type(new xc);return new ed((e||[])[0],s.keysSorted())}}throw new Error(`Unrecognized type: "${vt[t]}" (${t})`)}function nC(n,e){const t=e.fields.map(u=>Et.encode(n,u));Br.startFieldsVector(n,t.length);const s=Br.createFieldsVector(n,t),a=e.metadata&&e.metadata.size>0?Br.createCustomMetadataVector(n,[...e.metadata].map(([u,d])=>{const f=n.createString(`${u}`),p=n.createString(`${d}`);return Wt.startKeyValue(n),Wt.addKey(n,f),Wt.addValue(n,p),Wt.endKeyValue(n)})):-1;return Br.startSchema(n),Br.addFields(n,s),Br.addEndianness(n,lC?ya.Little:ya.Big),a!==-1&&Br.addCustomMetadata(n,a),Br.endSchema(n)}function rC(n,e){let t=-1,s=-1,a=-1;const u=e.type;let d=e.typeId;de.isDictionary(u)?(d=u.dictionary.typeId,a=vh.visit(u,n),s=vh.visit(u.dictionary,n)):s=vh.visit(u,n);const f=(u.children||[]).map(g=>Et.encode(n,g)),p=Jn.createChildrenVector(n,f),m=e.metadata&&e.metadata.size>0?Jn.createCustomMetadataVector(n,[...e.metadata].map(([g,v])=>{const S=n.createString(`${g}`),_=n.createString(`${v}`);return Wt.startKeyValue(n),Wt.addKey(n,S),Wt.addValue(n,_),Wt.endKeyValue(n)})):-1;return e.name&&(t=n.createString(e.name)),Jn.startField(n),Jn.addType(n,s),Jn.addTypeType(n,d),Jn.addChildren(n,p),Jn.addNullable(n,!!e.nullable),t!==-1&&Jn.addName(n,t),a!==-1&&Jn.addDictionary(n,a),m!==-1&&Jn.addCustomMetadata(n,m),Jn.endField(n)}function iC(n,e){const t=e.nodes||[],s=e.buffers||[];di.startNodesVector(n,t.length);for(const d of t.slice().reverse())Ia.encode(n,d);const a=n.endVector();di.startBuffersVector(n,s.length);for(const d of s.slice().reverse())wi.encode(n,d);const u=n.endVector();return di.startRecordBatch(n),di.addLength(n,BigInt(e.length)),di.addNodes(n,a),di.addBuffers(n,u),di.endRecordBatch(n)}function sC(n,e){const t=Cr.encode(n,e.data);return Bo.startDictionaryBatch(n),Bo.addId(n,BigInt(e.id)),Bo.addIsDelta(n,e.isDelta),Bo.addData(n,t),Bo.endDictionaryBatch(n)}function oC(n,e){return J0.createFieldNode(n,BigInt(e.length),BigInt(e.nullCount))}function aC(n,e){return G0.createBuffer(n,BigInt(e.offset),BigInt(e.length))}const lC=(()=>{const n=new ArrayBuffer(2);return new DataView(n).setInt16(0,256,!0),new Int16Array(n)[0]===256})(),Ap=n=>`Expected ${nt[n]} Message in stream, but was null or length 0.`,kp=n=>`Header pointer of flatbuffer-encoded ${nt[n]} Message is null or length 0.`,PS=(n,e)=>`Expected to read ${n} metadata bytes, but only read ${e}.`,TS=(n,e)=>`Expected to read ${n} bytes for message body, but only read ${e}.`;class NS{constructor(e){this.source=e instanceof id?e:new id(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Ft:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Ap(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);const t=Je(this.source.read(e));if(t.byteLength<e)throw new Error(TS(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){const t=nt.Schema,s=this.readMessage(t),a=s==null?void 0:s.header();if(e&&!a)throw new Error(kp(t));return a}readMetadataLength(){const e=this.source.read(gd),t=e&&new ma(e),s=(t==null?void 0:t.readInt32(0))||0;return{done:s===0,value:s}}readMetadata(e){const t=this.source.read(e);if(!t)return Ft;if(t.byteLength<e)throw new Error(PS(e,t.byteLength));return{done:!1,value:xr.decode(t)}}}class uC{constructor(e,t){this.source=e instanceof wa?e:$0(e)?new sd(e,t):new wa(e)}[Symbol.asyncIterator](){return this}next(){return Pe(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done||e.value===-1&&(e=yield this.readMetadataLength()).done||(e=yield this.readMetadata(e.value)).done?Ft:e})}throw(e){return Pe(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return Pe(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return Pe(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Ap(e));return t.value})}readMessageBody(e){return Pe(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);const t=Je(yield this.source.read(e));if(t.byteLength<e)throw new Error(TS(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return Pe(this,arguments,void 0,function*(e=!1){const t=nt.Schema,s=yield this.readMessage(t),a=s==null?void 0:s.header();if(e&&!a)throw new Error(kp(t));return a})}readMetadataLength(){return Pe(this,void 0,void 0,function*(){const e=yield this.source.read(gd),t=e&&new ma(e),s=(t==null?void 0:t.readInt32(0))||0;return{done:s===0,value:s}})}readMetadata(e){return Pe(this,void 0,void 0,function*(){const t=yield this.source.read(e);if(!t)return Ft;if(t.byteLength<e)throw new Error(PS(e,t.byteLength));return{done:!1,value:xr.decode(t)}})}}class cC extends NS{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof yv?e:new yv(e)}next(){const{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:xr.fromJSON(e.schema,nt.Schema)};if(this._dictionaryIndex<e.dictionaries.length){const t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:xr.fromJSON(t,nt.DictionaryBatch)}}if(this._batchIndex<e.batches.length){const t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:xr.fromJSON(t,nt.RecordBatch)}}return this._body=[],Ft}readMessageBody(e){return t(this._body);function t(s){return(s||[]).reduce((a,u)=>[...a,...u.VALIDITY&&[u.VALIDITY]||[],...u.TYPE_ID&&[u.TYPE_ID]||[],...u.OFFSET&&[u.OFFSET]||[],...u.DATA&&[u.DATA]||[],...t(u.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Ap(e));return t.value}readSchema(){const e=nt.Schema,t=this.readMessage(e),s=t==null?void 0:t.header();if(!t||!s)throw new Error(kp(e));return s}}const gd=4,Jh="ARROW1",od=new Uint8Array(Jh.length);for(let n=0;n<Jh.length;n+=1)od[n]=Jh.codePointAt(n);function Pp(n,e=0){for(let t=-1,s=od.length;++t<s;)if(od[t]!==n[e+t])return!1;return!0}const Yl=od.length,BS=Yl+gd,dC=Yl*2+gd;class Si extends xS{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){const t=this._impl.open(e);return kl(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return er.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return er.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof Si?e:Uh(e)?mC(e):$0(e)?vC(e):kl(e)?Pe(this,void 0,void 0,function*(){return yield Si.from(yield e)}):V0(e)||gp(e)||W0(e)||yp(e)?gC(new wa(e)):yC(new id(e))}static readAll(e){return e instanceof Si?e.isSync()?xv(e):Dv(e):Uh(e)||ArrayBuffer.isView(e)||pd(e)||z0(e)?xv(e):Dv(e)}}class ad extends Si{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Qr(this,arguments,function*(){yield Be(yield*Sc(Jo(this[Symbol.iterator]())))})}}class ld extends Si{constructor(e){super(e),this._impl=e}readAll(){return Pe(this,void 0,void 0,function*(){var e,t,s,a;const u=new Array;try{for(var d=!0,f=Jo(this),p;p=yield f.next(),e=p.done,!e;d=!0){a=p.value,d=!1;const m=a;u.push(m)}}catch(m){t={error:m}}finally{try{!d&&!e&&(s=f.return)&&(yield s.call(f))}finally{if(t)throw t.error}}return u})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class US extends ad{constructor(e){super(e),this._impl=e}}class fC extends ld{constructor(e){super(e),this._impl=e}}class jS{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,t){const s=this._loadVectors(e,t,this.schema.fields),a=$e({type:new gn(this.schema.fields),length:e.length,children:s});return new Er(this.schema,a)}_loadDictionaryBatch(e,t){const{id:s,isDelta:a}=e,{dictionaries:u,schema:d}=this,f=u.get(s),p=d.dictionaries.get(s),m=this._loadVectors(e.data,t,[p]);return(f&&a?f.concat(new ht(m)):new ht(m)).memoize()}_loadVectors(e,t,s){return new CS(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(s)}}class ud extends jS{constructor(e,t){super(t),this._reader=Uh(e)?new cC(this._handle=e):new NS(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=$S(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):Ft}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ft}next(){if(this.closed)return Ft;let e;const{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;const s=e.header(),a=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(s,a)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;const s=e.header(),a=t.readMessageBody(e.bodyLength),u=this._loadDictionaryBatch(s,a);this.dictionaries.set(s.id,u)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MS(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}}class cd extends jS{constructor(e,t){super(t),this._reader=new uC(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Pe(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 Pe(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=$S(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return Pe(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ft})}return(e){return Pe(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ft})}next(){return Pe(this,void 0,void 0,function*(){if(this.closed)return Ft;let e;const{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;const s=e.header(),a=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(s,a)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;const s=e.header(),a=yield t.readMessageBody(e.bodyLength),u=this._loadDictionaryBatch(s,a);this.dictionaries.set(s.id,u)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MS(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return Pe(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}}class zS extends ud{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,t){super(e instanceof gv?e:new gv(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();const s=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(s&&this._handle.seek(s.offset)){const a=this._reader.readMessage(nt.RecordBatch);if(a!=null&&a.isRecordBatch()){const u=a.header(),d=this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(u,d)}}return null}_readDictionaryBatch(e){var t;const s=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(s&&this._handle.seek(s.offset)){const a=this._reader.readMessage(nt.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){const u=a.header(),d=this._reader.readMessageBody(a.bodyLength),f=this._loadDictionaryBatch(u,d);this.dictionaries.set(u.id,f)}}}_readFooter(){const{_handle:e}=this,t=e.size-BS,s=e.readInt32(t),a=e.readAt(t-s,s);return Op.decode(a)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const s=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(s&&this._handle.seek(s.offset))return this._reader.readMessage(e)}return null}}class hC extends cd{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,...t){const s=typeof t[0]!="number"?t.shift():void 0,a=t[0]instanceof Map?t.shift():void 0;super(e instanceof sd?e:new sd(e,s),a)}isFile(){return!0}isAsync(){return!0}open(e){const t=Object.create(null,{open:{get:()=>super.open}});return Pe(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const s of this._footer.dictionaryBatches())s&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return Pe(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());const s=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(s&&(yield this._handle.seek(s.offset))){const a=yield this._reader.readMessage(nt.RecordBatch);if(a!=null&&a.isRecordBatch()){const u=a.header(),d=yield this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(u,d)}}return null})}_readDictionaryBatch(e){return Pe(this,void 0,void 0,function*(){var t;const s=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(s&&(yield this._handle.seek(s.offset))){const a=yield this._reader.readMessage(nt.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){const u=a.header(),d=yield this._reader.readMessageBody(a.bodyLength),f=this._loadDictionaryBatch(u,d);this.dictionaries.set(u.id,f)}}})}_readFooter(){return Pe(this,void 0,void 0,function*(){const{_handle:e}=this;e._pending&&(yield e._pending);const t=e.size-BS,s=yield e.readInt32(t),a=yield e.readAt(t-s,s);return Op.decode(a)})}_readNextMessageAndValidate(e){return Pe(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}}class pC extends ud{constructor(e,t){super(e,t)}_loadVectors(e,t,s){return new DD(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(s)}}function $S(n,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:n.autoDestroy}function*xv(n){const e=Si.from(n);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function Dv(n){return Qr(this,arguments,function*(){const t=yield Be(Si.from(n));try{if(!(yield Be(t.open({autoDestroy:!1}))).closed)do yield yield Be(t);while(!(yield Be(t.reset().open())).closed)}finally{yield Be(t.cancel())}})}function mC(n){return new ad(new pC(n))}function yC(n){const e=n.peek(Yl+7&-8);return e&&e.byteLength>=4?Pp(e)?new US(new zS(n.read())):new ad(new ud(n)):new ad(new ud(function*(){}()))}function gC(n){return Pe(this,void 0,void 0,function*(){const e=yield n.peek(Yl+7&-8);return e&&e.byteLength>=4?Pp(e)?new US(new zS(yield n.read())):new ld(new cd(n)):new ld(new cd(function(){return Qr(this,arguments,function*(){})}()))})}function vC(n){return Pe(this,void 0,void 0,function*(){const{size:e}=yield n.stat(),t=new sd(n,e);return e>=dC&&Pp(yield t.readAt(0,Yl+7&-8))?new fC(new hC(t)):new ld(new cd(t))})}function VS(n){const e=Si.from(n);return kl(e)?e.then(t=>VS(t)):e.isAsync()?e.readAll().then(t=>new rr(t)):new rr(e.readAll())}async function Nt(n,e){const{url:t,method:s,params:a,data:u,headers:d,credentials:f,mode:p,cache:m}=n,g=Object.keys({...a}).length>0,v=t.replace(/([^:]\/)\/+/g,"$1"),S=new URL(HS(v),window.location.origin);if(g){const _=Object.entries({...a}).reduce((D,[k,P])=>(P!=null&&(D[k]=String(P)),D),{});S.search=new URLSearchParams(_).toString()}return await new Promise((_,D)=>{fetch(S,{method:s,credentials:f,mode:p,cache:m,headers:wC(d),body:SC(u),signal:e==null?void 0:e.signal}).then(async k=>{if(k.status===204)return{ok:!0};const P=k.headers.get("Content-Type");if(Zt(P))return{ok:!1,message:"Empty response"};if(k.status>=400)try{const q=await k.json();throw q.status=q.status??k.status,q}catch(q){throw{message:k.statusText,...q}}const B=P.includes("text/event-stream"),V=P.includes("application/json"),W=P.includes("application/vnd.apache.arrow.stream");if(V)return await k.json();if(W)return await VS(k);if(B){const ee=(await k.text()).trim().replace("data: ","").trim();return JSON.parse(ee)}}).then(_).catch(D)})}function wC(n){return{"Content-Type":"application/json",...n??{}}}function SC(n){try{return JSON.stringify(n)}catch{return""}}function HS(n="/"){let e=`${Rl(window.__BASE_URL__)?"/":window.__BASE_URL__}/${n}`;for(;e.includes("//");)e=e.replaceAll("//","/");return e}const pc={python:"python",sql:"sql",seed:"seed",external:"external",source:"source"},Nr={editor:"editor",files:"files","data-catalog":"data-catalog",plans:"plans",tests:"tests",audits:"audits",errors:"errors",data:"data",lineage:"lineage"},kO={NUMBER_1:1,NUMBER_2:2,NUMBER_3:3},PO={init:"init",success:"success",fail:"fail"},_C=(n,e)=>Nt({url:"/api/commands/apply",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),bC=(n,e)=>Nt({url:"/api/commands/evaluate",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),IC=(n,e)=>Nt({url:"/api/commands/fetchdf",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),EC=(n,e)=>Nt({url:"/api/commands/render",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),xC=n=>Nt({url:"/api/files",method:"GET"},n),DC=(n,e)=>Nt({url:`/api/files/${n}`,method:"GET"},e),CC=(n,e,t)=>Nt({url:`/api/files/${n}`,method:"POST",headers:{"Content-Type":"application/json"},data:e},t),TO=(n,e)=>Nt({url:`/api/files/${n}`,method:"DELETE"},e),NO=(n,e,t)=>Nt({url:`/api/directories/${n}`,method:"POST",headers:{"Content-Type":"application/json"},data:e},t),BO=(n,e)=>Nt({url:`/api/directories/${n}`,method:"DELETE"},e),OC=(n,e)=>Nt({url:"/api/plan",method:"POST",headers:{"Content-Type":"application/json"},data:n},e),RC=n=>Nt({url:"/api/plan/cancel",method:"POST"},n),FC=n=>Nt({url:"/api/environments",method:"GET"},n),UO=(n,e)=>Nt({url:`/api/environments/${n}`,method:"DELETE"},e),MC=(n,e,t,s)=>Nt({url:`/api/lineage/${n}/${e}`,method:"GET",params:t},s),LC=(n,e)=>Nt({url:`/api/lineage/${n}`,method:"GET"},e),AC=n=>Nt({url:"/api/models",method:"GET"},n),kC=(n,e)=>Nt({url:`/api/models/${n}`,method:"GET"},e),PC=n=>Nt({url:"/api/meta",method:"GET"},n),TC=n=>Nt({url:"/api/modules",method:"GET"},n),NC=(n,e)=>Nt({url:"/api/table_diff",method:"GET",params:n},e),li=R.lazy(()=>vn(()=>import("./Root-RMJAgu4n.js"),[])),BC=R.lazy(()=>vn(()=>import("./Editor-MHaczmm6.js"),[])),UC=R.lazy(()=>vn(()=>import("./Plan-Ci99V-DQ.js"),[])),jC=R.lazy(()=>vn(()=>import("./Content-BBF9m9Ox.js"),[])),zC=R.lazy(()=>vn(()=>import("./DataCatalog-DrAfqL4U.js"),[])),$C=R.lazy(()=>vn(()=>import("./Tests-LJHrn9AT.js"),[])),VC=R.lazy(()=>vn(()=>import("./Audits-sNYlBGyo.js"),[])),HC=R.lazy(()=>vn(()=>import("./Data-3L1ecmWi.js"),[])),wh=R.lazy(()=>vn(()=>import("./Models-D9i15AXx.js"),[])),WC=R.lazy(()=>vn(()=>import("./Lineage-LbDptVMs.js"),[])),QC=R.lazy(()=>vn(()=>import("./Errors-DJscmqVa.js"),[])),KC=R.lazy(()=>vn(()=>import("./Content-VuErq_no.js"),[])),wr=R.lazy(()=>vn(()=>import("./Welcome-yLt3zok6.js"),[])),dt={Home:"/",Editor:"/editor",DataCatalog:"/data-catalog",DataCatalogModels:"/data-catalog/models",Data:"/data",Lineage:"/lineage",LineageModels:"/lineage/models",Tests:"/tests",Audits:"/audits",Errors:"/errors",Plan:"/plan",NotFound:"/not-found"},Cv={plan:[Nr.plans]};function qC(n){const e=[{path:"*",element:dd(n.list)?U.jsx(Fn,{link:dt.Home,message:"Back To Main"}):U.jsx(Fn,{headline:"Empty"})},{path:dt.Home,element:U.jsx(li,{})},...[{path:dt.Editor,element:U.jsx(li,{content:U.jsx(BC,{})})},{path:dt.DataCatalog,element:U.jsx(li,{content:U.jsx(wh,{route:dt.DataCatalog})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data Catalog",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.DataCatalog,message:"Back To Data Catalog"})},{path:"models",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data Catalog",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.DataCatalog,message:"Back To Data Catalog"})},{path:":modelName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(zC,{})})}]}]},{path:dt.Data,element:U.jsx(li,{content:U.jsx(wh,{route:dt.Data})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Data,message:"Back To Data"})},{path:"models",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Data",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Data,message:"Back To Data"})},{path:":modelName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(HC,{})})}]}]},{path:dt.Lineage,element:U.jsx(li,{content:U.jsx(wh,{route:dt.Lineage})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Lineage",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Lineage,message:"Back To Lineage"})},{path:"models",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to the Lineage",tagline:"Here you can find all the information about the models and their fields."})},{path:"*",element:U.jsx(Fn,{link:dt.Lineage,message:"Back To Lineage"})},{path:":modelName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(WC,{})})}]}]},{path:dt.Errors,element:U.jsx(li,{content:U.jsx(QC,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to errors report",tagline:"Here you can see all the errors that occurred."})},{path:"*",element:U.jsx(Fn,{link:dt.Errors,message:"Back To Errors"})},{path:":id",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(KC,{})})}]},{path:dt.Plan,element:U.jsx(li,{content:U.jsx(UC,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to plan",tagline:"Here you can run the plan and apply the changes."})},{path:"*",element:U.jsx(Fn,{link:dt.Plan,message:"Back To Plan"})},{path:"environments",children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to plan",tagline:"Here you can run the plan and apply the changes."})},{path:"*",element:U.jsx(Fn,{link:dt.Plan,message:"Back To Plan"})},{path:":environmentName",element:U.jsx(R.Suspense,{fallback:U.jsx("div",{className:"flex justify-center items-center w-full h-full",children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:"Loading Content..."})]})}),children:U.jsx(jC,{})})}]}]},{path:dt.Tests,element:U.jsx(li,{content:U.jsx($C,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to tests report",tagline:"Here you can run tests and see the results."})},{path:"*",element:U.jsx(Fn,{link:dt.Tests,message:"Back To Tests"})}]},{path:dt.Audits,element:U.jsx(li,{content:U.jsx(VC,{})}),children:[{index:!0,element:U.jsx(wr,{headline:"Welcome to audits report",tagline:"Here you can run audits and see the results."})},{path:"*",element:U.jsx(Fn,{link:dt.Audits,message:"Back To Audits"})}]}].filter(t=>{var a;const s=t.path.replace("/","");return Zt(Cv[s])?n.list.includes(s):(a=Cv[s])==null?void 0:a.some(u=>n.list.includes(u))})].filter(Boolean);return DE(e,{basename:HS()})}const Qt={API:"api",General:"general",RunPlan:"run-plan",ApplyPlan:"apply-plan",CancelPlan:"cancel-plan",Environments:"environments",Models:"models",Fetchdf:"fetchdf",EvaluateModel:"evaluate-model",RenderQuery:"render-query",ColumnLineage:"column-lineage",ModelLineage:"model-lineage",Meta:"meta",Modules:"modules",FileExplorer:"file-explorer",Table:"table",TableDiff:"table-diff",SaveFile:"save-file"},WS=R.createContext({errors:new Set,addError:()=>({removeError:()=>{},error:{}}),removeError:()=>{},clearErrors:()=>{}});function YC({children:n}){const[e,t]=R.useState(new Set);function s(d,f){const p={id:Sh(),key:d,status:f.status,timestamp:f.timestamp??Date.now(),message:f.message,description:f.description,type:f.type,origin:f.origin,trigger:f.trigger,stack:f.stack,traceback:f.traceback};return t(m=>new Set(m.add(p))),{removeError:()=>a(p),error:p}}function a(d){t(f=>(f.forEach(p=>{(p===d||p.key===d)&&f.delete(p)}),new Set(f)))}function u(){t(new Set)}return U.jsx(WS.Provider,{value:{errors:e,addError:s,removeError:a,clearErrors:u},children:n})}function Tp(){return R.useContext(WS)}const QS=60*1e3,GC=5*QS,vd=10*QS;function JC(n){return ln({queryKey:["/api/modules"],queryFn:TC,enabled:!0},{...n,errorKey:Qt.Modules,trigger:"API -> useApiModules"})}function jO(n){return ln({queryKey:["/api/meta"],queryFn:PC,enabled:!0},{...n,errorKey:Qt.Meta,trigger:"API -> useApiMeta"})}function zO(n){return ln({queryKey:["/api/models"],queryFn:AC},{...n,errorKey:Qt.Models,trigger:"API -> useApiModels"})}function $O(n,e){return ln({queryKey:["/api/models",n],queryFn:async({signal:t})=>await kC(n,{signal:t})},{...e,errorKey:Qt.Models,trigger:"API -> useApiModel"})}function VO(n){return ln({queryKey:["/api/files"],queryFn:xC},{...n,errorKey:Qt.FileExplorer,trigger:"API -> useApiFiles"})}function HO(n,e){return ln({queryKey:["/api/files",n],queryFn:async({signal:t})=>await DC(n,{signal:t})},{...e,errorKey:Qt.FileExplorer,trigger:"API -> useApiFileByPath"})}function WO(n,e){return ln({queryKey:["/api/lineage",n],queryFn:async({signal:t})=>await LC(n,{signal:t})},{...e,errorKey:Qt.ModelLineage,trigger:"API -> useApiModelLineage"})}function QO(n,e,t,s){return ln({queryKey:["/api/lineage",n,e],queryFn:async({signal:a})=>await MC(n,e,s,{signal:a})},{...t,errorKey:Qt.ColumnLineage,trigger:"API -> useApiColumnLineage"})}function KO(n){return ln({queryKey:["/api/environments"],queryFn:FC},{...n,errorKey:Qt.Environments,trigger:"API -> useApiEnvironments"})}function qO(n){return ln({queryKey:["/api/commands/apply"],queryFn:RC},{...n,errorKey:Qt.CancelPlan,trigger:"API -> useApiCancelPlan"})}function YO(n,e,t){return ln({queryKey:["/api/plan",n],async queryFn({signal:s}){return await OC({environment:n,plan_dates:e==null?void 0:e.planDates,plan_options:e==null?void 0:e.planOptions,categories:e==null?void 0:e.categories},{signal:s})}},{...t,errorKey:Qt.RunPlan,trigger:"API -> useApiPlanRun"})}function GO(n,e,t){return ln({queryKey:["/api/commands/apply",n],async queryFn({signal:s}){return await _C({environment:n,plan_dates:e==null?void 0:e.planDates,plan_options:e==null?void 0:e.planOptions,categories:e==null?void 0:e.categories},{signal:s})}},{...t,errorKey:Qt.ApplyPlan,trigger:"API -> useApiPlanApply"})}function JO(n,e){return ln({queryKey:["/api/commands/fetchd"],queryFn:async({signal:t})=>await IC(n,{signal:t})},{...e,errorKey:Qt.Fetchdf,trigger:"API -> useApiFetchdf",delay:vd})}function XO(n,e){return ln({queryKey:["/api/commands/render"],queryFn:async({signal:t})=>await EC(n,{signal:t})},{...e,errorKey:Qt.RenderQuery,trigger:"API -> useApiRender",delay:vd})}function ZO(n,e){return ln({queryKey:["/api/commands/table_diff"],queryFn:async({signal:t})=>await NC(n,{signal:t})},{...e,errorKey:Qt.TableDiff,trigger:"API -> useApiTableDiff",delay:vd})}function eR(n,e){return ln({queryKey:["/api/commands/evaluate"],queryFn:async({signal:t})=>await bC(n,{signal:t})},{...e,errorKey:Qt.EvaluateModel,trigger:"API -> useApiEvaluate",delay:vd})}function tR(n){const{addError:e}=Tp();return Ob({mutationFn:async({path:t,body:s})=>await CC(t,s),onError(t){e(Qt.SaveFile,t)},async onMutate({path:t}){await n.cancelQueries({queryKey:["/api/files",t]})}})}function ln(n,{delay:e=GC,removeTimeoutErrorAfter:t,errorKey:s=Qt.API,trigger:a}){const u=n.queryKey.join(" -> "),d=rp(),{addError:f}=Tp(),[p,m]=R.useState(!1);let g,v=function(){console.log(`[REQUEST TIMEOUT] ${u} id: ${String(g)} timed out after ${e}ms`);const{removeError:q}=f(s,{message:"Request timed out",description:`Request ${u} with timeoutId: ${String(g)} timed out after ${e}ms`,timestamp:Date.now(),origin:"useQueryTimeout",trigger:a});m(!0),D(),yn(t)&&setTimeout(()=>q(),t)};function S(){console.log(`[CLEAR TIMEOUT] ${u} id: ${String(g)} at ${Date.now()}`),clearTimeout(g),g=void 0,v=void 0}function _(){g=setTimeout(()=>{v==null||v()},e),console.log(`[START TIMEOUT] ${u} id: ${String(g)} at ${Date.now()}`)}function D(){S(),d.cancelQueries({queryKey:n.queryKey}),console.log(`[REQUEST CANCELED] ${u} at ${Date.now()}`)}function k(W){S(),mc(W)||W.name==="AbortError"?console.log(`[REQUEST ABORTED] ${u} aborted by React Query at ${Date.now()}`):(console.log(`[REQUEST FAILED] ${u} failed at ${Date.now()}`),f(s,W))}function P(){S(),console.log(`[REQUEST COMPLETED] ${u} completed at ${Date.now()}`)}async function B(...W){return _(),n.queryFn(...W)}const V=Cb({gcTime:0,enabled:!1,queryKey:n.queryKey,queryFn:B,meta:{...n.meta,onError:k,onSuccess:P}});return{...V,refetch:async(...W)=>new Promise(q=>{V.refetch(...W,{throwOnError:!0}).then(q).catch(ee=>ee)}),cancel:D,isTimeout:p}}class KS{constructor(e){Ct(this,"_initial");Ct(this,"isModel",!0);Zt(e)?this._initial=Object.assign({id:Sh()}):this._initial=yn(e==null?void 0:e.id)?e:new Proxy(Object.assign(e??{},{id:Sh()}),{set(){throw new Error("Cannot change initial file")}})}get initial(){return this._initial}get id(){return this.initial.id}}class Ov extends KS{constructor(t=[]){super();Ct(this,"modules",new Set);this.modules=new Set(t)}get list(){return Array.from(this.modules)}get isEmpty(){return this.modules.size===0}get hasErrors(){return this.modules.has(Nr.errors)}get hasEditor(){return this.modules.has(Nr.editor)}get hasFiles(){return this.modules.has(Nr.files)}get hasProjectEditor(){return this.hasEditor&&this.hasFiles}get hasOnlyProjectEditor(){return this.modules.size===2&&this.hasProjectEditor}get hasOnlyDataCatalog(){return this.modules.size===1&&this.hasDataCatalog}get hasProjectEditorAndModule(){return this.modules.size===3&&this.hasProjectEditor&&hs(this.hasErrors)}get hasDataCatalog(){return this.modules.has(Nr["data-catalog"])}get hasPlans(){return this.modules.has(Nr.plans)}get hasOnlyPlans(){return this.modules.size===1&&this.hasPlans}get hasOnlyPlansAndErrors(){return this.modules.size===2&&this.hasPlans&&this.hasErrors}get hasTests(){return this.modules.has(Nr.tests)}get hasAudits(){return this.modules.has(Nr.audits)}get hasData(){return this.modules.has(Nr.data)}get hasLineage(){return this.modules.has(Nr.lineage)}get hasModuleAndErrors(){return this.hasErrors&&(this.modules.size===2||this.modules.size===3&&this.hasProjectEditor)}get hasSingleModule(){return this.modules.size===1}get showModuleNavigation(){return this.isEmpty||this.hasSingleModule||this.hasOnlyProjectEditor||this.hasModuleAndErrors||this.hasOnlyDataCatalog?!1:this.hasProjectEditorAndModule?!0:hs(this.isEmpty)}get showHistoryNavigation(){return this.hasOnlyProjectEditor||this.hasModuleAndErrors||this.hasOnlyDataCatalog?!1:this.hasProjectEditorAndModule||this.hasDataCatalog?!0:hs(this.isEmpty)}get showNavigation(){return this.hasErrors||this.hasPlans||this.showHistoryNavigation}update(t=[]){this.modules=new Set(t)}defaultNavigationRoute(){return this.hasEditor?dt.Editor:this.hasPlans?dt.Plan:this.hasDataCatalog?dt.DataCatalog:dt.NotFound}}class XC extends KS{constructor(t){super(t!=null&&t.isModel?t.initial:{...t,dialect:(t==null?void 0:t.dialect)??"Default",columns:(t==null?void 0:t.columns)??[],details:(t==null?void 0:t.details)??{}});Ct(this,"_details",{});Ct(this,"_detailsIndex","");Ct(this,"name");Ct(this,"fqn");Ct(this,"path");Ct(this,"full_path");Ct(this,"dialect");Ct(this,"type");Ct(this,"columns");Ct(this,"default_catalog");Ct(this,"description");Ct(this,"sql");Ct(this,"definition");Ct(this,"hash");this.name=encodeURI(this.initial.name),this.fqn=encodeURI(this.initial.fqn),this.default_catalog=this.initial.default_catalog,this.path=this.initial.path,this.full_path=this.initial.full_path,this.dialect=this.initial.dialect,this.description=this.initial.description,this.sql=this.initial.sql,this.definition=this.initial.definition,this.columns=this.initial.columns??[],this.type=this.initial.type,this.hash=this.initial.hash,this.details=this.initial.details??{}}get defaultCatalog(){return this.default_catalog}get details(){return this._details}set details(t){const s=[];for(const a of Object.values(t))dd(a)?a.forEach(u=>{s.push(...Object.values(u))}):s.push(a);this._details=t,this._detailsIndex=s.join(" ")}get index(){return[this.displayName,this.path,this.type,...this.columns.map(t=>Object.values(t)).flat(),this._detailsIndex,this.dialect,this.description].filter(Boolean).join(" ").toLowerCase()}get isModelPython(){return this.type===pc.python}get isModelSQL(){return this.type===pc.sql}get isModelSeed(){return this.type===pc.seed}get isModelExternal(){return this.type===pc.external}get displayName(){return decodeURI(this.name)}update(t={}){for(const[s,a]of Object.entries(t))s==="columns"?this.columns=a:s==="details"?this.details=a:s==="name"?this.name=encodeURI(a):s==="fqn"?this.fqn=encodeURI(a):s==="type"?this.type=a:s==="default_catalog"?this.default_catalog=a:s==="description"?this.description=a:s in this&&(this[s]=a)}}const Rv=n=>{let e;const t=new Set,s=(m,g)=>{const v=typeof m=="function"?m(e):m;if(!Object.is(v,e)){const S=e;e=g??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(_=>_(e,S))}},a=()=>e,f={setState:s,getState:a,getInitialState:()=>p,subscribe:m=>(t.add(m),()=>t.delete(m))},p=e=n(s,a,f);return f},ZC=n=>n?Rv(n):Rv,eO=n=>n;function tO(n,e=eO){const t=Xs.useSyncExternalStore(n.subscribe,()=>e(n.getState()),()=>e(n.getInitialState()));return Xs.useDebugValue(t),t}const Fv=n=>{const e=ZC(n),t=s=>tO(e,s);return Object.assign(t,e),t},nO=n=>n?Fv(n):Fv,gl={Empty:"",Prod:"prod"},vi={Local:"local",Remote:"remote"},[Mv,rO]=Xv("profile");class on{constructor(e,t,s=gl.Prod,a=!1,u=!1){Ct(this,"_initial");Ct(this,"_type");Ct(this,"_createFrom");Ct(this,"_isPinned",!1);Ct(this,"_isDefault",!1);Ct(this,"isModel",!0);this._initial=e,this._type=t??vi.Local,this._createFrom=this._isDefault?gl.Empty:s,this._isPinned=a,this._isDefault=u}get id(){return this._initial.plan_id??""}get name(){return this._initial.name??gl.Empty}get type(){return this._type}get createFrom(){return this._createFrom}get isProd(){return this.name===gl.Prod}get isDefault(){return this._isDefault}set isDefault(e){this._isDefault=e}get isPinned(){return this._isPinned||this.isDefault||this.isProd}set isPinned(e){this._isPinned=e}get isInitial(){var e;return Rl((e=this._initial)==null?void 0:e.plan_id)}get isLocal(){return this._type===vi.Local}get isRemote(){return this._type===vi.Remote}get isSyncronized(){return this.isRemote&&hs(this.isInitial)}get isInitialProd(){return this.isInitial&&this.isProd}setType(e){this._type=e}setCreatedFrom(e){this._createFrom=e}update(e){this._initial=e}static save({environment:e,environments:t}){const s={};yn(e)&&(s.environment={name:e.name,plan_id:e.id,type:e.type,createFrom:e.createFrom,isPinned:e.isPinned,isDefault:e.isDefault}),yn(t)&&(s.environments=on.getOnlyLocal(t).map(a=>({name:a.name,plan_id:a.id,type:a.type,createFrom:a.createFrom,isPinned:a.isPinned,isDefault:a.isDefault}))),rO(s)}static getOnlyLocal(e=[]){return e.filter(t=>hs(Rl(t.name))&&t.isLocal)}static getOnlyRemote(e=[]){return e.filter(t=>hs(Rl(t.name))&&t.isRemote)}static getEnvironment(){const{environment:e}=Mv()??{};if(Zt(e))return;const{name:t,plan_id:s,type:a,createFrom:u,isPinned:d,isDefault:f}=e;return new on({name:t,plan_id:s},a,u,d,f)}static getEnvironments(){const e=Mv(),t=new Map;yn(e)&&yn(e.environment)&&t.set(e.environment.name,e.environment),yn(e)&&yn(e.environments)&&e.environments.forEach(a=>t.set(a.name,a));const s=[];return Array.from(t.entries()).forEach(([a,u])=>{s.push(new on({name:a,plan_id:u.plan_id},u.type,u.createFrom,u.isPinned,u.isDefault))}),Gv(s)&&s.push(new on({name:gl.Prod},vi.Local)),s}static sort(e){return e.sort(t=>t.isRemote?-1:1),e}}const Lv="prod",qS=new Set(on.getEnvironments()),Av=on.getEnvironment()??qS.values().next().value,kv=nO((n,e)=>({version:void 0,modules:new Ov,splitPaneSizes:[20,80],showConfirmation:!1,confirmations:[],environment:Av,environments:qS,initialStartDate:void 0,initialEndDate:void 0,models:new Map,lastSelectedModel:void 0,setLastSelectedModel(t){n(()=>({lastSelectedModel:t}))},setModules(t){n(()=>({modules:new Ov(t.list)}))},isModel(t){return e().models.has(t)},setSplitPaneSizes(t){n(()=>({splitPaneSizes:t}))},setVersion(t){n(()=>({version:t}))},setShowConfirmation(t){n(()=>({showConfirmation:t}))},addConfirmation(t){n(s=>(s.confirmations.push(t),{confirmations:Array.from(s.confirmations)}))},removeConfirmation(){const t=e();t.confirmations.shift(),n(()=>({confirmations:Array.from(t.confirmations)}))},setModels(t=[]){const s=e();n(()=>({models:t.reduce((a,u)=>{const d=new XC(u);let f=s.models.get(d.path)??s.models.get(d.name)??s.models.get(d.fqn);return Zt(f)?f=d:f.update(u),a.set(f.name,f),a.set(f.fqn,f),a.set(f.path,f),a},new Map)}))},getNextEnvironment(){return e().environments.values().next().value??Av},isExistingEnvironment(t){const s=e();if(t.isModel)return s.environments.has(t);let a=!1;return s.environments.forEach(u=>{u.name===t&&(a=!0)}),a},setEnvironment(t){n(()=>(on.save({environment:t}),{environment:t}))},addLocalEnvironment(t,s=Lv){n(a=>{if(Rl(t))return a;const u=new on({name:t},vi.Local,s);return a.environments.add(u),a.setEnvironment(u),on.save({environments:Array.from(a.environments)}),{environments:new Set(a.environments)}})},removeLocalEnvironment(t){n(s=>(s.environments.delete(t),on.save({environments:Array.from(s.environments)}),{environments:new Set(s.environments)}))},addRemoteEnvironments(t=[],s,a=[]){n(u=>{const d=Array.from(u.environments);t.forEach(_=>{let D=d.find(({name:k})=>_.name===k);Zt(D)?(D=new on(_,vi.Remote),d.push(D)):(D.update(_),D.setType(vi.Remote)),u.environment.name===_.name&&u.environment.update(_),D.isInitial&&D.isDefault&&u.setEnvironment(D)}),a.forEach(_=>{const D=d.find(({name:k})=>_===k);Zt(D)?d.push(new on({name:_},vi.Local,void 0,!0)):D.isPinned=!0});const f=on.getEnvironment();let p,m,g;d.forEach(_=>{switch(_.name){case Lv:p=_;break;case(f==null?void 0:f.name):m=_;break;case s:_.isDefault=!0,g=_}});const v=u.environment??m??g,S=B1(p==null?void 0:p.isInitial)?p:v;return on.save({environments:d,environment:S}),on.sort(d),{environment:S,environments:new Set(d)}})},hasRemoteEnvironments(){const t=e();return Array.from(t.environments).some(({type:s})=>s===vi.Remote)}}));function Pv({children:n,className:e}){return U.jsx("div",{className:qr("flex justify-center items-center w-full h-full",e),children:U.jsxs(No,{className:"inline-block",children:[U.jsx(zs,{className:"w-3 h-3 border border-neutral-10 mr-4"}),U.jsx("h3",{className:"text-md",children:n})]})})}const YS=!!(window.__IS_HEADLESS__??!1),Tv=YS?void 0:R.lazy(()=>vn(()=>import("./Header-ByzYcdnA.js"),[])),Nv=YS?void 0:R.lazy(()=>vn(()=>import("./Footer-Bqwyjxx6.js"),[]));function iO(){const{addError:n}=Tp(),e=kv(f=>f.modules),t=kv(f=>f.setModules),{refetch:s,cancel:a,isFetching:u}=JC();R.useEffect(()=>(s().then(({data:f})=>{e.update(f),t(e)}).catch(f=>n(Qt.Modules,f)),()=>{a()}),[]);const d=qC(e);return U.jsxs(U.Fragment,{children:[yn(Tv)&&U.jsxs(U.Fragment,{children:[U.jsx(Tv,{}),U.jsx(Gg,{})]}),U.jsx("main",{className:"h-full overflow-hidden relative",children:u?U.jsx(Pv,{className:"absolute w-full h-full bg-theme z-10",children:"Building Modules..."}):U.jsx(R.Suspense,{fallback:U.jsx(Pv,{children:"Loading Page..."}),children:dd(e.list)?U.jsx(ZI,{router:d}):U.jsx(Fn,{description:"No Modules Found"})})}),yn(Nv)&&U.jsxs(U.Fragment,{children:[U.jsx(Gg,{}),U.jsx(Nv,{})]})]})}const sO=new cb({queryCache:new u0({onError(n,e){e.meta.onError(n)},onSuccess(n,e){e.meta.onSuccess()}}),defaultOptions:{queries:{networkMode:"always",refetchOnWindowFocus:!1,retry:!1,staleTime:1/0}}});Y1.createRoot(oO()).render(U.jsx(Xs.StrictMode,{children:U.jsx(mb,{client:sO,children:U.jsx($1,{children:U.jsx(YC,{children:U.jsx(iO,{})})})})}));function oO(){const n="root";let e=document.getElementById(n);if(yn(e))return e;const t=document.body,s=t.children[0];return e=document.createElement("div"),e.id=n,e.className="h-full w-full flex flex-col justify-start",s instanceof HTMLElement?t.insertBefore(e,s):t.appendChild(e),e}export{KS as $,PO as A,FO as B,cO as C,Gv as D,Po as E,Qt as F,U0 as G,Gg as H,Rl as I,kO as J,vO as K,No as L,on as M,RE as N,DO as O,yO as P,xO as Q,Xs as R,zs as S,WE as T,Fn as U,bO as V,fO as W,j0 as X,RO as Y,UO as Z,vn as _,kv as a,nO as a0,qv as a1,Yv as a2,$O as a3,mO as a4,XO as a5,eR as a6,Pv as a7,_O as a8,dO as a9,OO as aA,WO as aB,U1 as aa,NO as ab,CC as ac,TO as ad,BO as ae,ZO as af,JO as ag,IC as ah,lO as ai,Xh as aj,SO as ak,CO as al,rp as am,HO as an,tR as ao,wO as ap,hO as aq,QO as ar,pc as as,uO as at,Jg as au,MO as av,LO as aw,Q1 as ax,Xv as ay,Sh as az,hs as b,qr as c,Tp as d,dt as e,B1 as f,dd as g,KO as h,yn as i,U as j,YO as k,Tt as l,ft as m,pO as n,GO as o,qO as p,gO as q,R as r,kI as s,zO as t,IO as u,Zt as v,HS as w,ro as x,jO as y,VO as z};