@ifc-lite/viewer 1.6.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/dist/assets/{Arrow.dom-Be1tgmo6.js → Arrow.dom-CwcRxist.js} +1 -1
  3. package/dist/assets/ifc-lite_bg-DyIN_nBM.wasm +0 -0
  4. package/dist/assets/index-7WoQ-qVC.css +1 -0
  5. package/dist/assets/{index-D1Du89Pa.js → index-BSANf7-H.js} +44948 -31410
  6. package/dist/assets/{native-bridge-A6zNnTfi.js → native-bridge-5LbrYh3R.js} +1 -1
  7. package/dist/assets/{wasm-bridge-DkRhgSvE.js → wasm-bridge-CgpLtj1h.js} +1 -1
  8. package/dist/index.html +2 -2
  9. package/package.json +18 -15
  10. package/src/components/viewer/BCFPanel.tsx +7 -789
  11. package/src/components/viewer/Drawing2DCanvas.tsx +1411 -0
  12. package/src/components/viewer/DrawingSettingsPanel.tsx +3 -3
  13. package/src/components/viewer/EntityContextMenu.tsx +47 -20
  14. package/src/components/viewer/ExportDialog.tsx +166 -17
  15. package/src/components/viewer/HierarchyPanel.tsx +113 -843
  16. package/src/components/viewer/IDSExportDialog.tsx +281 -0
  17. package/src/components/viewer/IDSPanel.tsx +126 -17
  18. package/src/components/viewer/KeyboardShortcutsDialog.tsx +9 -0
  19. package/src/components/viewer/LensPanel.tsx +1366 -0
  20. package/src/components/viewer/MainToolbar.tsx +237 -37
  21. package/src/components/viewer/PropertiesPanel.tsx +171 -652
  22. package/src/components/viewer/PropertyEditor.tsx +866 -77
  23. package/src/components/viewer/Section2DPanel.tsx +329 -2661
  24. package/src/components/viewer/TextAnnotationEditor.tsx +112 -0
  25. package/src/components/viewer/ToolOverlays.tsx +3 -1097
  26. package/src/components/viewer/ViewerLayout.tsx +132 -45
  27. package/src/components/viewer/Viewport.tsx +290 -1678
  28. package/src/components/viewer/ViewportContainer.tsx +13 -3
  29. package/src/components/viewer/bcf/BCFCreateTopicForm.tsx +134 -0
  30. package/src/components/viewer/bcf/BCFTopicDetail.tsx +388 -0
  31. package/src/components/viewer/bcf/BCFTopicList.tsx +239 -0
  32. package/src/components/viewer/bcf/bcfHelpers.tsx +109 -0
  33. package/src/components/viewer/hierarchy/HierarchyNode.tsx +328 -0
  34. package/src/components/viewer/hierarchy/treeDataBuilder.ts +464 -0
  35. package/src/components/viewer/hierarchy/types.ts +54 -0
  36. package/src/components/viewer/hierarchy/useHierarchyTree.ts +280 -0
  37. package/src/components/viewer/lists/ListBuilder.tsx +486 -0
  38. package/src/components/viewer/lists/ListPanel.tsx +540 -0
  39. package/src/components/viewer/lists/ListResultsTable.tsx +227 -0
  40. package/src/components/viewer/properties/ClassificationCard.tsx +70 -0
  41. package/src/components/viewer/properties/CoordinateDisplay.tsx +49 -0
  42. package/src/components/viewer/properties/DocumentCard.tsx +89 -0
  43. package/src/components/viewer/properties/MaterialCard.tsx +201 -0
  44. package/src/components/viewer/properties/ModelMetadataPanel.tsx +335 -0
  45. package/src/components/viewer/properties/PropertySetCard.tsx +132 -0
  46. package/src/components/viewer/properties/QuantitySetCard.tsx +79 -0
  47. package/src/components/viewer/properties/RelationshipsCard.tsx +100 -0
  48. package/src/components/viewer/properties/encodingUtils.ts +29 -0
  49. package/src/components/viewer/tools/MeasurePanel.tsx +218 -0
  50. package/src/components/viewer/tools/MeasurementVisuals.tsx +644 -0
  51. package/src/components/viewer/tools/SectionPanel.tsx +183 -0
  52. package/src/components/viewer/tools/SectionVisualization.tsx +78 -0
  53. package/src/components/viewer/tools/cloudPathGenerator.test.ts +118 -0
  54. package/src/components/viewer/tools/cloudPathGenerator.ts +275 -0
  55. package/src/components/viewer/tools/computePolygonArea.test.ts +165 -0
  56. package/src/components/viewer/tools/computePolygonArea.ts +72 -0
  57. package/src/components/viewer/tools/formatDistance.ts +18 -0
  58. package/src/components/viewer/tools/sectionConstants.ts +14 -0
  59. package/src/components/viewer/useAnimationLoop.ts +166 -0
  60. package/src/components/viewer/useGeometryStreaming.ts +406 -0
  61. package/src/components/viewer/useKeyboardControls.ts +221 -0
  62. package/src/components/viewer/useMouseControls.ts +1009 -0
  63. package/src/components/viewer/useRenderUpdates.ts +165 -0
  64. package/src/components/viewer/useTouchControls.ts +245 -0
  65. package/src/hooks/ids/idsColorSystem.ts +125 -0
  66. package/src/hooks/ids/idsDataAccessor.ts +237 -0
  67. package/src/hooks/ids/idsExportService.ts +444 -0
  68. package/src/hooks/useAnnotation2D.ts +551 -0
  69. package/src/hooks/useBCF.ts +7 -0
  70. package/src/hooks/useDrawingExport.ts +709 -0
  71. package/src/hooks/useDrawingGeneration.ts +627 -0
  72. package/src/hooks/useFloorplanView.ts +108 -0
  73. package/src/hooks/useIDS.ts +270 -463
  74. package/src/hooks/useIfc.ts +26 -1628
  75. package/src/hooks/useIfcFederation.ts +803 -0
  76. package/src/hooks/useIfcLoader.ts +508 -0
  77. package/src/hooks/useIfcServer.ts +465 -0
  78. package/src/hooks/useKeyboardShortcuts.ts +114 -15
  79. package/src/hooks/useLens.ts +113 -0
  80. package/src/hooks/useLensDiscovery.ts +46 -0
  81. package/src/hooks/useMeasure2D.ts +365 -0
  82. package/src/hooks/useModelSelection.ts +5 -22
  83. package/src/hooks/useViewControls.ts +218 -0
  84. package/src/index.css +7 -1
  85. package/src/lib/ifc4-pset-definitions.test.ts +161 -0
  86. package/src/lib/ifc4-pset-definitions.ts +621 -0
  87. package/src/lib/ifc4-qto-definitions.ts +315 -0
  88. package/src/lib/lens/adapter.ts +264 -0
  89. package/src/lib/lens/index.ts +5 -0
  90. package/src/lib/lists/adapter.ts +69 -0
  91. package/src/lib/lists/columnToAutoColor.ts +33 -0
  92. package/src/lib/lists/index.ts +28 -0
  93. package/src/lib/lists/persistence.ts +64 -0
  94. package/src/services/fs-cache.ts +1 -1
  95. package/src/services/tauri-modules.d.ts +25 -0
  96. package/src/store/index.ts +52 -3
  97. package/src/store/resolveEntityRef.ts +44 -0
  98. package/src/store/slices/cameraSlice.ts +14 -1
  99. package/src/store/slices/dataSlice.ts +14 -1
  100. package/src/store/slices/drawing2DSlice.ts +321 -0
  101. package/src/store/slices/lensSlice.ts +226 -0
  102. package/src/store/slices/listSlice.ts +74 -0
  103. package/src/store/slices/pinboardSlice.ts +247 -0
  104. package/src/store/types.ts +5 -0
  105. package/src/store.ts +3 -0
  106. package/src/utils/ifcConfig.ts +16 -3
  107. package/src/utils/serverDataModel.ts +64 -101
  108. package/src/vite-env.d.ts +3 -0
  109. package/dist/assets/ifc-lite_bg-C6kblxf9.wasm +0 -0
  110. package/dist/assets/index-v3mcCUPN.css +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,111 @@
1
1
  # @ifc-lite/viewer
2
2
 
3
+ ## 1.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#212](https://github.com/louistrue/ifc-lite/pull/212) [`5d4dd1e`](https://github.com/louistrue/ifc-lite/commit/5d4dd1e40539b02af666ef8329c749d708a09e17) Thanks [@louistrue](https://github.com/louistrue)! - Add annotation selection, deletion, move, and text re-editing in 2D drawings
8
+
9
+ - Click any annotation (measure, polygon area, text box, cloud) to select it — highlighted with a dashed blue border and corner handles
10
+ - Press Delete/Backspace to remove the selected annotation
11
+ - Drag to reposition any selected annotation
12
+ - Double-click text annotations to re-enter edit mode
13
+ - Escape exits annotation tools back to Select/Pan mode and deselects
14
+ - "Select / Pan" option added to annotation toolbar dropdown
15
+ - Performance: ephemeral drag state uses local refs instead of store updates, stable coordinate callbacks via refs, hit-test reads from storeRef to prevent callback cascade
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`7ae9711`](https://github.com/louistrue/ifc-lite/commit/7ae971119ad92c05c521a4931105a9a977ffc667), [`06ddd81`](https://github.com/louistrue/ifc-lite/commit/06ddd81ce922d8f356836d04ff634cba45520a81), [`0b6880a`](https://github.com/louistrue/ifc-lite/commit/0b6880ac9bafee78e8b604e8df5a8e14dc74bc28)]:
20
+ - @ifc-lite/renderer@1.8.0
21
+ - @ifc-lite/lens@1.8.0
22
+ - @ifc-lite/export@1.8.0
23
+ - @ifc-lite/bcf@1.8.0
24
+ - @ifc-lite/cache@1.8.0
25
+ - @ifc-lite/data@1.8.0
26
+ - @ifc-lite/drawing-2d@1.8.0
27
+ - @ifc-lite/encoding@1.8.0
28
+ - @ifc-lite/geometry@1.8.0
29
+ - @ifc-lite/ids@1.8.0
30
+ - @ifc-lite/lists@1.8.0
31
+ - @ifc-lite/mutations@1.8.0
32
+ - @ifc-lite/parser@1.8.0
33
+ - @ifc-lite/query@1.8.0
34
+ - @ifc-lite/server-client@1.8.0
35
+ - @ifc-lite/spatial@1.8.0
36
+ - @ifc-lite/wasm@1.8.0
37
+
38
+ ## 1.7.0
39
+
40
+ ### Minor Changes
41
+
42
+ - [#204](https://github.com/louistrue/ifc-lite/pull/204) [`057bde9`](https://github.com/louistrue/ifc-lite/commit/057bde9e48f64c07055413c690c6bdabb6942d04) Thanks [@louistrue](https://github.com/louistrue)! - Add orthographic projection, pinboard, lens, type tree, and floorplan views
43
+
44
+ ### Renderer
45
+
46
+ - Orthographic reverse-Z projection matrix in math utilities
47
+ - Camera projection mode toggle (perspective/orthographic) with seamless switching
48
+ - Orthographic zoom scales view size instead of camera distance
49
+ - Parallel ray unprojection for orthographic picking
50
+
51
+ ### Viewer
52
+
53
+ - **Orthographic projection**: Toggle button, unified Views dropdown, numpad `5` keyboard shortcut
54
+ - **Automatic Floorplan**: Per-storey section cuts with top-down ortho view, dropdown in toolbar
55
+ - **Pinboard**: Selection basket with Pin/Unpin/Show, entity isolation via serialized EntityRef Set
56
+ - **Tree View by Type**: IFC type grouping mode alongside spatial hierarchy, localStorage persistence
57
+ - **Lens**: Rule-based 3D colorization/filtering with built-in presets (By IFC Type, Structural Elements), full panel UI with color legend and rule evaluation engine
58
+
59
+ - [#200](https://github.com/louistrue/ifc-lite/pull/200) [`6c43c70`](https://github.com/louistrue/ifc-lite/commit/6c43c707ead13fc482ec367cb08d847b444a484a) Thanks [@louistrue](https://github.com/louistrue)! - Add schema-aware property editing, full property panel display, and document/relationship support
60
+
61
+ - Property editor validates against IFC4 standard (ISO 16739-1:2018): walls get wall psets, doors get door psets, etc.
62
+ - Schema-version-aware property editing: detects IFC2X3/IFC4/IFC4X3 from FILE_SCHEMA header
63
+ - New dialogs for adding classifications (12 standard systems), materials, and quantities in edit mode
64
+ - Quantity set definitions (Qto\_) with schema-aware dialog for standard IFC4 base quantities
65
+ - On-demand classification extraction from IfcRelAssociatesClassification with chain walking
66
+ - On-demand material extraction supporting all IFC material types: IfcMaterial, IfcMaterialLayerSet, IfcMaterialProfileSet, IfcMaterialConstituentSet, IfcMaterialList, and \*Usage wrappers
67
+ - On-demand document extraction from IfcRelAssociatesDocument with DocumentReference→DocumentInformation chain
68
+ - Type-level property merging: properties from IfcTypeObject HasPropertySets merged with instance properties
69
+ - Structural relationship display: openings, fills, groups, and connections
70
+ - Advanced property type parsing: IfcPropertyEnumeratedValue, BoundedValue, ListValue, TableValue, ReferenceValue
71
+ - Georeferencing display (IfcMapConversion + IfcProjectedCRS) in model metadata panel
72
+ - Length unit display in model metadata panel
73
+ - Classifications, materials, documents displayed with dedicated card components
74
+ - Type-level material/classification inheritance via IfcRelDefinesByType
75
+ - Relationship graph fallback for server-loaded models without on-demand maps
76
+ - Cycle detection in material resolution and classification chain walking
77
+ - Removed `any` types from parser production code in favor of proper `PropertyValue` union type
78
+
79
+ ### Patch Changes
80
+
81
+ - [#202](https://github.com/louistrue/ifc-lite/pull/202) [`e0af898`](https://github.com/louistrue/ifc-lite/commit/e0af898608c2f706dc2d82154c612c64e2de010c) Thanks [@louistrue](https://github.com/louistrue)! - Fix empty Description, ObjectType, and Tag columns in lists and show all IFC attributes in property panel
82
+
83
+ - Lists: add on-demand attribute extraction fallback with per-provider caching for Description, ObjectType, and Tag columns that were previously always empty
84
+ - Property panel: show ALL string/enum IFC attributes dynamically using the schema registry (Name, Description, ObjectType, Tag, PredefinedType, etc.) instead of hardcoding only Name/Description/ObjectType
85
+ - Parser: add `extractAllEntityAttributes()` for schema-aware full attribute extraction, extend `extractEntityAttributesOnDemand()` to include Tag (IfcElement index 7)
86
+ - Query: add `EntityNode.tag` getter and `EntityNode.allAttributes()` method for comprehensive attribute access
87
+ - Performance: cache `getAttributeNames()` inheritance walks, hoist module-level constants
88
+ - Fix type name casing bug where multi-word UPPERCASE STEP types (e.g., IFCWALLSTANDARDCASE) failed schema lookup
89
+
90
+ - Updated dependencies [[`0967cfe`](https://github.com/louistrue/ifc-lite/commit/0967cfe9a203141ee6fc7604153721396f027658), [`057bde9`](https://github.com/louistrue/ifc-lite/commit/057bde9e48f64c07055413c690c6bdabb6942d04), [`e0af898`](https://github.com/louistrue/ifc-lite/commit/e0af898608c2f706dc2d82154c612c64e2de010c), [`6c43c70`](https://github.com/louistrue/ifc-lite/commit/6c43c707ead13fc482ec367cb08d847b444a484a)]:
91
+ - @ifc-lite/encoding@1.7.0
92
+ - @ifc-lite/lists@1.7.0
93
+ - @ifc-lite/renderer@1.7.0
94
+ - @ifc-lite/parser@1.7.0
95
+ - @ifc-lite/query@1.7.0
96
+ - @ifc-lite/data@1.7.0
97
+ - @ifc-lite/cache@1.7.0
98
+ - @ifc-lite/export@1.7.0
99
+ - @ifc-lite/ids@1.7.0
100
+ - @ifc-lite/bcf@1.7.0
101
+ - @ifc-lite/drawing-2d@1.7.0
102
+ - @ifc-lite/geometry@1.7.0
103
+ - @ifc-lite/lens@1.7.0
104
+ - @ifc-lite/mutations@1.7.0
105
+ - @ifc-lite/server-client@1.7.0
106
+ - @ifc-lite/spatial@1.7.0
107
+ - @ifc-lite/wasm@1.7.0
108
+
3
109
  ## 1.6.0
4
110
 
5
111
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import{_ as bt,a as M,b as Si,c as ie,d as p,e as ba}from"./index-D1Du89Pa.js";const _a=new TextDecoder("utf-8"),vn=i=>_a.decode(i),va=new TextEncoder,Zi=i=>va.encode(i),wa=i=>typeof i=="number",Hs=i=>typeof i=="boolean",P=i=>typeof i=="function",nt=i=>i!=null&&Object(i)===i,ne=i=>nt(i)&&P(i.then),Ge=i=>nt(i)&&P(i[Symbol.iterator]),Se=i=>nt(i)&&P(i[Symbol.asyncIterator]),wn=i=>nt(i)&&nt(i.schema),Ks=i=>nt(i)&&"done"in i&&"value"in i,Gs=i=>nt(i)&&P(i.stat)&&wa(i.fd),qs=i=>nt(i)&&Tn(i.body),Qi=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Ia=i=>nt(i)&&P(i.abort)&&P(i.getWriter)&&!Qi(i),Tn=i=>nt(i)&&P(i.cancel)&&P(i.getReader)&&!Qi(i),Sa=i=>nt(i)&&P(i.end)&&P(i.write)&&Hs(i.writable)&&!Qi(i),Zs=i=>nt(i)&&P(i.read)&&P(i.pipe)&&Hs(i.readable)&&!Qi(i),Ba=i=>nt(i)&&P(i.clear)&&P(i.bytes)&&P(i.position)&&P(i.setPosition)&&P(i.capacity)&&P(i.getBufferIdentifier)&&P(i.createLong),Nn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Da(i){const t=i[0]?[i[0]]:[];let e,n,s,r;for(let o,a,c=0,l=0,h=i.length;++c<h;){if(o=t[l],a=i[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:e,byteLength:s}=o,{byteOffset:n,byteLength:r}=a,e+s<n||n+r<e){a&&(t[++l]=a);continue}t[l]=new Uint8Array(o.buffer,e,n-e+r)}return t}function ii(i,t,e=0,n=t.byteLength){const s=i.byteLength,r=new Uint8Array(i.buffer,i.byteOffset,s),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,s));return r.set(o,e),i}function wt(i,t){const e=Da(i),n=e.reduce((h,d)=>h+d.byteLength,0);let s,r,o,a=0,c=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,n);for(const h=e.length;++c<h;){if(s=e[c],r=s.subarray(0,Math.min(s.length,l-a)),l<=a+r.length){r.length<s.length?e[c]=s.subarray(r.length):r.length===s.length&&c++,o?ii(o,r,a):o=r;break}ii(o||(o=new Uint8Array(l)),r,a),a+=r.length}return[o||new Uint8Array(0),e.slice(c),n-(o?o.byteLength:0)]}function T(i,t){let e=Ks(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Zi(e)),e instanceof ArrayBuffer?new i(e):e instanceof Nn?new i(e):Ba(e)?T(i,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new i(0):new i(e.buffer,e.byteOffset,e.byteLength/i.BYTES_PER_ELEMENT):i.from(e)):new i(0)}const Aa=i=>T(Int8Array,i),Oa=i=>T(Int16Array,i),Fe=i=>T(Int32Array,i),Fa=i=>T(BigInt64Array,i),N=i=>T(Uint8Array,i),Ma=i=>T(Uint16Array,i),Ta=i=>T(Uint32Array,i),Na=i=>T(BigUint64Array,i),La=i=>T(Float32Array,i),Ua=i=>T(Float64Array,i),xa=i=>T(Uint8ClampedArray,i),In=i=>(i.next(),i);function*kt(i,t){const e=function*(s){yield s},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nn?e(t):Ge(t)?t:e(t);return yield*In(function*(s){let r=null;do r=s.next(yield T(i,r));while(!r.done)}(n[Symbol.iterator]())),new i}const Ca=i=>kt(Int8Array,i),Ea=i=>kt(Int16Array,i),Va=i=>kt(Int32Array,i),Qs=i=>kt(Uint8Array,i),Ra=i=>kt(Uint16Array,i),za=i=>kt(Uint32Array,i),ja=i=>kt(Float32Array,i),ka=i=>kt(Float64Array,i),Pa=i=>kt(Uint8ClampedArray,i);function Bt(i,t){return bt(this,arguments,function*(){if(ne(t))return yield M(yield M(yield*Si(ie(Bt(i,yield M(t))))));const n=function(o){return bt(this,arguments,function*(){yield yield M(yield M(o))})},s=function(o){return bt(this,arguments,function*(){yield M(yield*Si(ie(In(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(o[Symbol.iterator]())))))})},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nn?n(t):Ge(t)?s(t):Se(t)?t:n(t);return yield M(yield*Si(ie(In(function(o){return bt(this,arguments,function*(){let a=null;do a=yield M(o.next(yield yield M(T(i,a))));while(!a.done)})}(r[Symbol.asyncIterator]()))))),yield M(new i)})}const $a=i=>Bt(Int8Array,i),Wa=i=>Bt(Int16Array,i),Ya=i=>Bt(Int32Array,i),Xs=i=>Bt(Uint8Array,i),Ja=i=>Bt(Uint16Array,i),Ha=i=>Bt(Uint32Array,i),Ka=i=>Bt(Float32Array,i),Ga=i=>Bt(Float64Array,i),qa=i=>Bt(Uint8ClampedArray,i);function Ln(i,t,e){if(i!==0){e=e.slice(0,t);for(let n=-1,s=e.length;++n<s;)e[n]+=i}return e.subarray(0,t)}function tr(i,t){let e=0;const n=i.length;if(n!==t.length)return!1;if(n>0)do if(i[e]!==t[e])return!1;while(++e<n);return!0}const Za=Object.freeze(Object.defineProperty({__proto__:null,compareArrayLike:tr,joinUint8Arrays:wt,memcpy:ii,rebaseValueOffsets:Ln,toArrayBufferView:T,toArrayBufferViewAsyncIterator:Bt,toArrayBufferViewIterator:kt,toBigInt64Array:Fa,toBigUint64Array:Na,toFloat32Array:La,toFloat32ArrayAsyncIterator:Ka,toFloat32ArrayIterator:ja,toFloat64Array:Ua,toFloat64ArrayAsyncIterator:Ga,toFloat64ArrayIterator:ka,toInt16Array:Oa,toInt16ArrayAsyncIterator:Wa,toInt16ArrayIterator:Ea,toInt32Array:Fe,toInt32ArrayAsyncIterator:Ya,toInt32ArrayIterator:Va,toInt8Array:Aa,toInt8ArrayAsyncIterator:$a,toInt8ArrayIterator:Ca,toUint16Array:Ma,toUint16ArrayAsyncIterator:Ja,toUint16ArrayIterator:Ra,toUint32Array:Ta,toUint32ArrayAsyncIterator:Ha,toUint32ArrayIterator:za,toUint8Array:N,toUint8ArrayAsyncIterator:Xs,toUint8ArrayIterator:Qs,toUint8ClampedArray:xa,toUint8ClampedArrayAsyncIterator:qa,toUint8ClampedArrayIterator:Pa},Symbol.toStringTag,{value:"Module"})),ot={fromIterable(i){return vi(Qa(i))},fromAsyncIterable(i){return vi(Xa(i))},fromDOMStream(i){return vi(tc(i))},fromNodeStream(i){return vi(ic(i))},toDOMStream(i,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(i,t){throw new Error('"toNodeStream" not available in this environment')}},vi=i=>(i.next(),i);function*Qa(i){let t,e=!1,n=[],s,r,o,a=0;function c(){return r==="peek"?wt(n,o)[0]:([s,n,a]=wt(n,o),s)}({cmd:r,size:o}=yield null);const l=Qs(i)[Symbol.iterator]();try{do if({done:t,value:s}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&s.byteLength>0&&(n.push(s),a+=s.byteLength),t||o<=a)do({cmd:r,size:o}=yield c());while(o<a);while(!t)}catch(h){(e=!0)&&typeof l.throw=="function"&&l.throw(h)}finally{e===!1&&typeof l.return=="function"&&l.return(null)}return null}function Xa(i){return bt(this,arguments,function*(){let e,n=!1,s=[],r,o,a,c=0;function l(){return o==="peek"?wt(s,a)[0]:([r,s,c]=wt(s,a),r)}({cmd:o,size:a}=yield yield M(null));const h=Xs(i)[Symbol.asyncIterator]();try{do if({done:e,value:r}=Number.isNaN(a-c)?yield M(h.next()):yield M(h.next(a-c)),!e&&r.byteLength>0&&(s.push(r),c+=r.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield M(l()));while(a<c);while(!e)}catch(d){(n=!0)&&typeof h.throw=="function"&&(yield M(h.throw(d)))}finally{n===!1&&typeof h.return=="function"&&(yield M(h.return(new Uint8Array(0))))}return yield M(null)})}function tc(i){return bt(this,arguments,function*(){let e=!1,n=!1,s=[],r,o,a,c=0;function l(){return o==="peek"?wt(s,a)[0]:([r,s,c]=wt(s,a),r)}({cmd:o,size:a}=yield yield M(null));const h=new ec(i);try{do if({done:e,value:r}=Number.isNaN(a-c)?yield M(h.read()):yield M(h.read(a-c)),!e&&r.byteLength>0&&(s.push(N(r)),c+=r.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield M(l()));while(a<c);while(!e)}catch(d){(n=!0)&&(yield M(h.cancel(d)))}finally{n===!1?yield M(h.cancel()):i.locked&&h.releaseLock()}return yield M(null)})}class ec{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return p(this,void 0,void 0,function*(){const{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return p(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=N(e)),e})}}const yn=(i,t)=>{const e=s=>n([t,s]);let n;return[t,e,new Promise(s=>(n=s)&&i.once(t,e))]};function ic(i){return bt(this,arguments,function*(){const e=[];let n="error",s=!1,r=null,o,a,c=0,l=[],h;function d(){return o==="peek"?wt(l,a)[0]:([h,l,c]=wt(l,a),h)}if({cmd:o,size:a}=yield yield M(null),i.isTTY)return yield yield M(new Uint8Array(0)),yield M(null);try{e[0]=yn(i,"end"),e[1]=yn(i,"error");do{if(e[2]=yn(i,"readable"),[n,r]=yield M(Promise.race(e.map(j=>j[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(h=N(i.read(a-c)),h.byteLength<a-c&&(h=N(i.read()))):h=N(i.read()),h.byteLength>0&&(l.push(h),c+=h.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield M(d()));while(a<c)}while(!s)}finally{yield M(U(e,n==="error"?r:null))}return yield M(null);function U(j,ut){return h=l=null,new Promise((pa,ga)=>{for(const[De,ma]of j)i.off(De,ma);try{const De=i.destroy;De&&De.call(i,ut),ut=void 0}catch(De){ut=De||ut}finally{ut!=null?ga(ut):pa()}})}})}var H;(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4",i[i.V5=4]="V5"})(H||(H={}));var W;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(W||(W={}));var J;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(J||(J={}));var ct;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(ct||(ct={}));var f;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(f||(f={}));var It;(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME",i[i.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(It||(It={}));var V;(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(V||(V={}));var u;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.Float=3]="Float",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct=13]="Struct",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.Dictionary=-1]="Dictionary",i[i.Int8=-2]="Int8",i[i.Int16=-3]="Int16",i[i.Int32=-4]="Int32",i[i.Int64=-5]="Int64",i[i.Uint8=-6]="Uint8",i[i.Uint16=-7]="Uint16",i[i.Uint32=-8]="Uint32",i[i.Uint64=-9]="Uint64",i[i.Float16=-10]="Float16",i[i.Float32=-11]="Float32",i[i.Float64=-12]="Float64",i[i.DateDay=-13]="DateDay",i[i.DateMillisecond=-14]="DateMillisecond",i[i.TimestampSecond=-15]="TimestampSecond",i[i.TimestampMillisecond=-16]="TimestampMillisecond",i[i.TimestampMicrosecond=-17]="TimestampMicrosecond",i[i.TimestampNanosecond=-18]="TimestampNanosecond",i[i.TimeSecond=-19]="TimeSecond",i[i.TimeMillisecond=-20]="TimeMillisecond",i[i.TimeMicrosecond=-21]="TimeMicrosecond",i[i.TimeNanosecond=-22]="TimeNanosecond",i[i.DenseUnion=-23]="DenseUnion",i[i.SparseUnion=-24]="SparseUnion",i[i.IntervalDayTime=-25]="IntervalDayTime",i[i.IntervalYearMonth=-26]="IntervalYearMonth",i[i.DurationSecond=-27]="DurationSecond",i[i.DurationMillisecond=-28]="DurationMillisecond",i[i.DurationMicrosecond=-29]="DurationMicrosecond",i[i.DurationNanosecond=-30]="DurationNanosecond"})(u||(u={}));var Ft;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Ft||(Ft={}));const nc=void 0;function se(i){if(i===null)return"null";if(i===nc)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>se(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}const sc=Object.freeze(Object.defineProperty({__proto__:null,valueToString:se},Symbol.toStringTag,{value:"Module"})),er=Symbol.for("isArrowBigNum");function Dt(i,...t){return t.length===0?Object.setPrototypeOf(T(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Dt.prototype[er]=!0;Dt.prototype.toJSON=function(){return`"${ze(this)}"`};Dt.prototype.valueOf=function(){return ir(this)};Dt.prototype.toString=function(){return ze(this)};Dt.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return ir(this);case"string":return ze(this);case"default":return nr(this)}return ze(this)};function xe(...i){return Dt.apply(this,i)}function Ce(...i){return Dt.apply(this,i)}function ni(...i){return Dt.apply(this,i)}Object.setPrototypeOf(xe.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ce.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ni.prototype,Object.create(Uint32Array.prototype));Object.assign(xe.prototype,Dt.prototype,{constructor:xe,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ce.prototype,Dt.prototype,{constructor:Ce,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ni.prototype,Dt.prototype,{constructor:ni,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function ir(i){const{buffer:t,byteOffset:e,length:n,signed:s}=i,r=new BigUint64Array(t,e,n),o=s&&r.at(-1)&BigInt(1)<<BigInt(63);let a=BigInt(o?1:0),c=BigInt(0);if(o){for(const l of r)a+=~l*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(const l of r)a+=l*(BigInt(1)<<BigInt(32)*c++);return a}const ze=i=>{if(i.byteLength===8)return`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`;if(!i.signed)return pn(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return pn(i);t=t.slice();let n=1;for(let r=0;r<t.length;r++){const o=t[r],a=~o+n;t[r]=a,n&=o===0?1:0}return`-${pn(t)}`},nr=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:ze(i);function pn(i){let t="";const e=new Uint32Array(2);let n=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);const s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer);let r=-1;const o=n.length-1;do{for(e[0]=n[r=0];r<o;)n[r++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+n[r];n[r]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(s[0]||s[1]||s[2]||s[3]);return t??"0"}class fi{static new(t,e){switch(e){case!0:return new xe(t);case!1:return new Ce(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new xe(t)}return t.byteLength===16?new ni(t):new Ce(t)}static signed(t){return new xe(t)}static unsigned(t){return new Ce(t)}static decimal(t){return new ni(t)}constructor(t,e){return fi.new(t,e)}}const rc=Object.freeze(Object.defineProperty({__proto__:null,BN:fi,bigNumToBigInt:nr,bigNumToString:ze,isArrowBigNumSymbol:er},Symbol.toStringTag,{value:"Module"}));function St(i){if(typeof i=="bigint"&&(i<Number.MIN_SAFE_INTEGER||i>Number.MAX_SAFE_INTEGER))throw new TypeError(`${i} is not safe to convert to a number.`);return Number(i)}var sr,rr,or,ar,cr,lr,ur,hr,dr,fr,yr,pr,gr,mr,br,_r,vr,wr,Ir,Sr;class y{static isNull(t){return t?.typeId===u.Null}static isInt(t){return t?.typeId===u.Int}static isFloat(t){return t?.typeId===u.Float}static isBinary(t){return t?.typeId===u.Binary}static isUtf8(t){return t?.typeId===u.Utf8}static isBool(t){return t?.typeId===u.Bool}static isDecimal(t){return t?.typeId===u.Decimal}static isDate(t){return t?.typeId===u.Date}static isTime(t){return t?.typeId===u.Time}static isTimestamp(t){return t?.typeId===u.Timestamp}static isInterval(t){return t?.typeId===u.Interval}static isDuration(t){return t?.typeId===u.Duration}static isList(t){return t?.typeId===u.List}static isStruct(t){return t?.typeId===u.Struct}static isUnion(t){return t?.typeId===u.Union}static isFixedSizeBinary(t){return t?.typeId===u.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===u.FixedSizeList}static isMap(t){return t?.typeId===u.Map}static isDictionary(t){return t?.typeId===u.Dictionary}static isDenseUnion(t){return y.isUnion(t)&&t.mode===W.Dense}static isSparseUnion(t){return y.isUnion(t)&&t.mode===W.Sparse}get typeId(){return u.NONE}}sr=Symbol.toStringTag;y[sr]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(y.prototype);let Jt=class extends y{toString(){return"Null"}get typeId(){return u.Null}};rr=Symbol.toStringTag;Jt[rr]=(i=>i[Symbol.toStringTag]="Null")(Jt.prototype);class Q extends y{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return u.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}or=Symbol.toStringTag;Q[or]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Q.prototype);class Br extends Q{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}class Dr extends Q{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}class ve extends Q{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}let Un=class extends Q{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}};class Ar extends Q{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}class Or extends Q{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}class Fr extends Q{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}let Mr=class extends Q{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Br.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Dr.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ve.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Un.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ar.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Or.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Fr.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Mr.prototype,"ArrayType",{value:BigUint64Array});class re extends y{constructor(t){super(),this.precision=t}get typeId(){return u.Float}get ArrayType(){switch(this.precision){case J.HALF:return Uint16Array;case J.SINGLE:return Float32Array;case J.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}ar=Symbol.toStringTag;re[ar]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(re.prototype);class oc extends re{constructor(){super(J.HALF)}}class Tr extends re{constructor(){super(J.SINGLE)}}class xn extends re{constructor(){super(J.DOUBLE)}}Object.defineProperty(oc.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Tr.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(xn.prototype,"ArrayType",{value:Float64Array});let Ni=class extends y{constructor(){super()}get typeId(){return u.Binary}toString(){return"Binary"}};cr=Symbol.toStringTag;Ni[cr]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(Ni.prototype);let si=class extends y{constructor(){super()}get typeId(){return u.Utf8}toString(){return"Utf8"}};lr=Symbol.toStringTag;si[lr]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(si.prototype);let ri=class extends y{constructor(){super()}get typeId(){return u.Bool}toString(){return"Bool"}};ur=Symbol.toStringTag;ri[ur]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(ri.prototype);let Li=class extends y{constructor(t,e,n=128){super(),this.scale=t,this.precision=e,this.bitWidth=n}get typeId(){return u.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};hr=Symbol.toStringTag;Li[hr]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Li.prototype);class je extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Date}toString(){return`Date${(this.unit+1)*32}<${ct[this.unit]}>`}}dr=Symbol.toStringTag;je[dr]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(je.prototype);class gh extends je{constructor(){super(ct.DAY)}}class ac extends je{constructor(){super(ct.MILLISECOND)}}class Ht extends y{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return u.Time}toString(){return`Time${this.bitWidth}<${f[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}fr=Symbol.toStringTag;Ht[fr]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Ht.prototype);class mh extends Ht{constructor(){super(f.SECOND,32)}}class bh extends Ht{constructor(){super(f.MILLISECOND,32)}}class _h extends Ht{constructor(){super(f.MICROSECOND,64)}}class vh extends Ht{constructor(){super(f.NANOSECOND,64)}}class oe extends y{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return u.Timestamp}toString(){return`Timestamp<${f[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}yr=Symbol.toStringTag;oe[yr]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(oe.prototype);class wh extends oe{constructor(t){super(f.SECOND,t)}}class Ih extends oe{constructor(t){super(f.MILLISECOND,t)}}class Sh extends oe{constructor(t){super(f.MICROSECOND,t)}}class Bh extends oe{constructor(t){super(f.NANOSECOND,t)}}class ke extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Interval}toString(){return`Interval<${It[this.unit]}>`}}pr=Symbol.toStringTag;ke[pr]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(ke.prototype);class Dh extends ke{constructor(){super(It.DAY_TIME)}}class Ah extends ke{constructor(){super(It.YEAR_MONTH)}}let ae=class extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Duration}toString(){return`Duration<${f[this.unit]}>`}};gr=Symbol.toStringTag;ae[gr]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(ae.prototype);class Fh extends ae{constructor(){super(f.SECOND)}}class Mh extends ae{constructor(){super(f.MILLISECOND)}}class Th extends ae{constructor(){super(f.MICROSECOND)}}class Nh extends ae{constructor(){super(f.NANOSECOND)}}let Pe=class extends y{constructor(t){super(),this.children=[t]}get typeId(){return u.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};mr=Symbol.toStringTag;Pe[mr]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(Pe.prototype);class K extends y{constructor(t){super(),this.children=t}get typeId(){return u.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}br=Symbol.toStringTag;K[br]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(K.prototype);class we extends y{constructor(t,e,n){super(),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((s,r,o)=>(s[r]=o)&&s||s,Object.create(null))}get typeId(){return u.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}_r=Symbol.toStringTag;we[_r]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(we.prototype);class Uh extends we{constructor(t,e){super(W.Dense,t,e)}}class xh extends we{constructor(t,e){super(W.Sparse,t,e)}}let Ui=class extends y{constructor(t){super(),this.byteWidth=t}get typeId(){return u.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};vr=Symbol.toStringTag;Ui[vr]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Ui.prototype);let oi=class extends y{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return u.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};wr=Symbol.toStringTag;oi[wr]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(oi.prototype);class ai extends y{constructor(t,e=!1){var n,s,r;if(super(),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.children)){const o=(s=t?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");const a=(r=t?.type)===null||r===void 0?void 0:r.children[1];a&&(a.name="value")}}get typeId(){return u.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Ir=Symbol.toStringTag;ai[Ir]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(ai.prototype);const cc=(i=>()=>++i)(-1);class ce extends y{constructor(t,e,n,s){super(),this.indices=e,this.dictionary=t,this.isOrdered=s||!1,this.id=n==null?cc():St(n)}get typeId(){return u.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Sr=Symbol.toStringTag;ce[Sr]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(ce.prototype);function Mt(i){const t=i;switch(i.typeId){case u.Decimal:return i.bitWidth/32;case u.Timestamp:return 2;case u.Date:return 1+t.unit;case u.Interval:return 1+t.unit;case u.FixedSizeList:return t.listSize;case u.FixedSizeBinary:return t.byteWidth;default:return 1}}class O{visitMany(t,...e){return t.map((n,s)=>this.visit(n,...e.map(r=>r[s])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return lc(this,t,e)}getVisitFnByTypeId(t,e=!0){return Me(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function lc(i,t,e=!0){return typeof t=="number"?Me(i,t,e):typeof t=="string"&&t in u?Me(i,u[t],e):t&&t instanceof y?Me(i,As(t),e):t?.type&&t.type instanceof y?Me(i,As(t.type),e):Me(i,u.NONE,e)}function Me(i,t,e=!0){let n=null;switch(t){case u.Null:n=i.visitNull;break;case u.Bool:n=i.visitBool;break;case u.Int:n=i.visitInt;break;case u.Int8:n=i.visitInt8||i.visitInt;break;case u.Int16:n=i.visitInt16||i.visitInt;break;case u.Int32:n=i.visitInt32||i.visitInt;break;case u.Int64:n=i.visitInt64||i.visitInt;break;case u.Uint8:n=i.visitUint8||i.visitInt;break;case u.Uint16:n=i.visitUint16||i.visitInt;break;case u.Uint32:n=i.visitUint32||i.visitInt;break;case u.Uint64:n=i.visitUint64||i.visitInt;break;case u.Float:n=i.visitFloat;break;case u.Float16:n=i.visitFloat16||i.visitFloat;break;case u.Float32:n=i.visitFloat32||i.visitFloat;break;case u.Float64:n=i.visitFloat64||i.visitFloat;break;case u.Utf8:n=i.visitUtf8;break;case u.Binary:n=i.visitBinary;break;case u.FixedSizeBinary:n=i.visitFixedSizeBinary;break;case u.Date:n=i.visitDate;break;case u.DateDay:n=i.visitDateDay||i.visitDate;break;case u.DateMillisecond:n=i.visitDateMillisecond||i.visitDate;break;case u.Timestamp:n=i.visitTimestamp;break;case u.TimestampSecond:n=i.visitTimestampSecond||i.visitTimestamp;break;case u.TimestampMillisecond:n=i.visitTimestampMillisecond||i.visitTimestamp;break;case u.TimestampMicrosecond:n=i.visitTimestampMicrosecond||i.visitTimestamp;break;case u.TimestampNanosecond:n=i.visitTimestampNanosecond||i.visitTimestamp;break;case u.Time:n=i.visitTime;break;case u.TimeSecond:n=i.visitTimeSecond||i.visitTime;break;case u.TimeMillisecond:n=i.visitTimeMillisecond||i.visitTime;break;case u.TimeMicrosecond:n=i.visitTimeMicrosecond||i.visitTime;break;case u.TimeNanosecond:n=i.visitTimeNanosecond||i.visitTime;break;case u.Decimal:n=i.visitDecimal;break;case u.List:n=i.visitList;break;case u.Struct:n=i.visitStruct;break;case u.Union:n=i.visitUnion;break;case u.DenseUnion:n=i.visitDenseUnion||i.visitUnion;break;case u.SparseUnion:n=i.visitSparseUnion||i.visitUnion;break;case u.Dictionary:n=i.visitDictionary;break;case u.Interval:n=i.visitInterval;break;case u.IntervalDayTime:n=i.visitIntervalDayTime||i.visitInterval;break;case u.IntervalYearMonth:n=i.visitIntervalYearMonth||i.visitInterval;break;case u.Duration:n=i.visitDuration;break;case u.DurationSecond:n=i.visitDurationSecond||i.visitDuration;break;case u.DurationMillisecond:n=i.visitDurationMillisecond||i.visitDuration;break;case u.DurationMicrosecond:n=i.visitDurationMicrosecond||i.visitDuration;break;case u.DurationNanosecond:n=i.visitDurationNanosecond||i.visitDuration;break;case u.FixedSizeList:n=i.visitFixedSizeList;break;case u.Map:n=i.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${u[t]}'`)}function As(i){switch(i.typeId){case u.Null:return u.Null;case u.Int:{const{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?u.Int8:u.Uint8;case 16:return e?u.Int16:u.Uint16;case 32:return e?u.Int32:u.Uint32;case 64:return e?u.Int64:u.Uint64}return u.Int}case u.Float:switch(i.precision){case J.HALF:return u.Float16;case J.SINGLE:return u.Float32;case J.DOUBLE:return u.Float64}return u.Float;case u.Binary:return u.Binary;case u.Utf8:return u.Utf8;case u.Bool:return u.Bool;case u.Decimal:return u.Decimal;case u.Time:switch(i.unit){case f.SECOND:return u.TimeSecond;case f.MILLISECOND:return u.TimeMillisecond;case f.MICROSECOND:return u.TimeMicrosecond;case f.NANOSECOND:return u.TimeNanosecond}return u.Time;case u.Timestamp:switch(i.unit){case f.SECOND:return u.TimestampSecond;case f.MILLISECOND:return u.TimestampMillisecond;case f.MICROSECOND:return u.TimestampMicrosecond;case f.NANOSECOND:return u.TimestampNanosecond}return u.Timestamp;case u.Date:switch(i.unit){case ct.DAY:return u.DateDay;case ct.MILLISECOND:return u.DateMillisecond}return u.Date;case u.Interval:switch(i.unit){case It.DAY_TIME:return u.IntervalDayTime;case It.YEAR_MONTH:return u.IntervalYearMonth}return u.Interval;case u.Duration:switch(i.unit){case f.SECOND:return u.DurationSecond;case f.MILLISECOND:return u.DurationMillisecond;case f.MICROSECOND:return u.DurationMicrosecond;case f.NANOSECOND:return u.DurationNanosecond}return u.Duration;case u.Map:return u.Map;case u.List:return u.List;case u.Struct:return u.Struct;case u.Union:switch(i.mode){case W.Dense:return u.DenseUnion;case W.Sparse:return u.SparseUnion}return u.Union;case u.FixedSizeBinary:return u.FixedSizeBinary;case u.FixedSizeList:return u.FixedSizeList;case u.Dictionary:return u.Dictionary}throw new Error(`Unrecognized type '${u[i.typeId]}'`)}O.prototype.visitInt8=null;O.prototype.visitInt16=null;O.prototype.visitInt32=null;O.prototype.visitInt64=null;O.prototype.visitUint8=null;O.prototype.visitUint16=null;O.prototype.visitUint32=null;O.prototype.visitUint64=null;O.prototype.visitFloat16=null;O.prototype.visitFloat32=null;O.prototype.visitFloat64=null;O.prototype.visitDateDay=null;O.prototype.visitDateMillisecond=null;O.prototype.visitTimestampSecond=null;O.prototype.visitTimestampMillisecond=null;O.prototype.visitTimestampMicrosecond=null;O.prototype.visitTimestampNanosecond=null;O.prototype.visitTimeSecond=null;O.prototype.visitTimeMillisecond=null;O.prototype.visitTimeMicrosecond=null;O.prototype.visitTimeNanosecond=null;O.prototype.visitDenseUnion=null;O.prototype.visitSparseUnion=null;O.prototype.visitIntervalDayTime=null;O.prototype.visitIntervalYearMonth=null;O.prototype.visitDuration=null;O.prototype.visitDurationSecond=null;O.prototype.visitDurationMillisecond=null;O.prototype.visitDurationMicrosecond=null;O.prototype.visitDurationNanosecond=null;const Nr=new Float64Array(1),Ae=new Uint32Array(Nr.buffer);function Cn(i){const t=(i&31744)>>10,e=(i&1023)/1024,n=Math.pow(-1,(i&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function En(i){if(i!==i)return 32256;Nr[0]=i;const t=(Ae[1]&2147483648)>>16&65535;let e=Ae[1]&2146435072,n=0;return e>=1089470464?Ae[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Ae[1]&1048575)>>10):e<=1056964608?(n=1048576+(Ae[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Ae[1]&1048575)+512>>10),t|e|n&65535}const uc=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:En,uint16ToFloat64:Cn},Symbol.toStringTag,{value:"Module"}));class I extends O{}function D(i){return(t,e,n)=>{if(t.setValid(e,n!=null))return i(t,e,n)}}const hc=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},Vn=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},dc=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},fc=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},Lr=(i,t,e,n)=>{if(e+1<t.length){const{[e]:s,[e+1]:r}=t;i.set(n.subarray(0,r-s),s)}},yc=({offset:i,values:t},e,n)=>{const s=i+e;n?t[s>>3]|=1<<s%8:t[s>>3]&=~(1<<s%8)},Kt=({values:i},t,e)=>{i[t]=e},Rn=({values:i},t,e)=>{i[t]=e},Ur=({values:i},t,e)=>{i[t]=En(e)},pc=(i,t,e)=>{switch(i.type.precision){case J.HALF:return Ur(i,t,e);case J.SINGLE:case J.DOUBLE:return Rn(i,t,e)}},zn=({values:i},t,e)=>{hc(i,t,e.valueOf())},jn=({values:i},t,e)=>{Vn(i,t*2,e.valueOf())},xr=({stride:i,values:t},e,n)=>{t.set(n.subarray(0,i),i*e)},gc=({values:i,valueOffsets:t},e,n)=>Lr(i,t,e,n),mc=({values:i,valueOffsets:t},e,n)=>{Lr(i,t,e,Zi(n))},Cr=(i,t,e)=>{i.type.unit===ct.DAY?zn(i,t,e):jn(i,t,e)},kn=({values:i},t,e)=>Vn(i,t*2,e/1e3),Pn=({values:i},t,e)=>Vn(i,t*2,e),$n=({values:i},t,e)=>dc(i,t*2,e),Wn=({values:i},t,e)=>fc(i,t*2,e),Er=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return kn(i,t,e);case f.MILLISECOND:return Pn(i,t,e);case f.MICROSECOND:return $n(i,t,e);case f.NANOSECOND:return Wn(i,t,e)}},Yn=({values:i},t,e)=>{i[t]=e},Jn=({values:i},t,e)=>{i[t]=e},Hn=({values:i},t,e)=>{i[t]=e},Kn=({values:i},t,e)=>{i[t]=e},Vr=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return Yn(i,t,e);case f.MILLISECOND:return Jn(i,t,e);case f.MICROSECOND:return Hn(i,t,e);case f.NANOSECOND:return Kn(i,t,e)}},Rr=({values:i,stride:t},e,n)=>{i.set(n.subarray(0,t),t*e)},bc=(i,t,e)=>{const n=i.children[0],s=i.valueOffsets,r=yt.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=s[t],c=s[t+1];a<c;)r(n,a++,e[++o]);else for(let o=-1,a=s[t],c=s[t+1];a<c;)r(n,a++,e.get(++o))},_c=(i,t,e)=>{const n=i.children[0],{valueOffsets:s}=i,r=yt.getVisitFn(n);let{[t]:o,[t+1]:a}=s;const c=e instanceof Map?e.entries():Object.entries(e);for(const l of c)if(r(n,o,l),++o>=a)break},vc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[r]),wc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(r)),Ic=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(s.name)),Sc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[s.name]),Bc=(i,t,e)=>{const n=i.type.children.map(r=>yt.getVisitFn(r.type)),s=e instanceof Map?Ic(t,e):e instanceof g?wc(t,e):Array.isArray(e)?vc(t,e):Sc(t,e);i.type.children.forEach((r,o)=>s(n[o],i.children[o],r,o))},Dc=(i,t,e)=>{i.type.mode===W.Dense?zr(i,t,e):jr(i,t,e)},zr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];yt.visit(s,i.valueOffsets[t],e)},jr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];yt.visit(s,t,e)},Ac=(i,t,e)=>{var n;(n=i.dictionary)===null||n===void 0||n.set(i.values[t],e)},kr=(i,t,e)=>{i.type.unit===It.DAY_TIME?Gn(i,t,e):qn(i,t,e)},Gn=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},qn=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},Zn=({values:i},t,e)=>{i[t]=e},Qn=({values:i},t,e)=>{i[t]=e},Xn=({values:i},t,e)=>{i[t]=e},ts=({values:i},t,e)=>{i[t]=e},Pr=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return Zn(i,t,e);case f.MILLISECOND:return Qn(i,t,e);case f.MICROSECOND:return Xn(i,t,e);case f.NANOSECOND:return ts(i,t,e)}},Oc=(i,t,e)=>{const{stride:n}=i,s=i.children[0],r=yt.getVisitFn(s);if(Array.isArray(e))for(let o=-1,a=t*n;++o<n;)r(s,a+o,e[o]);else for(let o=-1,a=t*n;++o<n;)r(s,a+o,e.get(o))};I.prototype.visitBool=D(yc);I.prototype.visitInt=D(Kt);I.prototype.visitInt8=D(Kt);I.prototype.visitInt16=D(Kt);I.prototype.visitInt32=D(Kt);I.prototype.visitInt64=D(Kt);I.prototype.visitUint8=D(Kt);I.prototype.visitUint16=D(Kt);I.prototype.visitUint32=D(Kt);I.prototype.visitUint64=D(Kt);I.prototype.visitFloat=D(pc);I.prototype.visitFloat16=D(Ur);I.prototype.visitFloat32=D(Rn);I.prototype.visitFloat64=D(Rn);I.prototype.visitUtf8=D(mc);I.prototype.visitBinary=D(gc);I.prototype.visitFixedSizeBinary=D(xr);I.prototype.visitDate=D(Cr);I.prototype.visitDateDay=D(zn);I.prototype.visitDateMillisecond=D(jn);I.prototype.visitTimestamp=D(Er);I.prototype.visitTimestampSecond=D(kn);I.prototype.visitTimestampMillisecond=D(Pn);I.prototype.visitTimestampMicrosecond=D($n);I.prototype.visitTimestampNanosecond=D(Wn);I.prototype.visitTime=D(Vr);I.prototype.visitTimeSecond=D(Yn);I.prototype.visitTimeMillisecond=D(Jn);I.prototype.visitTimeMicrosecond=D(Hn);I.prototype.visitTimeNanosecond=D(Kn);I.prototype.visitDecimal=D(Rr);I.prototype.visitList=D(bc);I.prototype.visitStruct=D(Bc);I.prototype.visitUnion=D(Dc);I.prototype.visitDenseUnion=D(zr);I.prototype.visitSparseUnion=D(jr);I.prototype.visitDictionary=D(Ac);I.prototype.visitInterval=D(kr);I.prototype.visitIntervalDayTime=D(Gn);I.prototype.visitIntervalYearMonth=D(qn);I.prototype.visitDuration=D(Pr);I.prototype.visitDurationSecond=D(Zn);I.prototype.visitDurationMillisecond=D(Qn);I.prototype.visitDurationMicrosecond=D(Xn);I.prototype.visitDurationNanosecond=D(ts);I.prototype.visitFixedSizeList=D(Oc);I.prototype.visitMap=D(_c);const yt=new I,gt=Symbol.for("parent"),Ee=Symbol.for("rowIndex");class es{constructor(t,e){return this[gt]=t,this[Ee]=e,new Proxy(this,new Mc)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ee],e=this[gt],n=e.type.children,s={};for(let r=-1,o=n.length;++r<o;)s[n[r].name]=st.visit(e.children[r],t);return s}toString(){return`{${[...this].map(([t,e])=>`${se(t)}: ${se(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Fc(this[gt],this[Ee])}}class Fc{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,st.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(es.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[gt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ee]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class Mc{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[gt].type.children.map(e=>e.name)}has(t,e){return t[gt].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[gt].type.children.findIndex(n=>n.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[gt].type.children.findIndex(s=>s.name===e);if(n!==-1){const s=st.visit(t[gt].children[n],t[Ee]);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[gt].type.children.findIndex(r=>r.name===e);return s!==-1?(yt.visit(t[gt].children[s],t[Ee],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}class m extends O{}function S(i){return(t,e)=>t.getValid(e)?i(t,e):null}const Tc=(i,t)=>864e5*i[t],is=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),Nc=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,Lc=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,$r=i=>new Date(i),Uc=(i,t)=>$r(Tc(i,t)),xc=(i,t)=>$r(is(i,t)),Cc=(i,t)=>null,Wr=(i,t,e)=>{if(e+1>=t.length)return null;const n=t[e],s=t[e+1];return i.subarray(n,s)},Ec=({offset:i,values:t},e)=>{const n=i+e;return(t[n>>3]&1<<n%8)!==0},Yr=({values:i},t)=>Uc(i,t),Jr=({values:i},t)=>xc(i,t*2),he=({stride:i,values:t},e)=>t[i*e],Vc=({stride:i,values:t},e)=>Cn(t[i*e]),Hr=({values:i},t)=>i[t],Rc=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),zc=({values:i,valueOffsets:t},e)=>Wr(i,t,e),jc=({values:i,valueOffsets:t},e)=>{const n=Wr(i,t,e);return n!==null?vn(n):null},kc=({values:i},t)=>i[t],Pc=({type:i,values:t},e)=>i.precision!==J.HALF?t[e]:Cn(t[e]),$c=(i,t)=>i.type.unit===ct.DAY?Yr(i,t):Jr(i,t),Kr=({values:i},t)=>1e3*is(i,t*2),Gr=({values:i},t)=>is(i,t*2),qr=({values:i},t)=>Nc(i,t*2),Zr=({values:i},t)=>Lc(i,t*2),Wc=(i,t)=>{switch(i.type.unit){case f.SECOND:return Kr(i,t);case f.MILLISECOND:return Gr(i,t);case f.MICROSECOND:return qr(i,t);case f.NANOSECOND:return Zr(i,t)}},Qr=({values:i},t)=>i[t],Xr=({values:i},t)=>i[t],to=({values:i},t)=>i[t],eo=({values:i},t)=>i[t],Yc=(i,t)=>{switch(i.type.unit){case f.SECOND:return Qr(i,t);case f.MILLISECOND:return Xr(i,t);case f.MICROSECOND:return to(i,t);case f.NANOSECOND:return eo(i,t)}},Jc=({values:i,stride:t},e)=>fi.decimal(i.subarray(t*e,t*(e+1))),Hc=(i,t)=>{const{valueOffsets:e,stride:n,children:s}=i,{[t*n]:r,[t*n+1]:o}=e,c=s[0].slice(r,o-r);return new g([c])},Kc=(i,t)=>{const{valueOffsets:e,children:n}=i,{[t]:s,[t+1]:r}=e,o=n[0];return new Xi(o.slice(s,r-s))},Gc=(i,t)=>new es(i,t),qc=(i,t)=>i.type.mode===W.Dense?io(i,t):no(i,t),io=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,i.valueOffsets[t])},no=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,t)},Zc=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Qc=(i,t)=>i.type.unit===It.DAY_TIME?so(i,t):ro(i,t),so=({values:i},t)=>i.subarray(2*t,2*(t+1)),ro=({values:i},t)=>{const e=i[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},oo=({values:i},t)=>i[t],ao=({values:i},t)=>i[t],co=({values:i},t)=>i[t],lo=({values:i},t)=>i[t],Xc=(i,t)=>{switch(i.type.unit){case f.SECOND:return oo(i,t);case f.MILLISECOND:return ao(i,t);case f.MICROSECOND:return co(i,t);case f.NANOSECOND:return lo(i,t)}},tl=(i,t)=>{const{stride:e,children:n}=i,r=n[0].slice(t*e,e);return new g([r])};m.prototype.visitNull=S(Cc);m.prototype.visitBool=S(Ec);m.prototype.visitInt=S(kc);m.prototype.visitInt8=S(he);m.prototype.visitInt16=S(he);m.prototype.visitInt32=S(he);m.prototype.visitInt64=S(Hr);m.prototype.visitUint8=S(he);m.prototype.visitUint16=S(he);m.prototype.visitUint32=S(he);m.prototype.visitUint64=S(Hr);m.prototype.visitFloat=S(Pc);m.prototype.visitFloat16=S(Vc);m.prototype.visitFloat32=S(he);m.prototype.visitFloat64=S(he);m.prototype.visitUtf8=S(jc);m.prototype.visitBinary=S(zc);m.prototype.visitFixedSizeBinary=S(Rc);m.prototype.visitDate=S($c);m.prototype.visitDateDay=S(Yr);m.prototype.visitDateMillisecond=S(Jr);m.prototype.visitTimestamp=S(Wc);m.prototype.visitTimestampSecond=S(Kr);m.prototype.visitTimestampMillisecond=S(Gr);m.prototype.visitTimestampMicrosecond=S(qr);m.prototype.visitTimestampNanosecond=S(Zr);m.prototype.visitTime=S(Yc);m.prototype.visitTimeSecond=S(Qr);m.prototype.visitTimeMillisecond=S(Xr);m.prototype.visitTimeMicrosecond=S(to);m.prototype.visitTimeNanosecond=S(eo);m.prototype.visitDecimal=S(Jc);m.prototype.visitList=S(Hc);m.prototype.visitStruct=S(Gc);m.prototype.visitUnion=S(qc);m.prototype.visitDenseUnion=S(io);m.prototype.visitSparseUnion=S(no);m.prototype.visitDictionary=S(Zc);m.prototype.visitInterval=S(Qc);m.prototype.visitIntervalDayTime=S(so);m.prototype.visitIntervalYearMonth=S(ro);m.prototype.visitDuration=S(Xc);m.prototype.visitDurationSecond=S(oo);m.prototype.visitDurationMillisecond=S(ao);m.prototype.visitDurationMicrosecond=S(co);m.prototype.visitDurationNanosecond=S(lo);m.prototype.visitFixedSizeList=S(tl);m.prototype.visitMap=S(Kc);const st=new m,mt=Symbol.for("keys"),Ve=Symbol.for("vals");class Xi{constructor(t){return this[mt]=new g([t.children[0]]).memoize(),this[Ve]=t.children[1],new Proxy(this,new il)}[Symbol.iterator](){return new el(this[mt],this[Ve])}get size(){return this[mt].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[mt],e=this[Ve],n={};for(let s=-1,r=t.length;++s<r;)n[t.get(s)]=st.visit(e,s);return n}toString(){return`{${[...this].map(([t,e])=>`${se(t)}: ${se(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class el{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),st.visit(this.vals,t)]})}}class il{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[mt].toArray().map(String)}has(t,e){return t[mt].includes(e)}getOwnPropertyDescriptor(t,e){if(t[mt].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[mt].indexOf(e);if(n!==-1){const s=st.visit(Reflect.get(t,Ve),n);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[mt].indexOf(e);return s!==-1?(yt.visit(Reflect.get(t,Ve),s,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(Xi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[mt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ve]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function nl(i,t,e){const n=i.length,s=t>-1?t:n+t%n;return e?e(i,s):s}let Os;function ns(i,t,e,n){const{length:s=0}=i;let r=typeof t!="number"?0:t,o=typeof e!="number"?s:e;return r<0&&(r=(r%s+s)%s),o<0&&(o=(o%s+s)%s),o<r&&(Os=r,r=o,o=Os),o>s&&(o=s),n?n(i,r,o):[r,o]}const Fs=i=>i!==i;function Be(i){if(typeof i!=="object"||i===null)return Fs(i)?Fs:e=>e===i;if(i instanceof Date){const e=i.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(i)?e=>e?tr(i,e):!1:i instanceof Map?rl(i):Array.isArray(i)?sl(i):i instanceof g?ol(i):al(i,!0)}function sl(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Be(i[e]);return tn(t)}function rl(i){let t=-1;const e=[];for(const n of i.values())e[++t]=Be(n);return tn(e)}function ol(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Be(i.get(e));return tn(t)}function al(i,t=!1){const e=Object.keys(i);if(!t&&e.length===0)return()=>!1;const n=[];for(let s=-1,r=e.length;++s<r;)n[s]=Be(i[e[s]]);return tn(n,e)}function tn(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return cl(i,e);case Map:return Ms(i,e,e.keys());case Xi:case es:case Object:case void 0:return Ms(i,e,t||Object.keys(e))}return e instanceof g?ll(i,e):!1}}function cl(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t[n]))return!1;return!0}function ll(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t.get(n)))return!1;return!0}function Ms(i,t,e){const n=e[Symbol.iterator](),s=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),r=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=i.length;let c=r.next(),l=n.next(),h=s.next();for(;o<a&&!l.done&&!h.done&&!c.done&&!(l.value!==h.value||!i[o](c.value));++o,l=n.next(),h=s.next(),c=r.next());return o===a&&l.done&&h.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),r.return&&r.return(),!1)}const ul=Object.freeze(Object.defineProperty({__proto__:null,clampIndex:nl,clampRange:ns,createElementComparator:Be},Symbol.toStringTag,{value:"Module"}));function en(i,t,e,n){return(e&1<<n)!==0}function ss(i,t,e,n){return(e&1<<n)>>n}function hl(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function ci(i,t,e){const n=e.byteLength+7&-8;if(i>0||e.byteLength<n){const s=new Uint8Array(n);return s.set(i%8===0?e.subarray(i>>3):li(new $e(e,i,t,null,en)).subarray(0,n)),s}return e}function li(i){const t=[];let e=0,n=0,s=0;for(const o of i)o&&(s|=1<<n),++n===8&&(t[e++]=s,s=n=0);(e===0||n>0)&&(t[e++]=s);const r=new Uint8Array(t.length+7&-8);return r.set(t),r}class $e{constructor(t,e,n,s,r){this.bytes=t,this.length=n,this.context=s,this.get=r,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function xi(i,t,e){if(e-t<=0)return 0;if(e-t<8){let r=0;for(const o of new $e(i,t,e-t,i,ss))r+=o;return r}const n=e>>3<<3,s=t+(t%8===0?0:8-t%8);return xi(i,t,s)+xi(i,n,e)+uo(i,s>>3,n-s>>3)}function uo(i,t,e){let n=0,s=Math.trunc(t);const r=new DataView(i.buffer,i.byteOffset,i.byteLength),o=e===void 0?i.byteLength:s+e;for(;o-s>=4;)n+=Bi(r.getUint32(s)),s+=4;for(;o-s>=2;)n+=Bi(r.getUint16(s)),s+=2;for(;o-s>=1;)n+=Bi(r.getUint8(s)),s+=1;return n}function Bi(i){let t=Math.trunc(i);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const dl=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:$e,getBit:ss,getBool:en,packBools:li,popcnt_array:uo,popcnt_bit_range:xi,popcnt_uint32:Bi,setBool:hl,truncateBitmap:ci},Symbol.toStringTag,{value:"Module"})),fl=-1;class C{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return y.isSparseUnion(t)?this.children.some(e=>e.nullable):y.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:s,typeIds:r}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),r&&(t+=r.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(y.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let t=this._nullCount,e;return t<=fl&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-xi(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,s,r,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let c;r instanceof C?(this.stride=r.stride,this.values=r.values,this.typeIds=r.typeIds,this.nullBitmap=r.nullBitmap,this.valueOffsets=r.valueOffsets):(this.stride=Mt(t),r&&((c=r[0])&&(this.valueOffsets=c),(c=r[1])&&(this.values=c),(c=r[2])&&(this.nullBitmap=c),(c=r[3])&&(this.typeIds=c)))}getValid(t){const{type:e}=this;if(y.isUnion(e)){const n=e,s=this.children[n.typeIdToChildIndex[this.typeIds[t]]],r=n.mode===W.Dense?this.valueOffsets[t]:t;return s.getValid(r)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,e){let n;const{type:s}=this;if(y.isUnion(s)){const r=s,o=this.children[r.typeIdToChildIndex[this.typeIds[t]]],a=r.mode===W.Dense?this.valueOffsets[t]:t;n=o.getValid(a),o.setValid(a,e)}else{let{nullBitmap:r}=this;const{offset:o,length:a}=this,c=o+t,l=1<<c%8,h=c>>3;(!r||r.byteLength<=h)&&(r=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0&&r.set(ci(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r,_nullCount:-1}));const d=r[h];n=(d&l)!==0,e?r[h]=d|l:r[h]=d&~l}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,s=this._nullCount,r=this,o=this.children){return new C(t,e,n,s,r,o,this.dictionary)}slice(t,e){const{stride:n,typeId:s,children:r}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(t,e,n,s);return this.clone(this.type,this.offset+t,e,o,c,r.length===0||this.valueOffsets?r:this._sliceChildren(r,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===u.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,s=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);s[e>>3]=(1<<e-(e&-8))-1,n>0&&s.set(ci(this.offset,e,this.nullBitmap),0);const r=this.buffers;return r[Ft.VALIDITY]=s,this.clone(this.type,0,t,n+(t-e),r)}_sliceBuffers(t,e,n,s){let r;const{buffers:o}=this;return(r=o[Ft.TYPE])&&(o[Ft.TYPE]=r.subarray(t,t+e)),(r=o[Ft.OFFSET])&&(o[Ft.OFFSET]=r.subarray(t,t+e+1))||(r=o[Ft.DATA])&&(o[Ft.DATA]=s===6?r:r.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(s=>s.slice(e,n))}}C.prototype.children=Object.freeze([]);class ti extends O{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:s=0}=t;return new C(e,n,s,s)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.data),r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,s,r])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.data),r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,s,r])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:s}=t,r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,void 0,r],[s])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=N(t.nullBitmap),{length:o=s.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,void 0,r],s)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=T(e.ArrayType,t.typeIds),{["length"]:o=r.length,["nullCount"]:a=-1}=t;if(y.isSparseUnion(e))return new C(e,n,o,a,[void 0,void 0,void 0,r],s);const c=Fe(t.valueOffsets);return new C(e,n,o,a,[c,void 0,void 0,r],s)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.indices.ArrayType,t.data),{["dictionary"]:o=new g([new ti().visit({type:e.dictionary})])}=t,{["length"]:a=r.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[void 0,r,s],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new ti().visit({type:e.valueType})}=t,r=N(t.nullBitmap),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,void 0,r],[s])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new ti().visit({type:e.childType})}=t,r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,void 0,r],[s])}}const yl=new ti;function w(i){return yl.visit(i)}class Ts{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}function ho(i){return i.reduce((t,e)=>t+e.nullCount,0)}function fo(i){return i.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(i.length+1))}function yo(i,t,e,n){const s=[];for(let r=-1,o=i.length;++r<o;){const a=i[r],c=t[r],{length:l}=a;if(c>=n)break;if(e>=c+l)continue;if(c>=e&&c+l<=n){s.push(a);continue}const h=Math.max(0,e-c),d=Math.min(n-c,l);s.push(a.slice(h,d-h))}return s.length===0&&s.push(i[0].slice(0,0)),s}function rs(i,t,e,n){let s=0,r=0,o=t.length-1;do{if(s>=o-1)return e<t[o]?n(i,s,e-t[s]):null;r=s+Math.trunc((o-s)*.5),e<t[r]?o=r:s=r}while(s<o)}function os(i,t){return i.getValid(t)}function Re(i){function t(e,n,s){return i(e[n],s)}return function(e){const n=this.data;return rs(n,this._offsets,e,t)}}function po(i){let t;function e(n,s,r){return i(n[s],r,t)}return function(n,s){const r=this.data;t=s;const o=rs(r,this._offsets,n,e);return t=void 0,o}}function go(i){let t;function e(n,s,r){let o=r,a=0,c=0;for(let l=s-1,h=n.length;++l<h;){const d=n[l];if(~(a=i(d,t,o)))return c+a;o=0,c+=d.length}return-1}return function(n,s){t=n;const r=this.data,o=typeof s!="number"?e(r,0,0):rs(r,this._offsets,s,e);return t=void 0,o}}class b extends O{}function pl(i,t){return t===null&&i.length>0?0:-1}function gl(i,t){const{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let n=0;for(const s of new $e(e,i.offset+(t||0),i.length,e,en)){if(!s)return n;++n}return-1}function A(i,t,e){if(t===void 0)return-1;if(t===null)switch(i.typeId){case u.Union:break;case u.Dictionary:break;default:return gl(i,e)}const n=st.getVisitFn(i),s=Be(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}function mo(i,t,e){const n=st.getVisitFn(i),s=Be(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}b.prototype.visitNull=pl;b.prototype.visitBool=A;b.prototype.visitInt=A;b.prototype.visitInt8=A;b.prototype.visitInt16=A;b.prototype.visitInt32=A;b.prototype.visitInt64=A;b.prototype.visitUint8=A;b.prototype.visitUint16=A;b.prototype.visitUint32=A;b.prototype.visitUint64=A;b.prototype.visitFloat=A;b.prototype.visitFloat16=A;b.prototype.visitFloat32=A;b.prototype.visitFloat64=A;b.prototype.visitUtf8=A;b.prototype.visitBinary=A;b.prototype.visitFixedSizeBinary=A;b.prototype.visitDate=A;b.prototype.visitDateDay=A;b.prototype.visitDateMillisecond=A;b.prototype.visitTimestamp=A;b.prototype.visitTimestampSecond=A;b.prototype.visitTimestampMillisecond=A;b.prototype.visitTimestampMicrosecond=A;b.prototype.visitTimestampNanosecond=A;b.prototype.visitTime=A;b.prototype.visitTimeSecond=A;b.prototype.visitTimeMillisecond=A;b.prototype.visitTimeMicrosecond=A;b.prototype.visitTimeNanosecond=A;b.prototype.visitDecimal=A;b.prototype.visitList=A;b.prototype.visitStruct=A;b.prototype.visitUnion=A;b.prototype.visitDenseUnion=mo;b.prototype.visitSparseUnion=mo;b.prototype.visitDictionary=A;b.prototype.visitInterval=A;b.prototype.visitIntervalDayTime=A;b.prototype.visitIntervalYearMonth=A;b.prototype.visitDuration=A;b.prototype.visitDurationSecond=A;b.prototype.visitDurationMillisecond=A;b.prototype.visitDurationMicrosecond=A;b.prototype.visitDurationNanosecond=A;b.prototype.visitFixedSizeList=A;b.prototype.visitMap=A;const Ci=new b;class _ extends O{}function B(i){const{type:t}=i;if(i.nullCount===0&&i.stride===1&&(t.typeId===u.Timestamp||t instanceof Q&&t.bitWidth!==64||t instanceof Ht&&t.bitWidth!==64||t instanceof re&&t.precision!==J.HALF))return new Ts(i.data.length,n=>{const s=i.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let e=0;return new Ts(i.data.length,n=>{const r=i.data[n].length,o=i.slice(e,e+r);return e+=r,new ml(o)})}class ml{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}}_.prototype.visitNull=B;_.prototype.visitBool=B;_.prototype.visitInt=B;_.prototype.visitInt8=B;_.prototype.visitInt16=B;_.prototype.visitInt32=B;_.prototype.visitInt64=B;_.prototype.visitUint8=B;_.prototype.visitUint16=B;_.prototype.visitUint32=B;_.prototype.visitUint64=B;_.prototype.visitFloat=B;_.prototype.visitFloat16=B;_.prototype.visitFloat32=B;_.prototype.visitFloat64=B;_.prototype.visitUtf8=B;_.prototype.visitBinary=B;_.prototype.visitFixedSizeBinary=B;_.prototype.visitDate=B;_.prototype.visitDateDay=B;_.prototype.visitDateMillisecond=B;_.prototype.visitTimestamp=B;_.prototype.visitTimestampSecond=B;_.prototype.visitTimestampMillisecond=B;_.prototype.visitTimestampMicrosecond=B;_.prototype.visitTimestampNanosecond=B;_.prototype.visitTime=B;_.prototype.visitTimeSecond=B;_.prototype.visitTimeMillisecond=B;_.prototype.visitTimeMicrosecond=B;_.prototype.visitTimeNanosecond=B;_.prototype.visitDecimal=B;_.prototype.visitList=B;_.prototype.visitStruct=B;_.prototype.visitUnion=B;_.prototype.visitDenseUnion=B;_.prototype.visitSparseUnion=B;_.prototype.visitDictionary=B;_.prototype.visitInterval=B;_.prototype.visitIntervalDayTime=B;_.prototype.visitIntervalYearMonth=B;_.prototype.visitDuration=B;_.prototype.visitDurationSecond=B;_.prototype.visitDurationMillisecond=B;_.prototype.visitDurationMicrosecond=B;_.prototype.visitDurationNanosecond=B;_.prototype.visitFixedSizeList=B;_.prototype.visitMap=B;const as=new _,bl=(i,t)=>i+t;class de extends O{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===f.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitDuration(t,e){return 8}visitStruct(t,e){return t.children.reduce((n,s)=>n+Vt.visit(s,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((n,s)=>n+Vt.visit(s,e),0)}visitDictionary(t,e){var n;return t.type.indices.bitWidth/8+(((n=t.dictionary)===null||n===void 0?void 0:n.getByteLength(t.values[e]))||0)}}const _l=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),vl=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),wl=({valueOffsets:i,stride:t,children:e},n)=>{const s=e[0],{[n*t]:r}=i,{[n*t+1]:o}=i,a=Vt.getVisitFn(s.type),c=s.slice(r,o-r);let l=8;for(let h=-1,d=o-r;++h<d;)l+=a(c,h);return l},Il=({stride:i,children:t},e)=>{const n=t[0],s=n.slice(e*i,i),r=Vt.getVisitFn(n.type);let o=0;for(let a=-1,c=s.length;++a<c;)o+=r(s,a);return o},Sl=(i,t)=>i.type.mode===W.Dense?bo(i,t):_o(i,t),bo=({type:i,children:t,typeIds:e,valueOffsets:n},s)=>{const r=i.typeIdToChildIndex[e[s]];return 8+Vt.visit(t[r],n[s])},_o=({children:i},t)=>4+Vt.visitMany(i,i.map(()=>t)).reduce(bl,0);de.prototype.visitUtf8=_l;de.prototype.visitBinary=vl;de.prototype.visitList=wl;de.prototype.visitFixedSizeList=Il;de.prototype.visitUnion=Sl;de.prototype.visitDenseUnion=bo;de.prototype.visitSparseUnion=_o;const Vt=new de;var vo;const wo={},Io={};class g{constructor(t){var e,n,s;const r=t[0]instanceof g?t.flatMap(a=>a.data):t;if(r.length===0||r.some(a=>!(a instanceof C)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=r[0])===null||e===void 0?void 0:e.type;switch(r.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:c,indexOf:l,byteLength:h}=wo[o.typeId],d=r[0];this.isValid=U=>os(d,U),this.get=U=>a(d,U),this.set=(U,j)=>c(d,U,j),this.indexOf=U=>l(d,U),this.getByteLength=U=>h(d,U),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,Io[o.typeId]),this._offsets=fo(r);break}this.data=r,this.type=o,this.stride=Mt(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullCount(){return ho(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${u[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}getByteLength(t){return 0}[Symbol.iterator](){return as.visit(this)}concat(...t){return new g(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new g(ns(this,t,e,({data:n,_offsets:s},r,o)=>yo(n,s,r,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:s,ArrayType:r}=this;switch(t.typeId){case u.Int:case u.Float:case u.Decimal:case u.Time:case u.Timestamp:switch(e.length){case 0:return new r;case 1:return e[0].values.subarray(0,n*s);default:return e.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new r(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new g(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return y.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(y.isDictionary(this.type)){const t=new Ei(this.data[0].dictionary),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new g(e)}return new Ei(this)}unmemoize(){if(y.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new g(e)}return this}}vo=Symbol.toStringTag;g[vo]=(i=>{i.type=y.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;const t=Object.keys(u).map(e=>u[e]).filter(e=>typeof e=="number"&&e!==u.NONE);for(const e of t){const n=st.getVisitFnByTypeId(e),s=yt.getVisitFnByTypeId(e),r=Ci.getVisitFnByTypeId(e),o=Vt.getVisitFnByTypeId(e);wo[e]={get:n,set:s,indexOf:r,byteLength:o},Io[e]=Object.create(i,{isValid:{value:Re(os)},get:{value:Re(st.getVisitFnByTypeId(e))},set:{value:po(yt.getVisitFnByTypeId(e))},indexOf:{value:go(Ci.getVisitFnByTypeId(e))},getByteLength:{value:Re(Vt.getVisitFnByTypeId(e))}})}return"Vector"})(g.prototype);class Ei extends g{constructor(t){super(t.data);const e=this.get,n=this.set,s=this.slice,r=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=r[o];if(a!==void 0)return a;const c=e.call(this,o);return r[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),r[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Ei(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new g(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}function cs(i){if(i){if(i instanceof C)return new g([i]);if(i instanceof g)return new g(i.data);if(i.type instanceof y)return new g([w(i)]);if(Array.isArray(i))return new g(i.flatMap(t=>Bl(t)));if(ArrayBuffer.isView(i)){i instanceof DataView&&(i=new Uint8Array(i.buffer));const t={offset:0,length:i.length,nullCount:0,data:i};if(i instanceof Int8Array)return new g([w(Object.assign(Object.assign({},t),{type:new Br}))]);if(i instanceof Int16Array)return new g([w(Object.assign(Object.assign({},t),{type:new Dr}))]);if(i instanceof Int32Array)return new g([w(Object.assign(Object.assign({},t),{type:new ve}))]);if(i instanceof BigInt64Array)return new g([w(Object.assign(Object.assign({},t),{type:new Un}))]);if(i instanceof Uint8Array||i instanceof Uint8ClampedArray)return new g([w(Object.assign(Object.assign({},t),{type:new Ar}))]);if(i instanceof Uint16Array)return new g([w(Object.assign(Object.assign({},t),{type:new Or}))]);if(i instanceof Uint32Array)return new g([w(Object.assign(Object.assign({},t),{type:new Fr}))]);if(i instanceof BigUint64Array)return new g([w(Object.assign(Object.assign({},t),{type:new Mr}))]);if(i instanceof Float32Array)return new g([w(Object.assign(Object.assign({},t),{type:new Tr}))]);if(i instanceof Float64Array)return new g([w(Object.assign(Object.assign({},t),{type:new xn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function Bl(i){return i instanceof C?[i]:i instanceof g?i.data:cs(i).data}function Dl(i){if(!i||i.length<=0)return function(s){return!0};let t="";const e=i.filter(n=>n===n);return e.length>0&&(t=`
1
+ import{b as bt,c as M,d as Si,e as ie,f as p,g as ba}from"./index-BSANf7-H.js";const _a=new TextDecoder("utf-8"),vn=i=>_a.decode(i),va=new TextEncoder,Zi=i=>va.encode(i),wa=i=>typeof i=="number",Hs=i=>typeof i=="boolean",P=i=>typeof i=="function",nt=i=>i!=null&&Object(i)===i,ne=i=>nt(i)&&P(i.then),Ge=i=>nt(i)&&P(i[Symbol.iterator]),Se=i=>nt(i)&&P(i[Symbol.asyncIterator]),wn=i=>nt(i)&&nt(i.schema),Ks=i=>nt(i)&&"done"in i&&"value"in i,Gs=i=>nt(i)&&P(i.stat)&&wa(i.fd),qs=i=>nt(i)&&Tn(i.body),Qi=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Ia=i=>nt(i)&&P(i.abort)&&P(i.getWriter)&&!Qi(i),Tn=i=>nt(i)&&P(i.cancel)&&P(i.getReader)&&!Qi(i),Sa=i=>nt(i)&&P(i.end)&&P(i.write)&&Hs(i.writable)&&!Qi(i),Zs=i=>nt(i)&&P(i.read)&&P(i.pipe)&&Hs(i.readable)&&!Qi(i),Ba=i=>nt(i)&&P(i.clear)&&P(i.bytes)&&P(i.position)&&P(i.setPosition)&&P(i.capacity)&&P(i.getBufferIdentifier)&&P(i.createLong),Nn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Da(i){const t=i[0]?[i[0]]:[];let e,n,s,r;for(let o,a,c=0,l=0,h=i.length;++c<h;){if(o=t[l],a=i[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:e,byteLength:s}=o,{byteOffset:n,byteLength:r}=a,e+s<n||n+r<e){a&&(t[++l]=a);continue}t[l]=new Uint8Array(o.buffer,e,n-e+r)}return t}function ii(i,t,e=0,n=t.byteLength){const s=i.byteLength,r=new Uint8Array(i.buffer,i.byteOffset,s),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,s));return r.set(o,e),i}function wt(i,t){const e=Da(i),n=e.reduce((h,d)=>h+d.byteLength,0);let s,r,o,a=0,c=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,n);for(const h=e.length;++c<h;){if(s=e[c],r=s.subarray(0,Math.min(s.length,l-a)),l<=a+r.length){r.length<s.length?e[c]=s.subarray(r.length):r.length===s.length&&c++,o?ii(o,r,a):o=r;break}ii(o||(o=new Uint8Array(l)),r,a),a+=r.length}return[o||new Uint8Array(0),e.slice(c),n-(o?o.byteLength:0)]}function T(i,t){let e=Ks(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Zi(e)),e instanceof ArrayBuffer?new i(e):e instanceof Nn?new i(e):Ba(e)?T(i,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new i(0):new i(e.buffer,e.byteOffset,e.byteLength/i.BYTES_PER_ELEMENT):i.from(e)):new i(0)}const Aa=i=>T(Int8Array,i),Oa=i=>T(Int16Array,i),Fe=i=>T(Int32Array,i),Fa=i=>T(BigInt64Array,i),N=i=>T(Uint8Array,i),Ma=i=>T(Uint16Array,i),Ta=i=>T(Uint32Array,i),Na=i=>T(BigUint64Array,i),La=i=>T(Float32Array,i),Ua=i=>T(Float64Array,i),xa=i=>T(Uint8ClampedArray,i),In=i=>(i.next(),i);function*kt(i,t){const e=function*(s){yield s},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nn?e(t):Ge(t)?t:e(t);return yield*In(function*(s){let r=null;do r=s.next(yield T(i,r));while(!r.done)}(n[Symbol.iterator]())),new i}const Ca=i=>kt(Int8Array,i),Ea=i=>kt(Int16Array,i),Va=i=>kt(Int32Array,i),Qs=i=>kt(Uint8Array,i),Ra=i=>kt(Uint16Array,i),za=i=>kt(Uint32Array,i),ja=i=>kt(Float32Array,i),ka=i=>kt(Float64Array,i),Pa=i=>kt(Uint8ClampedArray,i);function Bt(i,t){return bt(this,arguments,function*(){if(ne(t))return yield M(yield M(yield*Si(ie(Bt(i,yield M(t))))));const n=function(o){return bt(this,arguments,function*(){yield yield M(yield M(o))})},s=function(o){return bt(this,arguments,function*(){yield M(yield*Si(ie(In(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(o[Symbol.iterator]())))))})},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nn?n(t):Ge(t)?s(t):Se(t)?t:n(t);return yield M(yield*Si(ie(In(function(o){return bt(this,arguments,function*(){let a=null;do a=yield M(o.next(yield yield M(T(i,a))));while(!a.done)})}(r[Symbol.asyncIterator]()))))),yield M(new i)})}const $a=i=>Bt(Int8Array,i),Wa=i=>Bt(Int16Array,i),Ya=i=>Bt(Int32Array,i),Xs=i=>Bt(Uint8Array,i),Ja=i=>Bt(Uint16Array,i),Ha=i=>Bt(Uint32Array,i),Ka=i=>Bt(Float32Array,i),Ga=i=>Bt(Float64Array,i),qa=i=>Bt(Uint8ClampedArray,i);function Ln(i,t,e){if(i!==0){e=e.slice(0,t);for(let n=-1,s=e.length;++n<s;)e[n]+=i}return e.subarray(0,t)}function tr(i,t){let e=0;const n=i.length;if(n!==t.length)return!1;if(n>0)do if(i[e]!==t[e])return!1;while(++e<n);return!0}const Za=Object.freeze(Object.defineProperty({__proto__:null,compareArrayLike:tr,joinUint8Arrays:wt,memcpy:ii,rebaseValueOffsets:Ln,toArrayBufferView:T,toArrayBufferViewAsyncIterator:Bt,toArrayBufferViewIterator:kt,toBigInt64Array:Fa,toBigUint64Array:Na,toFloat32Array:La,toFloat32ArrayAsyncIterator:Ka,toFloat32ArrayIterator:ja,toFloat64Array:Ua,toFloat64ArrayAsyncIterator:Ga,toFloat64ArrayIterator:ka,toInt16Array:Oa,toInt16ArrayAsyncIterator:Wa,toInt16ArrayIterator:Ea,toInt32Array:Fe,toInt32ArrayAsyncIterator:Ya,toInt32ArrayIterator:Va,toInt8Array:Aa,toInt8ArrayAsyncIterator:$a,toInt8ArrayIterator:Ca,toUint16Array:Ma,toUint16ArrayAsyncIterator:Ja,toUint16ArrayIterator:Ra,toUint32Array:Ta,toUint32ArrayAsyncIterator:Ha,toUint32ArrayIterator:za,toUint8Array:N,toUint8ArrayAsyncIterator:Xs,toUint8ArrayIterator:Qs,toUint8ClampedArray:xa,toUint8ClampedArrayAsyncIterator:qa,toUint8ClampedArrayIterator:Pa},Symbol.toStringTag,{value:"Module"})),ot={fromIterable(i){return vi(Qa(i))},fromAsyncIterable(i){return vi(Xa(i))},fromDOMStream(i){return vi(tc(i))},fromNodeStream(i){return vi(ic(i))},toDOMStream(i,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(i,t){throw new Error('"toNodeStream" not available in this environment')}},vi=i=>(i.next(),i);function*Qa(i){let t,e=!1,n=[],s,r,o,a=0;function c(){return r==="peek"?wt(n,o)[0]:([s,n,a]=wt(n,o),s)}({cmd:r,size:o}=yield null);const l=Qs(i)[Symbol.iterator]();try{do if({done:t,value:s}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&s.byteLength>0&&(n.push(s),a+=s.byteLength),t||o<=a)do({cmd:r,size:o}=yield c());while(o<a);while(!t)}catch(h){(e=!0)&&typeof l.throw=="function"&&l.throw(h)}finally{e===!1&&typeof l.return=="function"&&l.return(null)}return null}function Xa(i){return bt(this,arguments,function*(){let e,n=!1,s=[],r,o,a,c=0;function l(){return o==="peek"?wt(s,a)[0]:([r,s,c]=wt(s,a),r)}({cmd:o,size:a}=yield yield M(null));const h=Xs(i)[Symbol.asyncIterator]();try{do if({done:e,value:r}=Number.isNaN(a-c)?yield M(h.next()):yield M(h.next(a-c)),!e&&r.byteLength>0&&(s.push(r),c+=r.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield M(l()));while(a<c);while(!e)}catch(d){(n=!0)&&typeof h.throw=="function"&&(yield M(h.throw(d)))}finally{n===!1&&typeof h.return=="function"&&(yield M(h.return(new Uint8Array(0))))}return yield M(null)})}function tc(i){return bt(this,arguments,function*(){let e=!1,n=!1,s=[],r,o,a,c=0;function l(){return o==="peek"?wt(s,a)[0]:([r,s,c]=wt(s,a),r)}({cmd:o,size:a}=yield yield M(null));const h=new ec(i);try{do if({done:e,value:r}=Number.isNaN(a-c)?yield M(h.read()):yield M(h.read(a-c)),!e&&r.byteLength>0&&(s.push(N(r)),c+=r.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield M(l()));while(a<c);while(!e)}catch(d){(n=!0)&&(yield M(h.cancel(d)))}finally{n===!1?yield M(h.cancel()):i.locked&&h.releaseLock()}return yield M(null)})}class ec{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return p(this,void 0,void 0,function*(){const{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return p(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=N(e)),e})}}const yn=(i,t)=>{const e=s=>n([t,s]);let n;return[t,e,new Promise(s=>(n=s)&&i.once(t,e))]};function ic(i){return bt(this,arguments,function*(){const e=[];let n="error",s=!1,r=null,o,a,c=0,l=[],h;function d(){return o==="peek"?wt(l,a)[0]:([h,l,c]=wt(l,a),h)}if({cmd:o,size:a}=yield yield M(null),i.isTTY)return yield yield M(new Uint8Array(0)),yield M(null);try{e[0]=yn(i,"end"),e[1]=yn(i,"error");do{if(e[2]=yn(i,"readable"),[n,r]=yield M(Promise.race(e.map(j=>j[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(h=N(i.read(a-c)),h.byteLength<a-c&&(h=N(i.read()))):h=N(i.read()),h.byteLength>0&&(l.push(h),c+=h.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield M(d()));while(a<c)}while(!s)}finally{yield M(U(e,n==="error"?r:null))}return yield M(null);function U(j,ut){return h=l=null,new Promise((pa,ga)=>{for(const[De,ma]of j)i.off(De,ma);try{const De=i.destroy;De&&De.call(i,ut),ut=void 0}catch(De){ut=De||ut}finally{ut!=null?ga(ut):pa()}})}})}var H;(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4",i[i.V5=4]="V5"})(H||(H={}));var W;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(W||(W={}));var J;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(J||(J={}));var ct;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(ct||(ct={}));var f;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(f||(f={}));var It;(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME",i[i.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(It||(It={}));var V;(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(V||(V={}));var u;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.Float=3]="Float",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct=13]="Struct",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.Dictionary=-1]="Dictionary",i[i.Int8=-2]="Int8",i[i.Int16=-3]="Int16",i[i.Int32=-4]="Int32",i[i.Int64=-5]="Int64",i[i.Uint8=-6]="Uint8",i[i.Uint16=-7]="Uint16",i[i.Uint32=-8]="Uint32",i[i.Uint64=-9]="Uint64",i[i.Float16=-10]="Float16",i[i.Float32=-11]="Float32",i[i.Float64=-12]="Float64",i[i.DateDay=-13]="DateDay",i[i.DateMillisecond=-14]="DateMillisecond",i[i.TimestampSecond=-15]="TimestampSecond",i[i.TimestampMillisecond=-16]="TimestampMillisecond",i[i.TimestampMicrosecond=-17]="TimestampMicrosecond",i[i.TimestampNanosecond=-18]="TimestampNanosecond",i[i.TimeSecond=-19]="TimeSecond",i[i.TimeMillisecond=-20]="TimeMillisecond",i[i.TimeMicrosecond=-21]="TimeMicrosecond",i[i.TimeNanosecond=-22]="TimeNanosecond",i[i.DenseUnion=-23]="DenseUnion",i[i.SparseUnion=-24]="SparseUnion",i[i.IntervalDayTime=-25]="IntervalDayTime",i[i.IntervalYearMonth=-26]="IntervalYearMonth",i[i.DurationSecond=-27]="DurationSecond",i[i.DurationMillisecond=-28]="DurationMillisecond",i[i.DurationMicrosecond=-29]="DurationMicrosecond",i[i.DurationNanosecond=-30]="DurationNanosecond"})(u||(u={}));var Ft;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Ft||(Ft={}));const nc=void 0;function se(i){if(i===null)return"null";if(i===nc)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>se(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}const sc=Object.freeze(Object.defineProperty({__proto__:null,valueToString:se},Symbol.toStringTag,{value:"Module"})),er=Symbol.for("isArrowBigNum");function Dt(i,...t){return t.length===0?Object.setPrototypeOf(T(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Dt.prototype[er]=!0;Dt.prototype.toJSON=function(){return`"${ze(this)}"`};Dt.prototype.valueOf=function(){return ir(this)};Dt.prototype.toString=function(){return ze(this)};Dt.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return ir(this);case"string":return ze(this);case"default":return nr(this)}return ze(this)};function xe(...i){return Dt.apply(this,i)}function Ce(...i){return Dt.apply(this,i)}function ni(...i){return Dt.apply(this,i)}Object.setPrototypeOf(xe.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ce.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ni.prototype,Object.create(Uint32Array.prototype));Object.assign(xe.prototype,Dt.prototype,{constructor:xe,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ce.prototype,Dt.prototype,{constructor:Ce,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ni.prototype,Dt.prototype,{constructor:ni,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function ir(i){const{buffer:t,byteOffset:e,length:n,signed:s}=i,r=new BigUint64Array(t,e,n),o=s&&r.at(-1)&BigInt(1)<<BigInt(63);let a=BigInt(o?1:0),c=BigInt(0);if(o){for(const l of r)a+=~l*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(const l of r)a+=l*(BigInt(1)<<BigInt(32)*c++);return a}const ze=i=>{if(i.byteLength===8)return`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`;if(!i.signed)return pn(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return pn(i);t=t.slice();let n=1;for(let r=0;r<t.length;r++){const o=t[r],a=~o+n;t[r]=a,n&=o===0?1:0}return`-${pn(t)}`},nr=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:ze(i);function pn(i){let t="";const e=new Uint32Array(2);let n=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);const s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer);let r=-1;const o=n.length-1;do{for(e[0]=n[r=0];r<o;)n[r++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+n[r];n[r]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(s[0]||s[1]||s[2]||s[3]);return t??"0"}class fi{static new(t,e){switch(e){case!0:return new xe(t);case!1:return new Ce(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new xe(t)}return t.byteLength===16?new ni(t):new Ce(t)}static signed(t){return new xe(t)}static unsigned(t){return new Ce(t)}static decimal(t){return new ni(t)}constructor(t,e){return fi.new(t,e)}}const rc=Object.freeze(Object.defineProperty({__proto__:null,BN:fi,bigNumToBigInt:nr,bigNumToString:ze,isArrowBigNumSymbol:er},Symbol.toStringTag,{value:"Module"}));function St(i){if(typeof i=="bigint"&&(i<Number.MIN_SAFE_INTEGER||i>Number.MAX_SAFE_INTEGER))throw new TypeError(`${i} is not safe to convert to a number.`);return Number(i)}var sr,rr,or,ar,cr,lr,ur,hr,dr,fr,yr,pr,gr,mr,br,_r,vr,wr,Ir,Sr;class y{static isNull(t){return t?.typeId===u.Null}static isInt(t){return t?.typeId===u.Int}static isFloat(t){return t?.typeId===u.Float}static isBinary(t){return t?.typeId===u.Binary}static isUtf8(t){return t?.typeId===u.Utf8}static isBool(t){return t?.typeId===u.Bool}static isDecimal(t){return t?.typeId===u.Decimal}static isDate(t){return t?.typeId===u.Date}static isTime(t){return t?.typeId===u.Time}static isTimestamp(t){return t?.typeId===u.Timestamp}static isInterval(t){return t?.typeId===u.Interval}static isDuration(t){return t?.typeId===u.Duration}static isList(t){return t?.typeId===u.List}static isStruct(t){return t?.typeId===u.Struct}static isUnion(t){return t?.typeId===u.Union}static isFixedSizeBinary(t){return t?.typeId===u.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===u.FixedSizeList}static isMap(t){return t?.typeId===u.Map}static isDictionary(t){return t?.typeId===u.Dictionary}static isDenseUnion(t){return y.isUnion(t)&&t.mode===W.Dense}static isSparseUnion(t){return y.isUnion(t)&&t.mode===W.Sparse}get typeId(){return u.NONE}}sr=Symbol.toStringTag;y[sr]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(y.prototype);let Jt=class extends y{toString(){return"Null"}get typeId(){return u.Null}};rr=Symbol.toStringTag;Jt[rr]=(i=>i[Symbol.toStringTag]="Null")(Jt.prototype);class Q extends y{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return u.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}or=Symbol.toStringTag;Q[or]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Q.prototype);class Br extends Q{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}class Dr extends Q{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}class ve extends Q{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}let Un=class extends Q{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}};class Ar extends Q{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}class Or extends Q{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}class Fr extends Q{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}let Mr=class extends Q{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Br.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Dr.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ve.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Un.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ar.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Or.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Fr.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Mr.prototype,"ArrayType",{value:BigUint64Array});class re extends y{constructor(t){super(),this.precision=t}get typeId(){return u.Float}get ArrayType(){switch(this.precision){case J.HALF:return Uint16Array;case J.SINGLE:return Float32Array;case J.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}ar=Symbol.toStringTag;re[ar]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(re.prototype);class oc extends re{constructor(){super(J.HALF)}}class Tr extends re{constructor(){super(J.SINGLE)}}class xn extends re{constructor(){super(J.DOUBLE)}}Object.defineProperty(oc.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Tr.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(xn.prototype,"ArrayType",{value:Float64Array});let Ni=class extends y{constructor(){super()}get typeId(){return u.Binary}toString(){return"Binary"}};cr=Symbol.toStringTag;Ni[cr]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(Ni.prototype);let si=class extends y{constructor(){super()}get typeId(){return u.Utf8}toString(){return"Utf8"}};lr=Symbol.toStringTag;si[lr]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(si.prototype);let ri=class extends y{constructor(){super()}get typeId(){return u.Bool}toString(){return"Bool"}};ur=Symbol.toStringTag;ri[ur]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(ri.prototype);let Li=class extends y{constructor(t,e,n=128){super(),this.scale=t,this.precision=e,this.bitWidth=n}get typeId(){return u.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};hr=Symbol.toStringTag;Li[hr]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Li.prototype);class je extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Date}toString(){return`Date${(this.unit+1)*32}<${ct[this.unit]}>`}}dr=Symbol.toStringTag;je[dr]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(je.prototype);class gh extends je{constructor(){super(ct.DAY)}}class ac extends je{constructor(){super(ct.MILLISECOND)}}class Ht extends y{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return u.Time}toString(){return`Time${this.bitWidth}<${f[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}fr=Symbol.toStringTag;Ht[fr]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Ht.prototype);class mh extends Ht{constructor(){super(f.SECOND,32)}}class bh extends Ht{constructor(){super(f.MILLISECOND,32)}}class _h extends Ht{constructor(){super(f.MICROSECOND,64)}}class vh extends Ht{constructor(){super(f.NANOSECOND,64)}}class oe extends y{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return u.Timestamp}toString(){return`Timestamp<${f[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}yr=Symbol.toStringTag;oe[yr]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(oe.prototype);class wh extends oe{constructor(t){super(f.SECOND,t)}}class Ih extends oe{constructor(t){super(f.MILLISECOND,t)}}class Sh extends oe{constructor(t){super(f.MICROSECOND,t)}}class Bh extends oe{constructor(t){super(f.NANOSECOND,t)}}class ke extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Interval}toString(){return`Interval<${It[this.unit]}>`}}pr=Symbol.toStringTag;ke[pr]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(ke.prototype);class Dh extends ke{constructor(){super(It.DAY_TIME)}}class Ah extends ke{constructor(){super(It.YEAR_MONTH)}}let ae=class extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Duration}toString(){return`Duration<${f[this.unit]}>`}};gr=Symbol.toStringTag;ae[gr]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(ae.prototype);class Fh extends ae{constructor(){super(f.SECOND)}}class Mh extends ae{constructor(){super(f.MILLISECOND)}}class Th extends ae{constructor(){super(f.MICROSECOND)}}class Nh extends ae{constructor(){super(f.NANOSECOND)}}let Pe=class extends y{constructor(t){super(),this.children=[t]}get typeId(){return u.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};mr=Symbol.toStringTag;Pe[mr]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(Pe.prototype);class K extends y{constructor(t){super(),this.children=t}get typeId(){return u.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}br=Symbol.toStringTag;K[br]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(K.prototype);class we extends y{constructor(t,e,n){super(),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((s,r,o)=>(s[r]=o)&&s||s,Object.create(null))}get typeId(){return u.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}_r=Symbol.toStringTag;we[_r]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(we.prototype);class Uh extends we{constructor(t,e){super(W.Dense,t,e)}}class xh extends we{constructor(t,e){super(W.Sparse,t,e)}}let Ui=class extends y{constructor(t){super(),this.byteWidth=t}get typeId(){return u.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};vr=Symbol.toStringTag;Ui[vr]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Ui.prototype);let oi=class extends y{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return u.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};wr=Symbol.toStringTag;oi[wr]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(oi.prototype);class ai extends y{constructor(t,e=!1){var n,s,r;if(super(),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.children)){const o=(s=t?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");const a=(r=t?.type)===null||r===void 0?void 0:r.children[1];a&&(a.name="value")}}get typeId(){return u.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Ir=Symbol.toStringTag;ai[Ir]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(ai.prototype);const cc=(i=>()=>++i)(-1);class ce extends y{constructor(t,e,n,s){super(),this.indices=e,this.dictionary=t,this.isOrdered=s||!1,this.id=n==null?cc():St(n)}get typeId(){return u.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Sr=Symbol.toStringTag;ce[Sr]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(ce.prototype);function Mt(i){const t=i;switch(i.typeId){case u.Decimal:return i.bitWidth/32;case u.Timestamp:return 2;case u.Date:return 1+t.unit;case u.Interval:return 1+t.unit;case u.FixedSizeList:return t.listSize;case u.FixedSizeBinary:return t.byteWidth;default:return 1}}class O{visitMany(t,...e){return t.map((n,s)=>this.visit(n,...e.map(r=>r[s])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return lc(this,t,e)}getVisitFnByTypeId(t,e=!0){return Me(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function lc(i,t,e=!0){return typeof t=="number"?Me(i,t,e):typeof t=="string"&&t in u?Me(i,u[t],e):t&&t instanceof y?Me(i,As(t),e):t?.type&&t.type instanceof y?Me(i,As(t.type),e):Me(i,u.NONE,e)}function Me(i,t,e=!0){let n=null;switch(t){case u.Null:n=i.visitNull;break;case u.Bool:n=i.visitBool;break;case u.Int:n=i.visitInt;break;case u.Int8:n=i.visitInt8||i.visitInt;break;case u.Int16:n=i.visitInt16||i.visitInt;break;case u.Int32:n=i.visitInt32||i.visitInt;break;case u.Int64:n=i.visitInt64||i.visitInt;break;case u.Uint8:n=i.visitUint8||i.visitInt;break;case u.Uint16:n=i.visitUint16||i.visitInt;break;case u.Uint32:n=i.visitUint32||i.visitInt;break;case u.Uint64:n=i.visitUint64||i.visitInt;break;case u.Float:n=i.visitFloat;break;case u.Float16:n=i.visitFloat16||i.visitFloat;break;case u.Float32:n=i.visitFloat32||i.visitFloat;break;case u.Float64:n=i.visitFloat64||i.visitFloat;break;case u.Utf8:n=i.visitUtf8;break;case u.Binary:n=i.visitBinary;break;case u.FixedSizeBinary:n=i.visitFixedSizeBinary;break;case u.Date:n=i.visitDate;break;case u.DateDay:n=i.visitDateDay||i.visitDate;break;case u.DateMillisecond:n=i.visitDateMillisecond||i.visitDate;break;case u.Timestamp:n=i.visitTimestamp;break;case u.TimestampSecond:n=i.visitTimestampSecond||i.visitTimestamp;break;case u.TimestampMillisecond:n=i.visitTimestampMillisecond||i.visitTimestamp;break;case u.TimestampMicrosecond:n=i.visitTimestampMicrosecond||i.visitTimestamp;break;case u.TimestampNanosecond:n=i.visitTimestampNanosecond||i.visitTimestamp;break;case u.Time:n=i.visitTime;break;case u.TimeSecond:n=i.visitTimeSecond||i.visitTime;break;case u.TimeMillisecond:n=i.visitTimeMillisecond||i.visitTime;break;case u.TimeMicrosecond:n=i.visitTimeMicrosecond||i.visitTime;break;case u.TimeNanosecond:n=i.visitTimeNanosecond||i.visitTime;break;case u.Decimal:n=i.visitDecimal;break;case u.List:n=i.visitList;break;case u.Struct:n=i.visitStruct;break;case u.Union:n=i.visitUnion;break;case u.DenseUnion:n=i.visitDenseUnion||i.visitUnion;break;case u.SparseUnion:n=i.visitSparseUnion||i.visitUnion;break;case u.Dictionary:n=i.visitDictionary;break;case u.Interval:n=i.visitInterval;break;case u.IntervalDayTime:n=i.visitIntervalDayTime||i.visitInterval;break;case u.IntervalYearMonth:n=i.visitIntervalYearMonth||i.visitInterval;break;case u.Duration:n=i.visitDuration;break;case u.DurationSecond:n=i.visitDurationSecond||i.visitDuration;break;case u.DurationMillisecond:n=i.visitDurationMillisecond||i.visitDuration;break;case u.DurationMicrosecond:n=i.visitDurationMicrosecond||i.visitDuration;break;case u.DurationNanosecond:n=i.visitDurationNanosecond||i.visitDuration;break;case u.FixedSizeList:n=i.visitFixedSizeList;break;case u.Map:n=i.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${u[t]}'`)}function As(i){switch(i.typeId){case u.Null:return u.Null;case u.Int:{const{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?u.Int8:u.Uint8;case 16:return e?u.Int16:u.Uint16;case 32:return e?u.Int32:u.Uint32;case 64:return e?u.Int64:u.Uint64}return u.Int}case u.Float:switch(i.precision){case J.HALF:return u.Float16;case J.SINGLE:return u.Float32;case J.DOUBLE:return u.Float64}return u.Float;case u.Binary:return u.Binary;case u.Utf8:return u.Utf8;case u.Bool:return u.Bool;case u.Decimal:return u.Decimal;case u.Time:switch(i.unit){case f.SECOND:return u.TimeSecond;case f.MILLISECOND:return u.TimeMillisecond;case f.MICROSECOND:return u.TimeMicrosecond;case f.NANOSECOND:return u.TimeNanosecond}return u.Time;case u.Timestamp:switch(i.unit){case f.SECOND:return u.TimestampSecond;case f.MILLISECOND:return u.TimestampMillisecond;case f.MICROSECOND:return u.TimestampMicrosecond;case f.NANOSECOND:return u.TimestampNanosecond}return u.Timestamp;case u.Date:switch(i.unit){case ct.DAY:return u.DateDay;case ct.MILLISECOND:return u.DateMillisecond}return u.Date;case u.Interval:switch(i.unit){case It.DAY_TIME:return u.IntervalDayTime;case It.YEAR_MONTH:return u.IntervalYearMonth}return u.Interval;case u.Duration:switch(i.unit){case f.SECOND:return u.DurationSecond;case f.MILLISECOND:return u.DurationMillisecond;case f.MICROSECOND:return u.DurationMicrosecond;case f.NANOSECOND:return u.DurationNanosecond}return u.Duration;case u.Map:return u.Map;case u.List:return u.List;case u.Struct:return u.Struct;case u.Union:switch(i.mode){case W.Dense:return u.DenseUnion;case W.Sparse:return u.SparseUnion}return u.Union;case u.FixedSizeBinary:return u.FixedSizeBinary;case u.FixedSizeList:return u.FixedSizeList;case u.Dictionary:return u.Dictionary}throw new Error(`Unrecognized type '${u[i.typeId]}'`)}O.prototype.visitInt8=null;O.prototype.visitInt16=null;O.prototype.visitInt32=null;O.prototype.visitInt64=null;O.prototype.visitUint8=null;O.prototype.visitUint16=null;O.prototype.visitUint32=null;O.prototype.visitUint64=null;O.prototype.visitFloat16=null;O.prototype.visitFloat32=null;O.prototype.visitFloat64=null;O.prototype.visitDateDay=null;O.prototype.visitDateMillisecond=null;O.prototype.visitTimestampSecond=null;O.prototype.visitTimestampMillisecond=null;O.prototype.visitTimestampMicrosecond=null;O.prototype.visitTimestampNanosecond=null;O.prototype.visitTimeSecond=null;O.prototype.visitTimeMillisecond=null;O.prototype.visitTimeMicrosecond=null;O.prototype.visitTimeNanosecond=null;O.prototype.visitDenseUnion=null;O.prototype.visitSparseUnion=null;O.prototype.visitIntervalDayTime=null;O.prototype.visitIntervalYearMonth=null;O.prototype.visitDuration=null;O.prototype.visitDurationSecond=null;O.prototype.visitDurationMillisecond=null;O.prototype.visitDurationMicrosecond=null;O.prototype.visitDurationNanosecond=null;const Nr=new Float64Array(1),Ae=new Uint32Array(Nr.buffer);function Cn(i){const t=(i&31744)>>10,e=(i&1023)/1024,n=Math.pow(-1,(i&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function En(i){if(i!==i)return 32256;Nr[0]=i;const t=(Ae[1]&2147483648)>>16&65535;let e=Ae[1]&2146435072,n=0;return e>=1089470464?Ae[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Ae[1]&1048575)>>10):e<=1056964608?(n=1048576+(Ae[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Ae[1]&1048575)+512>>10),t|e|n&65535}const uc=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:En,uint16ToFloat64:Cn},Symbol.toStringTag,{value:"Module"}));class I extends O{}function D(i){return(t,e,n)=>{if(t.setValid(e,n!=null))return i(t,e,n)}}const hc=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},Vn=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},dc=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},fc=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},Lr=(i,t,e,n)=>{if(e+1<t.length){const{[e]:s,[e+1]:r}=t;i.set(n.subarray(0,r-s),s)}},yc=({offset:i,values:t},e,n)=>{const s=i+e;n?t[s>>3]|=1<<s%8:t[s>>3]&=~(1<<s%8)},Kt=({values:i},t,e)=>{i[t]=e},Rn=({values:i},t,e)=>{i[t]=e},Ur=({values:i},t,e)=>{i[t]=En(e)},pc=(i,t,e)=>{switch(i.type.precision){case J.HALF:return Ur(i,t,e);case J.SINGLE:case J.DOUBLE:return Rn(i,t,e)}},zn=({values:i},t,e)=>{hc(i,t,e.valueOf())},jn=({values:i},t,e)=>{Vn(i,t*2,e.valueOf())},xr=({stride:i,values:t},e,n)=>{t.set(n.subarray(0,i),i*e)},gc=({values:i,valueOffsets:t},e,n)=>Lr(i,t,e,n),mc=({values:i,valueOffsets:t},e,n)=>{Lr(i,t,e,Zi(n))},Cr=(i,t,e)=>{i.type.unit===ct.DAY?zn(i,t,e):jn(i,t,e)},kn=({values:i},t,e)=>Vn(i,t*2,e/1e3),Pn=({values:i},t,e)=>Vn(i,t*2,e),$n=({values:i},t,e)=>dc(i,t*2,e),Wn=({values:i},t,e)=>fc(i,t*2,e),Er=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return kn(i,t,e);case f.MILLISECOND:return Pn(i,t,e);case f.MICROSECOND:return $n(i,t,e);case f.NANOSECOND:return Wn(i,t,e)}},Yn=({values:i},t,e)=>{i[t]=e},Jn=({values:i},t,e)=>{i[t]=e},Hn=({values:i},t,e)=>{i[t]=e},Kn=({values:i},t,e)=>{i[t]=e},Vr=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return Yn(i,t,e);case f.MILLISECOND:return Jn(i,t,e);case f.MICROSECOND:return Hn(i,t,e);case f.NANOSECOND:return Kn(i,t,e)}},Rr=({values:i,stride:t},e,n)=>{i.set(n.subarray(0,t),t*e)},bc=(i,t,e)=>{const n=i.children[0],s=i.valueOffsets,r=yt.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=s[t],c=s[t+1];a<c;)r(n,a++,e[++o]);else for(let o=-1,a=s[t],c=s[t+1];a<c;)r(n,a++,e.get(++o))},_c=(i,t,e)=>{const n=i.children[0],{valueOffsets:s}=i,r=yt.getVisitFn(n);let{[t]:o,[t+1]:a}=s;const c=e instanceof Map?e.entries():Object.entries(e);for(const l of c)if(r(n,o,l),++o>=a)break},vc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[r]),wc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(r)),Ic=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(s.name)),Sc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[s.name]),Bc=(i,t,e)=>{const n=i.type.children.map(r=>yt.getVisitFn(r.type)),s=e instanceof Map?Ic(t,e):e instanceof g?wc(t,e):Array.isArray(e)?vc(t,e):Sc(t,e);i.type.children.forEach((r,o)=>s(n[o],i.children[o],r,o))},Dc=(i,t,e)=>{i.type.mode===W.Dense?zr(i,t,e):jr(i,t,e)},zr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];yt.visit(s,i.valueOffsets[t],e)},jr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];yt.visit(s,t,e)},Ac=(i,t,e)=>{var n;(n=i.dictionary)===null||n===void 0||n.set(i.values[t],e)},kr=(i,t,e)=>{i.type.unit===It.DAY_TIME?Gn(i,t,e):qn(i,t,e)},Gn=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},qn=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},Zn=({values:i},t,e)=>{i[t]=e},Qn=({values:i},t,e)=>{i[t]=e},Xn=({values:i},t,e)=>{i[t]=e},ts=({values:i},t,e)=>{i[t]=e},Pr=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return Zn(i,t,e);case f.MILLISECOND:return Qn(i,t,e);case f.MICROSECOND:return Xn(i,t,e);case f.NANOSECOND:return ts(i,t,e)}},Oc=(i,t,e)=>{const{stride:n}=i,s=i.children[0],r=yt.getVisitFn(s);if(Array.isArray(e))for(let o=-1,a=t*n;++o<n;)r(s,a+o,e[o]);else for(let o=-1,a=t*n;++o<n;)r(s,a+o,e.get(o))};I.prototype.visitBool=D(yc);I.prototype.visitInt=D(Kt);I.prototype.visitInt8=D(Kt);I.prototype.visitInt16=D(Kt);I.prototype.visitInt32=D(Kt);I.prototype.visitInt64=D(Kt);I.prototype.visitUint8=D(Kt);I.prototype.visitUint16=D(Kt);I.prototype.visitUint32=D(Kt);I.prototype.visitUint64=D(Kt);I.prototype.visitFloat=D(pc);I.prototype.visitFloat16=D(Ur);I.prototype.visitFloat32=D(Rn);I.prototype.visitFloat64=D(Rn);I.prototype.visitUtf8=D(mc);I.prototype.visitBinary=D(gc);I.prototype.visitFixedSizeBinary=D(xr);I.prototype.visitDate=D(Cr);I.prototype.visitDateDay=D(zn);I.prototype.visitDateMillisecond=D(jn);I.prototype.visitTimestamp=D(Er);I.prototype.visitTimestampSecond=D(kn);I.prototype.visitTimestampMillisecond=D(Pn);I.prototype.visitTimestampMicrosecond=D($n);I.prototype.visitTimestampNanosecond=D(Wn);I.prototype.visitTime=D(Vr);I.prototype.visitTimeSecond=D(Yn);I.prototype.visitTimeMillisecond=D(Jn);I.prototype.visitTimeMicrosecond=D(Hn);I.prototype.visitTimeNanosecond=D(Kn);I.prototype.visitDecimal=D(Rr);I.prototype.visitList=D(bc);I.prototype.visitStruct=D(Bc);I.prototype.visitUnion=D(Dc);I.prototype.visitDenseUnion=D(zr);I.prototype.visitSparseUnion=D(jr);I.prototype.visitDictionary=D(Ac);I.prototype.visitInterval=D(kr);I.prototype.visitIntervalDayTime=D(Gn);I.prototype.visitIntervalYearMonth=D(qn);I.prototype.visitDuration=D(Pr);I.prototype.visitDurationSecond=D(Zn);I.prototype.visitDurationMillisecond=D(Qn);I.prototype.visitDurationMicrosecond=D(Xn);I.prototype.visitDurationNanosecond=D(ts);I.prototype.visitFixedSizeList=D(Oc);I.prototype.visitMap=D(_c);const yt=new I,gt=Symbol.for("parent"),Ee=Symbol.for("rowIndex");class es{constructor(t,e){return this[gt]=t,this[Ee]=e,new Proxy(this,new Mc)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ee],e=this[gt],n=e.type.children,s={};for(let r=-1,o=n.length;++r<o;)s[n[r].name]=st.visit(e.children[r],t);return s}toString(){return`{${[...this].map(([t,e])=>`${se(t)}: ${se(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Fc(this[gt],this[Ee])}}class Fc{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,st.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(es.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[gt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ee]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class Mc{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[gt].type.children.map(e=>e.name)}has(t,e){return t[gt].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[gt].type.children.findIndex(n=>n.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[gt].type.children.findIndex(s=>s.name===e);if(n!==-1){const s=st.visit(t[gt].children[n],t[Ee]);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[gt].type.children.findIndex(r=>r.name===e);return s!==-1?(yt.visit(t[gt].children[s],t[Ee],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}class m extends O{}function S(i){return(t,e)=>t.getValid(e)?i(t,e):null}const Tc=(i,t)=>864e5*i[t],is=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),Nc=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,Lc=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,$r=i=>new Date(i),Uc=(i,t)=>$r(Tc(i,t)),xc=(i,t)=>$r(is(i,t)),Cc=(i,t)=>null,Wr=(i,t,e)=>{if(e+1>=t.length)return null;const n=t[e],s=t[e+1];return i.subarray(n,s)},Ec=({offset:i,values:t},e)=>{const n=i+e;return(t[n>>3]&1<<n%8)!==0},Yr=({values:i},t)=>Uc(i,t),Jr=({values:i},t)=>xc(i,t*2),he=({stride:i,values:t},e)=>t[i*e],Vc=({stride:i,values:t},e)=>Cn(t[i*e]),Hr=({values:i},t)=>i[t],Rc=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),zc=({values:i,valueOffsets:t},e)=>Wr(i,t,e),jc=({values:i,valueOffsets:t},e)=>{const n=Wr(i,t,e);return n!==null?vn(n):null},kc=({values:i},t)=>i[t],Pc=({type:i,values:t},e)=>i.precision!==J.HALF?t[e]:Cn(t[e]),$c=(i,t)=>i.type.unit===ct.DAY?Yr(i,t):Jr(i,t),Kr=({values:i},t)=>1e3*is(i,t*2),Gr=({values:i},t)=>is(i,t*2),qr=({values:i},t)=>Nc(i,t*2),Zr=({values:i},t)=>Lc(i,t*2),Wc=(i,t)=>{switch(i.type.unit){case f.SECOND:return Kr(i,t);case f.MILLISECOND:return Gr(i,t);case f.MICROSECOND:return qr(i,t);case f.NANOSECOND:return Zr(i,t)}},Qr=({values:i},t)=>i[t],Xr=({values:i},t)=>i[t],to=({values:i},t)=>i[t],eo=({values:i},t)=>i[t],Yc=(i,t)=>{switch(i.type.unit){case f.SECOND:return Qr(i,t);case f.MILLISECOND:return Xr(i,t);case f.MICROSECOND:return to(i,t);case f.NANOSECOND:return eo(i,t)}},Jc=({values:i,stride:t},e)=>fi.decimal(i.subarray(t*e,t*(e+1))),Hc=(i,t)=>{const{valueOffsets:e,stride:n,children:s}=i,{[t*n]:r,[t*n+1]:o}=e,c=s[0].slice(r,o-r);return new g([c])},Kc=(i,t)=>{const{valueOffsets:e,children:n}=i,{[t]:s,[t+1]:r}=e,o=n[0];return new Xi(o.slice(s,r-s))},Gc=(i,t)=>new es(i,t),qc=(i,t)=>i.type.mode===W.Dense?io(i,t):no(i,t),io=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,i.valueOffsets[t])},no=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,t)},Zc=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Qc=(i,t)=>i.type.unit===It.DAY_TIME?so(i,t):ro(i,t),so=({values:i},t)=>i.subarray(2*t,2*(t+1)),ro=({values:i},t)=>{const e=i[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},oo=({values:i},t)=>i[t],ao=({values:i},t)=>i[t],co=({values:i},t)=>i[t],lo=({values:i},t)=>i[t],Xc=(i,t)=>{switch(i.type.unit){case f.SECOND:return oo(i,t);case f.MILLISECOND:return ao(i,t);case f.MICROSECOND:return co(i,t);case f.NANOSECOND:return lo(i,t)}},tl=(i,t)=>{const{stride:e,children:n}=i,r=n[0].slice(t*e,e);return new g([r])};m.prototype.visitNull=S(Cc);m.prototype.visitBool=S(Ec);m.prototype.visitInt=S(kc);m.prototype.visitInt8=S(he);m.prototype.visitInt16=S(he);m.prototype.visitInt32=S(he);m.prototype.visitInt64=S(Hr);m.prototype.visitUint8=S(he);m.prototype.visitUint16=S(he);m.prototype.visitUint32=S(he);m.prototype.visitUint64=S(Hr);m.prototype.visitFloat=S(Pc);m.prototype.visitFloat16=S(Vc);m.prototype.visitFloat32=S(he);m.prototype.visitFloat64=S(he);m.prototype.visitUtf8=S(jc);m.prototype.visitBinary=S(zc);m.prototype.visitFixedSizeBinary=S(Rc);m.prototype.visitDate=S($c);m.prototype.visitDateDay=S(Yr);m.prototype.visitDateMillisecond=S(Jr);m.prototype.visitTimestamp=S(Wc);m.prototype.visitTimestampSecond=S(Kr);m.prototype.visitTimestampMillisecond=S(Gr);m.prototype.visitTimestampMicrosecond=S(qr);m.prototype.visitTimestampNanosecond=S(Zr);m.prototype.visitTime=S(Yc);m.prototype.visitTimeSecond=S(Qr);m.prototype.visitTimeMillisecond=S(Xr);m.prototype.visitTimeMicrosecond=S(to);m.prototype.visitTimeNanosecond=S(eo);m.prototype.visitDecimal=S(Jc);m.prototype.visitList=S(Hc);m.prototype.visitStruct=S(Gc);m.prototype.visitUnion=S(qc);m.prototype.visitDenseUnion=S(io);m.prototype.visitSparseUnion=S(no);m.prototype.visitDictionary=S(Zc);m.prototype.visitInterval=S(Qc);m.prototype.visitIntervalDayTime=S(so);m.prototype.visitIntervalYearMonth=S(ro);m.prototype.visitDuration=S(Xc);m.prototype.visitDurationSecond=S(oo);m.prototype.visitDurationMillisecond=S(ao);m.prototype.visitDurationMicrosecond=S(co);m.prototype.visitDurationNanosecond=S(lo);m.prototype.visitFixedSizeList=S(tl);m.prototype.visitMap=S(Kc);const st=new m,mt=Symbol.for("keys"),Ve=Symbol.for("vals");class Xi{constructor(t){return this[mt]=new g([t.children[0]]).memoize(),this[Ve]=t.children[1],new Proxy(this,new il)}[Symbol.iterator](){return new el(this[mt],this[Ve])}get size(){return this[mt].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[mt],e=this[Ve],n={};for(let s=-1,r=t.length;++s<r;)n[t.get(s)]=st.visit(e,s);return n}toString(){return`{${[...this].map(([t,e])=>`${se(t)}: ${se(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class el{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),st.visit(this.vals,t)]})}}class il{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[mt].toArray().map(String)}has(t,e){return t[mt].includes(e)}getOwnPropertyDescriptor(t,e){if(t[mt].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[mt].indexOf(e);if(n!==-1){const s=st.visit(Reflect.get(t,Ve),n);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[mt].indexOf(e);return s!==-1?(yt.visit(Reflect.get(t,Ve),s,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(Xi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[mt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ve]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function nl(i,t,e){const n=i.length,s=t>-1?t:n+t%n;return e?e(i,s):s}let Os;function ns(i,t,e,n){const{length:s=0}=i;let r=typeof t!="number"?0:t,o=typeof e!="number"?s:e;return r<0&&(r=(r%s+s)%s),o<0&&(o=(o%s+s)%s),o<r&&(Os=r,r=o,o=Os),o>s&&(o=s),n?n(i,r,o):[r,o]}const Fs=i=>i!==i;function Be(i){if(typeof i!=="object"||i===null)return Fs(i)?Fs:e=>e===i;if(i instanceof Date){const e=i.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(i)?e=>e?tr(i,e):!1:i instanceof Map?rl(i):Array.isArray(i)?sl(i):i instanceof g?ol(i):al(i,!0)}function sl(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Be(i[e]);return tn(t)}function rl(i){let t=-1;const e=[];for(const n of i.values())e[++t]=Be(n);return tn(e)}function ol(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Be(i.get(e));return tn(t)}function al(i,t=!1){const e=Object.keys(i);if(!t&&e.length===0)return()=>!1;const n=[];for(let s=-1,r=e.length;++s<r;)n[s]=Be(i[e[s]]);return tn(n,e)}function tn(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return cl(i,e);case Map:return Ms(i,e,e.keys());case Xi:case es:case Object:case void 0:return Ms(i,e,t||Object.keys(e))}return e instanceof g?ll(i,e):!1}}function cl(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t[n]))return!1;return!0}function ll(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t.get(n)))return!1;return!0}function Ms(i,t,e){const n=e[Symbol.iterator](),s=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),r=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=i.length;let c=r.next(),l=n.next(),h=s.next();for(;o<a&&!l.done&&!h.done&&!c.done&&!(l.value!==h.value||!i[o](c.value));++o,l=n.next(),h=s.next(),c=r.next());return o===a&&l.done&&h.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),r.return&&r.return(),!1)}const ul=Object.freeze(Object.defineProperty({__proto__:null,clampIndex:nl,clampRange:ns,createElementComparator:Be},Symbol.toStringTag,{value:"Module"}));function en(i,t,e,n){return(e&1<<n)!==0}function ss(i,t,e,n){return(e&1<<n)>>n}function hl(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function ci(i,t,e){const n=e.byteLength+7&-8;if(i>0||e.byteLength<n){const s=new Uint8Array(n);return s.set(i%8===0?e.subarray(i>>3):li(new $e(e,i,t,null,en)).subarray(0,n)),s}return e}function li(i){const t=[];let e=0,n=0,s=0;for(const o of i)o&&(s|=1<<n),++n===8&&(t[e++]=s,s=n=0);(e===0||n>0)&&(t[e++]=s);const r=new Uint8Array(t.length+7&-8);return r.set(t),r}class $e{constructor(t,e,n,s,r){this.bytes=t,this.length=n,this.context=s,this.get=r,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function xi(i,t,e){if(e-t<=0)return 0;if(e-t<8){let r=0;for(const o of new $e(i,t,e-t,i,ss))r+=o;return r}const n=e>>3<<3,s=t+(t%8===0?0:8-t%8);return xi(i,t,s)+xi(i,n,e)+uo(i,s>>3,n-s>>3)}function uo(i,t,e){let n=0,s=Math.trunc(t);const r=new DataView(i.buffer,i.byteOffset,i.byteLength),o=e===void 0?i.byteLength:s+e;for(;o-s>=4;)n+=Bi(r.getUint32(s)),s+=4;for(;o-s>=2;)n+=Bi(r.getUint16(s)),s+=2;for(;o-s>=1;)n+=Bi(r.getUint8(s)),s+=1;return n}function Bi(i){let t=Math.trunc(i);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const dl=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:$e,getBit:ss,getBool:en,packBools:li,popcnt_array:uo,popcnt_bit_range:xi,popcnt_uint32:Bi,setBool:hl,truncateBitmap:ci},Symbol.toStringTag,{value:"Module"})),fl=-1;class C{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return y.isSparseUnion(t)?this.children.some(e=>e.nullable):y.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:s,typeIds:r}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),r&&(t+=r.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(y.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let t=this._nullCount,e;return t<=fl&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-xi(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,s,r,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let c;r instanceof C?(this.stride=r.stride,this.values=r.values,this.typeIds=r.typeIds,this.nullBitmap=r.nullBitmap,this.valueOffsets=r.valueOffsets):(this.stride=Mt(t),r&&((c=r[0])&&(this.valueOffsets=c),(c=r[1])&&(this.values=c),(c=r[2])&&(this.nullBitmap=c),(c=r[3])&&(this.typeIds=c)))}getValid(t){const{type:e}=this;if(y.isUnion(e)){const n=e,s=this.children[n.typeIdToChildIndex[this.typeIds[t]]],r=n.mode===W.Dense?this.valueOffsets[t]:t;return s.getValid(r)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,e){let n;const{type:s}=this;if(y.isUnion(s)){const r=s,o=this.children[r.typeIdToChildIndex[this.typeIds[t]]],a=r.mode===W.Dense?this.valueOffsets[t]:t;n=o.getValid(a),o.setValid(a,e)}else{let{nullBitmap:r}=this;const{offset:o,length:a}=this,c=o+t,l=1<<c%8,h=c>>3;(!r||r.byteLength<=h)&&(r=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0&&r.set(ci(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r,_nullCount:-1}));const d=r[h];n=(d&l)!==0,e?r[h]=d|l:r[h]=d&~l}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,s=this._nullCount,r=this,o=this.children){return new C(t,e,n,s,r,o,this.dictionary)}slice(t,e){const{stride:n,typeId:s,children:r}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(t,e,n,s);return this.clone(this.type,this.offset+t,e,o,c,r.length===0||this.valueOffsets?r:this._sliceChildren(r,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===u.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,s=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);s[e>>3]=(1<<e-(e&-8))-1,n>0&&s.set(ci(this.offset,e,this.nullBitmap),0);const r=this.buffers;return r[Ft.VALIDITY]=s,this.clone(this.type,0,t,n+(t-e),r)}_sliceBuffers(t,e,n,s){let r;const{buffers:o}=this;return(r=o[Ft.TYPE])&&(o[Ft.TYPE]=r.subarray(t,t+e)),(r=o[Ft.OFFSET])&&(o[Ft.OFFSET]=r.subarray(t,t+e+1))||(r=o[Ft.DATA])&&(o[Ft.DATA]=s===6?r:r.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(s=>s.slice(e,n))}}C.prototype.children=Object.freeze([]);class ti extends O{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:s=0}=t;return new C(e,n,s,s)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.data),r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,s,r])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.data),r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,s,r])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:s}=t,r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,void 0,r],[s])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=N(t.nullBitmap),{length:o=s.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,void 0,r],s)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=T(e.ArrayType,t.typeIds),{["length"]:o=r.length,["nullCount"]:a=-1}=t;if(y.isSparseUnion(e))return new C(e,n,o,a,[void 0,void 0,void 0,r],s);const c=Fe(t.valueOffsets);return new C(e,n,o,a,[c,void 0,void 0,r],s)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.indices.ArrayType,t.data),{["dictionary"]:o=new g([new ti().visit({type:e.dictionary})])}=t,{["length"]:a=r.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[void 0,r,s],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new ti().visit({type:e.valueType})}=t,r=N(t.nullBitmap),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,void 0,r],[s])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new ti().visit({type:e.childType})}=t,r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,void 0,r],[s])}}const yl=new ti;function w(i){return yl.visit(i)}class Ts{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}function ho(i){return i.reduce((t,e)=>t+e.nullCount,0)}function fo(i){return i.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(i.length+1))}function yo(i,t,e,n){const s=[];for(let r=-1,o=i.length;++r<o;){const a=i[r],c=t[r],{length:l}=a;if(c>=n)break;if(e>=c+l)continue;if(c>=e&&c+l<=n){s.push(a);continue}const h=Math.max(0,e-c),d=Math.min(n-c,l);s.push(a.slice(h,d-h))}return s.length===0&&s.push(i[0].slice(0,0)),s}function rs(i,t,e,n){let s=0,r=0,o=t.length-1;do{if(s>=o-1)return e<t[o]?n(i,s,e-t[s]):null;r=s+Math.trunc((o-s)*.5),e<t[r]?o=r:s=r}while(s<o)}function os(i,t){return i.getValid(t)}function Re(i){function t(e,n,s){return i(e[n],s)}return function(e){const n=this.data;return rs(n,this._offsets,e,t)}}function po(i){let t;function e(n,s,r){return i(n[s],r,t)}return function(n,s){const r=this.data;t=s;const o=rs(r,this._offsets,n,e);return t=void 0,o}}function go(i){let t;function e(n,s,r){let o=r,a=0,c=0;for(let l=s-1,h=n.length;++l<h;){const d=n[l];if(~(a=i(d,t,o)))return c+a;o=0,c+=d.length}return-1}return function(n,s){t=n;const r=this.data,o=typeof s!="number"?e(r,0,0):rs(r,this._offsets,s,e);return t=void 0,o}}class b extends O{}function pl(i,t){return t===null&&i.length>0?0:-1}function gl(i,t){const{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let n=0;for(const s of new $e(e,i.offset+(t||0),i.length,e,en)){if(!s)return n;++n}return-1}function A(i,t,e){if(t===void 0)return-1;if(t===null)switch(i.typeId){case u.Union:break;case u.Dictionary:break;default:return gl(i,e)}const n=st.getVisitFn(i),s=Be(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}function mo(i,t,e){const n=st.getVisitFn(i),s=Be(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}b.prototype.visitNull=pl;b.prototype.visitBool=A;b.prototype.visitInt=A;b.prototype.visitInt8=A;b.prototype.visitInt16=A;b.prototype.visitInt32=A;b.prototype.visitInt64=A;b.prototype.visitUint8=A;b.prototype.visitUint16=A;b.prototype.visitUint32=A;b.prototype.visitUint64=A;b.prototype.visitFloat=A;b.prototype.visitFloat16=A;b.prototype.visitFloat32=A;b.prototype.visitFloat64=A;b.prototype.visitUtf8=A;b.prototype.visitBinary=A;b.prototype.visitFixedSizeBinary=A;b.prototype.visitDate=A;b.prototype.visitDateDay=A;b.prototype.visitDateMillisecond=A;b.prototype.visitTimestamp=A;b.prototype.visitTimestampSecond=A;b.prototype.visitTimestampMillisecond=A;b.prototype.visitTimestampMicrosecond=A;b.prototype.visitTimestampNanosecond=A;b.prototype.visitTime=A;b.prototype.visitTimeSecond=A;b.prototype.visitTimeMillisecond=A;b.prototype.visitTimeMicrosecond=A;b.prototype.visitTimeNanosecond=A;b.prototype.visitDecimal=A;b.prototype.visitList=A;b.prototype.visitStruct=A;b.prototype.visitUnion=A;b.prototype.visitDenseUnion=mo;b.prototype.visitSparseUnion=mo;b.prototype.visitDictionary=A;b.prototype.visitInterval=A;b.prototype.visitIntervalDayTime=A;b.prototype.visitIntervalYearMonth=A;b.prototype.visitDuration=A;b.prototype.visitDurationSecond=A;b.prototype.visitDurationMillisecond=A;b.prototype.visitDurationMicrosecond=A;b.prototype.visitDurationNanosecond=A;b.prototype.visitFixedSizeList=A;b.prototype.visitMap=A;const Ci=new b;class _ extends O{}function B(i){const{type:t}=i;if(i.nullCount===0&&i.stride===1&&(t.typeId===u.Timestamp||t instanceof Q&&t.bitWidth!==64||t instanceof Ht&&t.bitWidth!==64||t instanceof re&&t.precision!==J.HALF))return new Ts(i.data.length,n=>{const s=i.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let e=0;return new Ts(i.data.length,n=>{const r=i.data[n].length,o=i.slice(e,e+r);return e+=r,new ml(o)})}class ml{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}}_.prototype.visitNull=B;_.prototype.visitBool=B;_.prototype.visitInt=B;_.prototype.visitInt8=B;_.prototype.visitInt16=B;_.prototype.visitInt32=B;_.prototype.visitInt64=B;_.prototype.visitUint8=B;_.prototype.visitUint16=B;_.prototype.visitUint32=B;_.prototype.visitUint64=B;_.prototype.visitFloat=B;_.prototype.visitFloat16=B;_.prototype.visitFloat32=B;_.prototype.visitFloat64=B;_.prototype.visitUtf8=B;_.prototype.visitBinary=B;_.prototype.visitFixedSizeBinary=B;_.prototype.visitDate=B;_.prototype.visitDateDay=B;_.prototype.visitDateMillisecond=B;_.prototype.visitTimestamp=B;_.prototype.visitTimestampSecond=B;_.prototype.visitTimestampMillisecond=B;_.prototype.visitTimestampMicrosecond=B;_.prototype.visitTimestampNanosecond=B;_.prototype.visitTime=B;_.prototype.visitTimeSecond=B;_.prototype.visitTimeMillisecond=B;_.prototype.visitTimeMicrosecond=B;_.prototype.visitTimeNanosecond=B;_.prototype.visitDecimal=B;_.prototype.visitList=B;_.prototype.visitStruct=B;_.prototype.visitUnion=B;_.prototype.visitDenseUnion=B;_.prototype.visitSparseUnion=B;_.prototype.visitDictionary=B;_.prototype.visitInterval=B;_.prototype.visitIntervalDayTime=B;_.prototype.visitIntervalYearMonth=B;_.prototype.visitDuration=B;_.prototype.visitDurationSecond=B;_.prototype.visitDurationMillisecond=B;_.prototype.visitDurationMicrosecond=B;_.prototype.visitDurationNanosecond=B;_.prototype.visitFixedSizeList=B;_.prototype.visitMap=B;const as=new _,bl=(i,t)=>i+t;class de extends O{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===f.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitDuration(t,e){return 8}visitStruct(t,e){return t.children.reduce((n,s)=>n+Vt.visit(s,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((n,s)=>n+Vt.visit(s,e),0)}visitDictionary(t,e){var n;return t.type.indices.bitWidth/8+(((n=t.dictionary)===null||n===void 0?void 0:n.getByteLength(t.values[e]))||0)}}const _l=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),vl=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),wl=({valueOffsets:i,stride:t,children:e},n)=>{const s=e[0],{[n*t]:r}=i,{[n*t+1]:o}=i,a=Vt.getVisitFn(s.type),c=s.slice(r,o-r);let l=8;for(let h=-1,d=o-r;++h<d;)l+=a(c,h);return l},Il=({stride:i,children:t},e)=>{const n=t[0],s=n.slice(e*i,i),r=Vt.getVisitFn(n.type);let o=0;for(let a=-1,c=s.length;++a<c;)o+=r(s,a);return o},Sl=(i,t)=>i.type.mode===W.Dense?bo(i,t):_o(i,t),bo=({type:i,children:t,typeIds:e,valueOffsets:n},s)=>{const r=i.typeIdToChildIndex[e[s]];return 8+Vt.visit(t[r],n[s])},_o=({children:i},t)=>4+Vt.visitMany(i,i.map(()=>t)).reduce(bl,0);de.prototype.visitUtf8=_l;de.prototype.visitBinary=vl;de.prototype.visitList=wl;de.prototype.visitFixedSizeList=Il;de.prototype.visitUnion=Sl;de.prototype.visitDenseUnion=bo;de.prototype.visitSparseUnion=_o;const Vt=new de;var vo;const wo={},Io={};class g{constructor(t){var e,n,s;const r=t[0]instanceof g?t.flatMap(a=>a.data):t;if(r.length===0||r.some(a=>!(a instanceof C)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=r[0])===null||e===void 0?void 0:e.type;switch(r.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:c,indexOf:l,byteLength:h}=wo[o.typeId],d=r[0];this.isValid=U=>os(d,U),this.get=U=>a(d,U),this.set=(U,j)=>c(d,U,j),this.indexOf=U=>l(d,U),this.getByteLength=U=>h(d,U),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,Io[o.typeId]),this._offsets=fo(r);break}this.data=r,this.type=o,this.stride=Mt(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullCount(){return ho(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${u[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}getByteLength(t){return 0}[Symbol.iterator](){return as.visit(this)}concat(...t){return new g(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new g(ns(this,t,e,({data:n,_offsets:s},r,o)=>yo(n,s,r,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:s,ArrayType:r}=this;switch(t.typeId){case u.Int:case u.Float:case u.Decimal:case u.Time:case u.Timestamp:switch(e.length){case 0:return new r;case 1:return e[0].values.subarray(0,n*s);default:return e.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new r(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new g(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return y.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(y.isDictionary(this.type)){const t=new Ei(this.data[0].dictionary),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new g(e)}return new Ei(this)}unmemoize(){if(y.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new g(e)}return this}}vo=Symbol.toStringTag;g[vo]=(i=>{i.type=y.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;const t=Object.keys(u).map(e=>u[e]).filter(e=>typeof e=="number"&&e!==u.NONE);for(const e of t){const n=st.getVisitFnByTypeId(e),s=yt.getVisitFnByTypeId(e),r=Ci.getVisitFnByTypeId(e),o=Vt.getVisitFnByTypeId(e);wo[e]={get:n,set:s,indexOf:r,byteLength:o},Io[e]=Object.create(i,{isValid:{value:Re(os)},get:{value:Re(st.getVisitFnByTypeId(e))},set:{value:po(yt.getVisitFnByTypeId(e))},indexOf:{value:go(Ci.getVisitFnByTypeId(e))},getByteLength:{value:Re(Vt.getVisitFnByTypeId(e))}})}return"Vector"})(g.prototype);class Ei extends g{constructor(t){super(t.data);const e=this.get,n=this.set,s=this.slice,r=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=r[o];if(a!==void 0)return a;const c=e.call(this,o);return r[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),r[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Ei(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new g(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}function cs(i){if(i){if(i instanceof C)return new g([i]);if(i instanceof g)return new g(i.data);if(i.type instanceof y)return new g([w(i)]);if(Array.isArray(i))return new g(i.flatMap(t=>Bl(t)));if(ArrayBuffer.isView(i)){i instanceof DataView&&(i=new Uint8Array(i.buffer));const t={offset:0,length:i.length,nullCount:0,data:i};if(i instanceof Int8Array)return new g([w(Object.assign(Object.assign({},t),{type:new Br}))]);if(i instanceof Int16Array)return new g([w(Object.assign(Object.assign({},t),{type:new Dr}))]);if(i instanceof Int32Array)return new g([w(Object.assign(Object.assign({},t),{type:new ve}))]);if(i instanceof BigInt64Array)return new g([w(Object.assign(Object.assign({},t),{type:new Un}))]);if(i instanceof Uint8Array||i instanceof Uint8ClampedArray)return new g([w(Object.assign(Object.assign({},t),{type:new Ar}))]);if(i instanceof Uint16Array)return new g([w(Object.assign(Object.assign({},t),{type:new Or}))]);if(i instanceof Uint32Array)return new g([w(Object.assign(Object.assign({},t),{type:new Fr}))]);if(i instanceof BigUint64Array)return new g([w(Object.assign(Object.assign({},t),{type:new Mr}))]);if(i instanceof Float32Array)return new g([w(Object.assign(Object.assign({},t),{type:new Tr}))]);if(i instanceof Float64Array)return new g([w(Object.assign(Object.assign({},t),{type:new xn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function Bl(i){return i instanceof C?[i]:i instanceof g?i.data:cs(i).data}function Dl(i){if(!i||i.length<=0)return function(s){return!0};let t="";const e=i.filter(n=>n===n);return e.length>0&&(t=`
2
2
  switch (x) {${e.map(n=>`
3
3
  case ${Al(n)}:`).join("")}
4
4
  return false;