@loaders.gl/scene 5.0.0-beta.1 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DRACO-README.md +15 -0
- package/README.md +7 -1
- package/THIRD-PARTY-NOTICES.md +4 -1
- package/dist/dist.dev.js +5708 -4937
- package/dist/dist.min.js +24 -24
- package/dist/draco/bundled.cjs +37 -0
- package/dist/draco/bundled.cjs.map +7 -0
- package/dist/draco/bundled.d.ts +6 -0
- package/dist/draco/bundled.d.ts.map +1 -0
- package/dist/draco/bundled.js +7 -0
- package/dist/draco/bundled.js.map +1 -0
- package/dist/draco/draco-format.cjs +41 -0
- package/dist/draco/draco-format.cjs.map +7 -0
- package/dist/draco/draco-format.d.ts +15 -0
- package/dist/draco/draco-format.d.ts.map +1 -0
- package/dist/draco/draco-format.js +18 -0
- package/dist/draco/draco-format.js.map +1 -0
- package/dist/draco/draco-javascript-loader-with-parser.cjs +44 -0
- package/dist/draco/draco-javascript-loader-with-parser.cjs.map +7 -0
- package/dist/draco/draco-javascript-loader-with-parser.d.ts +34 -0
- package/dist/draco/draco-javascript-loader-with-parser.d.ts.map +1 -0
- package/dist/draco/draco-javascript-loader-with-parser.js +14 -0
- package/dist/draco/draco-javascript-loader-with-parser.js.map +1 -0
- package/dist/draco/draco-libraries.cjs +61 -0
- package/dist/draco/draco-libraries.cjs.map +7 -0
- package/dist/draco/draco-libraries.d.ts +28 -0
- package/dist/draco/draco-libraries.d.ts.map +1 -0
- package/dist/draco/draco-libraries.js +33 -0
- package/dist/draco/draco-libraries.js.map +1 -0
- package/dist/draco/draco-library-options.cjs +80 -0
- package/dist/draco/draco-library-options.cjs.map +7 -0
- package/dist/draco/draco-library-options.d.ts +16 -0
- package/dist/draco/draco-library-options.d.ts.map +1 -0
- package/dist/draco/draco-library-options.js +52 -0
- package/dist/draco/draco-library-options.js.map +1 -0
- package/dist/draco/draco-loader-options.cjs +37 -0
- package/dist/draco/draco-loader-options.cjs.map +7 -0
- package/dist/draco/draco-loader-options.d.ts +27 -0
- package/dist/draco/draco-loader-options.d.ts.map +1 -0
- package/dist/draco/draco-loader-options.js +12 -0
- package/dist/draco/draco-loader-options.js.map +1 -0
- package/dist/draco/draco-loader-types.cjs +88 -0
- package/dist/draco/draco-loader-types.cjs.map +7 -0
- package/dist/draco/draco-loader-types.d.ts +69 -0
- package/dist/draco/draco-loader-types.d.ts.map +1 -0
- package/dist/draco/draco-loader-types.js +54 -0
- package/dist/draco/draco-loader-types.js.map +1 -0
- package/dist/draco/draco-loader.cjs +51 -0
- package/dist/draco/draco-loader.cjs.map +7 -0
- package/dist/draco/draco-loader.d.ts +39 -0
- package/dist/draco/draco-loader.d.ts.map +1 -0
- package/dist/draco/draco-loader.js +22 -0
- package/dist/draco/draco-loader.js.map +1 -0
- package/dist/draco/draco-wasm-loader-with-parser.cjs +48 -0
- package/dist/draco/draco-wasm-loader-with-parser.cjs.map +7 -0
- package/dist/draco/draco-wasm-loader-with-parser.d.ts +34 -0
- package/dist/draco/draco-wasm-loader-with-parser.d.ts.map +1 -0
- package/dist/draco/draco-wasm-loader-with-parser.js +14 -0
- package/dist/draco/draco-wasm-loader-with-parser.js.map +1 -0
- package/dist/draco/draco-writer.cjs +183 -0
- package/dist/draco/draco-writer.cjs.map +7 -0
- package/dist/draco/draco-writer.d.ts +97 -0
- package/dist/draco/draco-writer.d.ts.map +1 -0
- package/dist/draco/draco-writer.js +166 -0
- package/dist/draco/draco-writer.js.map +1 -0
- package/dist/draco/draco3d/draco3d-types.cjs +76 -0
- package/dist/draco/draco3d/draco3d-types.cjs.map +7 -0
- package/dist/draco/draco3d/draco3d-types.d.ts +303 -0
- package/dist/draco/draco3d/draco3d-types.d.ts.map +1 -0
- package/dist/draco/draco3d/draco3d-types.js +47 -0
- package/dist/draco/draco3d/draco3d-types.js.map +1 -0
- package/dist/draco/draco3d-loader-with-parser.cjs +50 -0
- package/dist/draco/draco3d-loader-with-parser.cjs.map +7 -0
- package/dist/draco/draco3d-loader-with-parser.d.ts +34 -0
- package/dist/draco/draco3d-loader-with-parser.d.ts.map +1 -0
- package/dist/draco/draco3d-loader-with-parser.js +21 -0
- package/dist/draco/draco3d-loader-with-parser.js.map +1 -0
- package/dist/draco/index.cjs +54 -0
- package/dist/draco/index.cjs.map +7 -0
- package/dist/draco/index.d.ts +13 -0
- package/dist/draco/index.d.ts.map +1 -0
- package/dist/draco/index.js +13 -0
- package/dist/draco/index.js.map +1 -0
- package/dist/draco/lib/draco-builder.cjs +660 -0
- package/dist/draco/lib/draco-builder.cjs.map +7 -0
- package/dist/draco/lib/draco-builder.d.ts +175 -0
- package/dist/draco/lib/draco-builder.d.ts.map +1 -0
- package/dist/draco/lib/draco-builder.js +612 -0
- package/dist/draco/lib/draco-builder.js.map +1 -0
- package/dist/draco/lib/draco-library-loader.cjs +47 -0
- package/dist/draco/lib/draco-library-loader.cjs.map +7 -0
- package/dist/draco/lib/draco-library-loader.d.ts +5 -0
- package/dist/draco/lib/draco-library-loader.d.ts.map +1 -0
- package/dist/draco/lib/draco-library-loader.js +23 -0
- package/dist/draco/lib/draco-library-loader.js.map +1 -0
- package/dist/draco/lib/draco-module-loader.cjs +281 -0
- package/dist/draco/lib/draco-module-loader.cjs.map +7 -0
- package/dist/draco/lib/draco-module-loader.d.ts +25 -0
- package/dist/draco/lib/draco-module-loader.d.ts.map +1 -0
- package/dist/draco/lib/draco-module-loader.js +220 -0
- package/dist/draco/lib/draco-module-loader.js.map +1 -0
- package/dist/draco/lib/draco-parser.cjs +598 -0
- package/dist/draco/lib/draco-parser.cjs.map +7 -0
- package/dist/draco/lib/draco-parser.d.ts +142 -0
- package/dist/draco/lib/draco-parser.d.ts.map +1 -0
- package/dist/draco/lib/draco-parser.js +595 -0
- package/dist/draco/lib/draco-parser.js.map +1 -0
- package/dist/draco/lib/draco-types.cjs +19 -0
- package/dist/draco/lib/draco-types.cjs.map +7 -0
- package/dist/draco/lib/draco-types.d.ts +59 -0
- package/dist/draco/lib/draco-types.d.ts.map +1 -0
- package/dist/draco/lib/draco-types.js +5 -0
- package/dist/draco/lib/draco-types.js.map +1 -0
- package/dist/draco/lib/parse-draco.cjs +59 -0
- package/dist/draco/lib/parse-draco.cjs.map +7 -0
- package/dist/draco/lib/parse-draco.d.ts +22 -0
- package/dist/draco/lib/parse-draco.d.ts.map +1 -0
- package/dist/draco/lib/parse-draco.js +32 -0
- package/dist/draco/lib/parse-draco.js.map +1 -0
- package/dist/draco/lib/utils/get-draco-schema.cjs +74 -0
- package/dist/draco/lib/utils/get-draco-schema.cjs.map +7 -0
- package/dist/draco/lib/utils/get-draco-schema.d.ts +7 -0
- package/dist/draco/lib/utils/get-draco-schema.d.ts.map +1 -0
- package/dist/draco/lib/utils/get-draco-schema.js +45 -0
- package/dist/draco/lib/utils/get-draco-schema.js.map +1 -0
- package/dist/draco/lib/utils/version.cjs +31 -0
- package/dist/draco/lib/utils/version.cjs.map +7 -0
- package/dist/draco/lib/utils/version.d.ts +2 -0
- package/dist/draco/lib/utils/version.d.ts.map +1 -0
- package/dist/draco/lib/utils/version.js +8 -0
- package/dist/draco/lib/utils/version.js.map +1 -0
- package/dist/draco/unbundled.cjs +33 -0
- package/dist/draco/unbundled.cjs.map +7 -0
- package/dist/draco/unbundled.d.ts +3 -0
- package/dist/draco/unbundled.d.ts.map +1 -0
- package/dist/draco/unbundled.js +5 -0
- package/dist/draco/unbundled.js.map +1 -0
- package/dist/draco/workers/draco-worker-node.cjs +8 -0
- package/dist/draco/workers/draco-worker-node.cjs.map +7 -0
- package/dist/draco/workers/draco-worker-node.d.ts +2 -0
- package/dist/draco/workers/draco-worker-node.d.ts.map +1 -0
- package/dist/draco/workers/draco-worker-node.js +9 -0
- package/dist/draco/workers/draco-worker-node.js.map +1 -0
- package/dist/draco/workers/draco-worker.cjs +7 -0
- package/dist/draco/workers/draco-worker.cjs.map +7 -0
- package/dist/draco/workers/draco-worker.d.ts +2 -0
- package/dist/draco/workers/draco-worker.d.ts.map +1 -0
- package/dist/draco/workers/draco-worker.js +7 -0
- package/dist/draco/workers/draco-worker.js.map +1 -0
- package/dist/draco/workers/draco-writer-worker-node.cjs +11 -0
- package/dist/draco/workers/draco-writer-worker-node.cjs.map +7 -0
- package/dist/draco/workers/draco-writer-worker-node.d.cts +2 -0
- package/dist/draco/workers/draco-writer-worker-node.d.cts.map +1 -0
- package/dist/draco/workers/draco-writer-worker-node.d.ts +2 -0
- package/dist/draco/workers/draco-writer-worker-node.d.ts.map +1 -0
- package/dist/draco/workers/draco-writer-worker-node.js +9 -0
- package/dist/draco/workers/draco-writer-worker-node.js.map +1 -0
- package/dist/draco/workers/draco-writer-worker.cjs +10 -0
- package/dist/draco/workers/draco-writer-worker.cjs.map +7 -0
- package/dist/draco/workers/draco-writer-worker.d.ts +2 -0
- package/dist/draco/workers/draco-writer-worker.d.ts.map +1 -0
- package/dist/draco/workers/draco-writer-worker.js +7 -0
- package/dist/draco/workers/draco-writer-worker.js.map +1 -0
- package/dist/draco-javascript-loader.cjs +25 -0
- package/dist/draco-javascript-loader.cjs.map +7 -0
- package/dist/draco-javascript-loader.d.ts +2 -0
- package/dist/draco-javascript-loader.d.ts.map +1 -0
- package/dist/draco-javascript-loader.js +3 -0
- package/dist/draco-javascript-loader.js.map +1 -0
- package/dist/draco-library-options.cjs +36 -0
- package/dist/draco-library-options.cjs.map +7 -0
- package/dist/draco-library-options.d.ts +3 -0
- package/dist/draco-library-options.d.ts.map +1 -0
- package/dist/draco-library-options.js +4 -0
- package/dist/draco-library-options.js.map +1 -0
- package/dist/draco-loader-types.cjs +25 -0
- package/dist/draco-loader-types.cjs.map +7 -0
- package/dist/draco-loader-types.d.ts +2 -0
- package/dist/draco-loader-types.d.ts.map +1 -0
- package/dist/draco-loader-types.js +3 -0
- package/dist/draco-loader-types.js.map +1 -0
- package/dist/draco-loader.cjs +25 -0
- package/dist/draco-loader.cjs.map +7 -0
- package/dist/draco-loader.d.ts +2 -0
- package/dist/draco-loader.d.ts.map +1 -0
- package/dist/draco-loader.js +3 -0
- package/dist/draco-loader.js.map +1 -0
- package/dist/draco-wasm-loader.cjs +25 -0
- package/dist/draco-wasm-loader.cjs.map +7 -0
- package/dist/draco-wasm-loader.d.ts +2 -0
- package/dist/draco-wasm-loader.d.ts.map +1 -0
- package/dist/draco-wasm-loader.js +3 -0
- package/dist/draco-wasm-loader.js.map +1 -0
- package/dist/draco-worker-node.js +28279 -0
- package/dist/draco-worker-node.js.map +7 -0
- package/dist/draco-worker.js +18145 -0
- package/dist/draco-worker.js.map +7 -0
- package/dist/draco-writer-worker-node.cjs +27521 -0
- package/dist/draco-writer-worker-node.cjs.map +7 -0
- package/dist/draco-writer-worker.js +17339 -0
- package/dist/draco-writer-worker.js.map +7 -0
- package/dist/draco-writer.cjs +25 -0
- package/dist/draco-writer.cjs.map +7 -0
- package/dist/draco-writer.d.ts +2 -0
- package/dist/draco-writer.d.ts.map +1 -0
- package/dist/draco-writer.js +3 -0
- package/dist/draco-writer.js.map +1 -0
- package/dist/draco3d-loader.cjs +25 -0
- package/dist/draco3d-loader.cjs.map +7 -0
- package/dist/draco3d-loader.d.ts +2 -0
- package/dist/draco3d-loader.d.ts.map +1 -0
- package/dist/draco3d-loader.js +3 -0
- package/dist/draco3d-loader.js.map +1 -0
- package/dist/glb-loader-types.cjs +61 -0
- package/dist/glb-loader-types.cjs.map +7 -0
- package/dist/glb-loader-types.d.ts +2 -0
- package/dist/glb-loader-types.d.ts.map +1 -0
- package/dist/glb-loader-types.js +2 -0
- package/dist/glb-loader-types.js.map +1 -0
- package/dist/glb-loader.cjs +48 -0
- package/dist/glb-loader.cjs.map +7 -0
- package/dist/glb-loader.d.ts +2 -0
- package/dist/glb-loader.d.ts.map +1 -0
- package/dist/glb-loader.js +2 -0
- package/dist/glb-loader.js.map +1 -0
- package/dist/glb-writer.cjs +53 -0
- package/dist/glb-writer.cjs.map +7 -0
- package/dist/glb-writer.d.ts +2 -0
- package/dist/glb-writer.d.ts.map +1 -0
- package/dist/glb-writer.js +2 -0
- package/dist/glb-writer.js.map +1 -0
- package/dist/gltf/glb-loader-types.cjs +1 -1
- package/dist/gltf/glb-loader-types.cjs.map +2 -2
- package/dist/gltf/glb-loader-types.d.ts +2 -2
- package/dist/gltf/glb-loader-types.js +1 -1
- package/dist/gltf/glb-loader-types.js.map +1 -1
- package/dist/gltf/gltf-loader-types.cjs +1 -1
- package/dist/gltf/gltf-loader-types.cjs.map +2 -2
- package/dist/gltf/gltf-loader-types.d.ts +5 -5
- package/dist/gltf/gltf-loader-types.d.ts.map +1 -1
- package/dist/gltf/gltf-loader-types.js +1 -1
- package/dist/gltf/gltf-loader-types.js.map +1 -1
- package/dist/gltf/gltf-loader.cjs.map +1 -1
- package/dist/gltf/gltf-loader.d.ts +4 -4
- package/dist/gltf/gltf-loader.d.ts.map +1 -1
- package/dist/gltf/lib/encoders/encode-gltf-draco.cjs +12 -2
- package/dist/gltf/lib/encoders/encode-gltf-draco.cjs.map +2 -2
- package/dist/gltf/lib/encoders/encode-gltf-draco.d.ts +1 -1
- package/dist/gltf/lib/encoders/encode-gltf-draco.d.ts.map +1 -1
- package/dist/gltf/lib/encoders/encode-gltf-draco.js +1 -1
- package/dist/gltf/lib/encoders/encode-gltf-draco.js.map +1 -1
- package/dist/gltf/lib/extensions/KHR_draco_mesh_compression.cjs +2 -2
- package/dist/gltf/lib/extensions/KHR_draco_mesh_compression.cjs.map +2 -2
- package/dist/gltf/lib/extensions/KHR_draco_mesh_compression.d.ts.map +1 -1
- package/dist/gltf/lib/extensions/KHR_draco_mesh_compression.js +1 -1
- package/dist/gltf/lib/extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/dist/gltf/lib/parsers/parse-gltf.cjs +2 -2
- package/dist/gltf/lib/parsers/parse-gltf.cjs.map +3 -3
- package/dist/gltf/lib/parsers/parse-gltf.js +5 -5
- package/dist/gltf/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/lib/types/gltf-zod-schema.d.ts +1 -1
- package/dist/gltf/lib/utils/version.cjs +1 -1
- package/dist/gltf/lib/utils/version.js +1 -1
- package/dist/gltf-loader-types.cjs +73 -0
- package/dist/gltf-loader-types.cjs.map +7 -0
- package/dist/gltf-loader-types.d.ts +2 -0
- package/dist/gltf-loader-types.d.ts.map +1 -0
- package/dist/gltf-loader-types.js +2 -0
- package/dist/gltf-loader-types.js.map +1 -0
- package/dist/gltf-loader.cjs +48 -0
- package/dist/gltf-loader.cjs.map +7 -0
- package/dist/gltf-loader.d.ts +2 -0
- package/dist/gltf-loader.d.ts.map +1 -0
- package/dist/gltf-loader.js +2 -0
- package/dist/gltf-loader.js.map +1 -0
- package/dist/gltf-source.cjs +238 -0
- package/dist/gltf-source.cjs.map +7 -0
- package/dist/gltf-source.d.ts +2 -0
- package/dist/gltf-source.d.ts.map +1 -0
- package/dist/gltf-source.js +2 -0
- package/dist/gltf-source.js.map +1 -0
- package/dist/gltf-writer.cjs +69 -0
- package/dist/gltf-writer.cjs.map +7 -0
- package/dist/gltf-writer.d.ts +2 -0
- package/dist/gltf-writer.d.ts.map +1 -0
- package/dist/gltf-writer.js +2 -0
- package/dist/gltf-writer.js.map +1 -0
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/libs/DRACO-LICENSE +252 -0
- package/dist/libs/README.md +20 -0
- package/dist/libs/draco_decoder.js +34 -0
- package/dist/libs/draco_decoder.mjs +37 -0
- package/dist/libs/draco_decoder.wasm +0 -0
- package/dist/libs/draco_decoder_gltf.wasm +0 -0
- package/dist/libs/draco_encoder.js +98 -0
- package/dist/libs/draco_encoder.mjs +101 -0
- package/dist/libs/draco_encoder.wasm +0 -0
- package/dist/libs/draco_wasm_wrapper.js +117 -0
- package/dist/libs/draco_wasm_wrapper.mjs +120 -0
- package/dist/libs/draco_wasm_wrapper_gltf.js +116 -0
- package/dist/libs/draco_wasm_wrapper_gltf.mjs +119 -0
- package/dist/mtl-loader-types.cjs +64 -0
- package/dist/mtl-loader-types.cjs.map +7 -0
- package/dist/mtl-loader-types.d.ts +2 -0
- package/dist/mtl-loader-types.d.ts.map +1 -0
- package/dist/mtl-loader-types.js +2 -0
- package/dist/mtl-loader-types.js.map +1 -0
- package/dist/mtl-loader.cjs +47 -0
- package/dist/mtl-loader.cjs.map +7 -0
- package/dist/mtl-loader.d.ts +2 -0
- package/dist/mtl-loader.d.ts.map +1 -0
- package/dist/mtl-loader.js +2 -0
- package/dist/mtl-loader.js.map +1 -0
- package/dist/obj/mtl-loader-types.cjs +2 -2
- package/dist/obj/mtl-loader-types.cjs.map +2 -2
- package/dist/obj/mtl-loader-types.d.ts +2 -2
- package/dist/obj/mtl-loader-types.js +2 -2
- package/dist/obj/mtl-loader-types.js.map +1 -1
- package/dist/obj/mtl-loader.cjs +1 -1
- package/dist/obj/mtl-loader.cjs.map +2 -2
- package/dist/obj/mtl-loader.js +1 -1
- package/dist/obj/mtl-loader.js.map +1 -1
- package/dist/obj/obj-loader-types.cjs +2 -2
- package/dist/obj/obj-loader-types.cjs.map +2 -2
- package/dist/obj/obj-loader-types.js +2 -2
- package/dist/obj/obj-loader-types.js.map +1 -1
- package/dist/obj/obj-writer.cjs +1 -1
- package/dist/obj/obj-writer.js +1 -1
- package/dist/obj-loader-types.cjs +71 -0
- package/dist/obj-loader-types.cjs.map +7 -0
- package/dist/obj-loader-types.d.ts +2 -0
- package/dist/obj-loader-types.d.ts.map +1 -0
- package/dist/obj-loader-types.js +2 -0
- package/dist/obj-loader-types.js.map +1 -0
- package/dist/obj-loader.cjs +163 -0
- package/dist/obj-loader.cjs.map +7 -0
- package/dist/obj-loader.d.ts +2 -0
- package/dist/obj-loader.d.ts.map +1 -0
- package/dist/obj-loader.js +2 -0
- package/dist/obj-loader.js.map +1 -0
- package/dist/obj-worker.js +204 -71
- package/dist/obj-writer.cjs +167 -0
- package/dist/obj-writer.cjs.map +7 -0
- package/dist/obj-writer.d.ts +2 -0
- package/dist/obj-writer.d.ts.map +1 -0
- package/dist/obj-writer.js +2 -0
- package/dist/obj-writer.js.map +1 -0
- package/dist/usd/usd-loader-types.cjs +2 -2
- package/dist/usd/usd-loader-types.cjs.map +2 -2
- package/dist/usd/usd-loader-types.js +2 -2
- package/dist/usd/usd-loader-types.js.map +1 -1
- package/dist/usd-loader-types.cjs +69 -0
- package/dist/usd-loader-types.cjs.map +7 -0
- package/dist/usd-loader-types.d.ts +2 -0
- package/dist/usd-loader-types.d.ts.map +1 -0
- package/dist/usd-loader-types.js +2 -0
- package/dist/usd-loader-types.js.map +1 -0
- package/dist/usd-loader.cjs +43 -0
- package/dist/usd-loader.cjs.map +7 -0
- package/dist/usd-loader.d.ts +2 -0
- package/dist/usd-loader.d.ts.map +1 -0
- package/dist/usd-loader.js +2 -0
- package/dist/usd-loader.js.map +1 -0
- package/package.json +130 -71
- package/src/draco/bundled.ts +10 -0
- package/src/draco/draco-format.ts +20 -0
- package/src/draco/draco-javascript-loader-with-parser.ts +26 -0
- package/src/draco/draco-libraries.ts +35 -0
- package/src/draco/draco-library-options.ts +76 -0
- package/src/draco/draco-loader-options.ts +33 -0
- package/src/draco/draco-loader-types.ts +78 -0
- package/src/draco/draco-loader.ts +45 -0
- package/src/draco/draco-wasm-loader-with-parser.ts +31 -0
- package/src/draco/draco-writer.ts +252 -0
- package/src/draco/draco3d/draco3d-types.ts +498 -0
- package/src/draco/draco3d-loader-with-parser.ts +34 -0
- package/src/draco/index.ts +46 -0
- package/src/draco/lib/draco-builder.ts +935 -0
- package/src/draco/lib/draco-library-loader.ts +38 -0
- package/src/draco/lib/draco-module-loader.ts +370 -0
- package/src/draco/lib/draco-parser.ts +776 -0
- package/src/draco/lib/draco-types.ts +72 -0
- package/src/draco/lib/parse-draco.ts +51 -0
- package/src/draco/lib/utils/get-draco-schema.ts +65 -0
- package/src/draco/lib/utils/version.ts +8 -0
- package/src/draco/libs/DRACO-LICENSE +252 -0
- package/src/draco/libs/README.md +20 -0
- package/src/draco/libs/draco_decoder.js +34 -0
- package/src/draco/libs/draco_decoder.wasm +0 -0
- package/src/draco/libs/draco_decoder_gltf.wasm +0 -0
- package/src/draco/libs/draco_encoder.js +98 -0
- package/src/draco/libs/draco_encoder.wasm +0 -0
- package/src/draco/libs/draco_wasm_wrapper.js +117 -0
- package/src/draco/libs/draco_wasm_wrapper_gltf.js +116 -0
- package/src/draco/unbundled.ts +6 -0
- package/src/draco/workers/draco-worker-node.ts +10 -0
- package/src/draco/workers/draco-worker.ts +8 -0
- package/src/draco/workers/draco-writer-worker-node.cjs +21 -0
- package/src/draco/workers/draco-writer-worker-node.ts +13 -0
- package/src/draco/workers/draco-writer-worker.ts +11 -0
- package/src/draco-javascript-loader.ts +2 -0
- package/src/draco-library-options.ts +6 -0
- package/src/draco-loader-types.ts +2 -0
- package/src/draco-loader.ts +2 -0
- package/src/draco-wasm-loader.ts +2 -0
- package/src/draco-writer.ts +2 -0
- package/src/draco3d-loader.ts +2 -0
- package/src/glb-loader-types.ts +1 -0
- package/src/glb-loader.ts +1 -0
- package/src/glb-writer.ts +1 -0
- package/src/gltf/glb-loader-types.ts +1 -1
- package/src/gltf/gltf-loader-types.ts +5 -5
- package/src/gltf/gltf-loader.ts +4 -4
- package/src/gltf/lib/encoders/encode-gltf-draco.ts +2 -2
- package/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts +2 -1
- package/src/gltf/lib/parsers/parse-gltf.ts +5 -5
- package/src/gltf-loader-types.ts +1 -0
- package/src/gltf-loader.ts +1 -0
- package/src/gltf-source.ts +1 -0
- package/src/gltf-writer.ts +1 -0
- package/src/index.ts +5 -0
- package/src/mtl-loader-types.ts +1 -0
- package/src/mtl-loader.ts +1 -0
- package/src/obj/mtl-loader-types.ts +1 -1
- package/src/obj/mtl-loader.ts +1 -1
- package/src/obj/obj-loader-types.ts +1 -1
- package/src/obj-loader-types.ts +1 -0
- package/src/obj-loader.ts +1 -0
- package/src/obj-writer.ts +1 -0
- package/src/usd/usd-loader-types.ts +1 -1
- package/src/usd-loader-types.ts +1 -0
- package/src/usd-loader.ts +1 -0
package/dist/dist.min.js
CHANGED
|
@@ -4,46 +4,46 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
6
|
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var
|
|
7
|
+
"use strict";var __exports__=(()=>{var ZL=Object.create;var tu=Object.defineProperty;var eS=Object.getOwnPropertyDescriptor;var tS=Object.getOwnPropertyNames;var rS=Object.getPrototypeOf,nS=Object.prototype.hasOwnProperty;var p=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var sS=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Q=(r,e)=>{for(var t in e)tu(r,t,{get:e[t],enumerable:!0})},Ty=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of tS(e))!nS.call(r,s)&&s!==t&&tu(r,s,{get:()=>e[s],enumerable:!(n=eS(e,s))||n.enumerable});return r};var iS=(r,e,t)=>(t=r!=null?ZL(rS(r)):{},Ty(e||!r||!r.__esModule?tu(t,"default",{value:r,enumerable:!0}):t,r)),oS=r=>Ty(tu({},"__esModule",{value:!0}),r);var Ay=sS((MC,_y)=>{_y.exports=globalThis.loaders});function vy(r,e){if(!r.trimStart().startsWith("#usda"))throw new Error("OpenUSD ASCII layers must begin with the #usda header.");return new sd(r,e).parse()}var aS,cS,sd,id,Iy=p(()=>{"use strict";aS=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/,cS=new Set(["uniform","varying","custom","prepend","append","add","delete","reorder"]);sd=class{tokenizer;url;constructor(e,t){this.tokenizer=new id(e),this.url=t}parse(){let e=this.tokenizer.match("(")?this.parseMetadata(")"):{},t=[];for(;!this.tokenizer.isAtEnd();)this.isPrimDeclaration()?t.push(this.parsePrim("")):this.tokenizer.read();return{format:"usda",url:this.url,metadata:e,rootPrims:t,layers:this.url?[this.url]:[]}}parsePrim(e){let n=this.tokenizer.read().value,s=this.tokenizer.read(),i=this.tokenizer.peek().kind==="string",o=i?s.value:"",a=i?this.tokenizer.read().value:s.value,c=`${e}/${a}`,u=this.tokenizer.match("(")?this.parseMetadata(")"):{};this.tokenizer.expect("{");let f=this.parsePrimContents(c);return{name:a,path:c,sourceUrl:this.url,type:o,specifier:n,attributes:f.attributes,metadata:{...u,...f.metadata},variants:f.variants,children:f.children}}parsePrimContents(e){let t={},n={},s=[],i={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match("}");)if(this.isPrimDeclaration())s.push(this.parsePrim(e));else if(this.tokenizer.peek().value==="variantSet")this.parseVariantSet(e,i);else{let o=this.parseAttribute();o&&(t[o.name]=o)}return{attributes:t,metadata:n,children:s,variants:i}}parseVariantSet(e,t){this.tokenizer.expect("variantSet");let n=this.tokenizer.read().value;this.tokenizer.expect("="),this.tokenizer.expect("{");let s={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match("}");){let i=this.tokenizer.read().value;this.tokenizer.expect("{");let o=this.parsePrimContents(e);s[i]={attributes:o.attributes,metadata:o.metadata,children:o.children}}t[n]=s}parseAttribute(){let e=this.tokenizer.read();if(e.kind==="end")return null;let t=[e];for(;!this.tokenizer.isAtEnd()&&this.tokenizer.peek().line===e.line;){let u=this.tokenizer.peek();if(u.value==="="){this.tokenizer.read();break}if(u.value==="{"||u.value==="}")return null;t.push(this.tokenizer.read())}if(!(this.tokenizer.previousValue==="="))return null;let s=t.filter(u=>!cS.has(u.value));if(s.length===0)return null;let i=s[s.length-1].value,o=s.slice(0,-1).map(u=>u.value).join(""),a=this.parseValue(),c=this.tokenizer.match("(")?this.parseMetadata(")"):{};return{name:i,type:o,value:a,metadata:c}}parseMetadata(e){let t={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match(e);){if(this.tokenizer.match(","),this.tokenizer.peek().value===e){this.tokenizer.read();break}let n=this.tokenizer.read(),s=[n];for(;!this.tokenizer.isAtEnd()&&this.tokenizer.peek().line===n.line;){if(this.tokenizer.peek().value==="="||this.tokenizer.peek().value===":"){this.tokenizer.read();break}if(this.tokenizer.peek().value===e)break;s.push(this.tokenizer.read())}if(this.tokenizer.previousValue!=="="&&this.tokenizer.previousValue!==":")continue;let i=s[s.length-1].value;t[i]=this.parseValue(),this.tokenizer.match(",")}return t}parseValue(){let e=this.tokenizer.read();if(e.value==="[")return this.parseList("]");if(e.value==="(")return this.parseList(")");if(e.value==="{")return this.parseMetadata("}");if(e.kind==="asset"){let t={assetPath:e.value};return this.tokenizer.peek().kind==="path"&&this.tokenizer.peek().line===e.line&&(t.primPath=this.tokenizer.read().value),t}return e.kind==="path"?{path:e.value}:e.kind==="number"?Number(e.value):e.value==="true"?!0:e.value==="false"?!1:e.value==="None"||e.value==="null"?null:e.value}parseList(e){let t=[];for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match(e);)this.tokenizer.match(",")||(t.push(this.parseValue()),this.tokenizer.match(","));return t}isPrimDeclaration(){let e=this.tokenizer.peek().value;return e==="def"||e==="over"||e==="class"}},id=class{source;offset=0;line=1;bufferedToken=null;previousValue="";constructor(e){this.source=e}peek(){return this.bufferedToken||=this.readToken(),this.bufferedToken}read(){let e=this.peek();return this.bufferedToken=null,this.previousValue=e.value,e}match(e){return this.peek().value!==e?!1:(this.read(),!0)}expect(e){let t=this.read();if(t.value!==e)throw new Error(`Expected "${e}" at USDA line ${t.line}, received "${t.value}".`)}isAtEnd(){return this.peek().kind==="end"}readToken(){this.skipIgnoredText();let e=this.line,t=this.source[this.offset];if(t===void 0)return{value:"",line:e,kind:"end"};if("{}[](),=".includes(t))return this.offset++,{value:t,line:e,kind:"punctuation"};if(t==='"'||t==="'")return{value:this.readQuotedString(t),line:e,kind:"string"};if(t==="@")return{value:this.readDelimitedValue("@"),line:e,kind:"asset"};if(t==="<")return{value:this.readDelimitedValue(">"),line:e,kind:"path"};let n=this.source.slice(this.offset).match(aS);if(n)return this.offset+=n[0].length,{value:n[0],line:e,kind:"number"};let s=this.offset;for(;this.offset<this.source.length;){let i=this.source[this.offset];if(/\s/.test(i)||"{}[](),=@<>".includes(i))break;this.offset++}return this.offset===s&&this.offset++,{value:this.source.slice(s,this.offset),line:e,kind:"word"}}skipIgnoredText(){for(;this.offset<this.source.length;){let e=this.source[this.offset];if(e===`
|
|
8
8
|
`)this.line++,this.offset++;else if(/\s/.test(e))this.offset++;else if(e==="#")for(;this.offset<this.source.length&&this.source[this.offset]!==`
|
|
9
9
|
`;)this.offset++;else if(e==="/"&&this.source[this.offset+1]==="*"){for(this.offset+=2;this.offset<this.source.length&&!this.source.startsWith("*/",this.offset);)this.source[this.offset]===`
|
|
10
10
|
`&&this.line++,this.offset++;this.offset+=2}else if(this.source.startsWith('"""',this.offset)){for(this.offset+=3;this.offset<this.source.length&&!this.source.startsWith('"""',this.offset);)this.source[this.offset]===`
|
|
11
|
-
`&&this.line++,this.offset++;this.offset+=3}else break}}readQuotedString(e){this.offset++;let
|
|
12
|
-
`:s}else r+=n}return r}readDelimitedValue(e){this.offset++;let r=this.offset;for(;this.offset<this.source.length&&this.source[this.offset]!==e;)this.offset++;let n=this.source.slice(r,this.offset);return this.offset++,n}}});function ry(t){let e=new DataView(t),r=wL(e),n=e.getUint16(r+10,!0),s=e.getUint32(r+16,!0),i=new Map,o=new TextDecoder;for(let a=0;a<n;a++){if(e.getUint32(s,!0)!==33639248)throw new Error("USDZ archive contains an invalid ZIP central-directory entry.");let c=e.getUint16(s+10,!0),u=e.getUint32(s+20,!0),f=e.getUint16(s+28,!0),l=e.getUint16(s+30,!0),d=e.getUint16(s+32,!0),h=e.getUint32(s+42,!0),m=o.decode(new Uint8Array(t,s+46,f));if(c!==0)throw new Error(`USDZ entry "${m}" is compressed; USDZ requires stored ZIP entries.`);if(e.getUint32(h,!0)!==67324752)throw new Error(`USDZ entry "${m}" has an invalid local ZIP header.`);let b=e.getUint16(h+26,!0),x=e.getUint16(h+28,!0),g=h+30+b+x;i.set(m,t.slice(g,g+u)),s+=46+f+l+d}return i}function wL(t){let e=Math.max(0,t.byteLength-65557);for(let r=t.byteLength-22;r>=e;r--)if(t.getUint32(r,!0)===101010256)return r;throw new Error("USDZ archive does not contain a ZIP end-of-central-directory record.")}var ny=p(()=>{"use strict"});async function Yl(t,e={},r){let n=AL(e.core?.baseUrl,r?.url),s={fetch:async o=>{let a=await(r?.fetch||fetch)(o);if(!(a instanceof Response))throw new Error(`OpenUSD reference "${o}" did not return an HTTP response.`);if(!a.ok)throw new Error(`Unable to load OpenUSD reference "${o}": ${a.status}.`);return a},cache:new Map,archiveFiles:new Map,layers:new Set,options:{...e,usd:{...IL,...e.usd}}},i;if(BL(t)){let o=ry(t),a=Array.from(o.keys()).find(f=>/\.usda?$/i.test(f));if(!a)throw new Error("USDZ archives with binary USDC root layers are not implemented yet.");let c="https://usd.archive/";for(let[f,l]of o)s.archiveFiles.set(new URL(f,c).href,l);let u=new URL(a,c).href;i=Kl(o.get(a),u),i.format="usdz"}else i=Kl(t,n);return i.url&&s.layers.add(i.url),s.options.usd?.compose!==!1&&(i.rootPrims=await Hl(i.rootPrims,i.url,{},s,0)),i.layers=Array.from(s.layers),n&&(i.url=n),i}function AL(t,e){let r=iy(t);return r||iy(e)||t||e}function iy(t){try{return t?new URL(t).href:void 0}catch{return}}function vL(t,e){try{return new URL(t,e).href}catch{let r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return r>=0?`${e.slice(0,r+1)}${t}`:t}}function Kl(t,e){if(sy.decode(t.slice(0,8))===TL)throw new Error("Binary USDC crate layers are not implemented yet; use ASCII USDA layers.");return ey(sy.decode(t),e)}async function Hl(t,e,r,n,s){if(s>(n.options.usd?.maxReferenceDepth??12))throw new Error("OpenUSD reference composition exceeded the configured depth limit.");let i=[];for(let o of t){if(o.specifier==="class")continue;let c={...EL(o.metadata.variants),...r,...n.options.usd?.variantSelections},u=o.sourceUrl||e,f=pa(o);for(let[d,h]of Object.entries(f.variants)){let m=c[d]||Object.keys(h)[0],b=h[m];b&&(f=Jl(f,{...f,attributes:b.attributes,metadata:b.metadata,children:b.children,variants:{}}))}let l=ay(f);if(n.options.usd?.loadReferences!==!1&&l.length>0)for(let d of l){if(!u)throw new Error("OpenUSD references require a source URL or options.core.baseUrl.");let h=vL(d.assetPath,u),m=await LL(h,n),b=SL(m,d.primPath),x=await Hl(b,h,c,n,s+1);for(let g of x)f=Jl(cy(g,f.path),f)}f.children=await Hl(f.children,u,c,n,s),i.push(f)}return i}async function LL(t,e){let r=e.cache.get(t);return r||(r=(async()=>{let s=e.archiveFiles.get(t);if(!s){let o;try{o=await e.fetch(t)}catch(a){throw new Error(`Unable to fetch USD layer "${t}": ${String(a)}`)}s=o.arrayBuffer()}let i=Kl(await s,t);return e.layers.add(t),i})(),e.cache.set(t,r)),r}function SL(t,e){let r=e||t.metadata.defaultPrim;if(typeof r!="string")return t.rootPrims;let n=r.startsWith("/")?r:`/${r}`,s=oy(t.rootPrims,n);return s?[s]:[]}function oy(t,e){for(let r of t){if(r.path===e)return r;let n=oy(r.children,e);if(n)return n}}function ay(t){let e=[];for(let r of[t.metadata.references,t.metadata.payload,t.metadata.payloads])Array.isArray(r)?e.push(...r.filter(Xl)):Xl(r)&&e.push(r);return e}function EL(t){return!t||typeof t!="object"||Array.isArray(t)||Xl(t)?{}:Object.fromEntries(Object.entries(t).filter(e=>typeof e[1]=="string"))}function Xl(t){return!!(t&&typeof t=="object"&&!Array.isArray(t)&&"assetPath"in t)}function pa(t){return{...t,attributes:{...t.attributes},metadata:{...t.metadata},variants:{...t.variants},children:t.children.map(pa)}}function cy(t,e){let r=pa(t);return r.path=e,r.children=r.children.map(n=>cy(n,`${e}/${n.name}`)),r}function Jl(t,e){let r=t.children.map(pa);for(let n of e.children){let s=r.findIndex(i=>i.name===n.name);s>=0?r[s]=Jl(r[s],n):r.push(pa(n))}return{...t,...e,sourceUrl:ay(e).length>0?e.sourceUrl:t.sourceUrl||e.sourceUrl,type:e.type||t.type,attributes:{...t.attributes,...e.attributes},metadata:{...t.metadata,...e.metadata},variants:{...t.variants,...e.variants},children:r}}function BL(t){return t.byteLength>=4&&new DataView(t).getUint32(0,!0)===_L}var sy,TL,_L,IL,uy=p(()=>{"use strict";ty();ny();sy=new TextDecoder,TL="PXR-USDC",_L=67324752;IL={compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}});var fy={};Z(fy,{USDLoaderWithParser:()=>OL});async function ML(t,e,r){return Yl(new TextEncoder().encode(t).buffer,e,r)}var $C,FL,OL,ly=p(()=>{"use strict";uy();Zl();({preload:$C,...FL}=ma),OL={...FL,parse:Yl,parseText:ML}});async function DL(){let{USDLoaderWithParser:t}=await Promise.resolve().then(()=>(ly(),fy));return t}var RL,ma,Zl=p(()=>{"use strict";RL="5.0.0-beta.1";ma={dataType:null,batchType:null,name:"Universal Scene Description",id:"usd",module:"scene",version:RL,extensions:["usd","usda","usdz"],mimeTypes:["model/vnd.usd","model/vnd.usda","model/vnd.usdz+zip"],text:!0,binary:!0,tests:["#usda","PK"],options:{usd:{compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}},preload:DL}});var dy,hy=p(()=>{"use strict";dy={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]}});function my(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function B(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(f){try{u(n.next(f))}catch(l){o(l)}}function c(f){try{u(n.throw(f))}catch(l){o(l)}}function u(f){f.done?i(f.value):s(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})}function py(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function H(t){return this instanceof H?(this.v=t,this):new H(t)}function bt(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(m){return Promise.resolve(m).then(h,l)}}function a(h,m){n[h]&&(s[h]=function(b){return new Promise(function(x,g){i.push([h,b,x,g])>1||c(h,b)})},m&&(s[h]=m(s[h])))}function c(h,m){try{u(n[h](m))}catch(b){d(i[0][3],b)}}function u(h){h.value instanceof H?Promise.resolve(h.value.v).then(f,l):d(i[0][2],h)}function f(h){c("next",h)}function l(h){c("throw",h)}function d(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function so(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(o){return(r=!r)?{value:H(t[s](o)),done:!1}:i?i(o):o}:i}}function jt(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof py=="function"?py(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(a,c){o=t[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var Bt=p(()=>{});var by,io,NL,zt,an=p(()=>{by=new TextDecoder("utf-8"),io=by.decode.bind(by),NL=new TextEncoder,zt=t=>NL.encode(t)});var CL,gy,$e,gt,Wt,wr,ur,Yc,Zc,Qc,eu,tu,yy,ba,xy,ru,wy,Un=p(()=>{CL=t=>typeof t=="number",gy=t=>typeof t=="boolean",$e=t=>typeof t=="function",gt=t=>t!=null&&Object(t)===t,Wt=t=>gt(t)&&$e(t.then),wr=t=>gt(t)&&$e(t[Symbol.iterator]),ur=t=>gt(t)&&$e(t[Symbol.asyncIterator]),Yc=t=>gt(t)&>(t.schema),Zc=t=>gt(t)&&"done"in t&&"value"in t,Qc=t=>gt(t)&&$e(t.stat)&&CL(t.fd),eu=t=>gt(t)&&ba(t.body),tu=t=>"_getDOMStream"in t&&"_getNodeStream"in t,yy=t=>gt(t)&&$e(t.abort)&&$e(t.getWriter)&&!tu(t),ba=t=>gt(t)&&$e(t.cancel)&&$e(t.getReader)&&!tu(t),xy=t=>gt(t)&&$e(t.end)&&$e(t.write)&&gy(t.writable)&&!tu(t),ru=t=>gt(t)&&$e(t.read)&&$e(t.pipe)&&gy(t.readable)&&!tu(t),wy=t=>gt(t)&&$e(t.clear)&&$e(t.bytes)&&$e(t.position)&&$e(t.setPosition)&&$e(t.capacity)&&$e(t.getBufferIdentifier)&&$e(t.createLong)});var sd={};Z(sd,{compareArrayLike:()=>nd,joinUint8Arrays:()=>$t,memcpy:()=>ga,rebaseValueOffsets:()=>nu,toArrayBufferView:()=>Q,toArrayBufferViewAsyncIterator:()=>Tr,toArrayBufferViewIterator:()=>Vr,toBigInt64Array:()=>ya,toBigUint64Array:()=>jL,toFloat32Array:()=>zL,toFloat32ArrayAsyncIterator:()=>iS,toFloat32ArrayIterator:()=>YL,toFloat64Array:()=>WL,toFloat64ArrayAsyncIterator:()=>oS,toFloat64ArrayIterator:()=>ZL,toInt16Array:()=>VL,toInt16ArrayAsyncIterator:()=>tS,toInt16ArrayIterator:()=>KL,toInt32Array:()=>Qs,toInt32ArrayAsyncIterator:()=>rS,toInt32ArrayIterator:()=>HL,toInt8Array:()=>GL,toInt8ArrayAsyncIterator:()=>eS,toInt8ArrayIterator:()=>qL,toUint16Array:()=>UL,toUint16ArrayAsyncIterator:()=>nS,toUint16ArrayIterator:()=>XL,toUint32Array:()=>PL,toUint32ArrayAsyncIterator:()=>sS,toUint32ArrayIterator:()=>JL,toUint8Array:()=>D,toUint8ArrayAsyncIterator:()=>rd,toUint8ArrayIterator:()=>td,toUint8ClampedArray:()=>$L,toUint8ClampedArrayAsyncIterator:()=>aS,toUint8ClampedArrayIterator:()=>QL});function kL(t){let e=t[0]?[t[0]]:[],r,n,s,i;for(let o,a,c=0,u=0,f=t.length;++c<f;){if(o=e[u],a=t[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(e[++u]=a);continue}if({byteOffset:r,byteLength:s}=o,{byteOffset:n,byteLength:i}=a,r+s<n||n+i<r){a&&(e[++u]=a);continue}e[u]=new Uint8Array(o.buffer,r,n-r+i)}return e}function ga(t,e,r=0,n=e.byteLength){let s=t.byteLength,i=new Uint8Array(t.buffer,t.byteOffset,s),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,s));return i.set(o,r),t}function $t(t,e){let r=kL(t),n=r.reduce((f,l)=>f+l.byteLength,0),s,i,o,a=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,n);for(let f=r.length;++c<f;){if(s=r[c],i=s.subarray(0,Math.min(s.length,u-a)),u<=a+i.length){i.length<s.length?r[c]=s.subarray(i.length):i.length===s.length&&c++,o?ga(o,i,a):o=i;break}ga(o||(o=new Uint8Array(u)),i,a),a+=i.length}return[o||new Uint8Array(0),r.slice(c),n-(o?o.byteLength:0)]}function Q(t,e){let r=Zc(e)?e.value:e;return r instanceof t?t===Uint8Array?new t(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=zt(r)),r instanceof ArrayBuffer?new t(r):r instanceof ed?new t(r):wy(r)?Q(t,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new t(0):new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):t.from(r)):new t(0)}function*Vr(t,e){let r=function*(s){yield s},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ed?r(e):wr(e)?e:r(e);return yield*Ql((function*(s){let i=null;do i=s.next(yield Q(t,i));while(!i.done)})(n[Symbol.iterator]())),new t}function Tr(t,e){return bt(this,arguments,function*(){if(Wt(e))return yield H(yield H(yield*so(jt(Tr(t,yield H(e))))));let n=function(o){return bt(this,arguments,function*(){yield yield H(yield H(o))})},s=function(o){return bt(this,arguments,function*(){yield H(yield*so(jt(Ql((function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)})(o[Symbol.iterator]())))))})},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ed?n(e):wr(e)?s(e):ur(e)?e:n(e);return yield H(yield*so(jt(Ql((function(o){return bt(this,arguments,function*(){let a=null;do a=yield H(o.next(yield yield H(Q(t,a))));while(!a.done)})})(i[Symbol.asyncIterator]()))))),yield H(new t)})}function nu(t,e,r){if(t!==0){r=r.slice(0,e);let n=typeof r[0]=="bigint"?BigInt(t):t;for(let s=-1,i=r.length;++s<i;)r[s]+=n}return r.subarray(0,e)}function nd(t,e){let r=0,n=t.length;if(n!==e.length)return!1;if(n>0)do if(t[r]!==e[r])return!1;while(++r<n);return!0}var ed,GL,VL,Qs,ya,D,UL,PL,jL,zL,WL,$L,Ql,qL,KL,HL,td,XL,JL,YL,ZL,QL,eS,tS,rS,rd,nS,sS,iS,oS,aS,qe=p(()=>{Bt();an();Un();ed=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;GL=t=>Q(Int8Array,t),VL=t=>Q(Int16Array,t),Qs=t=>Q(Int32Array,t),ya=t=>Q(BigInt64Array,t),D=t=>Q(Uint8Array,t),UL=t=>Q(Uint16Array,t),PL=t=>Q(Uint32Array,t),jL=t=>Q(BigUint64Array,t),zL=t=>Q(Float32Array,t),WL=t=>Q(Float64Array,t),$L=t=>Q(Uint8ClampedArray,t),Ql=t=>(t.next(),t);qL=t=>Vr(Int8Array,t),KL=t=>Vr(Int16Array,t),HL=t=>Vr(Int32Array,t),td=t=>Vr(Uint8Array,t),XL=t=>Vr(Uint16Array,t),JL=t=>Vr(Uint32Array,t),YL=t=>Vr(Float32Array,t),ZL=t=>Vr(Float64Array,t),QL=t=>Vr(Uint8ClampedArray,t);eS=t=>Tr(Int8Array,t),tS=t=>Tr(Int16Array,t),rS=t=>Tr(Int32Array,t),rd=t=>Tr(Uint8Array,t),nS=t=>Tr(Uint16Array,t),sS=t=>Tr(Uint32Array,t),iS=t=>Tr(Float32Array,t),oS=t=>Tr(Float64Array,t),aS=t=>Tr(Uint8ClampedArray,t)});function*cS(t){let e,r=!1,n=[],s,i,o,a=0;function c(){return i==="peek"?$t(n,o)[0]:([s,n,a]=$t(n,o),s)}({cmd:i,size:o}=(yield null)||{cmd:"read",size:0});let u=td(t)[Symbol.iterator]();try{do if({done:e,value:s}=Number.isNaN(o-a)?u.next():u.next(o-a),!e&&s.byteLength>0&&(n.push(s),a+=s.byteLength),e||o<=a)do({cmd:i,size:o}=yield c());while(o<a);while(!e)}catch(f){r=!0,typeof u.throw=="function"&&u.throw(f)}finally{r===!1&&typeof u.return=="function"&&u.return(null)}return null}function uS(t){return bt(this,arguments,function*(){let r,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?$t(s,a)[0]:([i,s,c]=$t(s,a),i)}({cmd:o,size:a}=(yield yield H(null))||{cmd:"read",size:0});let f=rd(t)[Symbol.asyncIterator]();try{do if({done:r,value:i}=Number.isNaN(a-c)?yield H(f.next()):yield H(f.next(a-c)),!r&&i.byteLength>0&&(s.push(i),c+=i.byteLength),r||a<=c)do({cmd:o,size:a}=yield yield H(u()));while(a<c);while(!r)}catch(l){n=!0,typeof f.throw=="function"&&(yield H(f.throw(l)))}finally{n===!1&&typeof f.return=="function"&&(yield H(f.return(new Uint8Array(0))))}return yield H(null)})}function fS(t){return bt(this,arguments,function*(){let r=!1,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?$t(s,a)[0]:([i,s,c]=$t(s,a),i)}({cmd:o,size:a}=(yield yield H(null))||{cmd:"read",size:0});let f=new od(t);try{do if({done:r,value:i}=Number.isNaN(a-c)?yield H(f.read()):yield H(f.read(a-c)),!r&&i.byteLength>0&&(s.push(D(i)),c+=i.byteLength),r||a<=c)do({cmd:o,size:a}=yield yield H(u()));while(a<c);while(!r)}catch(l){n=!0,yield H(f.cancel(l))}finally{n===!1?yield H(f.cancel()):t.locked&&f.releaseLock()}return yield H(null)})}function lS(t){return bt(this,arguments,function*(){let r=[],n="error",s=!1,i=null,o,a,c=0,u=[],f;function l(){return o==="peek"?$t(u,a)[0]:([f,u,c]=$t(u,a),f)}if({cmd:o,size:a}=(yield yield H(null))||{cmd:"read",size:0},t.isTTY)return yield yield H(new Uint8Array(0)),yield H(null);try{r[0]=id(t,"end"),r[1]=id(t,"error");do{if(r[2]=id(t,"readable"),[n,i]=yield H(Promise.race(r.map(h=>h[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(f=D(t.read(a-c)),f.byteLength<a-c&&(f=D(t.read()))):f=D(t.read()),f.byteLength>0&&(u.push(f),c+=f.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield H(l()));while(a<c)}while(!s)}finally{yield H(d(r,n==="error"?i:null))}return yield H(null);function d(h,m){return f=u=null,new Promise((b,x)=>{for(let[g,w]of h)t.off(g,w);try{let g=t.destroy;g&&g.call(t,m),m=void 0}catch(g){m=g||m}finally{m!=null?x(m):b()}})}})}var Je,su,od,id,xa=p(()=>{Bt();qe();Je={fromIterable(t){return su(cS(t))},fromAsyncIterable(t){return su(uS(t))},fromDOMStream(t){return su(fS(t))},fromNodeStream(t){return su(lS(t))},toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}},su=t=>(t.next(),t);od=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return B(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return B(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=D(r)),r})}},id=(t,e)=>{let r=s=>n([e,s]),n;return[e,r,new Promise(s=>(n=s)&&t.once(e,r))]}});var me,iu=p(()=>{(function(t){t[t.V1=0]="V1",t[t.V2=1]="V2",t[t.V3=2]="V3",t[t.V4=3]="V4",t[t.V5=4]="V5"})(me||(me={}))});var de,ad=p(()=>{(function(t){t[t.Sparse=0]="Sparse",t[t.Dense=1]="Dense"})(de||(de={}))});var ue,cd=p(()=>{(function(t){t[t.HALF=0]="HALF",t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE"})(ue||(ue={}))});var ge,ud=p(()=>{(function(t){t[t.DAY=0]="DAY",t[t.MILLISECOND=1]="MILLISECOND"})(ge||(ge={}))});var S,wa=p(()=>{(function(t){t[t.SECOND=0]="SECOND",t[t.MILLISECOND=1]="MILLISECOND",t[t.MICROSECOND=2]="MICROSECOND",t[t.NANOSECOND=3]="NANOSECOND"})(S||(S={}))});var ie,fd=p(()=>{(function(t){t[t.YEAR_MONTH=0]="YEAR_MONTH",t[t.DAY_TIME=1]="DAY_TIME",t[t.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ie||(ie={}))});var ou=p(()=>{});var Ur,au,cu,oo,ld=p(()=>{Ur=new Int32Array(2),au=new Float32Array(Ur.buffer),cu=new Float64Array(Ur.buffer),oo=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Ta,dd=p(()=>{(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})(Ta||(Ta={}))});var Ye,hd=p(()=>{ou();dd();ld();Ye=class t{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new t(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Ur[0]=this.readInt32(e),au[0]}readFloat64(e){return Ur[oo?0:1]=this.readInt32(e),Ur[oo?1:0]=this.readInt32(e+4),cu[0]}writeInt8(e,r){this.bytes_[e]=r}writeUint8(e,r){this.bytes_[e]=r}writeInt16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeUint16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeInt32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeUint32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeInt64(e,r){this.writeInt32(e,Number(BigInt.asIntN(32,r))),this.writeInt32(e+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(e,r){this.writeUint32(e,Number(BigInt.asUintN(32,r))),this.writeUint32(e+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(e,r){au[0]=r,this.writeInt32(e,Ur[0])}writeFloat64(e,r){cu[0]=r,this.writeInt32(e,Ur[oo?0:1]),this.writeInt32(e+4,Ur[oo?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let r=0;r<4;r++)e+=String.fromCharCode(this.readInt8(this.position_+4+r));return e}__offset(e,r){let n=e-this.readInt32(e);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(e,r){return e.bb_pos=r+this.readInt32(r),e.bb=this,e}__string(e,r){e+=this.readInt32(e);let n=this.readInt32(e);e+=4;let s=this.bytes_.subarray(e,e+n);return r===Ta.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(e,r){return typeof e=="string"?this.__string(r):this.__union(e,r)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let r=0;r<4;r++)if(e.charCodeAt(r)!=this.readInt8(this.position()+4+r))return!1;return!0}createScalarList(e,r){let n=[];for(let s=0;s<r;++s){let i=e(s);i!==null&&n.push(i)}return n}createObjList(e,r){let n=[];for(let s=0;s<r;++s){let i=e(s);i!==null&&n.push(i.unpack())}return n}}});var ei,Ty=p(()=>{hd();ou();ei=class t{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;e?r=e:r=1024,this.bb=Ye.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,r){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+r)+1&e-1;for(;this.space<n+e+r;){let s=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)}pad(e){for(let r=0;r<e;r++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(e))}addFieldInt16(e,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(e))}addFieldInt32(e,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(e))}addFieldInt64(e,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(e))}addFieldFloat32(e,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(e))}addFieldFloat64(e,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(e))}addFieldOffset(e,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(e))}addFieldStruct(e,r,n){r!=n&&(this.nested(r),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let r=e.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,s=Ye.allocate(n);return s.setPosition(n-r),s.bytes().set(e.bytes(),n-r),s}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let r=0;r<e;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let n=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?e-this.vtable[r]:0);let s=2;this.addInt16(e-this.object_start);let i=(n+s)*2;this.addInt16(i);let o=0,a=this.space;e:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];if(i==this.bb.readInt16(c)){for(let u=2;u<i;u+=2)if(this.bb.readInt16(a+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[r];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,r,n){let s=n?4:0;if(r){let i=r;if(this.prep(this.minalign,8+s),i.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(i.charCodeAt(o))}this.prep(this.minalign,4+s),this.addOffset(e),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,r){this.finish(e,r,!0)}requiredField(e,r){let n=this.bb.capacity()-e,s=n-this.bb.readInt32(n);if(!(r<this.bb.readInt16(s)&&this.bb.readInt16(s+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(e,r,n){this.notNested(),this.vector_num_elems=r,this.prep(4,e*r),this.prep(n,e*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let r=this.createString(e);return this.string_maps.set(e,r),r}createString(e){if(e==null)return 0;let r;return e instanceof Uint8Array?r=e:r=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let r=[];for(let n=0;n<e.length;++n){let s=e[n];if(s!==null)r.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(e,r){return r(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var oe=p(()=>{ou();ld();Ty();hd();dd()});var ti,pd=p(()=>{(function(t){t[t.BUFFER=0]="BUFFER"})(ti||(ti={}))});var Ze,ao=p(()=>{(function(t){t[t.LZ4_FRAME=0]="LZ4_FRAME",t[t.ZSTD=1]="ZSTD"})(Ze||(Ze={}))});var cn,md=p(()=>{oe();pd();ao();cn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBodyCompression(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Ze.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):ti.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,r){e.addFieldInt8(0,r,Ze.LZ4_FRAME)}static addMethod(e,r){e.addFieldInt8(1,r,ti.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,r,n){return t.startBodyCompression(e),t.addCodec(e,r),t.addMethod(e,n),t.endBodyCompression(e)}}});var co,bd=p(()=>{co=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,r,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var uo,gd=p(()=>{uo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,r,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var st,yd=p(()=>{oe();md();bd();gd();st=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsRecordBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new uo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new co).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new cn).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addNodes(e,r){e.addFieldOffset(1,r,0)}static startNodesVector(e,r){e.startVector(16,r,8)}static addBuffers(e,r){e.addFieldOffset(2,r,0)}static startBuffersVector(e,r){e.startVector(16,r,8)}static addCompression(e,r){e.addFieldOffset(3,r,0)}static addVariadicBufferCounts(e,r){e.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(e,r){e.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)e.addInt64(r[n]);return e.endVector()}static startVariadicBufferCountsVector(e,r){e.startVector(8,r,8)}static endRecordBatch(e){return e.endObject()}}});var un,_y=p(()=>{oe();yd();un=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new st).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addData(e,r){e.addFieldOffset(1,r,0)}static addIsDelta(e,r){e.addFieldInt8(2,+r,0)}static endDictionaryBatch(e){return e.endObject()}}});var Pn,xd=p(()=>{(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(Pn||(Pn={}))});var _a,Ay=p(()=>{(function(t){t[t.DenseArray=0]="DenseArray"})(_a||(_a={}))});var Ar,fu=p(()=>{oe();Ar=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInt(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,r){e.addFieldInt32(0,r,0)}static addIsSigned(e,r){e.addFieldInt8(1,+r,0)}static endInt(e){return e.endObject()}static createInt(e,r,n){return t.startInt(e),t.addBitWidth(e,r),t.addIsSigned(e,n),t.endInt(e)}}});var Pr,wd=p(()=>{oe();Ay();fu();Pr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryEncoding(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Ar).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):_a.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addIndexType(e,r){e.addFieldOffset(1,r,0)}static addIsOrdered(e,r){e.addFieldInt8(2,+r,0)}static addDictionaryKind(e,r){e.addFieldInt16(3,r,_a.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Be,fo=p(()=>{oe();Be=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsKeyValue(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}key(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}value(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,r){e.addFieldOffset(0,r,0)}static addValue(e,r){e.addFieldOffset(1,r,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,r,n){return t.startKeyValue(e),t.addKey(e,r),t.addValue(e,n),t.endKeyValue(e)}}});var Aa,vy=p(()=>{oe();Aa=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return t.startBinary(e),t.endBinary(e)}}});var va,Iy=p(()=>{oe();va=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinaryView(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return t.startBinaryView(e),t.endBinaryView(e)}}});var Ia,Ly=p(()=>{oe();Ia=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBool(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return t.startBool(e),t.endBool(e)}}});var jn,Td=p(()=>{oe();ud();jn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDate(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ge.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,ge.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,r){return t.startDate(e),t.addUnit(e,r),t.endDate(e)}}});var jr,_d=p(()=>{oe();jr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDecimal(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,r){e.addFieldInt32(0,r,0)}static addScale(e,r){e.addFieldInt32(1,r,0)}static addBitWidth(e,r){e.addFieldInt32(2,r,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,r,n,s){return t.startDecimal(e),t.addPrecision(e,r),t.addScale(e,n),t.addBitWidth(e,s),t.endDecimal(e)}}});var zn,Ad=p(()=>{oe();wa();zn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDuration(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):S.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,S.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,r){return t.startDuration(e),t.addUnit(e,r),t.endDuration(e)}}});var Wn,vd=p(()=>{oe();Wn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,r){return t.startFixedSizeBinary(e),t.addByteWidth(e,r),t.endFixedSizeBinary(e)}}});var $n,Id=p(()=>{oe();$n=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,r){return t.startFixedSizeList(e),t.addListSize(e,r),t.endFixedSizeList(e)}}});var qn,Ld=p(()=>{oe();cd();qn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFloatingPoint(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ue.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,r){e.addFieldInt16(0,r,ue.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,r){return t.startFloatingPoint(e),t.addPrecision(e,r),t.endFloatingPoint(e)}}});var Kn,Sd=p(()=>{oe();fd();Kn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInterval(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ie.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,ie.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,r){return t.startInterval(e),t.addUnit(e,r),t.endInterval(e)}}});var La,Sy=p(()=>{oe();La=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return t.startLargeBinary(e),t.endLargeBinary(e)}}});var Sa,Ey=p(()=>{oe();Sa=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return t.startLargeList(e),t.endLargeList(e)}}});var Ea,By=p(()=>{oe();Ea=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return t.startLargeUtf8(e),t.endLargeUtf8(e)}}});var Ba,Fy=p(()=>{oe();Ba=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return t.startList(e),t.endList(e)}}});var Hn,Ed=p(()=>{oe();Hn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMap(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,r){e.addFieldInt8(0,+r,0)}static endMap(e){return e.endObject()}static createMap(e,r){return t.startMap(e),t.addKeysSorted(e,r),t.endMap(e)}}});var Fa,Oy=p(()=>{oe();Fa=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsNull(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return t.startNull(e),t.endNull(e)}}});var Oa,My=p(()=>{oe();Oa=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsStruct_(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return t.startStruct_(e),t.endStruct_(e)}}});var fn,Bd=p(()=>{oe();wa();fn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTime(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):S.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,S.MILLISECOND)}static addBitWidth(e,r){e.addFieldInt32(1,r,32)}static endTime(e){return e.endObject()}static createTime(e,r,n){return t.startTime(e),t.addUnit(e,r),t.addBitWidth(e,n),t.endTime(e)}}});var ln,Fd=p(()=>{oe();wa();ln=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTimestamp(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):S.SECOND}timezone(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,S.SECOND)}static addTimezone(e,r){e.addFieldOffset(1,r,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,r,n){return t.startTimestamp(e),t.addUnit(e,r),t.addTimezone(e,n),t.endTimestamp(e)}}});var vr,Od=p(()=>{oe();ad();vr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUnion(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):de.Sparse}typeIds(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,r){e.addFieldInt16(0,r,de.Sparse)}static addTypeIds(e,r){e.addFieldOffset(1,r,0)}static createTypeIdsVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addInt32(r[n]);return e.endVector()}static startTypeIdsVector(e,r){e.startVector(4,r,4)}static endUnion(e){return e.endObject()}static createUnion(e,r,n){return t.startUnion(e),t.addMode(e,r),t.addTypeIds(e,n),t.endUnion(e)}}});var Ma,Ry=p(()=>{oe();Ma=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return t.startUtf8(e),t.endUtf8(e)}}});var Ra,Dy=p(()=>{oe();Ra=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8View(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return t.startUtf8View(e),t.endUtf8View(e)}}});var P,lu=p(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.FloatingPoint=3]="FloatingPoint",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct_=13]="Struct_",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.RunEndEncoded=22]="RunEndEncoded",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.ListView=25]="ListView",t[t.LargeListView=26]="LargeListView"})(P||(P={}))});var it,Md=p(()=>{oe();wd();fo();lu();it=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsField(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):P.NONE}type(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(e,this.bb_pos+r):null}dictionary(e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new Pr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(e,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,r){e.addFieldOffset(0,r,0)}static addNullable(e,r){e.addFieldInt8(1,+r,0)}static addTypeType(e,r){e.addFieldInt8(2,r,P.NONE)}static addType(e,r){e.addFieldOffset(3,r,0)}static addDictionary(e,r){e.addFieldOffset(4,r,0)}static addChildren(e,r){e.addFieldOffset(5,r,0)}static createChildrenVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startChildrenVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(6,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endField(e){return e.endObject()}}});var Ft,Rd=p(()=>{oe();xd();Md();fo();Ft=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsSchema(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Pn.Little}fields(e,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new it).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,r){e.addFieldInt16(0,r,Pn.Little)}static addFields(e,r){e.addFieldOffset(1,r,0)}static createFieldsVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startFieldsVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(2,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static addFeatures(e,r){e.addFieldOffset(3,r,0)}static createFeaturesVector(e,r){e.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)e.addInt64(r[n]);return e.endVector()}static startFeaturesVector(e,r){e.startVector(8,r,8)}static endSchema(e){return e.endObject()}static createSchema(e,r,n,s,i){return t.startSchema(e),t.addEndianness(e,r),t.addFields(e,n),t.addCustomMetadata(e,s),t.addFeatures(e,i),t.endSchema(e)}}});var ne,du=p(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor",t[t.SparseTensor=5]="SparseTensor"})(ne||(ne={}))});var y,te,Fe=p(()=>{iu();ad();cd();ud();wa();fd();du();(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t[t.DurationSecond=-27]="DurationSecond",t[t.DurationMillisecond=-28]="DurationMillisecond",t[t.DurationMicrosecond=-29]="DurationMicrosecond",t[t.DurationNanosecond=-30]="DurationNanosecond",t[t.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(y||(y={}));(function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"})(te||(te={}))});var Dd={};Z(Dd,{valueToString:()=>Ir});function Ir(t){if(t===null)return"null";if(t===void 0)return"undefined";switch(typeof t){case"number":return`${t}`;case"bigint":return`${t}`;case"string":return`"${t}"`}return typeof t[Symbol.toPrimitive]=="function"?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?t instanceof BigInt64Array||t instanceof BigUint64Array?`[${[...t].map(e=>Ir(e))}]`:`[${t}]`:ArrayBuffer.isView(t)?`[${t}]`:JSON.stringify(t,(e,r)=>typeof r=="bigint"?`${r}`:r)}var Da=p(()=>{});function ee(t){if(typeof t=="bigint"&&(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER))throw new TypeError(`${t} is not safe to convert to a number.`);return Number(t)}function Nd(t,e){return ee(t/e)+ee(t%e)/ee(e)}var zr=p(()=>{});var Gd={};Z(Gd,{BN:()=>ri,bigNumToBigInt:()=>Cy,bigNumToNumber:()=>kd,bigNumToString:()=>po,isArrowBigNumSymbol:()=>Ny});function Lr(t,...e){return e.length===0?Object.setPrototypeOf(Q(this.TypedArray,t),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(t,...e),this.constructor.prototype)}function lo(...t){return Lr.apply(this,t)}function ho(...t){return Lr.apply(this,t)}function Na(...t){return Lr.apply(this,t)}function kd(t,e){let{buffer:r,byteOffset:n,byteLength:s,signed:i}=t,o=new BigUint64Array(r,n,s/8),a=i&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(a){for(let f of o)c|=(f^hS)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let f of o)c|=f*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let f=BigInt("1".padEnd(e+1,"0")),l=c/f,d=a?-(c%f):c%f,h=ee(l),m=`${d}`.padStart(e,"0");return+`${a&&h===0?"-":""}${h}.${m}`}return ee(c)}function po(t){if(t.byteLength===8)return`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`;if(!t.signed)return Cd(t);let e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return Cd(t);e=e.slice();let n=1;for(let i=0;i<e.length;i++){let o=e[i],a=~o+n;e[i]=a,n&=o===0?1:0}return`-${Cd(e)}`}function Cy(t){return t.byteLength===8?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:po(t)}function Cd(t){let e="",r=new Uint32Array(2),n=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),i=-1,o=n.length-1;do{for(r[0]=n[i=0];i<o;)n[i++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[i];n[i]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,e=`${r[0]}${e}`}while(s[0]||s[1]||s[2]||s[3]);return e??"0"}var Ny,dS,hS,ri,hu=p(()=>{qe();zr();Ny=Symbol.for("isArrowBigNum");Lr.prototype[Ny]=!0;Lr.prototype.toJSON=function(){return`"${po(this)}"`};Lr.prototype.valueOf=function(t){return kd(this,t)};Lr.prototype.toString=function(){return po(this)};Lr.prototype[Symbol.toPrimitive]=function(t="default"){switch(t){case"number":return kd(this);case"string":return po(this);case"default":return Cy(this)}return po(this)};Object.setPrototypeOf(lo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(ho.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Na.prototype,Object.create(Uint32Array.prototype));Object.assign(lo.prototype,Lr.prototype,{constructor:lo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(ho.prototype,Lr.prototype,{constructor:ho,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Na.prototype,Lr.prototype,{constructor:Na,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});dS=BigInt(4294967296)*BigInt(4294967296),hS=dS-BigInt(1);ri=class t{static new(e,r){switch(r){case!0:return new lo(e);case!1:return new ho(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new lo(e)}return e.byteLength===16?new Na(e):new ho(e)}static signed(e){return new lo(e)}static unsigned(e){return new ho(e)}static decimal(e){return new Na(e)}constructor(e,r){return t.new(e,r)}}});function Qt(t){let e=t;switch(t.typeId){case y.Decimal:return t.bitWidth/32;case y.Interval:return e.unit===ie.MONTH_DAY_NANO?4:1+e.unit;case y.BinaryView:case y.Utf8View:return 16;case y.FixedSizeList:return e.listSize;case y.FixedSizeBinary:return e.byteWidth;default:return 1}}var ky,Gy,Vy,Uy,Py,jy,zy,Wy,$y,qy,Ky,Hy,Xy,Jy,Yy,Zy,Qy,ex,tx,rx,nx,sx,ix,ox,ax,cx,L,Ne,Ee,qt,Kt,ke,Ht,Xt,Jt,yt,Sr,ot,Er,xt,Yt,Ot,J,Br,at,wt,Fr,ct,Mt,Tt,Xn,Jn,Qe,Yn,Zn,Qn,es,et,ts,Wr,rs,ns,ut,ss,is,Ca,_t,ka,Ga,Va,Ua,Ue,Zt,he,At,dn,os,Rt,Se,ft,pS,Pe,ye=p(()=>{zr();Fe();cx=Symbol.for("apache-arrow/DataType"),L=class t{static isDataType(e){return e?.[cx]===!0}static isNull(e){return e?.typeId===y.Null}static isInt(e){return e?.typeId===y.Int}static isFloat(e){return e?.typeId===y.Float}static isBinary(e){return e?.typeId===y.Binary}static isBinaryView(e){return e?.typeId===y.BinaryView}static isLargeBinary(e){return e?.typeId===y.LargeBinary}static isUtf8(e){return e?.typeId===y.Utf8}static isUtf8View(e){return e?.typeId===y.Utf8View}static isLargeUtf8(e){return e?.typeId===y.LargeUtf8}static isBool(e){return e?.typeId===y.Bool}static isDecimal(e){return e?.typeId===y.Decimal}static isDate(e){return e?.typeId===y.Date}static isTime(e){return e?.typeId===y.Time}static isTimestamp(e){return e?.typeId===y.Timestamp}static isInterval(e){return e?.typeId===y.Interval}static isDuration(e){return e?.typeId===y.Duration}static isList(e){return e?.typeId===y.List}static isLargeList(e){return e?.typeId===y.LargeList}static isStruct(e){return e?.typeId===y.Struct}static isUnion(e){return e?.typeId===y.Union}static isFixedSizeBinary(e){return e?.typeId===y.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===y.FixedSizeList}static isMap(e){return e?.typeId===y.Map}static isDictionary(e){return e?.typeId===y.Dictionary}static isDenseUnion(e){return t.isUnion(e)&&e.mode===de.Dense}static isSparseUnion(e){return t.isUnion(e)&&e.mode===de.Sparse}constructor(e){this.typeId=e}};ky=Symbol.toStringTag;L[ky]=(t=>(t.children=null,t.ArrayType=Array,t.OffsetArrayType=Int32Array,t[cx]=!0,t[Symbol.toStringTag]="DataType"))(L.prototype);Ne=class extends L{constructor(){super(y.Null)}toString(){return"Null"}};Gy=Symbol.toStringTag;Ne[Gy]=(t=>t[Symbol.toStringTag]="Null")(Ne.prototype);Ee=class extends L{constructor(e,r){super(y.Int),this.isSigned=e,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};Vy=Symbol.toStringTag;Ee[Vy]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(Ee.prototype);qt=class extends Ee{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Kt=class extends Ee{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ke=class extends Ee{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Ht=class extends Ee{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Xt=class extends Ee{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Jt=class extends Ee{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},yt=class extends Ee{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Sr=class extends Ee{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(qt.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Kt.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ke.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Ht.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Xt.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Jt.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(yt.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Sr.prototype,"ArrayType",{value:BigUint64Array});ot=class extends L{constructor(e){super(y.Float),this.precision=e}get ArrayType(){switch(this.precision){case ue.HALF:return Uint16Array;case ue.SINGLE:return Float32Array;case ue.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Uy=Symbol.toStringTag;ot[Uy]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(ot.prototype);Er=class extends ot{constructor(){super(ue.HALF)}},xt=class extends ot{constructor(){super(ue.SINGLE)}},Yt=class extends ot{constructor(){super(ue.DOUBLE)}};Object.defineProperty(Er.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(xt.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Yt.prototype,"ArrayType",{value:Float64Array});Ot=class extends L{constructor(){super(y.Binary)}toString(){return"Binary"}};Py=Symbol.toStringTag;Ot[Py]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(Ot.prototype);J=class extends L{constructor(){super(y.BinaryView)}toString(){return"BinaryView"}};jy=Symbol.toStringTag;J.ELEMENT_WIDTH=16;J.INLINE_CAPACITY=12;J.LENGTH_OFFSET=0;J.INLINE_OFFSET=4;J.BUFFER_INDEX_OFFSET=8;J.BUFFER_OFFSET_OFFSET=12;J[jy]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="BinaryView"))(J.prototype);Br=class extends L{constructor(){super(y.LargeBinary)}toString(){return"LargeBinary"}};zy=Symbol.toStringTag;Br[zy]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeBinary"))(Br.prototype);at=class extends L{constructor(){super(y.Utf8)}toString(){return"Utf8"}};Wy=Symbol.toStringTag;at[Wy]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(at.prototype);wt=class extends L{constructor(){super(y.Utf8View)}toString(){return"Utf8View"}};$y=Symbol.toStringTag;wt.ELEMENT_WIDTH=J.ELEMENT_WIDTH;wt.INLINE_CAPACITY=J.INLINE_CAPACITY;wt[$y]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8View"))(wt.prototype);Fr=class extends L{constructor(){super(y.LargeUtf8)}toString(){return"LargeUtf8"}};qy=Symbol.toStringTag;Fr[qy]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeUtf8"))(Fr.prototype);ct=class extends L{constructor(){super(y.Bool)}toString(){return"Bool"}};Ky=Symbol.toStringTag;ct[Ky]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(ct.prototype);Mt=class extends L{constructor(e,r,n=128){super(y.Decimal),this.scale=e,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Hy=Symbol.toStringTag;Mt[Hy]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(Mt.prototype);Tt=class extends L{constructor(e){super(y.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ge[this.unit]}>`}get ArrayType(){return this.unit===ge.DAY?Int32Array:BigInt64Array}};Xy=Symbol.toStringTag;Tt[Xy]=(t=>(t.unit=null,t[Symbol.toStringTag]="Date"))(Tt.prototype);Xn=class extends Tt{constructor(){super(ge.DAY)}},Jn=class extends Tt{constructor(){super(ge.MILLISECOND)}},Qe=class extends L{constructor(e,r){super(y.Time),this.unit=e,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${S[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Jy=Symbol.toStringTag;Qe[Jy]=(t=>(t.unit=null,t.bitWidth=null,t[Symbol.toStringTag]="Time"))(Qe.prototype);Yn=class extends Qe{constructor(){super(S.SECOND,32)}},Zn=class extends Qe{constructor(){super(S.MILLISECOND,32)}},Qn=class extends Qe{constructor(){super(S.MICROSECOND,64)}},es=class extends Qe{constructor(){super(S.NANOSECOND,64)}},et=class extends L{constructor(e,r){super(y.Timestamp),this.unit=e,this.timezone=r}toString(){return`Timestamp<${S[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Yy=Symbol.toStringTag;et[Yy]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Timestamp"))(et.prototype);ts=class extends et{constructor(e){super(S.SECOND,e)}},Wr=class extends et{constructor(e){super(S.MILLISECOND,e)}},rs=class extends et{constructor(e){super(S.MICROSECOND,e)}},ns=class extends et{constructor(e){super(S.NANOSECOND,e)}},ut=class extends L{constructor(e){super(y.Interval),this.unit=e}toString(){return`Interval<${ie[this.unit]}>`}};Zy=Symbol.toStringTag;ut[Zy]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(ut.prototype);ss=class extends ut{constructor(){super(ie.DAY_TIME)}},is=class extends ut{constructor(){super(ie.YEAR_MONTH)}},Ca=class extends ut{constructor(){super(ie.MONTH_DAY_NANO)}},_t=class extends L{constructor(e){super(y.Duration),this.unit=e}toString(){return`Duration<${S[this.unit]}>`}};Qy=Symbol.toStringTag;_t[Qy]=(t=>(t.unit=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Duration"))(_t.prototype);ka=class extends _t{constructor(){super(S.SECOND)}},Ga=class extends _t{constructor(){super(S.MILLISECOND)}},Va=class extends _t{constructor(){super(S.MICROSECOND)}},Ua=class extends _t{constructor(){super(S.NANOSECOND)}},Ue=class extends L{constructor(e){super(y.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ex=Symbol.toStringTag;Ue[ex]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(Ue.prototype);Zt=class extends L{constructor(e){super(y.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};tx=Symbol.toStringTag;Zt[tx]=(t=>(t.children=null,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeList"))(Zt.prototype);he=class extends L{constructor(e){super(y.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};rx=Symbol.toStringTag;he[rx]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(he.prototype);At=class extends L{constructor(e,r,n){super(y.Union),this.mode=e,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((s,i,o)=>(s[i]=o)&&s||s,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};nx=Symbol.toStringTag;At[nx]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(At.prototype);dn=class extends At{constructor(e,r){super(de.Dense,e,r)}},os=class extends At{constructor(e,r){super(de.Sparse,e,r)}},Rt=class extends L{constructor(e){super(y.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};sx=Symbol.toStringTag;Rt[sx]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(Rt.prototype);Se=class extends L{constructor(e,r){super(y.FixedSizeList),this.listSize=e,this.children=[r]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};ix=Symbol.toStringTag;Se[ix]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(Se.prototype);ft=class extends L{constructor(e,r=!1){var n,s,i;if(super(y.Map),this.children=[e],this.keysSorted=r,e&&(e.name="entries",!((n=e?.type)===null||n===void 0)&&n.children)){let o=(s=e?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");let a=(i=e?.type)===null||i===void 0?void 0:i.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};ox=Symbol.toStringTag;ft[ox]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(ft.prototype);pS=(t=>()=>++t)(-1),Pe=class extends L{constructor(e,r,n,s){super(y.Dictionary),this.indices=r,this.dictionary=e,this.isOrdered=s||!1,this.id=n==null?pS():ee(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};ax=Symbol.toStringTag;Pe[ax]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(Pe.prototype)});function mS(t,e,r=!0){return typeof e=="number"?mo(t,e,r):typeof e=="string"&&e in y?mo(t,y[e],r):e&&e instanceof L?mo(t,fx(e),r):e?.type&&e.type instanceof L?mo(t,fx(e.type),r):mo(t,y.NONE,r)}function mo(t,e,r=!0){let n=null;switch(e){case y.Null:n=t.visitNull;break;case y.Bool:n=t.visitBool;break;case y.Int:n=t.visitInt;break;case y.Int8:n=t.visitInt8||t.visitInt;break;case y.Int16:n=t.visitInt16||t.visitInt;break;case y.Int32:n=t.visitInt32||t.visitInt;break;case y.Int64:n=t.visitInt64||t.visitInt;break;case y.Uint8:n=t.visitUint8||t.visitInt;break;case y.Uint16:n=t.visitUint16||t.visitInt;break;case y.Uint32:n=t.visitUint32||t.visitInt;break;case y.Uint64:n=t.visitUint64||t.visitInt;break;case y.Float:n=t.visitFloat;break;case y.Float16:n=t.visitFloat16||t.visitFloat;break;case y.Float32:n=t.visitFloat32||t.visitFloat;break;case y.Float64:n=t.visitFloat64||t.visitFloat;break;case y.Utf8:n=t.visitUtf8;break;case y.LargeUtf8:n=t.visitLargeUtf8;break;case y.Utf8View:n=t.visitUtf8View||t.visitUtf8;break;case y.Binary:n=t.visitBinary;break;case y.LargeBinary:n=t.visitLargeBinary;break;case y.BinaryView:n=t.visitBinaryView||t.visitBinary;break;case y.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case y.Date:n=t.visitDate;break;case y.DateDay:n=t.visitDateDay||t.visitDate;break;case y.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case y.Timestamp:n=t.visitTimestamp;break;case y.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case y.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case y.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case y.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case y.Time:n=t.visitTime;break;case y.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case y.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case y.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case y.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case y.Decimal:n=t.visitDecimal;break;case y.List:n=t.visitList;break;case y.LargeList:n=t.visitLargeList;break;case y.Struct:n=t.visitStruct;break;case y.Union:n=t.visitUnion;break;case y.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case y.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case y.Dictionary:n=t.visitDictionary;break;case y.Interval:n=t.visitInterval;break;case y.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case y.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case y.IntervalMonthDayNano:n=t.visitIntervalMonthDayNano||t.visitInterval;break;case y.Duration:n=t.visitDuration;break;case y.DurationSecond:n=t.visitDurationSecond||t.visitDuration;break;case y.DurationMillisecond:n=t.visitDurationMillisecond||t.visitDuration;break;case y.DurationMicrosecond:n=t.visitDurationMicrosecond||t.visitDuration;break;case y.DurationNanosecond:n=t.visitDurationNanosecond||t.visitDuration;break;case y.FixedSizeList:n=t.visitFixedSizeList;break;case y.Map:n=t.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${y[e]}'`)}function fx(t){switch(t.typeId){case y.Null:return y.Null;case y.Int:{let{bitWidth:e,isSigned:r}=t;switch(e){case 8:return r?y.Int8:y.Uint8;case 16:return r?y.Int16:y.Uint16;case 32:return r?y.Int32:y.Uint32;case 64:return r?y.Int64:y.Uint64}return y.Int}case y.Float:switch(t.precision){case ue.HALF:return y.Float16;case ue.SINGLE:return y.Float32;case ue.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.LargeBinary:return y.LargeBinary;case y.BinaryView:return y.BinaryView;case y.Utf8:return y.Utf8;case y.LargeUtf8:return y.LargeUtf8;case y.Utf8View:return y.Utf8View;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(t.unit){case S.SECOND:return y.TimeSecond;case S.MILLISECOND:return y.TimeMillisecond;case S.MICROSECOND:return y.TimeMicrosecond;case S.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(t.unit){case S.SECOND:return y.TimestampSecond;case S.MILLISECOND:return y.TimestampMillisecond;case S.MICROSECOND:return y.TimestampMicrosecond;case S.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(t.unit){case ge.DAY:return y.DateDay;case ge.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(t.unit){case ie.DAY_TIME:return y.IntervalDayTime;case ie.YEAR_MONTH:return y.IntervalYearMonth;case ie.MONTH_DAY_NANO:return y.IntervalMonthDayNano}return y.Interval;case y.Duration:switch(t.unit){case S.SECOND:return y.DurationSecond;case S.MILLISECOND:return y.DurationMillisecond;case S.MICROSECOND:return y.DurationMicrosecond;case S.NANOSECOND:return y.DurationNanosecond}return y.Duration;case y.Map:return y.Map;case y.List:return y.List;case y.LargeList:return y.LargeList;case y.Struct:return y.Struct;case y.Union:switch(t.mode){case de.Dense:return y.DenseUnion;case de.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw new Error(`Unrecognized type '${y[t.typeId]}'`)}var R,Dt=p(()=>{Fe();ye();R=class{visitMany(e,...r){return e.map((n,s)=>this.visit(n,...r.map(i=>i[s])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,r=!0){return mS(this,e,r)}getVisitFnByTypeId(e,r=!0){return mo(this,e,r)}visitNull(e,...r){return null}visitBool(e,...r){return null}visitInt(e,...r){return null}visitFloat(e,...r){return null}visitUtf8(e,...r){return null}visitLargeUtf8(e,...r){return null}visitUtf8View(e,...r){return null}visitBinary(e,...r){return null}visitLargeBinary(e,...r){return null}visitBinaryView(e,...r){return null}visitFixedSizeBinary(e,...r){return null}visitDate(e,...r){return null}visitTimestamp(e,...r){return null}visitTime(e,...r){return null}visitDecimal(e,...r){return null}visitList(e,...r){return null}visitLargeList(e,...r){return null}visitStruct(e,...r){return null}visitUnion(e,...r){return null}visitDictionary(e,...r){return null}visitInterval(e,...r){return null}visitDuration(e,...r){return null}visitFixedSizeList(e,...r){return null}visitMap(e,...r){return null}};R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;R.prototype.visitIntervalMonthDayNano=null;R.prototype.visitDuration=null;R.prototype.visitDurationSecond=null;R.prototype.visitDurationMillisecond=null;R.prototype.visitDurationMicrosecond=null;R.prototype.visitDurationNanosecond=null});var Vd={};Z(Vd,{float64ToUint16:()=>Pa,uint16ToFloat64:()=>pu});function pu(t){let e=(t&31744)>>10,r=(t&1023)/1024,n=Math.pow(-1,(t&32768)>>15);switch(e){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,e-15)*(1+r)}function Pa(t){if(t!==t)return 32256;lx[0]=t;let e=(bo[1]&2147483648)>>16&65535,r=bo[1]&2146435072,n=0;return r>=1089470464?bo[0]>0?r=31744:(r=(r&2080374784)>>16,n=(bo[1]&1048575)>>10):r<=1056964608?(n=1048576+(bo[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(bo[1]&1048575)+512>>10),e|r|n&65535}var lx,bo,ja=p(()=>{lx=new Float64Array(1),bo=new Uint32Array(lx.buffer)});function W(t){return(e,r,n)=>{if(e.setValid(r,n!=null))return t(e,r,n)}}var U,bS,dx,gS,hn,Ud,hx,yS,mu,bu,Pd,px,xS,mx,wS,bx,TS,jd,gu,yu,xu,wu,zd,Tu,_u,Au,vu,Wd,$d,gx,_S,AS,vS,IS,LS,SS,ES,yx,xx,BS,qd,Iu,Lu,Su,Eu,Bu,Fu,Ou,Kd,FS,tt,er=p(()=>{lt();Dt();zr();an();ja();Fe();ye();U=class extends R{};bS=(t,e,r)=>{t[e]=Math.floor(r/864e5)},dx=(t,e,r,n)=>{if(r+1<e.length){let s=ee(e[r]),i=ee(e[r+1]);t.set(n.subarray(0,i-s),s)}},gS=({offset:t,values:e},r,n)=>{let s=t+r;n?e[s>>3]|=1<<s%8:e[s>>3]&=~(1<<s%8)},hn=({values:t},e,r)=>{t[e]=r},Ud=({values:t},e,r)=>{t[e]=r},hx=({values:t},e,r)=>{t[e]=Pa(r)},yS=(t,e,r)=>{switch(t.type.precision){case ue.HALF:return hx(t,e,r);case ue.SINGLE:case ue.DOUBLE:return Ud(t,e,r)}},mu=({values:t},e,r)=>{bS(t,e,r.valueOf())},bu=({values:t},e,r)=>{t[e]=BigInt(r)},Pd=({stride:t,values:e},r,n)=>{e.set(n.subarray(0,t),t*r)},px=({values:t,valueOffsets:e},r,n)=>dx(t,e,r,n),xS=t=>{let e=t.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),t.variadicBuffers=e),e},mx=(t,e,r)=>{var n,s,i,o;let a=t.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=J.ELEMENT_WIDTH,u=e*c,f=u+c;if(u<0||f>a.length)throw new RangeError(`BinaryView index ${e} out of bounds`);a.fill(0,u,f);let l=new DataView(a.buffer,a.byteOffset+u,c),d=r.length;if(l.setInt32(J.LENGTH_OFFSET,d,!0),d<=J.INLINE_CAPACITY){a.set(r,u+J.INLINE_OFFSET);return}let h=((n=r[0])!==null&&n!==void 0?n:0)|((s=r[1])!==null&&s!==void 0?s:0)<<8|((i=r[2])!==null&&i!==void 0?i:0)<<16|((o=r[3])!==null&&o!==void 0?o:0)<<24;l.setUint32(J.INLINE_OFFSET,h>>>0,!0);let m=xS(t),b=r.slice(),x=m.push(b)-1;l.setInt32(J.BUFFER_INDEX_OFFSET,x,!0),l.setInt32(J.BUFFER_OFFSET_OFFSET,0,!0)},wS=(t,e,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);mx(t,e,n)},bx=({values:t,valueOffsets:e},r,n)=>dx(t,e,r,zt(n)),TS=(t,e,r)=>{let n=zt(r);mx(t,e,n)},jd=(t,e,r)=>{t.type.unit===ge.DAY?mu(t,e,r):bu(t,e,r)},gu=({values:t},e,r)=>{t[e]=BigInt(r/1e3)},yu=({values:t},e,r)=>{t[e]=BigInt(r)},xu=({values:t},e,r)=>{t[e]=BigInt(r*1e3)},wu=({values:t},e,r)=>{t[e]=BigInt(r*1e6)},zd=(t,e,r)=>{switch(t.type.unit){case S.SECOND:return gu(t,e,r);case S.MILLISECOND:return yu(t,e,r);case S.MICROSECOND:return xu(t,e,r);case S.NANOSECOND:return wu(t,e,r)}},Tu=({values:t},e,r)=>{t[e]=r},_u=({values:t},e,r)=>{t[e]=r},Au=({values:t},e,r)=>{t[e]=r},vu=({values:t},e,r)=>{t[e]=r},Wd=(t,e,r)=>{switch(t.type.unit){case S.SECOND:return Tu(t,e,r);case S.MILLISECOND:return _u(t,e,r);case S.MICROSECOND:return Au(t,e,r);case S.NANOSECOND:return vu(t,e,r)}},$d=({values:t,stride:e},r,n)=>{t.set(n.subarray(0,e),e*r)},gx=(t,e,r)=>{let n=t.children[0],s=t.valueOffsets,i=tt.getVisitFn(n),o=ee(s[e]),a=ee(s[e+1]);if(Array.isArray(r))for(let c=-1,u=o;u<a;)i(n,u++,r[++c]);else for(let c=-1,u=o;u<a;)i(n,u++,r.get(++c))},_S=(t,e,r)=>{let n=t.children[0],{valueOffsets:s}=t,i=tt.getVisitFn(n),{[e]:o,[e+1]:a}=s,c=r instanceof Map?r.entries():Object.entries(r);for(let u of c)if(i(n,o,u),++o>=a)break},AS=(t,e)=>(r,n,s,i)=>n&&r(n,t,e[i]),vS=(t,e)=>(r,n,s,i)=>n&&r(n,t,e.get(i)),IS=(t,e)=>(r,n,s,i)=>n&&r(n,t,e.get(s.name)),LS=(t,e)=>(r,n,s,i)=>n&&r(n,t,e[s.name]),SS=(t,e,r)=>{let n=t.type.children.map(i=>tt.getVisitFn(i.type)),s=r instanceof Map?IS(e,r):r instanceof E?vS(e,r):Array.isArray(r)?AS(e,r):LS(e,r);t.type.children.forEach((i,o)=>s(n[o],t.children[o],i,o))},ES=(t,e,r)=>{t.type.mode===de.Dense?yx(t,e,r):xx(t,e,r)},yx=(t,e,r)=>{let n=t.type.typeIdToChildIndex[t.typeIds[e]],s=t.children[n];tt.visit(s,t.valueOffsets[e],r)},xx=(t,e,r)=>{let n=t.type.typeIdToChildIndex[t.typeIds[e]],s=t.children[n];tt.visit(s,e,r)},BS=(t,e,r)=>{var n;(n=t.dictionary)===null||n===void 0||n.set(t.values[e],r)},qd=(t,e,r)=>{switch(t.type.unit){case ie.YEAR_MONTH:return Lu(t,e,r);case ie.DAY_TIME:return Iu(t,e,r);case ie.MONTH_DAY_NANO:return Su(t,e,r)}},Iu=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},Lu=({values:t},e,r)=>{t[e]=r[0]*12+r[1]%12},Su=({values:t,stride:e},r,n)=>{t.set(n.subarray(0,e),e*r)},Eu=({values:t},e,r)=>{t[e]=r},Bu=({values:t},e,r)=>{t[e]=r},Fu=({values:t},e,r)=>{t[e]=r},Ou=({values:t},e,r)=>{t[e]=r},Kd=(t,e,r)=>{switch(t.type.unit){case S.SECOND:return Eu(t,e,r);case S.MILLISECOND:return Bu(t,e,r);case S.MICROSECOND:return Fu(t,e,r);case S.NANOSECOND:return Ou(t,e,r)}},FS=(t,e,r)=>{let{stride:n}=t,s=t.children[0],i=tt.getVisitFn(s);if(Array.isArray(r))for(let o=-1,a=e*n;++o<n;)i(s,a+o,r[o]);else for(let o=-1,a=e*n;++o<n;)i(s,a+o,r.get(o))};U.prototype.visitBool=W(gS);U.prototype.visitInt=W(hn);U.prototype.visitInt8=W(hn);U.prototype.visitInt16=W(hn);U.prototype.visitInt32=W(hn);U.prototype.visitInt64=W(hn);U.prototype.visitUint8=W(hn);U.prototype.visitUint16=W(hn);U.prototype.visitUint32=W(hn);U.prototype.visitUint64=W(hn);U.prototype.visitFloat=W(yS);U.prototype.visitFloat16=W(hx);U.prototype.visitFloat32=W(Ud);U.prototype.visitFloat64=W(Ud);U.prototype.visitUtf8=W(bx);U.prototype.visitLargeUtf8=W(bx);U.prototype.visitUtf8View=W(TS);U.prototype.visitBinary=W(px);U.prototype.visitLargeBinary=W(px);U.prototype.visitBinaryView=W(wS);U.prototype.visitFixedSizeBinary=W(Pd);U.prototype.visitDate=W(jd);U.prototype.visitDateDay=W(mu);U.prototype.visitDateMillisecond=W(bu);U.prototype.visitTimestamp=W(zd);U.prototype.visitTimestampSecond=W(gu);U.prototype.visitTimestampMillisecond=W(yu);U.prototype.visitTimestampMicrosecond=W(xu);U.prototype.visitTimestampNanosecond=W(wu);U.prototype.visitTime=W(Wd);U.prototype.visitTimeSecond=W(Tu);U.prototype.visitTimeMillisecond=W(_u);U.prototype.visitTimeMicrosecond=W(Au);U.prototype.visitTimeNanosecond=W(vu);U.prototype.visitDecimal=W($d);U.prototype.visitList=W(gx);U.prototype.visitLargeList=W(gx);U.prototype.visitStruct=W(SS);U.prototype.visitUnion=W(ES);U.prototype.visitDenseUnion=W(yx);U.prototype.visitSparseUnion=W(xx);U.prototype.visitDictionary=W(BS);U.prototype.visitInterval=W(qd);U.prototype.visitIntervalDayTime=W(Iu);U.prototype.visitIntervalYearMonth=W(Lu);U.prototype.visitIntervalMonthDayNano=W(Su);U.prototype.visitDuration=W(Kd);U.prototype.visitDurationSecond=W(Eu);U.prototype.visitDurationMillisecond=W(Bu);U.prototype.visitDurationMicrosecond=W(Fu);U.prototype.visitDurationNanosecond=W(Ou);U.prototype.visitFixedSizeList=W(FS);U.prototype.visitMap=W(_S);tt=new U});var Or,go,$r,Hd,Xd,OS,Mu=p(()=>{Da();ni();er();Or=Symbol.for("parent"),go=Symbol.for("rowIndex"),$r=class{constructor(e,r){return this[Or]=e,this[go]=r,new Proxy(this,OS)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[go],r=this[Or],n=r.type.children,s={};for(let i=-1,o=n.length;++i<o;)s[n[i].name]=je.visit(r.children[i],e);return s}toString(){return`{${[...this].map(([e,r])=>`${Ir(e)}: ${Ir(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Hd(this[Or],this[go])}},Hd=class{constructor(e,r){this.childIndex=0,this.children=e.children,this.rowIndex=r,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,je.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties($r.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Or]:{writable:!0,enumerable:!1,configurable:!1,value:null},[go]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Xd=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Or].type.children.map(r=>r.name)}has(e,r){return e[Or].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(e,r){if(e[Or].type.children.some(n=>n.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let n=e[Or].type.children.findIndex(s=>s.name===r);if(n!==-1){let s=je.visit(e[Or].children[n],e[go]);return Reflect.set(e,r,s),s}}set(e,r,n){let s=e[Or].type.children.findIndex(i=>i.name===r);return s!==-1?(tt.visit(e[Or].children[s],e[go],n),Reflect.set(e,r,n)):Reflect.has(e,r)||typeof r=="symbol"?Reflect.set(e,r,n):!1}},OS=new Xd});function j(t){return(e,r)=>e.getValid(r)?t(e,r):null}var C,MS,yo,RS,DS,wx,NS,Tx,_x,as,CS,Ax,kS,vx,Ix,GS,Lx,VS,US,PS,jS,Sx,Ex,Bx,Fx,zS,Ox,Mx,Rx,Dx,WS,$S,Nx,qS,KS,HS,Cx,kx,XS,JS,Gx,Vx,Ux,Px,jx,zx,Wx,YS,ZS,je,ni=p(()=>{hu();lt();Dt();za();Mu();zr();an();ja();Fe();C=class extends R{};MS=(t,e)=>864e5*t[e],yo=16,RS=12,DS=(t,e)=>null,wx=(t,e,r)=>{if(r+1>=e.length)return null;let n=ee(e[r]),s=ee(e[r+1]);return t.subarray(n,s)},NS=({offset:t,values:e},r)=>{let n=t+r;return(e[n>>3]&1<<n%8)!==0},Tx=({values:t},e)=>MS(t,e),_x=({values:t},e)=>ee(t[e]),as=({stride:t,values:e},r)=>e[t*r],CS=({stride:t,values:e},r)=>pu(e[t*r]),Ax=({values:t},e)=>t[e],kS=({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1)),vx=({values:t,valueOffsets:e},r)=>wx(t,e,r),Ix=(t,e)=>{var r;let n=t.values;if(!n)throw new Error("BinaryView data is missing view buffer");let s=e*yo,i=s+yo;if(s<0||i>n.length)throw new Error(`BinaryView data buffer is too short: expected ${yo} bytes, got ${Math.max(0,n.length-s)}`);let o=n.subarray(s,i);if(o.length<yo)throw new Error(`BinaryView data buffer is too short: expected ${yo} bytes, got ${o.length}`);let a=new DataView(n.buffer,o.byteOffset,yo),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=RS)return o.subarray(4,4+c);let u=a.getInt32(8,!0),f=a.getInt32(12,!0),l=(r=t.variadicBuffers)===null||r===void 0?void 0:r[u];if(!l)throw new Error(`BinaryView variadic buffer ${u} is missing`);return l.subarray(f,f+c)},GS=(t,e)=>Ix(t,e),Lx=({values:t,valueOffsets:e},r)=>{let n=wx(t,e,r);return n!==null?io(n):null},VS=(t,e)=>{let r=Ix(t,e);return io(r)},US=({values:t},e)=>t[e],PS=({type:t,values:e},r)=>t.precision!==ue.HALF?e[r]:pu(e[r]),jS=(t,e)=>t.type.unit===ge.DAY?Tx(t,e):_x(t,e),Sx=({values:t},e)=>1e3*ee(t[e]),Ex=({values:t},e)=>ee(t[e]),Bx=({values:t},e)=>Nd(t[e],BigInt(1e3)),Fx=({values:t},e)=>Nd(t[e],BigInt(1e6)),zS=(t,e)=>{switch(t.type.unit){case S.SECOND:return Sx(t,e);case S.MILLISECOND:return Ex(t,e);case S.MICROSECOND:return Bx(t,e);case S.NANOSECOND:return Fx(t,e)}},Ox=({values:t},e)=>t[e],Mx=({values:t},e)=>t[e],Rx=({values:t},e)=>t[e],Dx=({values:t},e)=>t[e],WS=(t,e)=>{switch(t.type.unit){case S.SECOND:return Ox(t,e);case S.MILLISECOND:return Mx(t,e);case S.MICROSECOND:return Rx(t,e);case S.NANOSECOND:return Dx(t,e)}},$S=({values:t,stride:e},r)=>ri.decimal(t.subarray(e*r,e*(r+1))),Nx=(t,e)=>{let{valueOffsets:r,stride:n,children:s}=t,i=ee(r[e*n]),o=ee(r[e*n+1]),c=s[0].slice(i,o-i);return new E([c])},qS=(t,e)=>{let{valueOffsets:r,children:n}=t,{[e]:s,[e+1]:i}=r,o=n[0];return new lr(o.slice(s,i-s))},KS=(t,e)=>new $r(t,e),HS=(t,e)=>t.type.mode===de.Dense?Cx(t,e):kx(t,e),Cx=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[r];return je.visit(n,t.valueOffsets[e])},kx=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[r];return je.visit(n,e)},XS=(t,e)=>{var r;return(r=t.dictionary)===null||r===void 0?void 0:r.get(t.values[e])},JS=(t,e)=>t.type.unit===ie.MONTH_DAY_NANO?Ux(t,e):t.type.unit===ie.DAY_TIME?Gx(t,e):Vx(t,e),Gx=({values:t},e)=>t.subarray(2*e,2*(e+1)),Vx=({values:t},e)=>{let r=t[e],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},Ux=({values:t},e)=>t.subarray(4*e,4*(e+1)),Px=({values:t},e)=>t[e],jx=({values:t},e)=>t[e],zx=({values:t},e)=>t[e],Wx=({values:t},e)=>t[e],YS=(t,e)=>{switch(t.type.unit){case S.SECOND:return Px(t,e);case S.MILLISECOND:return jx(t,e);case S.MICROSECOND:return zx(t,e);case S.NANOSECOND:return Wx(t,e)}},ZS=(t,e)=>{let{stride:r,children:n}=t,i=n[0].slice(e*r,r);return new E([i])};C.prototype.visitNull=j(DS);C.prototype.visitBool=j(NS);C.prototype.visitInt=j(US);C.prototype.visitInt8=j(as);C.prototype.visitInt16=j(as);C.prototype.visitInt32=j(as);C.prototype.visitInt64=j(Ax);C.prototype.visitUint8=j(as);C.prototype.visitUint16=j(as);C.prototype.visitUint32=j(as);C.prototype.visitUint64=j(Ax);C.prototype.visitFloat=j(PS);C.prototype.visitFloat16=j(CS);C.prototype.visitFloat32=j(as);C.prototype.visitFloat64=j(as);C.prototype.visitUtf8=j(Lx);C.prototype.visitLargeUtf8=j(Lx);C.prototype.visitUtf8View=j(VS);C.prototype.visitBinary=j(vx);C.prototype.visitLargeBinary=j(vx);C.prototype.visitBinaryView=j(GS);C.prototype.visitFixedSizeBinary=j(kS);C.prototype.visitDate=j(jS);C.prototype.visitDateDay=j(Tx);C.prototype.visitDateMillisecond=j(_x);C.prototype.visitTimestamp=j(zS);C.prototype.visitTimestampSecond=j(Sx);C.prototype.visitTimestampMillisecond=j(Ex);C.prototype.visitTimestampMicrosecond=j(Bx);C.prototype.visitTimestampNanosecond=j(Fx);C.prototype.visitTime=j(WS);C.prototype.visitTimeSecond=j(Ox);C.prototype.visitTimeMillisecond=j(Mx);C.prototype.visitTimeMicrosecond=j(Rx);C.prototype.visitTimeNanosecond=j(Dx);C.prototype.visitDecimal=j($S);C.prototype.visitList=j(Nx);C.prototype.visitLargeList=j(Nx);C.prototype.visitStruct=j(KS);C.prototype.visitUnion=j(HS);C.prototype.visitDenseUnion=j(Cx);C.prototype.visitSparseUnion=j(kx);C.prototype.visitDictionary=j(XS);C.prototype.visitInterval=j(JS);C.prototype.visitIntervalDayTime=j(Gx);C.prototype.visitIntervalYearMonth=j(Vx);C.prototype.visitIntervalMonthDayNano=j(Ux);C.prototype.visitDuration=j(YS);C.prototype.visitDurationSecond=j(Px);C.prototype.visitDurationMillisecond=j(jx);C.prototype.visitDurationMicrosecond=j(zx);C.prototype.visitDurationNanosecond=j(Wx);C.prototype.visitFixedSizeList=j(ZS);C.prototype.visitMap=j(qS);je=new C});var cs,wo,xo,Jd,lr,Yd,Zd,za=p(()=>{lt();Da();ni();er();cs=Symbol.for("keys"),wo=Symbol.for("vals"),xo=Symbol.for("kKeysAsStrings"),Jd=Symbol.for("_kKeysAsStrings"),lr=class{constructor(e){return this[cs]=new E([e.children[0]]).memoize(),this[wo]=e.children[1],new Proxy(this,new Zd)}get[xo](){return this[Jd]||(this[Jd]=Array.from(this[cs].toArray(),String))}[Symbol.iterator](){return new Yd(this[cs],this[wo])}get size(){return this[cs].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[cs],r=this[wo],n={};for(let s=-1,i=e.length;++s<i;)n[e.get(s)]=je.visit(r,s);return n}toString(){return`{${[...this].map(([e,r])=>`${Ir(e)}: ${Ir(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Yd=class{constructor(e,r){this.keys=e,this.vals=r,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),je.visit(this.vals,e)]})}},Zd=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[xo]}has(e,r){return e[xo].includes(r)}getOwnPropertyDescriptor(e,r){if(e[xo].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let n=e[xo].indexOf(r);if(n!==-1){let s=je.visit(Reflect.get(e,wo),n);return Reflect.set(e,r,s),s}}set(e,r,n){let s=e[xo].indexOf(r);return s!==-1?(tt.visit(Reflect.get(e,wo),s,n),Reflect.set(e,r,n)):Reflect.has(e,r)?Reflect.set(e,r,n):!1}};Object.defineProperties(lr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[cs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Jd]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Qd={};Z(Qd,{clampRange:()=>Wa,createElementComparator:()=>us,wrapIndex:()=>si});function Wa(t,e,r,n){let{length:s=0}=t,i=typeof e!="number"?0:e,o=typeof r!="number"?s:r;return i<0&&(i=(i%s+s)%s),o<0&&(o=(o%s+s)%s),o<i&&($x=i,i=o,o=$x),o>s&&(o=s),n?n(t,i,o):[i,o]}function us(t){if(typeof t!=="object"||t===null)return qx(t)?qx:r=>r===t;if(t instanceof Date){let r=t.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(t)?r=>r?nd(t,r):!1:t instanceof Map?eE(t):Array.isArray(t)?QS(t):t instanceof E?tE(t):rE(t,!0)}function QS(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=us(t[r]);return Ru(e)}function eE(t){let e=-1,r=[];for(let n of t.values())r[++e]=us(n);return Ru(r)}function tE(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=us(t.get(r));return Ru(e)}function rE(t,e=!1){let r=Object.keys(t);if(!e&&r.length===0)return()=>!1;let n=[];for(let s=-1,i=r.length;++s<i;)n[s]=us(t[r[s]]);return Ru(n,r)}function Ru(t,e){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return nE(t,r);case Map:return Kx(t,r,r.keys());case lr:case $r:case Object:case void 0:return Kx(t,r,e||Object.keys(r))}return r instanceof E?sE(t,r):!1}}function nE(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e[n]))return!1;return!0}function sE(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e.get(n)))return!1;return!0}function Kx(t,e,r){let n=r[Symbol.iterator](),s=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),i=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,a=t.length,c=i.next(),u=n.next(),f=s.next();for(;o<a&&!u.done&&!f.done&&!c.done&&!(u.value!==f.value||!t[o](c.value));++o,u=n.next(),f=s.next(),c=i.next());return o===a&&u.done&&f.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),i.return&&i.return(),!1)}var $x,si,qx,To=p(()=>{lt();za();Mu();qe();si=(t,e)=>t<0?e+t:t,qx=t=>t!==t});var eh={};Z(eh,{BitIterator:()=>qr,getBit:()=>Nu,getBool:()=>_o,packBools:()=>oi,popcnt_array:()=>Hx,popcnt_bit_range:()=>$a,popcnt_uint32:()=>Du,setBool:()=>iE,truncateBitmap:()=>ii});function _o(t,e,r,n){return(r&1<<n)!==0}function Nu(t,e,r,n){return(r&1<<n)>>n}function iE(t,e,r){return r?!!(t[e>>3]|=1<<e%8)||!0:!(t[e>>3]&=~(1<<e%8))&&!1}function ii(t,e,r){let n=r.byteLength+7&-8;if(t>0||r.byteLength<n){let s=new Uint8Array(n);return s.set(t%8===0?r.subarray(t>>3):oi(new qr(r,t,e,null,_o)).subarray(0,n)),s}return r}function oi(t){let e=[],r=0,n=0,s=0;for(let o of t)o&&(s|=1<<n),++n===8&&(e[r++]=s,s=n=0);(r===0||n>0)&&(e[r++]=s);let i=new Uint8Array(e.length+7&-8);return i.set(e),i}function $a(t,e,r){if(r-e<=0)return 0;if(r-e<8){let i=0;for(let o of new qr(t,e,r-e,t,Nu))i+=o;return i}let n=r>>3<<3,s=e+(e%8===0?0:8-e%8);return $a(t,e,s)+$a(t,n,r)+Hx(t,s>>3,n-s>>3)}function Hx(t,e,r){let n=0,s=Math.trunc(e),i=new DataView(t.buffer,t.byteOffset,t.byteLength),o=r===void 0?t.byteLength:s+r;for(;o-s>=4;)n+=Du(i.getUint32(s)),s+=4;for(;o-s>=2;)n+=Du(i.getUint16(s)),s+=2;for(;o-s>=1;)n+=Du(i.getUint8(s)),s+=1;return n}function Du(t){let e=Math.trunc(t);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var qr,ai=p(()=>{qr=class{constructor(e,r,n,s,i){this.bytes=e,this.length=n,this.context=s,this.get=i,this.bit=r%8,this.byteIndex=r>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function M(t){return aE.visit(t)}var oE,Xx,N,th,aE,dr=p(()=>{lt();Fe();ye();ai();ye();Dt();qe();oE=-1,Xx=Symbol.for("apache-arrow/Data"),N=class t{static isData(e){return e?.[Xx]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return L.isSparseUnion(e)?this.children.some(r=>r.nullable):L.isDenseUnion(e)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:r,values:n,nullBitmap:s,typeIds:i}=this;return r&&(e+=r.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),e+=this.variadicBuffers.reduce((o,a)=>{var c;return o+((c=a?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((o,a)=>o+a.byteLength,e)}get nullCount(){if(L.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let e=this._nullCount,r;return e<=oE&&(r=this.nullBitmap)&&(this._nullCount=e=r.length===0?0:this.length-$a(r,this.offset,this.offset+this.length)),e}constructor(e,r,n,s,i,o=[],a,c=[]){var u;this.type=e,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let f;i instanceof t?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets,this.variadicBuffers=i.variadicBuffers):(this.stride=Qt(e),i&&((f=i[0])&&(this.valueOffsets=f),(f=i[1])&&(this.values=f),(f=i[2])&&(this.nullBitmap=f),(f=i[3])&&(this.typeIds=f)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:r}=this;if(L.isUnion(r)){let n=r,s=this.typeIds[e],i=n.typeIdToChildIndex[s],o=this.children[i],a=this.valueOffsets,c=n.mode===de.Dense&&a?Number(a[e]):e;return o.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,r){let n,{type:s}=this;if(L.isUnion(s)){let i=s,o=this.typeIds[e],a=i.typeIdToChildIndex[o],c=this.children[a],u=this.valueOffsets,f=i.mode===de.Dense&&u?Number(u[e]):e;n=c.getValid(f),c.setValid(f,r)}else{let{nullBitmap:i}=this,{offset:o,length:a}=this,c=o+e,u=1<<c%8,f=c>>3;(!i||i.byteLength<=f)&&(i=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(i.set(ii(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:i})):Object.assign(this,{nullBitmap:i,_nullCount:0}));let l=i[f];n=(l&u)!==0,i[f]=r?l|u:l&~u}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(e=this.type,r=this.offset,n=this.length,s=this._nullCount,i=this,o=this.children,a=this.variadicBuffers){return new t(e,r,n,s,i,o,this.dictionary,a)}slice(e,r){let{stride:n,typeId:s,children:i}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(e,r,n,s);return this.clone(this.type,this.offset+e,r,o,c,i.length===0||this.valueOffsets?i:this._sliceChildren(i,a*e,a*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===y.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:n}=this,s=new Uint8Array((e+63&-64)>>3).fill(255,0,r>>3);s[r>>3]=(1<<r-(r&-8))-1,n>0&&s.set(ii(this.offset,r,this.nullBitmap),0);let i=this.buffers;return i[te.VALIDITY]=s,this.clone(this.type,0,e,n+(e-r),i,this.children,this.variadicBuffers)}_sliceBuffers(e,r,n,s){let i,{buffers:o}=this;if((i=o[te.TYPE])&&(o[te.TYPE]=i.subarray(e,e+r)),L.isBinaryView(this.type)||L.isUtf8View(this.type)){let a=J.ELEMENT_WIDTH;(i=o[te.DATA])&&(o[te.DATA]=i.subarray(e*a,(e+r)*a))}else(i=o[te.OFFSET])&&(o[te.OFFSET]=i.subarray(e,e+r+1))||(i=o[te.DATA])&&(o[te.DATA]=s===6?i:i.subarray(n*e,n*(e+r)));return o}_sliceChildren(e,r,n){return e.map(s=>s.slice(r,n))}};N.prototype.children=Object.freeze([]);N.prototype[Xx]=!0;Object.defineProperty(N,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===N&&N.isData(e)}});th=class t extends R{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:r,["offset"]:n=0,["length"]:s=0}=e;return new N(r,n,s,s)}visitBool(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitInt(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitFloat(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitUtf8(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=Qs(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[o,s,i])}visitUtf8View(e){var r;let{["type"]:n,["offset"]:s=0}=e,i=Q(n.ArrayType,e.views),o=D(e.nullBitmap),a=(e.variadicBuffers||[]).map(f=>D(f)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(i.length/wt.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new N(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeUtf8(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=ya(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[o,s,i])}visitBinary(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=Qs(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[o,s,i])}visitBinaryView(e){var r;let{["type"]:n,["offset"]:s=0}=e,i=Q(n.ArrayType,e.views),o=D(e.nullBitmap),a=(e.variadicBuffers||[]).map(f=>D(f)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(i.length/J.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new N(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeBinary(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=ya(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[o,s,i])}visitFixedSizeBinary(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length/Qt(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitDate(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length/Qt(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitTimestamp(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length/Qt(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitTime(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length/Qt(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitDecimal(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length/Qt(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitList(e){let{["type"]:r,["offset"]:n=0,["child"]:s}=e,i=D(e.nullBitmap),o=Qs(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[o,void 0,i],[s])}visitLargeList(e){let{["type"]:r,["offset"]:n=0,["child"]:s}=e,i=D(e.nullBitmap),o=ya(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[o,void 0,i],[s])}visitStruct(e){let{["type"]:r,["offset"]:n=0,["children"]:s=[]}=e,i=D(e.nullBitmap),{length:o=s.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,void 0,i],s)}visitUnion(e){let{["type"]:r,["offset"]:n=0,["children"]:s=[]}=e,i=Q(r.ArrayType,e.typeIds),{["length"]:o=i.length,["nullCount"]:a=-1}=e;if(L.isSparseUnion(r))return new N(r,n,o,a,[void 0,void 0,void 0,i],s);let c=Qs(e.valueOffsets);return new N(r,n,o,a,[c,void 0,void 0,i],s)}visitDictionary(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.indices.ArrayType,e.data),{["dictionary"]:o=new E([new t().visit({type:r.dictionary})])}=e,{["length"]:a=i.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[void 0,i,s],[],o)}visitInterval(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length/Qt(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitDuration(e){let{["type"]:r,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Q(r.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,i,s])}visitFixedSizeList(e){let{["type"]:r,["offset"]:n=0,["child"]:s=new t().visit({type:r.valueType})}=e,i=D(e.nullBitmap),{["length"]:o=s.length/Qt(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new N(r,n,o,a,[void 0,void 0,i],[s])}visitMap(e){let{["type"]:r,["offset"]:n=0,["child"]:s=new t().visit({type:r.childType})}=e,i=D(e.nullBitmap),o=Qs(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new N(r,n,a,c,[o,void 0,i],[s])}},aE=new th});function Jx(t){return t.some(e=>e.nullable)}function Cu(t){return t.reduce((e,r)=>e+r.nullCount,0)}function ku(t){return t.reduce((e,r,n)=>(e[n+1]=e[n]+r.length,e),new Uint32Array(t.length+1))}function Gu(t,e,r,n){let s=[];for(let i=-1,o=t.length;++i<o;){let a=t[i],c=e[i],{length:u}=a;if(c>=n)break;if(r>=c+u)continue;if(c>=r&&c+u<=n){s.push(a);continue}let f=Math.max(0,r-c),l=Math.min(n-c,u);s.push(a.slice(f,l-f))}return s.length===0&&s.push(t[0].slice(0,0)),s}function rh(t,e,r,n){let s=0,i=0,o=e.length-1;do{if(s>=o-1)return r<e[o]?n(t,s,r-e[s]):null;i=s+Math.trunc((o-s)*.5),r<e[i]?o=i:s=i}while(s<o)}function Ka(t,e){return t.getValid(e)}function Ao(t){function e(r,n,s){return t(r[n],s)}return function(r){let n=this.data;return rh(n,this._offsets,r,e)}}function Vu(t){let e;function r(n,s,i){return t(n[s],i,e)}return function(n,s){let i=this.data;e=s;let o=rh(i,this._offsets,n,r);return e=void 0,o}}function Uu(t){let e;function r(n,s,i){let o=i,a=0,c=0;for(let u=s-1,f=n.length;++u<f;){let l=n[u];if(~(a=t(l,e,o)))return c+a;o=0,c+=l.length}return-1}return function(n,s){e=n;let i=this.data,o=typeof s!="number"?r(i,0,0):rh(i,this._offsets,s,r);return e=void 0,o}}var qa,Pu=p(()=>{qa=class{constructor(e=0,r){this.numChunks=e,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function cE(t,e){return e===null&&t.length>0?0:-1}function uE(t,e){let{nullBitmap:r}=t;if(!r||t.nullCount<=0)return-1;let n=0;for(let s of new qr(r,t.offset+(e||0),t.length,r,_o)){if(!s)return n;++n}return-1}function q(t,e,r){if(e===void 0)return-1;if(e===null)switch(t.typeId){case y.Union:break;case y.Dictionary:break;default:return uE(t,r)}let n=je.getVisitFn(t),s=us(e);for(let i=(r||0)-1,o=t.length;++i<o;)if(s(n(t,i)))return i;return-1}function Yx(t,e,r){let n=je.getVisitFn(t),s=us(e);for(let i=(r||0)-1,o=t.length;++i<o;)if(s(n(t,i)))return i;return-1}var k,ci,ju=p(()=>{Fe();Dt();ni();ai();To();k=class extends R{};k.prototype.visitNull=cE;k.prototype.visitBool=q;k.prototype.visitInt=q;k.prototype.visitInt8=q;k.prototype.visitInt16=q;k.prototype.visitInt32=q;k.prototype.visitInt64=q;k.prototype.visitUint8=q;k.prototype.visitUint16=q;k.prototype.visitUint32=q;k.prototype.visitUint64=q;k.prototype.visitFloat=q;k.prototype.visitFloat16=q;k.prototype.visitFloat32=q;k.prototype.visitFloat64=q;k.prototype.visitUtf8=q;k.prototype.visitLargeUtf8=q;k.prototype.visitUtf8View=q;k.prototype.visitBinary=q;k.prototype.visitLargeBinary=q;k.prototype.visitBinaryView=q;k.prototype.visitFixedSizeBinary=q;k.prototype.visitDate=q;k.prototype.visitDateDay=q;k.prototype.visitDateMillisecond=q;k.prototype.visitTimestamp=q;k.prototype.visitTimestampSecond=q;k.prototype.visitTimestampMillisecond=q;k.prototype.visitTimestampMicrosecond=q;k.prototype.visitTimestampNanosecond=q;k.prototype.visitTime=q;k.prototype.visitTimeSecond=q;k.prototype.visitTimeMillisecond=q;k.prototype.visitTimeMicrosecond=q;k.prototype.visitTimeNanosecond=q;k.prototype.visitDecimal=q;k.prototype.visitList=q;k.prototype.visitLargeList=q;k.prototype.visitStruct=q;k.prototype.visitUnion=q;k.prototype.visitDenseUnion=Yx;k.prototype.visitSparseUnion=Yx;k.prototype.visitDictionary=q;k.prototype.visitInterval=q;k.prototype.visitIntervalDayTime=q;k.prototype.visitIntervalYearMonth=q;k.prototype.visitIntervalMonthDayNano=q;k.prototype.visitDuration=q;k.prototype.visitDurationSecond=q;k.prototype.visitDurationMillisecond=q;k.prototype.visitDurationMicrosecond=q;k.prototype.visitDurationNanosecond=q;k.prototype.visitFixedSizeList=q;k.prototype.visitMap=q;ci=new k});function z(t){let{type:e}=t;if(t.nullCount===0&&t.stride===1&&(L.isInt(e)&&e.bitWidth!==64||L.isTime(e)&&e.bitWidth!==64||L.isFloat(e)&&e.precision!==ue.HALF))return new qa(t.data.length,n=>{let s=t.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let r=0;return new qa(t.data.length,n=>{let i=t.data[n].length,o=t.slice(r,r+i);return r+=i,new nh(o)})}var G,nh,vo,zu=p(()=>{Dt();Fe();ye();Pu();G=class extends R{};nh=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};G.prototype.visitNull=z;G.prototype.visitBool=z;G.prototype.visitInt=z;G.prototype.visitInt8=z;G.prototype.visitInt16=z;G.prototype.visitInt32=z;G.prototype.visitInt64=z;G.prototype.visitUint8=z;G.prototype.visitUint16=z;G.prototype.visitUint32=z;G.prototype.visitUint64=z;G.prototype.visitFloat=z;G.prototype.visitFloat16=z;G.prototype.visitFloat32=z;G.prototype.visitFloat64=z;G.prototype.visitUtf8=z;G.prototype.visitLargeUtf8=z;G.prototype.visitUtf8View=z;G.prototype.visitBinary=z;G.prototype.visitLargeBinary=z;G.prototype.visitBinaryView=z;G.prototype.visitFixedSizeBinary=z;G.prototype.visitDate=z;G.prototype.visitDateDay=z;G.prototype.visitDateMillisecond=z;G.prototype.visitTimestamp=z;G.prototype.visitTimestampSecond=z;G.prototype.visitTimestampMillisecond=z;G.prototype.visitTimestampMicrosecond=z;G.prototype.visitTimestampNanosecond=z;G.prototype.visitTime=z;G.prototype.visitTimeSecond=z;G.prototype.visitTimeMillisecond=z;G.prototype.visitTimeMicrosecond=z;G.prototype.visitTimeNanosecond=z;G.prototype.visitDecimal=z;G.prototype.visitList=z;G.prototype.visitLargeList=z;G.prototype.visitStruct=z;G.prototype.visitUnion=z;G.prototype.visitDenseUnion=z;G.prototype.visitSparseUnion=z;G.prototype.visitDictionary=z;G.prototype.visitInterval=z;G.prototype.visitIntervalDayTime=z;G.prototype.visitIntervalYearMonth=z;G.prototype.visitIntervalMonthDayNano=z;G.prototype.visitDuration=z;G.prototype.visitDurationSecond=z;G.prototype.visitDurationMillisecond=z;G.prototype.visitDurationMicrosecond=z;G.prototype.visitDurationNanosecond=z;G.prototype.visitFixedSizeList=z;G.prototype.visitMap=z;vo=new G});function Kr(t){if(t){if(t instanceof N)return new E([t]);if(t instanceof E)return new E(t.data);if(t.type instanceof L)return new E([M(t)]);if(Array.isArray(t))return new E(t.flatMap(e=>fE(e)));if(ArrayBuffer.isView(t)){t instanceof DataView&&(t=new Uint8Array(t.buffer));let e={offset:0,length:t.length,nullCount:-1,data:t};if(t instanceof Int8Array)return new E([M(Object.assign(Object.assign({},e),{type:new qt}))]);if(t instanceof Int16Array)return new E([M(Object.assign(Object.assign({},e),{type:new Kt}))]);if(t instanceof Int32Array)return new E([M(Object.assign(Object.assign({},e),{type:new ke}))]);if(t instanceof BigInt64Array)return new E([M(Object.assign(Object.assign({},e),{type:new Ht}))]);if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new E([M(Object.assign(Object.assign({},e),{type:new Xt}))]);if(t instanceof Uint16Array)return new E([M(Object.assign(Object.assign({},e),{type:new Jt}))]);if(t instanceof Uint32Array)return new E([M(Object.assign(Object.assign({},e),{type:new yt}))]);if(t instanceof BigUint64Array)return new E([M(Object.assign(Object.assign({},e),{type:new Sr}))]);if(t instanceof Float32Array)return new E([M(Object.assign(Object.assign({},e),{type:new xt}))]);if(t instanceof Float64Array)return new E([M(Object.assign(Object.assign({},e),{type:new Yt}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function fE(t){return t instanceof N?[t]:t instanceof E?t.data:Kr(t).data}var Zx,Qx,ew,tw,E,Wu,lt=p(()=>{Fe();To();ye();dr();Pu();ni();er();ju();zu();ye();Qx=Symbol.for("apache-arrow/Vector"),ew={},tw={},E=class t{static isVector(e){return e?.[Qx]===!0}constructor(e){var r,n,s;let i=e[0]instanceof t?e.flatMap(a=>a.data):e;if(i.length===0||i.some(a=>!(a instanceof N)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(r=i[0])===null||r===void 0?void 0:r.type;switch(i.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:u}=ew[o.typeId],f=i[0];this.isValid=l=>Ka(f,l),this.get=l=>a(f,l),this.set=(l,d)=>c(f,l,d),this.indexOf=l=>u(f,l),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,tw[o.typeId]),this._offsets=ku(i);break}this.data=i,this.type=o,this.stride=Qt(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((e,r)=>e+r.byteLength,0)}get nullable(){return Jx(this.data)}get nullCount(){return Cu(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${y[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(si(e,this.length))}set(e,r){}indexOf(e,r){return-1}includes(e,r){return this.indexOf(e,r)>-1}[Symbol.iterator](){return vo.visit(this)}concat(...e){return new t(this.data.concat(e.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(e,r){return new t(Wa(this,e,r,({data:n,_offsets:s},i,o)=>Gu(n,s,i,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:r,length:n,stride:s,ArrayType:i}=this;switch(e.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.Timestamp:switch(r.length){case 0:return new i;case 1:return r[0].values.subarray(0,n*s);default:return r.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new i(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new t(this.data.map(({children:r})=>r[e])):null}get isMemoized(){return L.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(L.isDictionary(this.type)){let e=new Wu(this.data[0].dictionary),r=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new t(r)}return new Wu(this)}unmemoize(){if(L.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new t(r)}return this}};Zx=Symbol.toStringTag;E[Zx]=(t=>{t.type=L.prototype,t.data=[],t.length=0,t.stride=1,t.numChildren=0,t._offsets=new Uint32Array([0]),t[Symbol.isConcatSpreadable]=!0,t[Qx]=!0;let e=Object.keys(y).map(r=>y[r]).filter(r=>typeof r=="number"&&r!==y.NONE);for(let r of e){let n=je.getVisitFnByTypeId(r),s=tt.getVisitFnByTypeId(r),i=ci.getVisitFnByTypeId(r);ew[r]={get:n,set:s,indexOf:i},tw[r]=Object.create(t,{isValid:{value:Ao(Ka)},get:{value:Ao(je.getVisitFnByTypeId(r))},set:{value:Vu(tt.getVisitFnByTypeId(r))},indexOf:{value:Uu(ci.getVisitFnByTypeId(r))}})}return"Vector"})(E.prototype);Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===E&&E.isVector(e)}});Wu=class t extends E{constructor(e){super(e.data);let r=this.get,n=this.set,s=this.slice,i=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=i[o];if(a!==void 0)return a;let c=r.call(this,o);return i[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),i[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new t(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new E(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function rw(t){if(!t||t.length<=0)return function(s){return!0};let e="",r=t.filter(n=>n===n);return r.length>0&&(e=`
|
|
13
|
-
switch (x) {${
|
|
14
|
-
case ${
|
|
11
|
+
`&&this.line++,this.offset++;this.offset+=3}else break}}readQuotedString(e){this.offset++;let t="";for(;this.offset<this.source.length;){let n=this.source[this.offset++];if(n===e)break;if(n==="\\"&&this.offset<this.source.length){let s=this.source[this.offset++];t+=s==="n"?`
|
|
12
|
+
`:s}else t+=n}return t}readDelimitedValue(e){this.offset++;let t=this.offset;for(;this.offset<this.source.length&&this.source[this.offset]!==e;)this.offset++;let n=this.source.slice(t,this.offset);return this.offset++,n}}});function Ly(r){let e=new DataView(r),t=uS(e),n=e.getUint16(t+10,!0),s=e.getUint32(t+16,!0),i=new Map,o=new TextDecoder;for(let a=0;a<n;a++){if(e.getUint32(s,!0)!==33639248)throw new Error("USDZ archive contains an invalid ZIP central-directory entry.");let c=e.getUint16(s+10,!0),u=e.getUint32(s+20,!0),f=e.getUint16(s+28,!0),l=e.getUint16(s+30,!0),d=e.getUint16(s+32,!0),h=e.getUint32(s+42,!0),m=o.decode(new Uint8Array(r,s+46,f));if(c!==0)throw new Error(`USDZ entry "${m}" is compressed; USDZ requires stored ZIP entries.`);if(e.getUint32(h,!0)!==67324752)throw new Error(`USDZ entry "${m}" has an invalid local ZIP header.`);let b=e.getUint16(h+26,!0),w=e.getUint16(h+28,!0),g=h+30+b+w;i.set(m,r.slice(g,g+u)),s+=46+f+l+d}return i}function uS(r){let e=Math.max(0,r.byteLength-65557);for(let t=r.byteLength-22;t>=e;t--)if(r.getUint32(t,!0)===101010256)return t;throw new Error("USDZ archive does not contain a ZIP end-of-central-directory record.")}var Sy=p(()=>{"use strict"});async function fd(r,e={},t){let n=dS(e.core?.baseUrl,t?.url),s={fetch:async o=>{let a=await(t?.fetch||fetch)(o);if(!(a instanceof Response))throw new Error(`OpenUSD reference "${o}" did not return an HTTP response.`);if(!a.ok)throw new Error(`Unable to load OpenUSD reference "${o}": ${a.status}.`);return a},cache:new Map,archiveFiles:new Map,layers:new Set,options:{...e,usd:{...pS,...e.usd}}},i;if(yS(r)){let o=Ly(r),a=Array.from(o.keys()).find(f=>/\.usda?$/i.test(f));if(!a)throw new Error("USDZ archives with binary USDC root layers are not implemented yet.");let c="https://usd.archive/";for(let[f,l]of o)s.archiveFiles.set(new URL(f,c).href,l);let u=new URL(a,c).href;i=od(o.get(a),u),i.format="usdz"}else i=od(r,n);return i.url&&s.layers.add(i.url),s.options.usd?.compose!==!1&&(i.rootPrims=await ad(i.rootPrims,i.url,{},s,0)),i.layers=Array.from(s.layers),n&&(i.url=n),i}function dS(r,e){let t=By(r);return t||By(e)||r||e}function By(r){try{return r?new URL(r).href:void 0}catch{return}}function hS(r,e){try{return new URL(r,e).href}catch{let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>=0?`${e.slice(0,t+1)}${r}`:r}}function od(r,e){if(Ey.decode(r.slice(0,8))===fS)throw new Error("Binary USDC crate layers are not implemented yet; use ASCII USDA layers.");return vy(Ey.decode(r),e)}async function ad(r,e,t,n,s){if(s>(n.options.usd?.maxReferenceDepth??12))throw new Error("OpenUSD reference composition exceeded the configured depth limit.");let i=[];for(let o of r){if(o.specifier==="class")continue;let c={...gS(o.metadata.variants),...t,...n.options.usd?.variantSelections},u=o.sourceUrl||e,f=Ta(o);for(let[d,h]of Object.entries(f.variants)){let m=c[d]||Object.keys(h)[0],b=h[m];b&&(f=ud(f,{...f,attributes:b.attributes,metadata:b.metadata,children:b.children,variants:{}}))}let l=Oy(f);if(n.options.usd?.loadReferences!==!1&&l.length>0)for(let d of l){if(!u)throw new Error("OpenUSD references require a source URL or options.core.baseUrl.");let h=hS(d.assetPath,u),m=await mS(h,n),b=bS(m,d.primPath),w=await ad(b,h,c,n,s+1);for(let g of w)f=ud(My(g,f.path),f)}f.children=await ad(f.children,u,c,n,s),i.push(f)}return i}async function mS(r,e){let t=e.cache.get(r);return t||(t=(async()=>{let s=e.archiveFiles.get(r);if(!s){let o;try{o=await e.fetch(r)}catch(a){throw new Error(`Unable to fetch USD layer "${r}": ${String(a)}`)}s=o.arrayBuffer()}let i=od(await s,r);return e.layers.add(r),i})(),e.cache.set(r,t)),t}function bS(r,e){let t=e||r.metadata.defaultPrim;if(typeof t!="string")return r.rootPrims;let n=t.startsWith("/")?t:`/${t}`,s=Fy(r.rootPrims,n);return s?[s]:[]}function Fy(r,e){for(let t of r){if(t.path===e)return t;let n=Fy(t.children,e);if(n)return n}}function Oy(r){let e=[];for(let t of[r.metadata.references,r.metadata.payload,r.metadata.payloads])Array.isArray(t)?e.push(...t.filter(cd)):cd(t)&&e.push(t);return e}function gS(r){return!r||typeof r!="object"||Array.isArray(r)||cd(r)?{}:Object.fromEntries(Object.entries(r).filter(e=>typeof e[1]=="string"))}function cd(r){return!!(r&&typeof r=="object"&&!Array.isArray(r)&&"assetPath"in r)}function Ta(r){return{...r,attributes:{...r.attributes},metadata:{...r.metadata},variants:{...r.variants},children:r.children.map(Ta)}}function My(r,e){let t=Ta(r);return t.path=e,t.children=t.children.map(n=>My(n,`${e}/${n.name}`)),t}function ud(r,e){let t=r.children.map(Ta);for(let n of e.children){let s=t.findIndex(i=>i.name===n.name);s>=0?t[s]=ud(t[s],n):t.push(Ta(n))}return{...r,...e,sourceUrl:Oy(e).length>0?e.sourceUrl:r.sourceUrl||e.sourceUrl,type:e.type||r.type,attributes:{...r.attributes,...e.attributes},metadata:{...r.metadata,...e.metadata},variants:{...r.variants,...e.variants},children:t}}function yS(r){return r.byteLength>=4&&new DataView(r).getUint32(0,!0)===lS}var Ey,fS,lS,pS,Ry=p(()=>{"use strict";Iy();Sy();Ey=new TextDecoder,fS="PXR-USDC",lS=67324752;pS={compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}});async function TS(r,e,t){return fd(new TextEncoder().encode(r).buffer,e,t)}var UC,wS,xS,Dy=p(()=>{"use strict";Ry();ld();({preload:UC,...wS}=_a),xS={...wS,parse:fd,parseText:TS}});var Ny={};Q(Ny,{USDLoaderWithParser:()=>xS});var ky=p(()=>{"use strict";Dy()});async function AS(){let{USDLoaderWithParser:r}=await Promise.resolve().then(()=>(ky(),Ny));return r}var _S,_a,ld=p(()=>{"use strict";_S="5.0.0-beta.2";_a={dataType:null,batchType:null,name:"Universal Scene Description",id:"usd",module:"scene",version:_S,extensions:["usd","usda","usdz"],mimeTypes:["model/vnd.usd","model/vnd.usda","model/vnd.usdz+zip"],text:!0,binary:!0,tests:["#usda","PK"],options:{usd:{compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}},preload:AS}});var Cy,jy=p(()=>{"use strict";Cy={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]}});function Uy(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function B(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(f){try{u(n.next(f))}catch(l){o(l)}}function c(f){try{u(n.throw(f))}catch(l){o(l)}}function u(f){f.done?i(f.value):s(f.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function Vy(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function X(r){return this instanceof X?(this.v=r,this):new X(r)}function bt(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(m){return Promise.resolve(m).then(h,l)}}function a(h,m){n[h]&&(s[h]=function(b){return new Promise(function(w,g){i.push([h,b,w,g])>1||c(h,b)})},m&&(s[h]=m(s[h])))}function c(h,m){try{u(n[h](m))}catch(b){d(i[0][3],b)}}function u(h){h.value instanceof X?Promise.resolve(h.value.v).then(f,l):d(i[0][2],h)}function f(h){c("next",h)}function l(h){c("throw",h)}function d(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function uo(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:X(r[s](o)),done:!1}:i?i(o):o}:i}}function zt(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Vy=="function"?Vy(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var Bt=p(()=>{});var Gy,fo,vS,Wt,fn=p(()=>{Gy=new TextDecoder("utf-8"),fo=Gy.decode.bind(Gy),vS=new TextEncoder,Wt=r=>vS.encode(r)});var IS,Py,We,gt,$t,Tr,fr,ru,nu,su,iu,ou,zy,Aa,Wy,au,$y,Wn=p(()=>{IS=r=>typeof r=="number",Py=r=>typeof r=="boolean",We=r=>typeof r=="function",gt=r=>r!=null&&Object(r)===r,$t=r=>gt(r)&&We(r.then),Tr=r=>gt(r)&&We(r[Symbol.iterator]),fr=r=>gt(r)&&We(r[Symbol.asyncIterator]),ru=r=>gt(r)&>(r.schema),nu=r=>gt(r)&&"done"in r&&"value"in r,su=r=>gt(r)&&We(r.stat)&&IS(r.fd),iu=r=>gt(r)&&Aa(r.body),ou=r=>"_getDOMStream"in r&&"_getNodeStream"in r,zy=r=>gt(r)&&We(r.abort)&&We(r.getWriter)&&!ou(r),Aa=r=>gt(r)&&We(r.cancel)&&We(r.getReader)&&!ou(r),Wy=r=>gt(r)&&We(r.end)&&We(r.write)&&Py(r.writable)&&!ou(r),au=r=>gt(r)&&We(r.read)&&We(r.pipe)&&Py(r.readable)&&!ou(r),$y=r=>gt(r)&&We(r.clear)&&We(r.bytes)&&We(r.position)&&We(r.setPosition)&&We(r.capacity)&&We(r.getBufferIdentifier)&&We(r.createLong)});var gd={};Q(gd,{compareArrayLike:()=>bd,joinUint8Arrays:()=>qt,memcpy:()=>va,rebaseValueOffsets:()=>cu,toArrayBufferView:()=>Z,toArrayBufferViewAsyncIterator:()=>_r,toArrayBufferViewIterator:()=>Ur,toBigInt64Array:()=>Ia,toBigUint64Array:()=>OS,toFloat32Array:()=>MS,toFloat32ArrayAsyncIterator:()=>HS,toFloat32ArrayIterator:()=>US,toFloat64Array:()=>RS,toFloat64ArrayAsyncIterator:()=>XS,toFloat64ArrayIterator:()=>GS,toInt16Array:()=>ES,toInt16ArrayAsyncIterator:()=>WS,toInt16ArrayIterator:()=>kS,toInt32Array:()=>ei,toInt32ArrayAsyncIterator:()=>$S,toInt32ArrayIterator:()=>CS,toInt8Array:()=>SS,toInt8ArrayAsyncIterator:()=>zS,toInt8ArrayIterator:()=>NS,toUint16Array:()=>BS,toUint16ArrayAsyncIterator:()=>qS,toUint16ArrayIterator:()=>jS,toUint32Array:()=>FS,toUint32ArrayAsyncIterator:()=>KS,toUint32ArrayIterator:()=>VS,toUint8Array:()=>D,toUint8ArrayAsyncIterator:()=>md,toUint8ArrayIterator:()=>pd,toUint8ClampedArray:()=>DS,toUint8ClampedArrayAsyncIterator:()=>JS,toUint8ClampedArrayIterator:()=>PS});function LS(r){let e=r[0]?[r[0]]:[],t,n,s,i;for(let o,a,c=0,u=0,f=r.length;++c<f;){if(o=e[u],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(e[++u]=a);continue}if({byteOffset:t,byteLength:s}=o,{byteOffset:n,byteLength:i}=a,t+s<n||n+i<t){a&&(e[++u]=a);continue}e[u]=new Uint8Array(o.buffer,t,n-t+i)}return e}function va(r,e,t=0,n=e.byteLength){let s=r.byteLength,i=new Uint8Array(r.buffer,r.byteOffset,s),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,s));return i.set(o,t),r}function qt(r,e){let t=LS(r),n=t.reduce((f,l)=>f+l.byteLength,0),s,i,o,a=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,n);for(let f=t.length;++c<f;){if(s=t[c],i=s.subarray(0,Math.min(s.length,u-a)),u<=a+i.length){i.length<s.length?t[c]=s.subarray(i.length):i.length===s.length&&c++,o?va(o,i,a):o=i;break}va(o||(o=new Uint8Array(u)),i,a),a+=i.length}return[o||new Uint8Array(0),t.slice(c),n-(o?o.byteLength:0)]}function Z(r,e){let t=nu(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=Wt(t)),t instanceof ArrayBuffer?new r(t):t instanceof hd?new r(t):$y(t)?Z(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}function*Ur(r,e){let t=function*(s){yield s},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof hd?t(e):Tr(e)?e:t(e);return yield*dd((function*(s){let i=null;do i=s.next(yield Z(r,i));while(!i.done)})(n[Symbol.iterator]())),new r}function _r(r,e){return bt(this,arguments,function*(){if($t(e))return yield X(yield X(yield*uo(zt(_r(r,yield X(e))))));let n=function(o){return bt(this,arguments,function*(){yield yield X(yield X(o))})},s=function(o){return bt(this,arguments,function*(){yield X(yield*uo(zt(dd((function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)})(o[Symbol.iterator]())))))})},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof hd?n(e):Tr(e)?s(e):fr(e)?e:n(e);return yield X(yield*uo(zt(dd((function(o){return bt(this,arguments,function*(){let a=null;do a=yield X(o.next(yield yield X(Z(r,a))));while(!a.done)})})(i[Symbol.asyncIterator]()))))),yield X(new r)})}function cu(r,e,t){if(r!==0){t=t.slice(0,e);let n=typeof t[0]=="bigint"?BigInt(r):r;for(let s=-1,i=t.length;++s<i;)t[s]+=n}return t.subarray(0,e)}function bd(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}var hd,SS,ES,ei,Ia,D,BS,FS,OS,MS,RS,DS,dd,NS,kS,CS,pd,jS,VS,US,GS,PS,zS,WS,$S,md,qS,KS,HS,XS,JS,$e=p(()=>{Bt();fn();Wn();hd=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;SS=r=>Z(Int8Array,r),ES=r=>Z(Int16Array,r),ei=r=>Z(Int32Array,r),Ia=r=>Z(BigInt64Array,r),D=r=>Z(Uint8Array,r),BS=r=>Z(Uint16Array,r),FS=r=>Z(Uint32Array,r),OS=r=>Z(BigUint64Array,r),MS=r=>Z(Float32Array,r),RS=r=>Z(Float64Array,r),DS=r=>Z(Uint8ClampedArray,r),dd=r=>(r.next(),r);NS=r=>Ur(Int8Array,r),kS=r=>Ur(Int16Array,r),CS=r=>Ur(Int32Array,r),pd=r=>Ur(Uint8Array,r),jS=r=>Ur(Uint16Array,r),VS=r=>Ur(Uint32Array,r),US=r=>Ur(Float32Array,r),GS=r=>Ur(Float64Array,r),PS=r=>Ur(Uint8ClampedArray,r);zS=r=>_r(Int8Array,r),WS=r=>_r(Int16Array,r),$S=r=>_r(Int32Array,r),md=r=>_r(Uint8Array,r),qS=r=>_r(Uint16Array,r),KS=r=>_r(Uint32Array,r),HS=r=>_r(Float32Array,r),XS=r=>_r(Float64Array,r),JS=r=>_r(Uint8ClampedArray,r)});function*YS(r){let e,t=!1,n=[],s,i,o,a=0;function c(){return i==="peek"?qt(n,o)[0]:([s,n,a]=qt(n,o),s)}({cmd:i,size:o}=(yield null)||{cmd:"read",size:0});let u=pd(r)[Symbol.iterator]();try{do if({done:e,value:s}=Number.isNaN(o-a)?u.next():u.next(o-a),!e&&s.byteLength>0&&(n.push(s),a+=s.byteLength),e||o<=a)do({cmd:i,size:o}=yield c());while(o<a);while(!e)}catch(f){t=!0,typeof u.throw=="function"&&u.throw(f)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function QS(r){return bt(this,arguments,function*(){let t,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?qt(s,a)[0]:([i,s,c]=qt(s,a),i)}({cmd:o,size:a}=(yield yield X(null))||{cmd:"read",size:0});let f=md(r)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(a-c)?yield X(f.next()):yield X(f.next(a-c)),!t&&i.byteLength>0&&(s.push(i),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield X(u()));while(a<c);while(!t)}catch(l){n=!0,typeof f.throw=="function"&&(yield X(f.throw(l)))}finally{n===!1&&typeof f.return=="function"&&(yield X(f.return(new Uint8Array(0))))}return yield X(null)})}function ZS(r){return bt(this,arguments,function*(){let t=!1,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?qt(s,a)[0]:([i,s,c]=qt(s,a),i)}({cmd:o,size:a}=(yield yield X(null))||{cmd:"read",size:0});let f=new wd(r);try{do if({done:t,value:i}=Number.isNaN(a-c)?yield X(f.read()):yield X(f.read(a-c)),!t&&i.byteLength>0&&(s.push(D(i)),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield X(u()));while(a<c);while(!t)}catch(l){n=!0,yield X(f.cancel(l))}finally{n===!1?yield X(f.cancel()):r.locked&&f.releaseLock()}return yield X(null)})}function eE(r){return bt(this,arguments,function*(){let t=[],n="error",s=!1,i=null,o,a,c=0,u=[],f;function l(){return o==="peek"?qt(u,a)[0]:([f,u,c]=qt(u,a),f)}if({cmd:o,size:a}=(yield yield X(null))||{cmd:"read",size:0},r.isTTY)return yield yield X(new Uint8Array(0)),yield X(null);try{t[0]=yd(r,"end"),t[1]=yd(r,"error");do{if(t[2]=yd(r,"readable"),[n,i]=yield X(Promise.race(t.map(h=>h[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(f=D(r.read(a-c)),f.byteLength<a-c&&(f=D(r.read()))):f=D(r.read()),f.byteLength>0&&(u.push(f),c+=f.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield X(l()));while(a<c)}while(!s)}finally{yield X(d(t,n==="error"?i:null))}return yield X(null);function d(h,m){return f=u=null,new Promise((b,w)=>{for(let[g,x]of h)r.off(g,x);try{let g=r.destroy;g&&g.call(r,m),m=void 0}catch(g){m=g||m}finally{m!=null?w(m):b()}})}})}var Xe,uu,wd,yd,La=p(()=>{Bt();$e();Xe={fromIterable(r){return uu(YS(r))},fromAsyncIterable(r){return uu(QS(r))},fromDOMStream(r){return uu(ZS(r))},fromNodeStream(r){return uu(eE(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}},uu=r=>(r.next(),r);wd=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return B(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return B(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=D(t)),t})}},yd=(r,e)=>{let t=s=>n([e,s]),n;return[e,t,new Promise(s=>(n=s)&&r.once(e,t))]}});var me,fu=p(()=>{(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(me||(me={}))});var de,xd=p(()=>{(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(de||(de={}))});var ue,Td=p(()=>{(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(ue||(ue={}))});var ge,_d=p(()=>{(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(ge||(ge={}))});var S,Sa=p(()=>{(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(S||(S={}))});var ie,Ad=p(()=>{(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ie||(ie={}))});var lu=p(()=>{});var Gr,du,hu,lo,vd=p(()=>{Gr=new Int32Array(2),du=new Float32Array(Gr.buffer),hu=new Float64Array(Gr.buffer),lo=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Ea,Id=p(()=>{(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ea||(Ea={}))});var Je,Ld=p(()=>{lu();Id();vd();Je=class r{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new r(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Gr[0]=this.readInt32(e),du[0]}readFloat64(e){return Gr[lo?0:1]=this.readInt32(e),Gr[lo?1:0]=this.readInt32(e+4),hu[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){du[0]=t,this.writeInt32(e,Gr[0])}writeFloat64(e,t){hu[0]=t,this.writeInt32(e,Gr[lo?0:1]),this.writeInt32(e+4,Gr[lo?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<4;t++)e+=String.fromCharCode(this.readInt8(this.position_+4+t));return e}__offset(e,t){let n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);let n=this.readInt32(e);e+=4;let s=this.bytes_.subarray(e,e+n);return t===Ea.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let t=0;t<4;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+4+t))return!1;return!0}createScalarList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i)}return n}createObjList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i.unpack())}return n}}});var ti,qy=p(()=>{Ld();lu();ti=class r{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let t;e?t=e:t=1024,this.bb=Je.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<n+e+t;){let s=this.bb.capacity();this.bb=r.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,n){(this.force_defaults||t!==n)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,n){t!=n&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=t<<1,s=Je.allocate(n);return s.setPosition(n-t),s.bytes().set(e.bytes(),n-t),s}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let s=2;this.addInt16(e-this.object_start);let i=(n+s)*2;this.addInt16(i);let o=0,a=this.space;e:for(t=0;t<this.vtables.length;t++){let c=this.bb.capacity()-this.vtables[t];if(i==this.bb.readInt16(c)){for(let u=2;u<i;u+=2)if(this.bb.readInt16(a+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,n){let s=n?4:0;if(t){let i=t;if(this.prep(this.minalign,8+s),i.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(i.charCodeAt(o))}this.prep(this.minalign,4+s),this.addOffset(e),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,s=n-this.bb.readInt32(n);if(!(t<this.bb.readInt16(s)&&this.bb.readInt16(s+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(4,e*t),this.prep(n,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let t=[];for(let n=0;n<e.length;++n){let s=e[n];if(s!==null)t.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var oe=p(()=>{lu();vd();qy();Ld();Id()});var ri,Sd=p(()=>{(function(r){r[r.BUFFER=0]="BUFFER"})(ri||(ri={}))});var Ye,ho=p(()=>{(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(Ye||(Ye={}))});var ln,Ed=p(()=>{oe();Sd();ho();ln=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Ye.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):ri.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,Ye.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,ri.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return r.startBodyCompression(e),r.addCodec(e,t),r.addMethod(e,n),r.endBodyCompression(e)}}});var po,Bd=p(()=>{po=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var mo,Fd=p(()=>{mo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var nt,Od=p(()=>{oe();Ed();Bd();Fd();nt=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new mo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new po).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new ln).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}variadicBufferCounts(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static addVariadicBufferCounts(e,t){e.addFieldOffset(4,t,0)}static createVariadicBufferCountsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startVariadicBufferCountsVector(e,t){e.startVector(8,t,8)}static endRecordBatch(e){return e.endObject()}}});var dn,Ky=p(()=>{oe();Od();dn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new nt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}}});var $n,Md=p(()=>{(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})($n||($n={}))});var Ba,Hy=p(()=>{(function(r){r[r.DenseArray=0]="DenseArray"})(Ba||(Ba={}))});var vr,mu=p(()=>{oe();vr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return r.startInt(e),r.addBitWidth(e,t),r.addIsSigned(e,n),r.endInt(e)}}});var Pr,Rd=p(()=>{oe();Hy();mu();Pr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new vr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Ba.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,Ba.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Be,bo=p(()=>{oe();Be=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return r.startKeyValue(e),r.addKey(e,t),r.addValue(e,n),r.endKeyValue(e)}}});var Fa,Xy=p(()=>{oe();Fa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return r.startBinary(e),r.endBinary(e)}}});var Oa,Jy=p(()=>{oe();Oa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinaryView(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return r.startBinaryView(e),r.endBinaryView(e)}}});var Ma,Yy=p(()=>{oe();Ma=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return r.startBool(e),r.endBool(e)}}});var qn,Dd=p(()=>{oe();_d();qn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ge.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ge.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return r.startDate(e),r.addUnit(e,t),r.endDate(e)}}});var zr,Nd=p(()=>{oe();zr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,s){return r.startDecimal(e),r.addPrecision(e,t),r.addScale(e,n),r.addBitWidth(e,s),r.endDecimal(e)}}});var Kn,kd=p(()=>{oe();Sa();Kn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):S.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,S.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return r.startDuration(e),r.addUnit(e,t),r.endDuration(e)}}});var Hn,Cd=p(()=>{oe();Hn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return r.startFixedSizeBinary(e),r.addByteWidth(e,t),r.endFixedSizeBinary(e)}}});var Xn,jd=p(()=>{oe();Xn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return r.startFixedSizeList(e),r.addListSize(e,t),r.endFixedSizeList(e)}}});var Jn,Vd=p(()=>{oe();Td();Jn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ue.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,ue.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return r.startFloatingPoint(e),r.addPrecision(e,t),r.endFloatingPoint(e)}}});var Yn,Ud=p(()=>{oe();Ad();Yn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ie.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ie.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return r.startInterval(e),r.addUnit(e,t),r.endInterval(e)}}});var Ra,Qy=p(()=>{oe();Ra=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return r.startLargeBinary(e),r.endLargeBinary(e)}}});var Da,Zy=p(()=>{oe();Da=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return r.startLargeList(e),r.endLargeList(e)}}});var Na,ew=p(()=>{oe();Na=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return r.startLargeUtf8(e),r.endLargeUtf8(e)}}});var ka,tw=p(()=>{oe();ka=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return r.startList(e),r.endList(e)}}});var Qn,Gd=p(()=>{oe();Qn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return r.startMap(e),r.addKeysSorted(e,t),r.endMap(e)}}});var Ca,rw=p(()=>{oe();Ca=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return r.startNull(e),r.endNull(e)}}});var ja,nw=p(()=>{oe();ja=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return r.startStruct_(e),r.endStruct_(e)}}});var hn,Pd=p(()=>{oe();Sa();hn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):S.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,S.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return r.startTime(e),r.addUnit(e,t),r.addBitWidth(e,n),r.endTime(e)}}});var pn,zd=p(()=>{oe();Sa();pn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):S.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,S.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return r.startTimestamp(e),r.addUnit(e,t),r.addTimezone(e,n),r.endTimestamp(e)}}});var Ir,Wd=p(()=>{oe();xd();Ir=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):de.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,de.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return r.startUnion(e),r.addMode(e,t),r.addTypeIds(e,n),r.endUnion(e)}}});var Va,sw=p(()=>{oe();Va=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return r.startUtf8(e),r.endUtf8(e)}}});var Ua,iw=p(()=>{oe();Ua=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8View(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return r.startUtf8View(e),r.endUtf8View(e)}}});var P,bu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.ListView=25]="ListView",r[r.LargeListView=26]="LargeListView"})(P||(P={}))});var st,$d=p(()=>{oe();Rd();bo();bu();st=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):P.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Pr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new r).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,P.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}}});var Ft,qd=p(()=>{oe();Md();$d();bo();Ft=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):$n.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new st).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,$n.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static createSchema(e,t,n,s,i){return r.startSchema(e),r.addEndianness(e,t),r.addFields(e,n),r.addCustomMetadata(e,s),r.addFeatures(e,i),r.endSchema(e)}}});var ne,gu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(ne||(ne={}))});var y,te,Fe=p(()=>{fu();xd();Td();_d();Sa();Ad();gu();(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond",r[r.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(y||(y={}));(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(te||(te={}))});var Kd={};Q(Kd,{valueToString:()=>Lr});function Lr(r){if(r===null)return"null";if(r===void 0)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(e=>Lr(e))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(e,t)=>typeof t=="bigint"?`${t}`:t)}var Ga=p(()=>{});function ee(r){if(typeof r=="bigint"&&(r<Number.MIN_SAFE_INTEGER||r>Number.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Hd(r,e){return ee(r/e)+ee(r%e)/ee(e)}var Wr=p(()=>{});var Yd={};Q(Yd,{BN:()=>ni,bigNumToBigInt:()=>aw,bigNumToNumber:()=>Jd,bigNumToString:()=>wo,isArrowBigNumSymbol:()=>ow});function Sr(r,...e){return e.length===0?Object.setPrototypeOf(Z(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}function go(...r){return Sr.apply(this,r)}function yo(...r){return Sr.apply(this,r)}function Pa(...r){return Sr.apply(this,r)}function Jd(r,e){let{buffer:t,byteOffset:n,byteLength:s,signed:i}=r,o=new BigUint64Array(t,n,s/8),a=i&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(a){for(let f of o)c|=(f^rE)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let f of o)c|=f*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let f=BigInt("1".padEnd(e+1,"0")),l=c/f,d=a?-(c%f):c%f,h=ee(l),m=`${d}`.padStart(e,"0");return+`${a&&h===0?"-":""}${h}.${m}`}return ee(c)}function wo(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return Xd(r);let e=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return Xd(r);e=e.slice();let n=1;for(let i=0;i<e.length;i++){let o=e[i],a=~o+n;e[i]=a,n&=o===0?1:0}return`-${Xd(e)}`}function aw(r){return r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:wo(r)}function Xd(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),i=-1,o=n.length-1;do{for(t[0]=n[i=0];i<o;)n[i++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[i];n[i]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(s[0]||s[1]||s[2]||s[3]);return e??"0"}var ow,tE,rE,ni,yu=p(()=>{$e();Wr();ow=Symbol.for("isArrowBigNum");Sr.prototype[ow]=!0;Sr.prototype.toJSON=function(){return`"${wo(this)}"`};Sr.prototype.valueOf=function(r){return Jd(this,r)};Sr.prototype.toString=function(){return wo(this)};Sr.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Jd(this);case"string":return wo(this);case"default":return aw(this)}return wo(this)};Object.setPrototypeOf(go.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(yo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Pa.prototype,Object.create(Uint32Array.prototype));Object.assign(go.prototype,Sr.prototype,{constructor:go,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(yo.prototype,Sr.prototype,{constructor:yo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Pa.prototype,Sr.prototype,{constructor:Pa,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});tE=BigInt(4294967296)*BigInt(4294967296),rE=tE-BigInt(1);ni=class r{static new(e,t){switch(t){case!0:return new go(e);case!1:return new yo(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new go(e)}return e.byteLength===16?new Pa(e):new yo(e)}static signed(e){return new go(e)}static unsigned(e){return new yo(e)}static decimal(e){return new Pa(e)}constructor(e,t){return r.new(e,t)}}});function er(r){let e=r;switch(r.typeId){case y.Decimal:return r.bitWidth/32;case y.Interval:return e.unit===ie.MONTH_DAY_NANO?4:1+e.unit;case y.BinaryView:case y.Utf8View:return 16;case y.FixedSizeList:return e.listSize;case y.FixedSizeBinary:return e.byteWidth;default:return 1}}var cw,uw,fw,lw,dw,hw,pw,mw,bw,gw,yw,ww,xw,Tw,_w,Aw,vw,Iw,Lw,Sw,Ew,Bw,Fw,Ow,Mw,Rw,L,De,Ee,Kt,Ht,ke,Xt,Jt,Yt,yt,Er,it,Br,wt,Qt,Ot,Y,Fr,ot,xt,Or,at,Mt,Tt,Zn,es,Qe,ts,rs,ns,ss,Ze,is,$r,os,as,ct,cs,us,za,_t,Wa,$a,qa,Ka,Ve,Zt,he,At,mn,fs,Rt,Se,ut,nE,Ue,ye=p(()=>{Wr();Fe();Rw=Symbol.for("apache-arrow/DataType"),L=class r{static isDataType(e){return e?.[Rw]===!0}static isNull(e){return e?.typeId===y.Null}static isInt(e){return e?.typeId===y.Int}static isFloat(e){return e?.typeId===y.Float}static isBinary(e){return e?.typeId===y.Binary}static isBinaryView(e){return e?.typeId===y.BinaryView}static isLargeBinary(e){return e?.typeId===y.LargeBinary}static isUtf8(e){return e?.typeId===y.Utf8}static isUtf8View(e){return e?.typeId===y.Utf8View}static isLargeUtf8(e){return e?.typeId===y.LargeUtf8}static isBool(e){return e?.typeId===y.Bool}static isDecimal(e){return e?.typeId===y.Decimal}static isDate(e){return e?.typeId===y.Date}static isTime(e){return e?.typeId===y.Time}static isTimestamp(e){return e?.typeId===y.Timestamp}static isInterval(e){return e?.typeId===y.Interval}static isDuration(e){return e?.typeId===y.Duration}static isList(e){return e?.typeId===y.List}static isLargeList(e){return e?.typeId===y.LargeList}static isStruct(e){return e?.typeId===y.Struct}static isUnion(e){return e?.typeId===y.Union}static isFixedSizeBinary(e){return e?.typeId===y.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===y.FixedSizeList}static isMap(e){return e?.typeId===y.Map}static isDictionary(e){return e?.typeId===y.Dictionary}static isDenseUnion(e){return r.isUnion(e)&&e.mode===de.Dense}static isSparseUnion(e){return r.isUnion(e)&&e.mode===de.Sparse}constructor(e){this.typeId=e}};cw=Symbol.toStringTag;L[cw]=(r=>(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Rw]=!0,r[Symbol.toStringTag]="DataType"))(L.prototype);De=class extends L{constructor(){super(y.Null)}toString(){return"Null"}};uw=Symbol.toStringTag;De[uw]=(r=>r[Symbol.toStringTag]="Null")(De.prototype);Ee=class extends L{constructor(e,t){super(y.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};fw=Symbol.toStringTag;Ee[fw]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Ee.prototype);Kt=class extends Ee{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Ht=class extends Ee{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ke=class extends Ee{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Xt=class extends Ee{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Jt=class extends Ee{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Yt=class extends Ee{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},yt=class extends Ee{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Er=class extends Ee{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Kt.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Ht.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ke.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Xt.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Jt.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Yt.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(yt.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Er.prototype,"ArrayType",{value:BigUint64Array});it=class extends L{constructor(e){super(y.Float),this.precision=e}get ArrayType(){switch(this.precision){case ue.HALF:return Uint16Array;case ue.SINGLE:return Float32Array;case ue.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};lw=Symbol.toStringTag;it[lw]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(it.prototype);Br=class extends it{constructor(){super(ue.HALF)}},wt=class extends it{constructor(){super(ue.SINGLE)}},Qt=class extends it{constructor(){super(ue.DOUBLE)}};Object.defineProperty(Br.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(wt.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Qt.prototype,"ArrayType",{value:Float64Array});Ot=class extends L{constructor(){super(y.Binary)}toString(){return"Binary"}};dw=Symbol.toStringTag;Ot[dw]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ot.prototype);Y=class extends L{constructor(){super(y.BinaryView)}toString(){return"BinaryView"}};hw=Symbol.toStringTag;Y.ELEMENT_WIDTH=16;Y.INLINE_CAPACITY=12;Y.LENGTH_OFFSET=0;Y.INLINE_OFFSET=4;Y.BUFFER_INDEX_OFFSET=8;Y.BUFFER_OFFSET_OFFSET=12;Y[hw]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="BinaryView"))(Y.prototype);Fr=class extends L{constructor(){super(y.LargeBinary)}toString(){return"LargeBinary"}};pw=Symbol.toStringTag;Fr[pw]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Fr.prototype);ot=class extends L{constructor(){super(y.Utf8)}toString(){return"Utf8"}};mw=Symbol.toStringTag;ot[mw]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ot.prototype);xt=class extends L{constructor(){super(y.Utf8View)}toString(){return"Utf8View"}};bw=Symbol.toStringTag;xt.ELEMENT_WIDTH=Y.ELEMENT_WIDTH;xt.INLINE_CAPACITY=Y.INLINE_CAPACITY;xt[bw]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8View"))(xt.prototype);Or=class extends L{constructor(){super(y.LargeUtf8)}toString(){return"LargeUtf8"}};gw=Symbol.toStringTag;Or[gw]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Or.prototype);at=class extends L{constructor(){super(y.Bool)}toString(){return"Bool"}};yw=Symbol.toStringTag;at[yw]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(at.prototype);Mt=class extends L{constructor(e,t,n=128){super(y.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};ww=Symbol.toStringTag;Mt[ww]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Mt.prototype);Tt=class extends L{constructor(e){super(y.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ge[this.unit]}>`}get ArrayType(){return this.unit===ge.DAY?Int32Array:BigInt64Array}};xw=Symbol.toStringTag;Tt[xw]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Tt.prototype);Zn=class extends Tt{constructor(){super(ge.DAY)}},es=class extends Tt{constructor(){super(ge.MILLISECOND)}},Qe=class extends L{constructor(e,t){super(y.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${S[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Tw=Symbol.toStringTag;Qe[Tw]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Qe.prototype);ts=class extends Qe{constructor(){super(S.SECOND,32)}},rs=class extends Qe{constructor(){super(S.MILLISECOND,32)}},ns=class extends Qe{constructor(){super(S.MICROSECOND,64)}},ss=class extends Qe{constructor(){super(S.NANOSECOND,64)}},Ze=class extends L{constructor(e,t){super(y.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${S[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};_w=Symbol.toStringTag;Ze[_w]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Ze.prototype);is=class extends Ze{constructor(e){super(S.SECOND,e)}},$r=class extends Ze{constructor(e){super(S.MILLISECOND,e)}},os=class extends Ze{constructor(e){super(S.MICROSECOND,e)}},as=class extends Ze{constructor(e){super(S.NANOSECOND,e)}},ct=class extends L{constructor(e){super(y.Interval),this.unit=e}toString(){return`Interval<${ie[this.unit]}>`}};Aw=Symbol.toStringTag;ct[Aw]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(ct.prototype);cs=class extends ct{constructor(){super(ie.DAY_TIME)}},us=class extends ct{constructor(){super(ie.YEAR_MONTH)}},za=class extends ct{constructor(){super(ie.MONTH_DAY_NANO)}},_t=class extends L{constructor(e){super(y.Duration),this.unit=e}toString(){return`Duration<${S[this.unit]}>`}};vw=Symbol.toStringTag;_t[vw]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(_t.prototype);Wa=class extends _t{constructor(){super(S.SECOND)}},$a=class extends _t{constructor(){super(S.MILLISECOND)}},qa=class extends _t{constructor(){super(S.MICROSECOND)}},Ka=class extends _t{constructor(){super(S.NANOSECOND)}},Ve=class extends L{constructor(e){super(y.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Iw=Symbol.toStringTag;Ve[Iw]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Ve.prototype);Zt=class extends L{constructor(e){super(y.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Lw=Symbol.toStringTag;Zt[Lw]=(r=>(r.children=null,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeList"))(Zt.prototype);he=class extends L{constructor(e){super(y.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};Sw=Symbol.toStringTag;he[Sw]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(he.prototype);At=class extends L{constructor(e,t,n){super(y.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((s,i,o)=>(s[i]=o)&&s||s,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};Ew=Symbol.toStringTag;At[Ew]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(At.prototype);mn=class extends At{constructor(e,t){super(de.Dense,e,t)}},fs=class extends At{constructor(e,t){super(de.Sparse,e,t)}},Rt=class extends L{constructor(e){super(y.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Bw=Symbol.toStringTag;Rt[Bw]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Rt.prototype);Se=class extends L{constructor(e,t){super(y.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Fw=Symbol.toStringTag;Se[Fw]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Se.prototype);ut=class extends L{constructor(e,t=!1){var n,s,i;if(super(y.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((n=e?.type)===null||n===void 0)&&n.children)){let o=(s=e?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");let a=(i=e?.type)===null||i===void 0?void 0:i.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};Ow=Symbol.toStringTag;ut[Ow]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(ut.prototype);nE=(r=>()=>++r)(-1),Ue=class extends L{constructor(e,t,n,s){super(y.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=s||!1,this.id=n==null?nE():ee(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};Mw=Symbol.toStringTag;Ue[Mw]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Ue.prototype)});function sE(r,e,t=!0){return typeof e=="number"?xo(r,e,t):typeof e=="string"&&e in y?xo(r,y[e],t):e&&e instanceof L?xo(r,Nw(e),t):e?.type&&e.type instanceof L?xo(r,Nw(e.type),t):xo(r,y.NONE,t)}function xo(r,e,t=!0){let n=null;switch(e){case y.Null:n=r.visitNull;break;case y.Bool:n=r.visitBool;break;case y.Int:n=r.visitInt;break;case y.Int8:n=r.visitInt8||r.visitInt;break;case y.Int16:n=r.visitInt16||r.visitInt;break;case y.Int32:n=r.visitInt32||r.visitInt;break;case y.Int64:n=r.visitInt64||r.visitInt;break;case y.Uint8:n=r.visitUint8||r.visitInt;break;case y.Uint16:n=r.visitUint16||r.visitInt;break;case y.Uint32:n=r.visitUint32||r.visitInt;break;case y.Uint64:n=r.visitUint64||r.visitInt;break;case y.Float:n=r.visitFloat;break;case y.Float16:n=r.visitFloat16||r.visitFloat;break;case y.Float32:n=r.visitFloat32||r.visitFloat;break;case y.Float64:n=r.visitFloat64||r.visitFloat;break;case y.Utf8:n=r.visitUtf8;break;case y.LargeUtf8:n=r.visitLargeUtf8;break;case y.Utf8View:n=r.visitUtf8View||r.visitUtf8;break;case y.Binary:n=r.visitBinary;break;case y.LargeBinary:n=r.visitLargeBinary;break;case y.BinaryView:n=r.visitBinaryView||r.visitBinary;break;case y.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case y.Date:n=r.visitDate;break;case y.DateDay:n=r.visitDateDay||r.visitDate;break;case y.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case y.Timestamp:n=r.visitTimestamp;break;case y.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case y.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case y.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case y.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case y.Time:n=r.visitTime;break;case y.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case y.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case y.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case y.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case y.Decimal:n=r.visitDecimal;break;case y.List:n=r.visitList;break;case y.LargeList:n=r.visitLargeList;break;case y.Struct:n=r.visitStruct;break;case y.Union:n=r.visitUnion;break;case y.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case y.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case y.Dictionary:n=r.visitDictionary;break;case y.Interval:n=r.visitInterval;break;case y.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case y.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case y.IntervalMonthDayNano:n=r.visitIntervalMonthDayNano||r.visitInterval;break;case y.Duration:n=r.visitDuration;break;case y.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case y.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case y.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case y.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case y.FixedSizeList:n=r.visitFixedSizeList;break;case y.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${y[e]}'`)}function Nw(r){switch(r.typeId){case y.Null:return y.Null;case y.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?y.Int8:y.Uint8;case 16:return t?y.Int16:y.Uint16;case 32:return t?y.Int32:y.Uint32;case 64:return t?y.Int64:y.Uint64}return y.Int}case y.Float:switch(r.precision){case ue.HALF:return y.Float16;case ue.SINGLE:return y.Float32;case ue.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.LargeBinary:return y.LargeBinary;case y.BinaryView:return y.BinaryView;case y.Utf8:return y.Utf8;case y.LargeUtf8:return y.LargeUtf8;case y.Utf8View:return y.Utf8View;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(r.unit){case S.SECOND:return y.TimeSecond;case S.MILLISECOND:return y.TimeMillisecond;case S.MICROSECOND:return y.TimeMicrosecond;case S.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(r.unit){case S.SECOND:return y.TimestampSecond;case S.MILLISECOND:return y.TimestampMillisecond;case S.MICROSECOND:return y.TimestampMicrosecond;case S.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(r.unit){case ge.DAY:return y.DateDay;case ge.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(r.unit){case ie.DAY_TIME:return y.IntervalDayTime;case ie.YEAR_MONTH:return y.IntervalYearMonth;case ie.MONTH_DAY_NANO:return y.IntervalMonthDayNano}return y.Interval;case y.Duration:switch(r.unit){case S.SECOND:return y.DurationSecond;case S.MILLISECOND:return y.DurationMillisecond;case S.MICROSECOND:return y.DurationMicrosecond;case S.NANOSECOND:return y.DurationNanosecond}return y.Duration;case y.Map:return y.Map;case y.List:return y.List;case y.LargeList:return y.LargeList;case y.Struct:return y.Struct;case y.Union:switch(r.mode){case de.Dense:return y.DenseUnion;case de.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw new Error(`Unrecognized type '${y[r.typeId]}'`)}var R,Dt=p(()=>{Fe();ye();R=class{visitMany(e,...t){return e.map((n,s)=>this.visit(n,...t.map(i=>i[s])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return sE(this,e,t)}getVisitFnByTypeId(e,t=!0){return xo(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitUtf8View(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitBinaryView(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitLargeList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;R.prototype.visitIntervalMonthDayNano=null;R.prototype.visitDuration=null;R.prototype.visitDurationSecond=null;R.prototype.visitDurationMillisecond=null;R.prototype.visitDurationMicrosecond=null;R.prototype.visitDurationNanosecond=null});var Qd={};Q(Qd,{float64ToUint16:()=>Ha,uint16ToFloat64:()=>wu});function wu(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(e){case 31:return n*(t?Number.NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*Math.pow(2,e-15)*(1+t)}function Ha(r){if(r!==r)return 32256;kw[0]=r;let e=(To[1]&2147483648)>>16&65535,t=To[1]&2146435072,n=0;return t>=1089470464?To[0]>0?t=31744:(t=(t&2080374784)>>16,n=(To[1]&1048575)>>10):t<=1056964608?(n=1048576+(To[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(To[1]&1048575)+512>>10),e|t|n&65535}var kw,To,Xa=p(()=>{kw=new Float64Array(1),To=new Uint32Array(kw.buffer)});function $(r){return(e,t,n)=>{if(e.setValid(t,n!=null))return r(e,t,n)}}var G,iE,Cw,oE,bn,Zd,jw,aE,xu,Tu,eh,Vw,cE,Uw,uE,Gw,fE,th,_u,Au,vu,Iu,rh,Lu,Su,Eu,Bu,nh,sh,Pw,lE,dE,hE,pE,mE,bE,gE,zw,Ww,yE,ih,Fu,Ou,Mu,Ru,Du,Nu,ku,oh,wE,et,tr=p(()=>{ft();Dt();Wr();fn();Xa();Fe();ye();G=class extends R{};iE=(r,e,t)=>{r[e]=Math.floor(t/864e5)},Cw=(r,e,t,n)=>{if(t+1<e.length){let s=ee(e[t]),i=ee(e[t+1]);r.set(n.subarray(0,i-s),s)}},oE=({offset:r,values:e},t,n)=>{let s=r+t;n?e[s>>3]|=1<<s%8:e[s>>3]&=~(1<<s%8)},bn=({values:r},e,t)=>{r[e]=t},Zd=({values:r},e,t)=>{r[e]=t},jw=({values:r},e,t)=>{r[e]=Ha(t)},aE=(r,e,t)=>{switch(r.type.precision){case ue.HALF:return jw(r,e,t);case ue.SINGLE:case ue.DOUBLE:return Zd(r,e,t)}},xu=({values:r},e,t)=>{iE(r,e,t.valueOf())},Tu=({values:r},e,t)=>{r[e]=BigInt(t)},eh=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},Vw=({values:r,valueOffsets:e},t,n)=>Cw(r,e,t,n),cE=r=>{let e=r.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),r.variadicBuffers=e),e},Uw=(r,e,t)=>{var n,s,i,o;let a=r.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Y.ELEMENT_WIDTH,u=e*c,f=u+c;if(u<0||f>a.length)throw new RangeError(`BinaryView index ${e} out of bounds`);a.fill(0,u,f);let l=new DataView(a.buffer,a.byteOffset+u,c),d=t.length;if(l.setInt32(Y.LENGTH_OFFSET,d,!0),d<=Y.INLINE_CAPACITY){a.set(t,u+Y.INLINE_OFFSET);return}let h=((n=t[0])!==null&&n!==void 0?n:0)|((s=t[1])!==null&&s!==void 0?s:0)<<8|((i=t[2])!==null&&i!==void 0?i:0)<<16|((o=t[3])!==null&&o!==void 0?o:0)<<24;l.setUint32(Y.INLINE_OFFSET,h>>>0,!0);let m=cE(r),b=t.slice(),w=m.push(b)-1;l.setInt32(Y.BUFFER_INDEX_OFFSET,w,!0),l.setInt32(Y.BUFFER_OFFSET_OFFSET,0,!0)},uE=(r,e,t)=>{let n=t instanceof Uint8Array?t:new Uint8Array(t);Uw(r,e,n)},Gw=({values:r,valueOffsets:e},t,n)=>Cw(r,e,t,Wt(n)),fE=(r,e,t)=>{let n=Wt(t);Uw(r,e,n)},th=(r,e,t)=>{r.type.unit===ge.DAY?xu(r,e,t):Tu(r,e,t)},_u=({values:r},e,t)=>{r[e]=BigInt(t/1e3)},Au=({values:r},e,t)=>{r[e]=BigInt(t)},vu=({values:r},e,t)=>{r[e]=BigInt(t*1e3)},Iu=({values:r},e,t)=>{r[e]=BigInt(t*1e6)},rh=(r,e,t)=>{switch(r.type.unit){case S.SECOND:return _u(r,e,t);case S.MILLISECOND:return Au(r,e,t);case S.MICROSECOND:return vu(r,e,t);case S.NANOSECOND:return Iu(r,e,t)}},Lu=({values:r},e,t)=>{r[e]=t},Su=({values:r},e,t)=>{r[e]=t},Eu=({values:r},e,t)=>{r[e]=t},Bu=({values:r},e,t)=>{r[e]=t},nh=(r,e,t)=>{switch(r.type.unit){case S.SECOND:return Lu(r,e,t);case S.MILLISECOND:return Su(r,e,t);case S.MICROSECOND:return Eu(r,e,t);case S.NANOSECOND:return Bu(r,e,t)}},sh=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},Pw=(r,e,t)=>{let n=r.children[0],s=r.valueOffsets,i=et.getVisitFn(n),o=ee(s[e]),a=ee(s[e+1]);if(Array.isArray(t))for(let c=-1,u=o;u<a;)i(n,u++,t[++c]);else for(let c=-1,u=o;u<a;)i(n,u++,t.get(++c))},lE=(r,e,t)=>{let n=r.children[0],{valueOffsets:s}=r,i=et.getVisitFn(n),{[e]:o,[e+1]:a}=s,c=t instanceof Map?t.entries():Object.entries(t);for(let u of c)if(i(n,o,u),++o>=a)break},dE=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[i]),hE=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(i)),pE=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(s.name)),mE=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[s.name]),bE=(r,e,t)=>{let n=r.type.children.map(i=>et.getVisitFn(i.type)),s=t instanceof Map?pE(e,t):t instanceof E?hE(e,t):Array.isArray(t)?dE(e,t):mE(e,t);r.type.children.forEach((i,o)=>s(n[o],r.children[o],i,o))},gE=(r,e,t)=>{r.type.mode===de.Dense?zw(r,e,t):Ww(r,e,t)},zw=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];et.visit(s,r.valueOffsets[e],t)},Ww=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];et.visit(s,e,t)},yE=(r,e,t)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[e],t)},ih=(r,e,t)=>{switch(r.type.unit){case ie.YEAR_MONTH:return Ou(r,e,t);case ie.DAY_TIME:return Fu(r,e,t);case ie.MONTH_DAY_NANO:return Mu(r,e,t)}},Fu=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Ou=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},Mu=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},Ru=({values:r},e,t)=>{r[e]=t},Du=({values:r},e,t)=>{r[e]=t},Nu=({values:r},e,t)=>{r[e]=t},ku=({values:r},e,t)=>{r[e]=t},oh=(r,e,t)=>{switch(r.type.unit){case S.SECOND:return Ru(r,e,t);case S.MILLISECOND:return Du(r,e,t);case S.MICROSECOND:return Nu(r,e,t);case S.NANOSECOND:return ku(r,e,t)}},wE=(r,e,t)=>{let{stride:n}=r,s=r.children[0],i=et.getVisitFn(s);if(Array.isArray(t))for(let o=-1,a=e*n;++o<n;)i(s,a+o,t[o]);else for(let o=-1,a=e*n;++o<n;)i(s,a+o,t.get(o))};G.prototype.visitBool=$(oE);G.prototype.visitInt=$(bn);G.prototype.visitInt8=$(bn);G.prototype.visitInt16=$(bn);G.prototype.visitInt32=$(bn);G.prototype.visitInt64=$(bn);G.prototype.visitUint8=$(bn);G.prototype.visitUint16=$(bn);G.prototype.visitUint32=$(bn);G.prototype.visitUint64=$(bn);G.prototype.visitFloat=$(aE);G.prototype.visitFloat16=$(jw);G.prototype.visitFloat32=$(Zd);G.prototype.visitFloat64=$(Zd);G.prototype.visitUtf8=$(Gw);G.prototype.visitLargeUtf8=$(Gw);G.prototype.visitUtf8View=$(fE);G.prototype.visitBinary=$(Vw);G.prototype.visitLargeBinary=$(Vw);G.prototype.visitBinaryView=$(uE);G.prototype.visitFixedSizeBinary=$(eh);G.prototype.visitDate=$(th);G.prototype.visitDateDay=$(xu);G.prototype.visitDateMillisecond=$(Tu);G.prototype.visitTimestamp=$(rh);G.prototype.visitTimestampSecond=$(_u);G.prototype.visitTimestampMillisecond=$(Au);G.prototype.visitTimestampMicrosecond=$(vu);G.prototype.visitTimestampNanosecond=$(Iu);G.prototype.visitTime=$(nh);G.prototype.visitTimeSecond=$(Lu);G.prototype.visitTimeMillisecond=$(Su);G.prototype.visitTimeMicrosecond=$(Eu);G.prototype.visitTimeNanosecond=$(Bu);G.prototype.visitDecimal=$(sh);G.prototype.visitList=$(Pw);G.prototype.visitLargeList=$(Pw);G.prototype.visitStruct=$(bE);G.prototype.visitUnion=$(gE);G.prototype.visitDenseUnion=$(zw);G.prototype.visitSparseUnion=$(Ww);G.prototype.visitDictionary=$(yE);G.prototype.visitInterval=$(ih);G.prototype.visitIntervalDayTime=$(Fu);G.prototype.visitIntervalYearMonth=$(Ou);G.prototype.visitIntervalMonthDayNano=$(Mu);G.prototype.visitDuration=$(oh);G.prototype.visitDurationSecond=$(Ru);G.prototype.visitDurationMillisecond=$(Du);G.prototype.visitDurationMicrosecond=$(Nu);G.prototype.visitDurationNanosecond=$(ku);G.prototype.visitFixedSizeList=$(wE);G.prototype.visitMap=$(lE);et=new G});var Mr,_o,qr,ah,ch,xE,Cu=p(()=>{Ga();si();tr();Mr=Symbol.for("parent"),_o=Symbol.for("rowIndex"),qr=class{constructor(e,t){return this[Mr]=e,this[_o]=t,new Proxy(this,xE)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[_o],t=this[Mr],n=t.type.children,s={};for(let i=-1,o=n.length;++i<o;)s[n[i].name]=Ge.visit(t.children[i],e);return s}toString(){return`{${[...this].map(([e,t])=>`${Lr(e)}: ${Lr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new ah(this[Mr],this[_o])}},ah=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,Ge.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(qr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Mr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[_o]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});ch=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Mr].type.children.map(t=>t.name)}has(e,t){return e[Mr].type.children.some(n=>n.name===t)}getOwnPropertyDescriptor(e,t){if(e[Mr].type.children.some(n=>n.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Mr].type.children.findIndex(s=>s.name===t);if(n!==-1){let s=Ge.visit(e[Mr].children[n],e[_o]);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Mr].type.children.findIndex(i=>i.name===t);return s!==-1?(et.visit(e[Mr].children[s],e[_o],n),Reflect.set(e,t,n)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,n):!1}},xE=new ch});function z(r){return(e,t)=>e.getValid(t)?r(e,t):null}var C,TE,Ao,_E,AE,$w,vE,qw,Kw,ls,IE,Hw,LE,Xw,Jw,SE,Yw,EE,BE,FE,OE,Qw,Zw,ex,tx,ME,rx,nx,sx,ix,RE,DE,ox,NE,kE,CE,ax,cx,jE,VE,ux,fx,lx,dx,hx,px,mx,UE,GE,Ge,si=p(()=>{yu();ft();Dt();Ja();Cu();Wr();fn();Xa();Fe();C=class extends R{};TE=(r,e)=>864e5*r[e],Ao=16,_E=12,AE=(r,e)=>null,$w=(r,e,t)=>{if(t+1>=e.length)return null;let n=ee(e[t]),s=ee(e[t+1]);return r.subarray(n,s)},vE=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},qw=({values:r},e)=>TE(r,e),Kw=({values:r},e)=>ee(r[e]),ls=({stride:r,values:e},t)=>e[r*t],IE=({stride:r,values:e},t)=>wu(e[r*t]),Hw=({values:r},e)=>r[e],LE=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),Xw=({values:r,valueOffsets:e},t)=>$w(r,e,t),Jw=(r,e)=>{var t;let n=r.values;if(!n)throw new Error("BinaryView data is missing view buffer");let s=e*Ao,i=s+Ao;if(s<0||i>n.length)throw new Error(`BinaryView data buffer is too short: expected ${Ao} bytes, got ${Math.max(0,n.length-s)}`);let o=n.subarray(s,i);if(o.length<Ao)throw new Error(`BinaryView data buffer is too short: expected ${Ao} bytes, got ${o.length}`);let a=new DataView(n.buffer,o.byteOffset,Ao),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=_E)return o.subarray(4,4+c);let u=a.getInt32(8,!0),f=a.getInt32(12,!0),l=(t=r.variadicBuffers)===null||t===void 0?void 0:t[u];if(!l)throw new Error(`BinaryView variadic buffer ${u} is missing`);return l.subarray(f,f+c)},SE=(r,e)=>Jw(r,e),Yw=({values:r,valueOffsets:e},t)=>{let n=$w(r,e,t);return n!==null?fo(n):null},EE=(r,e)=>{let t=Jw(r,e);return fo(t)},BE=({values:r},e)=>r[e],FE=({type:r,values:e},t)=>r.precision!==ue.HALF?e[t]:wu(e[t]),OE=(r,e)=>r.type.unit===ge.DAY?qw(r,e):Kw(r,e),Qw=({values:r},e)=>1e3*ee(r[e]),Zw=({values:r},e)=>ee(r[e]),ex=({values:r},e)=>Hd(r[e],BigInt(1e3)),tx=({values:r},e)=>Hd(r[e],BigInt(1e6)),ME=(r,e)=>{switch(r.type.unit){case S.SECOND:return Qw(r,e);case S.MILLISECOND:return Zw(r,e);case S.MICROSECOND:return ex(r,e);case S.NANOSECOND:return tx(r,e)}},rx=({values:r},e)=>r[e],nx=({values:r},e)=>r[e],sx=({values:r},e)=>r[e],ix=({values:r},e)=>r[e],RE=(r,e)=>{switch(r.type.unit){case S.SECOND:return rx(r,e);case S.MILLISECOND:return nx(r,e);case S.MICROSECOND:return sx(r,e);case S.NANOSECOND:return ix(r,e)}},DE=({values:r,stride:e},t)=>ni.decimal(r.subarray(e*t,e*(t+1))),ox=(r,e)=>{let{valueOffsets:t,stride:n,children:s}=r,i=ee(t[e*n]),o=ee(t[e*n+1]),c=s[0].slice(i,o-i);return new E([c])},NE=(r,e)=>{let{valueOffsets:t,children:n}=r,{[e]:s,[e+1]:i}=t,o=n[0];return new dr(o.slice(s,i-s))},kE=(r,e)=>new qr(r,e),CE=(r,e)=>r.type.mode===de.Dense?ax(r,e):cx(r,e),ax=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return Ge.visit(n,r.valueOffsets[e])},cx=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return Ge.visit(n,e)},jE=(r,e)=>{var t;return(t=r.dictionary)===null||t===void 0?void 0:t.get(r.values[e])},VE=(r,e)=>r.type.unit===ie.MONTH_DAY_NANO?lx(r,e):r.type.unit===ie.DAY_TIME?ux(r,e):fx(r,e),ux=({values:r},e)=>r.subarray(2*e,2*(e+1)),fx=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=Math.trunc(t/12),n[1]=Math.trunc(t%12),n},lx=({values:r},e)=>r.subarray(4*e,4*(e+1)),dx=({values:r},e)=>r[e],hx=({values:r},e)=>r[e],px=({values:r},e)=>r[e],mx=({values:r},e)=>r[e],UE=(r,e)=>{switch(r.type.unit){case S.SECOND:return dx(r,e);case S.MILLISECOND:return hx(r,e);case S.MICROSECOND:return px(r,e);case S.NANOSECOND:return mx(r,e)}},GE=(r,e)=>{let{stride:t,children:n}=r,i=n[0].slice(e*t,t);return new E([i])};C.prototype.visitNull=z(AE);C.prototype.visitBool=z(vE);C.prototype.visitInt=z(BE);C.prototype.visitInt8=z(ls);C.prototype.visitInt16=z(ls);C.prototype.visitInt32=z(ls);C.prototype.visitInt64=z(Hw);C.prototype.visitUint8=z(ls);C.prototype.visitUint16=z(ls);C.prototype.visitUint32=z(ls);C.prototype.visitUint64=z(Hw);C.prototype.visitFloat=z(FE);C.prototype.visitFloat16=z(IE);C.prototype.visitFloat32=z(ls);C.prototype.visitFloat64=z(ls);C.prototype.visitUtf8=z(Yw);C.prototype.visitLargeUtf8=z(Yw);C.prototype.visitUtf8View=z(EE);C.prototype.visitBinary=z(Xw);C.prototype.visitLargeBinary=z(Xw);C.prototype.visitBinaryView=z(SE);C.prototype.visitFixedSizeBinary=z(LE);C.prototype.visitDate=z(OE);C.prototype.visitDateDay=z(qw);C.prototype.visitDateMillisecond=z(Kw);C.prototype.visitTimestamp=z(ME);C.prototype.visitTimestampSecond=z(Qw);C.prototype.visitTimestampMillisecond=z(Zw);C.prototype.visitTimestampMicrosecond=z(ex);C.prototype.visitTimestampNanosecond=z(tx);C.prototype.visitTime=z(RE);C.prototype.visitTimeSecond=z(rx);C.prototype.visitTimeMillisecond=z(nx);C.prototype.visitTimeMicrosecond=z(sx);C.prototype.visitTimeNanosecond=z(ix);C.prototype.visitDecimal=z(DE);C.prototype.visitList=z(ox);C.prototype.visitLargeList=z(ox);C.prototype.visitStruct=z(kE);C.prototype.visitUnion=z(CE);C.prototype.visitDenseUnion=z(ax);C.prototype.visitSparseUnion=z(cx);C.prototype.visitDictionary=z(jE);C.prototype.visitInterval=z(VE);C.prototype.visitIntervalDayTime=z(ux);C.prototype.visitIntervalYearMonth=z(fx);C.prototype.visitIntervalMonthDayNano=z(lx);C.prototype.visitDuration=z(UE);C.prototype.visitDurationSecond=z(dx);C.prototype.visitDurationMillisecond=z(hx);C.prototype.visitDurationMicrosecond=z(px);C.prototype.visitDurationNanosecond=z(mx);C.prototype.visitFixedSizeList=z(GE);C.prototype.visitMap=z(NE);Ge=new C});var ds,Io,vo,uh,dr,fh,lh,Ja=p(()=>{ft();Ga();si();tr();ds=Symbol.for("keys"),Io=Symbol.for("vals"),vo=Symbol.for("kKeysAsStrings"),uh=Symbol.for("_kKeysAsStrings"),dr=class{constructor(e){return this[ds]=new E([e.children[0]]).memoize(),this[Io]=e.children[1],new Proxy(this,new lh)}get[vo](){return this[uh]||(this[uh]=Array.from(this[ds].toArray(),String))}[Symbol.iterator](){return new fh(this[ds],this[Io])}get size(){return this[ds].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ds],t=this[Io],n={};for(let s=-1,i=e.length;++s<i;)n[e.get(s)]=Ge.visit(t,s);return n}toString(){return`{${[...this].map(([e,t])=>`${Lr(e)}: ${Lr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},fh=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),Ge.visit(this.vals,e)]})}},lh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[vo]}has(e,t){return e[vo].includes(t)}getOwnPropertyDescriptor(e,t){if(e[vo].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[vo].indexOf(t);if(n!==-1){let s=Ge.visit(Reflect.get(e,Io),n);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[vo].indexOf(t);return s!==-1?(et.visit(Reflect.get(e,Io),s,n),Reflect.set(e,t,n)):Reflect.has(e,t)?Reflect.set(e,t,n):!1}};Object.defineProperties(dr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ds]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Io]:{writable:!0,enumerable:!1,configurable:!1,value:null},[uh]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var dh={};Q(dh,{clampRange:()=>Ya,createElementComparator:()=>hs,wrapIndex:()=>ii});function Ya(r,e,t,n){let{length:s=0}=r,i=typeof e!="number"?0:e,o=typeof t!="number"?s:t;return i<0&&(i=(i%s+s)%s),o<0&&(o=(o%s+s)%s),o<i&&(bx=i,i=o,o=bx),o>s&&(o=s),n?n(r,i,o):[i,o]}function hs(r){if(typeof r!=="object"||r===null)return gx(r)?gx:t=>t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?bd(r,t):!1:r instanceof Map?zE(r):Array.isArray(r)?PE(r):r instanceof E?WE(r):$E(r,!0)}function PE(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=hs(r[t]);return ju(e)}function zE(r){let e=-1,t=[];for(let n of r.values())t[++e]=hs(n);return ju(t)}function WE(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=hs(r.get(t));return ju(e)}function $E(r,e=!1){let t=Object.keys(r);if(!e&&t.length===0)return()=>!1;let n=[];for(let s=-1,i=t.length;++s<i;)n[s]=hs(r[t[s]]);return ju(n,t)}function ju(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return qE(r,t);case Map:return yx(r,t,t.keys());case dr:case qr:case Object:case void 0:return yx(r,t,e||Object.keys(t))}return t instanceof E?KE(r,t):!1}}function qE(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function KE(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function yx(r,e,t){let n=t[Symbol.iterator](),s=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),i=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,a=r.length,c=i.next(),u=n.next(),f=s.next();for(;o<a&&!u.done&&!f.done&&!c.done&&!(u.value!==f.value||!r[o](c.value));++o,u=n.next(),f=s.next(),c=i.next());return o===a&&u.done&&f.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),i.return&&i.return(),!1)}var bx,ii,gx,Lo=p(()=>{ft();Ja();Cu();$e();ii=(r,e)=>r<0?e+r:r,gx=r=>r!==r});var hh={};Q(hh,{BitIterator:()=>Kr,getBit:()=>Uu,getBool:()=>So,packBools:()=>ai,popcnt_array:()=>wx,popcnt_bit_range:()=>Qa,popcnt_uint32:()=>Vu,setBool:()=>HE,truncateBitmap:()=>oi});function So(r,e,t,n){return(t&1<<n)!==0}function Uu(r,e,t,n){return(t&1<<n)>>n}function HE(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}function oi(r,e,t){let n=t.byteLength+7&-8;if(r>0||t.byteLength<n){let s=new Uint8Array(n);return s.set(r%8===0?t.subarray(r>>3):ai(new Kr(t,r,e,null,So)).subarray(0,n)),s}return t}function ai(r){let e=[],t=0,n=0,s=0;for(let o of r)o&&(s|=1<<n),++n===8&&(e[t++]=s,s=n=0);(t===0||n>0)&&(e[t++]=s);let i=new Uint8Array(e.length+7&-8);return i.set(e),i}function Qa(r,e,t){if(t-e<=0)return 0;if(t-e<8){let i=0;for(let o of new Kr(r,e,t-e,r,Uu))i+=o;return i}let n=t>>3<<3,s=e+(e%8===0?0:8-e%8);return Qa(r,e,s)+Qa(r,n,t)+wx(r,s>>3,n-s>>3)}function wx(r,e,t){let n=0,s=Math.trunc(e),i=new DataView(r.buffer,r.byteOffset,r.byteLength),o=t===void 0?r.byteLength:s+t;for(;o-s>=4;)n+=Vu(i.getUint32(s)),s+=4;for(;o-s>=2;)n+=Vu(i.getUint16(s)),s+=2;for(;o-s>=1;)n+=Vu(i.getUint8(s)),s+=1;return n}function Vu(r){let e=Math.trunc(r);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var Kr,ci=p(()=>{Kr=class{constructor(e,t,n,s,i){this.bytes=e,this.length=n,this.context=s,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function M(r){return JE.visit(r)}var XE,xx,k,ph,JE,hr=p(()=>{ft();Fe();ye();ci();ye();Dt();$e();XE=-1,xx=Symbol.for("apache-arrow/Data"),k=class r{static isData(e){return e?.[xx]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return L.isSparseUnion(e)?this.children.some(t=>t.nullable):L.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:s,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),e+=this.variadicBuffers.reduce((o,a)=>{var c;return o+((c=a?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((o,a)=>o+a.byteLength,e)}get nullCount(){if(L.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let e=this._nullCount,t;return e<=XE&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Qa(t,this.offset,this.offset+this.length)),e}constructor(e,t,n,s,i,o=[],a,c=[]){var u;this.type=e,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let f;i instanceof r?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets,this.variadicBuffers=i.variadicBuffers):(this.stride=er(e),i&&((f=i[0])&&(this.valueOffsets=f),(f=i[1])&&(this.values=f),(f=i[2])&&(this.nullBitmap=f),(f=i[3])&&(this.typeIds=f)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:t}=this;if(L.isUnion(t)){let n=t,s=this.typeIds[e],i=n.typeIdToChildIndex[s],o=this.children[i],a=this.valueOffsets,c=n.mode===de.Dense&&a?Number(a[e]):e;return o.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,t){let n,{type:s}=this;if(L.isUnion(s)){let i=s,o=this.typeIds[e],a=i.typeIdToChildIndex[o],c=this.children[a],u=this.valueOffsets,f=i.mode===de.Dense&&u?Number(u[e]):e;n=c.getValid(f),c.setValid(f,t)}else{let{nullBitmap:i}=this,{offset:o,length:a}=this,c=o+e,u=1<<c%8,f=c>>3;(!i||i.byteLength<=f)&&(i=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(i.set(oi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:i})):Object.assign(this,{nullBitmap:i,_nullCount:0}));let l=i[f];n=(l&u)!==0,i[f]=t?l|u:l&~u}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,n=this.length,s=this._nullCount,i=this,o=this.children,a=this.variadicBuffers){return new r(e,t,n,s,i,o,this.dictionary,a)}slice(e,t){let{stride:n,typeId:s,children:i}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(e,t,n,s);return this.clone(this.type,this.offset+e,t,o,c,i.length===0||this.valueOffsets?i:this._sliceChildren(i,a*e,a*t),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===y.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:t,nullCount:n}=this,s=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);s[t>>3]=(1<<t-(t&-8))-1,n>0&&s.set(oi(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[te.VALIDITY]=s,this.clone(this.type,0,e,n+(e-t),i,this.children,this.variadicBuffers)}_sliceBuffers(e,t,n,s){let i,{buffers:o}=this;if((i=o[te.TYPE])&&(o[te.TYPE]=i.subarray(e,e+t)),L.isBinaryView(this.type)||L.isUtf8View(this.type)){let a=Y.ELEMENT_WIDTH;(i=o[te.DATA])&&(o[te.DATA]=i.subarray(e*a,(e+t)*a))}else(i=o[te.OFFSET])&&(o[te.OFFSET]=i.subarray(e,e+t+1))||(i=o[te.DATA])&&(o[te.DATA]=s===6?i:i.subarray(n*e,n*(e+t)));return o}_sliceChildren(e,t,n){return e.map(s=>s.slice(t,n))}};k.prototype.children=Object.freeze([]);k.prototype[xx]=!0;Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===k&&k.isData(e)}});ph=class r extends R{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:n=0,["length"]:s=0}=e;return new k(t,n,s,s)}visitBool(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitInt(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitFloat(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=ei(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitUtf8View(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=Z(n.ArrayType,e.views),o=D(e.nullBitmap),a=(e.variadicBuffers||[]).map(f=>D(f)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/xt.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new k(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=Ia(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=ei(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitBinaryView(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=Z(n.ArrayType,e.views),o=D(e.nullBitmap),a=(e.variadicBuffers||[]).map(f=>D(f)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/Y.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new k(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=Ia(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/er(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitDate(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/er(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitTimestamp(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/er(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitTime(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/er(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitDecimal(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/er(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=D(e.nullBitmap),o=ei(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,void 0,i],[s])}visitLargeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=D(e.nullBitmap),o=Ia(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,void 0,i],[s])}visitStruct(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=D(e.nullBitmap),{length:o=s.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,void 0,i],s)}visitUnion(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=Z(t.ArrayType,e.typeIds),{["length"]:o=i.length,["nullCount"]:a=-1}=e;if(L.isSparseUnion(t))return new k(t,n,o,a,[void 0,void 0,void 0,i],s);let c=ei(e.valueOffsets);return new k(t,n,o,a,[c,void 0,void 0,i],s)}visitDictionary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.indices.ArrayType,e.data),{["dictionary"]:o=new E([new r().visit({type:t.dictionary})])}=e,{["length"]:a=i.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[void 0,i,s],[],o)}visitInterval(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/er(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitDuration(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitFixedSizeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.valueType})}=e,i=D(e.nullBitmap),{["length"]:o=s.length/er(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,void 0,i],[s])}visitMap(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.childType})}=e,i=D(e.nullBitmap),o=ei(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,void 0,i],[s])}},JE=new ph});function Tx(r){return r.some(e=>e.nullable)}function Gu(r){return r.reduce((e,t)=>e+t.nullCount,0)}function Pu(r){return r.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(r.length+1))}function zu(r,e,t,n){let s=[];for(let i=-1,o=r.length;++i<o;){let a=r[i],c=e[i],{length:u}=a;if(c>=n)break;if(t>=c+u)continue;if(c>=t&&c+u<=n){s.push(a);continue}let f=Math.max(0,t-c),l=Math.min(n-c,u);s.push(a.slice(f,l-f))}return s.length===0&&s.push(r[0].slice(0,0)),s}function mh(r,e,t,n){let s=0,i=0,o=e.length-1;do{if(s>=o-1)return t<e[o]?n(r,s,t-e[s]):null;i=s+Math.trunc((o-s)*.5),t<e[i]?o=i:s=i}while(s<o)}function ec(r,e){return r.getValid(e)}function Eo(r){function e(t,n,s){return r(t[n],s)}return function(t){let n=this.data;return mh(n,this._offsets,t,e)}}function Wu(r){let e;function t(n,s,i){return r(n[s],i,e)}return function(n,s){let i=this.data;e=s;let o=mh(i,this._offsets,n,t);return e=void 0,o}}function $u(r){let e;function t(n,s,i){let o=i,a=0,c=0;for(let u=s-1,f=n.length;++u<f;){let l=n[u];if(~(a=r(l,e,o)))return c+a;o=0,c+=l.length}return-1}return function(n,s){e=n;let i=this.data,o=typeof s!="number"?t(i,0,0):mh(i,this._offsets,s,t);return e=void 0,o}}var Za,qu=p(()=>{Za=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function YE(r,e){return e===null&&r.length>0?0:-1}function QE(r,e){let{nullBitmap:t}=r;if(!t||r.nullCount<=0)return-1;let n=0;for(let s of new Kr(t,r.offset+(e||0),r.length,t,So)){if(!s)return n;++n}return-1}function K(r,e,t){if(e===void 0)return-1;if(e===null)switch(r.typeId){case y.Union:break;case y.Dictionary:break;default:return QE(r,t)}let n=Ge.getVisitFn(r),s=hs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}function _x(r,e,t){let n=Ge.getVisitFn(r),s=hs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}var j,ui,Ku=p(()=>{Fe();Dt();si();ci();Lo();j=class extends R{};j.prototype.visitNull=YE;j.prototype.visitBool=K;j.prototype.visitInt=K;j.prototype.visitInt8=K;j.prototype.visitInt16=K;j.prototype.visitInt32=K;j.prototype.visitInt64=K;j.prototype.visitUint8=K;j.prototype.visitUint16=K;j.prototype.visitUint32=K;j.prototype.visitUint64=K;j.prototype.visitFloat=K;j.prototype.visitFloat16=K;j.prototype.visitFloat32=K;j.prototype.visitFloat64=K;j.prototype.visitUtf8=K;j.prototype.visitLargeUtf8=K;j.prototype.visitUtf8View=K;j.prototype.visitBinary=K;j.prototype.visitLargeBinary=K;j.prototype.visitBinaryView=K;j.prototype.visitFixedSizeBinary=K;j.prototype.visitDate=K;j.prototype.visitDateDay=K;j.prototype.visitDateMillisecond=K;j.prototype.visitTimestamp=K;j.prototype.visitTimestampSecond=K;j.prototype.visitTimestampMillisecond=K;j.prototype.visitTimestampMicrosecond=K;j.prototype.visitTimestampNanosecond=K;j.prototype.visitTime=K;j.prototype.visitTimeSecond=K;j.prototype.visitTimeMillisecond=K;j.prototype.visitTimeMicrosecond=K;j.prototype.visitTimeNanosecond=K;j.prototype.visitDecimal=K;j.prototype.visitList=K;j.prototype.visitLargeList=K;j.prototype.visitStruct=K;j.prototype.visitUnion=K;j.prototype.visitDenseUnion=_x;j.prototype.visitSparseUnion=_x;j.prototype.visitDictionary=K;j.prototype.visitInterval=K;j.prototype.visitIntervalDayTime=K;j.prototype.visitIntervalYearMonth=K;j.prototype.visitIntervalMonthDayNano=K;j.prototype.visitDuration=K;j.prototype.visitDurationSecond=K;j.prototype.visitDurationMillisecond=K;j.prototype.visitDurationMicrosecond=K;j.prototype.visitDurationNanosecond=K;j.prototype.visitFixedSizeList=K;j.prototype.visitMap=K;ui=new j});function W(r){let{type:e}=r;if(r.nullCount===0&&r.stride===1&&(L.isInt(e)&&e.bitWidth!==64||L.isTime(e)&&e.bitWidth!==64||L.isFloat(e)&&e.precision!==ue.HALF))return new Za(r.data.length,n=>{let s=r.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let t=0;return new Za(r.data.length,n=>{let i=r.data[n].length,o=r.slice(t,t+i);return t+=i,new bh(o)})}var V,bh,Bo,Hu=p(()=>{Dt();Fe();ye();qu();V=class extends R{};bh=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};V.prototype.visitNull=W;V.prototype.visitBool=W;V.prototype.visitInt=W;V.prototype.visitInt8=W;V.prototype.visitInt16=W;V.prototype.visitInt32=W;V.prototype.visitInt64=W;V.prototype.visitUint8=W;V.prototype.visitUint16=W;V.prototype.visitUint32=W;V.prototype.visitUint64=W;V.prototype.visitFloat=W;V.prototype.visitFloat16=W;V.prototype.visitFloat32=W;V.prototype.visitFloat64=W;V.prototype.visitUtf8=W;V.prototype.visitLargeUtf8=W;V.prototype.visitUtf8View=W;V.prototype.visitBinary=W;V.prototype.visitLargeBinary=W;V.prototype.visitBinaryView=W;V.prototype.visitFixedSizeBinary=W;V.prototype.visitDate=W;V.prototype.visitDateDay=W;V.prototype.visitDateMillisecond=W;V.prototype.visitTimestamp=W;V.prototype.visitTimestampSecond=W;V.prototype.visitTimestampMillisecond=W;V.prototype.visitTimestampMicrosecond=W;V.prototype.visitTimestampNanosecond=W;V.prototype.visitTime=W;V.prototype.visitTimeSecond=W;V.prototype.visitTimeMillisecond=W;V.prototype.visitTimeMicrosecond=W;V.prototype.visitTimeNanosecond=W;V.prototype.visitDecimal=W;V.prototype.visitList=W;V.prototype.visitLargeList=W;V.prototype.visitStruct=W;V.prototype.visitUnion=W;V.prototype.visitDenseUnion=W;V.prototype.visitSparseUnion=W;V.prototype.visitDictionary=W;V.prototype.visitInterval=W;V.prototype.visitIntervalDayTime=W;V.prototype.visitIntervalYearMonth=W;V.prototype.visitIntervalMonthDayNano=W;V.prototype.visitDuration=W;V.prototype.visitDurationSecond=W;V.prototype.visitDurationMillisecond=W;V.prototype.visitDurationMicrosecond=W;V.prototype.visitDurationNanosecond=W;V.prototype.visitFixedSizeList=W;V.prototype.visitMap=W;Bo=new V});function Hr(r){if(r){if(r instanceof k)return new E([r]);if(r instanceof E)return new E(r.data);if(r.type instanceof L)return new E([M(r)]);if(Array.isArray(r))return new E(r.flatMap(e=>ZE(e)));if(ArrayBuffer.isView(r)){r instanceof DataView&&(r=new Uint8Array(r.buffer));let e={offset:0,length:r.length,nullCount:-1,data:r};if(r instanceof Int8Array)return new E([M(Object.assign(Object.assign({},e),{type:new Kt}))]);if(r instanceof Int16Array)return new E([M(Object.assign(Object.assign({},e),{type:new Ht}))]);if(r instanceof Int32Array)return new E([M(Object.assign(Object.assign({},e),{type:new ke}))]);if(r instanceof BigInt64Array)return new E([M(Object.assign(Object.assign({},e),{type:new Xt}))]);if(r instanceof Uint8Array||r instanceof Uint8ClampedArray)return new E([M(Object.assign(Object.assign({},e),{type:new Jt}))]);if(r instanceof Uint16Array)return new E([M(Object.assign(Object.assign({},e),{type:new Yt}))]);if(r instanceof Uint32Array)return new E([M(Object.assign(Object.assign({},e),{type:new yt}))]);if(r instanceof BigUint64Array)return new E([M(Object.assign(Object.assign({},e),{type:new Er}))]);if(r instanceof Float32Array)return new E([M(Object.assign(Object.assign({},e),{type:new wt}))]);if(r instanceof Float64Array)return new E([M(Object.assign(Object.assign({},e),{type:new Qt}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function ZE(r){return r instanceof k?[r]:r instanceof E?r.data:Hr(r).data}var Ax,vx,Ix,Lx,E,Xu,ft=p(()=>{Fe();Lo();ye();hr();qu();si();tr();Ku();Hu();ye();vx=Symbol.for("apache-arrow/Vector"),Ix={},Lx={},E=class r{static isVector(e){return e?.[vx]===!0}constructor(e){var t,n,s;let i=e[0]instanceof r?e.flatMap(a=>a.data):e;if(i.length===0||i.some(a=>!(a instanceof k)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=i[0])===null||t===void 0?void 0:t.type;switch(i.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:u}=Ix[o.typeId],f=i[0];this.isValid=l=>ec(f,l),this.get=l=>a(f,l),this.set=(l,d)=>c(f,l,d),this.indexOf=l=>u(f,l),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,Lx[o.typeId]),this._offsets=Pu(i);break}this.data=i,this.type=o,this.stride=er(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((e,t)=>e+t.byteLength,0)}get nullable(){return Tx(this.data)}get nullCount(){return Gu(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${y[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(ii(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Bo.visit(this)}concat(...e){return new r(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new r(Ya(this,e,t,({data:n,_offsets:s},i,o)=>zu(n,s,i,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:s,ArrayType:i}=this;switch(e.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*s);default:return t.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new i(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new r(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return L.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(L.isDictionary(this.type)){let e=new Xu(this.data[0].dictionary),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return new Xu(this)}unmemoize(){if(L.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return this}};Ax=Symbol.toStringTag;E[Ax]=(r=>{r.type=L.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0,r[vx]=!0;let e=Object.keys(y).map(t=>y[t]).filter(t=>typeof t=="number"&&t!==y.NONE);for(let t of e){let n=Ge.getVisitFnByTypeId(t),s=et.getVisitFnByTypeId(t),i=ui.getVisitFnByTypeId(t);Ix[t]={get:n,set:s,indexOf:i},Lx[t]=Object.create(r,{isValid:{value:Eo(ec)},get:{value:Eo(Ge.getVisitFnByTypeId(t))},set:{value:Wu(et.getVisitFnByTypeId(t))},indexOf:{value:$u(ui.getVisitFnByTypeId(t))}})}return"Vector"})(E.prototype);Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===E&&E.isVector(e)}});Xu=class r extends E{constructor(e){super(e.data);let t=this.get,n=this.set,s=this.slice,i=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=i[o];if(a!==void 0)return a;let c=t.call(this,o);return i[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),i[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new r(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new E(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function Sx(r){if(!r||r.length<=0)return function(s){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
|
|
13
|
+
switch (x) {${t.map(n=>`
|
|
14
|
+
case ${eB(n)}:`).join("")}
|
|
15
15
|
return false;
|
|
16
|
-
}`),
|
|
16
|
+
}`),r.length!==t.length&&(e=`if (x !== x) return false;
|
|
17
17
|
${e}`),new Function("x",`${e}
|
|
18
|
-
return true;`)}function lE(t){return typeof t!="bigint"?Ir(t):`${Ir(t)}n`}var nw=p(()=>{Da()});function sh(t,e){let r=Math.ceil(t)*e-1;return(r-r%64+64||64)/e}function sw(t,e=0){return t.length>=e?t.subarray(0,e):ga(new t.constructor(e),t,0)}var Nt,pn,Io,fs,Mr=p(()=>{qe();Nt=class{constructor(e,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new e(this.length),this.stride=n,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,r){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let r=this.stride,n=this.length*r,s=this.buffer.length;n>=s&&this._resize(s===0?sh(n*1,this.BYTES_PER_ELEMENT):sh(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=sh(e*this.stride,this.BYTES_PER_ELEMENT);let r=sw(this.buffer,e);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=sw(this.buffer,e)}},pn=class extends Nt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,r){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=r,this}},Io=class extends pn{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,r){let{buffer:n}=this.reserve(e-this.length+1),s=e>>3,i=e%8,o=n[s]>>i&1;return r?o===0&&(n[s]|=1<<i,++this.numValid):o===1&&(n[s]&=~(1<<i),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},fs=class extends pn{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,r){let n=this.length-1,s=this.reserve(e-n+1).buffer;return n<e++&&n>=0&&s.fill(s[n],n,e),s[e]=s[e-1]+r,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}}});var we,ze,dt,Ae=p(()=>{lt();dr();za();ye();nw();Mr();we=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:r}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=r,this.stride=Qt(e),this._nulls=new Io,r&&r.length>0&&(this._isValid=rw(r))}toVector(){return new E([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:r,_values:n,_nulls:s,_typeIds:i,children:o}=this;return r&&(e+=r.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),o.reduce((a,c)=>a+c.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,r){return this.setValid(e,this.isValid(r))&&this.setValue(e,r),this}setValue(e,r){this._setValue(this,e,r)}setValid(e,r){return this.length=this._nulls.set(e,+r).length,r}addChild(e,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e,r,n,s,{type:i,length:o,nullCount:a,_typeIds:c,_offsets:u,_values:f,_nulls:l}=this;(r=c?.flush(o))?s=u?.flush(o):(s=u?.flush(o))?e=f?.flush(u.last()):e=f?.flush(o),a>0&&(n=l?.flush(o));let d=this.children.map(h=>h.flush());return this.clear(),M({type:i,length:o,nullCount:a,children:d,child:d[0],data:e,typeIds:r,nullBitmap:n,valueOffsets:s})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,r,n,s;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(r=this._values)===null||r===void 0||r.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(s=this._typeIds)===null||s===void 0||s.clear();for(let i of this.children)i.clear();return this}};we.prototype.length=1;we.prototype.stride=1;we.prototype.children=null;we.prototype.finished=!1;we.prototype.nullValues=null;we.prototype._isValid=()=>!0;ze=class extends we{constructor(e){super(e),this._values=new pn(this.ArrayType,0,this.stride)}setValue(e,r){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,r)}},dt=class extends we{constructor(e){super(e),this._pendingLength=0,this._offsets=new fs(e.type)}setValue(e,r){let n=this._pending||(this._pending=new Map),s=n.get(e);s&&(this._pendingLength-=s.length),this._pendingLength+=r instanceof lr?r[cs].length:r.length,n.set(e,r)}setValid(e,r){return super.setValid(e,r)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,r),this}}});var ui,ih=p(()=>{ui=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,r,n,s){return e.prep(8,24),e.writeInt64(BigInt(s??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(r??0)),e.offset()}}});var tr,iw=p(()=>{oe();ih();fo();iu();Rd();tr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFooter(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):me.V1}schema(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Ft).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new ui).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new ui).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,me.V1)}static addSchema(e,r){e.addFieldOffset(1,r,0)}static addDictionaries(e,r){e.addFieldOffset(2,r,0)}static startDictionariesVector(e,r){e.startVector(24,r,8)}static addRecordBatches(e,r){e.addFieldOffset(3,r,0)}static startRecordBatchesVector(e,r){e.startVector(24,r,8)}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,r){e.finish(r)}static finishSizePrefixedFooterBuffer(e,r){e.finish(r,void 0,!0)}}});function $u(t,e){return new Map([...t||new Map,...e||new Map])}function oh(t,e=new Map){for(let r=-1,n=t.length;++r<n;){let i=t[r].type;if(L.isDictionary(i)){if(!e.has(i.id))e.set(i.id,i.dictionary);else if(e.get(i.id)!==i.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}i.children&&i.children.length>0&&oh(i.children,e)}return e}var ow,aw,X,F,ht=p(()=>{Fe();ye();ow=Symbol.for("apache-arrow/Schema"),aw=Symbol.for("apache-arrow/Field"),X=class t{static isSchema(e){return e?.[ow]===!0}constructor(e=[],r,n,s=me.V5){this.fields=e||[],this.metadata=r||new Map,n||(n=oh(this.fields)),this.dictionaries=n,this.metadataVersion=s}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,r)=>`${r}: ${e}`).join(", ")} }>`}select(e){let r=new Set(e),n=this.fields.filter(s=>r.has(s.name));return new t(n,this.metadata)}selectAt(e){let r=e.map(n=>this.fields[n]).filter(Boolean);return new t(r,this.metadata)}assign(...e){let r=e[0]instanceof t?e[0]:Array.isArray(e[0])?new t(e[0]):new t(e),n=[...this.fields],s=$u($u(new Map,this.metadata),r.metadata),i=r.fields.filter(a=>{let c=n.findIndex(u=>u.name===a.name);return~c?(n[c]=a.clone({metadata:$u($u(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=oh(i,new Map);return new t([...n,...i],s,new Map([...this.dictionaries,...o]))}};X.prototype.fields=null;X.prototype.metadata=null;X.prototype.dictionaries=null;X.prototype[ow]=!0;Object.defineProperty(X,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===X&&X.isSchema(e)}});F=class t{static isField(e){return e?.[aw]===!0}static new(...e){let[r,n,s,i]=e;return e[0]&&typeof e[0]=="object"&&({name:r}=e[0],n===void 0&&(n=e[0].type),s===void 0&&(s=e[0].nullable),i===void 0&&(i=e[0].metadata)),new t(`${r}`,n,s,i)}constructor(e,r,n=!1,s){this.name=e,this.type=r,this.nullable=n,this.metadata=s||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[r,n,s,i]=e;return!e[0]||typeof e[0]!="object"?[r=this.name,n=this.type,s=this.nullable,i=this.metadata]=e:{name:r=this.name,type:n=this.type,nullable:s=this.nullable,metadata:i=this.metadata}=e[0],t.new(r,n,s,i)}};F.prototype.type=null;F.prototype.name=null;F.prototype.nullable=null;F.prototype.metadata=null;F.prototype[aw]=!0;Object.defineProperty(F,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===F&&F.isField(e)}})});var dE,hE,mn,ah,Rr,ch=p(()=>{ih();iw();oe();ht();Fe();qe();zr();dE=ei,hE=Ye,mn=class{static decode(e){e=new hE(D(e));let r=tr.getRootAsFooter(e),n=X.decode(r.schema(),new Map,r.version());return new ah(n,r)}static encode(e){let r=new dE,n=X.encode(r,e.schema);tr.startRecordBatchesVector(r,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())Rr.encode(r,o);let s=r.endVector();tr.startDictionariesVector(r,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())Rr.encode(r,o);let i=r.endVector();return tr.startFooter(r),tr.addSchema(r,n),tr.addVersion(r,me.V5),tr.addRecordBatches(r,s),tr.addDictionaries(r,i),tr.finishFooterBuffer(r,tr.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,r=me.V5,n,s){this.schema=e,this.version=r,n&&(this._recordBatches=n),s&&(this._dictionaryBatches=s)}*recordBatches(){for(let e,r=-1,n=this.numRecordBatches;++r<n;)(e=this.getRecordBatch(r))&&(yield e)}*dictionaryBatches(){for(let e,r=-1,n=this.numDictionaries;++r<n;)(e=this.getDictionaryBatch(r))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}},ah=class extends mn{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,r){super(e,r.version()),this._footer=r}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let r=this._footer.recordBatches(e);if(r)return Rr.decode(r)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let r=this._footer.dictionaries(e);if(r)return Rr.decode(r)}return null}},Rr=class t{static decode(e){return new t(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,r){let{metaDataLength:n}=r,s=BigInt(r.offset),i=BigInt(r.bodyLength);return ui.createBlock(e,s,n,i)}constructor(e,r,n){this.metaDataLength=e,this.offset=ee(n),this.bodyLength=ee(r)}}});var rr,cw=p(()=>{oe();fo();du();iu();rr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMessage(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):me.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ne.NONE}header(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(e,this.bb_pos+r):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,me.V1)}static addHeaderType(e,r){e.addFieldInt8(1,r,ne.NONE)}static addHeader(e,r){e.addFieldOffset(2,r,0)}static addBodyLength(e,r){e.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,r){e.finish(r)}static finishSizePrefixedMessageBuffer(e,r){e.finish(r,void 0,!0)}static createMessage(e,r,n,s,i,o){return t.startMessage(e),t.addVersion(e,r),t.addHeaderType(e,n),t.addHeader(e,s),t.addBodyLength(e,i),t.addCustomMetadata(e,o),t.endMessage(e)}}});var uh,qu,uw=p(()=>{Dt();Oy();fu();Ld();vy();Iy();Sy();Ly();Ry();Dy();By();_d();Td();Bd();Fd();Sd();Ad();Fy();Ey();My();Od();wd();vd();Id();Ed();uh=class extends R{visit(e,r){return e==null||r==null?void 0:super.visit(e,r)}visitNull(e,r){return Fa.startNull(r),Fa.endNull(r)}visitInt(e,r){return Ar.startInt(r),Ar.addBitWidth(r,e.bitWidth),Ar.addIsSigned(r,e.isSigned),Ar.endInt(r)}visitFloat(e,r){return qn.startFloatingPoint(r),qn.addPrecision(r,e.precision),qn.endFloatingPoint(r)}visitBinary(e,r){return Aa.startBinary(r),Aa.endBinary(r)}visitBinaryView(e,r){return va.startBinaryView(r),va.endBinaryView(r)}visitLargeBinary(e,r){return La.startLargeBinary(r),La.endLargeBinary(r)}visitBool(e,r){return Ia.startBool(r),Ia.endBool(r)}visitUtf8(e,r){return Ma.startUtf8(r),Ma.endUtf8(r)}visitUtf8View(e,r){return Ra.startUtf8View(r),Ra.endUtf8View(r)}visitLargeUtf8(e,r){return Ea.startLargeUtf8(r),Ea.endLargeUtf8(r)}visitDecimal(e,r){return jr.startDecimal(r),jr.addScale(r,e.scale),jr.addPrecision(r,e.precision),jr.addBitWidth(r,e.bitWidth),jr.endDecimal(r)}visitDate(e,r){return jn.startDate(r),jn.addUnit(r,e.unit),jn.endDate(r)}visitTime(e,r){return fn.startTime(r),fn.addUnit(r,e.unit),fn.addBitWidth(r,e.bitWidth),fn.endTime(r)}visitTimestamp(e,r){let n=e.timezone&&r.createString(e.timezone)||void 0;return ln.startTimestamp(r),ln.addUnit(r,e.unit),n!==void 0&&ln.addTimezone(r,n),ln.endTimestamp(r)}visitInterval(e,r){return Kn.startInterval(r),Kn.addUnit(r,e.unit),Kn.endInterval(r)}visitDuration(e,r){return zn.startDuration(r),zn.addUnit(r,e.unit),zn.endDuration(r)}visitList(e,r){return Ba.startList(r),Ba.endList(r)}visitLargeList(e,r){return Sa.startLargeList(r),Sa.endLargeList(r)}visitStruct(e,r){return Oa.startStruct_(r),Oa.endStruct_(r)}visitUnion(e,r){vr.startTypeIdsVector(r,e.typeIds.length);let n=vr.createTypeIdsVector(r,e.typeIds);return vr.startUnion(r),vr.addMode(r,e.mode),vr.addTypeIds(r,n),vr.endUnion(r)}visitDictionary(e,r){let n=this.visit(e.indices,r);return Pr.startDictionaryEncoding(r),Pr.addId(r,BigInt(e.id)),Pr.addIsOrdered(r,e.isOrdered),n!==void 0&&Pr.addIndexType(r,n),Pr.endDictionaryEncoding(r)}visitFixedSizeBinary(e,r){return Wn.startFixedSizeBinary(r),Wn.addByteWidth(r,e.byteWidth),Wn.endFixedSizeBinary(r)}visitFixedSizeList(e,r){return $n.startFixedSizeList(r),$n.addListSize(r,e.listSize),$n.endFixedSizeList(r)}visitMap(e,r){return Hn.startMap(r),Hn.addKeysSorted(r,e.keysSorted),Hn.endMap(r)}},qu=new uh});function hw(t,e=new Map){return new X(pE(t,e),Ku(t.metadata),e)}function fh(t){return new We(t.count,mw(t.columns),bw(t.columns),null,gw(t.columns))}function pw(t){return new pt(fh(t.data),t.id,t.isDelta)}function pE(t,e){return(t.fields||[]).filter(Boolean).map(r=>F.fromJSON(r,e))}function fw(t,e){return(t.children||[]).filter(Boolean).map(r=>F.fromJSON(r,e))}function mw(t){return(t||[]).reduce((e,r)=>[...e,new hr(r.count,mE(r.VALIDITY)),...mw(r.children)],[])}function bw(t,e=[]){for(let r=-1,n=(t||[]).length;++r<n;){let s=t[r];if(s.VALIDITY&&e.push(new Ce(e.length,s.VALIDITY.length)),s.TYPE_ID&&e.push(new Ce(e.length,s.TYPE_ID.length)),s.OFFSET&&e.push(new Ce(e.length,s.OFFSET.length)),s.DATA&&e.push(new Ce(e.length,s.DATA.length)),s.VIEWS&&e.push(new Ce(e.length,s.VIEWS.length)),s.VARIADIC_DATA_BUFFERS)for(let i of s.VARIADIC_DATA_BUFFERS)e.push(new Ce(e.length,i.length));e=bw(s.children,e)}return e}function mE(t){return(t||[]).reduce((e,r)=>e+ +(r===0),0)}function gw(t){return(t||[]).reduce((e,r)=>[...e,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...gw(r.children)],[])}function yw(t,e){let r,n,s,i,o,a;return!e||!(i=t.dictionary)?(o=dw(t,fw(t,e)),s=new F(t.name,o,t.nullable,Ku(t.metadata))):e.has(r=i.id)?(n=(n=i.indexType)?lw(n):new ke,a=new Pe(e.get(r),n,r,i.isOrdered),s=new F(t.name,a,t.nullable,Ku(t.metadata))):(n=(n=i.indexType)?lw(n):new ke,e.set(r,o=dw(t,fw(t,e))),a=new Pe(o,n,r,i.isOrdered),s=new F(t.name,a,t.nullable,Ku(t.metadata))),s||null}function Ku(t=[]){return new Map(t.map(({key:e,value:r})=>[e,r]))}function lw(t){return new Ee(t.isSigned,t.bitWidth)}function dw(t,e){let r=t.type.name;switch(r){case"NONE":return new Ne;case"null":return new Ne;case"binary":return new Ot;case"largebinary":return new Br;case"binaryview":return new J;case"utf8":return new at;case"largeutf8":return new Fr;case"utf8view":return new wt;case"bool":return new ct;case"list":return new Ue((e||[])[0]);case"largelist":return new Zt((e||[])[0]);case"struct":return new he(e||[]);case"struct_":return new he(e||[])}switch(r){case"int":{let n=t.type;return new Ee(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=t.type;return new ot(ue[n.precision])}case"decimal":{let n=t.type;return new Mt(n.scale,n.precision,n.bitWidth)}case"date":{let n=t.type;return new Tt(ge[n.unit])}case"time":{let n=t.type;return new Qe(S[n.unit],n.bitWidth)}case"timestamp":{let n=t.type;return new et(S[n.unit],n.timezone)}case"interval":{let n=t.type;return new ut(ie[n.unit])}case"duration":{let n=t.type;return new _t(S[n.unit])}case"union":{let n=t.type,[s,...i]=(n.mode+"").toLowerCase(),o=s.toUpperCase()+i.join("");return new At(de[o],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=t.type;return new Rt(n.byteWidth)}case"fixedsizelist":{let n=t.type;return new Se(n.listSize,(e||[])[0])}case"map":{let n=t.type;return new ft((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var xw=p(()=>{ht();ye();ls();Fe()});function yE(t,e){return(()=>{switch(e){case ne.Schema:return X.fromJSON(t);case ne.RecordBatch:return We.fromJSON(t);case ne.DictionaryBatch:return pt.fromJSON(t)}throw new Error(`Unrecognized Message type: { name: ${ne[e]}, type: ${e} }`)})}function xE(t,e){return(()=>{switch(e){case ne.Schema:return X.decode(t.header(new Ft),new Map,t.version());case ne.RecordBatch:return We.decode(t.header(new st),t.version());case ne.DictionaryBatch:return pt.decode(t.header(new un),t.version())}throw new Error(`Unrecognized Message type: { name: ${ne[e]}, type: ${e} }`)})}function wE(t,e=new Map,r=me.V5){let n=EE(t,e);return new X(n,Hu(t),e,r)}function TE(t,e=me.V5){return new We(t.length(),IE(t),LE(t,e),Aw(t.compression()),SE(t))}function _E(t,e=me.V5){return new pt(We.decode(t.data(),e),t.id(),t.isDelta())}function AE(t){return new Ce(t.offset(),t.length())}function vE(t){return new hr(t.length(),t.nullCount())}function IE(t){let e=[];for(let r,n=-1,s=-1,i=t.nodesLength();++n<i;)(r=t.nodes(n))&&(e[++s]=hr.decode(r));return e}function LE(t,e){let r=[];for(let n,s=-1,i=-1,o=t.buffersLength();++s<o;)(n=t.buffers(s))&&(e<me.V4&&(n.bb_pos+=8*(s+1)),r[++i]=Ce.decode(n));return r}function SE(t){let e=[],r=Math.trunc(t.variadicBufferCountsLength());for(let n=0;n<r;++n)e.push(ee(t.variadicBufferCounts(n)));return e}function EE(t,e){let r=[];for(let n,s=-1,i=-1,o=t.fieldsLength();++s<o;)(n=t.fields(s))&&(r[++i]=F.decode(n,e));return r}function ww(t,e){let r=[];for(let n,s=-1,i=-1,o=t.childrenLength();++s<o;)(n=t.children(s))&&(r[++i]=F.decode(n,e));return r}function BE(t,e){let r,n,s,i,o,a;return!e||!(a=t.dictionary())?(s=_w(t,ww(t,e)),n=new F(t.name(),s,t.nullable(),Hu(t))):e.has(r=ee(a.id()))?(i=(i=a.indexType())?Tw(i):new ke,o=new Pe(e.get(r),i,r,a.isOrdered()),n=new F(t.name(),o,t.nullable(),Hu(t))):(i=(i=a.indexType())?Tw(i):new ke,e.set(r,s=_w(t,ww(t,e))),o=new Pe(s,i,r,a.isOrdered()),n=new F(t.name(),o,t.nullable(),Hu(t))),n||null}function Hu(t){let e=new Map;if(t)for(let r,n,s=-1,i=Math.trunc(t.customMetadataLength());++s<i;)(r=t.customMetadata(s))&&(n=r.key())!=null&&e.set(n,r.value());return e}function FE(t){let e=new Map;for(let r,n,s=-1,i=Math.trunc(t.customMetadataLength());++s<i;)(r=t.customMetadata(s))&&(n=r.key())!=null&&e.set(n,r.value());return e}function Tw(t){return new Ee(t.isSigned(),t.bitWidth())}function _w(t,e){let r=t.typeType();switch(r){case P.NONE:return new Ne;case P.Null:return new Ne;case P.Binary:return new Ot;case P.LargeBinary:return new Br;case P.BinaryView:return new J;case P.Utf8:return new at;case P.LargeUtf8:return new Fr;case P.Utf8View:return new wt;case P.Bool:return new ct;case P.List:return new Ue((e||[])[0]);case P.LargeList:return new Zt((e||[])[0]);case P.Struct_:return new he(e||[])}switch(r){case P.Int:{let n=t.type(new Ar);return new Ee(n.isSigned(),n.bitWidth())}case P.FloatingPoint:{let n=t.type(new qn);return new ot(n.precision())}case P.Decimal:{let n=t.type(new jr);return new Mt(n.scale(),n.precision(),n.bitWidth())}case P.Date:{let n=t.type(new jn);return new Tt(n.unit())}case P.Time:{let n=t.type(new fn);return new Qe(n.unit(),n.bitWidth())}case P.Timestamp:{let n=t.type(new ln);return new et(n.unit(),n.timezone())}case P.Interval:{let n=t.type(new Kn);return new ut(n.unit())}case P.Duration:{let n=t.type(new zn);return new _t(n.unit())}case P.Union:{let n=t.type(new vr);return new At(n.mode(),n.typeIdsArray()||[],e||[])}case P.FixedSizeBinary:{let n=t.type(new Wn);return new Rt(n.byteWidth())}case P.FixedSizeList:{let n=t.type(new $n);return new Se(n.listSize(),(e||[])[0])}case P.Map:{let n=t.type(new Hn);return new ft((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${P[r]}" (${r})`)}function Aw(t){return t?new fi(t.codec(),t.method()):null}function OE(t,e){let r=e.fields.map(i=>F.encode(t,i));Ft.startFieldsVector(t,r.length);let n=Ft.createFieldsVector(t,r),s=e.metadata&&e.metadata.size>0?Ft.createCustomMetadataVector(t,[...e.metadata].map(([i,o])=>{let a=t.createString(`${i}`),c=t.createString(`${o}`);return Be.startKeyValue(t),Be.addKey(t,a),Be.addValue(t,c),Be.endKeyValue(t)})):-1;return Ft.startSchema(t),Ft.addFields(t,n),Ft.addEndianness(t,kE?Pn.Little:Pn.Big),s!==-1&&Ft.addCustomMetadata(t,s),Ft.endSchema(t)}function ME(t,e){let r=-1,n=-1,s=-1,i=e.type,o=e.typeId;L.isDictionary(i)?(o=i.dictionary.typeId,s=qu.visit(i,t),n=qu.visit(i.dictionary,t)):n=qu.visit(i,t);let a=(i.children||[]).map(f=>F.encode(t,f)),c=it.createChildrenVector(t,a),u=e.metadata&&e.metadata.size>0?it.createCustomMetadataVector(t,[...e.metadata].map(([f,l])=>{let d=t.createString(`${f}`),h=t.createString(`${l}`);return Be.startKeyValue(t),Be.addKey(t,d),Be.addValue(t,h),Be.endKeyValue(t)})):-1;return e.name&&(r=t.createString(e.name)),it.startField(t),it.addType(t,n),it.addTypeType(t,o),it.addChildren(t,c),it.addNullable(t,!!e.nullable),r!==-1&&it.addName(t,r),s!==-1&&it.addDictionary(t,s),u!==-1&&it.addCustomMetadata(t,u),it.endField(t)}function RE(t,e){let r=e.nodes||[],n=e.buffers||[],s=e.variadicBufferCounts||[];st.startNodesVector(t,r.length);for(let u of r.slice().reverse())hr.encode(t,u);let i=t.endVector();st.startBuffersVector(t,n.length);for(let u of n.slice().reverse())Ce.encode(t,u);let o=t.endVector(),a=null;e.compression!==null&&(a=vw(t,e.compression));let c=-1;return s.length>0&&(c=st.createVariadicBufferCountsVector(t,s.map(BigInt))),st.startRecordBatch(t),st.addLength(t,BigInt(e.length)),st.addNodes(t,i),st.addBuffers(t,o),e.compression!==null&&a&&st.addCompression(t,a),c!==-1&&st.addVariadicBufferCounts(t,c),st.endRecordBatch(t)}function vw(t,e){return cn.startBodyCompression(t),cn.addCodec(t,e.type),cn.addMethod(t,e.method),cn.endBodyCompression(t)}function DE(t,e){let r=We.encode(t,e.data);return un.startDictionaryBatch(t),un.addId(t,BigInt(e.id)),un.addIsDelta(t,e.isDelta),un.addData(t,r),un.endDictionaryBatch(t)}function NE(t,e){return uo.createFieldNode(t,BigInt(e.length),BigInt(e.nullCount))}function CE(t,e){return co.createBuffer(t,BigInt(e.offset),BigInt(e.length))}var bE,gE,mt,We,pt,Ce,hr,fi,kE,ls=p(()=>{oe();Rd();fu();yd();_y();bd();Md();gd();lu();fo();xd();Ld();_d();Td();Bd();Fd();Sd();Ad();Od();vd();Id();Ed();cw();md();pd();ht();qe();zr();Fe();uw();xw();ye();bE=ei,gE=Ye,mt=class t{static fromJSON(e,r){let n=new t(0,me.V5,r);return n._createHeader=yE(e,r),n}static decode(e){e=new gE(D(e));let r=rr.getRootAsMessage(e),n=r.bodyLength(),s=r.version(),i=r.headerType(),o=FE(r),a=new t(n,s,i,void 0,o);return a._createHeader=xE(r,i),a}static encode(e){let r=new bE,n=-1;e.isSchema()?n=X.encode(r,e.header()):e.isRecordBatch()?n=We.encode(r,e.header()):e.isDictionaryBatch()&&(n=pt.encode(r,e.header()));let s=e.metadata&&e.metadata.size>0?rr.createCustomMetadataVector(r,[...e.metadata].map(([i,o])=>{let a=r.createString(`${i}`),c=r.createString(`${o}`);return Be.startKeyValue(r),Be.addKey(r,a),Be.addValue(r,c),Be.endKeyValue(r)})):-1;return rr.startMessage(r),rr.addVersion(r,me.V5),rr.addHeader(r,n),rr.addHeaderType(r,e.headerType),rr.addBodyLength(r,BigInt(e.bodyLength)),s!==-1&&rr.addCustomMetadata(r,s),rr.finishMessageBuffer(r,rr.endMessage(r)),r.asUint8Array()}static from(e,r=0){if(e instanceof X)return new t(0,me.V5,ne.Schema,e);if(e instanceof We)return new t(r,me.V5,ne.RecordBatch,e,e.metadata);if(e instanceof pt)return new t(r,me.V5,ne.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===ne.Schema}isRecordBatch(){return this.headerType===ne.RecordBatch}isDictionaryBatch(){return this.headerType===ne.DictionaryBatch}constructor(e,r,n,s,i){this._version=r,this._headerType=n,this.body=new Uint8Array(0),this._compression=s?.compression,s&&(this._createHeader=()=>s),this._bodyLength=ee(e),this._metadata=i||new Map}},We=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(e,r,n,s,i=[],o){this._nodes=r,this._buffers=n,this._length=ee(e),this._compression=s,this._variadicBufferCounts=i,this._metadata=o||new Map}},pt=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,r,n=!1){this._data=e,this._isDelta=n,this._id=ee(r)}},Ce=class{constructor(e,r){this.offset=ee(e),this.length=ee(r)}},hr=class{constructor(e,r){this.length=ee(e),this.nullCount=ee(r)}},fi=class{constructor(e,r=ti.BUFFER){this.type=e,this.method=r}};F.encode=ME;F.decode=BE;F.fromJSON=yw;X.encode=OE;X.decode=wE;X.fromJSON=hw;We.encode=RE;We.decode=TE;We.fromJSON=fh;pt.encode=DE;pt.decode=_E;pt.fromJSON=pw;hr.encode=NE;hr.decode=vE;Ce.encode=CE;Ce.decode=AE;fi.encode=vw;fi.decode=Aw;kE=(()=>{let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256})()});var ve,Ha,li,Xu,Xa=p(()=>{Bt();xa();ve=Object.freeze({done:!0,value:void 0}),Ha=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},li=class{tee(){return this._getDOMStream().tee()}pipe(e,r){return this._getNodeStream().pipe(e,r)}pipeTo(e,r){return this._getDOMStream().pipeTo(e,r)}pipeThrough(e,r){return this._getDOMStream().pipeThrough(e,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},Xu=class extends li{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(ve);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Je.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Je.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return B(this,void 0,void 0,function*(){return yield this.abort(e),ve})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),ve})}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(ve)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var pr,mr,Ct,lh,bn,ds=p(()=>{Bt();xa();an();Xa();qe();Un();pr=class extends Xu{write(e){if((e=D(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?io(this.toUint8Array(!0)):this.toUint8Array(!1).then(io)}toUint8Array(e=!1){return e?$t(this._values)[0]:B(this,void 0,void 0,function*(){var r,n,s,i;let o=[],a=0;try{for(var c=!0,u=jt(this),f;f=yield u.next(),r=f.done,!r;c=!0){i=f.value,c=!1;let l=i;o.push(l),a+=l.byteLength}}catch(l){n={error:l}}finally{try{!c&&!r&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return $t(o,a)[0]})}},mr=class{constructor(e){e&&(this.source=new lh(Je.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Ct=class t{constructor(e){e instanceof t?this.source=e.source:e instanceof pr?this.source=new bn(Je.fromAsyncIterable(e)):ru(e)?this.source=new bn(Je.fromNodeStream(e)):ba(e)?this.source=new bn(Je.fromDOMStream(e)):eu(e)?this.source=new bn(Je.fromDOMStream(e.body)):wr(e)?this.source=new bn(Je.fromIterable(e)):Wt(e)?this.source=new bn(Je.fromAsyncIterable(e)):ur(e)&&(this.source=new bn(Je.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},lh=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,r="read"){return this.source.next({cmd:r,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||ve)}return(e){return Object.create(this.source.return&&this.source.return(e)||ve)}},bn=class{constructor(e){this.source=e,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return B(this,arguments,void 0,function*(r,n="read"){return yield this.source.next({cmd:n,size:r})})}throw(e){return B(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(e))||ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(e){return B(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(e))||ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var Ja,hs,dh=p(()=>{Bt();ds();qe();Ja=class extends mr{constructor(e,r){super(),this.position=0,this.buffer=D(e),this.size=r===void 0?this.buffer.byteLength:r}readInt32(e){let{buffer:r,byteOffset:n}=this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:r,size:n,position:s}=this;return r&&s<n?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(n,s+Math.min(n-s,e)),r.subarray(s,this.position)):null}readAt(e,r){let n=this.buffer,s=Math.min(this.size,e+r);return n?n.subarray(e,s):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},hs=class extends Ct{constructor(e,r){super(),this.position=0,this._handle=e,typeof r=="number"?this.size=r:this._pending=B(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return B(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)})}seek(e){return B(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return B(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:s}=this;if(r&&s<n){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let i=s,o=0,a=0,c=Math.min(n,i+Math.min(n-i,e)),u=new Uint8Array(Math.max(0,(this.position=c)-i));for(;(i+=a)<c&&(o+=a)<u.byteLength;)({bytesRead:a}=yield r.read(u,o,u.byteLength-o,i));return u}return null})}readAt(e,r){return B(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:s}=this;if(n&&e+r<s){let i=Math.min(s,e+r),o=new Uint8Array(i-e);return(yield n.read(o,0,r,e)).buffer}return new Uint8Array(r)})}close(){return B(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return B(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var ph={};Z(ph,{BaseInt64:()=>Ya,Int128:()=>Za,Int64:()=>gn,Uint64:()=>Oe});function Lo(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}var So,hh,Ya,Oe,gn,Za,mh=p(()=>{So=8,hh=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Ya=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),s=r[3]*n[3];this.buffer[0]=s&65535;let i=s>>>16;return s=r[2]*n[3],i+=s,s=r[3]*n[2]>>>0,i+=s,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0<s?65536:0,this.buffer[1]+=i>>>16,this.buffer[1]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(e){let r=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${Lo(this.buffer[1])} ${Lo(this.buffer[0])}`}},Oe=class t extends Ya{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.length,s=new t(r);for(let i=0;i<n;){let o=So<n-i?So:n-i,a=new t(new Uint32Array([Number.parseInt(e.slice(i,i+o),10),0])),c=new t(new Uint32Array([hh[o],0]));s.times(c),s.plus(a),i+=o}return s}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},gn=class t extends Ya{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let r=this.buffer[1]<<0,n=e.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<e.buffer[0]}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.startsWith("-"),s=e.length,i=new t(r);for(let o=n?1:0;o<s;){let a=So<s-o?So:s-o,c=new t(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0])),u=new t(new Uint32Array([hh[a],0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},Za=class t{constructor(e){this.buffer=e}high(){return new gn(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new gn(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let r=new Oe(new Uint32Array([this.buffer[3],0])),n=new Oe(new Uint32Array([this.buffer[2],0])),s=new Oe(new Uint32Array([this.buffer[1],0])),i=new Oe(new Uint32Array([this.buffer[0],0])),o=new Oe(new Uint32Array([e.buffer[3],0])),a=new Oe(new Uint32Array([e.buffer[2],0])),c=new Oe(new Uint32Array([e.buffer[1],0])),u=new Oe(new Uint32Array([e.buffer[0],0])),f=Oe.multiply(i,u);this.buffer[0]=f.low();let l=new Oe(new Uint32Array([f.high(),0]));return f=Oe.multiply(s,u),l.plus(f),f=Oe.multiply(i,c),l.plus(f),this.buffer[1]=l.low(),this.buffer[3]=l.lessThan(f)?1:0,this.buffer[2]=l.high(),new Oe(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Oe.multiply(n,u)).plus(Oe.multiply(s,c)).plus(Oe.multiply(i,a)),this.buffer[3]+=Oe.multiply(r,u).plus(Oe.multiply(n,c)).plus(Oe.multiply(s,a)).plus(Oe.multiply(i,o)).low(),this}plus(e){let r=new Uint32Array(4);return r[3]=this.buffer[3]+e.buffer[3]>>>0,r[2]=this.buffer[2]+e.buffer[2]>>>0,r[1]=this.buffer[1]+e.buffer[1]>>>0,r[0]=this.buffer[0]+e.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${Lo(this.buffer[3])} ${Lo(this.buffer[2])} ${Lo(this.buffer[1])} ${Lo(this.buffer[0])}`}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}static from(e,r=new Uint32Array(4)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(4)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(4)){let n=e.startsWith("-"),s=e.length,i=new t(r);for(let o=n?1:0;o<s;){let a=So<s-o?So:s-o,c=new t(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0,0,0])),u=new t(new Uint32Array([hh[a],0,0,0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let r=new Uint32Array(e.length*4);for(let n=-1,s=e.length;++n<s;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+16*n,4));return r}}});var wh={};Z(wh,{toIntervalDayTimeInt32Array:()=>bh,toIntervalDayTimeObjects:()=>yh,toIntervalMonthDayNanoInt32Array:()=>gh,toIntervalMonthDayNanoObjects:()=>xh});function bh(t){var e,r;let n=t.length,s=new Int32Array(n*2);for(let i=0,o=0;i<n;i++){let a=t[i];s[o++]=(e=a.days)!==null&&e!==void 0?e:0,s[o++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return s}function gh(t){var e,r;let n=t.length,s=new Int32Array(n*4);for(let i=0,o=0;i<n;i++){let a=t[i];s[o++]=(e=a.months)!==null&&e!==void 0?e:0,s[o++]=(r=a.days)!==null&&r!==void 0?r:0;let c=a.nanoseconds;if(c){let u=BigInt(c);s[o++]=Number(u&BigInt(4294967295))>>>0,s[o++]=Number(u>>BigInt(32))>>>0}else o+=2}return s}function yh(t){let e=t.length,r=new Array(e/2);for(let n=0,s=0;n<e;n+=2)r[s++]={days:t[n],milliseconds:t[n+1]};return r}function xh(t,e){let r=t.length,n=new Array(r/4);for(let s=0,i=0;s<r;s+=4){let o=BigInt(t[s+3])<<BigInt(32)|BigInt(t[s+2]>>>0);n[i++]={months:t[s],days:t[s+1],nanoseconds:e?`${o}`:o}}return n}var Ju=p(()=>{});function Lw(t){let e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r>>1]=Number.parseInt(t.slice(r,r+2),16);return e}function GE(t){return Lw(t.join(""))}function Sw(t,e){let r=new Uint8Array(t.length*16),n=new DataView(r.buffer);for(let[s,i]of t.entries()){let o=s*16,a=i.SIZE;if(n.setInt32(o,a,!0),i.INLINED!==void 0){let c=e(i.INLINED);for(let u=0;u<c.length&&u<12;u++)r[o+4+u]=c[u]}else{let c=i.PREFIX_HEX;for(let u=0;u<8&&u<c.length;u+=2)r[o+4+(u>>1)]=Number.parseInt(c.slice(u,u+2),16);n.setInt32(o+8,i.BUFFER_INDEX,!0),n.setInt32(o+12,i.OFFSET,!0)}}return r}function VE(t){return Sw(t,e=>{let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n>>1]=Number.parseInt(e.slice(n,n+2),16);return r})}function UE(t){return Sw(t,e=>new TextEncoder().encode(e))}var Eo,Yu,Zu,Ew=p(()=>{dr();ht();ye();Dt();ai();an();mh();Fe();qe();Ju();Eo=class extends R{constructor(e,r,n,s,i=me.V5,o=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=e,this.nodes=r,this.buffers=n,this.dictionaries=s,this.metadataVersion=i,this.variadicBufferCounts=o}visit(e){return super.visit(e instanceof F?e.type:e)}visitNull(e,{length:r}=this.nextFieldNode()){return M({type:e,length:r})}visitBool(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitInt(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFloat(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitUtf8(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitUtf8View(e,{length:r,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return M({type:e,length:r,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinaryView(e,{length:r,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return M({type:e,length:r,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitFixedSizeBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDate(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTimestamp(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTime(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDecimal(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitList(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitLargeList(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),children:this.visitMany(e.children)})}visitUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<me.V5&&this.readNullBitmap(e,n),e.mode===de.Sparse?this.visitSparseUnion(e,{length:r,nullCount:n}):this.visitDenseUnion(e,{length:r,nullCount:n})}visitDenseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDuration(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFixedSizeList(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),child:this.visit(e.children[0])})}visitMap(e,{length:r,nullCount:n}=this.nextFieldNode()){return M({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,r,n=this.nextBufferRange()){return r>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,r){return this.readData(e,r)}readTypeIds(e,r){return this.readData(e,r)}readData(e,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readVariadicBuffers(e){return Array.from({length:e},()=>this.readData(null))}nextVariadicBufferCount(){var e;return(e=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&e!==void 0?e:0}readDictionary(e){return this.dictionaries.get(e.id)}},Yu=class extends Eo{constructor(e,r,n,s,i,o=[]){super(new Uint8Array(0),r,n,s,i,o),this.sources=e}readNullBitmap(e,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):oi(this.sources[n])}readOffsets(e,{offset:r}=this.nextBufferRange()){return Q(Uint8Array,Q(e.OffsetArrayType,this.sources[r]))}readTypeIds(e,{offset:r}=this.nextBufferRange()){return Q(Uint8Array,Q(e.ArrayType,this.sources[r]))}readData(e,{offset:r}=this.nextBufferRange()){let{sources:n}=this;if(L.isTimestamp(e))return Q(Uint8Array,gn.convertArray(n[r]));if((L.isInt(e)||L.isTime(e))&&e.bitWidth===64||L.isDuration(e))return Q(Uint8Array,gn.convertArray(n[r]));if(L.isDate(e)&&e.unit===ge.MILLISECOND)return Q(Uint8Array,gn.convertArray(n[r]));if(L.isDecimal(e))return Q(Uint8Array,Za.convertArray(n[r]));if(L.isBinary(e)||L.isLargeBinary(e)||L.isFixedSizeBinary(e))return GE(n[r]);if(L.isBinaryView(e))return VE(n[r]);if(L.isUtf8View(e))return UE(n[r]);if(L.isBool(e))return oi(n[r]);if(L.isUtf8(e)||L.isLargeUtf8(e))return zt(n[r].join(""));if(L.isInterval(e))switch(e.unit){case ie.DAY_TIME:return bh(n[r]);case ie.MONTH_DAY_NANO:return gh(n[r]);default:break}return Q(Uint8Array,Q(e.ArrayType,n[r].map(s=>+s)))}readVariadicBuffers(e){let r=[];for(let n=0;n<e;n++){let{offset:s}=this.nextBufferRange(),i=this.sources[s];r.push(Lw(i))}return r}};Zu=class extends Eo{constructor(e,r,n,s,i,o=[]){super(new Uint8Array(0),r,n,s,i,o),this.bodyChunks=e}readData(e,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var yn,Qu=p(()=>{Mr();Ae();qe();yn=class extends dt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,D(r))}_flushPending(e,r){let n=this._offsets,s=this._values.reserve(r).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,0);else{let c=a.length;s.set(a,i),n.set(o,c),i+=c}}}});var xn,ef=p(()=>{qe();Mr();Ae();xn=class extends dt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,D(r))}_flushPending(e,r){let n=this._offsets,s=this._values.reserve(r).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,BigInt(0));else{let c=a.length;s.set(a,i),n.set(o,BigInt(c)),i+=c}}}});var di,Th=p(()=>{Mr();Ae();di=class extends we{constructor(e){super(e),this._values=new Io}setValue(e,r){this._values.set(e,+r)}}});var Hr,ps,ms,_h=p(()=>{Ae();er();Hr=class extends ze{};Hr.prototype._setValue=jd;ps=class extends Hr{};ps.prototype._setValue=mu;ms=class extends Hr{};ms.prototype._setValue=bu});var bs,Ah=p(()=>{Ae();er();bs=class extends ze{};bs.prototype._setValue=$d});var hi,vh=p(()=>{ye();Ae();Qa();hi=class extends we{constructor({type:e,nullValues:r,dictionaryHashFunction:n}){super({type:new Pe(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Dr({type:this.type.indices,nullValues:r}),this.dictionary=Dr({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,r){let n=this.indices;return r=n.setValid(e,r),this.length=n.length,r}setValue(e,r){let n=this._keysToIndices,s=this.valueToKey(r),i=n[s];return i===void 0&&(n[s]=i=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(e,i)}flush(){let e=this.type,r=this._dictionary,n=this.dictionary.toVector(),s=this.indices.flush().clone(e);return s.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=s.dictionary,this.clear(),s}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}}});var gs,Ih=p(()=>{Ae();er();gs=class extends ze{};gs.prototype._setValue=Pd});var pi,Lh=p(()=>{ht();Ae();ye();pi=class extends we{setValue(e,r){let[n]=this.children,s=e*this.stride;for(let i=-1,o=this.stride;++i<o;)n.set(s+i,r[i])}setValid(e,r){return super.setValid(e,r)||this.children[0].setValid((e+1)*this.stride-1,!1),r}addChild(e,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new Se(this.type.listSize,new F(r,e.type,!0)),n}}});var Xr,mi,bi,gi,Sh=p(()=>{ja();Ae();Xr=class extends ze{setValue(e,r){this._values.set(e,r)}},mi=class extends Xr{setValue(e,r){super.setValue(e,Pa(r))}},bi=class extends Xr{},gi=class extends Xr{}});var Nr,ys,xs,ws,Eh=p(()=>{Ae();er();Nr=class extends ze{};Nr.prototype._setValue=qd;ys=class extends Nr{};ys.prototype._setValue=Iu;xs=class extends Nr{};xs.prototype._setValue=Lu;ws=class extends Nr{};ws.prototype._setValue=Su});var br,Ts,_s,As,vs,Bh=p(()=>{Ae();er();br=class extends ze{};br.prototype._setValue=Kd;Ts=class extends br{};Ts.prototype._setValue=Eu;_s=class extends br{};_s.prototype._setValue=Bu;As=class extends br{};As.prototype._setValue=Fu;vs=class extends br{};vs.prototype._setValue=Ou});var vt,yi,xi,wi,Ti,_i,Ai,vi,Ii,Fh=p(()=>{Ae();vt=class extends ze{setValue(e,r){this._values.set(e,r)}},yi=class extends vt{},xi=class extends vt{},wi=class extends vt{},Ti=class extends vt{},_i=class extends vt{},Ai=class extends vt{},vi=class extends vt{},Ii=class extends vt{}});var Li,Oh=p(()=>{ht();ye();Mr();Ae();Li=class extends dt{constructor(e){super(e),this._offsets=new fs(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Ue(new F(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")r.set(s,0);else{let o=i,a=o.length,c=r.set(s,a).buffer[s];for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Si,Mh=p(()=>{ht();ye();Mr();zr();Ae();Si=class extends dt{constructor(e){super(e),this._offsets=new fs(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Zt(new F(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")r.set(s,BigInt(0));else{let o=i,a=o.length,c=ee(r.set(s,BigInt(a)).buffer[s]);for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Ei,Rh=p(()=>{ht();ye();Ae();Ei=class extends dt{set(e,r){return super.set(e,r)}setValue(e,r){let n=r instanceof Map?r:new Map(Object.entries(r)),s=this._pending||(this._pending=new Map),i=s.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=n.size,s.set(e,n)}addChild(e,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ft(new F(r,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[s,i]of e)if(i===void 0)r.set(s,0);else{let{[s]:o,[s+1]:a}=r.set(s,i.size).buffer;for(let c of i.entries())if(n.set(o,c),++o>=a)break}}}});var Bi,Dh=p(()=>{Ae();Bi=class extends we{setValue(e,r){}setValid(e,r){return this.length=Math.max(e+1,this.length),r}}});var Fi,Nh=p(()=>{ht();Ae();ye();Fi=class extends we{setValue(e,r){let{children:n,type:s}=this;switch(Array.isArray(r)||r.constructor){case!0:return s.children.forEach((i,o)=>n[o].set(e,r[o]));case Map:return s.children.forEach((i,o)=>n[o].set(e,r.get(i.name)));default:return s.children.forEach((i,o)=>n[o].set(e,r[i.name]))}}setValid(e,r){return super.setValid(e,r)||this.children.forEach(n=>n.setValid(e,r)),r}addChild(e,r=`${this.numChildren}`){let n=this.children.push(e);return this.type=new he([...this.type.children,new F(r,e.type,!0)]),n}}});var gr,Is,Ls,Ss,Es,Ch=p(()=>{Ae();er();gr=class extends ze{};gr.prototype._setValue=zd;Is=class extends gr{};Is.prototype._setValue=gu;Ls=class extends gr{};Ls.prototype._setValue=yu;Ss=class extends gr{};Ss.prototype._setValue=xu;Es=class extends gr{};Es.prototype._setValue=wu});var yr,Bs,Fs,Os,Ms,kh=p(()=>{Ae();er();yr=class extends ze{};yr.prototype._setValue=Wd;Bs=class extends yr{};Bs.prototype._setValue=Tu;Fs=class extends yr{};Fs.prototype._setValue=_u;Os=class extends yr{};Os.prototype._setValue=Au;Ms=class extends yr{};Ms.prototype._setValue=vu});var wn,Oi,Mi,Gh=p(()=>{ht();Mr();Ae();ye();wn=class extends we{constructor(e){super(e),this._typeIds=new pn(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,r){return this.set(this.length,e,r)}set(e,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,e)),this.setValue(e,r,n),this}setValue(e,r,n){this._typeIds.set(e,n);let s=this.type.typeIdToChildIndex[n],i=this.children[s];i?.set(e,r),this.length=Math.max(e+1,this.length)}addChild(e,r=`${this.children.length}`){let n=this.children.push(e),{type:{children:s,mode:i,typeIds:o}}=this,a=[...s,new F(r,e.type)];return this.type=new At(i,[...o,n],a),n}_valueToChildTypeId(e,r,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},Oi=class extends wn{},Mi=class extends wn{constructor(e){super(e),this._offsets=new pn(Int32Array)}setValue(e,r,n){let s=this._typeIds.set(e,n).buffer[e],i=this.getChildAt(this.type.typeIdToChildIndex[s]),o=this._offsets.set(e,i.length).buffer[e];i?.set(o,r),this.length=Math.max(e+1,this.length)}}});var Rs,Vh=p(()=>{an();Qu();Mr();Ae();Rs=class extends dt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,zt(r))}_flushPending(e,r){}};Rs.prototype._flushPending=yn.prototype._flushPending});var Ds,Uh=p(()=>{an();Mr();Ae();ef();Ds=class extends dt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,zt(r))}_flushPending(e,r){}};Ds.prototype._flushPending=xn.prototype._flushPending});var Tn,tf=p(()=>{ye();Ae();Mr();qe();dr();Tn=class extends we{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Nt(Uint8Array)}get byteLength(){let e=0;this._views&&(e+=this._views.byteLength),this._nulls&&(e+=this._nulls.byteLength);for(let r of this._variadicBuffers)e+=r.byteLength;return this._currentBuffer&&(e+=this._currentBuffer.byteLength),e}setValue(e,r){return this.writeBinaryValue(e,this.encodeValue(r))}writeBinaryValue(e,r){let n=r.length,s=(e+1)*J.ELEMENT_WIDTH,i=this._views.length;s>i&&this._views.reserve(s-i);let o=this._views.buffer,a=e*J.ELEMENT_WIDTH,c=new DataView(o.buffer,o.byteOffset+a,J.ELEMENT_WIDTH);if(c.setInt32(J.LENGTH_OFFSET,n,!0),n<=J.INLINE_CAPACITY){o.set(r,a+J.INLINE_OFFSET);for(let u=n;u<J.INLINE_CAPACITY;u++)o[a+J.INLINE_OFFSET+u]=0}else{let u=new DataView(r.buffer,r.byteOffset,Math.min(4,n));c.setUint32(J.INLINE_OFFSET,u.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new Nt(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(r,this._currentBufferOffset),c.setInt32(J.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(J.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(e){return D(e)}setValid(e,r){let n=(e+1)*J.ELEMENT_WIDTH,s=this._views.length;n>s&&this._views.reserve(n-s);let i=super.setValid(e,r);if(!i){let o=this._views.buffer,a=e*J.ELEMENT_WIDTH;for(let c=0;c<J.ELEMENT_WIDTH;c++)o[a+c]=0}return i}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:e,length:r,nullCount:n,_views:s,_nulls:i}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let o=s.flush(r*J.ELEMENT_WIDTH),a=n>0?i.flush(r):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),M({type:e,length:r,nullCount:n,nullBitmap:a,views:o,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Ri,Ph=p(()=>{tf();an();Ri=class extends Tn{constructor(e){super(e)}setValue(e,r){return this.writeBinaryValue(e,zt(r))}}});var jh,Bw,Fw=p(()=>{Dt();Qu();ef();Th();_h();Ah();vh();Ih();Lh();Sh();Eh();Bh();Fh();Oh();Mh();Rh();Dh();Nh();Ch();kh();Gh();Vh();Uh();tf();Ph();jh=class extends R{visitNull(){return Bi}visitBool(){return di}visitInt(){return vt}visitInt8(){return yi}visitInt16(){return xi}visitInt32(){return wi}visitInt64(){return Ti}visitUint8(){return _i}visitUint16(){return Ai}visitUint32(){return vi}visitUint64(){return Ii}visitFloat(){return Xr}visitFloat16(){return mi}visitFloat32(){return bi}visitFloat64(){return gi}visitUtf8(){return Rs}visitLargeUtf8(){return Ds}visitBinary(){return yn}visitLargeBinary(){return xn}visitFixedSizeBinary(){return gs}visitDate(){return Hr}visitDateDay(){return ps}visitDateMillisecond(){return ms}visitTimestamp(){return gr}visitTimestampSecond(){return Is}visitTimestampMillisecond(){return Ls}visitTimestampMicrosecond(){return Ss}visitTimestampNanosecond(){return Es}visitTime(){return yr}visitTimeSecond(){return Bs}visitTimeMillisecond(){return Fs}visitTimeMicrosecond(){return Os}visitTimeNanosecond(){return Ms}visitDecimal(){return bs}visitList(){return Li}visitLargeList(){return Si}visitStruct(){return Fi}visitUnion(){return wn}visitDenseUnion(){return Mi}visitSparseUnion(){return Oi}visitDictionary(){return hi}visitInterval(){return Nr}visitIntervalDayTime(){return ys}visitIntervalYearMonth(){return xs}visitIntervalMonthDayNano(){return ws}visitDuration(){return br}visitDurationSecond(){return Ts}visitDurationMillisecond(){return _s}visitDurationMicrosecond(){return As}visitDurationNanosecond(){return vs}visitFixedSizeList(){return pi}visitMap(){return Ei}visitBinaryView(){return Tn}visitUtf8View(){return Ri}},Bw=new jh});function It(t,e){return e instanceof t.constructor}function _n(t,e){return t===e||It(t,e)}function An(t,e){return t===e||It(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function rf(t,e){return t===e||It(t,e)&&t.precision===e.precision}function PE(t,e){return t===e||It(t,e)&&t.byteWidth===e.byteWidth}function zh(t,e){return t===e||It(t,e)&&t.unit===e.unit}function ec(t,e){return t===e||It(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function tc(t,e){return t===e||It(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function Ow(t,e){return t===e||It(t,e)&&t.children.length===e.children.length&&Jr.compareManyFields(t.children,e.children)}function jE(t,e){return t===e||It(t,e)&&t.children.length===e.children.length&&Jr.compareManyFields(t.children,e.children)}function Wh(t,e){return t===e||It(t,e)&&t.mode===e.mode&&t.typeIds.every((r,n)=>r===e.typeIds[n])&&Jr.compareManyFields(t.children,e.children)}function zE(t,e){return t===e||It(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&Jr.visit(t.indices,e.indices)&&Jr.visit(t.dictionary,e.dictionary)}function nf(t,e){return t===e||It(t,e)&&t.unit===e.unit}function rc(t,e){return t===e||It(t,e)&&t.unit===e.unit}function WE(t,e){return t===e||It(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&Jr.compareManyFields(t.children,e.children)}function $E(t,e){return t===e||It(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&Jr.compareManyFields(t.children,e.children)}function Di(t,e){return Jr.compareSchemas(t,e)}function Mw(t,e){return Jr.compareFields(t,e)}function sf(t,e){return Jr.visit(t,e)}var V,Jr,nc=p(()=>{Dt();V=class extends R{compareSchemas(e,r){return e===r||r instanceof e.constructor&&this.compareManyFields(e.fields,r.fields)}compareManyFields(e,r){return e===r||Array.isArray(e)&&Array.isArray(r)&&e.length===r.length&&e.every((n,s)=>this.compareFields(n,r[s]))}compareFields(e,r){return e===r||r instanceof e.constructor&&e.name===r.name&&e.nullable===r.nullable&&this.visit(e.type,r.type)}};V.prototype.visitNull=_n;V.prototype.visitBool=_n;V.prototype.visitInt=An;V.prototype.visitInt8=An;V.prototype.visitInt16=An;V.prototype.visitInt32=An;V.prototype.visitInt64=An;V.prototype.visitUint8=An;V.prototype.visitUint16=An;V.prototype.visitUint32=An;V.prototype.visitUint64=An;V.prototype.visitFloat=rf;V.prototype.visitFloat16=rf;V.prototype.visitFloat32=rf;V.prototype.visitFloat64=rf;V.prototype.visitUtf8=_n;V.prototype.visitLargeUtf8=_n;V.prototype.visitUtf8View=_n;V.prototype.visitBinary=_n;V.prototype.visitLargeBinary=_n;V.prototype.visitBinaryView=_n;V.prototype.visitFixedSizeBinary=PE;V.prototype.visitDate=zh;V.prototype.visitDateDay=zh;V.prototype.visitDateMillisecond=zh;V.prototype.visitTimestamp=ec;V.prototype.visitTimestampSecond=ec;V.prototype.visitTimestampMillisecond=ec;V.prototype.visitTimestampMicrosecond=ec;V.prototype.visitTimestampNanosecond=ec;V.prototype.visitTime=tc;V.prototype.visitTimeSecond=tc;V.prototype.visitTimeMillisecond=tc;V.prototype.visitTimeMicrosecond=tc;V.prototype.visitTimeNanosecond=tc;V.prototype.visitDecimal=_n;V.prototype.visitList=Ow;V.prototype.visitLargeList=Ow;V.prototype.visitStruct=jE;V.prototype.visitUnion=Wh;V.prototype.visitDenseUnion=Wh;V.prototype.visitSparseUnion=Wh;V.prototype.visitDictionary=zE;V.prototype.visitInterval=nf;V.prototype.visitIntervalDayTime=nf;V.prototype.visitIntervalYearMonth=nf;V.prototype.visitIntervalMonthDayNano=nf;V.prototype.visitDuration=rc;V.prototype.visitDurationSecond=rc;V.prototype.visitDurationMillisecond=rc;V.prototype.visitDurationMicrosecond=rc;V.prototype.visitDurationNanosecond=rc;V.prototype.visitFixedSizeList=WE;V.prototype.visitMap=$E;Jr=new V});function Dr(t){let e=t.type,r=new(Bw.getVisitFn(e)())(t);if(e.children&&e.children.length>0){let n=t.children||[],s={nullValues:t.nullValues},i=Array.isArray(n)?((o,a)=>n[a]||s):(({name:o})=>n[o]||s);for(let[o,a]of e.children.entries()){let{type:c}=a,u=i(a,o);r.children.push(Dr(Object.assign(Object.assign({},u),{type:c})))}}return r}function Bo(t,e){if(t instanceof N||t instanceof E||t.type instanceof L||ArrayBuffer.isView(t))return Kr(t);let r={type:e??of(t),nullValues:[null]},n=[...af(r)(t)],s=n.length===1?n[0]:n.reduce((i,o)=>i.concat(o));return L.isDictionary(s.type)?s.memoize():s}function $h(t){let e=Bo(t),r=new le(new X(e.type.children),e.data[0]);return new be(r)}function of(t){if(t.length===0)return new Ne;let e=0,r=0,n=0,s=0,i=0,o=0,a=0,c=0;for(let u of t){if(u==null){++e;continue}switch(typeof u){case"bigint":++o;continue;case"boolean":++a;continue;case"number":++s;continue;case"string":++i;continue;case"object":Array.isArray(u)?++r:Object.prototype.toString.call(u)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(s+e===t.length)return new Yt;if(i+e===t.length)return new Pe(new at,new ke);if(o+e===t.length)return new Ht;if(a+e===t.length)return new ct;if(c+e===t.length)return new Wr;if(r+e===t.length){let u=t,f=of(u[u.findIndex(l=>l!=null)]);if(u.every(l=>l==null||sf(f,of(l))))return new Ue(new F("",f,!0))}else if(n+e===t.length){let u=new Map;for(let f of t)for(let l of Object.keys(f))!u.has(l)&&f[l]!=null&&u.set(l,new F(l,of([f[l]]),!0));return new he([...u.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function af(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=t,n=e!=="bytes"?"length":"byteLength";return function*(s){let i=0,o=Dr(t);for(let a of s)o.append(a)[n]>=r&&++i&&(yield o.toVector());(o.finish().length>0||i===0)&&(yield o.toVector())}}function qh(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=t,n=e!=="bytes"?"length":"byteLength";return function(s){return bt(this,arguments,function*(){var i,o,a,c;let u=0,f=Dr(t);try{for(var l=!0,d=jt(s),h;h=yield H(d.next()),i=h.done,!i;l=!0){c=h.value,l=!1;let m=c;f.append(m)[n]>=r&&++u&&(yield yield H(f.toVector()))}}catch(m){o={error:m}}finally{try{!l&&!i&&(a=d.return)&&(yield H(a.call(d)))}finally{if(o)throw o.error}}(f.finish().length>0||u===0)&&(yield yield H(f.toVector()))})}}var Qa=p(()=>{Bt();ht();ye();dr();lt();Fw();Ni();vn();nc()});function cf(t,e){return qE(t,e.map(r=>r.data.concat()))}function qE(t,e){let r=[...t.fields],n=[],s={numBatches:e.reduce((l,d)=>Math.max(l,d.length),0)},i=0,o=0,a=-1,c=e.length,u,f=[];for(;s.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)f[a]=u=e[a].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(f=KE(r,o,f,e,s),o>0&&(n[i++]=M({type:new he(r),length:o,nullCount:0,children:f.slice()})))}return[t=t.assign(r),n.map(l=>new le(t,l))]}function KE(t,e,r,n,s){var i;let o=(e+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let u=r[a],f=u?.length;if(f>=e)f===e?r[a]=u:(r[a]=u.slice(0,e),s.numBatches=Math.max(s.numBatches,n[a].unshift(u.slice(e,f-e))));else{let l=t[a];t[a]=l.clone({nullable:!0}),r[a]=(i=u?._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:M({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return r}var Rw=p(()=>{dr();ye();vn()});function Kh(t){let e={},r=Object.entries(t);for(let[n,s]of r)e[n]=Kr(s);return new be(e)}function Hh(t){let e={},r=Object.entries(t);for(let[n,s]of r)e[n]=Bo(s);return new be(e)}var Dw,Nw,be,Ni=p(()=>{Fe();dr();Qa();lt();ht();ye();nc();Rw();Pu();ni();er();ju();zu();To();vn();Nw=Symbol.for("apache-arrow/Table"),be=class t{static isTable(e){return e?.[Nw]===!0}constructor(...e){var r,n;if(e.length===0)return this.batches=[],this.schema=new X([]),this._offsets=[0],this;let s,i;e[0]instanceof X&&(s=e.shift()),e.at(-1)instanceof Uint32Array&&(i=e.pop());let o=c=>{if(c){if(c instanceof le)return[c];if(c instanceof t)return c.batches;if(c instanceof N){if(c.type instanceof he)return[new le(new X(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>o(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>o(u));if(typeof c=="object"){let u=Object.keys(c),f=u.map(h=>new E([c[h]])),l=s??new X(u.map((h,m)=>new F(String(h),f[m].type,f[m].nullable))),[,d]=cf(l,f);return d.length===0?[new le(c)]:d}}}return[]},a=e.flatMap(c=>o(c));if(s=(n=s??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new X([]),!(s instanceof X))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof le))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Di(s,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=a,this._offsets=i??ku(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,r)=>e+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Cu(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(si(e,this.numRows))}set(e,r){}indexOf(e,r){return-1}[Symbol.iterator](){return this.batches.length>0?vo.visit(new E(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
18
|
+
return true;`)}function eB(r){return typeof r!="bigint"?Lr(r):`${Lr(r)}n`}var Ex=p(()=>{Ga()});function gh(r,e){let t=Math.ceil(r)*e-1;return(t-t%64+64||64)/e}function Bx(r,e=0){return r.length>=e?r.subarray(0,e):va(new r.constructor(e),r,0)}var Nt,gn,Fo,ps,Rr=p(()=>{$e();Nt=class{constructor(e,t=0,n=1){this.length=Math.ceil(t/n),this.buffer=new e(this.length),this.stride=n,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,n=this.length*t,s=this.buffer.length;n>=s&&this._resize(s===0?gh(n*1,this.BYTES_PER_ELEMENT):gh(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=gh(e*this.stride,this.BYTES_PER_ELEMENT);let t=Bx(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=Bx(this.buffer,e)}},gn=class extends Nt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}},Fo=class extends gn{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:n}=this.reserve(e-this.length+1),s=e>>3,i=e%8,o=n[s]>>i&1;return t?o===0&&(n[s]|=1<<i,++this.numValid):o===1&&(n[s]&=~(1<<i),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},ps=class extends gn{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,t){let n=this.length-1,s=this.reserve(e-n+1).buffer;return n<e++&&n>=0&&s.fill(s[n],n,e),s[e]=s[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}}});var xe,Pe,lt,ve=p(()=>{ft();hr();Ja();ye();Ex();Rr();xe=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=er(e),this._nulls=new Fo,t&&t.length>0&&(this._isValid=Sx(t))}toVector(){return new E([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:t,_values:n,_nulls:s,_typeIds:i,children:o}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),o.reduce((a,c)=>a+c.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,n)=>t+n.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e,t,n,s,{type:i,length:o,nullCount:a,_typeIds:c,_offsets:u,_values:f,_nulls:l}=this;(t=c?.flush(o))?s=u?.flush(o):(s=u?.flush(o))?e=f?.flush(u.last()):e=f?.flush(o),a>0&&(n=l?.flush(o));let d=this.children.map(h=>h.flush());return this.clear(),M({type:i,length:o,nullCount:a,children:d,child:d[0],data:e,typeIds:t,nullBitmap:n,valueOffsets:s})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,t,n,s;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(t=this._values)===null||t===void 0||t.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(s=this._typeIds)===null||s===void 0||s.clear();for(let i of this.children)i.clear();return this}};xe.prototype.length=1;xe.prototype.stride=1;xe.prototype.children=null;xe.prototype.finished=!1;xe.prototype.nullValues=null;xe.prototype._isValid=()=>!0;Pe=class extends xe{constructor(e){super(e),this._values=new gn(this.ArrayType,0,this.stride)}setValue(e,t){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,t)}},lt=class extends xe{constructor(e){super(e),this._pendingLength=0,this._offsets=new ps(e.type)}setValue(e,t){let n=this._pending||(this._pending=new Map),s=n.get(e);s&&(this._pendingLength-=s.length),this._pendingLength+=t instanceof dr?t[ds].length:t.length,n.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}}});var fi,yh=p(()=>{fi=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,s){return e.prep(8,24),e.writeInt64(BigInt(s??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}}});var rr,Fx=p(()=>{oe();yh();bo();fu();qd();rr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):me.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ft).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new fi).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new fi).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,me.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}}});function Ju(r,e){return new Map([...r||new Map,...e||new Map])}function wh(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let i=r[t].type;if(L.isDictionary(i)){if(!e.has(i.id))e.set(i.id,i.dictionary);else if(e.get(i.id)!==i.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}i.children&&i.children.length>0&&wh(i.children,e)}return e}var Ox,Mx,J,F,dt=p(()=>{Fe();ye();Ox=Symbol.for("apache-arrow/Schema"),Mx=Symbol.for("apache-arrow/Field"),J=class r{static isSchema(e){return e?.[Ox]===!0}constructor(e=[],t,n,s=me.V5){this.fields=e||[],this.metadata=t||new Map,n||(n=wh(this.fields)),this.dictionaries=n,this.metadataVersion=s}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(e){let t=new Set(e),n=this.fields.filter(s=>t.has(s.name));return new r(n,this.metadata)}selectAt(e){let t=e.map(n=>this.fields[n]).filter(Boolean);return new r(t,this.metadata)}assign(...e){let t=e[0]instanceof r?e[0]:Array.isArray(e[0])?new r(e[0]):new r(e),n=[...this.fields],s=Ju(Ju(new Map,this.metadata),t.metadata),i=t.fields.filter(a=>{let c=n.findIndex(u=>u.name===a.name);return~c?(n[c]=a.clone({metadata:Ju(Ju(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=wh(i,new Map);return new r([...n,...i],s,new Map([...this.dictionaries,...o]))}};J.prototype.fields=null;J.prototype.metadata=null;J.prototype.dictionaries=null;J.prototype[Ox]=!0;Object.defineProperty(J,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===J&&J.isSchema(e)}});F=class r{static isField(e){return e?.[Mx]===!0}static new(...e){let[t,n,s,i]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],n===void 0&&(n=e[0].type),s===void 0&&(s=e[0].nullable),i===void 0&&(i=e[0].metadata)),new r(`${t}`,n,s,i)}constructor(e,t,n=!1,s){this.name=e,this.type=t,this.nullable=n,this.metadata=s||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,n,s,i]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,s=this.nullable,i=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:s=this.nullable,metadata:i=this.metadata}=e[0],r.new(t,n,s,i)}};F.prototype.type=null;F.prototype.name=null;F.prototype.nullable=null;F.prototype.metadata=null;F.prototype[Mx]=!0;Object.defineProperty(F,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===F&&F.isField(e)}})});var tB,rB,yn,xh,Dr,Th=p(()=>{yh();Fx();oe();dt();Fe();$e();Wr();tB=ti,rB=Je,yn=class{static decode(e){e=new rB(D(e));let t=rr.getRootAsFooter(e),n=J.decode(t.schema(),new Map,t.version());return new xh(n,t)}static encode(e){let t=new tB,n=J.encode(t,e.schema);rr.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())Dr.encode(t,o);let s=t.endVector();rr.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())Dr.encode(t,o);let i=t.endVector();return rr.startFooter(t),rr.addSchema(t,n),rr.addVersion(t,me.V5),rr.addRecordBatches(t,s),rr.addDictionaries(t,i),rr.finishFooterBuffer(t,rr.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=me.V5,n,s){this.schema=e,this.version=t,n&&(this._recordBatches=n),s&&(this._dictionaryBatches=s)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t<n;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,n=this.numDictionaries;++t<n;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}},xh=class extends yn{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,t){super(e,t.version()),this._footer=t}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return Dr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return Dr.decode(t)}return null}},Dr=class r{static decode(e){return new r(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,s=BigInt(t.offset),i=BigInt(t.bodyLength);return fi.createBlock(e,s,n,i)}constructor(e,t,n){this.metaDataLength=e,this.offset=ee(n),this.bodyLength=ee(t)}}});var nr,Rx=p(()=>{oe();bo();gu();fu();nr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):me.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ne.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,me.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,ne.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,n,s,i,o){return r.startMessage(e),r.addVersion(e,t),r.addHeaderType(e,n),r.addHeader(e,s),r.addBodyLength(e,i),r.addCustomMetadata(e,o),r.endMessage(e)}}});var _h,Yu,Dx=p(()=>{Dt();rw();mu();Vd();Xy();Jy();Qy();Yy();sw();iw();ew();Nd();Dd();Pd();zd();Ud();kd();tw();Zy();nw();Wd();Rd();Cd();jd();Gd();_h=class extends R{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Ca.startNull(t),Ca.endNull(t)}visitInt(e,t){return vr.startInt(t),vr.addBitWidth(t,e.bitWidth),vr.addIsSigned(t,e.isSigned),vr.endInt(t)}visitFloat(e,t){return Jn.startFloatingPoint(t),Jn.addPrecision(t,e.precision),Jn.endFloatingPoint(t)}visitBinary(e,t){return Fa.startBinary(t),Fa.endBinary(t)}visitBinaryView(e,t){return Oa.startBinaryView(t),Oa.endBinaryView(t)}visitLargeBinary(e,t){return Ra.startLargeBinary(t),Ra.endLargeBinary(t)}visitBool(e,t){return Ma.startBool(t),Ma.endBool(t)}visitUtf8(e,t){return Va.startUtf8(t),Va.endUtf8(t)}visitUtf8View(e,t){return Ua.startUtf8View(t),Ua.endUtf8View(t)}visitLargeUtf8(e,t){return Na.startLargeUtf8(t),Na.endLargeUtf8(t)}visitDecimal(e,t){return zr.startDecimal(t),zr.addScale(t,e.scale),zr.addPrecision(t,e.precision),zr.addBitWidth(t,e.bitWidth),zr.endDecimal(t)}visitDate(e,t){return qn.startDate(t),qn.addUnit(t,e.unit),qn.endDate(t)}visitTime(e,t){return hn.startTime(t),hn.addUnit(t,e.unit),hn.addBitWidth(t,e.bitWidth),hn.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return pn.startTimestamp(t),pn.addUnit(t,e.unit),n!==void 0&&pn.addTimezone(t,n),pn.endTimestamp(t)}visitInterval(e,t){return Yn.startInterval(t),Yn.addUnit(t,e.unit),Yn.endInterval(t)}visitDuration(e,t){return Kn.startDuration(t),Kn.addUnit(t,e.unit),Kn.endDuration(t)}visitList(e,t){return ka.startList(t),ka.endList(t)}visitLargeList(e,t){return Da.startLargeList(t),Da.endLargeList(t)}visitStruct(e,t){return ja.startStruct_(t),ja.endStruct_(t)}visitUnion(e,t){Ir.startTypeIdsVector(t,e.typeIds.length);let n=Ir.createTypeIdsVector(t,e.typeIds);return Ir.startUnion(t),Ir.addMode(t,e.mode),Ir.addTypeIds(t,n),Ir.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Pr.startDictionaryEncoding(t),Pr.addId(t,BigInt(e.id)),Pr.addIsOrdered(t,e.isOrdered),n!==void 0&&Pr.addIndexType(t,n),Pr.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Hn.startFixedSizeBinary(t),Hn.addByteWidth(t,e.byteWidth),Hn.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Xn.startFixedSizeList(t),Xn.addListSize(t,e.listSize),Xn.endFixedSizeList(t)}visitMap(e,t){return Qn.startMap(t),Qn.addKeysSorted(t,e.keysSorted),Qn.endMap(t)}},Yu=new _h});function jx(r,e=new Map){return new J(nB(r,e),Qu(r.metadata),e)}function Ah(r){return new ze(r.count,Ux(r.columns),Gx(r.columns),null,Px(r.columns))}function Vx(r){return new ht(Ah(r.data),r.id,r.isDelta)}function nB(r,e){return(r.fields||[]).filter(Boolean).map(t=>F.fromJSON(t,e))}function Nx(r,e){return(r.children||[]).filter(Boolean).map(t=>F.fromJSON(t,e))}function Ux(r){return(r||[]).reduce((e,t)=>[...e,new pr(t.count,sB(t.VALIDITY)),...Ux(t.children)],[])}function Gx(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let s=r[t];if(s.VALIDITY&&e.push(new Ne(e.length,s.VALIDITY.length)),s.TYPE_ID&&e.push(new Ne(e.length,s.TYPE_ID.length)),s.OFFSET&&e.push(new Ne(e.length,s.OFFSET.length)),s.DATA&&e.push(new Ne(e.length,s.DATA.length)),s.VIEWS&&e.push(new Ne(e.length,s.VIEWS.length)),s.VARIADIC_DATA_BUFFERS)for(let i of s.VARIADIC_DATA_BUFFERS)e.push(new Ne(e.length,i.length));e=Gx(s.children,e)}return e}function sB(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function Px(r){return(r||[]).reduce((e,t)=>[...e,...t.VARIADIC_DATA_BUFFERS?[t.VARIADIC_DATA_BUFFERS.length]:[],...Px(t.children)],[])}function zx(r,e){let t,n,s,i,o,a;return!e||!(i=r.dictionary)?(o=Cx(r,Nx(r,e)),s=new F(r.name,o,r.nullable,Qu(r.metadata))):e.has(t=i.id)?(n=(n=i.indexType)?kx(n):new ke,a=new Ue(e.get(t),n,t,i.isOrdered),s=new F(r.name,a,r.nullable,Qu(r.metadata))):(n=(n=i.indexType)?kx(n):new ke,e.set(t,o=Cx(r,Nx(r,e))),a=new Ue(o,n,t,i.isOrdered),s=new F(r.name,a,r.nullable,Qu(r.metadata))),s||null}function Qu(r=[]){return new Map(r.map(({key:e,value:t})=>[e,t]))}function kx(r){return new Ee(r.isSigned,r.bitWidth)}function Cx(r,e){let t=r.type.name;switch(t){case"NONE":return new De;case"null":return new De;case"binary":return new Ot;case"largebinary":return new Fr;case"binaryview":return new Y;case"utf8":return new ot;case"largeutf8":return new Or;case"utf8view":return new xt;case"bool":return new at;case"list":return new Ve((e||[])[0]);case"largelist":return new Zt((e||[])[0]);case"struct":return new he(e||[]);case"struct_":return new he(e||[])}switch(t){case"int":{let n=r.type;return new Ee(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new it(ue[n.precision])}case"decimal":{let n=r.type;return new Mt(n.scale,n.precision,n.bitWidth)}case"date":{let n=r.type;return new Tt(ge[n.unit])}case"time":{let n=r.type;return new Qe(S[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new Ze(S[n.unit],n.timezone)}case"interval":{let n=r.type;return new ct(ie[n.unit])}case"duration":{let n=r.type;return new _t(S[n.unit])}case"union":{let n=r.type,[s,...i]=(n.mode+"").toLowerCase(),o=s.toUpperCase()+i.join("");return new At(de[o],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new Rt(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Se(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new ut((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}var Wx=p(()=>{dt();ye();ms();Fe()});function aB(r,e){return(()=>{switch(e){case ne.Schema:return J.fromJSON(r);case ne.RecordBatch:return ze.fromJSON(r);case ne.DictionaryBatch:return ht.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${ne[e]}, type: ${e} }`)})}function cB(r,e){return(()=>{switch(e){case ne.Schema:return J.decode(r.header(new Ft),new Map,r.version());case ne.RecordBatch:return ze.decode(r.header(new nt),r.version());case ne.DictionaryBatch:return ht.decode(r.header(new dn),r.version())}throw new Error(`Unrecognized Message type: { name: ${ne[e]}, type: ${e} }`)})}function uB(r,e=new Map,t=me.V5){let n=gB(r,e);return new J(n,Zu(r),e,t)}function fB(r,e=me.V5){return new ze(r.length(),pB(r),mB(r,e),Hx(r.compression()),bB(r))}function lB(r,e=me.V5){return new ht(ze.decode(r.data(),e),r.id(),r.isDelta())}function dB(r){return new Ne(r.offset(),r.length())}function hB(r){return new pr(r.length(),r.nullCount())}function pB(r){let e=[];for(let t,n=-1,s=-1,i=r.nodesLength();++n<i;)(t=r.nodes(n))&&(e[++s]=pr.decode(t));return e}function mB(r,e){let t=[];for(let n,s=-1,i=-1,o=r.buffersLength();++s<o;)(n=r.buffers(s))&&(e<me.V4&&(n.bb_pos+=8*(s+1)),t[++i]=Ne.decode(n));return t}function bB(r){let e=[],t=Math.trunc(r.variadicBufferCountsLength());for(let n=0;n<t;++n)e.push(ee(r.variadicBufferCounts(n)));return e}function gB(r,e){let t=[];for(let n,s=-1,i=-1,o=r.fieldsLength();++s<o;)(n=r.fields(s))&&(t[++i]=F.decode(n,e));return t}function $x(r,e){let t=[];for(let n,s=-1,i=-1,o=r.childrenLength();++s<o;)(n=r.children(s))&&(t[++i]=F.decode(n,e));return t}function yB(r,e){let t,n,s,i,o,a;return!e||!(a=r.dictionary())?(s=Kx(r,$x(r,e)),n=new F(r.name(),s,r.nullable(),Zu(r))):e.has(t=ee(a.id()))?(i=(i=a.indexType())?qx(i):new ke,o=new Ue(e.get(t),i,t,a.isOrdered()),n=new F(r.name(),o,r.nullable(),Zu(r))):(i=(i=a.indexType())?qx(i):new ke,e.set(t,s=Kx(r,$x(r,e))),o=new Ue(s,i,t,a.isOrdered()),n=new F(r.name(),o,r.nullable(),Zu(r))),n||null}function Zu(r){let e=new Map;if(r)for(let t,n,s=-1,i=Math.trunc(r.customMetadataLength());++s<i;)(t=r.customMetadata(s))&&(n=t.key())!=null&&e.set(n,t.value());return e}function wB(r){let e=new Map;for(let t,n,s=-1,i=Math.trunc(r.customMetadataLength());++s<i;)(t=r.customMetadata(s))&&(n=t.key())!=null&&e.set(n,t.value());return e}function qx(r){return new Ee(r.isSigned(),r.bitWidth())}function Kx(r,e){let t=r.typeType();switch(t){case P.NONE:return new De;case P.Null:return new De;case P.Binary:return new Ot;case P.LargeBinary:return new Fr;case P.BinaryView:return new Y;case P.Utf8:return new ot;case P.LargeUtf8:return new Or;case P.Utf8View:return new xt;case P.Bool:return new at;case P.List:return new Ve((e||[])[0]);case P.LargeList:return new Zt((e||[])[0]);case P.Struct_:return new he(e||[])}switch(t){case P.Int:{let n=r.type(new vr);return new Ee(n.isSigned(),n.bitWidth())}case P.FloatingPoint:{let n=r.type(new Jn);return new it(n.precision())}case P.Decimal:{let n=r.type(new zr);return new Mt(n.scale(),n.precision(),n.bitWidth())}case P.Date:{let n=r.type(new qn);return new Tt(n.unit())}case P.Time:{let n=r.type(new hn);return new Qe(n.unit(),n.bitWidth())}case P.Timestamp:{let n=r.type(new pn);return new Ze(n.unit(),n.timezone())}case P.Interval:{let n=r.type(new Yn);return new ct(n.unit())}case P.Duration:{let n=r.type(new Kn);return new _t(n.unit())}case P.Union:{let n=r.type(new Ir);return new At(n.mode(),n.typeIdsArray()||[],e||[])}case P.FixedSizeBinary:{let n=r.type(new Hn);return new Rt(n.byteWidth())}case P.FixedSizeList:{let n=r.type(new Xn);return new Se(n.listSize(),(e||[])[0])}case P.Map:{let n=r.type(new Qn);return new ut((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${P[t]}" (${t})`)}function Hx(r){return r?new li(r.codec(),r.method()):null}function xB(r,e){let t=e.fields.map(i=>F.encode(r,i));Ft.startFieldsVector(r,t.length);let n=Ft.createFieldsVector(r,t),s=e.metadata&&e.metadata.size>0?Ft.createCustomMetadataVector(r,[...e.metadata].map(([i,o])=>{let a=r.createString(`${i}`),c=r.createString(`${o}`);return Be.startKeyValue(r),Be.addKey(r,a),Be.addValue(r,c),Be.endKeyValue(r)})):-1;return Ft.startSchema(r),Ft.addFields(r,n),Ft.addEndianness(r,LB?$n.Little:$n.Big),s!==-1&&Ft.addCustomMetadata(r,s),Ft.endSchema(r)}function TB(r,e){let t=-1,n=-1,s=-1,i=e.type,o=e.typeId;L.isDictionary(i)?(o=i.dictionary.typeId,s=Yu.visit(i,r),n=Yu.visit(i.dictionary,r)):n=Yu.visit(i,r);let a=(i.children||[]).map(f=>F.encode(r,f)),c=st.createChildrenVector(r,a),u=e.metadata&&e.metadata.size>0?st.createCustomMetadataVector(r,[...e.metadata].map(([f,l])=>{let d=r.createString(`${f}`),h=r.createString(`${l}`);return Be.startKeyValue(r),Be.addKey(r,d),Be.addValue(r,h),Be.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),st.startField(r),st.addType(r,n),st.addTypeType(r,o),st.addChildren(r,c),st.addNullable(r,!!e.nullable),t!==-1&&st.addName(r,t),s!==-1&&st.addDictionary(r,s),u!==-1&&st.addCustomMetadata(r,u),st.endField(r)}function _B(r,e){let t=e.nodes||[],n=e.buffers||[],s=e.variadicBufferCounts||[];nt.startNodesVector(r,t.length);for(let u of t.slice().reverse())pr.encode(r,u);let i=r.endVector();nt.startBuffersVector(r,n.length);for(let u of n.slice().reverse())Ne.encode(r,u);let o=r.endVector(),a=null;e.compression!==null&&(a=Xx(r,e.compression));let c=-1;return s.length>0&&(c=nt.createVariadicBufferCountsVector(r,s.map(BigInt))),nt.startRecordBatch(r),nt.addLength(r,BigInt(e.length)),nt.addNodes(r,i),nt.addBuffers(r,o),e.compression!==null&&a&&nt.addCompression(r,a),c!==-1&&nt.addVariadicBufferCounts(r,c),nt.endRecordBatch(r)}function Xx(r,e){return ln.startBodyCompression(r),ln.addCodec(r,e.type),ln.addMethod(r,e.method),ln.endBodyCompression(r)}function AB(r,e){let t=ze.encode(r,e.data);return dn.startDictionaryBatch(r),dn.addId(r,BigInt(e.id)),dn.addIsDelta(r,e.isDelta),dn.addData(r,t),dn.endDictionaryBatch(r)}function vB(r,e){return mo.createFieldNode(r,BigInt(e.length),BigInt(e.nullCount))}function IB(r,e){return po.createBuffer(r,BigInt(e.offset),BigInt(e.length))}var iB,oB,pt,ze,ht,Ne,pr,li,LB,ms=p(()=>{oe();qd();mu();Od();Ky();Bd();$d();Fd();bu();bo();Md();Vd();Nd();Dd();Pd();zd();Ud();kd();Wd();Cd();jd();Gd();Rx();Ed();Sd();dt();$e();Wr();Fe();Dx();Wx();ye();iB=ti,oB=Je,pt=class r{static fromJSON(e,t){let n=new r(0,me.V5,t);return n._createHeader=aB(e,t),n}static decode(e){e=new oB(D(e));let t=nr.getRootAsMessage(e),n=t.bodyLength(),s=t.version(),i=t.headerType(),o=wB(t),a=new r(n,s,i,void 0,o);return a._createHeader=cB(t,i),a}static encode(e){let t=new iB,n=-1;e.isSchema()?n=J.encode(t,e.header()):e.isRecordBatch()?n=ze.encode(t,e.header()):e.isDictionaryBatch()&&(n=ht.encode(t,e.header()));let s=e.metadata&&e.metadata.size>0?nr.createCustomMetadataVector(t,[...e.metadata].map(([i,o])=>{let a=t.createString(`${i}`),c=t.createString(`${o}`);return Be.startKeyValue(t),Be.addKey(t,a),Be.addValue(t,c),Be.endKeyValue(t)})):-1;return nr.startMessage(t),nr.addVersion(t,me.V5),nr.addHeader(t,n),nr.addHeaderType(t,e.headerType),nr.addBodyLength(t,BigInt(e.bodyLength)),s!==-1&&nr.addCustomMetadata(t,s),nr.finishMessageBuffer(t,nr.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof J)return new r(0,me.V5,ne.Schema,e);if(e instanceof ze)return new r(t,me.V5,ne.RecordBatch,e,e.metadata);if(e instanceof ht)return new r(t,me.V5,ne.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===ne.Schema}isRecordBatch(){return this.headerType===ne.RecordBatch}isDictionaryBatch(){return this.headerType===ne.DictionaryBatch}constructor(e,t,n,s,i){this._version=t,this._headerType=n,this.body=new Uint8Array(0),this._compression=s?.compression,s&&(this._createHeader=()=>s),this._bodyLength=ee(e),this._metadata=i||new Map}},ze=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(e,t,n,s,i=[],o){this._nodes=t,this._buffers=n,this._length=ee(e),this._compression=s,this._variadicBufferCounts=i,this._metadata=o||new Map}},ht=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=ee(t)}},Ne=class{constructor(e,t){this.offset=ee(e),this.length=ee(t)}},pr=class{constructor(e,t){this.length=ee(e),this.nullCount=ee(t)}},li=class{constructor(e,t=ri.BUFFER){this.type=e,this.method=t}};F.encode=TB;F.decode=yB;F.fromJSON=zx;J.encode=xB;J.decode=uB;J.fromJSON=jx;ze.encode=_B;ze.decode=fB;ze.fromJSON=Ah;ht.encode=AB;ht.decode=lB;ht.fromJSON=Vx;pr.encode=vB;pr.decode=hB;Ne.encode=IB;Ne.decode=dB;li.encode=Xx;li.decode=Hx;LB=(()=>{let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})()});var Ie,tc,di,ef,rc=p(()=>{Bt();La();Ie=Object.freeze({done:!0,value:void 0}),tc=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},di=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},ef=class extends di{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Ie);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Xe.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Xe.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return B(this,void 0,void 0,function*(){return yield this.abort(e),Ie})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),Ie})}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(Ie)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var mr,br,kt,vh,wn,bs=p(()=>{Bt();La();fn();rc();$e();Wn();mr=class extends ef{write(e){if((e=D(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?fo(this.toUint8Array(!0)):this.toUint8Array(!1).then(fo)}toUint8Array(e=!1){return e?qt(this._values)[0]:B(this,void 0,void 0,function*(){var t,n,s,i;let o=[],a=0;try{for(var c=!0,u=zt(this),f;f=yield u.next(),t=f.done,!t;c=!0){i=f.value,c=!1;let l=i;o.push(l),a+=l.byteLength}}catch(l){n={error:l}}finally{try{!c&&!t&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return qt(o,a)[0]})}},br=class{constructor(e){e&&(this.source=new vh(Xe.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},kt=class r{constructor(e){e instanceof r?this.source=e.source:e instanceof mr?this.source=new wn(Xe.fromAsyncIterable(e)):au(e)?this.source=new wn(Xe.fromNodeStream(e)):Aa(e)?this.source=new wn(Xe.fromDOMStream(e)):iu(e)?this.source=new wn(Xe.fromDOMStream(e.body)):Tr(e)?this.source=new wn(Xe.fromIterable(e)):$t(e)?this.source=new wn(Xe.fromAsyncIterable(e)):fr(e)&&(this.source=new wn(Xe.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},vh=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Ie)}return(e){return Object.create(this.source.return&&this.source.return(e)||Ie)}},wn=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return B(this,arguments,void 0,function*(t,n="read"){return yield this.source.next({cmd:n,size:t})})}throw(e){return B(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Ie;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return B(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Ie;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}});var nc,gs,Ih=p(()=>{Bt();bs();$e();nc=class extends br{constructor(e,t){super(),this.position=0,this.buffer=D(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:t,size:n,position:s}=this;return t&&s<n?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(n,s+Math.min(n-s,e)),t.subarray(s,this.position)):null}readAt(e,t){let n=this.buffer,s=Math.min(this.size,e+t);return n?n.subarray(e,s):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},gs=class extends kt{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=B(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return B(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return B(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return B(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:n,position:s}=this;if(t&&s<n){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let i=s,o=0,a=0,c=Math.min(n,i+Math.min(n-i,e)),u=new Uint8Array(Math.max(0,(this.position=c)-i));for(;(i+=a)<c&&(o+=a)<u.byteLength;)({bytesRead:a}=yield t.read(u,o,u.byteLength-o,i));return u}return null})}readAt(e,t){return B(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:s}=this;if(n&&e+t<s){let i=Math.min(s,e+t),o=new Uint8Array(i-e);return(yield n.read(o,0,t,e)).buffer}return new Uint8Array(t)})}close(){return B(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return B(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var Sh={};Q(Sh,{BaseInt64:()=>sc,Int128:()=>ic,Int64:()=>xn,Uint64:()=>Oe});function Oo(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var Mo,Lh,sc,Oe,xn,ic,Eh=p(()=>{Mo=8,Lh=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],sc=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),s=t[3]*n[3];this.buffer[0]=s&65535;let i=s>>>16;return s=t[2]*n[3],i+=s,s=t[3]*n[2]>>>0,i+=s,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0<s?65536:0,this.buffer[1]+=i>>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${Oo(this.buffer[1])} ${Oo(this.buffer[0])}`}},Oe=class r extends sc{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,s=new r(t);for(let i=0;i<n;){let o=Mo<n-i?Mo:n-i,a=new r(new Uint32Array([Number.parseInt(e.slice(i,i+o),10),0])),c=new r(new Uint32Array([Lh[o],0]));s.times(c),s.plus(a),i+=o}return s}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}},xn=class r extends sc{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let t=this.buffer[1]<<0,n=e.buffer[1]<<0;return t<n||t===n&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),s=e.length,i=new r(t);for(let o=n?1:0;o<s;){let a=Mo<s-o?Mo:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0])),u=new r(new Uint32Array([Lh[a],0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}},ic=class r{constructor(e){this.buffer=e}high(){return new xn(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new xn(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let t=new Oe(new Uint32Array([this.buffer[3],0])),n=new Oe(new Uint32Array([this.buffer[2],0])),s=new Oe(new Uint32Array([this.buffer[1],0])),i=new Oe(new Uint32Array([this.buffer[0],0])),o=new Oe(new Uint32Array([e.buffer[3],0])),a=new Oe(new Uint32Array([e.buffer[2],0])),c=new Oe(new Uint32Array([e.buffer[1],0])),u=new Oe(new Uint32Array([e.buffer[0],0])),f=Oe.multiply(i,u);this.buffer[0]=f.low();let l=new Oe(new Uint32Array([f.high(),0]));return f=Oe.multiply(s,u),l.plus(f),f=Oe.multiply(i,c),l.plus(f),this.buffer[1]=l.low(),this.buffer[3]=l.lessThan(f)?1:0,this.buffer[2]=l.high(),new Oe(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Oe.multiply(n,u)).plus(Oe.multiply(s,c)).plus(Oe.multiply(i,a)),this.buffer[3]+=Oe.multiply(t,u).plus(Oe.multiply(n,c)).plus(Oe.multiply(s,a)).plus(Oe.multiply(i,o)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${Oo(this.buffer[3])} ${Oo(this.buffer[2])} ${Oo(this.buffer[1])} ${Oo(this.buffer[0])}`}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),s=e.length,i=new r(t);for(let o=n?1:0;o<s;){let a=Mo<s-o?Mo:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0,0,0])),u=new r(new Uint32Array([Lh[a],0,0,0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+16*n,4));return t}}});var Rh={};Q(Rh,{toIntervalDayTimeInt32Array:()=>Bh,toIntervalDayTimeObjects:()=>Oh,toIntervalMonthDayNanoInt32Array:()=>Fh,toIntervalMonthDayNanoObjects:()=>Mh});function Bh(r){var e,t;let n=r.length,s=new Int32Array(n*2);for(let i=0,o=0;i<n;i++){let a=r[i];s[o++]=(e=a.days)!==null&&e!==void 0?e:0,s[o++]=(t=a.milliseconds)!==null&&t!==void 0?t:0}return s}function Fh(r){var e,t;let n=r.length,s=new Int32Array(n*4);for(let i=0,o=0;i<n;i++){let a=r[i];s[o++]=(e=a.months)!==null&&e!==void 0?e:0,s[o++]=(t=a.days)!==null&&t!==void 0?t:0;let c=a.nanoseconds;if(c){let u=BigInt(c);s[o++]=Number(u&BigInt(4294967295))>>>0,s[o++]=Number(u>>BigInt(32))>>>0}else o+=2}return s}function Oh(r){let e=r.length,t=new Array(e/2);for(let n=0,s=0;n<e;n+=2)t[s++]={days:r[n],milliseconds:r[n+1]};return t}function Mh(r,e){let t=r.length,n=new Array(t/4);for(let s=0,i=0;s<t;s+=4){let o=BigInt(r[s+3])<<BigInt(32)|BigInt(r[s+2]>>>0);n[i++]={months:r[s],days:r[s+1],nanoseconds:e?`${o}`:o}}return n}var tf=p(()=>{});function Yx(r){let e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2)e[t>>1]=Number.parseInt(r.slice(t,t+2),16);return e}function SB(r){return Yx(r.join(""))}function Qx(r,e){let t=new Uint8Array(r.length*16),n=new DataView(t.buffer);for(let[s,i]of r.entries()){let o=s*16,a=i.SIZE;if(n.setInt32(o,a,!0),i.INLINED!==void 0){let c=e(i.INLINED);for(let u=0;u<c.length&&u<12;u++)t[o+4+u]=c[u]}else{let c=i.PREFIX_HEX;for(let u=0;u<8&&u<c.length;u+=2)t[o+4+(u>>1)]=Number.parseInt(c.slice(u,u+2),16);n.setInt32(o+8,i.BUFFER_INDEX,!0),n.setInt32(o+12,i.OFFSET,!0)}}return t}function EB(r){return Qx(r,e=>{let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=Number.parseInt(e.slice(n,n+2),16);return t})}function BB(r){return Qx(r,e=>new TextEncoder().encode(e))}var Ro,rf,nf,Zx=p(()=>{hr();dt();ye();Dt();ci();fn();Eh();Fe();$e();tf();Ro=class extends R{constructor(e,t,n,s,i=me.V5,o=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=e,this.nodes=t,this.buffers=n,this.dictionaries=s,this.metadataVersion=i,this.variadicBufferCounts=o}visit(e){return super.visit(e instanceof F?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return M({type:e,length:t})}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitUtf8View(e,{length:t,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return M({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinaryView(e,{length:t,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return M({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitFixedSizeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitLargeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),children:this.visitMany(e.children)})}visitUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<me.V5&&this.readNullBitmap(e,n),e.mode===de.Sparse?this.visitSparseUnion(e,{length:t,nullCount:n}):this.visitDenseUnion(e,{length:t,nullCount:n})}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDuration(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),child:this.visit(e.children[0])})}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,n=this.nextBufferRange()){return t>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readVariadicBuffers(e){return Array.from({length:e},()=>this.readData(null))}nextVariadicBufferCount(){var e;return(e=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&e!==void 0?e:0}readDictionary(e){return this.dictionaries.get(e.id)}},rf=class extends Ro{constructor(e,t,n,s,i,o=[]){super(new Uint8Array(0),t,n,s,i,o),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array(0):ai(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Z(Uint8Array,Z(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Z(Uint8Array,Z(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;if(L.isTimestamp(e))return Z(Uint8Array,xn.convertArray(n[t]));if((L.isInt(e)||L.isTime(e))&&e.bitWidth===64||L.isDuration(e))return Z(Uint8Array,xn.convertArray(n[t]));if(L.isDate(e)&&e.unit===ge.MILLISECOND)return Z(Uint8Array,xn.convertArray(n[t]));if(L.isDecimal(e))return Z(Uint8Array,ic.convertArray(n[t]));if(L.isBinary(e)||L.isLargeBinary(e)||L.isFixedSizeBinary(e))return SB(n[t]);if(L.isBinaryView(e))return EB(n[t]);if(L.isUtf8View(e))return BB(n[t]);if(L.isBool(e))return ai(n[t]);if(L.isUtf8(e)||L.isLargeUtf8(e))return Wt(n[t].join(""));if(L.isInterval(e))switch(e.unit){case ie.DAY_TIME:return Bh(n[t]);case ie.MONTH_DAY_NANO:return Fh(n[t]);default:break}return Z(Uint8Array,Z(e.ArrayType,n[t].map(s=>+s)))}readVariadicBuffers(e){let t=[];for(let n=0;n<e;n++){let{offset:s}=this.nextBufferRange(),i=this.sources[s];t.push(Yx(i))}return t}};nf=class extends Ro{constructor(e,t,n,s,i,o=[]){super(new Uint8Array(0),t,n,s,i,o),this.bodyChunks=e}readData(e,t=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var Tn,sf=p(()=>{Rr();ve();$e();Tn=class extends lt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,D(t))}_flushPending(e,t){let n=this._offsets,s=this._values.reserve(t).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,0);else{let c=a.length;s.set(a,i),n.set(o,c),i+=c}}}});var _n,of=p(()=>{$e();Rr();ve();_n=class extends lt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,D(t))}_flushPending(e,t){let n=this._offsets,s=this._values.reserve(t).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,BigInt(0));else{let c=a.length;s.set(a,i),n.set(o,BigInt(c)),i+=c}}}});var hi,Dh=p(()=>{Rr();ve();hi=class extends xe{constructor(e){super(e),this._values=new Fo}setValue(e,t){this._values.set(e,+t)}}});var Xr,ys,ws,Nh=p(()=>{ve();tr();Xr=class extends Pe{};Xr.prototype._setValue=th;ys=class extends Xr{};ys.prototype._setValue=xu;ws=class extends Xr{};ws.prototype._setValue=Tu});var xs,kh=p(()=>{ve();tr();xs=class extends Pe{};xs.prototype._setValue=sh});var pi,Ch=p(()=>{ye();ve();oc();pi=class extends xe{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new Ue(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Nr({type:this.type.indices,nullValues:t}),this.dictionary=Nr({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let n=this.indices;return t=n.setValid(e,t),this.length=n.length,t}setValue(e,t){let n=this._keysToIndices,s=this.valueToKey(t),i=n[s];return i===void 0&&(n[s]=i=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,i)}flush(){let e=this.type,t=this._dictionary,n=this.dictionary.toVector(),s=this.indices.flush().clone(e);return s.dictionary=t?t.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=s.dictionary,this.clear(),s}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}}});var Ts,jh=p(()=>{ve();tr();Ts=class extends Pe{};Ts.prototype._setValue=eh});var mi,Vh=p(()=>{dt();ve();ye();mi=class extends xe{setValue(e,t){let[n]=this.children,s=e*this.stride;for(let i=-1,o=this.stride;++i<o;)n.set(s+i,t[i])}setValid(e,t){return super.setValid(e,t)||this.children[0].setValid((e+1)*this.stride-1,!1),t}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new Se(this.type.listSize,new F(t,e.type,!0)),n}}});var Jr,bi,gi,yi,Uh=p(()=>{Xa();ve();Jr=class extends Pe{setValue(e,t){this._values.set(e,t)}},bi=class extends Jr{setValue(e,t){super.setValue(e,Ha(t))}},gi=class extends Jr{},yi=class extends Jr{}});var kr,_s,As,vs,Gh=p(()=>{ve();tr();kr=class extends Pe{};kr.prototype._setValue=ih;_s=class extends kr{};_s.prototype._setValue=Fu;As=class extends kr{};As.prototype._setValue=Ou;vs=class extends kr{};vs.prototype._setValue=Mu});var gr,Is,Ls,Ss,Es,Ph=p(()=>{ve();tr();gr=class extends Pe{};gr.prototype._setValue=oh;Is=class extends gr{};Is.prototype._setValue=Ru;Ls=class extends gr{};Ls.prototype._setValue=Du;Ss=class extends gr{};Ss.prototype._setValue=Nu;Es=class extends gr{};Es.prototype._setValue=ku});var vt,wi,xi,Ti,_i,Ai,vi,Ii,Li,zh=p(()=>{ve();vt=class extends Pe{setValue(e,t){this._values.set(e,t)}},wi=class extends vt{},xi=class extends vt{},Ti=class extends vt{},_i=class extends vt{},Ai=class extends vt{},vi=class extends vt{},Ii=class extends vt{},Li=class extends vt{}});var Si,Wh=p(()=>{dt();ye();Rr();ve();Si=class extends lt{constructor(e){super(e),this._offsets=new ps(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Ve(new F(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")t.set(s,0);else{let o=i,a=o.length,c=t.set(s,a).buffer[s];for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Ei,$h=p(()=>{dt();ye();Rr();Wr();ve();Ei=class extends lt{constructor(e){super(e),this._offsets=new ps(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Zt(new F(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")t.set(s,BigInt(0));else{let o=i,a=o.length,c=ee(t.set(s,BigInt(a)).buffer[s]);for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Bi,qh=p(()=>{dt();ye();ve();Bi=class extends lt{set(e,t){return super.set(e,t)}setValue(e,t){let n=t instanceof Map?t:new Map(Object.entries(t)),s=this._pending||(this._pending=new Map),i=s.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=n.size,s.set(e,n)}addChild(e,t=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ut(new F(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(i===void 0)t.set(s,0);else{let{[s]:o,[s+1]:a}=t.set(s,i.size).buffer;for(let c of i.entries())if(n.set(o,c),++o>=a)break}}}});var Fi,Kh=p(()=>{ve();Fi=class extends xe{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}}});var Oi,Hh=p(()=>{dt();ve();ye();Oi=class extends xe{setValue(e,t){let{children:n,type:s}=this;switch(Array.isArray(t)||t.constructor){case!0:return s.children.forEach((i,o)=>n[o].set(e,t[o]));case Map:return s.children.forEach((i,o)=>n[o].set(e,t.get(i.name)));default:return s.children.forEach((i,o)=>n[o].set(e,t[i.name]))}}setValid(e,t){return super.setValid(e,t)||this.children.forEach(n=>n.setValid(e,t)),t}addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new he([...this.type.children,new F(t,e.type,!0)]),n}}});var yr,Bs,Fs,Os,Ms,Xh=p(()=>{ve();tr();yr=class extends Pe{};yr.prototype._setValue=rh;Bs=class extends yr{};Bs.prototype._setValue=_u;Fs=class extends yr{};Fs.prototype._setValue=Au;Os=class extends yr{};Os.prototype._setValue=vu;Ms=class extends yr{};Ms.prototype._setValue=Iu});var wr,Rs,Ds,Ns,ks,Jh=p(()=>{ve();tr();wr=class extends Pe{};wr.prototype._setValue=nh;Rs=class extends wr{};Rs.prototype._setValue=Lu;Ds=class extends wr{};Ds.prototype._setValue=Su;Ns=class extends wr{};Ns.prototype._setValue=Eu;ks=class extends wr{};ks.prototype._setValue=Bu});var An,Mi,Ri,Yh=p(()=>{dt();Rr();ve();ye();An=class extends xe{constructor(e){super(e),this._typeIds=new gn(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,n){return n===void 0&&(n=this._valueToChildTypeId(this,t,e)),this.setValue(e,t,n),this}setValue(e,t,n){this._typeIds.set(e,n);let s=this.type.typeIdToChildIndex[n],i=this.children[s];i?.set(e,t),this.length=Math.max(e+1,this.length)}addChild(e,t=`${this.children.length}`){let n=this.children.push(e),{type:{children:s,mode:i,typeIds:o}}=this,a=[...s,new F(t,e.type)];return this.type=new At(i,[...o,n],a),n}_valueToChildTypeId(e,t,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},Mi=class extends An{},Ri=class extends An{constructor(e){super(e),this._offsets=new gn(Int32Array)}setValue(e,t,n){let s=this._typeIds.set(e,n).buffer[e],i=this.getChildAt(this.type.typeIdToChildIndex[s]),o=this._offsets.set(e,i.length).buffer[e];i?.set(o,t),this.length=Math.max(e+1,this.length)}}});var Cs,Qh=p(()=>{fn();sf();Rr();ve();Cs=class extends lt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Wt(t))}_flushPending(e,t){}};Cs.prototype._flushPending=Tn.prototype._flushPending});var js,Zh=p(()=>{fn();Rr();ve();of();js=class extends lt{constructor(e){super(e),this._values=new Nt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Wt(t))}_flushPending(e,t){}};js.prototype._flushPending=_n.prototype._flushPending});var vn,af=p(()=>{ye();ve();Rr();$e();hr();vn=class extends xe{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Nt(Uint8Array)}get byteLength(){let e=0;this._views&&(e+=this._views.byteLength),this._nulls&&(e+=this._nulls.byteLength);for(let t of this._variadicBuffers)e+=t.byteLength;return this._currentBuffer&&(e+=this._currentBuffer.byteLength),e}setValue(e,t){return this.writeBinaryValue(e,this.encodeValue(t))}writeBinaryValue(e,t){let n=t.length,s=(e+1)*Y.ELEMENT_WIDTH,i=this._views.length;s>i&&this._views.reserve(s-i);let o=this._views.buffer,a=e*Y.ELEMENT_WIDTH,c=new DataView(o.buffer,o.byteOffset+a,Y.ELEMENT_WIDTH);if(c.setInt32(Y.LENGTH_OFFSET,n,!0),n<=Y.INLINE_CAPACITY){o.set(t,a+Y.INLINE_OFFSET);for(let u=n;u<Y.INLINE_CAPACITY;u++)o[a+Y.INLINE_OFFSET+u]=0}else{let u=new DataView(t.buffer,t.byteOffset,Math.min(4,n));c.setUint32(Y.INLINE_OFFSET,u.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new Nt(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(t,this._currentBufferOffset),c.setInt32(Y.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Y.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(e){return D(e)}setValid(e,t){let n=(e+1)*Y.ELEMENT_WIDTH,s=this._views.length;n>s&&this._views.reserve(n-s);let i=super.setValid(e,t);if(!i){let o=this._views.buffer,a=e*Y.ELEMENT_WIDTH;for(let c=0;c<Y.ELEMENT_WIDTH;c++)o[a+c]=0}return i}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:e,length:t,nullCount:n,_views:s,_nulls:i}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let o=s.flush(t*Y.ELEMENT_WIDTH),a=n>0?i.flush(t):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),M({type:e,length:t,nullCount:n,nullBitmap:a,views:o,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Di,ep=p(()=>{af();fn();Di=class extends vn{constructor(e){super(e)}setValue(e,t){return this.writeBinaryValue(e,Wt(t))}}});var tp,e0,t0=p(()=>{Dt();sf();of();Dh();Nh();kh();Ch();jh();Vh();Uh();Gh();Ph();zh();Wh();$h();qh();Kh();Hh();Xh();Jh();Yh();Qh();Zh();af();ep();tp=class extends R{visitNull(){return Fi}visitBool(){return hi}visitInt(){return vt}visitInt8(){return wi}visitInt16(){return xi}visitInt32(){return Ti}visitInt64(){return _i}visitUint8(){return Ai}visitUint16(){return vi}visitUint32(){return Ii}visitUint64(){return Li}visitFloat(){return Jr}visitFloat16(){return bi}visitFloat32(){return gi}visitFloat64(){return yi}visitUtf8(){return Cs}visitLargeUtf8(){return js}visitBinary(){return Tn}visitLargeBinary(){return _n}visitFixedSizeBinary(){return Ts}visitDate(){return Xr}visitDateDay(){return ys}visitDateMillisecond(){return ws}visitTimestamp(){return yr}visitTimestampSecond(){return Bs}visitTimestampMillisecond(){return Fs}visitTimestampMicrosecond(){return Os}visitTimestampNanosecond(){return Ms}visitTime(){return wr}visitTimeSecond(){return Rs}visitTimeMillisecond(){return Ds}visitTimeMicrosecond(){return Ns}visitTimeNanosecond(){return ks}visitDecimal(){return xs}visitList(){return Si}visitLargeList(){return Ei}visitStruct(){return Oi}visitUnion(){return An}visitDenseUnion(){return Ri}visitSparseUnion(){return Mi}visitDictionary(){return pi}visitInterval(){return kr}visitIntervalDayTime(){return _s}visitIntervalYearMonth(){return As}visitIntervalMonthDayNano(){return vs}visitDuration(){return gr}visitDurationSecond(){return Is}visitDurationMillisecond(){return Ls}visitDurationMicrosecond(){return Ss}visitDurationNanosecond(){return Es}visitFixedSizeList(){return mi}visitMap(){return Bi}visitBinaryView(){return vn}visitUtf8View(){return Di}},e0=new tp});function It(r,e){return e instanceof r.constructor}function In(r,e){return r===e||It(r,e)}function Ln(r,e){return r===e||It(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function cf(r,e){return r===e||It(r,e)&&r.precision===e.precision}function FB(r,e){return r===e||It(r,e)&&r.byteWidth===e.byteWidth}function rp(r,e){return r===e||It(r,e)&&r.unit===e.unit}function ac(r,e){return r===e||It(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function cc(r,e){return r===e||It(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function r0(r,e){return r===e||It(r,e)&&r.children.length===e.children.length&&Yr.compareManyFields(r.children,e.children)}function OB(r,e){return r===e||It(r,e)&&r.children.length===e.children.length&&Yr.compareManyFields(r.children,e.children)}function np(r,e){return r===e||It(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&Yr.compareManyFields(r.children,e.children)}function MB(r,e){return r===e||It(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&Yr.visit(r.indices,e.indices)&&Yr.visit(r.dictionary,e.dictionary)}function uf(r,e){return r===e||It(r,e)&&r.unit===e.unit}function uc(r,e){return r===e||It(r,e)&&r.unit===e.unit}function RB(r,e){return r===e||It(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&Yr.compareManyFields(r.children,e.children)}function DB(r,e){return r===e||It(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&Yr.compareManyFields(r.children,e.children)}function Ni(r,e){return Yr.compareSchemas(r,e)}function n0(r,e){return Yr.compareFields(r,e)}function ff(r,e){return Yr.visit(r,e)}var U,Yr,fc=p(()=>{Dt();U=class extends R{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,s)=>this.compareFields(n,t[s]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};U.prototype.visitNull=In;U.prototype.visitBool=In;U.prototype.visitInt=Ln;U.prototype.visitInt8=Ln;U.prototype.visitInt16=Ln;U.prototype.visitInt32=Ln;U.prototype.visitInt64=Ln;U.prototype.visitUint8=Ln;U.prototype.visitUint16=Ln;U.prototype.visitUint32=Ln;U.prototype.visitUint64=Ln;U.prototype.visitFloat=cf;U.prototype.visitFloat16=cf;U.prototype.visitFloat32=cf;U.prototype.visitFloat64=cf;U.prototype.visitUtf8=In;U.prototype.visitLargeUtf8=In;U.prototype.visitUtf8View=In;U.prototype.visitBinary=In;U.prototype.visitLargeBinary=In;U.prototype.visitBinaryView=In;U.prototype.visitFixedSizeBinary=FB;U.prototype.visitDate=rp;U.prototype.visitDateDay=rp;U.prototype.visitDateMillisecond=rp;U.prototype.visitTimestamp=ac;U.prototype.visitTimestampSecond=ac;U.prototype.visitTimestampMillisecond=ac;U.prototype.visitTimestampMicrosecond=ac;U.prototype.visitTimestampNanosecond=ac;U.prototype.visitTime=cc;U.prototype.visitTimeSecond=cc;U.prototype.visitTimeMillisecond=cc;U.prototype.visitTimeMicrosecond=cc;U.prototype.visitTimeNanosecond=cc;U.prototype.visitDecimal=In;U.prototype.visitList=r0;U.prototype.visitLargeList=r0;U.prototype.visitStruct=OB;U.prototype.visitUnion=np;U.prototype.visitDenseUnion=np;U.prototype.visitSparseUnion=np;U.prototype.visitDictionary=MB;U.prototype.visitInterval=uf;U.prototype.visitIntervalDayTime=uf;U.prototype.visitIntervalYearMonth=uf;U.prototype.visitIntervalMonthDayNano=uf;U.prototype.visitDuration=uc;U.prototype.visitDurationSecond=uc;U.prototype.visitDurationMillisecond=uc;U.prototype.visitDurationMicrosecond=uc;U.prototype.visitDurationNanosecond=uc;U.prototype.visitFixedSizeList=RB;U.prototype.visitMap=DB;Yr=new U});function Nr(r){let e=r.type,t=new(e0.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],s={nullValues:r.nullValues},i=Array.isArray(n)?((o,a)=>n[a]||s):(({name:o})=>n[o]||s);for(let[o,a]of e.children.entries()){let{type:c}=a,u=i(a,o);t.children.push(Nr(Object.assign(Object.assign({},u),{type:c})))}}return t}function Do(r,e){if(r instanceof k||r instanceof E||r.type instanceof L||ArrayBuffer.isView(r))return Hr(r);let t={type:e??lf(r),nullValues:[null]},n=[...df(t)(r)],s=n.length===1?n[0]:n.reduce((i,o)=>i.concat(o));return L.isDictionary(s.type)?s.memoize():s}function sp(r){let e=Do(r),t=new le(new J(e.type.children),e.data[0]);return new be(t)}function lf(r){if(r.length===0)return new De;let e=0,t=0,n=0,s=0,i=0,o=0,a=0,c=0;for(let u of r){if(u==null){++e;continue}switch(typeof u){case"bigint":++o;continue;case"boolean":++a;continue;case"number":++s;continue;case"string":++i;continue;case"object":Array.isArray(u)?++t:Object.prototype.toString.call(u)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(s+e===r.length)return new Qt;if(i+e===r.length)return new Ue(new ot,new ke);if(o+e===r.length)return new Xt;if(a+e===r.length)return new at;if(c+e===r.length)return new $r;if(t+e===r.length){let u=r,f=lf(u[u.findIndex(l=>l!=null)]);if(u.every(l=>l==null||ff(f,lf(l))))return new Ve(new F("",f,!0))}else if(n+e===r.length){let u=new Map;for(let f of r)for(let l of Object.keys(f))!u.has(l)&&f[l]!=null&&u.set(l,new F(l,lf([f[l]]),!0));return new he([...u.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function df(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function*(s){let i=0,o=Nr(r);for(let a of s)o.append(a)[n]>=t&&++i&&(yield o.toVector());(o.finish().length>0||i===0)&&(yield o.toVector())}}function ip(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function(s){return bt(this,arguments,function*(){var i,o,a,c;let u=0,f=Nr(r);try{for(var l=!0,d=zt(s),h;h=yield X(d.next()),i=h.done,!i;l=!0){c=h.value,l=!1;let m=c;f.append(m)[n]>=t&&++u&&(yield yield X(f.toVector()))}}catch(m){o={error:m}}finally{try{!l&&!i&&(a=d.return)&&(yield X(a.call(d)))}finally{if(o)throw o.error}}(f.finish().length>0||u===0)&&(yield yield X(f.toVector()))})}}var oc=p(()=>{Bt();dt();ye();hr();ft();t0();ki();Sn();fc()});function hf(r,e){return NB(r,e.map(t=>t.data.concat()))}function NB(r,e){let t=[...r.fields],n=[],s={numBatches:e.reduce((l,d)=>Math.max(l,d.length),0)},i=0,o=0,a=-1,c=e.length,u,f=[];for(;s.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)f[a]=u=e[a].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(f=kB(t,o,f,e,s),o>0&&(n[i++]=M({type:new he(t),length:o,nullCount:0,children:f.slice()})))}return[r=r.assign(t),n.map(l=>new le(r,l))]}function kB(r,e,t,n,s){var i;let o=(e+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let u=t[a],f=u?.length;if(f>=e)f===e?t[a]=u:(t[a]=u.slice(0,e),s.numBatches=Math.max(s.numBatches,n[a].unshift(u.slice(e,f-e))));else{let l=r[a];r[a]=l.clone({nullable:!0}),t[a]=(i=u?._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:M({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return t}var s0=p(()=>{hr();ye();Sn()});function op(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=Hr(s);return new be(e)}function ap(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=Do(s);return new be(e)}var i0,o0,be,ki=p(()=>{Fe();hr();oc();ft();dt();ye();fc();s0();qu();si();tr();Ku();Hu();Lo();Sn();o0=Symbol.for("apache-arrow/Table"),be=class r{static isTable(e){return e?.[o0]===!0}constructor(...e){var t,n;if(e.length===0)return this.batches=[],this.schema=new J([]),this._offsets=[0],this;let s,i;e[0]instanceof J&&(s=e.shift()),e.at(-1)instanceof Uint32Array&&(i=e.pop());let o=c=>{if(c){if(c instanceof le)return[c];if(c instanceof r)return c.batches;if(c instanceof k){if(c.type instanceof he)return[new le(new J(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>o(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>o(u));if(typeof c=="object"){let u=Object.keys(c),f=u.map(h=>new E([c[h]])),l=s??new J(u.map((h,m)=>new F(String(h),f[m].type,f[m].nullable))),[,d]=hf(l,f);return d.length===0?[new le(c)]:d}}}return[]},a=e.flatMap(c=>o(c));if(s=(n=s??((t=a[0])===null||t===void 0?void 0:t.schema))!==null&&n!==void 0?n:new J([]),!(s instanceof J))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof le))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Ni(s,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=a,this._offsets=i??Pu(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Gu(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(ii(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Bo.visit(new E(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
19
19
|
${this.toArray().join(`,
|
|
20
20
|
`)}
|
|
21
|
-
]`}concat(...e){let r=this.schema,n=this.data.concat(e.flatMap(({data:s})=>s));return new t(r,n.map(s=>new le(r,s)))}slice(e,r){let n=this.schema;[e,r]=Wa({length:this.numRows},e,r);let s=Gu(this.data,this._offsets,e,r);return new t(n,s.map(i=>new le(n,i)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let r=this.data.map(n=>n.children[e]);if(r.length===0){let{type:n}=this.schema.fields[e],s=M({type:n,length:0,nullCount:0});r.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new E(r)}return null}setChild(e,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),r)}setChildAt(e,r){let n=this.schema,s=[...this.batches];if(e>-1&&e<this.numCols){r||(r=new E([M({type:new Ne,length:this.numRows})]));let i=n.fields.slice(),o=i[e].clone({type:r.type}),a=this.schema.fields.map((c,u)=>this.getChildAt(u));[i[e],a[e]]=[o,r],[n,s]=cf(n,a)}return new t(n,s)}select(e){let r=this.schema.fields.reduce((n,s,i)=>n.set(s.name,i),new Map);return this.selectAt(e.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(e){let r=this.schema.selectAt(e),n=this.batches.map(s=>s.selectAt(e));return new t(r,n)}assign(e){let r=this.schema.fields,[n,s]=e.schema.fields.reduce((a,c,u)=>{let[f,l]=a,d=r.findIndex(h=>h.name===c.name);return~d?l[d]=u:f.push(u),a},[[],[]]),i=this.schema.assign(e.schema),o=[...r.map((a,c)=>[c,s[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):e.getChildAt(c)),...n.map(a=>e.getChildAt(a))].filter(Boolean);return new t(...cf(i,o))}};Dw=Symbol.toStringTag;be[Dw]=(t=>(t.schema=null,t.batches=[],t._offsets=new Uint32Array([0]),t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[Nw]=!0,t.isValid=Ao(Ka),t.get=Ao(je.getVisitFn(y.Struct)),t.set=Vu(tt.getVisitFn(y.Struct)),t.indexOf=Uu(ci.getVisitFn(y.Struct)),"Table"))(be.prototype);Object.defineProperty(be,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===be&&be.isTable(e)}})});function Cw(t,e,r=e.reduce((n,s)=>Math.max(n,s.length),0)){var n;let s=[...t.fields],i=[...e],o=(r+63&-64)>>3;for(let[a,c]of t.fields.entries()){let u=e[a];(!u||u.length!==r)&&(s[a]=c.clone({nullable:!0}),i[a]=(n=u?._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:M({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(o)}))}return[t.assign(s),M({type:new he(s),length:r,children:i})]}function Vw(t,e,r=new Map){var n,s;if(((n=t?.length)!==null&&n!==void 0?n:0)>0&&t?.length===e?.length)for(let i=-1,o=t.length;++i<o;){let{type:a}=t[i],c=e[i];for(let u of[c,...((s=c?.dictionary)===null||s===void 0?void 0:s.data)||[]])Vw(a.children,u?.children,r);if(L.isDictionary(a)){let{id:u}=a;if(!r.has(u))c?.dictionary&&r.set(u,c.dictionary);else if(r.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var kw,Gw,le,Ci,vn=p(()=>{dr();Ni();lt();ht();ye();To();ni();er();ju();zu();Gw=Symbol.for("apache-arrow/RecordBatch"),le=class t{static isRecordBatch(e){return e?.[Gw]===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof X))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=M({nullCount:0,type:new he(this.schema.fields),children:this.schema.fields.map(r=>M({type:r.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof N))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Cw(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=e,{fields:n,children:s,length:i}=Object.keys(r).reduce((c,u,f)=>(c.children[f]=r[u],c.length=Math.max(c.length,r[u].length),c.fields[f]=F.new({name:u,type:r[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new X(n),a=M({type:new he(n),length:i,children:s,nullCount:0});[this.schema,this.data]=Cw(o,a.children,i),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=Vw(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return je.visit(this.data,e)}at(e){return this.get(si(e,this.numRows))}set(e,r){return tt.visit(this.data,e,r)}indexOf(e,r){return ci.visit(this.data,e,r)}[Symbol.iterator](){return vo.visit(new E([this.data]))}toArray(){return[...this]}concat(...e){return new be(this.schema,[this,...e])}slice(e,r){let[n]=new E([this.data]).slice(e,r).data;return new t(this.schema,n,this._metadata)}getChild(e){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new E([this.data.children[e]]):null}setChild(e,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),r)}setChildAt(e,r){let n=this.schema,s=this.data;if(e>-1&&e<this.numCols){r||(r=new E([M({type:new Ne,length:this.numRows})]));let i=n.fields.slice(),o=s.children.slice(),a=i[e].clone({type:r.type});[i[e],o[e]]=[a,r.data[0]],n=new X(i,new Map(this.schema.metadata)),s=M({type:new he(i),length:s.length,children:o})}return new t(n,s,this._metadata)}select(e){let r=this.schema.select(e),n=new he(r.fields),s=[];for(let i of e){let o=this.schema.fields.findIndex(a=>a.name===i);~o&&(s[o]=this.data.children[o])}return new t(r,M({type:n,length:this.numRows,children:s}),this._metadata)}selectAt(e){let r=this.schema.selectAt(e),n=e.map(i=>this.data.children[i]).filter(Boolean),s=M({type:new he(r.fields),length:this.numRows,children:n});return new t(r,s,this._metadata)}};kw=Symbol.toStringTag;le[kw]=(t=>(t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[Gw]=!0,"RecordBatch"))(le.prototype);Object.defineProperty(le,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===le&&le.isRecordBatch(e)}});Ci=class extends le{constructor(e,r){let n=e.fields.map(i=>M({type:i.type})),s=M({type:new he(e.fields),length:0,nullCount:0,children:n});super(e,s,r||new Map)}}});function ff(t,e=0){for(let r=-1,n=Fo.length;++r<n;)if(Fo[r]!==t[e+r])return!1;return!0}var Jh,Yh,Uw,Pw,Ns,ki,Gi,uf,Xh,Fo,Oo,Zh,jw,lf=p(()=>{Bt();Fe();oe();ls();Un();dh();qe();ds();Xa();Jh=t=>`Expected ${ne[t]} Message in stream, but was null or length 0.`,Yh=t=>`Header pointer of flatbuffer-encoded ${ne[t]} Message is null or length 0.`,Uw=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,Pw=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,Ns=class{constructor(e){this.source=e instanceof mr?e:new mr(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?ve:e.value===-1&&(e=this.readMetadataLength()).done?ve:(e=this.readMetadata(e.value)).done?ve:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Jh(e));return r.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let r=D(this.source.read(e));if(r.byteLength<e)throw new Error(Pw(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(e=!1){let r=ne.Schema,n=this.readMessage(r),s=n?.header();if(e&&!s)throw new Error(Yh(r));return s}readMetadataLength(){let e=this.source.read(uf),r=e&&new Ye(e),n=r?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let r=this.source.read(e);if(!r)return ve;if(r.byteLength<e)throw new Error(Uw(e,r.byteLength));return{done:!1,value:mt.decode(r)}}},ki=class{constructor(e,r){this.source=e instanceof Ct?e:Qc(e)?new hs(e,r):new Ct(e)}[Symbol.asyncIterator](){return this}next(){return B(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?ve:e.value===-1&&(e=yield this.readMetadataLength()).done?ve:(e=yield this.readMetadata(e.value)).done?ve:e})}throw(e){return B(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return B(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return B(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Jh(e));return r.value})}readMessageBody(e){return B(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let r=D(yield this.source.read(e));if(r.byteLength<e)throw new Error(Pw(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return B(this,arguments,void 0,function*(e=!1){let r=ne.Schema,n=yield this.readMessage(r),s=n?.header();if(e&&!s)throw new Error(Yh(r));return s})}readMetadataLength(){return B(this,void 0,void 0,function*(){let e=yield this.source.read(uf),r=e&&new Ye(e),n=r?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(e){return B(this,void 0,void 0,function*(){let r=yield this.source.read(e);if(!r)return ve;if(r.byteLength<e)throw new Error(Uw(e,r.byteLength));return{done:!1,value:mt.decode(r)}})}},Gi=class extends Ns{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Ha?e:new Ha(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:mt.fromJSON(e.schema,ne.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let r=e.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:mt.fromJSON(r,ne.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let r=e.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:mt.fromJSON(r,ne.RecordBatch)}}return this._body=[],ve}readMessageBody(e){return r(this._body);function r(n){return(n||[]).reduce((s,i)=>[...s,...i.VALIDITY&&[i.VALIDITY]||[],...i.TYPE_ID&&[i.TYPE_ID]||[],...i.OFFSET&&[i.OFFSET]||[],...i.DATA&&[i.DATA]||[],...i.VIEWS&&[i.VIEWS]||[],...i.VARIADIC_DATA_BUFFERS||[],...r(i.children)],[])}}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Jh(e));return r.value}readSchema(){let e=ne.Schema,r=this.readMessage(e),n=r?.header();if(!r||!n)throw new Error(Yh(e));return n}},uf=4,Xh="ARROW1",Fo=new Uint8Array(Xh.length);for(let t=0;t<Xh.length;t+=1)Fo[t]=Xh.codePointAt(t);Oo=Fo.length,Zh=Oo+uf,jw=Oo*2+uf});var Qh,ep,zw,Ww=p(()=>{ao();Qh=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(r);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((r,n)=>e[n]===r)}_hasValidVersion(e){return(e[4]&192)>>6===1}},ep=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(r);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((r,n)=>e[n]===r)}},zw={[Ze.LZ4_FRAME]:new Qh,[Ze.ZSTD]:new ep}});var tp,Cs,df=p(()=>{ao();Ww();tp=class{constructor(){this.registry={}}set(e,r){if(r?.encode&&typeof r.encode=="function"&&!zw[e].isValidCodecEncode(r))throw new Error(`Encoder for ${Ze[e]} is not valid.`);this.registry[e]=r}get(e){var r;return((r=this.registry)===null||r===void 0?void 0:r[e])||null}},Cs=new tp});function Hw(t,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:t.autoDestroy}function*$w(t){let e=Lt.from(t);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function qw(t){return bt(this,arguments,function*(){let r=yield H(Lt.from(t));try{if(!(yield H(r.open({autoDestroy:!1}))).closed)do yield yield H(r);while(!(yield H(r.reset().open())).closed)}finally{yield H(r.cancel())}})}function XE(t){return new Cr(new np(t))}function JE(t){let e=t.peek(Oo+7&-8);return e&&e.byteLength>=4?ff(e)?new Ln(new pf(t.read())):new Cr(new Ro(t)):new Cr(new Ro((function*(){})()))}function YE(t){return B(this,void 0,void 0,function*(){let e=yield t.peek(Oo+7&-8);return e&&e.byteLength>=4?ff(e)?new Ln(new pf(yield t.read())):new In(new Do(t)):new In(new Do((function(){return bt(this,arguments,function*(){})})()))})}function ZE(t){return B(this,void 0,void 0,function*(){let{size:e}=yield t.stat(),r=new hs(t,e);return e>=jw&&ff(yield r.readAt(0,Oo+7&-8))?new Mo(new rp(r)):new In(new Do(r))})}var Lt,Cr,In,Ln,Mo,hf,Ro,Do,pf,rp,np,sc=p(()=>{Bt();dr();lt();ye();Fe();ch();xa();ls();ds();dh();Ew();vn();Xa();lf();Un();df();zr();oe();Lt=class t extends li{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let r=this._impl.open(e);return Wt(r)?r.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Je.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Je.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof t?e:Yc(e)?XE(e):Qc(e)?ZE(e):Wt(e)?B(this,void 0,void 0,function*(){return yield t.from(yield e)}):eu(e)||ba(e)||ru(e)||ur(e)?YE(new Ct(e)):JE(new mr(e))}static readAll(e){return e instanceof t?e.isSync()?$w(e):qw(e):Yc(e)||ArrayBuffer.isView(e)||wr(e)||Zc(e)?$w(e):qw(e)}},Cr=class extends Lt{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return bt(this,arguments,function*(){yield H(yield*so(jt(this[Symbol.iterator]())))})}},In=class extends Lt{constructor(e){super(e),this._impl=e}readAll(){return B(this,void 0,void 0,function*(){var e,r,n,s;let i=new Array;try{for(var o=!0,a=jt(this),c;c=yield a.next(),e=c.done,!e;o=!0){s=c.value,o=!1;let u=s;i.push(u)}}catch(u){r={error:u}}finally{try{!o&&!e&&(n=a.return)&&(yield n.call(a))}finally{if(r)throw r.error}}return i})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Ln=class extends Cr{constructor(e){super(e),this._impl=e}},Mo=class extends In{constructor(e){super(e),this._impl=e}},hf=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,r,n){let s;if(e.compression!=null){let o=Cs.get(e.compression.type);if(o?.decode&&typeof o.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(e,r,o);s=this._loadCompressedVectors(e,a,this.schema.fields),e=new We(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else s=this._loadVectors(e,r,this.schema.fields);let i=M({type:new he(this.schema.fields),length:e.length,children:s});return new le(this.schema,i,n)}_loadDictionaryBatch(e,r){let{id:n,isDelta:s}=e,{dictionaries:i,schema:o}=this,a=i.get(n),c=o.dictionaries.get(n),u;if(e.data.compression!=null){let f=Cs.get(e.data.compression.type);if(f?.decode&&typeof f.decode=="function"){let{decommpressedBody:l,buffers:d}=this._decompressBuffers(e.data,r,f);u=this._loadCompressedVectors(e.data,l,[c]),e=new pt(new We(e.data.length,e.data.nodes,d,null,e.data.variadicBufferCounts),n,s)}else throw new Error("Dictionary batch is compressed but codec not found")}else u=this._loadVectors(e.data,r,[c]);return(a&&s?a.concat(new E(u)):new E(u)).memoize()}_loadVectors(e,r,n){return new Eo(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(e,r,n){return new Zu(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_decompressBuffers(e,r,n){let s=[],i=[],o=0;for(let{offset:a,length:c}of e.buffers){if(c===0){s.push(new Uint8Array(0)),i.push(new Ce(o,0));continue}let u=new Ye(r.subarray(a,a+c)),f=ee(u.readInt64(0)),l=u.bytes().subarray(8),d=f===-1?l:n.decode(l);s.push(d);let h=(o+7&-8)-o;o+=h,i.push(new Ce(o,d.length)),o+=d.length}return{decommpressedBody:s,buffers:i}}},Ro=class extends hf{constructor(e,r){super(r),this._reader=Yc(e)?new Gi(this._handle=e):new Ns(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Hw(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):ve}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):ve}next(){if(this.closed)return ve;let e,{_reader:r}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=r.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ci(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Do=class extends hf{constructor(e,r){super(r),this._reader=new ki(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return B(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return B(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Hw(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):ve})}return(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):ve})}next(){return B(this,void 0,void 0,function*(){if(this.closed)return ve;let e,{_reader:r}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=yield r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=yield r.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ci(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},pf=class extends Ro{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,r){super(e instanceof Ja?e:new Ja(e),r)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(ne.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null}_readDictionaryBatch(e){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(ne.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,r=e.size-Zh,n=e.readInt32(r),s=e.readAt(r-n,n);return mn.decode(s)}_readNextMessageAndValidate(e){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(e)}return null}},rp=class extends Do{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...r){let n=typeof r[0]!="number"?r.shift():void 0,s=r[0]instanceof Map?r.shift():void 0;super(e instanceof hs?e:new hs(e,n),s)}isFile(){return!0}isAsync(){return!0}open(e){let r=Object.create(null,{open:{get:()=>super.open}});return B(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,e)})}readRecordBatch(e){return B(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(ne.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null})}_readDictionaryBatch(e){return B(this,void 0,void 0,function*(){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(ne.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}})}_readFooter(){return B(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let r=e.size-Zh,n=yield e.readInt32(r),s=yield e.readAt(r-n,n);return mn.decode(s)})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(e)}return null})}},np=class extends Ro{constructor(e,r){super(e,r)}_loadVectors(e,r,n){return new Yu(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}}});function nr(t){let e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new Ce(this._byteLength,e)),this._byteLength+=e,this}function QE(t){var e;let{type:r,length:n,typeIds:s,valueOffsets:i}=t;if(nr.call(this,s),r.mode===de.Sparse)return sp.call(this,t);if(r.mode===de.Dense){if(t.offset<=0)return nr.call(this,i),sp.call(this,t);{let o=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let u,f,l=-1;++l<n;)(u=s[l])!==void 0&&((f=a[u])===void 0&&(f=a[u]=i[l]),o[l]=i[l]-f,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);nr.call(this,o),this.visitMany(t.children.map((u,f)=>{let l=r.typeIds[f],d=a[l],h=c[l];return u.slice(d,Math.min(n,h))}))}}return this}function eB(t){let e;return t.nullCount>=t.length?nr.call(this,new Uint8Array(t.length+7>>3)):(e=t.values)instanceof Uint8Array?nr.call(this,ii(t.offset,t.length,e)):nr.call(this,oi(t.values))}function Sn(t){return nr.call(this,t.values.subarray(0,t.length*t.stride))}function mf(t){let{length:e,values:r,valueOffsets:n}=t,s=ee(n[0]),i=ee(n[e]),o=Math.min(i-s,r.byteLength-s);return nr.call(this,nu(-s,e+1,n)),nr.call(this,r.subarray(s,s+o)),this}function Xw(t){let{offset:e,length:r,stride:n,values:s,variadicBuffers:i=[]}=t;if(!s)throw new Error("BinaryView data is missing view buffer");let o=e*n,a=o+r*n;nr.call(this,s.subarray(o,a));for(let c of i)nr.call(this,c);return this._variadicBufferCounts.push(i.length),this}function bf(t){let{length:e,valueOffsets:r}=t;if(r){let n=ee(r[0]),s=ee(r[e]);return nr.call(this,nu(-n,e+1,r)),this.visit(t.children[0].slice(n,s-n))}return this.visit(t.children[0])}function sp(t){return this.visitMany(t.type.children.map((e,r)=>t.children[r]).filter(Boolean))[0]}var Ie,Jw=p(()=>{lt();Dt();Fe();vn();qe();ai();ls();ye();zr();Ie=class t extends R{static assemble(...e){let r=s=>s.flatMap(i=>Array.isArray(i)?r(i):i instanceof le?i.data.children:i.data),n=new t;return n.visitMany(r(e)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof E)return this.visitMany(e.data),this;let{type:r}=e;if(!L.isDictionary(r)){let{length:n}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(L.isUnion(r))this.nodes.push(new hr(n,0));else{let{nullCount:s}=e;L.isNull(r)||nr.call(this,s<=0?new Uint8Array(0):ii(e.offset,n,e.nullBitmap)),this.nodes.push(new hr(n,s))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Ie.prototype.visitBool=eB;Ie.prototype.visitInt=Sn;Ie.prototype.visitFloat=Sn;Ie.prototype.visitUtf8=mf;Ie.prototype.visitLargeUtf8=mf;Ie.prototype.visitUtf8View=Xw;Ie.prototype.visitBinary=mf;Ie.prototype.visitLargeBinary=mf;Ie.prototype.visitBinaryView=Xw;Ie.prototype.visitFixedSizeBinary=Sn;Ie.prototype.visitDate=Sn;Ie.prototype.visitTimestamp=Sn;Ie.prototype.visitTime=Sn;Ie.prototype.visitDecimal=Sn;Ie.prototype.visitList=bf;Ie.prototype.visitLargeList=bf;Ie.prototype.visitStruct=sp;Ie.prototype.visitUnion=QE;Ie.prototype.visitInterval=Sn;Ie.prototype.visitDuration=Sn;Ie.prototype.visitFixedSizeList=bf;Ie.prototype.visitMap=bf});var gf,Yw=p(()=>{Dt();lu();Fe();gf=class extends R{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:P[e].toLowerCase()}}visitInt({typeId:e,bitWidth:r,isSigned:n}){return{name:P[e].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:e,precision:r}){return{name:P[e].toLowerCase(),precision:ue[r]}}visitBinary({typeId:e}){return{name:P[e].toLowerCase()}}visitLargeBinary({typeId:e}){return{name:P[e].toLowerCase()}}visitBinaryView({typeId:e}){return{name:P[e].toLowerCase()}}visitBool({typeId:e}){return{name:P[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:P[e].toLowerCase()}}visitLargeUtf8({typeId:e}){return{name:P[e].toLowerCase()}}visitUtf8View({typeId:e}){return{name:P[e].toLowerCase()}}visitDecimal({typeId:e,scale:r,precision:n,bitWidth:s}){return{name:P[e].toLowerCase(),scale:r,precision:n,bitWidth:s}}visitDate({typeId:e,unit:r}){return{name:P[e].toLowerCase(),unit:ge[r]}}visitTime({typeId:e,unit:r,bitWidth:n}){return{name:P[e].toLowerCase(),unit:S[r],bitWidth:n}}visitTimestamp({typeId:e,timezone:r,unit:n}){return{name:P[e].toLowerCase(),unit:S[n],timezone:r}}visitInterval({typeId:e,unit:r}){return{name:P[e].toLowerCase(),unit:ie[r]}}visitDuration({typeId:e,unit:r}){return{name:P[e].toLocaleLowerCase(),unit:S[r]}}visitList({typeId:e}){return{name:P[e].toLowerCase()}}visitLargeList({typeId:e}){return{name:P[e].toLowerCase()}}visitStruct({typeId:e}){return{name:P[e].toLowerCase()}}visitUnion({typeId:e,mode:r,typeIds:n}){return{name:P[e].toLowerCase(),mode:de[r].toUpperCase(),typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:r}){return{name:P[e].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:e,listSize:r}){return{name:P[e].toLowerCase(),listSize:r}}visitMap({typeId:e,keysSorted:r}){return{name:P[e].toLowerCase(),keysSorted:r}}}});function*ip(t){for(let e of t)yield e.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*En(t,e){let r=new Uint32Array(t.buffer,t.byteOffset,t.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,s=r.length/e;++n<s;)yield`${ri.new(r.subarray((n+0)*e,(n+1)*e),!1)}`}function Zw(t,e){let n=t.values,s=new DataView(n.buffer,n.byteOffset,n.byteLength),i=n.byteLength/16,o=d=>Array.from(d).map(h=>("0"+(h&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:i},(d,h)=>{let m=h*16,b=s.getInt32(m,!0);return[m,b]}).map(([d,h])=>h>12?{SIZE:h,PREFIX_HEX:o(n.subarray(d+4,d+8)),BUFFER_INDEX:s.getInt32(d+8,!0),OFFSET:s.getInt32(d+12,!0)}:{SIZE:h,INLINED:e(n.subarray(d+4,d+4+h))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],u=c.map(d=>o(t.variadicBuffers[d])),f=new Map(c.map((d,h)=>[d,h]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:f.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:u}}var ic,Qw=p(()=>{hu();lt();Dt();Fe();Fe();ai();Ju();ye();ic=class t extends R{static assemble(...e){let r=new t;return e.map(({schema:n,data:s})=>r.visitMany(n.fields,s.children))}visit({name:e},r){let{length:n}=r,{offset:s,nullCount:i,nullBitmap:o}=r,a=L.isDictionary(r.type)?r.type.indices:r.type,c=Object.assign([],r.buffers,{[te.VALIDITY]:void 0});return Object.assign({name:e,count:n,VALIDITY:L.isNull(a)||L.isUnion(a)?void 0:i<=0?Array.from({length:n},()=>1):[...new qr(o,s,n,null,Nu)]},super.visit(r.clone(a,s,n,0,c)))}visitNull(){return{}}visitBool({values:e,offset:r,length:n}){return{DATA:[...new qr(e,r,n,null,_o)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...En(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...new E([e])],OFFSET:[...e.valueOffsets]}}visitLargeUtf8(e){return{DATA:[...new E([e])],OFFSET:[...En(e.valueOffsets,2)]}}visitBinary(e){return{DATA:[...ip(new E([e]))],OFFSET:[...e.valueOffsets]}}visitLargeBinary(e){return{DATA:[...ip(new E([e]))],OFFSET:[...En(e.valueOffsets,2)]}}visitBinaryView(e){return Zw(e,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(e){return Zw(e,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(e){return{DATA:[...ip(new E([e]))]}}visitDate(e){return{DATA:e.type.unit===ge.DAY?[...e.values]:[...En(e.values,2)]}}visitTimestamp(e){return{DATA:[...En(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<S.MICROSECOND?[...e.values]:[...En(e.values,2)]}}visitDecimal(e){return{DATA:[...En(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}visitLargeList(e){return{OFFSET:[...En(e.valueOffsets,2)],children:this.visitMany(e.type.children,e.children)}}visitStruct(e){return{children:this.visitMany(e.type.children,e.children)}}visitUnion(e){return{TYPE_ID:[...e.typeIds],OFFSET:e.type.mode===de.Dense?[...e.valueOffsets]:void 0,children:this.visitMany(e.type.children,e.children)}}visitInterval(e){switch(e.type.unit){case ie.YEAR_MONTH:return{DATA:[...e.values]};case ie.DAY_TIME:return{DATA:yh(e.values)};case ie.MONTH_DAY_NANO:return{DATA:xh(e.values,!0)}}}visitDuration(e){return{DATA:[...En(e.values,2)]}}visitFixedSizeList(e){return{children:this.visitMany(e.type.children,e.children)}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}}});function op(t,e){let r=e;e instanceof be&&(r=e.batches,t.reset(void 0,e.schema));for(let n of r)t.write(n);return t.finish()}function ap(t,e){return B(this,void 0,void 0,function*(){var r,n,s,i,o,a,c;try{for(r=!0,n=jt(e);s=yield n.next(),i=s.done,!i;r=!0){c=s.value,r=!1;let u=c;t.write(u)}}catch(u){o={error:u}}finally{try{!r&&!i&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return t.finish()})}function eT({name:t,type:e,nullable:r}){let n=new gf;return{name:t,nullable:r,type:n.visit(e),children:(e.children||[]).map(s=>eT(s)),dictionary:L.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function tB(t,e,r=!1){let[n]=ic.assemble(new le({[e]:t}));return JSON.stringify({id:e,isDelta:r,data:{count:t.length,columns:n}},null,2)}function rB(t){let[e]=ic.assemble(t);return JSON.stringify({count:t.numRows,columns:e},null,2)}var Yr,Bn,Fn,oc,yf=p(()=>{Bt();Ni();lf();lt();ye();ls();ls();ch();Fe();nc();ds();Jw();Yw();Qw();qe();vn();Xa();Un();ao();df();oe();Yr=class extends li{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}constructor(e){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new pr,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,gt(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(Ze).includes(e.compressionType))this._compression=new fi(e.compressionType);else{let r=Object.values(Ze).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Wt(e)?e.then(r=>this.writeAll(r)):ur(e)?ap(this,e):op(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,r=null){return e===this._sink||e instanceof pr?this._sink=e:(this._sink=new pr,e&&yy(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&xy(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!Di(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(e){let r=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof be&&!(r=e.schema))return this.finish()&&void 0;if(e instanceof le&&!(r=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!Di(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}e instanceof le?e instanceof Ci||this._writeRecordBatch(e):e instanceof be?this.writeAll(e.batches):wr(e)&&this.writeAll(e)}_writeMessage(e,r=8){let n=r-1,s=mt.encode(e),i=s.byteLength,o=this._writeLegacyIpcFormat?4:8,a=i+o+n&~n,c=a-i-o;return e.headerType===ne.RecordBatch?this._recordBatchBlocks.push(new Rr(a,e.bodyLength,this._position)):e.headerType===ne.DictionaryBatch&&this._dictionaryBlocks.push(new Rr(a,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),i>0&&this._write(s),this._writePadding(c)}_write(e){if(this._started){let r=D(e);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(e){return this._writeMessage(mt.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Fo)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:r,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=this._assembleRecordBatch(e),a=new We(e.numRows,n,s,this._compression,o,e.metadata),c=mt.from(a,r);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(i)}_assembleRecordBatch(e){let{byteLength:r,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=Ie.assemble(e);return this._compression!=null&&({byteLength:r,bufferRegions:s,buffers:i}=this._compressBodyBuffers(i)),{byteLength:r,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}}_compressBodyBuffers(e){let r=Cs.get(this._compression.type);if(!r?.encode||typeof r.encode!="function")throw new Error(`Codec for compression type "${Ze[this._compression.type]}" has invalid encode method`);let n=0,s=[],i=[];for(let a of e){let c=D(a);if(c.length===0){s.push(new Uint8Array(0),new Uint8Array(0)),i.push(new Ce(n,0));continue}let u=r.encode(c),f=u.length<c.length,l=f?u:c,d=f?l.length:-1,h=new Ye(new Uint8Array(8));h.writeInt64(0,BigInt(d)),s.push(h.bytes(),new Uint8Array(l));let m=(n+7&-8)-n;n+=m;let b=8+l.length;i.push(new Ce(n,b)),n+=b}let o=(n+7&-8)-n;return n+=o,{byteLength:n,bufferRegions:i,buffers:s}}_writeDictionaryBatch(e,r,n=!1){let{byteLength:s,nodes:i,bufferRegions:o,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new E([e])),u=new We(e.length,i,o,this._compression,c),f=new pt(u,r,n),l=mt.from(f,s);return this._writeMessage(l)._writeBodyBuffers(a)}_writeBodyBuffers(e){let r=this._compression!=null?2:1,n=new Array(r);for(let s=0;s<e.length;s+=r){let i=0;for(let a=-1;++a<r;)n[a]=e[s+a],i+=n[a].byteLength;if(i===0)continue;for(let a of n)this._write(a);let o=(i+7&-8)-i;o>0&&this._writePadding(o)}return this}_writeDictionaries(e){var r,n;for(let[s,i]of e.dictionaries){let o=(r=i?.data)!==null&&r!==void 0?r:[],a=this._seenDictionaries.get(s),c=(n=this._dictionaryDeltaOffsets.get(s))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(let[u,f]of o.entries())this._writeDictionaryBatch(f,s,u>0);else if(c<o.length)for(let u of o.slice(c))this._writeDictionaryBatch(u,s,!0);this._seenDictionaries.set(s,i),this._dictionaryDeltaOffsets.set(s,o.length)}return this}},Bn=class t extends Yr{static writeAll(e,r){let n=new t(r);return Wt(e)?e.then(s=>n.writeAll(s)):ur(e)?ap(n,e):op(n,e)}},Fn=class t extends Yr{static writeAll(e,r){let n=new t(r);return Wt(e)?e.then(s=>n.writeAll(s)):ur(e)?ap(n,e):op(n,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,r,n)}_writeFooter(e){let r=mn.encode(new mn(e,me.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},oc=class t extends Yr{static writeAll(e){return new t().writeAll(e)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
22
|
-
"schema": ${JSON.stringify({fields:e.fields.map(
|
|
23
|
-
`),this._write(
|
|
21
|
+
]`}concat(...e){let t=this.schema,n=this.data.concat(e.flatMap(({data:s})=>s));return new r(t,n.map(s=>new le(t,s)))}slice(e,t){let n=this.schema;[e,t]=Ya({length:this.numRows},e,t);let s=zu(this.data,this._offsets,e,t);return new r(n,s.map(i=>new le(n,i)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let t=this.data.map(n=>n.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],s=M({type:n,length:0,nullCount:0});t.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new E(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),t)}setChildAt(e,t){let n=this.schema,s=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new E([M({type:new De,length:this.numRows})]));let i=n.fields.slice(),o=i[e].clone({type:t.type}),a=this.schema.fields.map((c,u)=>this.getChildAt(u));[i[e],a[e]]=[o,t],[n,s]=hf(n,a)}return new r(n,s)}select(e){let t=this.schema.fields.reduce((n,s,i)=>n.set(s.name,i),new Map);return this.selectAt(e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(e){let t=this.schema.selectAt(e),n=this.batches.map(s=>s.selectAt(e));return new r(t,n)}assign(e){let t=this.schema.fields,[n,s]=e.schema.fields.reduce((a,c,u)=>{let[f,l]=a,d=t.findIndex(h=>h.name===c.name);return~d?l[d]=u:f.push(u),a},[[],[]]),i=this.schema.assign(e.schema),o=[...t.map((a,c)=>[c,s[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):e.getChildAt(c)),...n.map(a=>e.getChildAt(a))].filter(Boolean);return new r(...hf(i,o))}};i0=Symbol.toStringTag;be[i0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[o0]=!0,r.isValid=Eo(ec),r.get=Eo(Ge.getVisitFn(y.Struct)),r.set=Wu(et.getVisitFn(y.Struct)),r.indexOf=$u(ui.getVisitFn(y.Struct)),"Table"))(be.prototype);Object.defineProperty(be,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===be&&be.isTable(e)}})});function a0(r,e,t=e.reduce((n,s)=>Math.max(n,s.length),0)){var n;let s=[...r.fields],i=[...e],o=(t+63&-64)>>3;for(let[a,c]of r.fields.entries()){let u=e[a];(!u||u.length!==t)&&(s[a]=c.clone({nullable:!0}),i[a]=(n=u?._changeLengthAndBackfillNullBitmap(t))!==null&&n!==void 0?n:M({type:c.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)}))}return[r.assign(s),M({type:new he(s),length:t,children:i})]}function f0(r,e,t=new Map){var n,s;if(((n=r?.length)!==null&&n!==void 0?n:0)>0&&r?.length===e?.length)for(let i=-1,o=r.length;++i<o;){let{type:a}=r[i],c=e[i];for(let u of[c,...((s=c?.dictionary)===null||s===void 0?void 0:s.data)||[]])f0(a.children,u?.children,t);if(L.isDictionary(a)){let{id:u}=a;if(!t.has(u))c?.dictionary&&t.set(u,c.dictionary);else if(t.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return t}var c0,u0,le,Ci,Sn=p(()=>{hr();ki();ft();dt();ye();Lo();si();tr();Ku();Hu();u0=Symbol.for("apache-arrow/RecordBatch"),le=class r{static isRecordBatch(e){return e?.[u0]===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof J))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=M({nullCount:0,type:new he(this.schema.fields),children:this.schema.fields.map(t=>M({type:t.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof k))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=a0(this.schema,this.data.children,this.data.length);break}case 1:{let[t]=e,{fields:n,children:s,length:i}=Object.keys(t).reduce((c,u,f)=>(c.children[f]=t[u],c.length=Math.max(c.length,t[u].length),c.fields[f]=F.new({name:u,type:t[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new J(n),a=M({type:new he(n),length:i,children:s,nullCount:0});[this.schema,this.data]=a0(o,a.children,i),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=f0(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return Ge.visit(this.data,e)}at(e){return this.get(ii(e,this.numRows))}set(e,t){return et.visit(this.data,e,t)}indexOf(e,t){return ui.visit(this.data,e,t)}[Symbol.iterator](){return Bo.visit(new E([this.data]))}toArray(){return[...this]}concat(...e){return new be(this.schema,[this,...e])}slice(e,t){let[n]=new E([this.data]).slice(e,t).data;return new r(this.schema,n,this._metadata)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new E([this.data.children[e]]):null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),t)}setChildAt(e,t){let n=this.schema,s=this.data;if(e>-1&&e<this.numCols){t||(t=new E([M({type:new De,length:this.numRows})]));let i=n.fields.slice(),o=s.children.slice(),a=i[e].clone({type:t.type});[i[e],o[e]]=[a,t.data[0]],n=new J(i,new Map(this.schema.metadata)),s=M({type:new he(i),length:s.length,children:o})}return new r(n,s,this._metadata)}select(e){let t=this.schema.select(e),n=new he(t.fields),s=[];for(let i of e){let o=this.schema.fields.findIndex(a=>a.name===i);~o&&(s[o]=this.data.children[o])}return new r(t,M({type:n,length:this.numRows,children:s}),this._metadata)}selectAt(e){let t=this.schema.selectAt(e),n=e.map(i=>this.data.children[i]).filter(Boolean),s=M({type:new he(t.fields),length:this.numRows,children:n});return new r(t,s,this._metadata)}};c0=Symbol.toStringTag;le[c0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[u0]=!0,"RecordBatch"))(le.prototype);Object.defineProperty(le,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===le&&le.isRecordBatch(e)}});Ci=class extends le{constructor(e,t){let n=e.fields.map(i=>M({type:i.type})),s=M({type:new he(e.fields),length:0,nullCount:0,children:n});super(e,s,t||new Map)}}});function mf(r,e=0){for(let t=-1,n=No.length;++t<n;)if(No[t]!==r[e+t])return!1;return!0}var up,fp,l0,d0,Vs,ji,Vi,pf,cp,No,ko,lp,h0,bf=p(()=>{Bt();Fe();oe();ms();Wn();Ih();$e();bs();rc();up=r=>`Expected ${ne[r]} Message in stream, but was null or length 0.`,fp=r=>`Header pointer of flatbuffer-encoded ${ne[r]} Message is null or length 0.`,l0=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,d0=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,Vs=class{constructor(e){this.source=e instanceof br?e:new br(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?Ie:e.value===-1&&(e=this.readMetadataLength()).done?Ie:(e=this.readMetadata(e.value)).done?Ie:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(up(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=D(this.source.read(e));if(t.byteLength<e)throw new Error(d0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=ne.Schema,n=this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(fp(t));return s}readMetadataLength(){let e=this.source.read(pf),t=e&&new Je(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Ie;if(t.byteLength<e)throw new Error(l0(e,t.byteLength));return{done:!1,value:pt.decode(t)}}},ji=class{constructor(e,t){this.source=e instanceof kt?e:su(e)?new gs(e,t):new kt(e)}[Symbol.asyncIterator](){return this}next(){return B(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?Ie:e.value===-1&&(e=yield this.readMetadataLength()).done?Ie:(e=yield this.readMetadata(e.value)).done?Ie:e})}throw(e){return B(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return B(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return B(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(up(e));return t.value})}readMessageBody(e){return B(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=D(yield this.source.read(e));if(t.byteLength<e)throw new Error(d0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return B(this,arguments,void 0,function*(e=!1){let t=ne.Schema,n=yield this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(fp(t));return s})}readMetadataLength(){return B(this,void 0,void 0,function*(){let e=yield this.source.read(pf),t=e&&new Je(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(e){return B(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return Ie;if(t.byteLength<e)throw new Error(l0(e,t.byteLength));return{done:!1,value:pt.decode(t)}})}},Vi=class extends Vs{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof tc?e:new tc(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:pt.fromJSON(e.schema,ne.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:pt.fromJSON(t,ne.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:pt.fromJSON(t,ne.RecordBatch)}}return this._body=[],Ie}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((s,i)=>[...s,...i.VALIDITY&&[i.VALIDITY]||[],...i.TYPE_ID&&[i.TYPE_ID]||[],...i.OFFSET&&[i.OFFSET]||[],...i.DATA&&[i.DATA]||[],...i.VIEWS&&[i.VIEWS]||[],...i.VARIADIC_DATA_BUFFERS||[],...t(i.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(up(e));return t.value}readSchema(){let e=ne.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw new Error(fp(e));return n}},pf=4,cp="ARROW1",No=new Uint8Array(cp.length);for(let r=0;r<cp.length;r+=1)No[r]=cp.codePointAt(r);ko=No.length,lp=ko+pf,h0=ko*2+pf});var dp,hp,p0,m0=p(()=>{ho();dp=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let t=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(t);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((t,n)=>e[n]===t)}_hasValidVersion(e){return(e[4]&192)>>6===1}},hp=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let t=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(t);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((t,n)=>e[n]===t)}},p0={[Ye.LZ4_FRAME]:new dp,[Ye.ZSTD]:new hp}});var pp,Us,gf=p(()=>{ho();m0();pp=class{constructor(){this.registry={}}set(e,t){if(t?.encode&&typeof t.encode=="function"&&!p0[e].isValidCodecEncode(t))throw new Error(`Encoder for ${Ye[e]} is not valid.`);this.registry[e]=t}get(e){var t;return((t=this.registry)===null||t===void 0?void 0:t[e])||null}},Us=new pp});function w0(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*b0(r){let e=Lt.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function g0(r){return bt(this,arguments,function*(){let t=yield X(Lt.from(r));try{if(!(yield X(t.open({autoDestroy:!1}))).closed)do yield yield X(t);while(!(yield X(t.reset().open())).closed)}finally{yield X(t.cancel())}})}function jB(r){return new Cr(new bp(r))}function VB(r){let e=r.peek(ko+7&-8);return e&&e.byteLength>=4?mf(e)?new Bn(new wf(r.read())):new Cr(new jo(r)):new Cr(new jo((function*(){})()))}function UB(r){return B(this,void 0,void 0,function*(){let e=yield r.peek(ko+7&-8);return e&&e.byteLength>=4?mf(e)?new Bn(new wf(yield r.read())):new En(new Vo(r)):new En(new Vo((function(){return bt(this,arguments,function*(){})})()))})}function GB(r){return B(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new gs(r,e);return e>=h0&&mf(yield t.readAt(0,ko+7&-8))?new Co(new mp(t)):new En(new Vo(t))})}var Lt,Cr,En,Bn,Co,yf,jo,Vo,wf,mp,bp,lc=p(()=>{Bt();hr();ft();ye();Fe();Th();La();ms();bs();Ih();Zx();Sn();rc();bf();Wn();gf();Wr();oe();Lt=class r extends di{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return $t(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Xe.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Xe.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof r?e:ru(e)?jB(e):su(e)?GB(e):$t(e)?B(this,void 0,void 0,function*(){return yield r.from(yield e)}):iu(e)||Aa(e)||au(e)||fr(e)?UB(new kt(e)):VB(new br(e))}static readAll(e){return e instanceof r?e.isSync()?b0(e):g0(e):ru(e)||ArrayBuffer.isView(e)||Tr(e)||nu(e)?b0(e):g0(e)}},Cr=class extends Lt{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return bt(this,arguments,function*(){yield X(yield*uo(zt(this[Symbol.iterator]())))})}},En=class extends Lt{constructor(e){super(e),this._impl=e}readAll(){return B(this,void 0,void 0,function*(){var e,t,n,s;let i=new Array;try{for(var o=!0,a=zt(this),c;c=yield a.next(),e=c.done,!e;o=!0){s=c.value,o=!1;let u=s;i.push(u)}}catch(u){t={error:u}}finally{try{!o&&!e&&(n=a.return)&&(yield n.call(a))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Bn=class extends Cr{constructor(e){super(e),this._impl=e}},Co=class extends En{constructor(e){super(e),this._impl=e}},yf=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t,n){let s;if(e.compression!=null){let o=Us.get(e.compression.type);if(o?.decode&&typeof o.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(e,t,o);s=this._loadCompressedVectors(e,a,this.schema.fields),e=new ze(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else s=this._loadVectors(e,t,this.schema.fields);let i=M({type:new he(this.schema.fields),length:e.length,children:s});return new le(this.schema,i,n)}_loadDictionaryBatch(e,t){let{id:n,isDelta:s}=e,{dictionaries:i,schema:o}=this,a=i.get(n),c=o.dictionaries.get(n),u;if(e.data.compression!=null){let f=Us.get(e.data.compression.type);if(f?.decode&&typeof f.decode=="function"){let{decommpressedBody:l,buffers:d}=this._decompressBuffers(e.data,t,f);u=this._loadCompressedVectors(e.data,l,[c]),e=new ht(new ze(e.data.length,e.data.nodes,d,null,e.data.variadicBufferCounts),n,s)}else throw new Error("Dictionary batch is compressed but codec not found")}else u=this._loadVectors(e.data,t,[c]);return(a&&s?a.concat(new E(u)):new E(u)).memoize()}_loadVectors(e,t,n){return new Ro(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(e,t,n){return new nf(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_decompressBuffers(e,t,n){let s=[],i=[],o=0;for(let{offset:a,length:c}of e.buffers){if(c===0){s.push(new Uint8Array(0)),i.push(new Ne(o,0));continue}let u=new Je(t.subarray(a,a+c)),f=ee(u.readInt64(0)),l=u.bytes().subarray(8),d=f===-1?l:n.decode(l);s.push(d);let h=(o+7&-8)-o;o+=h,i.push(new Ne(o,d.length)),o+=d.length}return{decommpressedBody:s,buffers:i}}},jo=class extends yf{constructor(e,t){super(t),this._reader=ru(e)?new Vi(this._handle=e):new Vs(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=w0(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Ie}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ie}next(){if(this.closed)return Ie;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ci(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Vo=class extends yf{constructor(e,t){super(t),this._reader=new ji(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return B(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return B(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=w0(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ie})}return(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ie})}next(){return B(this,void 0,void 0,function*(){if(this.closed)return Ie;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ci(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},wf=class extends jo{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof nc?e:new nc(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(ne.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(ne.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,t=e.size-lp,n=e.readInt32(t),s=e.readAt(t-n,n);return yn.decode(s)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(e)}return null}},mp=class extends Vo{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...t){let n=typeof t[0]!="number"?t.shift():void 0,s=t[0]instanceof Map?t.shift():void 0;super(e instanceof gs?e:new gs(e,n),s)}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return B(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return B(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(ne.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null})}_readDictionaryBatch(e){return B(this,void 0,void 0,function*(){var t;let n=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(ne.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}})}_readFooter(){return B(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-lp,n=yield e.readInt32(t),s=yield e.readAt(t-n,n);return yn.decode(s)})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},bp=class extends jo{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new rf(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}}});function sr(r){let e=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ne(this._byteLength,e)),this._byteLength+=e,this}function PB(r){var e;let{type:t,length:n,typeIds:s,valueOffsets:i}=r;if(sr.call(this,s),t.mode===de.Sparse)return gp.call(this,r);if(t.mode===de.Dense){if(r.offset<=0)return sr.call(this,i),gp.call(this,r);{let o=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let u,f,l=-1;++l<n;)(u=s[l])!==void 0&&((f=a[u])===void 0&&(f=a[u]=i[l]),o[l]=i[l]-f,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);sr.call(this,o),this.visitMany(r.children.map((u,f)=>{let l=t.typeIds[f],d=a[l],h=c[l];return u.slice(d,Math.min(n,h))}))}}return this}function zB(r){let e;return r.nullCount>=r.length?sr.call(this,new Uint8Array(r.length+7>>3)):(e=r.values)instanceof Uint8Array?sr.call(this,oi(r.offset,r.length,e)):sr.call(this,ai(r.values))}function Fn(r){return sr.call(this,r.values.subarray(0,r.length*r.stride))}function xf(r){let{length:e,values:t,valueOffsets:n}=r,s=ee(n[0]),i=ee(n[e]),o=Math.min(i-s,t.byteLength-s);return sr.call(this,cu(-s,e+1,n)),sr.call(this,t.subarray(s,s+o)),this}function x0(r){let{offset:e,length:t,stride:n,values:s,variadicBuffers:i=[]}=r;if(!s)throw new Error("BinaryView data is missing view buffer");let o=e*n,a=o+t*n;sr.call(this,s.subarray(o,a));for(let c of i)sr.call(this,c);return this._variadicBufferCounts.push(i.length),this}function Tf(r){let{length:e,valueOffsets:t}=r;if(t){let n=ee(t[0]),s=ee(t[e]);return sr.call(this,cu(-n,e+1,t)),this.visit(r.children[0].slice(n,s-n))}return this.visit(r.children[0])}function gp(r){return this.visitMany(r.type.children.map((e,t)=>r.children[t]).filter(Boolean))[0]}var Le,T0=p(()=>{ft();Dt();Fe();Sn();$e();ci();ms();ye();Wr();Le=class r extends R{static assemble(...e){let t=s=>s.flatMap(i=>Array.isArray(i)?t(i):i instanceof le?i.data.children:i.data),n=new r;return n.visitMany(t(e)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof E)return this.visitMany(e.data),this;let{type:t}=e;if(!L.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(L.isUnion(t))this.nodes.push(new pr(n,0));else{let{nullCount:s}=e;L.isNull(t)||sr.call(this,s<=0?new Uint8Array(0):oi(e.offset,n,e.nullBitmap)),this.nodes.push(new pr(n,s))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Le.prototype.visitBool=zB;Le.prototype.visitInt=Fn;Le.prototype.visitFloat=Fn;Le.prototype.visitUtf8=xf;Le.prototype.visitLargeUtf8=xf;Le.prototype.visitUtf8View=x0;Le.prototype.visitBinary=xf;Le.prototype.visitLargeBinary=xf;Le.prototype.visitBinaryView=x0;Le.prototype.visitFixedSizeBinary=Fn;Le.prototype.visitDate=Fn;Le.prototype.visitTimestamp=Fn;Le.prototype.visitTime=Fn;Le.prototype.visitDecimal=Fn;Le.prototype.visitList=Tf;Le.prototype.visitLargeList=Tf;Le.prototype.visitStruct=gp;Le.prototype.visitUnion=PB;Le.prototype.visitInterval=Fn;Le.prototype.visitDuration=Fn;Le.prototype.visitFixedSizeList=Tf;Le.prototype.visitMap=Tf});var _f,_0=p(()=>{Dt();bu();Fe();_f=class extends R{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:P[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:P[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:P[e].toLowerCase(),precision:ue[t]}}visitBinary({typeId:e}){return{name:P[e].toLowerCase()}}visitLargeBinary({typeId:e}){return{name:P[e].toLowerCase()}}visitBinaryView({typeId:e}){return{name:P[e].toLowerCase()}}visitBool({typeId:e}){return{name:P[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:P[e].toLowerCase()}}visitLargeUtf8({typeId:e}){return{name:P[e].toLowerCase()}}visitUtf8View({typeId:e}){return{name:P[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n,bitWidth:s}){return{name:P[e].toLowerCase(),scale:t,precision:n,bitWidth:s}}visitDate({typeId:e,unit:t}){return{name:P[e].toLowerCase(),unit:ge[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:P[e].toLowerCase(),unit:S[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:P[e].toLowerCase(),unit:S[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:P[e].toLowerCase(),unit:ie[t]}}visitDuration({typeId:e,unit:t}){return{name:P[e].toLocaleLowerCase(),unit:S[t]}}visitList({typeId:e}){return{name:P[e].toLowerCase()}}visitLargeList({typeId:e}){return{name:P[e].toLowerCase()}}visitStruct({typeId:e}){return{name:P[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:P[e].toLowerCase(),mode:de[t].toUpperCase(),typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:P[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:P[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:P[e].toLowerCase(),keysSorted:t}}}});function*yp(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*On(r,e){let t=new Uint32Array(r.buffer,r.byteOffset,r.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,s=t.length/e;++n<s;)yield`${ni.new(t.subarray((n+0)*e,(n+1)*e),!1)}`}function A0(r,e){let n=r.values,s=new DataView(n.buffer,n.byteOffset,n.byteLength),i=n.byteLength/16,o=d=>Array.from(d).map(h=>("0"+(h&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:i},(d,h)=>{let m=h*16,b=s.getInt32(m,!0);return[m,b]}).map(([d,h])=>h>12?{SIZE:h,PREFIX_HEX:o(n.subarray(d+4,d+8)),BUFFER_INDEX:s.getInt32(d+8,!0),OFFSET:s.getInt32(d+12,!0)}:{SIZE:h,INLINED:e(n.subarray(d+4,d+4+h))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],u=c.map(d=>o(r.variadicBuffers[d])),f=new Map(c.map((d,h)=>[d,h]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:f.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:u}}var dc,v0=p(()=>{yu();ft();Dt();Fe();Fe();ci();tf();ye();dc=class r extends R{static assemble(...e){let t=new r;return e.map(({schema:n,data:s})=>t.visitMany(n.fields,s.children))}visit({name:e},t){let{length:n}=t,{offset:s,nullCount:i,nullBitmap:o}=t,a=L.isDictionary(t.type)?t.type.indices:t.type,c=Object.assign([],t.buffers,{[te.VALIDITY]:void 0});return Object.assign({name:e,count:n,VALIDITY:L.isNull(a)||L.isUnion(a)?void 0:i<=0?Array.from({length:n},()=>1):[...new Kr(o,s,n,null,Uu)]},super.visit(t.clone(a,s,n,0,c)))}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...new Kr(e,t,n,null,So)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...On(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...new E([e])],OFFSET:[...e.valueOffsets]}}visitLargeUtf8(e){return{DATA:[...new E([e])],OFFSET:[...On(e.valueOffsets,2)]}}visitBinary(e){return{DATA:[...yp(new E([e]))],OFFSET:[...e.valueOffsets]}}visitLargeBinary(e){return{DATA:[...yp(new E([e]))],OFFSET:[...On(e.valueOffsets,2)]}}visitBinaryView(e){return A0(e,t=>Array.from(t).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(e){return A0(e,t=>Array.from(t).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(e){return{DATA:[...yp(new E([e]))]}}visitDate(e){return{DATA:e.type.unit===ge.DAY?[...e.values]:[...On(e.values,2)]}}visitTimestamp(e){return{DATA:[...On(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<S.MICROSECOND?[...e.values]:[...On(e.values,2)]}}visitDecimal(e){return{DATA:[...On(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}visitLargeList(e){return{OFFSET:[...On(e.valueOffsets,2)],children:this.visitMany(e.type.children,e.children)}}visitStruct(e){return{children:this.visitMany(e.type.children,e.children)}}visitUnion(e){return{TYPE_ID:[...e.typeIds],OFFSET:e.type.mode===de.Dense?[...e.valueOffsets]:void 0,children:this.visitMany(e.type.children,e.children)}}visitInterval(e){switch(e.type.unit){case ie.YEAR_MONTH:return{DATA:[...e.values]};case ie.DAY_TIME:return{DATA:Oh(e.values)};case ie.MONTH_DAY_NANO:return{DATA:Mh(e.values,!0)}}}visitDuration(e){return{DATA:[...On(e.values,2)]}}visitFixedSizeList(e){return{children:this.visitMany(e.type.children,e.children)}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}}});function wp(r,e){let t=e;e instanceof be&&(t=e.batches,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function xp(r,e){return B(this,void 0,void 0,function*(){var t,n,s,i,o,a,c;try{for(t=!0,n=zt(e);s=yield n.next(),i=s.done,!i;t=!0){c=s.value,t=!1;let u=c;r.write(u)}}catch(u){o={error:u}}finally{try{!t&&!i&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function I0({name:r,type:e,nullable:t}){let n=new _f;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(s=>I0(s)),dictionary:L.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function WB(r,e,t=!1){let[n]=dc.assemble(new le({[e]:r}));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:n}},null,2)}function $B(r){let[e]=dc.assemble(r);return JSON.stringify({count:r.numRows,columns:e},null,2)}var Qr,Mn,Rn,hc,Af=p(()=>{Bt();ki();bf();ft();ye();ms();ms();Th();Fe();fc();bs();T0();_0();v0();$e();Sn();rc();Wn();ho();gf();oe();Qr=class extends di{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}constructor(e){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new mr,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,gt(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(Ye).includes(e.compressionType))this._compression=new li(e.compressionType);else{let t=Object.values(Ye).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${t.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return $t(e)?e.then(t=>this.writeAll(t)):fr(e)?xp(this,e):wp(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof mr?this._sink=e:(this._sink=new mr,e&&zy(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Wy(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!Ni(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof be&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof le&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!Ni(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof le?e instanceof Ci||this._writeRecordBatch(e):e instanceof be?this.writeAll(e.batches):Tr(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,s=pt.encode(e),i=s.byteLength,o=this._writeLegacyIpcFormat?4:8,a=i+o+n&~n,c=a-i-o;return e.headerType===ne.RecordBatch?this._recordBatchBlocks.push(new Dr(a,e.bodyLength,this._position)):e.headerType===ne.DictionaryBatch&&this._dictionaryBlocks.push(new Dr(a,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),i>0&&this._write(s),this._writePadding(c)}_write(e){if(this._started){let t=D(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(pt.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(No)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=this._assembleRecordBatch(e),a=new ze(e.numRows,n,s,this._compression,o,e.metadata),c=pt.from(a,t);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(i)}_assembleRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=Le.assemble(e);return this._compression!=null&&({byteLength:t,bufferRegions:s,buffers:i}=this._compressBodyBuffers(i)),{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}}_compressBodyBuffers(e){let t=Us.get(this._compression.type);if(!t?.encode||typeof t.encode!="function")throw new Error(`Codec for compression type "${Ye[this._compression.type]}" has invalid encode method`);let n=0,s=[],i=[];for(let a of e){let c=D(a);if(c.length===0){s.push(new Uint8Array(0),new Uint8Array(0)),i.push(new Ne(n,0));continue}let u=t.encode(c),f=u.length<c.length,l=f?u:c,d=f?l.length:-1,h=new Je(new Uint8Array(8));h.writeInt64(0,BigInt(d)),s.push(h.bytes(),new Uint8Array(l));let m=(n+7&-8)-n;n+=m;let b=8+l.length;i.push(new Ne(n,b)),n+=b}let o=(n+7&-8)-n;return n+=o,{byteLength:n,bufferRegions:i,buffers:s}}_writeDictionaryBatch(e,t,n=!1){let{byteLength:s,nodes:i,bufferRegions:o,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new E([e])),u=new ze(e.length,i,o,this._compression,c),f=new ht(u,t,n),l=pt.from(f,s);return this._writeMessage(l)._writeBodyBuffers(a)}_writeBodyBuffers(e){let t=this._compression!=null?2:1,n=new Array(t);for(let s=0;s<e.length;s+=t){let i=0;for(let a=-1;++a<t;)n[a]=e[s+a],i+=n[a].byteLength;if(i===0)continue;for(let a of n)this._write(a);let o=(i+7&-8)-i;o>0&&this._writePadding(o)}return this}_writeDictionaries(e){var t,n;for(let[s,i]of e.dictionaries){let o=(t=i?.data)!==null&&t!==void 0?t:[],a=this._seenDictionaries.get(s),c=(n=this._dictionaryDeltaOffsets.get(s))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(let[u,f]of o.entries())this._writeDictionaryBatch(f,s,u>0);else if(c<o.length)for(let u of o.slice(c))this._writeDictionaryBatch(u,s,!0);this._seenDictionaries.set(s,i),this._dictionaryDeltaOffsets.set(s,o.length)}return this}},Mn=class r extends Qr{static writeAll(e,t){let n=new r(t);return $t(e)?e.then(s=>n.writeAll(s)):fr(e)?xp(n,e):wp(n,e)}},Rn=class r extends Qr{static writeAll(e,t){let n=new r(t);return $t(e)?e.then(s=>n.writeAll(s)):fr(e)?xp(n,e):wp(n,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=yn.encode(new yn(e,me.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}},hc=class r extends Qr{static writeAll(e){return new r().writeAll(e)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
22
|
+
"schema": ${JSON.stringify({fields:e.fields.map(t=>I0(t))},null,2)}`)}_writeDictionaries(e){return e.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(e),this}_writeDictionaryBatch(e,t,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
|
|
23
|
+
`),this._write(WB(e,t,n)),this._dictionaryBlocks.push(new Dr(0,0,0)),this}_writeRecordBatch(e){return this._writeDictionaries(e),this._recordBatches.push(e),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
|
|
24
24
|
"dictionaries": [
|
|
25
25
|
`);for(let e of this._recordBatchesWithDictionaries)super._writeDictionaries(e);this._write(`
|
|
26
|
-
]`)}if(this._recordBatches.length>0){for(let e=-1,
|
|
26
|
+
]`)}if(this._recordBatches.length>0){for(let e=-1,t=this._recordBatches.length;++e<t;)this._write(e===0?`,
|
|
27
27
|
"batches": [
|
|
28
28
|
`:`,
|
|
29
|
-
`),this._write(
|
|
29
|
+
`),this._write($B(this._recordBatches[e])),this._recordBatchBlocks.push(new Dr(0,0,0));this._write(`
|
|
30
30
|
]`)}return this._schema&&this._write(`
|
|
31
|
-
}`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function tT(t,e){if(ur(t))return sB(t,e);if(wr(t))return nB(t,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function nB(t,e){let r=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){i(o,r||(r=t[Symbol.iterator]()))},pull(o){r?i(o,r):o.close()},cancel(){r?.return&&r.return(),r=null}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){let c,u=null,f=o.desiredSize||null;for(;!(u=a.next(n?f:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=D(u.value))&&(f!=null&&n&&(f=f-c.byteLength+1),u.value=c),o.enqueue(u.value),f!=null&&--f<=0)return;o.close()}}function sB(t,e){let r=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return B(this,void 0,void 0,function*(){yield i(o,r||(r=t[Symbol.asyncIterator]()))})},pull(o){return B(this,void 0,void 0,function*(){r?yield i(o,r):o.close()})},cancel(){return B(this,void 0,void 0,function*(){r?.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){return B(this,void 0,void 0,function*(){let c,u=null,f=o.desiredSize||null;for(;!(u=yield a.next(n?f:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=D(u.value))&&(f!=null&&n&&(f=f-c.byteLength+1),u.value=c),o.enqueue(u.value),f!=null&&--f<=0)return;o.close()})}}var rT=p(()=>{Bt();qe();Un()});function iT(t){return new cp(t)}var cp,nT,sT,oT=p(()=>{Bt();Qa();cp=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=e,i=my(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Dr(i),this._getSize=s!=="bytes"?nT:sT;let{["highWaterMark"]:o=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:a=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:s!=="bytes"?nT:sT}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-r}_maybeFlush(e,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(e,r){this._bufferedSize=0,this._controller=null,r==null?e.close():e.enqueue(r)}},nT=t=>{var e;return(e=t?.length)!==null&&e!==void 0?e:0},sT=t=>{var e;return(e=t?.byteLength)!==null&&e!==void 0?e:0}});function xf(t,e){let r=new pr,n=null,s=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield r.close()})},start(a){return B(this,void 0,void 0,function*(){yield o(a,n||(n=yield i()))})},pull(a){return B(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},t)),readable:s};function i(){return B(this,void 0,void 0,function*(){return yield(yield Lt.from(r)).open(e)})}function o(a,c){return B(this,void 0,void 0,function*(){let u=a.desiredSize,f=null;for(;!(f=yield c.next()).done;)if(a.enqueue(f.value),u!=null&&--u<=0)return;a.close()})}}var aT=p(()=>{Bt();ds();sc()});function wf(t,e){let r=new this(t),n=new Ct(r),s=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return B(this,void 0,void 0,function*(){yield i(o)})},start(o){return B(this,void 0,void 0,function*(){yield i(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(r,t),readable:s};function i(o){return B(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}var cT=p(()=>{Bt();ds()});function ac(t){let e=Lt.from(t);return Wt(e)?e.then(r=>ac(r)):e.isAsync()?e.readAll().then(r=>new be(r)):new be(e.readAll())}function Tf(t,e="stream",r=null){let n={compressionType:r};return(e==="stream"?Bn:Fn).writeAll(t,n).toUint8Array(!0)}var uT=p(()=>{Ni();Un();sc();yf()});var up={};Z(up,{isArrowData:()=>If,isArrowDataType:()=>vf,isArrowField:()=>Af,isArrowRecordBatch:()=>Sf,isArrowSchema:()=>_f,isArrowTable:()=>Ef,isArrowVector:()=>Lf});function _f(t){return X.isSchema(t)}function Af(t){return F.isField(t)}function vf(t){return L.isDataType(t)}function If(t){return N.isData(t)}function Lf(t){return E.isVector(t)}function Sf(t){return le.isRecordBatch(t)}function Ef(t){return be.isTable(t)}var fp=p(()=>{ht();ye();dr();lt();vn();Ni()});var fT,lp=p(()=>{du();ao();Fe();dr();ye();Ni();lt();Dt();ht();za();Mu();Ae();Qa();Th();Dh();_h();Ah();vh();Ih();Sh();Fh();kh();Ch();Eh();Bh();Vh();Ph();Uh();Qu();tf();ef();Oh();Mh();Lh();Rh();Nh();Gh();ds();sc();yf();uT();df();lf();ls();vn();fp();hu();mh();ai();ja();qe();To();Da();Ju();fp();nc();fT=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Gd),ph),eh),Vd),sd),Qd),Dd),wh),up),{compareSchemas:Di,compareFields:Mw,compareTypes:sf})});var On={};Z(On,{AsyncByteQueue:()=>pr,AsyncByteStream:()=>Ct,AsyncMessageReader:()=>ki,AsyncRecordBatchFileReader:()=>Mo,AsyncRecordBatchStreamReader:()=>In,Binary:()=>Ot,BinaryBuilder:()=>yn,BinaryView:()=>J,BinaryViewBuilder:()=>Tn,Bool:()=>ct,BoolBuilder:()=>di,BufferType:()=>te,Builder:()=>we,ByteStream:()=>mr,CompressionType:()=>Ze,Data:()=>N,DataType:()=>L,DateBuilder:()=>Hr,DateDay:()=>Xn,DateDayBuilder:()=>ps,DateMillisecond:()=>Jn,DateMillisecondBuilder:()=>ms,DateUnit:()=>ge,Date_:()=>Tt,Decimal:()=>Mt,DecimalBuilder:()=>bs,DenseUnion:()=>dn,DenseUnionBuilder:()=>Mi,Dictionary:()=>Pe,DictionaryBuilder:()=>hi,Duration:()=>_t,DurationBuilder:()=>br,DurationMicrosecond:()=>Va,DurationMicrosecondBuilder:()=>As,DurationMillisecond:()=>Ga,DurationMillisecondBuilder:()=>_s,DurationNanosecond:()=>Ua,DurationNanosecondBuilder:()=>vs,DurationSecond:()=>ka,DurationSecondBuilder:()=>Ts,Field:()=>F,FixedSizeBinary:()=>Rt,FixedSizeBinaryBuilder:()=>gs,FixedSizeList:()=>Se,FixedSizeListBuilder:()=>pi,Float:()=>ot,Float16:()=>Er,Float16Builder:()=>mi,Float32:()=>xt,Float32Builder:()=>bi,Float64:()=>Yt,Float64Builder:()=>gi,FloatBuilder:()=>Xr,Int:()=>Ee,Int16:()=>Kt,Int16Builder:()=>xi,Int32:()=>ke,Int32Builder:()=>wi,Int64:()=>Ht,Int64Builder:()=>Ti,Int8:()=>qt,Int8Builder:()=>yi,IntBuilder:()=>vt,Interval:()=>ut,IntervalBuilder:()=>Nr,IntervalDayTime:()=>ss,IntervalDayTimeBuilder:()=>ys,IntervalMonthDayNano:()=>Ca,IntervalMonthDayNanoBuilder:()=>ws,IntervalUnit:()=>ie,IntervalYearMonth:()=>is,IntervalYearMonthBuilder:()=>xs,JSONMessageReader:()=>Gi,LargeBinary:()=>Br,LargeBinaryBuilder:()=>xn,LargeList:()=>Zt,LargeListBuilder:()=>Si,LargeUtf8:()=>Fr,LargeUtf8Builder:()=>Ds,List:()=>Ue,ListBuilder:()=>Li,MapBuilder:()=>Ei,MapRow:()=>lr,Map_:()=>ft,Message:()=>mt,MessageHeader:()=>ne,MessageReader:()=>Ns,MetadataVersion:()=>me,Null:()=>Ne,NullBuilder:()=>Bi,Precision:()=>ue,RecordBatch:()=>le,RecordBatchFileReader:()=>Ln,RecordBatchFileWriter:()=>Fn,RecordBatchJSONWriter:()=>oc,RecordBatchReader:()=>Lt,RecordBatchStreamReader:()=>Cr,RecordBatchStreamWriter:()=>Bn,RecordBatchWriter:()=>Yr,Schema:()=>X,SparseUnion:()=>os,SparseUnionBuilder:()=>Oi,Struct:()=>he,StructBuilder:()=>Fi,StructRow:()=>$r,Table:()=>be,Time:()=>Qe,TimeBuilder:()=>yr,TimeMicrosecond:()=>Qn,TimeMicrosecondBuilder:()=>Os,TimeMillisecond:()=>Zn,TimeMillisecondBuilder:()=>Fs,TimeNanosecond:()=>es,TimeNanosecondBuilder:()=>Ms,TimeSecond:()=>Yn,TimeSecondBuilder:()=>Bs,TimeUnit:()=>S,Timestamp:()=>et,TimestampBuilder:()=>gr,TimestampMicrosecond:()=>rs,TimestampMicrosecondBuilder:()=>Ss,TimestampMillisecond:()=>Wr,TimestampMillisecondBuilder:()=>Ls,TimestampNanosecond:()=>ns,TimestampNanosecondBuilder:()=>Es,TimestampSecond:()=>ts,TimestampSecondBuilder:()=>Is,Type:()=>y,Uint16:()=>Jt,Uint16Builder:()=>Ai,Uint32:()=>yt,Uint32Builder:()=>vi,Uint64:()=>Sr,Uint64Builder:()=>Ii,Uint8:()=>Xt,Uint8Builder:()=>_i,Union:()=>At,UnionBuilder:()=>wn,UnionMode:()=>de,Utf8:()=>at,Utf8Builder:()=>Rs,Utf8View:()=>wt,Utf8ViewBuilder:()=>Ri,Vector:()=>E,Visitor:()=>R,builderThroughAsyncIterable:()=>qh,builderThroughIterable:()=>af,compressionRegistry:()=>Cs,isArrowData:()=>If,isArrowDataType:()=>vf,isArrowField:()=>Af,isArrowRecordBatch:()=>Sf,isArrowSchema:()=>_f,isArrowTable:()=>Ef,isArrowVector:()=>Lf,makeBuilder:()=>Dr,makeData:()=>M,makeTable:()=>Kh,makeVector:()=>Kr,tableFromArrays:()=>Hh,tableFromIPC:()=>ac,tableFromJSON:()=>$h,tableToIPC:()=>Tf,util:()=>fT,vectorFromArray:()=>Bo});var ks=p(()=>{xa();Ae();sc();yf();rT();oT();aT();cT();lp();lp();Je.toDOMStream=tT;we.throughDOM=iT;Lt.throughDOM=xf;Ln.throughDOM=xf;Cr.throughDOM=xf;Yr.throughDOM=wf;Fn.throughDOM=wf;Bn.throughDOM=wf});function No(t){return{fields:t.fields.map(e=>Vi(e)),metadata:mT(t.metadata)}}function pT(t,e){return new X(t.fields.map(r=>Zr(r,e)),Bf(t.metadata))}function mT(t){return Object.fromEntries(t)}function Bf(t){return t?new Map(Object.entries(t)):new Map}function Vi(t){return{name:t.name,type:Ff(t.type),nullable:t.nullable,metadata:mT(t.metadata)}}function Zr(t,e){return new F(t.name,Co(t.type,e),t.nullable,Bf(t.metadata))}function Ff(t){if(lT(t,"BinaryView"))return"binary-view";if(lT(t,"Utf8View"))return"utf8-view";if(iB(t,"LargeList"))return{type:"large-list",children:[Vi(t.valueField)]};switch(t.constructor){case Ne:return"null";case Ot:return"binary";case Rt:return{type:"fixed-size-binary",byteWidth:t.byteWidth};case ct:return"bool";case Ee:let e=t;return`${e.isSigned?"":"u"}int${e.bitWidth}`;case qt:return"int8";case Kt:return"int16";case ke:return"int32";case Ht:return"int64";case Xt:return"uint8";case Jt:return"uint16";case yt:return"uint32";case Sr:return"uint64";case ot:switch(t.precision){case ue.HALF:return"float16";case ue.SINGLE:return"float32";case ue.DOUBLE:return"float64";default:return"float16"}case Er:return"float16";case xt:return"float32";case Yt:return"float64";case at:return"utf8";case Mt:let n=t;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case Tt:return t.unit===ge.DAY?"date-day":"date-millisecond";case Xn:return"date-day";case Jn:return"date-millisecond";case Qe:switch(t.unit){case S.SECOND:return"time-second";case S.MILLISECOND:return"time-millisecond";case S.MICROSECOND:return"time-microsecond";case S.NANOSECOND:return"time-nanosecond";default:return"time-second"}case Zn:return"time-millisecond";case Yn:return"time-second";case Qn:return"time-microsecond";case es:return"time-nanosecond";case et:switch(t.unit){case S.SECOND:return"timestamp-second";case S.MILLISECOND:return"timestamp-millisecond";case S.MICROSECOND:return"timestamp-microsecond";case S.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case ts:return"timestamp-second";case Wr:return"timestamp-millisecond";case rs:return"timestamp-microsecond";case ns:return"timestamp-nanosecond";case ut:switch(t.unit){case ie.DAY_TIME:return"interval-daytime";case ie.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case ss:return"interval-daytime";case is:return"interval-yearmonth";case ft:let c=t;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(b=>Vi(b))};case Ue:let f=t.valueField;return{type:"list",children:[Vi(f)]};case Se:let l=t;return{type:"fixed-size-list",listSize:l.listSize,children:[Vi(l.children[0])]};case he:return{type:"struct",children:t.children.map(b=>Vi(b))};case os:case dn:let h=t;return{type:h instanceof dn?"dense-union":"sparse-union",typeIds:h.typeIds,children:h.children.map(b=>Vi(b)),typeIdToChildIndex:{...h.typeIdToChildIndex}};case Pe:let m=t;return{type:"dictionary",id:m.id,indices:oB(m.indices),dictionary:Ff(m.dictionary),isOrdered:m.isOrdered};default:throw new Error(`arrow type not supported: ${t.constructor.name}`)}}function Co(t,e){if(typeof t=="object")switch(t.type){case"decimal":return new Mt(t.scale,t.precision,t.bitWidth);case"map":{let r=t.children.map(n=>Zr(n,e));return new ft(r[0],t.keysSorted)}case"list":{let r=Zr(t.children[0],e);return new Ue(r)}case"large-list":{let r=Zr(t.children[0],e),n=cc("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(r)}case"fixed-size-list":{let r=Zr(t.children[0],e);return new Se(t.listSize,r)}case"fixed-size-binary":return new Rt(t.byteWidth);case"struct":{let r=t.children.map(n=>Zr(n,e));return new he(r)}case"sparse-union":case"dense-union":{let r=t.children.map(n=>Zr(n,e));return t.type==="dense-union"?new dn(t.typeIds,r):new os(t.typeIds,r)}case"dictionary":return new Pe(Co(t.dictionary,e),cB(t.indices),t.id,t.isOrdered);default:throw new Error("array type not supported")}switch(t){case"null":return new Ne;case"binary":return dT("BinaryView",new Ot,e);case"binary-view":return hT("BinaryView");case"bool":return new ct;case"int8":return new qt;case"int16":return new Kt;case"int32":return new ke;case"int64":return new Ht;case"uint8":return new Xt;case"uint16":return new Jt;case"uint32":return new yt;case"uint64":return new Sr;case"float16":return new Er;case"float32":return new xt;case"float64":return new Yt;case"utf8":return dT("Utf8View",new at,e);case"utf8-view":return hT("Utf8View");case"date-day":return new Xn;case"date-millisecond":return new Jn;case"time-second":return new Yn;case"time-millisecond":return new Zn;case"time-microsecond":return new Qn;case"time-nanosecond":return new es;case"timestamp-second":return new ts;case"timestamp-millisecond":return new Wr;case"timestamp-microsecond":return new rs;case"timestamp-nanosecond":return new ns;case"interval-daytime":return new ss;case"interval-yearmonth":return new is;default:throw new Error("array type not supported")}}function cc(t){return On[t]}function lT(t,e){let r=cc(e);if(r&&t instanceof r)return!0;let n=L;return!!(e==="BinaryView"?n.isBinaryView:n.isUtf8View)?.(t)}function iB(t,e){let r=cc(e);return!!(r&&t instanceof r)}function dT(t,e,r){let n=r?.viewTypes||"never";if(n==="never")return e;let s=cc(t);if(s)return new s;if(n==="require")throw new Error(`${t} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return e}function hT(t){let e=cc(t);if(!e)throw new Error(`${t} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new e}function oB(t){if(t instanceof Ee){let r=`${t.isSigned?"int":"uint"}${t.bitWidth}`;if(aB(r))return r}switch(t.constructor){case qt:return"int8";case Kt:return"int16";case ke:return"int32";case Xt:return"uint8";case Jt:return"uint16";case yt:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${t.constructor.name}`)}}function aB(t){return["int8","int16","int32","uint8","uint16","uint32"].includes(t)}function cB(t){switch(t){case"int8":return new qt;case"int16":return new Kt;case"int32":return new ke;case"uint8":return new Xt;case"uint16":return new Jt;case"uint32":return new yt;default:throw new Error(`schema dictionary index type not supported: ${t}`)}}var uc=p(()=>{"use strict";ks()});function bT(t,e={}){let r={...e,copies:new WeakMap};return uB(t)?dB(t,r):fB(t)?gT(t,r):lB(t)?yT(t,r):Mf(t,r)}function uB(t){return"batches"in t}function fB(t){return"schema"in t&&"data"in t&&!Array.isArray(t.data)}function lB(t){return"data"in t&&Array.isArray(t.data)}function dB(t,e){let r=t.batches.map(n=>gT(n,e));return new be(t.schema,r)}function gT(t,e){return new le(t.schema,Mf(t.data,e))}function Mf(t,e){let r=t.children.map(i=>Mf(i,e)),n=t.dictionary?yT(t.dictionary,e):void 0,s={[te.OFFSET]:Of(t.buffers[te.OFFSET],e),[te.DATA]:Of(t.buffers[te.DATA],e),[te.VALIDITY]:Of(t.buffers[te.VALIDITY],e),[te.TYPE]:Of(t.buffers[te.TYPE],e)};return new N(t.type,t.offset,t.length,t._nullCount,s,r,n)}function yT(t,e){return new E(t.data.map(r=>Mf(r,e)))}function Of(t,e){if(!hB(t)||e.copy==="none"||e.copy!=="all"&&t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t;let r=e.copies.get(t);return r||(r=t.slice(),e.copies.set(t,r)),r}function hB(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var dp=p(()=>{"use strict";ks()});function xT(t,e){let r=bT(t,e);return{shape:"arrow-table",transport:"arrow-js",schema:No(r.schema),batches:r.batches.map(n=>pB(n))}}function wT(t){let e=pT(t.schema),r=t.batches.map(n=>new le(e,mp(n.data)));return new be(e,r)}function Ui(t){if(!AT(t))throw new Error("Workers require Arrow table output");let{data:e,...r}=t;return{...structuredClone(r),data:xT(e,{copy:"all"})}}function hp(t){if(!vT(t))throw new Error("Workers require Arrow column transport");return{...t,data:wT(t.data)}}function TT(t,e){if(!AT(t))return t;let r=e,n=r?.core?.workerTransferBufferCopy??r?.workerTransferBufferCopy;return{...t,data:xT(t.data,n?{copy:n}:void 0)}}function _T(t){return vT(t)?{...t,data:wT(t.data)}:t}function AT(t){let e=t;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function vT(t){let e=t;return!!(e&&e.shape==="arrow-table"&&e.data&&e.data.transport==="arrow-js"&&Array.isArray(e.data.batches))}function pB(t){return{data:pp(t.data)}}function pp(t){return{type:Ff(t.type),offset:t.offset,length:t.length,nullCount:t._nullCount,buffers:{[te.OFFSET]:t.buffers[te.OFFSET],[te.DATA]:t.buffers[te.DATA],[te.VALIDITY]:t.buffers[te.VALIDITY],[te.TYPE]:t.buffers[te.TYPE]},children:t.children.map(e=>pp(e)),dictionary:t.dictionary?mB(t.dictionary):void 0}}function mB(t){return{data:t.data.map(e=>pp(e))}}function mp(t){let e=t.children.map(n=>mp(n)),r=t.dictionary?bB(t.dictionary):void 0;return new N(Co(t.type),t.offset,t.length,t.nullCount,t.buffers,e,r)}function bB(t){return new E(t.data.map(e=>mp(e)))}var IT=p(()=>{"use strict";ks();uc();dp()});var fc=p(()=>{"use strict";IT();dp()});async function lc(t,e,r,n){return n._parse(t,e,r,n)}var LT=p(()=>{"use strict"});function sr(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var bp=p(()=>{"use strict"});var Qr,gB,yB,xB,wB,Mn,ST,TB,gp=p(()=>{"use strict";Qr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},gB=Qr.self||Qr.window||Qr.global||{},yB=Qr.window||Qr.self||Qr.global||{},xB=Qr.global||Qr.self||Qr.window||{},wB=Qr.document||{},Mn=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),ST=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),TB=ST&&parseFloat(ST[1])||0});var ET,BT=p(()=>{"use strict";ET=t=>typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer});function Pi(t,e){return new Promise((r,n)=>{let s=!1;function i(a){s||(s=!0,n(a))}function o(a){if(!s){s=!0;try{r(e(a))}catch(c){n(c)}}}try{t(o,i)?.then(o,i)}catch(a){i(a)}})}var FT=p(()=>{"use strict"});function yp(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function xp(t){return globalThis.loaders?.modules?.[t]||null}var wp=p(()=>{"use strict"});var OT,bz,gz,Tp,MT=p(()=>{"use strict";OT="master",bz=`https://raw.githubusercontent.com/visgl/loaders.gl/${OT}/`,gz=`https://github.com/visgl/loaders.gl/raw/${OT}/`,Tp="beta"});var RT=p(()=>{"use strict";MT()});function _B(){let t="5.0.0-beta.1";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=t,t}var dc,_p=p(()=>{"use strict";dc=_B()});function Rn(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var hc=p(()=>{"use strict"});var en,Az,vz,Iz,Lz,Me,pc,NT,DT,Sz,ji=p(()=>{"use strict";en={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Az=en.self||en.window||en.global||{},vz=en.window||en.self||en.global||{},Iz=en.global||en.self||en.window||{},Lz=en.document||{},Me=typeof process!="object"||String(process)!=="[object process]"||process.browser,pc=typeof importScripts=="function",NT=typeof window<"u"&&typeof window.orientation<"u",DT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Sz=DT&&parseFloat(DT[1])||0});function AB(t){let e=new Error(t);return e.name="AbortError",e}var mc,CT=p(()=>{"use strict";mc=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,r){this.name=e,this.workerThread=r,this.result=new Promise((n,s)=>{this._resolve=n,this._reject=s})}postMessage(e,r){this.isRunning&&this.workerThread.postMessage({source:"loaders.gl",type:e,payload:r})}done(e){this.isRunning&&(this.isRunning=!1,this._resolve(e))}error(e){this.isRunning&&(this.isRunning=!1,this._reject(e))}abort(e){this.isRunning&&(this.workerThread.destroy(),this.error(arguments.length?e:AB(`Worker job "${this.name}" was aborted`)))}}});var ko,kT=p(()=>{"use strict";ko=class{constructor(...e){let n=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(n)return new n(...e)}terminate(){}}});function GT(t){Rn(t.source&&!t.url||!t.source&&t.url);let e=Ap.get(t.source||t.url);return e||(t.url&&(e=vB(t.url),Ap.set(t.url,e)),t.source&&(e=VT(t.source),Ap.set(t.source,e))),Rn(e),e}function vB(t){if(!t.startsWith("http"))return t;let e=IB(t);return VT(e)}function VT(t){let e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function IB(t){return`try {
|
|
32
|
-
importScripts('${
|
|
31
|
+
}`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function L0(r,e){if(fr(r))return KB(r,e);if(Tr(r))return qB(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function qB(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){i(o,t||(t=r[Symbol.iterator]()))},pull(o){t?i(o,t):o.close()},cancel(){t?.return&&t.return(),t=null}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){let c,u=null,f=o.desiredSize||null;for(;!(u=a.next(n?f:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=D(u.value))&&(f!=null&&n&&(f=f-c.byteLength+1),u.value=c),o.enqueue(u.value),f!=null&&--f<=0)return;o.close()}}function KB(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return B(this,void 0,void 0,function*(){yield i(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return B(this,void 0,void 0,function*(){t?yield i(o,t):o.close()})},cancel(){return B(this,void 0,void 0,function*(){t?.return&&(yield t.return()),t=null})}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){return B(this,void 0,void 0,function*(){let c,u=null,f=o.desiredSize||null;for(;!(u=yield a.next(n?f:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=D(u.value))&&(f!=null&&n&&(f=f-c.byteLength+1),u.value=c),o.enqueue(u.value),f!=null&&--f<=0)return;o.close()})}}var S0=p(()=>{Bt();$e();Wn()});function F0(r){return new Tp(r)}var Tp,E0,B0,O0=p(()=>{Bt();oc();Tp=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=e,i=Uy(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Nr(i),this._getSize=s!=="bytes"?E0:B0;let{["highWaterMark"]:o=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:a=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:s!=="bytes"?E0:B0}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},E0=r=>{var e;return(e=r?.length)!==null&&e!==void 0?e:0},B0=r=>{var e;return(e=r?.byteLength)!==null&&e!==void 0?e:0}});function vf(r,e){let t=new mr,n=null,s=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield t.close()})},start(a){return B(this,void 0,void 0,function*(){yield o(a,n||(n=yield i()))})},pull(a){return B(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:s};function i(){return B(this,void 0,void 0,function*(){return yield(yield Lt.from(t)).open(e)})}function o(a,c){return B(this,void 0,void 0,function*(){let u=a.desiredSize,f=null;for(;!(f=yield c.next()).done;)if(a.enqueue(f.value),u!=null&&--u<=0)return;a.close()})}}var M0=p(()=>{Bt();bs();lc()});function If(r,e){let t=new this(r),n=new kt(t),s=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return B(this,void 0,void 0,function*(){yield i(o)})},start(o){return B(this,void 0,void 0,function*(){yield i(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:s};function i(o){return B(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}var R0=p(()=>{Bt();bs()});function pc(r){let e=Lt.from(r);return $t(e)?e.then(t=>pc(t)):e.isAsync()?e.readAll().then(t=>new be(t)):new be(e.readAll())}function Lf(r,e="stream",t=null){let n={compressionType:t};return(e==="stream"?Mn:Rn).writeAll(r,n).toUint8Array(!0)}var D0=p(()=>{ki();Wn();lc();Af()});var _p={};Q(_p,{isArrowData:()=>Ff,isArrowDataType:()=>Bf,isArrowField:()=>Ef,isArrowRecordBatch:()=>Mf,isArrowSchema:()=>Sf,isArrowTable:()=>Rf,isArrowVector:()=>Of});function Sf(r){return J.isSchema(r)}function Ef(r){return F.isField(r)}function Bf(r){return L.isDataType(r)}function Ff(r){return k.isData(r)}function Of(r){return E.isVector(r)}function Mf(r){return le.isRecordBatch(r)}function Rf(r){return be.isTable(r)}var Ap=p(()=>{dt();ye();hr();ft();Sn();ki()});var N0,vp=p(()=>{gu();ho();Fe();hr();ye();ki();ft();Dt();dt();Ja();Cu();ve();oc();Dh();Kh();Nh();kh();Ch();jh();Uh();zh();Jh();Xh();Gh();Ph();Qh();ep();Zh();sf();af();of();Wh();$h();Vh();qh();Hh();Yh();bs();lc();Af();D0();gf();bf();ms();Sn();Ap();yu();Eh();ci();Xa();$e();Lo();Ga();tf();Ap();fc();N0=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Yd),Sh),hh),Qd),gd),dh),Kd),Rh),_p),{compareSchemas:Ni,compareFields:n0,compareTypes:ff})});var Dn={};Q(Dn,{AsyncByteQueue:()=>mr,AsyncByteStream:()=>kt,AsyncMessageReader:()=>ji,AsyncRecordBatchFileReader:()=>Co,AsyncRecordBatchStreamReader:()=>En,Binary:()=>Ot,BinaryBuilder:()=>Tn,BinaryView:()=>Y,BinaryViewBuilder:()=>vn,Bool:()=>at,BoolBuilder:()=>hi,BufferType:()=>te,Builder:()=>xe,ByteStream:()=>br,CompressionType:()=>Ye,Data:()=>k,DataType:()=>L,DateBuilder:()=>Xr,DateDay:()=>Zn,DateDayBuilder:()=>ys,DateMillisecond:()=>es,DateMillisecondBuilder:()=>ws,DateUnit:()=>ge,Date_:()=>Tt,Decimal:()=>Mt,DecimalBuilder:()=>xs,DenseUnion:()=>mn,DenseUnionBuilder:()=>Ri,Dictionary:()=>Ue,DictionaryBuilder:()=>pi,Duration:()=>_t,DurationBuilder:()=>gr,DurationMicrosecond:()=>qa,DurationMicrosecondBuilder:()=>Ss,DurationMillisecond:()=>$a,DurationMillisecondBuilder:()=>Ls,DurationNanosecond:()=>Ka,DurationNanosecondBuilder:()=>Es,DurationSecond:()=>Wa,DurationSecondBuilder:()=>Is,Field:()=>F,FixedSizeBinary:()=>Rt,FixedSizeBinaryBuilder:()=>Ts,FixedSizeList:()=>Se,FixedSizeListBuilder:()=>mi,Float:()=>it,Float16:()=>Br,Float16Builder:()=>bi,Float32:()=>wt,Float32Builder:()=>gi,Float64:()=>Qt,Float64Builder:()=>yi,FloatBuilder:()=>Jr,Int:()=>Ee,Int16:()=>Ht,Int16Builder:()=>xi,Int32:()=>ke,Int32Builder:()=>Ti,Int64:()=>Xt,Int64Builder:()=>_i,Int8:()=>Kt,Int8Builder:()=>wi,IntBuilder:()=>vt,Interval:()=>ct,IntervalBuilder:()=>kr,IntervalDayTime:()=>cs,IntervalDayTimeBuilder:()=>_s,IntervalMonthDayNano:()=>za,IntervalMonthDayNanoBuilder:()=>vs,IntervalUnit:()=>ie,IntervalYearMonth:()=>us,IntervalYearMonthBuilder:()=>As,JSONMessageReader:()=>Vi,LargeBinary:()=>Fr,LargeBinaryBuilder:()=>_n,LargeList:()=>Zt,LargeListBuilder:()=>Ei,LargeUtf8:()=>Or,LargeUtf8Builder:()=>js,List:()=>Ve,ListBuilder:()=>Si,MapBuilder:()=>Bi,MapRow:()=>dr,Map_:()=>ut,Message:()=>pt,MessageHeader:()=>ne,MessageReader:()=>Vs,MetadataVersion:()=>me,Null:()=>De,NullBuilder:()=>Fi,Precision:()=>ue,RecordBatch:()=>le,RecordBatchFileReader:()=>Bn,RecordBatchFileWriter:()=>Rn,RecordBatchJSONWriter:()=>hc,RecordBatchReader:()=>Lt,RecordBatchStreamReader:()=>Cr,RecordBatchStreamWriter:()=>Mn,RecordBatchWriter:()=>Qr,Schema:()=>J,SparseUnion:()=>fs,SparseUnionBuilder:()=>Mi,Struct:()=>he,StructBuilder:()=>Oi,StructRow:()=>qr,Table:()=>be,Time:()=>Qe,TimeBuilder:()=>wr,TimeMicrosecond:()=>ns,TimeMicrosecondBuilder:()=>Ns,TimeMillisecond:()=>rs,TimeMillisecondBuilder:()=>Ds,TimeNanosecond:()=>ss,TimeNanosecondBuilder:()=>ks,TimeSecond:()=>ts,TimeSecondBuilder:()=>Rs,TimeUnit:()=>S,Timestamp:()=>Ze,TimestampBuilder:()=>yr,TimestampMicrosecond:()=>os,TimestampMicrosecondBuilder:()=>Os,TimestampMillisecond:()=>$r,TimestampMillisecondBuilder:()=>Fs,TimestampNanosecond:()=>as,TimestampNanosecondBuilder:()=>Ms,TimestampSecond:()=>is,TimestampSecondBuilder:()=>Bs,Type:()=>y,Uint16:()=>Yt,Uint16Builder:()=>vi,Uint32:()=>yt,Uint32Builder:()=>Ii,Uint64:()=>Er,Uint64Builder:()=>Li,Uint8:()=>Jt,Uint8Builder:()=>Ai,Union:()=>At,UnionBuilder:()=>An,UnionMode:()=>de,Utf8:()=>ot,Utf8Builder:()=>Cs,Utf8View:()=>xt,Utf8ViewBuilder:()=>Di,Vector:()=>E,Visitor:()=>R,builderThroughAsyncIterable:()=>ip,builderThroughIterable:()=>df,compressionRegistry:()=>Us,isArrowData:()=>Ff,isArrowDataType:()=>Bf,isArrowField:()=>Ef,isArrowRecordBatch:()=>Mf,isArrowSchema:()=>Sf,isArrowTable:()=>Rf,isArrowVector:()=>Of,makeBuilder:()=>Nr,makeData:()=>M,makeTable:()=>op,makeVector:()=>Hr,tableFromArrays:()=>ap,tableFromIPC:()=>pc,tableFromJSON:()=>sp,tableToIPC:()=>Lf,util:()=>N0,vectorFromArray:()=>Do});var Gs=p(()=>{La();ve();lc();Af();S0();O0();M0();R0();vp();vp();Xe.toDOMStream=L0;xe.throughDOM=F0;Lt.throughDOM=vf;Bn.throughDOM=vf;Cr.throughDOM=vf;Qr.throughDOM=If;Rn.throughDOM=If;Mn.throughDOM=If});function Uo(r){return{fields:r.fields.map(e=>Ui(e)),metadata:U0(r.metadata)}}function V0(r,e){return new J(r.fields.map(t=>Zr(t,e)),Df(r.metadata))}function U0(r){return Object.fromEntries(r)}function Df(r){return r?new Map(Object.entries(r)):new Map}function Ui(r){return{name:r.name,type:Nf(r.type),nullable:r.nullable,metadata:U0(r.metadata)}}function Zr(r,e){return new F(r.name,Go(r.type,e),r.nullable,Df(r.metadata))}function Nf(r){if(k0(r,"BinaryView"))return"binary-view";if(k0(r,"Utf8View"))return"utf8-view";if(HB(r,"LargeList"))return{type:"large-list",children:[Ui(r.valueField)]};switch(r.constructor){case De:return"null";case Ot:return"binary";case Rt:return{type:"fixed-size-binary",byteWidth:r.byteWidth};case at:return"bool";case Ee:let e=r;return`${e.isSigned?"":"u"}int${e.bitWidth}`;case Kt:return"int8";case Ht:return"int16";case ke:return"int32";case Xt:return"int64";case Jt:return"uint8";case Yt:return"uint16";case yt:return"uint32";case Er:return"uint64";case it:switch(r.precision){case ue.HALF:return"float16";case ue.SINGLE:return"float32";case ue.DOUBLE:return"float64";default:return"float16"}case Br:return"float16";case wt:return"float32";case Qt:return"float64";case ot:return"utf8";case Mt:let n=r;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case Tt:return r.unit===ge.DAY?"date-day":"date-millisecond";case Zn:return"date-day";case es:return"date-millisecond";case Qe:switch(r.unit){case S.SECOND:return"time-second";case S.MILLISECOND:return"time-millisecond";case S.MICROSECOND:return"time-microsecond";case S.NANOSECOND:return"time-nanosecond";default:return"time-second"}case rs:return"time-millisecond";case ts:return"time-second";case ns:return"time-microsecond";case ss:return"time-nanosecond";case Ze:switch(r.unit){case S.SECOND:return"timestamp-second";case S.MILLISECOND:return"timestamp-millisecond";case S.MICROSECOND:return"timestamp-microsecond";case S.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case is:return"timestamp-second";case $r:return"timestamp-millisecond";case os:return"timestamp-microsecond";case as:return"timestamp-nanosecond";case ct:switch(r.unit){case ie.DAY_TIME:return"interval-daytime";case ie.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case cs:return"interval-daytime";case us:return"interval-yearmonth";case ut:let c=r;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(b=>Ui(b))};case Ve:let f=r.valueField;return{type:"list",children:[Ui(f)]};case Se:let l=r;return{type:"fixed-size-list",listSize:l.listSize,children:[Ui(l.children[0])]};case he:return{type:"struct",children:r.children.map(b=>Ui(b))};case fs:case mn:let h=r;return{type:h instanceof mn?"dense-union":"sparse-union",typeIds:h.typeIds,children:h.children.map(b=>Ui(b)),typeIdToChildIndex:{...h.typeIdToChildIndex}};case Ue:let m=r;return{type:"dictionary",id:m.id,indices:XB(m.indices),dictionary:Nf(m.dictionary),isOrdered:m.isOrdered};default:throw new Error(`arrow type not supported: ${r.constructor.name}`)}}function Go(r,e){if(typeof r=="object")switch(r.type){case"decimal":return new Mt(r.scale,r.precision,r.bitWidth);case"map":{let t=r.children.map(n=>Zr(n,e));return new ut(t[0],r.keysSorted)}case"list":{let t=Zr(r.children[0],e);return new Ve(t)}case"large-list":{let t=Zr(r.children[0],e),n=mc("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(t)}case"fixed-size-list":{let t=Zr(r.children[0],e);return new Se(r.listSize,t)}case"fixed-size-binary":return new Rt(r.byteWidth);case"struct":{let t=r.children.map(n=>Zr(n,e));return new he(t)}case"sparse-union":case"dense-union":{let t=r.children.map(n=>Zr(n,e));return r.type==="dense-union"?new mn(r.typeIds,t):new fs(r.typeIds,t)}case"dictionary":return new Ue(Go(r.dictionary,e),YB(r.indices),r.id,r.isOrdered);default:throw new Error("array type not supported")}switch(r){case"null":return new De;case"binary":return C0("BinaryView",new Ot,e);case"binary-view":return j0("BinaryView");case"bool":return new at;case"int8":return new Kt;case"int16":return new Ht;case"int32":return new ke;case"int64":return new Xt;case"uint8":return new Jt;case"uint16":return new Yt;case"uint32":return new yt;case"uint64":return new Er;case"float16":return new Br;case"float32":return new wt;case"float64":return new Qt;case"utf8":return C0("Utf8View",new ot,e);case"utf8-view":return j0("Utf8View");case"date-day":return new Zn;case"date-millisecond":return new es;case"time-second":return new ts;case"time-millisecond":return new rs;case"time-microsecond":return new ns;case"time-nanosecond":return new ss;case"timestamp-second":return new is;case"timestamp-millisecond":return new $r;case"timestamp-microsecond":return new os;case"timestamp-nanosecond":return new as;case"interval-daytime":return new cs;case"interval-yearmonth":return new us;default:throw new Error("array type not supported")}}function mc(r){return Dn[r]}function k0(r,e){let t=mc(e);if(t&&r instanceof t)return!0;let n=L;return!!(e==="BinaryView"?n.isBinaryView:n.isUtf8View)?.(r)}function HB(r,e){let t=mc(e);return!!(t&&r instanceof t)}function C0(r,e,t){let n=t?.viewTypes||"never";if(n==="never")return e;let s=mc(r);if(s)return new s;if(n==="require")throw new Error(`${r} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return e}function j0(r){let e=mc(r);if(!e)throw new Error(`${r} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new e}function XB(r){if(r instanceof Ee){let t=`${r.isSigned?"int":"uint"}${r.bitWidth}`;if(JB(t))return t}switch(r.constructor){case Kt:return"int8";case Ht:return"int16";case ke:return"int32";case Jt:return"uint8";case Yt:return"uint16";case yt:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${r.constructor.name}`)}}function JB(r){return["int8","int16","int32","uint8","uint16","uint32"].includes(r)}function YB(r){switch(r){case"int8":return new Kt;case"int16":return new Ht;case"int32":return new ke;case"uint8":return new Jt;case"uint16":return new Yt;case"uint32":return new yt;default:throw new Error(`schema dictionary index type not supported: ${r}`)}}var bc=p(()=>{"use strict";Gs()});function G0(r,e={}){let t={...e,copies:new WeakMap};return QB(r)?tF(r,t):ZB(r)?P0(r,t):eF(r)?z0(r,t):Cf(r,t)}function QB(r){return"batches"in r}function ZB(r){return"schema"in r&&"data"in r&&!Array.isArray(r.data)}function eF(r){return"data"in r&&Array.isArray(r.data)}function tF(r,e){let t=r.batches.map(n=>P0(n,e));return new be(r.schema,t)}function P0(r,e){return new le(r.schema,Cf(r.data,e))}function Cf(r,e){let t=r.children.map(i=>Cf(i,e)),n=r.dictionary?z0(r.dictionary,e):void 0,s={[te.OFFSET]:kf(r.buffers[te.OFFSET],e),[te.DATA]:kf(r.buffers[te.DATA],e),[te.VALIDITY]:kf(r.buffers[te.VALIDITY],e),[te.TYPE]:kf(r.buffers[te.TYPE],e)};return new k(r.type,r.offset,r.length,r._nullCount,s,t,n)}function z0(r,e){return new E(r.data.map(t=>Cf(t,e)))}function kf(r,e){if(!rF(r)||e.copy==="none"||e.copy!=="all"&&r.byteOffset===0&&r.byteLength===r.buffer.byteLength)return r;let t=e.copies.get(r);return t||(t=r.slice(),e.copies.set(r,t)),t}function rF(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Ip=p(()=>{"use strict";Gs()});function W0(r,e){let t=G0(r,e);return{shape:"arrow-table",transport:"arrow-js",schema:Uo(t.schema),batches:t.batches.map(n=>nF(n))}}function $0(r){let e=V0(r.schema),t=r.batches.map(n=>new le(e,Ep(n.data)));return new be(e,t)}function Gi(r){if(!q0(r))throw new Error("Workers require Arrow table output");let{data:e,...t}=r;return{...structuredClone(t),data:W0(e,{copy:"all"})}}function Lp(r){if(!K0(r))throw new Error("Workers require Arrow column transport");return{...r,data:$0(r.data)}}function jf(r,e){if(!q0(r))return r;let t=e,n=t?.core?.workerTransferBufferCopy??t?.workerTransferBufferCopy;return{...r,data:W0(r.data,n?{copy:n}:void 0)}}function Vf(r){return K0(r)?{...r,data:$0(r.data)}:r}function q0(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function K0(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&e.data.transport==="arrow-js"&&Array.isArray(e.data.batches))}function nF(r){return{data:Sp(r.data)}}function Sp(r){return{type:Nf(r.type),offset:r.offset,length:r.length,nullCount:r._nullCount,buffers:{[te.OFFSET]:r.buffers[te.OFFSET],[te.DATA]:r.buffers[te.DATA],[te.VALIDITY]:r.buffers[te.VALIDITY],[te.TYPE]:r.buffers[te.TYPE]},children:r.children.map(e=>Sp(e)),dictionary:r.dictionary?sF(r.dictionary):void 0}}function sF(r){return{data:r.data.map(e=>Sp(e))}}function Ep(r){let e=r.children.map(n=>Ep(n)),t=r.dictionary?iF(r.dictionary):void 0;return new k(Go(r.type),r.offset,r.length,r.nullCount,r.buffers,e,t)}function iF(r){return new E(r.data.map(e=>Ep(e)))}var H0=p(()=>{"use strict";Gs();bc();Ip()});var Po=p(()=>{"use strict";H0();Ip()});async function gc(r,e,t,n){return n._parse(r,e,t,n)}var X0=p(()=>{"use strict"});function ir(r,e){if(!r)throw new Error(e||"loader assertion failed.")}var Bp=p(()=>{"use strict"});var en,oF,aF,cF,uF,Nn,J0,fF,Fp=p(()=>{"use strict";en={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},oF=en.self||en.window||en.global||{},aF=en.window||en.self||en.global||{},cF=en.global||en.self||en.window||{},uF=en.document||{},Nn=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),J0=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),fF=J0&&parseFloat(J0[1])||0});var Y0,Q0=p(()=>{"use strict";Y0=r=>typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer});function Pi(r,e){return new Promise((t,n)=>{let s=!1;function i(a){s||(s=!0,n(a))}function o(a){if(!s){s=!0;try{t(e(a))}catch(c){n(c)}}}try{r(o,i)?.then(o,i)}catch(a){i(a)}})}var Z0=p(()=>{"use strict"});function Op(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Mp(r){return globalThis.loaders?.modules?.[r]||null}var Rp=p(()=>{"use strict"});function lF(){let r="5.0.0-beta.2";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=r,r}var eT,tT=p(()=>{"use strict";eT=lF()});function rT(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var nT=p(()=>{"use strict"});var tn,mW,bW,gW,yW,xr,zi,wW,sT,xW,Dp=p(()=>{"use strict";tn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},mW=tn.self||tn.window||tn.global||{},bW=tn.window||tn.self||tn.global||{},gW=tn.global||tn.self||tn.window||{},yW=tn.document||{},xr=typeof process!="object"||String(process)!=="[object process]"||process.browser,zi=typeof importScripts=="function",wW=typeof window<"u"&&typeof window.orientation<"u",sT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),xW=sT&&parseFloat(sT[1])||0});var Uf,Np=p(()=>{Uf="latest"});function dF(){return typeof __VERSION__>"u"?Uf:__VERSION__}var kp,iT=p(()=>{Np();kp=dF()});function Wi(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var Gf=p(()=>{});var rn,LW,SW,EW,BW,Ct,aT,oT,FW,zo=p(()=>{rn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},LW=rn.self||rn.window||rn.global||{},SW=rn.window||rn.self||rn.global||{},EW=rn.global||rn.self||rn.window||{},BW=rn.document||{},Ct=typeof process!="object"||String(process)!=="[object process]"||process.browser,aT=typeof window<"u"&&typeof window.orientation<"u",oT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),FW=oT&&parseFloat(oT[1])||0});function cT(r){let e=new Error(r);return e.name="AbortError",e}var yc,uT=p(()=>{yc=class{constructor(e,t){this.isRunning=!0,this.isCancelled=!1,this.failed=!1,this.postMessageMs=0,this.complete=()=>{},this.processStarted=!1,this._resolve=()=>{},this._reject=()=>{},this.name=e,this.workerThread=t,this.completion=new Promise(n=>{this.complete=n}),this.result=new Promise((n,s)=>{this._resolve=n,this._reject=s})}postMessage(e,t,n){if(!this.isRunning||this.isCancelled)return;let s=performance.now();(e==="process"||e==="process-in-batches"||e==="preload")&&(this.processStarted=!0);try{this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t},n)}finally{this.postMessageMs+=performance.now()-s}}done(e){this.isRunning&&(this.isRunning=!1,this.executionMs=e?.executionMs,clearTimeout(this.cancellationTimer),this.complete(),this.isCancelled||this._resolve(e))}error(e){this.isRunning&&(this.isRunning=!1,this.failed=!0,this.sharedState?.snapshot.cancelled&&(this.isCancelled=!0),clearTimeout(this.cancellationTimer),this.complete(),this._reject(e))}cancel(e,t=1e3){if(!this.isRunning||this.isCancelled)return;if(!Number.isFinite(t)||t<0){this.abort(new RangeError("cancellationTimeout must be finite and nonnegative"));return}this.isCancelled=!0,this.sharedState?.cancel();let n=arguments.length?e:cT(`Worker job "${this.name}" was cancelled`);if(!this.processStarted){this.error(n);return}this._reject(n);try{this.workerThread.postMessage({source:"loaders.gl",type:"cancel",payload:{}},[]),this.cancellationTimer=setTimeout(()=>this.abort(e),t)}catch(s){this.abort(s)}}abort(e){this.isRunning&&(this.isCancelled=!0,this.sharedState?.cancel(),this.workerThread.destroy(),this.error(arguments.length?e:cT(`Worker job "${this.name}" was aborted`)))}}});var Wo,fT=p(()=>{Wo=class{constructor(...e){let n=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(n)return new n(...e)}terminate(){}}});function lT(r){if(Wi(r.source&&!r.url||!r.source&&r.url),r.url&&r.workerType==="module")return r.url;let e=Cp.get(r.source||r.url);return e||(r.url&&(e=hF(r.url),Cp.set(r.url,e)),r.source&&(e=dT(r.source),Cp.set(r.source,e))),Wi(e),e}function hF(r){if(!r.startsWith("http"))return r;let e=pF(r);return dT(e)}function dT(r){let e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function pF(r){return`try {
|
|
32
|
+
importScripts('${r}');
|
|
33
33
|
} catch (error) {
|
|
34
34
|
console.error(error);
|
|
35
35
|
throw error;
|
|
36
|
-
}`}var Ap,UT=p(()=>{"use strict";hc();Ap=new Map});function vp(t,e=!0,r){let n=r||new Set;if(t){if(PT(t))n.add(t);else if(PT(t.buffer))n.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(let s in t)vp(t[s],e,n)}}return r===void 0?Array.from(n):[]}function PT(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}function Rf(t){if(t===null)return{};let e=Object.assign({},t);return Object.keys(e).forEach(r=>{typeof t[r]=="object"&&!ArrayBuffer.isView(t[r])&&!(t[r]instanceof Array)?e[r]=Rf(t[r]):typeof e[r]=="function"||e[r]instanceof RegExp?e[r]={}:e[r]=t[r]}),e}var Ip=p(()=>{"use strict"});var Lp,Gs,Sp=p(()=>{"use strict";kT();ji();hc();UT();Ip();Lp=()=>{},Gs=class{name;source;url;getUrl;loadWorker;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Me||typeof ko<"u"&&!Me}constructor(e){let{name:r,source:n,url:s,getUrl:i,loadWorker:o}=e;Rn(n||s||i||o),this.name=r,this.source=n,this.url=s,this.getUrl=i,this.loadWorker=o,this.onMessage=Lp,this.onError=a=>console.log(a),this.worker=Me?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=Lp,this.onError=Lp,this.worker.terminate(),this.terminated=!0}unref(){!Me&&typeof this.worker.unref=="function"&&this.worker.unref()}ref(){!Me&&typeof this.worker.ref=="function"&&this.worker.ref()}get isRunning(){return!!this.onMessage}postMessage(e,r){r=r||vp(e),this.worker.postMessage(e,r)}_getErrorFromErrorEvent(e){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url||"built-in worker factory"}. `,e.message&&(r+=`${e.message} in `),e.lineno&&(r+=`:${e.lineno}:${e.colno}`),new Error(r)}_createBrowserWorker(){if(this.loadWorker)try{let n=this.loadWorker();if(n)return this._initializeBrowserWorker(n)}catch(n){if(!this.source&&!this.url&&!this.getUrl)throw n}let e=this.url||this.getUrl?.();this._loadableURL=GT({source:this.source,url:e});let r=new Worker(this._loadableURL,{name:this.name});return this._initializeBrowserWorker(r)}_initializeBrowserWorker(e){return e.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},e.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},e.onmessageerror=r=>console.error(r),e}_createNodeWorker(){let e;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`,s=n.startsWith("file:")?new URL(n):n,i=this.url.endsWith(".ts")||this.url.endsWith(".mjs")?"module":"commonjs";e=new ko(s,{eval:!1,type:i})}else if(this.source)e=new ko(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",r=>{this.onMessage(r)}),e.on("error",r=>{this.onError(r)}),e.on("exit",r=>{}),e}}});var bc,jT=p(()=>{"use strict";ji();Sp();CT();bc=class{name="unnamed";source;url;getUrl;loadWorker;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];activeJobs=new Set;count=0;isDestroyed=!1;static isSupported(){return Gs.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.getUrl=e.getUrl,this.loadWorker=e.loadWorker,this.setProps(e)}destroy(e=new Error("Worker pool was destroyed")){this.isDestroyed=!0,this.activeJobs.forEach(n=>n.abort(e)),this.jobQueue.splice(0).forEach(n=>{n.removeAbortListener(),n.onReject(e)}),this.idleQueue.forEach(n=>n.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,r=(i,o,a)=>i.done(a),n=(i,o)=>i.error(o),s){if(s?.aborted)throw s.reason;if(this.isDestroyed)return Promise.reject(new Error("Worker pool was destroyed"));let i=new Promise((o,a)=>{let c=()=>{let f=this.jobQueue.indexOf(u);f>=0&&(this.jobQueue.splice(f,1),u.removeAbortListener(),a(s?.reason))},u={name:e,onMessage:r,onError:n,onStart:o,onReject:a,signal:s,removeAbortListener:()=>s?.removeEventListener("abort",c)};return this.jobQueue.push(u),s?.addEventListener("abort",c,{once:!0}),this});return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;let e;try{e=this._getAvailableWorker()}catch(n){let s=this.jobQueue.shift();s?.removeAbortListener(),s?.onReject(n),this._startQueuedJob();return}if(!e)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:e,backlog:this.jobQueue.length});let n=new mc(r.name,e);r.removeAbortListener();let s=()=>n.abort(r.signal?.reason);r.signal?.addEventListener("abort",s,{once:!0}),r.signal?.aborted&&s(),this.activeJobs.add(n),e.ref(),e.onMessage=i=>{n.isRunning&&r.onMessage(n,i.type,i.payload)},e.onError=i=>r.onError(n,i),r.onStart(n);try{await n.result}catch{}finally{r.signal?.removeEventListener("abort",s),this.activeJobs.delete(n),this.returnWorkerToQueue(e)}}else this.returnWorkerToQueue(e)}returnWorkerToQueue(e){e.terminated||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.terminated||e.destroy(),this.count--):(e.unref(),this.idleQueue.push(e)),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;try{return new Gs({name:e,source:this.source,url:this.url,getUrl:this.getUrl,loadWorker:this.loadWorker})}catch(r){throw this.count--,r}}return null}_getMaxConcurrency(){return NT?this.maxMobileConcurrency:this.maxConcurrency}}});function EB(t){let{name:e,source:r,url:n,urlKey:s,loadWorker:i}=t,o=r?`source:${r}`:"",a=n||s?`url:${n||s}`:"",c=i?`loadWorker:${BB(i)}`:"";return[e,o,a,c].filter(Boolean).join("|")}function BB(t){let e=zT.get(t);return e||(e=SB++,zT.set(t,e)),e}var LB,zT,SB,Vs,Ep=p(()=>{"use strict";jT();Sp();LB={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},zT=new WeakMap,SB=1,Vs=class t{props;workerPools=new Map;static _workerFarm;static isSupported(){return Gs.isSupported()}static getWorkerFarm(e={}){return t._workerFarm=t._workerFarm||new t({}),t._workerFarm.setProps(e),t._workerFarm}constructor(e){this.props={...LB},this.setProps(e),this.workerPools=new Map}destroy(e){for(let r of this.workerPools.values())r.destroy(e);this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(e){let{name:r,source:n,url:s,getUrl:i,loadWorker:o}=e,a=EB(e),c=this.workerPools.get(a);return c||(c=new bc({name:r,source:n,url:s,getUrl:i,loadWorker:o}),c.setProps(this._getWorkerPoolProps()),this.workerPools.set(a,c)),c}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}});var gc,WT=p(()=>{"use strict";gc=class{_values;_settlers;_closed;constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(e){return this.enqueue(e)}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let r=this._settlers.shift();e instanceof Error?r.reject(e):r.resolve({value:e})}else this._values.push(e)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((e,r)=>{this._settlers.push({resolve:e,reject:r})})}}});function qT(t){let e=t.version!==dc?` (worker-utils@${dc})`:"";return`${t.name}@${t.version}${e}`}function Bp(t,e={}){let r=Me?t.workerFile||`${t.id}-worker.js`:t.workerNode||`${t.id}-worker-node.js`,n=KT(t,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(Me)n=`modules/${t.module}/dist/${r}`;else{let i=t.module==="core"&&t.workerNode?.startsWith("worker-utils/")?"worker-utils/workers":"workers",o=t.workerSourceNode||`${i}/${t.id}-worker-node.ts`;n=`modules/${t.module}/src/${o}`}return n||null}function KT(t,e={}){return(e[t.id]||{}).workerUrl||(t.id==="compression"?e.workerUrl:null)||null}function Fp(t,e={}){let r=Bp(t,e),n=typeof t.worker=="string"?t.worker:null,s=r||n||Op(t,!0);return Rn(s),s}function Op(t,e=!1){let r=Me?t.workerFile||`${t.id}-worker.js`:t.workerNode||`${t.id}-worker-node.js`,n=t.version;n==="latest"&&(n=Tp);let s=n?`@${n}`:"",i=`https://unpkg.com/@loaders.gl/${t.module}${s}/dist/${r}`;return e&&FB(t,i),i}function FB(t,e){if(t.version!=="latest")return;let r=`${t.module}:${t.id}`;$T.has(r)||($T.add(r),console.warn(`loaders.gl: ${t.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var $T,HT=p(()=>{"use strict";hc();ji();_p();RT();$T=new Set});function Mp(t,e,r={},n={},s={}){return OB(t,e,r,n,s)}async function*OB(t,e,r,n,s){MB(r.signal);let i=qT(t),a=Vs.getWorkerFarm(r).getWorkerPool(CB(t,r,i)),c=new gc,u=DB(e),f=!1,l=!1,d=!1,h=Promise.resolve(),m=new Error("Worker batch job failed"),b=()=>{!l&&!d&&(d=!0,NB(u))},x=()=>{f||(f=!0,c.close())},g=T=>{f||(f=!0,c.enqueue(m),c.close())},w=await a.startJob(r.jobName||t.name,(T,_,v)=>{switch(_){case"progress":JT(T,r,v);break;case"input-request":h=h.then(async()=>{if(!T.isRunning)return;let I=await u.next();T.isRunning&&(I.done?(l=!0,T.postMessage("input-done",{})):T.postMessage("input-batch",{input:I.value}))}).catch(I=>T.abort(I));break;case"output-batch":c.push(v.result);break;case"done":T.done(v),x();break;case"error":{let I=new Error(v.error||"Worker batch processing failed");T.error(I),g(I);break}case"process":kB(n,r,T,_,v);break;default:{let I=new Error(`Unexpected worker batch message: ${_}`);T.error(I),g(I);break}}},void 0,r.signal).catch(T=>{throw b(),T});w.result.catch(T=>{g(T),b()});try{let{signal:T,onProgress:_,...v}=r;w.isRunning&&w.postMessage("process-in-batches",{options:Rf(v),context:Rf(s)});try{for await(let I of c)yield I,w.isRunning&&w.postMessage("output-ack",{})}catch(I){throw I===m&&await w.result,I}await w.result}finally{w.isRunning&&w.abort(XT("Worker batch iterator was closed")),b()}}function MB(t){if(t?.aborted)throw RB(t)}function RB(t){return t?t.reason:XT("Worker job was aborted")}function XT(t){let e=new Error(t);return e.name="AbortError",e}function DB(t){return Symbol.asyncIterator in t?t[Symbol.asyncIterator]():(async function*(){yield*t})()}function NB(t){try{Promise.resolve(t.return?.()).catch(()=>{})}catch{}}function CB(t,e,r){if(e.source)return{name:r,source:e.source};let n=Bp(t,e);return n?{name:r,url:n}:Me&&t.loadWorker?{name:r,loadWorker:t.loadWorker,getUrl:()=>Fp(t,e),urlKey:Op(t)}:{name:r,url:Fp(t,e)}}async function kB(t,e,r,n,s){switch(n){case"progress":JT(r,e,s);break;case"done":r.done(s);break;case"error":r.error(new Error(s.error));break;case"process":let{id:i,input:o,options:a}=s;try{if(!t.process){r.postMessage("error",{id:i,error:"Worker not set up to process on main thread"});return}let c=await t.process(o,{...a,signal:e.signal,onProgress:e.onProgress},void 0,s.context||{});r.postMessage("done",{id:i,result:c})}catch(c){let u=c instanceof Error?c.message:"unknown error";r.postMessage("error",{id:i,error:u})}break;default:console.warn(`process-on-worker: unknown message ${n}`)}}function JT(t,e,r){if(!(!t.isRunning||!r.progress))try{e.onProgress?.(r.progress)}catch(n){t.abort(n)}}var YT=p(()=>{"use strict";WT();Ep();HT();Ip();ji()});function tn(t={}){let e=t.useLocalLibraries??t.core?.useLocalLibraries,r=GB(t.CDN,t.core?.CDN),n=t.modules;return{...e!==void 0?{useLocalLibraries:e}:{},...r!==void 0?{CDN:r}:{},...n!==void 0?{modules:n}:{}}}function GB(t,e){if(typeof t=="string"||t===null)return t;if(typeof e=="string"||e===null)return e}async function xr(t,e=null,r={},n=null,s=null){let i=t;if(e){let a=n||t,c=r.modules?.[a];if(c!==void 0&&typeof c!="string")return c;t=Dp(t,e,r,n),i=s&&(!(typeof c=="string")||typeof r.modules?.[s]=="string")?Dp(s,e,r,s):t}let o=VB(t,i,pc);return Rp[o]=Rp[o]||UB(t,i),await Rp[o]}function VB(t,e,r){return r?JSON.stringify([t,e]):t}function Dp(t,e,r={},n=null){if(r?.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||t;let s=r.modules||{};if(typeof s[n]=="string")return s[n];if(!r.useLocalLibraries&&t.startsWith("http"))return t;if(!Me)return`modules/${e}/dist/libs/${n}`;if(r.CDN){if(typeof r.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return Rn(r.CDN.startsWith("http")),`${r.CDN}/${e}@${dc}/dist/libs/${n}`}return pc?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${e}/src/libs/${n}`}async function UB(t,e){if(t.endsWith("wasm"))return await zB(t);if(!Me){let{requireFromFile:n}=globalThis.loaders||{};try{let s=await n?.(t);return s||!t.includes("/dist/libs/")?s:await n?.(t.replace("/dist/libs/","/src/libs/"))}catch(s){if(t.includes("/dist/libs/"))try{return await n?.(t.replace("/dist/libs/","/src/libs/"))}catch{}return console.error(s),null}}if(pc)return PB(t,e);let r=await WB(t);return jB(r,t)}async function PB(t,e=t){try{importScripts()}catch{let n=await import(new URL(e,globalThis.location.href).href);return n.default??n}return importScripts(t)}function jB(t,e){let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function zB(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(Me||!e||t.startsWith("http"))return await(await fetch(t)).arrayBuffer();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${t}`)}}async function WB(t){let{readFileAsText:e}=globalThis.loaders||{};if(Me||!e||t.startsWith("http"))return await(await fetch(t)).text();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${t}`)}}var Rp,ZT=p(()=>{"use strict";ji();hc();_p();Rp={}});var Us=p(()=>{"use strict";ji();Ep();YT();ZT()});function Np(t,e){if(!Vs.isSupported())return!1;let r=e?._nodeWorkers??e?.core?._nodeWorkers,n=e?.worker??e?.core?.worker;return!Mn&&!r?!1:!!(t.worker&&n)}var QT=p(()=>{"use strict";Us();gp()});function t0(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?e0(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?e0(t,0,e):""}function e0(t,e,r){if(t.byteLength<=e+r)return"";let n=new DataView(t),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(e+i));return s}var r0=p(()=>{"use strict"});function Cp(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${t0(t)}"`)}}var n0=p(()=>{"use strict";r0()});function kp(...t){return s0(t)}function s0(t){let e=t.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),r=e.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(r),s=0;for(let i of e)n.set(i,s),s+=i.byteLength;return n.buffer}function zi(t,e,r){let n=r!==void 0?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}var Gp=p(()=>{"use strict"});function Te(t,e){return sr(t>=0),sr(e>0),t+(e-1)&~(e-1)}function Wi(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{let s=t.byteOffset,i=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,s,i)}return e.set(n,r),r+Te(n.byteLength,4)}var Vp=p(()=>{"use strict";bp()});function yc(t,e,r,n){let s=Te(r.byteLength,n),i=s-r.byteLength;if(t){let o=new Uint8Array(t.buffer,t.byteOffset+e,r.byteLength),a=new Uint8Array(r);o.set(a);for(let c=0;c<i;++c)t.setUint8(e+r.byteLength+c,32)}return e+=s,e}function Df(t,e,r,n){let i=new TextEncoder().encode(r);return e=yc(t,e,i,n),e}var i0=p(()=>{"use strict";Vp()});function Up(t){let e=new Uint8Array(t),r=[],n=3*4096;for(let s=0;s<e.length;s+=n)r.push(btoa(String.fromCharCode(...e.subarray(s,s+n))));return r.join("")}var o0=p(()=>{"use strict"});async function*Pp(t,e={}){let r=new TextDecoder(void 0,e);for await(let n of t)yield typeof n=="string"?n:r.decode(n,{stream:!0})}async function*jp(t){let e="";for await(let r of t){e+=r;let n;for(n=e.indexOf(`
|
|
36
|
+
}`}var Cp,hT=p(()=>{Gf();Cp=new Map});function Pf(r,e=!0,t){let n=t||new Set,s=new Set;function i(o){if(!(!o||typeof o!="object"||s.has(o))){if(s.add(o),jp(o))n.add(o);else if(ArrayBuffer.isView(o))jp(o.buffer)&&n.add(o.buffer);else if(e&&o instanceof Map)for(let[a,c]of o)i(a),i(c);else if(e&&o instanceof Set)for(let a of o)i(a);else if(e)for(let a of Object.keys(o))i(o[a])}}return i(r),t===void 0?Array.from(n):[]}function jp(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}function Vp(r){let e=new Map;function t(n){if(typeof n=="function"||n instanceof RegExp)return{};if(!n||typeof n!="object")return n;if(e.has(n))return e.get(n);if(ArrayBuffer.isView(n)||n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer||n instanceof Date||typeof WebAssembly<"u"&&n instanceof WebAssembly.Module||jp(n))return n;let s=n instanceof Map?new Map:n instanceof Set?new Set:Array.isArray(n)?[]:{};if(e.set(n,s),n instanceof Map)for(let[i,o]of n)s.set(t(i),t(o));else if(n instanceof Set)for(let i of n)s.add(t(i));else for(let i of Object.keys(n))Object.defineProperty(s,i,{value:t(n[i]),enumerable:!0,writable:!0,configurable:!0});return s}return r===null?{}:t(r)}var Up=p(()=>{});var Gp,nn,zf=p(()=>{fT();zo();Gf();hT();Up();Gp=()=>{},nn=class{static isSupported(){return typeof Worker<"u"&&Ct||typeof Wo<"u"&&!Ct}constructor(e){this.terminated=!1,this.createdAt=performance.now(),this._loadableURL="";let{name:t,source:n,url:s,getUrl:i,loadWorker:o}=e;Wi(n||s||i||o),this.name=t,this.source=n,this.url=s,this.workerType=e.workerType??"classic",this.getUrl=i,this.loadWorker=o,this.onMessage=Gp,this.onError=c=>console.log(c);let a=performance.now();this.worker=Ct?this._createBrowserWorker():this._createNodeWorker(),this.creationTimeMs=performance.now()-a}destroy(){return this.onMessage=Gp,this.onError=Gp,this.terminated?this.termination??Promise.resolve():(this.terminated=!0,this.termination=Promise.resolve(this.worker.terminate()).then(()=>{}),this.termination.catch(()=>{}),this.termination)}unref(){!Ct&&typeof this.worker.unref=="function"&&this.worker.unref()}ref(){!Ct&&typeof this.worker.ref=="function"&&this.worker.ref()}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||Pf(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url||"built-in worker factory"}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){if(this.loadWorker)try{let n=this.loadWorker();if(n)return this._initializeBrowserWorker(n)}catch(n){if(!this.source&&!this.url&&!this.getUrl)throw n}let e=this.url||this.getUrl?.();this._loadableURL=lT({source:this.source,url:e,workerType:this.workerType});let t=new Worker(this._loadableURL,{name:this.name,type:this.workerType});return this._initializeBrowserWorker(t)}_initializeBrowserWorker(e){return e.onmessage=t=>{t.data?t.data.type==="ready"?this.startupTimeMs=performance.now()-this.createdAt:this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{let n=this.onError,s=this._getErrorFromErrorEvent(t);this.destroy(),n(s)},e.onmessageerror=()=>{let t=this.onError;this.destroy(),t(new Error("Worker message could not be deserialized"))},e}_createNodeWorker(){let e;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`,s=n.startsWith("file:")?new URL(n):n,i=this.url.endsWith(".ts")||this.url.endsWith(".mjs")?"module":"commonjs";e=new Wo(s,{eval:!1,type:i})}else if(this.source)e=new Wo(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{t?.type==="ready"?this.startupTimeMs=performance.now()-this.createdAt:this.onMessage(t)}),e.on("error",t=>{this.terminated=!0,this.onError(t)}),this.termination=new Promise(t=>e.on("exit",()=>t())),e.on("exit",t=>{this.terminated||(this.terminated=!0,this.onError(new Error(`Worker ${this.name} exited unexpectedly (code ${t})`)))}),e}}});var wc,pT=p(()=>{zo();zf();uT();wc=class{get stats(){return{...this.totals,queuedJobs:this.jobQueue.length,activeJobs:this.activeJobs.size,queuedBytes:this.queuedBytes+this.reservedBytes,inFlightBytes:this.inFlightBytes,pendingAdmissions:this.admissions.length,reservations:this.reservations.size}}reserve(e,t={}){let{signal:n}=t;return n?.aborted?Promise.reject(n.reason):this.isDestroyed?Promise.reject(new Error("Worker pool was destroyed")):this.isClosing?Promise.reject(new Error("Worker pool is closing")):!Number.isSafeInteger(e)||e<0||e>this.maxQueuedBytes||e>this.maxInFlightBytes?Promise.reject(new RangeError("Reservation exceeds worker byte budgets")):this.maxQueuedJobs<1||this.admissions.length>=this.maxPendingAdmissions?Promise.reject(new RangeError("Worker admission queue is full")):new Promise((s,i)=>{let o=()=>{let c=this.admissions.indexOf(a);c>=0&&this.admissions.splice(c,1),a.cleanup(),i(n?.reason),this._admit()},a={inputBytes:e,resolve:s,reject:i,cleanup:()=>n?.removeEventListener("abort",o)};this.admissions.push(a),n?.addEventListener("abort",o,{once:!0}),this._admit()})}_admit(){for(;!this.isDestroyed&&!this.isClosing&&this.admissions.length;){let e=this.admissions[0];if(e.inputBytes>this.maxQueuedBytes||e.inputBytes>this.maxInFlightBytes){this.admissions.shift(),e.cleanup(),e.reject(new RangeError("Reservation exceeds worker byte budgets"));continue}if(this.jobQueue.length+this.reservations.size>=this.maxQueuedJobs||e.inputBytes>this.maxQueuedBytes-this.queuedBytes-this.reservedBytes)return;this.admissions.shift(),e.cleanup();let t={inputBytes:e.inputBytes,release:()=>{this.reservations.delete(t)&&(this.reservedBytes-=t.inputBytes,this._admit())}};this.reservations.add(t),this.reservedBytes+=t.inputBytes,this.totals.peakQueuedBytes=Math.max(this.totals.peakQueuedBytes,this.queuedBytes+this.reservedBytes),e.resolve(t)}}static isSupported(){return nn.isSupported()}constructor(e){this.name="unnamed",this.maxConcurrency=1,this.maxMobileConcurrency=1,this.onDebug=()=>{},this.reuseWorkers=!0,this.props={},this.jobQueue=[],this.idleQueue=[],this.activeJobs=new Set,this.startingJobs=0,this.count=0,this.workers=new Set,this.queuedBytes=0,this.inFlightBytes=0,this.maxQueuedBytes=1/0,this.maxInFlightBytes=1/0,this.isDestroyed=!1,this.isClosing=!1,this.maxQueuedJobs=1/0,this.maxPendingAdmissions=128,this.priorityAgingMs=1e3,this.reservations=new Set,this.admissions=[],this.reservedBytes=0,this.totals={peakQueuedBytes:0,peakInFlightBytes:0,workersCreated:0,workerRestarts:0,completed:0,failed:0,cancelled:0},this.source=e.source,this.url=e.url,this.workerType=e.workerType,this.getUrl=e.getUrl,this.loadWorker=e.loadWorker,this.setProps(e)}close(e={}){if(this.closing)return this.closing;if(this.isDestroyed)return this.destroy();if(e.timeout!==void 0&&(!Number.isFinite(e.timeout)||e.timeout<0||e.timeout>2147483647))return Promise.reject(new RangeError("Close timeout must be between 0 and 2147483647 ms"));this.isClosing=!0;let t=new Error("Worker pool is closing");this.admissions.splice(0).forEach(o=>{o.cleanup(),o.reject(t)}),this.reservations.clear(),this.reservedBytes=0;let n,s=new Promise(o=>{this.onDrained=o}),i=e.timeout===void 0?s:Promise.race([s,new Promise(o=>{n=setTimeout(o,e.timeout)})]);return this.closing=i.then(async()=>{clearTimeout(n),await this.destroy()}),this._checkDrained(),this.closing}_checkDrained(){this.isClosing&&!this.jobQueue.length&&!this.activeJobs.size&&!this.startingJobs&&this.onDrained?.()}destroy(e=new Error("Worker pool was destroyed")){if(this.destruction)return this.destruction;let t=[...this.workers];this.isDestroyed=!0,this.onDrained?.(),this.activeJobs.forEach(s=>s.abort(e)),this.admissions.splice(0).forEach(s=>{s.cleanup(),s.reject(e)}),this.reservations.clear(),this.reservedBytes=0;let n=this.jobQueue.splice(0);return this.queuedBytes=0,n.forEach(s=>{s.removeAbortListener(),s.onReject(e)}),this.idleQueue.splice(0).forEach(s=>{s.destroy(),this.count--}),this.isDestroyed=!0,this.destruction=Promise.all(t.map(s=>s.destroy())).then(()=>{this.workers.clear()}),this.destruction.catch(()=>{}),this.destruction}setProps(e){for(let t of["maxQueuedBytes","maxInFlightBytes","maxQueuedJobs","maxPendingAdmissions"]){let n=e[t];if(n!==void 0&&(!(n>=0)||n!==1/0&&!Number.isSafeInteger(n)))throw new RangeError(`${t} must be a nonnegative safe integer or Infinity`)}if(e.priorityAgingMs!==void 0&&(!Number.isFinite(e.priorityAgingMs)||e.priorityAgingMs<=0))throw new RangeError("priorityAgingMs must be positive and finite");this.maxQueuedJobs=e.maxQueuedJobs??this.maxQueuedJobs,this.maxPendingAdmissions=e.maxPendingAdmissions??this.maxPendingAdmissions,this.priorityAgingMs=e.priorityAgingMs??this.priorityAgingMs,this.maxQueuedBytes=e.maxQueuedBytes??this.maxQueuedBytes,this.maxInFlightBytes=e.maxInFlightBytes??this.maxInFlightBytes,this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug);for(let t of[...this.jobQueue])t.inputBytes>this.maxInFlightBytes&&(this.jobQueue.splice(this.jobQueue.indexOf(t),1),this.queuedBytes-=t.inputBytes,t.removeAbortListener(),t.onReject(new RangeError("Worker job exceeds maxInFlightBytes")));this._admit(),this._startQueuedJob(),this._checkDrained()}get requiresInputBytes(){return this.maxQueuedBytes!==1/0||this.maxInFlightBytes!==1/0}async startJob(e,t=(o,a,c)=>o.done(c),n=(o,a)=>o.error(a),s,i={}){if(i.cancellationMode!==void 0&&!["terminate","cooperative"].includes(i.cancellationMode))throw new Error("Invalid worker cancellation mode");if(i.cancellationTimeout!==void 0&&(!Number.isFinite(i.cancellationTimeout)||i.cancellationTimeout<0))throw new RangeError("cancellationTimeout must be finite and nonnegative");if(s?.aborted)throw s.reason;if(this.isDestroyed)return Promise.reject(new Error("Worker pool was destroyed"));if(this.isClosing)return Promise.reject(new Error("Worker pool is closing"));let{inputBytes:o=0,priority:a=0}=i;if(!Number.isSafeInteger(o)||o<0||!Number.isFinite(a))throw new RangeError("Invalid worker scheduling inputBytes or priority");if(o>this.maxInFlightBytes)throw new RangeError("Worker job exceeds maxInFlightBytes");let c=i.admission;if(c&&(!this.reservations.has(c)||c.inputBytes!==o))throw new Error("Invalid or consumed worker admission");let u=!this.jobQueue.length&&this.activeJobs.size<this._getMaxConcurrency()&&this.inFlightBytes+o<=this.maxInFlightBytes;if(!c&&!u&&(this.jobQueue.length+this.reservations.size>=this.maxQueuedJobs||o>this.maxQueuedBytes-this.queuedBytes-this.reservedBytes))throw new RangeError("Worker queue exceeds maxQueuedBytes or maxQueuedJobs");c&&(this.reservations.delete(c),this.reservedBytes-=c.inputBytes);let f=new Promise((l,d)=>{let h=()=>{let w=this.jobQueue.indexOf(m);w>=0&&(this.jobQueue.splice(w,1),this.queuedBytes-=m.inputBytes,this._admit(),this._startQueuedJob(),m.removeAbortListener(),d(s?.reason),this._checkDrained())},m={name:e,inputBytes:o,priority:a,queuedAt:performance.now(),sharedState:i.sharedState,cancellationMode:i.cancellationMode,cancellationTimeout:i.cancellationTimeout,onMessage:t,onError:n,onStart:l,onReject:d,signal:s,removeAbortListener:()=>s?.removeEventListener("abort",h)},b=this.jobQueue.findIndex(w=>w.priority<a);return this.jobQueue.splice(b<0?this.jobQueue.length:b,0,m),this.queuedBytes+=o,u||(this.totals.peakQueuedBytes=Math.max(this.totals.peakQueuedBytes,this.queuedBytes+this.reservedBytes)),s?.addEventListener("abort",h,{once:!0}),this});return this._startQueuedJob(),await f}async _startQueuedJob(){if(!this.jobQueue.length)return;let e=performance.now();if(this.jobQueue.sort((s,i)=>i.priority+Math.floor((e-i.queuedAt)/this.priorityAgingMs)-(s.priority+Math.floor((e-s.queuedAt)/this.priorityAgingMs))),this.jobQueue[0].inputBytes>this.maxInFlightBytes-this.inFlightBytes)return;let t;try{t=this._getAvailableWorker()}catch(s){let i=this.jobQueue.shift();i&&(this.queuedBytes-=i.inputBytes),this._admit(),i?.removeAbortListener(),i?.onReject(s),this._startQueuedJob(),this._checkDrained();return}if(!t)return;let n=this.jobQueue.shift();if(n){this.startingJobs++,this.queuedBytes-=n.inputBytes,this.inFlightBytes+=n.inputBytes,this.totals.peakInFlightBytes=Math.max(this.totals.peakInFlightBytes,this.inFlightBytes),this._admit();let s=performance.now();try{this.onDebug({message:"Starting job",name:n.name,workerThread:t,backlog:this.jobQueue.length})}catch{}if(this.isDestroyed||t.terminated){this.startingJobs--,this.inFlightBytes-=n.inputBytes,n.removeAbortListener(),n.onReject(new Error("Worker pool was destroyed before job start")),this.returnWorkerToQueue(t);return}let i=new yc(n.name,t);i.sharedState=n.sharedState,n.removeAbortListener();let o=()=>{n.cancellationMode==="cooperative"?i.cancel(n.signal?.reason,n.cancellationTimeout):i.abort(n.signal?.reason)};n.signal?.addEventListener("abort",o,{once:!0}),n.signal?.aborted&&o(),this.activeJobs.add(i),this.startingJobs--,t.ref(),t.onMessage=a=>{try{i.isRunning&&n.onMessage(i,a.type,a.payload)}catch(c){i.abort(c)}},t.onError=a=>{try{n.onError(i,a)}catch(c){i.abort(c)}},i.result.catch(()=>{}),n.onStart(i),this._startQueuedJob();try{await i.completion}catch{}finally{n.signal?.removeEventListener("abort",o),this.activeJobs.delete(i),this.inFlightBytes-=n.inputBytes;let a=i.isCancelled?"cancelled":i.failed?"failed":"completed";this.totals[a]++;let c={name:i.name,outcome:a,queueWaitMs:s-n.queuedAt,durationMs:performance.now()-s,workerCreationMs:t.creationTimeMs,workerStartupMs:t.startupTimeMs,postMessageMs:i.postMessageMs,executionMs:i.executionMs,inputBytes:n.inputBytes};try{this.props.onMetrics?.(c),this.props.performanceMarks&&typeof performance.measure=="function"&&performance.measure(`math.gl.worker:${i.name}`,{start:n.queuedAt,end:performance.now(),detail:c})}catch{}this._admit(),this.returnWorkerToQueue(t)}}else this.returnWorkerToQueue(t)}returnWorkerToQueue(e){e.terminated||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.terminated&&!this.isDestroyed&&this.totals.workerRestarts++,e.terminated||e.destroy(),e.destroy().then(()=>this.workers.delete(e)),this.count--):(e.unref(),this.idleQueue.push(e)),this.isDestroyed||this._startQueuedJob(),this._checkDrained()}_getAvailableWorker(){for(;this.idleQueue.length>0;){let e=this.idleQueue.shift();if(e&&(e.terminated||this.count>this._getMaxConcurrency()))e.terminated&&this.totals.workerRestarts++,e.destroy().then(()=>this.workers.delete(e)),this.count--;else if(e)return e}if(this.count<this._getMaxConcurrency()){this.count++;let e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;try{let t=new nn({name:e,source:this.source,url:this.url,workerType:this.workerType,getUrl:this.getUrl,loadWorker:this.loadWorker});return this.totals.workersCreated++,this.workers.add(t),t}catch(t){throw this.count--,t}}return null}_getMaxConcurrency(){return aT?this.maxMobileConcurrency:this.maxConcurrency}}});function bF(r){let{name:e,source:t,url:n,urlKey:s,loadWorker:i,workerType:o}=r,a=t?`source:${t}`:"",c=n||s?`url:${n||s}`:"",u=i?`loadWorker:${gF(i)}`:"";return[e,a,c,u,`type:${o||"classic"}`].filter(Boolean).join("|")}function gF(r){let e=bT.get(r);return e||(e=mF++,bT.set(r,e)),e}var mT,bT,mF,sn,Pp=p(()=>{pT();zf();mT={maxQueuedJobs:1/0,maxPendingAdmissions:128,priorityAgingMs:1e3,onMetrics:()=>{},performanceMarks:!1,maxQueuedBytes:1/0,maxInFlightBytes:1/0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},bT=new WeakMap,mF=1,sn=class r{static isSupported(){return nn.isSupported()}static getWorkerFarm(e={}){return r._workerFarm=r._workerFarm||new r({}),r._workerFarm.setProps(e),r._workerFarm}constructor(e){this.workerPools=new Map,this.props={...mT},this.setProps(e),this.workerPools=new Map}destroy(e){let t=[...this.workerPools.values()];return this.workerPools.clear(),Promise.all(t.map(n=>n.destroy(e))).then(()=>{})}setProps(e){let t={};for(let n of Object.keys(mT))e[n]!==void 0&&(t[n]=e[n]);this.props={...this.props,...t};for(let n of this.workerPools.values())n.setProps(this._getWorkerPoolProps())}getWorkerPool(e){let{name:t,source:n,url:s,getUrl:i,loadWorker:o,workerType:a}=e,c=bF(e),u=this.workerPools.get(c);return u||(u=new wc({name:t,source:n,url:s,getUrl:i,loadWorker:o,workerType:a}),u.setProps(this._getWorkerPoolProps()),this.workerPools.set(c,u)),u}_getWorkerPoolProps(){return{maxQueuedJobs:this.props.maxQueuedJobs,maxPendingAdmissions:this.props.maxPendingAdmissions,priorityAgingMs:this.props.priorityAgingMs,onMetrics:this.props.onMetrics,performanceMarks:this.props.performanceMarks,maxQueuedBytes:this.props.maxQueuedBytes,maxInFlightBytes:this.props.maxInFlightBytes,maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}});var xc,gT=p(()=>{xc=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(e){return this.enqueue(e)}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let t=this._settlers.shift();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.push(e)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((e,t)=>{this._settlers.push({resolve:e,reject:t})})}}});function wT(r){let e=r.version!==kp?` (worker-utils@${kp})`:"";return`${r.name}@${r.version}${e}`}function zp(r,e={}){let t=Ct?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=xT(r,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(Ct)n=`modules/${r.module}/dist/${t}`;else{let i=r.module==="core"&&r.workerNode?.startsWith("worker-utils/")?"worker-utils/workers":"workers",o=r.workerSourceNode||`${i}/${r.id}-worker-node.ts`;n=`modules/${r.module}/src/${o}`}return n||null}function xT(r,e={}){return(e[r.id]||{}).workerUrl||(r.id==="compression"?e.workerUrl:null)||null}function Wp(r,e={}){let t=zp(r,e),n=typeof r.worker=="string"?r.worker:null,s=t||n||$p(r,!0);return Wi(s),s}function $p(r,e=!1){let t=Ct?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=r.version;n==="latest"&&(n=Uf);let s=n?`@${n}`:"",o=`https://unpkg.com/${r.packageName||`@loaders.gl/${r.module}`}${s}/dist/${t}`;return e&&yF(r,o),o}function yF(r,e){if(r.version!=="latest")return;let t=`${r.module}:${r.id}`;yT.has(t)||(yT.add(t),console.warn(`loaders.gl: ${r.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var yT,TT=p(()=>{Gf();zo();iT();Np();yT=new Set});function _T(){let r=typeof globalThis.crossOriginIsolated=="boolean"?globalThis.crossOriginIsolated:void 0,e={workers:nn.isSupported(),sharedMemory:!1,crossOriginIsolated:r};if(Ct&&r!==!0)e.sharedMemoryUnavailableReason="cross-origin-isolation";else if(typeof SharedArrayBuffer>"u"||typeof Atomics>"u"||typeof structuredClone!="function")e.sharedMemoryUnavailableReason="unsupported";else try{let t=new SharedArrayBuffer(4),n=structuredClone(t);Atomics.store(new Int32Array(t),0,17),e.sharedMemory=Atomics.load(new Int32Array(n),0)===17,e.sharedMemory||(e.sharedMemoryUnavailableReason="blocked")}catch{e.sharedMemoryUnavailableReason="blocked"}return e}function wF(){if(!_T().sharedMemory)return null;let r=new $o(new SharedArrayBuffer(16));return r.setProgress(0),r}function AT(r){if(r.sharedState===void 0&&r.cancellationMode==="cooperative"){let e=wF();return e?{...r,sharedState:e.buffer}:r}if(r.sharedState){if(!_T().sharedMemory)throw new Error("Shared worker memory is unavailable");new $o(r.sharedState).throwIfCancelled()}return r}var $o,vT=p(()=>{zf();zo();$o=class{constructor(e){if(typeof SharedArrayBuffer>"u"||!(e instanceof SharedArrayBuffer)||e.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=e,this.values=new Int32Array(e)}get snapshot(){return{cancelled:Atomics.load(this.values,0)!==0,completed:Atomics.load(this.values,1),total:Atomics.load(this.values,2),revision:Atomics.load(this.values,3)}}cancel(){Atomics.store(this.values,0,1),Atomics.add(this.values,3,1),Atomics.notify(this.values,0)}throwIfCancelled(){if(Atomics.load(this.values,0)!==0){let e=new Error("Shared worker task was cancelled");throw e.name="AbortError",e}}setProgress(e,t=-1){if(!Number.isInteger(e)||e<0||e>2147483647||!Number.isInteger(t)||t<-1||t>2147483647)throw new RangeError("Shared progress requires nonnegative int32 counts (or total -1)");Atomics.store(this.values,1,e),Atomics.store(this.values,2,t),Atomics.add(this.values,3,1)}}});function qp(r){let e=new Set,t=0;function n(s){if(!(!s||typeof s!="object"||e.has(s)))if(e.add(s),ArrayBuffer.isView(s))n(s.buffer);else if(s instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&s instanceof SharedArrayBuffer)t+=s.byteLength;else if(s instanceof Map)for(let[i,o]of s)n(i),n(o);else if(s instanceof Set)for(let i of s)n(i);else for(let i of Object.keys(s))n(s[i])}return n(r),t}var IT=p(()=>{});function Tc(r,e,t={},n={},s={}){if(t.inputOwnership!==void 0&&!["copy","transfer","share"].includes(t.inputOwnership))throw new Error("Invalid worker input ownership");return xF(r,e,t,n,s)}async function*xF(r,e,t,n,s){t=AT(t),TF(t.signal);let i=wT(r),o=t.workerPool??sn.getWorkerFarm(t).getWorkerPool(IF(r,t,i));LT(t,[Kp(t),s]);let a=qp([SF(t),s]),c=t.inputBytes??a;if(o.requiresInputBytes&&t.inputBytes===void 0)throw new Error("Byte-bounded batch sessions require inputBytes");if(!Number.isSafeInteger(c)||c<a)throw new RangeError("Batch inputBytes must cover options and context buffers");let u=new xc,f=AF(e),l=!1,d=!1,h=!1,m=Promise.resolve(),b=new Error("Worker batch job failed"),w=()=>{!d&&!h&&(h=!0,vF(f))},g=()=>{l||(l=!0,u.close())},x=_=>{l||(l=!0,u.enqueue(b),u.close())},T=await o.startJob(t.jobName||r.name,(_,v,I)=>{if(!(_.isCancelled&&v!=="done"&&v!=="error"))switch(v){case"progress":ET(_,t,I);break;case"input-request":m=m.then(async()=>{if(!_.isRunning)return;let N=await f.next();if(_.isRunning)if(N.done)d=!0,_.postMessage("input-done",{});else{if(LT(t,N.value),t.inputBytes!==void 0&&qp(N.value)+a>c)throw new RangeError("Worker batch exceeds reserved inputBytes");_.postMessage("input-batch",{input:N.value},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0)}}).catch(N=>{_.isCancelled||_.abort(N)});break;case"output-batch":u.push(I.result);break;case"done":_.done(I),g();break;case"error":{let N=new Error(I.error||"Worker batch processing failed");N.name=I.errorName||"Error",_.error(N),x(N);break}case"process":LF(n,t,_,v,I);break;default:{let N=new Error(`Unexpected worker batch message: ${v}`);_.error(N),x(N);break}}},void 0,t.signal,{inputBytes:c,priority:t.priority,admission:t.admission,sharedState:t.sharedState?new $o(t.sharedState):void 0,cancellationMode:t.cancellationMode,cancellationTimeout:t.cancellationTimeout}).catch(_=>{throw w(),_});T.result.catch(_=>{x(_),w()});try{let _=Kp(t);T.isRunning&&T.postMessage("process-in-batches",{options:Vp(_),context:Vp(s)},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0);try{for await(let v of u)yield v,T.isRunning&&T.postMessage("output-ack",{})}catch(v){throw v===b&&await T.result,v}await T.result}finally{T.isRunning&&!T.isCancelled&&T.abort(ST("Worker batch iterator was closed")),w()}}function TF(r){if(r?.aborted)throw _F(r)}function _F(r){return r?r.reason:ST("Worker job was aborted")}function ST(r){let e=new Error(r);return e.name="AbortError",e}function AF(r){return Symbol.asyncIterator in r?r[Symbol.asyncIterator]():(async function*(){yield*r})()}function vF(r){try{Promise.resolve(r.return?.()).catch(()=>{})}catch{}}function IF(r,e,t){if(e.source)return{name:t,source:e.source,workerType:e.workerType};let n=zp(r,e);return n?{name:t,url:n,workerType:e.workerType}:Ct&&r.loadWorker?{name:t,workerType:e.workerType,loadWorker:r.loadWorker,getUrl:()=>Wp(r,e),urlKey:$p(r)}:{name:t,url:Wp(r,e),workerType:e.workerType}}async function LF(r,e,t,n,s){if(!(t.isCancelled&&n!=="done"&&n!=="error"))switch(n){case"progress":ET(t,e,s);break;case"done":t.done(s);break;case"error":let i=new Error(s.error);i.name=s.errorName||"Error",t.error(i);break;case"process":let{id:o,input:a,options:c}=s;try{if(!r.process){t.postMessage("error",{id:o,error:"Worker not set up to process on main thread"});return}let u=await r.process(a,{...c,signal:e.signal,onProgress:e.onProgress},void 0,s.context||{});t.postMessage("done",{id:o,result:u})}catch(u){let f=u instanceof Error?u.message:"unknown error";t.postMessage("error",{id:o,error:f})}break;default:console.warn(`process-on-worker: unknown message ${n}`)}}function ET(r,e,t){if(!(!r.isRunning||r.isCancelled||!t.progress))try{e.onProgress?.(t.progress)}catch(n){r.abort(n)}}function Kp(r){let{signal:e,onProgress:t,onMetrics:n,workerPool:s,admission:i,workerType:o,...a}=r;return a}function LT(r,e){if(r.inputOwnership==="share"&&Pf(e).length)throw new Error("Share ownership requires SharedArrayBuffer storage; ordinary transferables are not allowed")}function SF(r){let{sharedState:e,...t}=Kp(r);return t}var BT=p(()=>{gT();Pp();TT();Up();vT();zo();IT()});var EF,Hp,p$,DT=p(()=>{Pp();BT();EF={},Hp=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",p$=Hp?`file://${Hp.startsWith("/")?"":"/"}${encodeURI(Hp).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:EF.url});var Xp=p(()=>{DT()});var NT=p(()=>{"use strict";Xp()});var kT=p(()=>{"use strict";Xp()});function on(r={}){let e=r.useLocalLibraries??r.core?.useLocalLibraries,t=BF(r.CDN,r.core?.CDN),n=r.modules;return{...e!==void 0?{useLocalLibraries:e}:{},...t!==void 0?{CDN:t}:{},...n!==void 0?{modules:n}:{}}}function BF(r,e){if(typeof r=="string"||r===null)return r;if(typeof e=="string"||e===null)return e}async function qo(r,e=null,t={},n=null,s=null){let i=r;if(e){let a=n||r,c=t.modules?.[a];if(c!==void 0&&typeof c!="string")return c;r=Yp(r,e,t,n),i=s&&(!(typeof c=="string")||typeof t.modules?.[s]=="string")?Yp(s,e,t,s):r}let o=FF(r,i,zi);return Jp[o]=Jp[o]||OF(r,i),await Jp[o]}function FF(r,e,t){return t?JSON.stringify([r,e]):r}function Yp(r,e,t={},n=null){if(t?.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||r;let s=t.modules||{};if(typeof s[n]=="string")return s[n];if(!t.useLocalLibraries&&r.startsWith("http"))return r;if(!xr)return`modules/${e}/dist/libs/${n}`;if(t.CDN){if(typeof t.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return rT(t.CDN.startsWith("http")),`${t.CDN}/${e}@${eT}/dist/libs/${n}`}return zi?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${e}/src/libs/${n}`}async function OF(r,e){if(r.endsWith("wasm"))return await DF(r);if(!xr){let{requireFromFile:n}=globalThis.loaders||{};try{let s=await n?.(r);return s||!r.includes("/dist/libs/")?s:await n?.(r.replace("/dist/libs/","/src/libs/"))}catch(s){if(r.includes("/dist/libs/"))try{return await n?.(r.replace("/dist/libs/","/src/libs/"))}catch{}return console.error(s),null}}if(zi)return MF(r,e);let t=await NF(r);return RF(t,r)}async function MF(r,e=r){try{importScripts()}catch{let n=await import(new URL(e,globalThis.location.href).href);return n.default??n}return importScripts(r)}function RF(r,e){let t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(r))}catch{t.text=r}return document.body.appendChild(t),null}async function DF(r){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(xr||!e||r.startsWith("http"))return await(await fetch(r)).arrayBuffer();try{return await e(r)}catch{if(r.includes("/dist/libs/"))return await e(r.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${r}`)}}async function NF(r){let{readFileAsText:e}=globalThis.loaders||{};if(xr||!e||r.startsWith("http"))return await(await fetch(r)).text();try{return await e(r)}catch{if(r.includes("/dist/libs/"))return await e(r.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${r}`)}}var Jp,CT=p(()=>{"use strict";Dp();nT();tT();Jp={}});var Ps=p(()=>{"use strict";Dp();NT();kT();CT()});function Qp(r,e){if(!sn.isSupported())return!1;let t=e?._nodeWorkers??e?.core?._nodeWorkers,n=e?.worker??e?.core?.worker;return!Nn&&!t?!1:!!(r.worker&&n)}var jT=p(()=>{"use strict";Ps();Fp()});function UT(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?VT(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?VT(r,0,e):""}function VT(r,e,t){if(r.byteLength<=e+t)return"";let n=new DataView(r),s="";for(let i=0;i<t;i++)s+=String.fromCharCode(n.getUint8(e+i));return s}var GT=p(()=>{"use strict"});function Zp(r){try{return JSON.parse(r)}catch{throw new Error(`Failed to parse JSON from data starting with "${UT(r)}"`)}}var PT=p(()=>{"use strict";GT()});function em(...r){return zT(r)}function zT(r){let e=r.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),t=e.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(t),s=0;for(let i of e)n.set(i,s),s+=i.byteLength;return n.buffer}function $i(r,e,t){let n=t!==void 0?new Uint8Array(r).subarray(e,e+t):new Uint8Array(r).subarray(e);return new Uint8Array(n).buffer}var tm=p(()=>{"use strict"});function Te(r,e){return ir(r>=0),ir(e>0),r+(e-1)&~(e-1)}function qi(r,e,t){let n;if(r instanceof ArrayBuffer)n=new Uint8Array(r);else{let s=r.byteOffset,i=r.byteLength;n=new Uint8Array(r.buffer||r.arrayBuffer,s,i)}return e.set(n,t),t+Te(n.byteLength,4)}var rm=p(()=>{"use strict";Bp()});function _c(r,e,t,n){let s=Te(t.byteLength,n),i=s-t.byteLength;if(r){let o=new Uint8Array(r.buffer,r.byteOffset+e,t.byteLength),a=new Uint8Array(t);o.set(a);for(let c=0;c<i;++c)r.setUint8(e+t.byteLength+c,32)}return e+=s,e}function Wf(r,e,t,n){let i=new TextEncoder().encode(t);return e=_c(r,e,i,n),e}var WT=p(()=>{"use strict";rm()});function nm(r){let e=new Uint8Array(r),t=[],n=3*4096;for(let s=0;s<e.length;s+=n)t.push(btoa(String.fromCharCode(...e.subarray(s,s+n))));return t.join("")}var $T=p(()=>{"use strict"});async function*sm(r,e={}){let t=new TextDecoder(void 0,e);for await(let n of r)yield typeof n=="string"?n:t.decode(n,{stream:!0})}async function*im(r){let e="";for await(let t of r){e+=t;let n;for(n=e.indexOf(`
|
|
37
37
|
`);n>=0;){let s=e.slice(0,n+1);e=e.slice(n+1),yield s,n=e.indexOf(`
|
|
38
|
-
`)}}e.length>0&&(yield e)}var a0=p(()=>{"use strict"});async function zp(t){let e=[];for await(let r of t)e.push($B(r));return kp(...e)}function $B(t){if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)){let{buffer:e,byteOffset:r,byteLength:n}=t;return c0(e,r,n)}return c0(t)}function c0(t,e=0,r=t.byteLength-e){let n=new Uint8Array(t,e,r),s=new Uint8Array(n.length);return s.set(n),s.buffer}var u0=p(()=>{"use strict";Gp()});function $i(t){if(t instanceof ArrayBuffer)return t;if(ET(t))return Wp(t);let{buffer:e,byteOffset:r,byteLength:n}=t;return e instanceof ArrayBuffer&&r===0&&n===e.byteLength?e:Wp(e,r,n)}function Wp(t,e=0,r=t.byteLength-e){let n=new Uint8Array(t,e,r),s=new Uint8Array(n.length);return s.set(n),s.buffer}var f0=p(()=>{"use strict";BT()});function $p(t){return{...t,batchType:"data",length:t.data.numRows}}var l0=p(()=>{"use strict"});var CW,kW,GW,VW,d0=p(()=>{CW=Math.PI/2,kW=Math.PI/4,GW=Math.PI/6,VW=Math.PI*2});function h0(t,{precision:e=rt.precision}={}){return t=HB(t),`${parseFloat(t.toPrecision(e))}`}function Go(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function qp(t,e,r){let n=rt.EPSILON;r&&(rt.EPSILON=r);try{if(t===e)return!0;if(Go(t)&&Go(e)){if(t.length!==e.length)return!1;for(let s=0;s<t.length;++s)if(!qp(t[s],e[s]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=rt.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{rt.EPSILON=n}}function HB(t){return Math.round(t/rt.EPSILON)*rt.EPSILON}var UW,PW,KB,rt,xc=p(()=>{UW=1/Math.PI*180,PW=1/180*Math.PI,KB={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...KB}};rt=globalThis.mathgl.config});var Ps,Nf=p(()=>{xc();Ps=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Go(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toString(){return this.formatString(rt)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+h0(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!qp(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let s=0;s<this.ELEMENTS;++s){let i=e[s],o=typeof r=="number"?r:r[s];this[s]=i+n*(o-i)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(rt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}}});function XB(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function Ge(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function Vo(t,e,r=""){if(rt.debug&&!XB(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}var qi=p(()=>{xc()});var Uo,Kp=p(()=>{Nf();qi();xc();Uo=class extends Ps{toString(){let e="[";if(rt.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${this[r]}`}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=Ge(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(e,r){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}}});function Hp(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var p0=p(()=>{});var Cf,m0=p(()=>{Nf();qi();p0();Cf=class extends Ps{get x(){return this[0]}set x(e){this[0]=Ge(e)}get y(){return this[1]}set y(e){this[1]=Ge(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-e[n];r+=s*s}return Ge(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return Ge(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Hp(e>=0&&e<this.ELEMENTS,"index is out of range"),Ge(this[e])}setComponent(e,r){return Hp(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e[n]*r;return this.check()}}});var kf,r5,b0=p(()=>{kf=typeof Float32Array<"u"?Float32Array:Array,r5=Math.PI/180});function g0(t,e,r){let n=e[0],s=e[1];return t[0]=r[0]*n+r[3]*s+r[6],t[1]=r[1]*n+r[4]*s+r[7],t}function y0(t,e,r){let n=e[0],s=e[1];return t[0]=r[0]*n+r[4]*s+r[12],t[1]=r[1]*n+r[5]*s+r[13],t}var Gf=p(()=>{});function x0(t,e,r){let n=e[0],s=e[1],i=r[3]*n+r[7]*s||1;return t[0]=(r[0]*n+r[4]*s)/i,t[1]=(r[1]*n+r[5]*s)/i,t}function Vf(t,e,r){let n=e[0],s=e[1],i=e[2],o=r[3]*n+r[7]*s+r[11]*i||1;return t[0]=(r[0]*n+r[4]*s+r[8]*i)/o,t[1]=(r[1]*n+r[5]*s+r[9]*i)/o,t[2]=(r[2]*n+r[6]*s+r[10]*i)/o,t}function w0(t,e,r){let n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s,t[1]=r[1]*n+r[3]*s,t[2]=e[2],t}function T0(t,e,r){let n=e[0],s=e[1],i=e[2];return t[0]=r[0]*n+r[3]*s+r[6]*i,t[1]=r[1]*n+r[4]*s+r[7]*i,t[2]=r[2]*n+r[5]*s+r[8]*i,t[3]=e[3],t}var Uf=p(()=>{});function _0(){let t=new kf(3);return kf!==Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function YB(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function Xp(t,e,r){let n=new kf(3);return n[0]=t,n[1]=e,n[2]=r,n}function A0(t,e){let r=e[0],n=e[1],s=e[2],i=r*r+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Jp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Po(t,e,r){let n=e[0],s=e[1],i=e[2],o=r[0],a=r[1],c=r[2];return t[0]=s*c-i*a,t[1]=i*o-n*c,t[2]=n*a-s*o,t}function Pf(t,e,r){let n=e[0],s=e[1],i=e[2],o=r[3]*n+r[7]*s+r[11]*i+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*s+r[8]*i+r[12])/o,t[1]=(r[1]*n+r[5]*s+r[9]*i+r[13])/o,t[2]=(r[2]*n+r[6]*s+r[10]*i+r[14])/o,t}function jf(t,e,r){let n=e[0],s=e[1],i=e[2];return t[0]=n*r[0]+s*r[3]+i*r[6],t[1]=n*r[1]+s*r[4]+i*r[7],t[2]=n*r[2]+s*r[5]+i*r[8],t}function v0(t,e,r){let n=r[0],s=r[1],i=r[2],o=r[3],a=e[0],c=e[1],u=e[2],f=s*u-i*c,l=i*a-n*u,d=n*c-s*a,h=s*d-i*l,m=i*f-n*d,b=n*l-s*f,x=o*2;return f*=x,l*=x,d*=x,h*=2,m*=2,b*=2,t[0]=a+f+h,t[1]=c+l+m,t[2]=u+d+b,t}function I0(t,e,r,n){let s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0],i[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),i[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function L0(t,e,r,n){let s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),i[1]=s[1],i[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function S0(t,e,r,n){let s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),i[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),i[2]=s[2],t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function E0(t,e){let r=t[0],n=t[1],s=t[2],i=e[0],o=e[1],a=e[2],c=Math.sqrt((r*r+n*n+s*s)*(i*i+o*o+a*a)),u=c&&Jp(t,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}var B0,jo=p(()=>{b0();B0=YB});var Yp,zf,Tc,F0=p(()=>{m0();xc();qi();jo();Uf();Yp=[0,0,0],Tc=class t extends Cf{static get ZERO(){return zf||(zf=new t(0,0,0),Object.freeze(zf)),zf}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Go(e)?this.copy(e):(rt.debug&&(Ge(e),Ge(r),Ge(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return rt.debug&&(Ge(e.x),Ge(e.y),Ge(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Ge(e)}angle(e){return E0(this,e)}cross(e){return Po(this,this,e),this.check()}rotateX({radians:e,origin:r=Yp}){return I0(this,this,r,e),this.check()}rotateY({radians:e,origin:r=Yp}){return L0(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=Yp}){return S0(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Pf(this,this,e),this.check()}transformAsVector(e){return Vf(this,this,e),this.check()}transformByMatrix3(e){return jf(this,this,e),this.check()}transformByMatrix2(e){return w0(this,this,e),this.check()}transformByQuaternion(e){return v0(this,this,e),this.check()}}});function O0(t,e){if(t===e){let r=e[1],n=e[2],s=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=s}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function M0(t,e){let r=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],l=f*o-a*u,d=-f*i+a*c,h=u*i-o*c,m=r*l+n*d+s*h;return m?(m=1/m,t[0]=l*m,t[1]=(-f*n+s*u)*m,t[2]=(a*n-s*o)*m,t[3]=d*m,t[4]=(f*r-s*c)*m,t[5]=(-a*r+s*i)*m,t[6]=h*m,t[7]=(-u*r+n*c)*m,t[8]=(o*r-n*i)*m,t):null}function R0(t){let e=t[0],r=t[1],n=t[2],s=t[3],i=t[4],o=t[5],a=t[6],c=t[7],u=t[8];return e*(u*i-o*c)+r*(-u*s+o*a)+n*(c*s-i*a)}function Zp(t,e,r){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=r[0],h=r[1],m=r[2],b=r[3],x=r[4],g=r[5],w=r[6],T=r[7],_=r[8];return t[0]=d*n+h*o+m*u,t[1]=d*s+h*a+m*f,t[2]=d*i+h*c+m*l,t[3]=b*n+x*o+g*u,t[4]=b*s+x*a+g*f,t[5]=b*i+x*c+g*l,t[6]=w*n+T*o+_*u,t[7]=w*s+T*a+_*f,t[8]=w*i+T*c+_*l,t}function D0(t,e,r){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=r[0],h=r[1];return t[0]=n,t[1]=s,t[2]=i,t[3]=o,t[4]=a,t[5]=c,t[6]=d*n+h*o+u,t[7]=d*s+h*a+f,t[8]=d*i+h*c+l,t}function N0(t,e,r){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=Math.sin(r),h=Math.cos(r);return t[0]=h*n+d*o,t[1]=h*s+d*a,t[2]=h*i+d*c,t[3]=h*o-d*n,t[4]=h*a-d*s,t[5]=h*c-d*i,t[6]=u,t[7]=f,t[8]=l,t}function Qp(t,e,r){let n=r[0],s=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=s*e[3],t[4]=s*e[4],t[5]=s*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function C0(t,e){let r=e[0],n=e[1],s=e[2],i=e[3],o=r+r,a=n+n,c=s+s,u=r*o,f=n*o,l=n*a,d=s*o,h=s*a,m=s*c,b=i*o,x=i*a,g=i*c;return t[0]=1-l-m,t[3]=f-g,t[6]=d+x,t[1]=f+g,t[4]=1-u-m,t[7]=h-b,t[2]=d-x,t[5]=h+b,t[8]=1-u-l,t}var em=p(()=>{});function eF(){return Wf||(Wf=new Dn([0,0,0,0,0,0,0,0,0]),Object.freeze(Wf)),Wf}function tF(){return $f||($f=new Dn,Object.freeze($f)),$f}var tm,QB,Dn,Wf,$f,k0=p(()=>{Kp();qi();Uf();em();Gf();jo();(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(tm||(tm={}));QB=Object.freeze([1,0,0,0,1,0,0,0,1]),Dn=class extends Uo{static get IDENTITY(){return tF()}static get ZERO(){return eF()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return tm}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(QB)}fromObject(e){return this.check()}fromQuaternion(e){return C0(this,e),this.check()}fromMatrix4(e){return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])}set(e,r,n,s,i,o,a,c,u){return this[0]=e,this[1]=r,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this.check()}setRowMajor(e,r,n,s,i,o,a,c,u){return this[0]=e,this[1]=s,this[2]=a,this[3]=r,this[4]=i,this[5]=c,this[6]=n,this[7]=o,this[8]=u,this.check()}determinant(){return R0(this)}transpose(){return O0(this,this),this.check()}invert(){return M0(this,this),this.check()}multiplyLeft(e){return Zp(this,e,this),this.check()}multiplyRight(e){return Zp(this,this,e),this.check()}rotate(e){return N0(this,this,e),this.check()}scale(e){return Array.isArray(e)?Qp(this,this,e):Qp(this,this,[e,e]),this.check()}translate(e){return D0(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=g0(r||[-0,-0],e,this);break;case 3:n=jf(r||[-0,-0,-0],e,this);break;case 4:n=T0(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Vo(n,e.length),n}},$f=null});function rF(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function G0(t,e){if(t===e){let r=e[1],n=e[2],s=e[3],i=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=s,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function V0(t,e){let r=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],l=e[9],d=e[10],h=e[11],m=e[12],b=e[13],x=e[14],g=e[15],w=r*a-n*o,T=r*c-s*o,_=r*u-i*o,v=n*c-s*a,I=n*u-i*a,Y=s*u-i*c,$=f*b-l*m,re=f*x-d*m,pe=f*g-h*m,Re=l*x-d*b,De=l*g-h*b,ce=d*g-h*x,se=w*ce-T*De+_*Re+v*pe-I*re+Y*$;return se?(se=1/se,t[0]=(a*ce-c*De+u*Re)*se,t[1]=(s*De-n*ce-i*Re)*se,t[2]=(b*Y-x*I+g*v)*se,t[3]=(d*I-l*Y-h*v)*se,t[4]=(c*pe-o*ce-u*re)*se,t[5]=(r*ce-s*pe+i*re)*se,t[6]=(x*_-m*Y-g*T)*se,t[7]=(f*Y-d*_+h*T)*se,t[8]=(o*De-a*pe+u*$)*se,t[9]=(n*pe-r*De-i*$)*se,t[10]=(m*I-b*_+g*w)*se,t[11]=(l*_-f*I-h*w)*se,t[12]=(a*re-o*Re-c*$)*se,t[13]=(r*Re-n*re+s*$)*se,t[14]=(b*T-m*v-x*w)*se,t[15]=(f*v-l*T+d*w)*se,t):null}function U0(t){let e=t[0],r=t[1],n=t[2],s=t[3],i=t[4],o=t[5],a=t[6],c=t[7],u=t[8],f=t[9],l=t[10],d=t[11],h=t[12],m=t[13],b=t[14],x=t[15],g=e*o-r*i,w=e*a-n*i,T=r*a-n*o,_=u*m-f*h,v=u*b-l*h,I=f*b-l*m,Y=e*I-r*v+n*_,$=i*I-o*v+a*_,re=u*T-f*w+l*g,pe=h*T-m*w+b*g;return c*Y-s*$+x*re-d*pe}function rm(t,e,r){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=e[9],h=e[10],m=e[11],b=e[12],x=e[13],g=e[14],w=e[15],T=r[0],_=r[1],v=r[2],I=r[3];return t[0]=T*n+_*a+v*l+I*b,t[1]=T*s+_*c+v*d+I*x,t[2]=T*i+_*u+v*h+I*g,t[3]=T*o+_*f+v*m+I*w,T=r[4],_=r[5],v=r[6],I=r[7],t[4]=T*n+_*a+v*l+I*b,t[5]=T*s+_*c+v*d+I*x,t[6]=T*i+_*u+v*h+I*g,t[7]=T*o+_*f+v*m+I*w,T=r[8],_=r[9],v=r[10],I=r[11],t[8]=T*n+_*a+v*l+I*b,t[9]=T*s+_*c+v*d+I*x,t[10]=T*i+_*u+v*h+I*g,t[11]=T*o+_*f+v*m+I*w,T=r[12],_=r[13],v=r[14],I=r[15],t[12]=T*n+_*a+v*l+I*b,t[13]=T*s+_*c+v*d+I*x,t[14]=T*i+_*u+v*h+I*g,t[15]=T*o+_*f+v*m+I*w,t}function P0(t,e,r){let n=r[0],s=r[1],i=r[2],o,a,c,u,f,l,d,h,m,b,x,g;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*i+e[12],t[13]=e[1]*n+e[5]*s+e[9]*i+e[13],t[14]=e[2]*n+e[6]*s+e[10]*i+e[14],t[15]=e[3]*n+e[7]*s+e[11]*i+e[15]):(o=e[0],a=e[1],c=e[2],u=e[3],f=e[4],l=e[5],d=e[6],h=e[7],m=e[8],b=e[9],x=e[10],g=e[11],t[0]=o,t[1]=a,t[2]=c,t[3]=u,t[4]=f,t[5]=l,t[6]=d,t[7]=h,t[8]=m,t[9]=b,t[10]=x,t[11]=g,t[12]=o*n+f*s+m*i+e[12],t[13]=a*n+l*s+b*i+e[13],t[14]=c*n+d*s+x*i+e[14],t[15]=u*n+h*s+g*i+e[15]),t}function j0(t,e,r){let n=r[0],s=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function z0(t,e,r,n){let s=n[0],i=n[1],o=n[2],a=Math.sqrt(s*s+i*i+o*o),c,u,f,l,d,h,m,b,x,g,w,T,_,v,I,Y,$,re,pe,Re,De,ce,se,xe;return a<1e-6?null:(a=1/a,s*=a,i*=a,o*=a,u=Math.sin(r),c=Math.cos(r),f=1-c,l=e[0],d=e[1],h=e[2],m=e[3],b=e[4],x=e[5],g=e[6],w=e[7],T=e[8],_=e[9],v=e[10],I=e[11],Y=s*s*f+c,$=i*s*f+o*u,re=o*s*f-i*u,pe=s*i*f-o*u,Re=i*i*f+c,De=o*i*f+s*u,ce=s*o*f+i*u,se=i*o*f-s*u,xe=o*o*f+c,t[0]=l*Y+b*$+T*re,t[1]=d*Y+x*$+_*re,t[2]=h*Y+g*$+v*re,t[3]=m*Y+w*$+I*re,t[4]=l*pe+b*Re+T*De,t[5]=d*pe+x*Re+_*De,t[6]=h*pe+g*Re+v*De,t[7]=m*pe+w*Re+I*De,t[8]=l*ce+b*se+T*xe,t[9]=d*ce+x*se+_*xe,t[10]=h*ce+g*se+v*xe,t[11]=m*ce+w*se+I*xe,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function W0(t,e,r){let n=Math.sin(r),s=Math.cos(r),i=e[4],o=e[5],a=e[6],c=e[7],u=e[8],f=e[9],l=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*s+u*n,t[5]=o*s+f*n,t[6]=a*s+l*n,t[7]=c*s+d*n,t[8]=u*s-i*n,t[9]=f*s-o*n,t[10]=l*s-a*n,t[11]=d*s-c*n,t}function $0(t,e,r){let n=Math.sin(r),s=Math.cos(r),i=e[0],o=e[1],a=e[2],c=e[3],u=e[8],f=e[9],l=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*s-u*n,t[1]=o*s-f*n,t[2]=a*s-l*n,t[3]=c*s-d*n,t[8]=i*n+u*s,t[9]=o*n+f*s,t[10]=a*n+l*s,t[11]=c*n+d*s,t}function q0(t,e,r){let n=Math.sin(r),s=Math.cos(r),i=e[0],o=e[1],a=e[2],c=e[3],u=e[4],f=e[5],l=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*s+u*n,t[1]=o*s+f*n,t[2]=a*s+l*n,t[3]=c*s+d*n,t[4]=u*s-i*n,t[5]=f*s-o*n,t[6]=l*s-a*n,t[7]=d*s-c*n,t}function K0(t,e){let r=e[0],n=e[1],s=e[2],i=e[3],o=r+r,a=n+n,c=s+s,u=r*o,f=n*o,l=n*a,d=s*o,h=s*a,m=s*c,b=i*o,x=i*a,g=i*c;return t[0]=1-l-m,t[1]=f+g,t[2]=d-x,t[3]=0,t[4]=f-g,t[5]=1-u-m,t[6]=h+b,t[7]=0,t[8]=d+x,t[9]=h-b,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function H0(t,e,r,n,s,i,o){let a=1/(r-e),c=1/(s-n),u=1/(i-o);return t[0]=i*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(s+n)*c,t[10]=(o+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*u,t[15]=0,t}function nF(t,e,r,n,s){let i=1/Math.tan(e/2);if(t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,s!=null&&s!==1/0){let o=1/(n-s);t[10]=(s+n)*o,t[14]=2*s*n*o}else t[10]=-1,t[14]=-2*n;return t}function sF(t,e,r,n,s,i,o){let a=1/(e-r),c=1/(n-s),u=1/(i-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(s+n)*c,t[14]=(o+i)*u,t[15]=1,t}function Y0(t,e,r,n){let s,i,o,a,c,u,f,l,d,h,m=e[0],b=e[1],x=e[2],g=n[0],w=n[1],T=n[2],_=r[0],v=r[1],I=r[2];return Math.abs(m-_)<1e-6&&Math.abs(b-v)<1e-6&&Math.abs(x-I)<1e-6?rF(t):(l=m-_,d=b-v,h=x-I,s=1/Math.sqrt(l*l+d*d+h*h),l*=s,d*=s,h*=s,i=w*h-T*d,o=T*l-g*h,a=g*d-w*l,s=Math.sqrt(i*i+o*o+a*a),s?(s=1/s,i*=s,o*=s,a*=s):(i=0,o=0,a=0),c=d*a-h*o,u=h*i-l*a,f=l*o-d*i,s=Math.sqrt(c*c+u*u+f*f),s?(s=1/s,c*=s,u*=s,f*=s):(c=0,u=0,f=0),t[0]=i,t[1]=c,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=d,t[7]=0,t[8]=a,t[9]=f,t[10]=h,t[11]=0,t[12]=-(i*m+o*b+a*x),t[13]=-(c*m+u*b+f*x),t[14]=-(l*m+d*b+h*x),t[15]=1,t)}var X0,J0,nm=p(()=>{X0=nF;J0=sF});function Z0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Q0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function e_(t){let e=t[0],r=t[1],n=t[2],s=t[3];return Math.sqrt(e*e+r*r+n*n+s*s)}function t_(t){let e=t[0],r=t[1],n=t[2],s=t[3];return e*e+r*r+n*n+s*s}function r_(t,e){let r=e[0],n=e[1],s=e[2],i=e[3],o=r*r+n*n+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=s*o,t[3]=i*o,t}function n_(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function s_(t,e,r,n){let s=e[0],i=e[1],o=e[2],a=e[3];return t[0]=s+n*(r[0]-s),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function i_(t,e,r){let n=e[0],s=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*s+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*s+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*s+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*s+r[11]*i+r[15]*o,t}var qf=p(()=>{});function uF(){return Kf||(Kf=new js([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Kf)),Kf}function fF(){return Hf||(Hf=new js,Object.freeze(Hf)),Hf}function o_(t){if(t>Math.PI*2)throw Error("expected radians")}function lF(t,e,r,n,s,i){let o=2*i/(r-e),a=2*i/(s-n),c=(r+e)/(r-e),u=(s+n)/(s-n),f=-1,l=-1,d=-2*i;return t[0]=o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=u,t[10]=f,t[11]=l,t[12]=0,t[13]=0,t[14]=d,t[15]=0,t}var om,oF,aF,sm,im,cF,js,Kf,Hf,a_=p(()=>{Kp();qi();Uf();nm();Gf();jo();qf();(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(om||(om={}));oF=45*Math.PI/180,aF=1,sm=.1,im=500,cF=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),js=class extends Uo{static get IDENTITY(){return fF()}static get ZERO(){return uF()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return om}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,s,i,o,a,c,u,f,l,d,h,m,b,x){return this[0]=e,this[1]=r,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this[9]=f,this[10]=l,this[11]=d,this[12]=h,this[13]=m,this[14]=b,this[15]=x,this.check()}setRowMajor(e,r,n,s,i,o,a,c,u,f,l,d,h,m,b,x){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=r,this[5]=o,this[6]=f,this[7]=m,this[8]=n,this[9]=a,this[10]=l,this[11]=b,this[12]=s,this[13]=c,this[14]=d,this[15]=x,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(cF)}fromObject(e){return this.check()}fromQuaternion(e){return K0(this,e),this.check()}fromMatrix3(e){return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)}frustum(e){let{left:r,right:n,bottom:s,top:i,near:o=sm,far:a=im}=e;return a===1/0?lF(this,r,n,s,i,o):H0(this,r,n,s,i,o,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:s=[0,1,0]}=e;return Y0(this,r,n,s),this.check()}ortho(e){let{left:r,right:n,bottom:s,top:i,near:o=sm,far:a=im}=e;return J0(this,r,n,s,i,o,a),this.check()}orthographic(e){let{fovy:r=oF,aspect:n=aF,focalDistance:s=1,near:i=sm,far:o=im}=e;o_(r);let a=r/2,c=s*Math.tan(a),u=c*n;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:i,far:o})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:s=.1,far:i=500}=e;return o_(r),X0(this,r,n,s,i),this.check()}determinant(){return U0(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*s,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*s,e[5]=this[5]*i,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*s,e[9]=this[9]*i,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*s,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=this[4]*s,e[4]=this[5]*i,e[5]=this[6]*o,e[6]=this[8]*s,e[7]=this[9]*i,e[8]=this[10]*o,e}transpose(){return G0(this,this),this.check()}invert(){return V0(this,this),this.check()}multiplyLeft(e){return rm(this,e,this),this.check()}multiplyRight(e){return rm(this,this,e),this.check()}rotateX(e){return W0(this,this,e),this.check()}rotateY(e){return $0(this,this,e),this.check()}rotateZ(e){return q0(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return z0(this,this,e,r),this.check()}scale(e){return j0(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return P0(this,this,e),this.check()}transform(e,r){return e.length===4?(r=i_(r||[-0,-0,-0,-0],e,this),Vo(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,s;switch(n){case 2:s=y0(r||[-0,-0],e,this);break;case 3:s=Pf(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Vo(s,e.length),s}transformAsVector(e,r){let n;switch(e.length){case 2:n=x0(r||[-0,-0],e,this);break;case 3:n=Vf(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Vo(n,e.length),n}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}}});function c_(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function am(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function cm(t,e,r){let n=e[0],s=e[1],i=e[2],o=e[3],a=r[0],c=r[1],u=r[2],f=r[3];return t[0]=n*f+o*a+s*u-i*c,t[1]=s*f+o*c+i*a-n*u,t[2]=i*f+o*u+n*c-s*a,t[3]=o*f-n*a-s*c-i*u,t}function u_(t,e,r){r*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*a,t[1]=s*c+i*a,t[2]=i*c-s*a,t[3]=o*c-n*a,t}function f_(t,e,r){r*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c-i*a,t[1]=s*c+o*a,t[2]=i*c+n*a,t[3]=o*c-s*a,t}function l_(t,e,r){r*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*a,t[1]=s*c-n*a,t[2]=i*c+o*a,t[3]=o*c-i*a,t}function d_(t,e){let r=e[0],n=e[1],s=e[2];return t[0]=r,t[1]=n,t[2]=s,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),t}function h_(t,e,r,n){let s=e[0],i=e[1],o=e[2],a=e[3],c=r[0],u=r[1],f=r[2],l=r[3],d,h,m,b,x;return d=s*c+i*u+o*f+a*l,d<0&&(d=-d,c=-c,u=-u,f=-f,l=-l),1-d>1e-6?(h=Math.acos(d),x=Math.sin(h),m=Math.sin((1-n)*h)/x,b=Math.sin(n*h)/x):(m=1-n,b=n),t[0]=m*s+b*c,t[1]=m*i+b*u,t[2]=m*o+b*f,t[3]=m*a+b*l,t}function p_(t,e){let r=e[0],n=e[1],s=e[2],i=e[3],o=r*r+n*n+s*s+i*i,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-s*a,t[3]=i*a,t}function m_(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function b_(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let s=0;e[4]>e[0]&&(s=1),e[8]>e[s*3+s]&&(s=2);let i=(s+1)%3,o=(s+2)%3;n=Math.sqrt(e[s*3+s]-e[i*3+i]-e[o*3+o]+1),t[s]=.5*n,n=.5/n,t[3]=(e[i*3+o]-e[o*3+i])*n,t[i]=(e[i*3+s]+e[s*3+i])*n,t[o]=(e[o*3+s]+e[s*3+o])*n}return t}var g_,y_,x_,w_,T_,__,dF,A_,um=p(()=>{jo();qf();g_=Z0,y_=Q0,x_=n_,w_=s_,T_=e_,__=t_,dF=r_,A_=(function(){let t=_0(),e=Xp(1,0,0),r=Xp(0,1,0);return function(n,s,i){let o=Jp(s,i);return o<-.999999?(Po(t,e,s),B0(t)<1e-6&&Po(t,r,s),A0(t,t),am(n,t,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Po(t,s,i),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+o,dF(n,n))}})()});var _c,v_=p(()=>{Nf();qi();um();_c=class extends Ps{constructor(e=0,r=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,s)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,s){return this[0]=e,this[1]=r,this[2]=n,this[3]=s,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return b_(this,e),this.check()}fromEuler(e){switch(this.identity(),e.order){case"xyz":return this.rotateX(e.x).rotateY(e.y).rotateZ(e.z);case"yxz":return this.rotateY(e.y).rotateX(e.x).rotateZ(e.z);case"zxy":return this.rotateZ(e.z).rotateX(e.x).rotateY(e.y);case"zyx":return this.rotateZ(e.z).rotateY(e.y).rotateX(e.x);case"yzx":return this.rotateY(e.y).rotateZ(e.z).rotateX(e.x);case"xzy":return this.rotateX(e.x).rotateZ(e.z).rotateY(e.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(e,r){return am(this,e,r),this.check()}identity(){return c_(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Ge(e)}get y(){return this[1]}set y(e){this[1]=Ge(e)}get z(){return this[2]}set z(e){this[2]=Ge(e)}get w(){return this[3]}set w(e){this[3]=Ge(e)}len(){return T_(this)}lengthSquared(){return __(this)}dot(e){return x_(this,e)}rotationTo(e,r){return A_(this,e,r),this.check()}add(e){return g_(this,this,e),this.check()}calculateW(){return d_(this,this),this.check()}conjugate(){return m_(this,this),this.check()}invert(){return p_(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(w_(this,e,r,n),this.check())}multiplyRight(e){return cm(this,this,e),this.check()}multiplyLeft(e){return cm(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return u_(this,this,e),this.check()}rotateY(e){return f_(this,this,e),this.check()}rotateZ(e){return l_(this,this,e),this.check()}scale(e){return y_(this,this,e),this.check()}slerp(e,r,n){let s,i,o;return arguments.length===2?(s=this,i=e,o=r):(s=e,i=r,o=n),h_(this,s,i,o),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}});function Xf(){return zo??Uint16Array}var zo,I_=p(()=>{zo=globalThis.Float16Array});var L_=p(()=>{I_()});var S_=p(()=>{L_()});var E_=p(()=>{em()});var B_=p(()=>{nm()});var F_=p(()=>{um()});var O_=p(()=>{Gf()});var M_=p(()=>{jo()});var R_=p(()=>{qf()});var Jf=p(()=>{F0();k0();a_();v_();d0();S_();E_();B_();F_();O_();M_();R_()});var Ve=p(()=>{"use strict";LT();bp();gp();FT();wp();wp();QT();n0();Gp();Vp();i0();o0();a0();u0();f0();l0()});function TF(t,e="float32"){return t instanceof Date?"date-millisecond":typeof t=="number"?e:typeof t=="boolean"?"bool":typeof t=="string"?"utf8":"null"}function Ac(t){let e=fm(t);return e!=="null"?{type:e,nullable:!1}:t.length>0?(e=TF(t[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function fm(t){if(typeof Float16Array<"u"&&t instanceof Float16Array)return"float16";switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var Yf=p(()=>{"use strict"});function rn(t){let e=t?.POSITION;if(!e||!("value"in e)||!e.value.length)return null;let r=1/0,n=1/0,s=1/0,i=-1/0,o=-1/0,a=-1/0,c=e.value,u=c.length;for(let f=0;f<u;f+=3){let l=c[f],d=c[f+1],h=c[f+2];r=l<r?l:r,n=d<n?d:n,s=h<s?h:s,i=l>i?l:i,o=d>o?d:o,a=h>a?h:a}return[[r,n,s],[i,o,a]]}var lm=p(()=>{"use strict"});function dm(t){let e=Xf();return new e(t)}function zs(t){return!!(zo&&t instanceof zo)}function hm(t,e,r){zs(t)?t[e]=r:t[e]=D_(r)}function pm(t,e){return zs(t)?t[e]:_F(t[e])}function vc(t){return zs(t)?new Uint16Array(t.buffer,t.byteOffset,t.length):t}function D_(t){if(!Number.isFinite(t))return t===1/0?31744:t===-1/0?64512:32256;let e=t<0||Object.is(t,-0)?32768:0,r=Math.abs(t);if(r===0)return e;if(r>=65520)return e|31744;if(r>=65504)return e|31743;let n=Math.floor(Math.log2(r));if(n<-14)return e|Math.round(r/2**-24);let s=n+15,i=Math.round((r/2**n-1)*1024);return i===1024?e|s+1<<10:e|s<<10|i}function _F(t){let e=t&32768?-1:1,r=t>>10&31,n=t&1023;return r===0?e*n*2**-24:r===31?n?NaN:e*(1/0):e*(1+n/1024)*2**(r-15)}var N_=p(()=>{"use strict";Jf()});var Zf,mm,C_=p(()=>{"use strict";ks();Zf=new X([new F("POSITION",new Se(3,new F("value",new xt,!1)),!1)]),mm=new X([...Zf.fields,new F("indices",new Ue(new F("item",new yt,!1)),!0)])});var Ic=p(()=>{"use strict";N_();C_()});function k_(t){return t.type instanceof Se?t.type.listSize:1}function bm(t,e,r){let n=AF(t,e,r);return new E([n])}function AF(t,e,r){let n=vF(t,e,r),s=n.children[0].type,i=r==="float16"&&zs(t)?vc(t):t,o={[te.DATA]:i},a=new N(s,0,i.length,0,o);return new N(n,0,i.length/e,0,void 0,[a])}function vF(t,e,r){let n=r||Ac(t).type,s=Co(n);return new Se(e,new F("value",s,!1))}var gm=p(()=>{"use strict";Ic();ks();Yf();uc()});function Ws(t,e){switch(e){case"columnar-table":return IF(t);case"arrow-table":return LF(t);default:throw new Error(e)}}function IF(t){let e={},r=U_(t);for(let[n,s]of Object.entries(t.attributes))e[n]=s.value;return{shape:"columnar-table",schema:t.schema,data:e,topology:t.topology,indices:r?t.indices:void 0}}function LF(t,e){return V_(t.attributes,{schema:t.schema,topology:t.topology,mode:t.mode,boundingBox:t.header?.boundingBox,indices:U_(t)?t.indices:void 0})}function V_(t,e={}){let r=[],n={},s=EF(t);for(let c of s){let u=t[c],{value:f,size:l=1}=u,d=SF(f,l,u.componentType);if(n[c]=d,r.push(BF(e.schema,c,d,u.componentType)),c==="POSITION"&&e.indices?.value?.length){let h=mm.fields.find(m=>m.name==="indices");n.indices=OF(e.indices.value,d.length,h.type),r.push(h)}}let i=new X(r,MF(e)),o=n[s[0]]?.length===0?new be(i):new be(i,n);return{shape:"arrow-table",schema:No(o.schema),data:o,topology:e.topology||"point-list",indices:e.indices}}function SF(t,e,r){if(r==="float16"){let n=zs(t)?vc(t):t;if(e===1){let s=new N(new Er,0,n.length,0,{[te.DATA]:n});return new E([s])}return bm(t,e,r)}return e===1?Kr(t):bm(t,e)}function EF(t){let e=Object.keys(t),r=G_.filter(s=>s in t),n=e.filter(s=>!G_.includes(s));return[...r,...n]}function U_(t){return!!t.indices?.value?.length}function BF(t,e,r,n){if(e==="POSITION"&&FF(r)){let i=Zf.fields[0],o=t?.fields.find(c=>c.name===e);if(!o?.metadata)return i;let a=new Map(i.metadata);for(let[c,u]of Object.entries(o.metadata))a.set(c,u);return new F(i.name,i.type,i.nullable,a)}let s=t?.fields.find(i=>i.name===e);if(n==="float16"){let i=new Map(Object.entries(s?.metadata||{}));return i.set("componentType","float16"),new F(e,r.type,!1,i)}if(s&&s.type.toString()!==r.type.toString()){let i=Zr(s);return new F(e,r.type,i.nullable,i.metadata)}return s?Zr(s):new F(e,r.type,!1)}function FF(t){return t.type instanceof Se&&t.type.listSize===3&&t.type.children[0].type instanceof xt}function OF(t,e,r){let n=r,s=t instanceof Uint32Array?t:Uint32Array.from(t),i=new Int32Array(e+1);e>0&&i.fill(s.length,1);let o=new Uint8Array(Math.ceil(e/8));e>0&&(o[0]=1);let a=new N(n.children[0].type,0,s.length,0,{[te.DATA]:s}),c=new N(n,0,e,Math.max(0,e-1),{[te.OFFSET]:i,[te.VALIDITY]:o},[a]);return new E([c])}function MF(t){let e={...t.schema?.metadata};return t.topology&&(e.topology||=t.topology),Number.isFinite(t.mode)&&(e.mode||=String(t.mode)),t.boundingBox&&(e.boundingBox||=JSON.stringify(t.boundingBox)),Bf(e)}var G_,P_=p(()=>{"use strict";Ic();Ic();ks();gm();uc();G_=["POSITION"]});function nn(t){if(t.shape==="arrow-table")return RF(t);throw new Error(t.shape)}function RF(t){let e=t.data,r=No(e.schema),n=r.fields,s={},i=[];for(let f of n){let{name:l}=f;if(l==="indices")continue;let d=e.getChild(l),h=k_(d),m=GF(d,h),b=NF(f.metadata),x=b.componentType==="float16"?VF(m):m,g=i.find(w=>w.data.length===d.data.length&&s[w.name].value.constructor===x.constructor&&w.data.every((T,_)=>j_(T,d.data[_])));s[l]={value:g?s[g.name].value:x,size:h,...b},g||i.push({name:l,data:d.data})}kF(r);let o=r.metadata.topology,a=UF(r),c=PF(e),u=s.POSITION?.transform?.type==="quantization"?DF(r)||rn(s):rn(s);return{schema:r,attributes:s,topology:o,mode:a,indices:c,header:{vertexCount:e.numRows,boundingBox:u??void 0}}}function DF(t){let e=t.metadata?.boundingBox;if(!e)return null;try{let r=JSON.parse(e);if(Array.isArray(r)&&r.length===2&&r.every(n=>Array.isArray(n)&&n.length===3&&n.every(s=>typeof s=="number")))return r}catch{}return null}function NF(t={}){let e={};if(t.byteOffset!==void 0&&(e.byteOffset=Number(t.byteOffset)),t.byteStride!==void 0&&(e.byteStride=Number(t.byteStride)),t.normalized!==void 0&&(e.normalized=t.normalized==="true"),t.componentType==="float16"&&(e.componentType="float16"),t["loaders.gl.transform"])try{let r=JSON.parse(t["loaders.gl.transform"]);CF(r)&&(e.transform=r)}catch{}return e}function CF(t){if(!t||typeof t!="object"||!("type"in t))return!1;let e=t;return e.type==="octahedron"?Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30:e.type==="quantization"&&Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30&&Array.isArray(e.origin)&&e.origin.every(r=>typeof r=="number")&&typeof e.range=="number"}function kF(t){t.metadata||={},t.metadata.topology||="point-list",t.metadata.mode||="0"}function GF(t,e){if(!(t.type instanceof Se))return t.toArray();let n=t.data[0].children[0].values.constructor,s=new n(t.length*e),i=0;for(let o of t.data){let a=o.children[0],c=o.length*e,u=a.offset||o.offset*e,f=u+c<=a.values.length?u:0,l=a.values.subarray(f,f+c);s.set(l,i),i+=c}return s}function VF(t){let e=dm(t.length);for(let r=0;r<t.length;r++)hm(e,r,pm(t,r));return e}function UF(t){let e=Number(t.metadata?.mode);return Number.isFinite(e)?e:0}function PF(t){let e=t.getChild("indices");if(!e?.isValid(0))return;let r=e.data[0],n=r.valueOffsets,s=n[r.offset],i=n[r.offset+1];return{value:r.children[0].values.subarray(s,i),size:1}}function j_(t,e){let r=Object.values(e.buffers);return t.type.toString()===e.type.toString()&&t.offset===e.offset&&t.length===e.length&&t.nullCount===e.nullCount&&t.dictionary===e.dictionary&&Object.values(t.buffers).every((n,s)=>{let i=r[s];return n===i||!!(n&&i&&n.buffer===i.buffer&&n.byteOffset===i.byteOffset&&n.byteLength===i.byteLength)})&&t.children.length===e.children.length&&t.children.every((n,s)=>j_(n,e.children[s]))}var z_=p(()=>{"use strict";Ic();ks();gm();uc();lm()});function ym(t,e,r){let n=e.componentType||fm(e.value),s=r||Qf(e),i=e.size===1?n:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]};return{name:t,type:i,nullable:!1,metadata:s}}function Qf(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),t.componentType&&(e.componentType=t.componentType),t.transform&&(e["loaders.gl.transform"]=JSON.stringify(t.transform)),e}var W_=p(()=>{"use strict";Yf()});var Nn=p(()=>{"use strict";Yf();lm();P_();z_();W_()});function el(t,e={}){let r={};for(let s in e)s!=="value"&&(r[s]=JSON.stringify(e[s]));let n=[];for(let s in t){let i=t[s],o=jF(s,i);n.push(o)}return{fields:n,metadata:r}}function jF(t,e){let r={};for(let i in e)i!=="value"&&(r[i]=JSON.stringify(e[i]));let{type:n}=Ac(e.value);return e.size===1||e.size===void 0||(n={type:"fixed-size-list",listSize:e.size,children:[{name:"values",type:n}]}),{name:t,type:n,nullable:!1,metadata:r}}var xm=p(()=>{"use strict";Nn()});function q_(t){let e=new _m;t.indexOf(`\r
|
|
39
|
-
`)!==-1&&(
|
|
40
|
-
`)),
|
|
41
|
-
`)!==-1&&(
|
|
42
|
-
`),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let f=0,l=
|
|
43
|
-
`);for(let i of s){if(i=i.trim(),i.length===0||i.charAt(0)==="#")continue;let o=i.indexOf(" "),a=o>=0?i.substring(0,o):i;a=a.toLowerCase();let c=o>=0?i.substring(o+1):"";switch(c=c.trim(),a){case"newmtl":n={name:c},r.push(n);break;case"ka":n.ambientColor=nl(c);break;case"kd":n.diffuseColor=nl(c);break;case"map_kd":n.diffuseTextureUrl=c;break;case"ks":n.specularColor=nl(c);break;case"map_ks":n.specularTextureUrl=c;break;case"ke":n.emissiveColor=nl(c);break;case"map_ke":n.emissiveTextureUrl=c;break;case"ns":n.shininess=parseFloat(c);break;case"map_ns":break;case"ni":n.refraction=parseFloat(c);break;case"illum":n.illumination=parseFloat(c);break;default:break}}return r}function nl(t,e){let r=t.split(sO,3);return[parseFloat(r[0]),parseFloat(r[1]),parseFloat(r[2])]}var sO,e1=p(()=>{"use strict";sO=/\s+/});var Sm={};Z(Sm,{MTLLoaderWithParser:()=>cO,MTLWorkerLoaderWithParser:()=>aO});var Kq,iO,Hq,oO,aO,cO,Em=p(()=>{"use strict";e1();Fm();Fm();({preload:Kq,...iO}=t1),{preload:Hq,...oO}=Bm,aO={...iO},cO={...oO,parse:async(t,e)=>Lm(new TextDecoder().decode(t),e?.mtl),parseTextSync:(t,e)=>Lm(t,e?.mtl)}});async function fO(){let{MTLLoaderWithParser:t}=await Promise.resolve().then(()=>(Em(),Sm));return t}var uO,Bm,t1,Fm=p(()=>{"use strict";Q_();uO="5.0.0-beta.1";Bm={...Z_,dataType:null,batchType:null,version:uO,worker:!0,text:!0,testText:t=>t.includes("newmtl"),options:{mtl:{}},preload:fO},t1=Bm});var sl,Om=p(()=>{"use strict";sl="5.0.0-beta.1"});var r1,n1,Mm=p(()=>{"use strict";r1={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},n1={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]}});function s1(t){return!pO(t,"ftyp",4)||(t[8]&96)===0?null:lO(t)}function lO(t){switch(dO(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function dO(t,e,r){return String.fromCharCode(...t.slice(e,r))}function hO(t){return[...t].map(e=>e.charCodeAt(0))}function pO(t,e,r=0){let n=hO(e);for(let s=0;s<n.length;++s)if(n[s]!==t[s+r])return!1;return!0}var i1=p(()=>{"use strict"});function Cn(t){let e=Sc(t);return bO(e)||xO(e)||gO(e)||yO(e)||mO(e)}function mO(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=s1(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function bO(t){let e=Sc(t);return e.byteLength>=33&&e.getUint32(0,ir)===2303741511&&e.getUint32(4,ir)===218765834&&e.getUint32(8,ir)===13&&e.getUint32(12,ir)===1229472850?{mimeType:"image/png",width:e.getUint32(16,ir),height:e.getUint32(20,ir)}:null}function gO(t){let e=Sc(t);return e.byteLength>=10&&e.getUint32(0,ir)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Lc),height:e.getUint16(8,Lc)}:null}function yO(t){let e=Sc(t);return e.byteLength>=14&&e.getUint16(0,ir)===16973&&e.getUint32(2,Lc)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Lc),height:e.getUint32(22,Lc)}:null}function xO(t){let e=Sc(t);if(!(e.byteLength>=3&&e.getUint16(0,ir)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=wO(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,ir);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,ir),width:e.getUint16(i+7,ir)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,ir)}return null}function wO(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Sc(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}var ir,Lc,il=p(()=>{"use strict";i1();ir=!1,Lc=!0});var TO,_O,AO,o1,a1=p(()=>{"use strict";il();TO=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],_O=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],AO={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:_O,extensions:TO,tests:[t=>!!Cn(new DataView(t))]},o1={...AO,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var c1,u1=p(()=>{"use strict";c1="5.0.0-beta.1"});function Wo(t){if(!t)return!1;if(vO.test(t))return!0;for(let e=t.indexOf(".svg");e>=0;e=t.indexOf(".svg",e+4)){let r=t[e+4];if(r===void 0||r==="?"||r==="#")return!0}return!1}function f1(t,e){if(Wo(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Rm(t,e)}function Rm(t,e){if(Wo(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}var vO,ol=p(()=>{"use strict";vO=/^data:image\/svg\+xml/});async function l1(t,e,r){let n=f1(t,r),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await IO(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function IO(t,e){let r=new Image;return r.src=t,e?.image?.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var d1=p(()=>{"use strict";ol()});async function p1(t,e,r){let n;Wo(r)?n=await l1(t,e,r):n=Rm(t,r);let s=e&&e.imagebitmap;return await b1(n,s)}async function m1(t,e){let r=e&&e.imagebitmap;return await b1(t,r)}async function b1(t,e=null){if((LO(e)||!h1)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),h1=!1}return await createImageBitmap(t)}function LO(t){if(!t)return!0;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var h1,g1=p(()=>{"use strict";ol();d1();h1=!0});async function y1(t,e){let{mimeType:r}=Cn(t)||{},n=globalThis.loaders?.parseImageNode;sr(n);let s=globalThis.loaders?.createImageBitmapNode;if(!s)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let i=await n(t,r);return s(i)}var x1=p(()=>{"use strict";Ve();il()});async function Dm(t,e,r){e=e||{},_1(e);let n=!!globalThis.loaders?.parseImageNode;if(!Mn||n)return await y1(t,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(w1);return await p1(t,e,r?.url)}async function T1(t,e,r){e=e||{},_1(e);let n=!!globalThis.loaders?.parseImageNode;if(!Mn||n||Wo(r?.url)||t.type.startsWith("image/svg+xml"))return await Dm(await t.arrayBuffer(),e,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(w1);return await m1(t,e)}function _1(t){let e=t.image?.type;if(e&&e!=="imagebitmap")throw new Error(SO)}var SO,w1,A1=p(()=>{"use strict";Ve();g1();ol();x1();SO="@loaders.gl/images: ImageBitmapLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",w1="@loaders.gl/images: ImageBitmapLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var v1={};Z(v1,{ImageBitmapLoaderWithParser:()=>BO});var TK,EO,BO,I1=p(()=>{"use strict";A1();Nm();({preload:TK,...EO}=Ec),BO={...EO,parse:Dm,parseBlob:T1}});async function OO(){let{ImageBitmapLoaderWithParser:t}=await Promise.resolve().then(()=>(I1(),v1));return t}var FO,Ec,Nm=p(()=>{"use strict";u1();a1();FO={image:{}};Ec={dataType:null,batchType:null,...o1,version:c1,options:FO,preload:OO}});function S1(t){let e=NO(t);if(!e)throw new Error("Not an image");return e}function Bc(t){switch(S1(t)){case"data":return t;case"imagebitmap":return MO(t)?RO(t):L1(t);case"image":return L1(t);default:throw new Error("getImageData")}}function MO(t){let e=globalThis.loaders?.isImageBitmapNode;return!!e?.(t)}function RO(t){let e=globalThis.loaders?.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(t)}function L1(t){let e=DO(t.width,t.height),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height)}function DO(t,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(t,e);if(typeof document<"u"){let r=document.createElement("canvas");return r.width=t,r.height=e,r}throw new Error("getImageData")}function NO(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var E1=p(()=>{"use strict"});async function km(){return al?await al:(al=kO(),await al)}async function kO(){let t=new Set;for(let e of CO)(Mn?await UO(e):B1(e))&&t.add(e);return t}function Gm(t){if(Cm[t]===void 0){let e=Mn?GO(t):B1(t);Cm[t]=e}return Cm[t]}function B1(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&r.includes(t)}function GO(t){switch(t){case"image/avif":case"image/webp":return PO(t);default:return!0}}async function UO(t){let e=VO[t];return e?await jO(e):!0}function PO(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}async function jO(t){return new Promise(e=>{let r=new Image;r.src=t,r.onload=()=>e(r.height>0),r.onerror=()=>e(!1)})}var CO,al,Cm,VO,Vm=p(()=>{"use strict";Ve();CO=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg","image/svg+xml","image/bmp","image/vnd.microsoft.icon"],al=null;Cm={};VO={"image/avif":"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=","image/webp":"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}});var $s=p(()=>{"use strict";Nm();il();E1();Vm();Vm()});var F1,O1=p(()=>{"use strict";F1="5.0.0-beta.1"});var M1,R1=p(()=>{"use strict";M1={name:"Basis",id:"basis",module:"textures",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]}});function N1(t){if(!cl){t=t||WO()||void 0,cl=new Set;for(let e of zO)for(let r in D1)if(t&&t.getExtension(`${e}${r}`))for(let n of D1[r])cl.add(n)}return cl}function WO(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var zO,D1,cl,C1=p(()=>{"use strict";zO=["","WEBKIT_","MOZ_"],D1={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},cl=null});function G1(t=N1(),e,r={}){let n=new Set(t);if(!e)return qO(n);if(e.isHDR){let s=k1(e);return r.astcHDR&&(s==="astc-4x4"||s==="astc-6x6")&&ul(n,s.slice(5))?s==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return Pm(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let s=k1(e);return s&&ul(n,s.slice(5))?s:Um(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?ul(n,"4x4")?"astc-4x4":Um(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):Um(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function qO(t){return ul(t,"4x4")?"astc-4x4":Pm(t)?"bc7":V1(t)?{alpha:"bc3",noAlpha:"bc1"}:U1(t)?"etc2":t.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:P1(t)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:j1(t)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function Um(t,e,r){for(let n of r)switch(n){case"bc7":if(Pm(t))return"bc7";break;case"bc":if(V1(t))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(U1(t))return"etc2";break;case"etc1":if(!e.hasAlpha&&t.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(P1(t))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(j1(t))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function k1(t){let e=`${t.blockWidth}x${t.blockHeight}`;return $O.includes(e)?`astc-${e}`:null}function ul(t,e){return $o(t,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function Pm(t){return $o(t,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function V1(t){return $o(t,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function U1(t){return $o(t,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function P1(t){return $o(t,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function j1(t){return $o(t,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function $o(t,e){return e.some(r=>t.has(r))}var $O,z1=p(()=>{"use strict";C1();$O=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function q1(t){yp(t.modules);let e=xp("basis");return e||($1||=KO(t),await $1)}async function KO(t){let e=null,r=null;return[e,r]=await Promise.all([await xr(W1.TRANSCODER,"textures",t,null,"basis_transcoder.mjs"),await xr(W1.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await HO(e,r)}function HO(t,e){let r={};return e&&(r.wasmBinary=e),Pi(()=>t(r),n=>{let{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:u}=n;return c(),{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,isFormatSupported:u}})}var W1,$1,K1=p(()=>{"use strict";Ve();Us();W1={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function H1(t){if(t.byteLength<jm.byteLength)return!1;let e=new Uint8Array(t,0,jm.byteLength);return jm.every((r,n)=>e[n]===r)}var jm,X1=p(()=>{"use strict";jm=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10])});async function ZO(t){let e=J1,r;J1=new Promise(n=>{r=n}),await e;try{return await t()}finally{r()}}async function Z1(t,e={}){return await ZO(async()=>{let r=await q1(tn(e)),n=e.basis?.containerFormat||"auto";if(n==="ktx2"||n==="auto"&&H1(t)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return eM(r,t,e)}return QO(r,t,e)})}function QO(t,e,r){let n=new t.BasisFile(new Uint8Array(e));try{let s=eA(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let i=[];for(let o=0;o<n.getNumImages();o++){let a=[];for(let c=0;c<n.getNumLevels(o);c++){let u=n.getImageWidth(o,c),f=n.getImageHeight(o,c);a.push(Q1(n,s,u,f,r,l=>n.getImageTranscodedSizeInBytes(o,c,l),(l,d)=>n.transcodeImage(l,o,c,d,0,0)))}i.push(a)}return i}finally{n.close(),n.delete()}}function eM(t,e,r){let n=new t.KTX2File(new Uint8Array(e));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let i=eA(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let o=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let u=0;u<o;u++)for(let f=0;f<a;f++){let l=[];for(let d=0;d<n.getLevels();d++){let h=n.getImageLevelInfo(d,u,f);l.push(Q1(n,{...i,hasAlpha:!!h.alphaFlag},h.width,h.height,r,m=>n.getImageTranscodedSizeInBytes(d,u,f,m),(m,b)=>n.transcodeImage(m,d,u,f,b,0,-1,-1)))}c.push(l)}return c}finally{n.close(),n.delete()}}function Q1(t,e,r,n,s,i,o){let a=rM(s,e);tM(e,zm(s,e));let c=i(a.basisFormat),u=sM(c,a.dataType);if(!o(u,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${zm(s,e)}`);let f=e.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:r,height:n,data:u,compressed:a.compressed,format:f&&a.srgbFormat||a.format,textureFormat:f?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:e.hasAlpha}}function tM(t,e){let r=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(t.isHDR!==r)throw new Error(`Basis source codec ${t.codec} cannot be transcoded to ${e}`);if(t.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${t.codec} cannot be transcoded to ${e}`)}function rM(t,e){let r=zm(t,e),n=Y1[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function zm(t,e){let r=t.basis?.format||"auto";return r==="auto"&&(r=G1(t.basis?.supportedTextureFormats,e,t.basis?.supportedTextureFeatures)),typeof r=="object"&&(r=e.hasAlpha?r.alpha:r.noAlpha),r.toLowerCase()}function eA(t,e){let r=t.getBasisTexFormat(),n=nM[r];if(!n)throw new Error(`Unsupported Basis source texture format ${r}`);return{codec:n,isHDR:!!t.isHDR(),isSRGB:e?!!t.isSRGB():!1,hasAlpha:!!t.getHasAlpha(),blockWidth:t.getBlockWidth(),blockHeight:t.getBlockHeight()}}function sM(t,e){return e==="uint16"?new Uint16Array(t/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(t/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function nt(t,e,r){return{basisFormat:t,compressed:!0,format:e,textureFormat:r}}function qo(t,e,r,n,s){return{basisFormat:t,compressed:!1,format:e,textureFormat:r,srgbFormat:n,srgbTextureFormat:s}}function Gt(t,e,r,n){return{...nt(t,e,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var kt,Y1,WH,J1,nM,tA=p(()=>{"use strict";Us();z1();K1();X1();kt={"4x4":Gt(10,37808,37840,"4x4"),"5x4":Gt(28,37809,37841,"5x4"),"5x5":Gt(29,37810,37842,"5x5"),"6x5":Gt(30,37811,37843,"6x5"),"6x6":Gt(31,37812,37844,"6x6"),"8x5":Gt(32,37813,37845,"8x5"),"8x6":Gt(33,37814,37846,"8x6"),"8x8":Gt(36,37815,37847,"8x8"),"10x5":Gt(34,37816,37848,"10x5"),"10x6":Gt(35,37817,37849,"10x6"),"10x8":Gt(37,37818,37850,"10x8"),"10x10":Gt(38,37819,37851,"10x10"),"12x10":Gt(39,37820,37852,"12x10"),"12x12":Gt(40,37821,37853,"12x12")},Y1={etc1:nt(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...nt(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...nt(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...nt(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:nt(4,36283,"bc4-r-unorm"),bc5:nt(5,36285,"bc5-rg-unorm"),bc7:{...nt(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":nt(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":nt(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":kt["4x4"],"astc-5x4":kt["5x4"],"astc-5x5":kt["5x5"],"astc-6x5":kt["6x5"],"astc-6x6":kt["6x6"],"astc-8x5":kt["8x5"],"astc-8x6":kt["8x6"],"astc-8x8":kt["8x8"],"astc-10x5":kt["10x5"],"astc-10x6":kt["10x6"],"astc-10x8":kt["10x8"],"astc-10x10":kt["10x10"],"astc-12x10":kt["12x10"],"astc-12x12":kt["12x12"],"atc-rgb":nt(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":nt(12,34798,"atc-rgbai-unorm-webgl"),rgba32:qo(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:qo(14,36194,"rgb565unorm-webgl"),bgr565:qo(15,36194,"rgb565unorm-webgl"),rgba4444:qo(16,32854,"rgba4unorm-webgl"),"eac-r11":nt(20,37488,"eac-r11unorm"),"eac-rg11":nt(21,37490,"eac-rg11unorm"),bc6h:nt(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":nt(23,37808,"astc-4x4-unorm"),rgba16f:{...qo(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...qo(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":nt(27,37812,"astc-6x6-unorm")},WH=Object.freeze(Object.keys(Y1)),J1=Promise.resolve();nM={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var rA={};Z(rA,{BasisLoaderWithParser:()=>cM,BasisWorkerLoaderWithParser:()=>aM});var XH,iM,JH,oM,aM,cM,nA=p(()=>{"use strict";tA();fl();fl();({preload:XH,...iM}=sA),{preload:JH,...oM}=Ko,aM={...iM},cM={...oM,parse:Z1}});async function uM(){let{BasisLoaderWithParser:t}=await Promise.resolve().then(()=>(nA(),rA));return t}var Ko,sA,fl=p(()=>{"use strict";R1();O1();Ko={...M1,dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:F1,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:uM},sA=Ko});var iA=p(()=>{"use strict";fl()});function K(t,e){if(!t)throw new Error(e||"assert failed: gltf")}var Ki=p(()=>{"use strict"});function mM(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function uA(t,e=0,r={}){let n=new DataView(t),{magic:s=oA}=r,i=n.getUint32(e,!1);return i===s||i===oA}function hl(t,e,r=0,n={}){let s=new DataView(e),i=mM(s,r+0),o=s.getUint32(r+4,qs),a=o===3?lA(s,r+8,"GLB byte length"):s.getUint32(r+8,qs);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},jsonChunkIndex:-1,binChunks:[]}),t.version){case 1:return bM(t,s,r+ll);case 2:return gM(t,s,r+ll,n);case 3:return yM(t,s,r+cA,n);default:throw new Error(`Invalid GLB version ${t.version}. Only supports versions 1, 2 and 3.`)}}function bM(t,e,r){sr(t.header.byteLength>ll+dl);let n=t.header.byteOffset+t.header.byteLength;sr(n<=e.byteLength);let s=e.getUint32(r+0,qs),i=e.getUint32(r+4,qs);if(r+=dl,sr(i===dM),r+s>n)throw new Error("GLB JSON content extends beyond the declared file length.");Wm(t,e,r,s,0),r+=s;let o=n-r;return o>0&&$m(t,e,r,o,1),n}function gM(t,e,r,n){return sr(t.header.byteLength>ll+dl),fA(t,e,r,dl,n),t.header.byteOffset+t.header.byteLength}function yM(t,e,r,n){return sr(t.header.byteLength>=cA+aA),fA(t,e,r,aA,n),t.header.byteOffset+t.header.byteLength}function fA(t,e,r,n,s){let i=t.header.byteOffset+t.header.byteLength;sr(i<=e.byteLength);let o=0;for(;r+n<=i;){let a=t.version===3,c=e.getUint32(r+(a?0:4),qs),u=a?e.getUint32(r+4,qs):0,f=a?lA(e,r+8,"GLB chunk length"):e.getUint32(r+0,qs);if(r+=n,u!==0)throw new Error(`Unsupported GLB chunk encoding ${u}.`);if(r+f>i)throw new Error("GLB chunk extends beyond the declared file length.");switch(c){case fM:(t.version!==3||t.jsonChunkIndex===-1)&&Wm(t,e,r,f,o);break;case lM:$m(t,e,r,f,o);break;case hM:s.strict||Wm(t,e,r,f,o);break;case pM:s.strict||$m(t,e,r,f,o);break;default:break}r+=qm(f),o++}return r}function Wm(t,e,r,n,s){let i=new Uint8Array(e.buffer,r,n),a=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(a),t.jsonChunkIndex=s,qm(n)}function $m(t,e,r,n,s){return t.header.hasBinChunk=!0,t.binChunks.push({chunkIndex:s,byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),qm(n)}function lA(t,e,r){let n=t.getBigUint64(e,qs);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`${r} exceeds JavaScript's safe integer range.`);return Number(n)}function qm(t){return Math.ceil(t/4)*4}var qs,oA,ll,cA,dl,aA,fM,lM,dM,hM,pM,Km=p(()=>{"use strict";Ve();qs=!0,oA=1735152710,ll=12,cA=16,dl=8,aA=16,fM=1313821514,lM=5130562,dM=0,hM=0,pM=1});function kn(t,e,r){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return pl(t);let s=r?.baseUrl||xM(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${t}`);let i=s.endsWith("/")?`${s}${t}`:`${s}/${t}`;return pl(i)}function pl(t){try{return new URL(t).href}catch{return t}}function xM(t){if(!t)return;if(t.endsWith("/"))return t;let e=t.lastIndexOf("/");return e>=0?t.slice(0,e+1):""}var Fc=p(()=>{"use strict"});var ml,Oc,Hm=p(()=>{"use strict";ml={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Oc={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8}});function Ho(t){return dA[t-1]||dA[0]}function Gn(t){let e=TM.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Mc(t,e){let r=vM[t.componentType],n=_M[t.type],s=AM[t.componentType],i=t.count*n,o=t.count*n*s;K(o>=0&&o<=e.byteLength);let a=Oc[t.componentType],c=ml[t.type];return{ArrayType:r,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}var dA,wM,TM,_M,AM,vM,Ks=p(()=>{"use strict";Ki();Hm();dA=["SCALAR","VEC2","VEC3","VEC4"],wM=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],TM=new Map(wM),_M={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},AM={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},vM={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array}});function or(t,e,r){let n=typeof r=="number"?t.bufferViews[r]:r;K(n);let s=n.buffer,i=e[s];K(i),K((n.byteOffset||0)>=0&&n.byteLength>=0),K((n.byteOffset||0)+n.byteLength<=i.byteLength),K(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function hA(t,e,r){let n=t.images[r];return or(t,e,n.bufferView)}function bl(t,e,r){let n=typeof r=="number"?t.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);K(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=Mc(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(K(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=Xm(t,e,n);let u=n.sparse;if(!u)return c;let f=new s(i);new Uint8Array(f.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),K(u.count>=0&&u.count<=n.count),K([5121,5123,5125].includes(u.indices.componentType));let l=Xm(t,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=Xm(t,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(f.buffer),b=o*s.BYTES_PER_ELEMENT,x=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let g=0;g<u.count;g++){let w=Number(l[g]);K(w>h&&w<n.count),m.set(x.subarray(g*b,(g+1)*b),w*b),h=w}return f}function Xm(t,e,r){let n=t.bufferViews?.[r.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];K(s);let{arrayBuffer:i,byteOffset:o}=s;K((n.byteOffset||0)>=0&&n.byteLength>=0),K((n.byteOffset||0)+n.byteLength<=s.byteLength),K(o>=0&&o+s.byteLength<=i.byteLength),K((r.byteOffset||0)>=0);let a=(o||0)+(r.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:f,numberOfComponentsInElement:l}=Mc(r,n),d=f*l,h=r.type.startsWith("MAT")?Number(r.type.slice(3)):1,m=Te(h*f,4),b=h>1?h*m:d,x=n.byteStride??b,g=h>1?(h-1)*m+h*f:d;if(K(x>=b),K((r.byteOffset||0)+(r.count===0?0:(r.count-1)*x+g)<=n.byteLength),r.count===0)return new c(0);if(h>1&&m!==h*f){let _=n.byteStride??h*m,v=(h-1)*m+h*f;K((r.byteOffset||0)+(r.count-1)*_+v<=n.byteLength);let I=new c(u),Y=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let $=0;$<r.count;$++)for(let re=0;re<h;re++){let pe=new Uint8Array(i,a+$*_+re*m,h*f);Y.set(pe,$*d+re*h*f)}return I}let w=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%f!==0){let v=new Uint8Array(i,a,u*f),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<r.count;_++){let v=a+_*w,I;if(v%f!==0){let Y=new Uint8Array(i,v,d),$=new Uint8Array(d);$.set(Y),I=new c($.buffer,0,l)}else I=new c(i,v,l);T.set(I,_*l)}return T}var Hi=p(()=>{"use strict";Ki();Ve();Ks()});function Jm(t,e){let r=t.json.files||[],n=[];for(let s=0;s<r.length;s++){let i=r[s];(i.name===e||i.uri===e)&&n.push(s)}return K(n.length<=1,`glTF package file reference ${e} is ambiguous.`),n[0]??-1}async function gl(t,e,r,n){let s=t.json.files||[],i=typeof e=="number"?e:Jm(t,e);K(Number.isInteger(i)&&i>=0&&i<s.length),t.files=t.files||new Array(s.length).fill(null);let o=t.files[i];if(o)return o;let a=s[i];K(a.mimeType,`glTF file ${i} must define mimeType.`);let c=a.uri!==void 0,u=a.bufferView!==void 0;K(c!==u,`glTF file ${i} must define exactly one of uri or bufferView.`);let f;if(a.uri!==void 0){let l=kn(a.uri,r,n),d=await n.fetch(l);K(d?.ok,`Failed to fetch glTF file ${a.uri}: HTTP ${d?.status}.`);let h=await d.arrayBuffer();f={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength,mimeType:a.mimeType,name:a.name,url:l}}else{let l=or(t.json,t.buffers,a.bufferView);f={arrayBuffer:l.buffer,byteOffset:l.byteOffset,byteLength:l.byteLength,mimeType:a.mimeType,name:a.name}}return t.files[i]=f,f}var pA=p(()=>{"use strict";Hi();Fc();Ki()});function IM(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var sn,Rc=p(()=>{"use strict";$s();Ve();Ki();Ks();Hi();sn=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||IM(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=Te(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let r=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof r=="string"||typeof n=="string"}getExtension(e){let r=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return r?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,r){return(e.extensions||{})[r]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,r){if(typeof r=="object")return r;let n=this.json[e]&&this.json[e][r];if(!n)throw new Error(`glTF file error: Could not find ${e}[${r}]`);return n}getTypedArrayForBufferView(e){return or(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return bl(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let r=this.getBufferView(e.bufferView),s=this.getBuffer(r.buffer).data,i=r.byteOffset||0;return new Uint8Array(s,i,r.byteLength)}addApplicationData(e,r){return this.json[e]=r,this}addExtraData(e,r){return this.json.extras=this.json.extras||{},this.json.extras[e]=r,this}addObjectExtension(e,r,n){return e.extensions=e.extensions||{},e.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(e,r,n){let s=e.extensions||{};s[r]=n}removeObjectExtension(e,r){let n=e?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(r)||s.push(r)}delete n[r]}addExtension(e,r={}){return K(r),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=r,this.registerUsedExtension(e),r}addRequiredExtension(e,r={}){return K(r),this.addExtension(e,r),this.registerRequiredExtension(e),r}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(e)||r.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:r}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(e){let{meshIndex:r,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:r};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:r,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(r),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,r){let n=Cn(e),s=r||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,r=0,n=this.byteLength){let s=e.byteLength;K(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:r,byteOffset:n,byteLength:s};return this.byteLength+=Te(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,r){let n=r.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:Ho(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,r={size:3}){let n=this.addBufferView(e),s={min:r.min,max:r.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,r.size));let i={size:r.size,componentType:Gn(e),count:Math.round(e.length/r.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,r))}addTexture(e){let{imageIndex:r,samplerIndex:n}=e,s={source:r,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],r=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=Te(r,8),r=e[o]+Te(a.byteLength,4))}let n=new ArrayBuffer(r),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=Wi(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&Wi(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];K(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let f=e[u.buffer];K(f!==void 0),u.byteOffset=f+(u.byteOffset||0),u.buffer=0}}}this.byteLength=r,this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,r){let n=!0;for(;n;){let s=e.indexOf(r);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let r={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=Te(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let f=o.length/s.size,l=new Uint8Array(f*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<f;m++)l.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(l);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:Gn(o),count:f})}r[i]=u}return r}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,r){let n={min:null,max:null};if(e.length<r)return n;n.min=[],n.max=[];let s=e.subarray(0,r);for(let i of s)n.min.push(i),n.max.push(i);for(let i=r;i<e.length;i+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}}});function LM(t){switch(t.type){case"accessor":return{get bufferView(){return t.bufferView?.data}};case"animation":return{get channels(){return Xi(t.channels)},get samplers(){return Xi(t.samplers)}};case"animationChannel":return{get sampler(){return t.sampler.data},get target(){return t.target.data}};case"animationChannelTarget":return{get node(){return t.node?.data}};case"animationSampler":return{get input(){return t.input.data},get output(){return t.output.data}};case"bufferView":return{get buffer(){return t.buffer.data}};case"externalAsset":return{get file(){return t.file.data}};case"file":case"image":return{get bufferView(){return t.bufferView?.data}};case"material":return{get baseColorTexture(){return t.baseColorTexture?.data},get metallicRoughnessTexture(){return t.metallicRoughnessTexture?.data},get normalTexture(){return t.normalTexture?.data},get occlusionTexture(){return t.occlusionTexture?.data},get emissiveTexture(){return t.emissiveTexture?.data},get textures(){return Xi(t.textures)}};case"textureInfo":return{get texture(){return t.texture.data}};case"mesh":return{get primitives(){return Xi(t.primitives)}};case"primitive":return{get attributes(){return mA(t.attributes)},get indices(){return t.indices?.data},get material(){return t.material?.data},get targets(){return t.targets.map(mA)}};case"node":return{get camera(){return t.camera?.data},get children(){return Xi(t.children)},get skin(){return t.skin?.data},get mesh(){return t.mesh?.data},get externalAsset(){return t.externalAsset?.data}};case"scene":return{get nodes(){return Xi(t.nodes)}};case"skin":return{get inverseBindMatrices(){return t.inverseBindMatrices?.data},get skeleton(){return t.skeleton?.data},get joints(){return Xi(t.joints)}};case"texture":return{get sampler(){return t.sampler?.data},get source(){return t.source?.data}};default:return{}}}function Ji(t,e){return(function*(){for(let n=0;n<t.length;n++)yield e(t[n],n)})()}function Xi(t){return(function*(){for(let r of t)yield r.data})()}function mA(t){return new Map(Array.from(t,([e,r])=>[e,r.data]))}function SM(t){switch(t){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${t}s`}}function bA(t,e){if(t)for(let r=t.length-1;r>=0;r--)t[r]===e&&t.splice(r,1)}var Ke,Hs,Ym,Zm,Qm,eb,yl,tb,rb,nb,sb,ib,ob,ab,cb,ub,fb,lb,db,hb,pb,mb,ae,He=p(()=>{"use strict";Hi();Ks();Ke=class{gltf;type;index;data;path;iterator;constructor(e,r,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=r,this.index=n,this.data=s,this.path=i}},Hs=class extends Ke{parent;constructor(e,r,n,s,i,o){super(e,r,n,s,i),this.parent=o}},Ym=class extends Ke{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},Zm=class extends Ke{get channels(){return Ji(this.data.channels,(e,r)=>this.iterator.getOrCreateNested(e,()=>new Qm(this.iterator,"animationChannel",r,e,`${this.path}.channels[${r}]`,this)))}get samplers(){return Ji(this.data.samplers,(e,r)=>this.iterator.getOrCreateNested(e,()=>new yl(this.iterator,"animationSampler",r,e,`${this.path}.samplers[${r}]`,this)))}},Qm=class extends Hs{get sampler(){let r=this.parent.data.samplers[this.data.sampler];if(!r)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(r,()=>new yl(this.iterator,"animationSampler",this.data.sampler,r,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new eb(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},eb=class extends Hs{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},yl=class extends Hs{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},tb=class extends Ke{get loadedBuffer(){return this.gltf.buffers[this.index]}},rb=class extends Ke{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let r=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,r,this.data.byteLength)}},nb=class extends Ke{},sb=class extends Ke{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},ib=class extends Ke{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},ob=class extends Ke{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},ab=class extends Ke{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(r=>!!r).values()}getTextureInfo(e,r,n){return e?this.iterator.getOrCreateNested(e,()=>new cb(this.iterator,"textureInfo",r,e,`${this.path}.${n}`,this)):void 0}},cb=class extends Hs{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},ub=class extends Ke{get primitives(){return Ji(this.data.primitives,(e,r)=>this.iterator.getOrCreateNested(e,()=>new fb(this.iterator,"primitive",r,e,`${this.path}.primitives[${r}]`,this)))}},fb=class extends Hs{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,r])=>[e,this.iterator.resolveAccessor(r,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,r)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${r}].${n}`)])))}},lb=class extends Ke{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return Ji(this.data.children||[],(e,r)=>this.iterator.resolveNode(e,`${this.path}.children[${r}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},db=class extends Ke{},hb=class extends Ke{get nodes(){return Ji(this.data.nodes||[],(e,r)=>this.iterator.resolveNode(e,`${this.path}.nodes[${r}]`))}},pb=class extends Ke{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return Ji(this.data.joints,(e,r)=>this.iterator.resolveNode(e,`${this.path}.joints[${r}]`))}},mb=class extends Ke{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},ae=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return or(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return bl(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return hA(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let r=this.getMetadata(e);return this.gltf.buffers[r.index]}getLoadedBufferView(e){let r=this.getReferences(e).buffer,n=this.getLoadedBuffer(r);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:r,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,r,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:r}),this.data.bufferViews.length-1}addAccessor(e,r){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:Ho(r.size),componentType:r.componentType,count:r.count,min:r.min,max:r.max}),this.data.accessors.length-1}getReferences(e){let r=this.referencesCache.get(e);if(r)return r;let n=this.getObjectIterator(e),s=LM(n);return this.referencesCache.set(e,s),s}getMetadata(e){let r=this.getObjectIterator(e),n=r instanceof Hs?r.parent.data:void 0;return{gltf:this.gltf,type:r.type,index:r.index,parent:n,path:r.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,r){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:r;return n.extensions?.[s]}setExtension(e,r,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:r,a=s?r:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,r){let n=typeof e=="string",s=n?this.data:e,i=n?e:r;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(bA(this.data.extensionsUsed,i),bA(this.data.extensionsRequired,i))}recordRemovedExtension(e){let r=this.data;r.extensionsRemoved||=[],r.extensionsRemoved.includes(e)||r.extensionsRemoved.push(e)}resolveAccessor(e,r){return this.resolveCollectionObject("accessor",e,r)}resolveBuffer(e,r){return this.resolveCollectionObject("buffer",e,r)}resolveBufferView(e,r){return this.resolveCollectionObject("bufferView",e,r)}resolveCamera(e,r){return this.resolveCollectionObject("camera",e,r)}resolveExternalAsset(e,r){return this.resolveCollectionObject("externalAsset",e,r)}resolveFile(e,r){return this.resolveCollectionObject("file",e,r)}resolveImage(e,r){return this.resolveCollectionObject("image",e,r)}resolveMaterial(e,r){return this.resolveCollectionObject("material",e,r)}resolveMesh(e,r){return this.resolveCollectionObject("mesh",e,r)}resolveNode(e,r){return this.resolveCollectionObject("node",e,r)}resolveSampler(e,r){return this.resolveCollectionObject("sampler",e,r)}resolveScene(e,r){return this.resolveCollectionObject("scene",e,r)}resolveSkin(e,r){return this.resolveCollectionObject("skin",e,r)}resolveTexture(e,r){return this.resolveCollectionObject("texture",e,r)}getOrCreateNested(e,r){return this.getOrCreate(e,r)}iterateCollection(e){let r=this.getCollection(e);return Ji(r,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let r=this.objectCache.get(e);if(!r)throw new Error("glTF object is not registered with this iterator");return r}resolveCollectionObject(e,r,n){let i=this.getCollection(e)[r];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${r} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,r,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,r,n){let s=`${SM(e)}[${r}]`;switch(e){case"accessor":return new Ym(this,e,r,n,s);case"animation":return new Zm(this,e,r,n,s);case"buffer":return new tb(this,e,r,n,s);case"bufferView":return new rb(this,e,r,n,s);case"camera":return new nb(this,e,r,n,s);case"externalAsset":return new sb(this,e,r,n,s);case"file":return new ib(this,e,r,n,s);case"image":return new ob(this,e,r,n,s);case"material":return new ab(this,e,r,n,s);case"mesh":return new ub(this,e,r,n,s);case"node":return new lb(this,e,r,n,s);case"sampler":return new db(this,e,r,n,s);case"scene":return new hb(this,e,r,n,s);case"skin":return new pb(this,e,r,n,s);case"texture":return new mb(this,e,r,n,s)}}getOrCreate(e,r){let n=this.objectCache.get(e);if(n)return n;let s=r();return this.objectCache.set(e,s),s}}});function gA(t){return(t%1+1)%1}function Dc(t,e){return xA[e]*yA[t]}function Xo(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let s=t.getTypedArrayForBufferView(e),i=Jo(s,"SCALAR",r,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function Jo(t,e,r,n=1){let s=yA[e],i=EM[r],o=xA[r],a=n*s,c=a*o,u=t.buffer,f=t.byteOffset;return f%o!==0&&(u=new Uint8Array(u).slice(f,f+c).buffer,f=0),new i($i(u),f,a)}function Yo(t,e,r){let n=`TEXCOORD_${e.texCoord||0}`,s=r.attributes[n],i=t.getTypedArrayForAccessor(s),o=t.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,f=t.gltf.images?.[c];if(f&&typeof f.width<"u"){let l=[];for(let d=0;d<i.length;d+=2){let h=BM(f,u,i,d,e.channels);l.push(h)}return l}}return[]}function xl(t,e,r,n,s){if(!r?.length)return;let i=[];for(let l of r){let d=n.findIndex(h=>h===l);d===-1&&(d=n.push(l)-1),i.push(d)}let o=new Uint32Array(i),a=t instanceof ae?t:new ae(t.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),f=a.addAccessor(u,{size:1,componentType:Gn(o),count:o.length});s.attributes[e]=f}function BM(t,e,r,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],a=r[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=FM(o,a,t,c),f=0;for(let l of s){let d=typeof l=="number"?Object.values(i)[l]:i[l],h=u+d.offset,m=Bc(t);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];f|=b<<d.shift}return f}function FM(t,e,r,n=1){let s=r.width,i=gA(t)*(s-1),o=Math.round(i),a=r.height,c=gA(e)*(a-1),u=Math.round(c),f=r.components?r.components:n;return(u*s+o)*f}function Nc(t,e,r,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(r[i]),a=Number(r[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>t.length)break;let c=o*n,u=a*n;s.push(t.slice(c,c+u))}return s}function Cc(t,e,r,n=1){let s=[],i=r*n;for(let o=0;o<e;o++){let a=o*i;s.push(t.slice(a,a+i))}return s}function wl(t,e,r,n,s){let i=new TextDecoder("utf8");if(r){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<t;a++){let c=r[a],u=r[a+1],f=[];for(let l=c;l<u;l++){let d=n[l],h=n[l+1],m=e.subarray(d,h);f.push(i.decode(m))}o.push(f)}return o}if(n){let o=[],a=t*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),f=Number(n[c+1]);u>=0&&f>=u&&f<=e.length&&o.push(i.decode(e.subarray(u,f)))}return s?Array.from({length:t},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var yA,EM,xA,Tl=p(()=>{"use strict";He();Ks();$s();Ve();yA={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},EM={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},xA={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8}});var bb={};Z(bb,{createExtMeshFeatures:()=>kM,decode:()=>MM,encode:()=>RM,name:()=>OM});async function MM(t,e){let r=new ae(t);DM(r,e)}function RM(t,e){let r=new sn(t);return CM(r,e),r.createBinaryChunk(),r.gltf}function DM(t,e){for(let r of t.meshes)for(let n of t.getReferences(r).primitives)NM(t,n,e)}function NM(t,e,r){let s=t.getExtension(e,Zo)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!r?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=t.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!r?.gltf?.loadImages)continue;o=Yo(t,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?t.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function CM(t,e){let r=t.gltf.json.meshes;if(r)for(let n of r)for(let s of n.primitives)GM(t,s)}function kM(t,e,r,n){e.extensions||(e.extensions={});let s=e.extensions[Zo];s||(s={featureIds:[]},e.extensions[Zo]=s);let{featureIds:i}=s,o={featureCount:r.length,propertyTable:n,data:r};i.push(o),t.addObjectExtension(e,Zo,s)}function GM(t,e){let r=e.extensions?.[Zo];if(!r)return;let n=r.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=VM(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=t.addBufferView(c),f=t.addAccessor(u,{size:1,componentType:Gn(c),count:c.length});e.attributes[o]=f}})}function VM(t){let e="_FEATURE_ID_",r=Object.keys(t).filter(i=>i.indexOf(e)===0),n=-1;for(let i of r){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var Zo,OM,wA=p(()=>{"use strict";Rc();He();Tl();Ks();Zo="EXT_mesh_features",OM=Zo});var wb={};Z(wb,{createExtStructuralMetadata:()=>f2,decode:()=>PM,encode:()=>jM,name:()=>UM});async function PM(t,e,r){let n=new ae(t),s=n.getExtension(Yi);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!r?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=kn(s.schemaUri,e,r),o=await r.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}zM(n,e)}function jM(t,e){let r=new sn(t);return c2(r,e),r.createBinaryChunk(),r.gltf}function zM(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Yi);r&&(e.gltf?.loadImages&&WM(t,r),$M(t,r))}function WM(t,e){let r=e.propertyTextures,n=t.data;if(r&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)qM(t,r,i,e)}function $M(t,e){let r=e.schema;if(!r)return;let n=r.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&HM(t,r,i)}function qM(t,e,r,n){if(!e)return;let i=r.extensions?.[Yi]?.propertyTextures;if(i)for(let o of i){let a=e[o];KM(t,a,r,n)}}function KM(t,e,r,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=Yo(t,a,r);u!==null&&(xl(t,o,u,c,r),a.data=c,n.dataAttributeNames.push(o))}}function HM(t,e,r){let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let i in n.properties){let o=n.properties[i],a=r.properties?.[i];if(a){let c={},u=XM(t,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function XM(t,e,r,n,s,i){let o=[],a=s.values,c=t.getTypedArrayForBufferView(a),u=YM(t,r,s,n),f=ZM(t,r,s,n,u);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let l=QM(r,s,n,c,u);o=l.data,i&&(i.value=l.rawData);break}case"BOOLEAN":{o=JM(r,n,c,u);break}case"STRING":{o=wl(n,c,u,f,r.array?r.count:void 0);break}case"ENUM":{o=n2(e,r,n,c,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return o}function JM(t,e,r,n){return t.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return gb(r,o,a-o)}):t.count===void 0?[]:Array.from({length:e},(s,i)=>gb(r,i*t.count,t.count)):gb(r,0,e)}function gb(t,e,r){if(e+r>t.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:r},(n,s)=>{let i=e+s;return!!(t[Math.floor(i/8)]&1<<i%8)})}function YM(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?Xo(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function ZM(t,e,r,n,s){if(typeof r.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return Xo(t,r.stringOffsets,r.stringOffsetType||"UINT32",i)}return null}function QM(t,e,r,n,s){let i=t.array,o=t.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[t.type]||1,c=Dc(t.type,t.componentType),u=n.byteLength/c,f;t.componentType?f=Jo(n,t.type,t.componentType,u):f=n;let l=f,d=e.offset??t.offset,h=e.scale??t.scale,m=t.normalized||d!==void 0||h!==void 0?e2(l,t.componentType,t.type,t.normalized,d,h):l;return i?s?{data:Nc(m,r,s,a),rawData:Nc(l,r,s,a)}:o?{data:Cc(m,r,o,a),rawData:Cc(l,r,o,a)}:{data:[],rawData:[]}:{data:m,rawData:l}}function e2(t,e,r,n,s,i){let o=r2(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return t;let c=t2(r),u=new Float64Array(t.length);for(let f=0;f<t.length;f++){let l=Number(t[f]);a&&(l=e?.startsWith("INT")?Math.max(l/o,-1):l/o);let d=f%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[f]=l*m+h}return u}function t2(t){switch(t){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function r2(t){switch(t){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function n2(t,e,r,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=t.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=Dc(e.type,a),u=n.byteLength/c,f=Jo(n,e.type,a,u);if(f||(f=n),e.array){if(s)return s2({valuesData:f,numberOfElements:r,arrayOffsets:s,enumEntry:o});let l=e.count;return l?i2(f,r,l,o):[]}return xb(f,0,r,o)}function s2(t){let{valuesData:e,numberOfElements:r,arrayOffsets:n,enumEntry:s}=t,i=[];for(let o=0;o<r;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=xb(e,a,c,s);i.push(u)}return i}function i2(t,e,r,n){let s=[];for(let i=0;i<e;i++){let o=r*i,a=xb(t,o,r,n);s.push(a)}return s}function xb(t,e,r,n){let s=[];for(let i=0;i<r;i++){let o=t[e+i],a=o2(n,o);a?s.push(a.name):s.push("")}return s}function o2(t,e){for(let r of t.values)if(typeof e=="bigint"?Number.isSafeInteger(r.value)&&BigInt(r.value)===e:r.value===e)return r;return null}function c2(t,e){let r=t.getExtension(Yi);if(r&&r.propertyTables)for(let n of r.propertyTables){let s=n.class,i=r.schema?.classes?.[s];n.properties&&i&&u2(n,i,t)}}function u2(t,e,r){for(let n in t.properties){let s=t.properties[n].data;if(s){let i=e.properties[n];if(i){let o=h2(s,i,r);t.properties[n]=o}}}}function f2(t,e,r=a2){let n=t.getExtension(Yi);n||(n=t.addExtension(Yi)),n.schema=l2(e,r,n.schema);let s=d2(e,r,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function l2(t,e,r){let n=r??{id:"schema_id"},s={properties:{}};for(let i of t){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function d2(t,e,r){let n={class:e,count:0},s=0,i=r.classes?.[e];for(let o of t){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function h2(t,e,r){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=b2(t);n.stringOffsets=yb(i,r),n.values=yb(s,r)}else if(e.type==="SCALAR"&&e.componentType){let s=m2(t,e.componentType);n.values=yb(s,r)}return n}function m2(t,e){let r=[];for(let s of t)r.push(Number(s));let n=p2[e];if(!n)throw new Error("Illegal component type");return new n(r)}function b2(t){let e=new TextEncoder,r=[],n=0;for(let c of t){let u=e.encode(c);n+=u.length,r.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of r)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function yb(t,e){return e.addBufferView(t)}var Yi,UM,a2,p2,TA=p(()=>{"use strict";Rc();He();Tl();Fc();Yi="EXT_structural_metadata",UM=Yi;a2="schemaClassId";p2={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array}});var _b={};Z(_b,{SPZ_COMPRESSION_EXTENSION_NAME:()=>_l,decode:()=>y2,getGaussianSplatPrimitives:()=>_A,name:()=>Tb});async function y2(t,e){let r=_A(t),n=new ae(t);for(let[s,i]of(t.json.meshes||[]).entries())for(let[o,a]of i.primitives.entries()){let c=a.extensions?.[Tb];if(!c)continue;w2(t.json,a,c,s,o,n);let u=c.extensions?.[_l];if(u){let f=r.find(l=>l.meshIndex===s&&l.primitiveIndex===o);if(f){let l=e?.gltf?.splatDecoder,d=t.json.bufferViews?.[u.bufferView];if(d&&t.buffers[d.buffer])f.compressedBytes=x2(t,u.bufferView);else if(l)throw new Error(`KHR_gaussian_splatting: bufferView ${u.bufferView} is not loaded for SPZ2 decoding.`);l&&f.compressedBytes&&(f.decoded=await l(f.compressedBytes.buffer,{sourceCoordinateSystem:"LUF"}))}}}r.length&&(t.gaussianSplatPrimitives=r)}function x2(t,e){let r=t.json.bufferViews?.[e];if(!r)throw new Error(`KHR_gaussian_splatting: bufferView ${e} is not defined.`);let n=t.buffers[r.buffer];if(!n)throw new Error(`KHR_gaussian_splatting: buffer ${r.buffer} is not loaded for SPZ2 payload.`);let s=n.byteOffset+(r.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,r.byteLength).slice()}function _A(t){let e="json"in t?t.json:t,r=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Tb];if(!a)continue;let c=a.extensions?.[_l]?.bufferView;r.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a,compressedBufferView:c})}return r}function w2(t,e,r,n,s,i){if((e.mode??4)!==0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} must use POINTS mode.`);if(typeof r.kernel!="string"||r.kernel.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing kernel.`);if(typeof r.colorSpace!="string"||r.colorSpace.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing colorSpace.`);let o=r.extensions?.[_l]?.bufferView;if(o!==void 0){if(!Number.isInteger(o)||o<0||o>=(t.bufferViews||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid SPZ bufferView.`)}else for(let a of g2)if(e.attributes[a]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing ${a}.`);for(let[a,c]of Object.entries(e.attributes))if(!Number.isInteger(c)||c<0||c>=(t.accessors||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has invalid accessor ${a}.`);T2(t,e,i,n,s);for(let a=1;a<=3;a++){let c=a*2+1,u=Array.from({length:c},(f,l)=>e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${a}_COEF_${l}`]!==void 0);if(u.some(Boolean)&&!u.every(Boolean))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has incomplete SH degree ${a}.`);if(u.some(Boolean)&&a>1){let f=a-1,l=f*2+1;for(let d=0;d<l;d++)if(e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${f}_COEF_${d}`]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} skips SH degree ${f}.`)}}}function T2(t,e,r,n,s){let i=e.attributes["KHR_gaussian_splatting:SCALE"],o=e.attributes["KHR_gaussian_splatting:OPACITY"];for(let[a,c,u]of[["KHR_gaussian_splatting:SCALE",i,f=>f>=0],["KHR_gaussian_splatting:OPACITY",o,f=>f>=0&&f<=1]]){if(c===void 0||!_2(t,r,c))continue;let f=r.getTypedArrayForAccessor(c);for(let l=0;l<f.length;l++)if(!u(Number(f[l])))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid ${a} value.`)}}function _2(t,e,r){let n=t.accessors?.[r],s=n?.bufferView===void 0?void 0:t.bufferViews?.[n.bufferView];return!!(s&&e.gltf.buffers[s.buffer])}var Tb,_l,g2,AA=p(()=>{"use strict";He();Tb="KHR_gaussian_splatting",_l="KHR_gaussian_splatting_compression_spz_2",g2=["POSITION","KHR_gaussian_splatting:ROTATION","KHR_gaussian_splatting:SCALE","KHR_gaussian_splatting:OPACITY","KHR_gaussian_splatting:SH_DEGREE_0_COEF_0"]});var vb={};Z(vb,{decode:()=>A2,getVoxelPrimitives:()=>v2,name:()=>Ab});async function A2(t){for(let[e,r]of(t.json.meshes||[]).entries())for(let[n,s]of r.primitives.entries()){let i=s.extensions?.[Ab];i&&I2(t.json,s,i,e,n)}}function v2(t){let e="json"in t?t.json:t,r=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Ab];a&&r.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a})}return r}function I2(t,e,r,n,s){if(!Number.isInteger(r.shape)||r.shape<0)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid shape.`);if(!Array.isArray(r.dimensions)||r.dimensions.length!==3||r.dimensions.some(i=>!Number.isInteger(i)||i<=0))throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must provide three positive dimensions.`);if(e.mode!==void 0&&e.mode!==2147483647)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must use voxel mode.`);for(let i of Object.keys(e.attributes)){let o=e.attributes[i];if(!Number.isInteger(o)||o<0||o>=(t.accessors||[]).length)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid accessor ${i}.`)}}var Ab,vA=p(()=>{"use strict";Ab="EXT_primitive_voxels"});var Ib={};Z(Ib,{decode:()=>S2,getPrimitiveRestartRanges:()=>Al,name:()=>Xs});async function S2(t,e){if(!t.json.extensionsUsed?.includes(Xs))return;if(!t.json.extensionsRequired?.includes(Xs))throw new Error(`${Xs} must be declared in extensionsRequired`);if(!e.gltf?.loadBuffers)return;let r=new ae(t);for(let n of r.meshes)for(let s of r.getReferences(n).primitives)E2(r,s)}function E2(t,e){if(e.indices===void 0)return;let r=e.indices,n=typeof r=="number"?t.data.accessors?.[r]:r;if(!n)throw new Error(`${Xs}: primitive references missing indices accessor ${e.indices}`);let s=B2(n),i=t.getTypedArrayForAccessor(e.indices),o=Array.prototype.includes.call(i,s);if(!L2.has(e.mode??4)){if(o)throw new Error(`${Xs}: primitive restart is not valid for mode ${e.mode??4}`);return}Object.defineProperty(e,"primitiveRestart",{configurable:!0,enumerable:!1,writable:!0,value:{restartIndex:s,ranges:Al(i,s)}})}function B2(t){if(t.type!=="SCALAR")throw new Error(`${Xs}: indices accessor must have SCALAR type`);switch(t.componentType){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${Xs}: indices accessor must use an unsigned integer component type`)}}function Al(t,e){let r=[],n=0;for(let s=0;s<=t.length;s++)(s===t.length||t[s]===e)&&(s>n&&r.push({offset:n,count:s-n}),n=s+1);return r}var Xs,L2,Lb=p(()=>{"use strict";He();Xs="KHR_mesh_primitive_restart",L2=new Set([2,3,5,6])});var Sb={};Z(Sb,{decode:()=>F2,name:()=>Vt});async function F2(t,e){if(!e.gltf?.loadBuffers)return;let r=new ae(t);for(let n of r.meshes)for(let s of r.getReferences(n).primitives){let i=r.getExtension(s,Vt);i&&Object.defineProperty(i,"data",{configurable:!0,enumerable:!1,writable:!0,value:O2(r,s,i)})}}function O2(t,e,r){if(!Number.isInteger(r.count)||r.count<1)throw new Error(`${Vt}: count must be a positive integer`);if((e.mode??4)!==4||e.indices===void 0)throw new Error(`${Vt}: primitive must use TRIANGLES mode with indices`);let n=vl(t,e.indices,"indices"),s=vl(t,r.indicesOffsets,"indicesOffsets",r.count),i=vl(t,r.loopIndices,"loopIndices"),o=vl(t,r.loopIndicesOffsets,"loopIndicesOffsets",r.count),a=t.data.accessors?.[r.loopIndices],c=M2(a.componentType);IA(s,n.length,"indicesOffsets"),IA(o,i.length,"loopIndicesOffsets");let u=[];for(let f=0;f<r.count;f++){let l=Number(s[f]),d=f+1<r.count?Number(s[f+1]):n.length,h=Number(o[f]),m=f+1<r.count?Number(o[f+1]):i.length,b=Array.from(i).slice(h,m),x=Al(b,c).map(g=>({offset:g.offset+h,count:g.count}));if((d-l)%3!==0)throw new Error(`${Vt}: polygon ${f} triangle range must contain complete triangles`);if(x.length===0)throw new Error(`${Vt}: polygon ${f} must contain at least one loop`);if(x.some(g=>g.count<3))throw new Error(`${Vt}: polygon ${f} loops must contain at least three indices`);u.push({triangleRange:{offset:l,count:d-l},loopRanges:x})}return{indicesOffsets:s,loopIndices:i,loopIndicesOffsets:o,polygons:u}}function vl(t,e,r,n){if(typeof e=="number"&&(!Number.isInteger(e)||e<0))throw new Error(`${Vt}: ${r} must reference an accessor`);let s=typeof e=="number"?t.data.accessors?.[e]:e;if(!s)throw new Error(`${Vt}: ${r} references missing accessor ${e}`);if(s.type!=="SCALAR"||![5121,5123,5125].includes(s.componentType))throw new Error(`${Vt}: ${r} must be an unsigned integer SCALAR accessor`);if(n!==void 0&&s.count!==n)throw new Error(`${Vt}: ${r} count must equal polygon count ${n}`);return t.getTypedArrayForAccessor(e)}function IA(t,e,r){if(Number(t[0])!==0)throw new Error(`${Vt}: ${r} must begin at zero`);let n=-1;for(let s=0;s<t.length;s++){let i=Number(t[s]);if(!Number.isInteger(i)||i<0||i>=e||i<=n)throw new Error(`${Vt}: ${r} must contain increasing in-bounds offsets`);n=i}}function M2(t){switch(t){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${Vt}: unsupported loop index component type ${t}`)}}var Vt,LA=p(()=>{"use strict";He();Lb();Vt="EXT_mesh_polygon"});var Eb={};Z(Eb,{decode:()=>R2,getSpatialAudio:()=>SA,name:()=>Qo});function SA(t){let e="asset"in t?t:t.json,r=[],n=e.extensions?.[Qo];n&&r.push({nodeIndex:null,extension:n});for(let[s,i]of(e.nodes||[]).entries()){let o=i.extensions?.[Qo];o&&r.push({nodeIndex:s,extension:o})}return r}async function R2(t){let e=SA(t);for(let{extension:r,nodeIndex:n}of e){let s=n===null?"root":`node ${n}`;for(let i of r.sources||[]){if(!Array.isArray(i.accessors)||i.accessors.length===0)throw new Error(`${Qo}: ${s} source ${i.id} requires audio accessors.`);for(let o of i.accessors)if(!Number.isInteger(o)||o<0||!t.json.accessors?.[o])throw new Error(`${Qo}: ${s} source ${i.id} has invalid accessor ${o}.`);if(i.reverbFeedGain&&i.reverbFeedGain.length!==(i.reverbFeed?.length||0))throw new Error(`${Qo}: ${s} source ${i.id} has mismatched reverb feed gains.`)}}e.length&&(t.spatialAudio=e)}var Qo,EA=p(()=>{"use strict";Qo="MPEG_audio_spatial"});var Bb={};Z(Bb,{decode:()=>D2,name:()=>Ut});async function D2(t,e,r){let n=t.json.extensions?.[Ut],s=(n?.audio||[]).map(c=>({audio:c})),i=n?.sources||[],o=n?.emitters||[];for(let c of i)c.audio!==void 0&&Il(s,c.audio,"audio");for(let c of o){if(c.type!=="global"&&c.type!=="positional")throw new Error(`${Ut}: invalid emitter type ${c.type}.`);if(c.type==="global"&&c.positional!==void 0)throw new Error(`${Ut}: global emitters cannot have positional settings.`);for(let u of c.sources||[])Il(i,u,"source")}let a=[];for(let c of["nodes","scenes"])for(let[u,f]of(t.json[c]||[]).entries()){let l=f.extensions?.[Ut];if(l){if(!Array.isArray(l.emitters)||!l.emitters.length)throw new Error(`${Ut}: ${c} ${u} requires emitters.`);for(let d of l.emitters){let h=Il(o,d,"emitter");if(c==="scenes"&&h.type!=="global")throw new Error(`${Ut}: scenes may only reference global emitters.`);a.push({emitterIndex:d,nodeIndex:c==="nodes"?u:null,sceneIndex:c==="scenes"?u:null,emitter:h,sources:(h.sources||[]).map(m=>{let b=i[m];return{sourceIndex:m,source:b,clip:b.audio===void 0?void 0:s[b.audio]}})})}}}if(n){for(let c of s)N2(t,c);e.gltf?.loadAudio!==!1&&await Promise.all(s.map(c=>C2(t,c,e,r))),t.audioClips=s,t.audioEmitters=a}}function Il(t,e,r){if(!Number.isInteger(e)||e<0||!t[e])throw new Error(`${Ut}: invalid ${r} index ${e}.`);return t[e]}function N2(t,e){let{audio:r}=e;if(r.bufferView!==void 0){if(Il(t.json.bufferViews||[],r.bufferView,"bufferView"),!r.mimeType)throw new Error(`${Ut}: buffer-view audio requires mimeType.`)}else if(!r.uri)throw new Error(`${Ut}: audio requires a uri or bufferView.`)}async function C2(t,e,r,n){let{audio:s}=e;if(s.bufferView!==void 0){let a=t.json.bufferViews[s.bufferView],c=t.buffers[a.buffer];if(!c){if(r.gltf?.loadBuffers===!1)return;throw new Error(`${Ut}: audio buffer ${a.buffer} is not loaded.`)}let u=a.byteOffset??0,f=a.byteLength;if(!Number.isSafeInteger(u)||u<0||!Number.isSafeInteger(f)||f<0||u+f>c.byteLength||c.byteOffset+u+f>c.arrayBuffer.byteLength)throw new Error(`${Ut}: audio bufferView exceeds its buffer.`);e.data=new Uint8Array(c.arrayBuffer,c.byteOffset+u,f);return}if(!n?.fetch)throw new Error(`${Ut}: a loader context is required to load audio.`);let i=kn(s.uri,r,n),o=await n.fetch(i);if(!o.ok)throw new Error(`${Ut}: failed to load audio ${i} (${o.status}).`);e.url=i,e.data=new Uint8Array(await o.arrayBuffer())}var Ut,BA=p(()=>{"use strict";Fc();Ut="KHR_audio_emitter"});var FA={};Z(FA,{MeshoptDecoder:()=>k2});var k2,OA=p(()=>{"use strict";k2=(function(){var t="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;X8:kdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:bsesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:I9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkpPesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",r=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(r)?a(e):a(t),i,o=WebAssembly.instantiate(s,{}).then(function(g){i=g.instance,i.exports.__wasm_call_ctors()});function a(g){for(var w=new Uint8Array(g.length),T=0;T<g.length;++T){var _=g.charCodeAt(T);w[T]=_>96?_-97:_>64?_-39:_+4}for(var v=0,T=0;T<g.length;++T)w[v++]=w[T]<60?n[w[T]]:(w[T]-60)*64+w[++T];return w.buffer.slice(0,v)}function c(g,w,T,_,v,I,Y){var $=g.exports.sbrk,re=_+3&-4,pe=$(re*v),Re=$(I.length),De=new Uint8Array(g.exports.memory.buffer);De.set(I,Re);var ce=w(pe,_,v,Re,I.length);if(ce==0&&Y&&Y(pe,re,v),T.set(De.subarray(pe,pe+_*v)),$(pe-$(0)),ce!=0)throw new Error("Malformed buffer data: "+ce)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},l=[],d=0;function h(g){var w={object:new Worker(g),pending:0,requests:{}};return w.object.onmessage=function(T){var _=T.data;w.pending-=_.count,w.requests[_.id][_.action](_.value),delete w.requests[_.id]},w}function m(g){for(var w="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+x.name+";"+c.toString()+x.toString(),T=new Blob([w],{type:"text/javascript"}),_=URL.createObjectURL(T),v=l.length;v<g;++v)l[v]=h(_);for(var v=g;v<l.length;++v)l[v].object.postMessage({});l.length=g,URL.revokeObjectURL(_)}function b(g,w,T,_,v){for(var I=l[0],Y=1;Y<l.length;++Y)l[Y].pending<I.pending&&(I=l[Y]);return new Promise(function($,re){var pe=new Uint8Array(T),Re=++d;I.pending+=g,I.requests[Re]={resolve:$,reject:re},I.object.postMessage({id:Re,count:g,size:w,source:pe,mode:_,filter:v},[pe.buffer])})}function x(g){var w=g.data;self.ready.then(function(T){if(!w.id)return self.close();try{var _=new Uint8Array(w.count*w.size);c(T,T.exports[w.mode],_,w.count,w.size,w.source,T.exports[w.filter]),self.postMessage({id:w.id,count:w.count,action:"resolve",value:_},[_.buffer])}catch(v){self.postMessage({id:w.id,count:w.count,action:"reject",value:v})}})}return{ready:o,supported:!0,useWorkers:function(g){m(g)},decodeVertexBuffer:function(g,w,T,_,v){c(i,i.exports.meshopt_decodeVertexBuffer,g,w,T,_,i.exports[u[v]])},decodeIndexBuffer:function(g,w,T,_){c(i,i.exports.meshopt_decodeIndexBuffer,g,w,T,_)},decodeIndexSequence:function(g,w,T,_){c(i,i.exports.meshopt_decodeIndexSequence,g,w,T,_)},decodeGltfBuffer:function(g,w,T,_,v,I){c(i,i.exports[f[v]],g,w,T,_,i.exports[u[I]])},decodeGltfBufferAsync:function(g,w,T,_,v){return l.length>0?b(g,w,T,f[_],u[v]):o.then(function(){var I=new Uint8Array(g*w);return c(i,i.exports[f[_]],I,g,w,T,i.exports[u[v]]),I})}}})()});function MA(){return Promise.resolve().then(()=>(OA(),FA))}var RA=p(()=>{"use strict"});async function G2(){return Ll||(Ll=MA().then(async({MeshoptDecoder:t})=>(await t.ready,t),t=>{throw Ll=void 0,new Error("Failed to load the packaged meshopt decoder.",{cause:t})})),Ll}function V2(t){return typeof t=="string"?t:["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL","COLOR"][t]}async function DA(t,e,r,n,s,i="NONE"){(await G2()).decodeGltfBuffer(t,e,r,n,s,V2(i))}var Ll,NA=p(()=>{"use strict";RA()});async function Sl(t,e,r){if(!e.gltf?.decompressMeshes&&e.gltf?.decompressBufferViewIndices===void 0||!e.gltf?.loadBuffers)return;U2(t.json);let n=new ae(t),s=e.gltf.decompressBufferViewIndices,i=s?new Set(typeof s=="function"?s(t.json):s):void 0,o=Array.from(n.bufferViews),a=o.map((c,u)=>i?.has(u)===!1?Promise.resolve():P2(n,c,r));if(await Promise.all(a),i){for(let c of i){let u=o[c];u&&n.removeExtension(u,r)}return}for(let c of o)n.removeExtension(c,r);for(let c of n.buffers)n.removeExtension(c,r);n.removeExtension(r)}function U2(t){let e=t.bufferViews||[];for(let n=0;n<e.length;n++){let s=e[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF bufferView ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}let r=t.buffers||[];for(let n=0;n<r.length;n++){let s=r[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF buffer ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}}async function P2(t,e,r){let n=t.getExtension(e,r);if(!n)return;let{byteOffset:s=0,byteLength:i,byteStride:o,count:a,mode:c,filter:u="NONE",buffer:f}=n,l=t.gltf.buffers[f],d=t.gltf.buffers[e.buffer],h=new Uint8Array(l.arrayBuffer,l.byteOffset+s,i),m=new Uint8Array(d.arrayBuffer,d.byteOffset+(e.byteOffset||0),e.byteLength);await DA(m,a,o,h,c,u)}var Fb=p(()=>{"use strict";He();NA()});var Ob={};Z(Ob,{decode:()=>j2,name:()=>CA});async function j2(t,e){await Sl(t,e,CA)}var CA,kA=p(()=>{"use strict";Fb();CA="EXT_meshopt_compression"});var Mb={};Z(Mb,{decode:()=>z2,name:()=>GA});async function z2(t,e){await Sl(t,e,GA)}var GA,VA=p(()=>{"use strict";Fb();GA="KHR_meshopt_compression"});var Rb={};Z(Rb,{name:()=>W2,preprocess:()=>$2});function $2(t,e){let r=new ae(t);if(!Gm("image/webp")){if(r.isExtensionRequired(ea))throw new Error(`gltf: Required extension ${ea} not supported by browser`);return}for(let n of r.textures){let s=r.getExtension(n,ea);s&&(n.source=s.source),r.removeExtension(n,ea)}r.removeExtension(ea)}var ea,W2,UA=p(()=>{"use strict";$s();He();ea="EXT_texture_webp",W2=ea});var Db={};Z(Db,{name:()=>q2,preprocess:()=>K2});async function K2(t,e){let r=new ae(t);if(!r.hasExtension(Zi))return;if(!(await km()).has("image/avif")){if(r.isExtensionRequired(Zi))throw new Error(`gltf: Required extension ${Zi} not supported by browser`);return}for(let s of r.textures){let i=r.getExtension(s,Zi);i&&(s.source=i.source),r.removeExtension(s,Zi)}r.removeExtension(Zi)}var Zi,q2,PA=p(()=>{"use strict";$s();He();Zi="EXT_texture_avif",q2=Zi});var Nb={};Z(Nb,{name:()=>H2,preprocess:()=>X2});function X2(t,e){let r=new ae(t);for(let n of r.textures){let s=r.getExtension(n,El);s&&(n.source=s.source,r.removeExtension(n,El))}r.removeExtension(El)}var El,H2,jA=p(()=>{"use strict";He();El="KHR_texture_basisu",H2=El});var zA=p(()=>{"use strict";Us()});async function Bl(t={},e,r="full"){let n=QA(t);return n?await Gb(n):await Z2(t,e==="js"?"javascript":e,r)}async function Z2(t={},e,r="full"){let n=ev(`${e}:${r}`,t),s=$A.get(n);return s||(s=Q2(t,e,r),$A.set(n,s)),await s}async function Gb(t){let e=rR(t),r=KA.get(e);return r||(r=Pi(()=>e.createDecoderModule({}),n=>({draco:n})),KA.set(e,r)),await r}async function Vb(t={}){let e=QA(t);if(e){let s=nR(e),i=HA.get(s);return i||(i=Pi(()=>s.createEncoderModule({}),o=>({draco:o})),HA.set(s,i)),await i}let r=ev("encoder",t),n=qA.get(r);return n||(n=tR(t),qA.set(r,n)),await n}async function Q2(t,e,r){try{return await JA(t,e,r)}catch(n){if(e==="javascript")throw n;try{return await JA(t,"javascript","full")}catch(s){throw new AggregateError([n,s],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function JA(t,e,r){let n=XA.then(()=>eR(t,e,r));return XA=n.then(()=>{},()=>{}),await n}async function eR(t,e,r){if(e==="javascript"){let o;try{o=await xr(ta[Le.FALLBACK_DECODER],"draco",t,Le.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Me||t.useLocalLibraries)throw c;o=await xr(ta[Le.FALLBACK_DECODER],"draco",{...t,useLocalLibraries:!0},Le.FALLBACK_DECODER,"draco_decoder.mjs")}let a=kb(o,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await Cb(a)}let n,s;try{[n,s]=await YA(t,r)}catch(o){if(Me||t.useLocalLibraries)throw o;[n,s]=await YA({...t,useLocalLibraries:!0},r)}let i=kb(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await Cb(i,s)}async function YA(t,e){let r=e==="gltf"?Le.GLTF_DECODER:Le.DECODER,n=e==="gltf"?Le.GLTF_DECODER_WASM:Le.DECODER_WASM;return await Promise.all([xr(ta[r],"draco",t,r,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),xr(ta[n],"draco",t,n)])}async function tR(t){let e,r;try{[e,r]=await ZA(t)}catch(s){if(Me||t.useLocalLibraries)throw s;[e,r]=await ZA({...t,useLocalLibraries:!0})}let n=kb(e,"DracoEncoderModule")||globalThis.DracoEncoderModule;return await Cb(n,r)}async function ZA(t){return await Promise.all([xr(ta[Le.ENCODER],"draco",t,Le.ENCODER,"draco_encoder.mjs"),xr(ta[Le.ENCODER_WASM],"draco",t,Le.ENCODER_WASM)])}function Cb(t,e){if(typeof t!="function")throw new Error("Draco module initializer could not be loaded");return Pi(r=>t({...e?{wasmBinary:e}:{},onModuleLoaded:r}),r=>({draco:r}))}function kb(t,e){if(typeof t=="function")return t;if(t&&typeof t=="object"){let r=t,n=r[e]||r.default;return typeof n=="function"?n:void 0}}function QA(t){let e=t.modules?.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function rR(t){let e=t;if(typeof e?.createDecoderModule!="function")throw new Error("Invalid draco3d decoder module");return e}function nR(t){let e=t;if(typeof e?.createEncoderModule!="function")throw new Error("Invalid draco3d encoder module");return e}function ev(t,e){let r=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,s])=>`${n}:${String(s)}`).sort().join("|");return[t,e.useLocalLibraries?"local":"remote",e.CDN||"",r].join("|")}var J2,Y2,kc,WA,Le,ta,$A,qA,KA,HA,XA,Gc=p(()=>{"use strict";Ve();zA();J2="1.5.7",Y2="8786740086a9f4d83f44aa83badfbea4dce7a1b5",kc=`https://www.gstatic.com/draco/versioned/decoders/${J2}`,WA=`https://cdn.jsdelivr.net/gh/google/draco@${Y2}/javascript`,Le={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},ta={[Le.DECODER]:`${kc}/${Le.DECODER}`,[Le.DECODER_WASM]:`${kc}/${Le.DECODER_WASM}`,[Le.GLTF_DECODER]:`${kc}/${Le.GLTF_DECODER}`,[Le.GLTF_DECODER_WASM]:`${kc}/${Le.GLTF_DECODER_WASM}`,[Le.FALLBACK_DECODER]:`${kc}/${Le.FALLBACK_DECODER}`,[Le.ENCODER]:`${WA}/${Le.ENCODER}`,[Le.ENCODER_WASM]:`${WA}/${Le.ENCODER_WASM}`},$A=new Map,qA=new Map,KA=new WeakMap,HA=new WeakMap;XA=Promise.resolve()});var Vc,Ub=p(()=>{"use strict";Vc={name:"Draco",id:"draco",module:"draco",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});function rv(t){let e=t.size(),r=new ArrayBuffer(e),n=new Int8Array(r);for(let s=0;s<e;++s)n[s]=t.GetValue(s);return r}function iR(t){return t instanceof Map?t.entries():Object.entries(t)}function Uc(t){return ArrayBuffer.isView(t)?t:t&&typeof t=="object"&&"value"in t&&ArrayBuffer.isView(t.value)?t.value:null}function Fl(t,e){return ArrayBuffer.isView(t)?e:t.size}function oR(t,e){for(let r of t)if(!Number.isInteger(r)||r<0||r>=e)throw new Error(`DracoWriter: triangle index ${r} is outside vertex range 0-${e-1}`)}function nv(t){return!!(t.attributeQuantization&&Object.keys(t.attributeQuantization).length)}function Ol(t,e,r){if(!Number.isInteger(e)||e<1||e>30)throw new Error(`DracoWriter: quantization bits for "${t}" must be an integer from 1 to 30`);if(r==="NORMAL"&&(e<2||e>29))throw new Error(`DracoWriter: quantization bits for NORMAL attribute "${t}" must be an integer from 2 to 29`)}function aR(t,e,r){if(Ol(t,r.bits),!Array.isArray(r.origin)||r.origin.length!==e)throw new Error(`DracoWriter: quantization origin for "${t}" must contain ${e} values`);if(!r.origin.every(Number.isFinite))throw new Error(`DracoWriter: quantization origin for "${t}" must be finite`);if(!Number.isFinite(r.range)||r.range<=0)throw new Error(`DracoWriter: quantization range for "${t}" must be positive`)}function sv(t,e){for(let r of["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"])if(t[r]===e)return r;return"GENERIC"}function cR(t){let e={gltf:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},webgpu:{method:"MESH_SEQUENTIAL_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},balanced:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:12,NORMAL:10,TEX_COORD:10}}},r=t.preset?e[t.preset]:{};return{...r,...t,quantization:{...r.quantization,...t.quantization}}}var sR,tv,ra,iv=p(()=>{"use strict";sR={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},tv=()=>{},ra=class{draco;dracoEncoder;dracoMeshBuilder;dracoMetadataBuilder;log=tv;constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder)}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,r={}){return this._encodeSync(e,r,!1).data}encodeSyncWithReport(e,r={}){return this._encodeSync(e,r,!0)}_encodeSync(e,r,n){return r=cR(r),this.log=r.log||tv,r.pointcloud?this._encodePointCloud(e,r,n):this._encodeMesh(e,r,n)}_getAttributesFromMesh(e){return{...e.indices?{indices:e.indices}:{},...e.attributes}}_encodePointCloud(e,r,n){let s=new this.draco.PointCloud,i=new this.draco.DracoInt8Array,o=null;try{r.metadata&&this._addGeometryMetadata(s,r.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoPointCloud(s,a,r),u=nv(r),f,l;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,r),l=o,n&&l.SetTrackEncodedProperties(!0),f=o.EncodeToDracoBuffer(r.deduplicateValues??!1,i)):(this._setOptions(r),l=this.dracoEncoder,n&&l.SetTrackEncodedProperties(!0),f=this.dracoEncoder.EncodePointCloudToDracoBuffer(s,r.deduplicateValues??!1,i)),!(f>0))throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
44
|
-
with ${s.num_attributes()} attributes into ${f} bytes`);let d=
|
|
45
|
-
with ${s.num_attributes()} attributes into ${f} bytes`);let d=rv(i);return{data:d,report:this._getEncodingReport("mesh",d.byteLength,s,l,c,r,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_setOptions(e){if(e.speed&&this.dracoEncoder.SetSpeedOptions(...e.speed),e.method){let r=this.draco[e.method];this.dracoEncoder.SetEncodingMethod(r)}if(e.quantization)for(let r in e.quantization){let n=r,s=e.quantization[n];s!==void 0&&(Ol(n,s,n),this.dracoEncoder.SetAttributeQuantization(this.draco[n],s))}}_setExpertOptions(e,r,n){n.speed&&e.SetSpeedOptions(...n.speed),n.method&&e.SetEncodingMethod(this.draco[n.method]);let s=this._getAttributeQuantization(r,n);for(let[i,o]of s){let a=r[i];typeof o=="number"?e.SetAttributeQuantization(a.attributeId,o):e.SetAttributeExplicitQuantization(a.attributeId,o.bits,a.componentCount,o.origin,o.range)}}_getAttributeQuantization(e,r){let n=new Map;for(let i of Object.keys(r.quantization||{})){let o=r.quantization?.[i];o!==void 0&&(Ol(i,o,i),n.set(this.draco[i],o))}let s=new Map;for(let[i,o]of Object.entries(e)){let a=n.get(o.attributeType);a!==void 0&&s.set(i,a)}for(let[i,o]of Object.entries(r.attributeQuantization||{})){let a=e[i];if(!a)throw new Error(`DracoWriter: quantized attribute "${i}" does not exist`);if(typeof o=="number")Ol(i,o,a.attributeTypeName);else{if(a.attributeTypeName==="NORMAL")throw new Error(`DracoWriter: explicit quantization transforms are not supported for NORMAL attribute "${i}"`);aR(i,e[i].componentCount,o)}s.set(i,o)}for(let i of s.keys())if(!e[i].supportsQuantization)throw new Error(`DracoWriter: quantization for "${i}" requires floating-point attribute data`);return s}_getEncodingReport(e,r,n,s,i,o,a){let c=this._getAttributeQuantization(i,o),u={};for(let[f,l]of Object.entries(i))u[f]={id:l.attributeId,type:l.attributeTypeName,componentCount:l.componentCount,...c.has(f)?{quantization:c.get(f)}:{}};return{geometryType:e,byteLength:r,pointCount:a?s.GetNumberOfEncodedPoints():n.num_points(),faceCount:a?s.GetNumberOfEncodedFaces():e==="mesh"&&typeof n.num_faces=="function"?n.num_faces():0,attributeCount:n.num_attributes(),...o.method?{method:o.method}:{},...o.speed?{speed:o.speed}:{},attributes:u}}_createDracoMesh(e,r,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(r,n);for(let[a,c]of Object.entries(r)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let f=Uc(c),l=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:l,attributeTypeName:sv(this.draco,l),componentCount:Fl(c,f.length/o),supportsQuantization:f instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_createDracoPointCloud(e,r,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(r,n);for(let[a,c]of Object.entries(r)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let f=Uc(c),l=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:l,attributeTypeName:sv(this.draco,l),componentCount:Fl(c,f.length/o),supportsQuantization:f instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_addAttributeToMesh(e,r,n,s,i={}){let o=Uc(n);if(!o)throw new Error(`DracoWriter: attribute "${r}" must contain a typed array`);let a=this._getDracoAttributeType(r,i.attributeTypes),c=Fl(n,o.length/s);if(a==="indices"){if(o.length%3!==0)throw new Error("DracoWriter: triangle indices length must be divisible by 3");oR(o,s);let l=o.length/3;this.log(`Adding attribute ${r}, size ${l}`);let d=o instanceof Uint16Array||o instanceof Uint32Array?o:Uint32Array.from(o);return this.dracoMeshBuilder.AddFacesToMesh(e,l,d),-1}if(!Number.isInteger(c)||c<=0||o.length!==s*c)throw new Error(`DracoWriter: attribute "${r}" has ${o.length} values, expected ${s*c}`);this.log(`Adding attribute ${r}, size ${c}`);let u=this.dracoMeshBuilder,f=-1;if(o instanceof Int8Array)f=u.AddInt8Attribute(e,a,s,c,o);else if(o instanceof Int16Array)f=u.AddInt16Attribute(e,a,s,c,o);else if(o instanceof Int32Array)f=u.AddInt32Attribute(e,a,s,c,o);else if(o instanceof Uint8Array)f=u.AddUInt8Attribute(e,a,s,c,o);else if(o instanceof Uint8ClampedArray){let l=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);f=u.AddUInt8Attribute(e,a,s,c,l)}else if(o instanceof Uint16Array)f=u.AddUInt16Attribute(e,a,s,c,o);else if(o instanceof Uint32Array)f=u.AddUInt32Attribute(e,a,s,c,o);else if(o instanceof Float32Array)f=u.AddFloatAttribute(e,a,s,c,o);else throw new Error(`DracoWriter: attribute "${r}" uses unsupported ${o.constructor.name}`);return!ArrayBuffer.isView(n)&&n.normalized!==void 0&&u.SetNormalizedFlagForAttribute(e,f,n.normalized),f}_getDracoAttributeType(e,r={}){if(e.toLowerCase()==="indices")return"indices";let n=r[e];if(n)return this.draco[n];let s=sR[e];if(s)return this.draco[s];switch(e.toLowerCase()){case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return/^color_\d+$/i.test(e)?this.draco.COLOR:/^texcoord_\d+$/i.test(e)?this.draco.TEX_COORD:this.draco.GENERIC}}_getVertexCount(e,r){let n=this._getPositionAttribute(e,r.attributeTypes),s=n&&Uc(n);if(!n||!s)throw new Error("DracoWriter: POSITION attribute is required");let i=Fl(n,3);if(!Number.isInteger(i)||i<=0||s.length%i!==0)throw new Error("DracoWriter: POSITION attribute has an invalid size or value count");return s.length/i}_getPositionAttribute(e,r={}){for(let n in e){let s=e[n];if(this._getDracoAttributeType(n,r)===this.draco.POSITION&&Uc(s))return s}return null}_addGeometryMetadata(e,r){let n=new this.draco.Metadata;this._populateDracoMetadata(n,r),this.dracoMeshBuilder.AddMetadata(e,n)}_addAttributeMetadata(e,r,n){let s=new this.draco.Metadata;this._populateDracoMetadata(s,n),this.dracoMeshBuilder.SetMetadataForAttribute(e,r,s)}_populateDracoMetadata(e,r){for(let[n,s]of iR(r))switch(typeof s){case"number":Math.trunc(s)===s?this.dracoMetadataBuilder.AddIntEntry(e,n,s):this.dracoMetadataBuilder.AddDoubleEntry(e,n,s);break;case"object":s instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,n,s,s.length);break;default:this.dracoMetadataBuilder.AddStringEntry(e,n,s)}}}});var Pc,Pb=p(()=>{"use strict";Pc="5.0.0-beta.1"});async function fR(t,e={}){return(await Ml(t,e)).data}async function Ml(t,e={}){let{draco:r}=await Vb(tn(e)),n=new ra(r);try{return n.encodeSyncWithReport(cv(t),e.draco)}finally{n.destroy()}}function av(t,e={}){let r=hR(t);if(Np(ov,e)){let{onProgress:n,...s}=e;return Mp(ov,r,s)}return dR(r,e)}async function*lR(t,e={}){let r=(async function*(){for await(let n of t)yield[n]})();for await(let n of av(r,e))yield n.data}async function*dR(t,e={}){let{draco:r}=await Vb(tn(e)),n=new ra(r);try{for await(let s of t)for(let i of s)pR(e.signal),yield n.encodeSyncWithReport(i,e.draco)}finally{n.destroy()}}async function*hR(t){for await(let e of t)yield e.map(cv)}function pR(t){if(!t?.aborted)return;if(t.reason!==void 0)throw t.reason;let e=new Error("Draco batch encoding aborted");throw e.name="AbortError",e}function cv(t){if(mR(t))return nn(t);if(bR(t))return t;let{indices:e,...r}=t;return{attributes:r,...e?{indices:e}:{}}}function mR(t){return typeof t=="object"&&t!==null&&"shape"in t&&t.shape==="arrow-table"}function bR(t){return typeof t=="object"&&t!==null&&"attributes"in t&&typeof t.attributes=="object"&&t.attributes!==null&&!ArrayBuffer.isView(t.attributes)}var uR,ov,xJ,uv=p(()=>{"use strict";Ve();Nn();Us();iv();Gc();Pb();Ub();uR={pointcloud:!1,attributeNameEntry:"name"},ov={...Vc,id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:Pc,worker:!0,workerNode:"draco-writer-worker-node.cjs",options:{draco:{}}},xJ={...Vc,name:"DRACO",version:Pc,options:{draco:uR},encode:fR,encodeInBatches:lR}});var fv,lv=p(()=>{"use strict";fv={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});function hv(t,e,r){let n=pv(e.metadata),s=[],i=gR(e.attributes);for(let o in t){let a=t[o],c=dv(o,a,i[o]);s.push(c)}if(r){let o=dv("indices",r);s.push(o)}return{fields:s,metadata:n}}function gR(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function dv(t,e,r){let n={...Qf(e),...r?pv(r.metadata):{}};return ym(t,e,n)}function pv(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var mv=p(()=>{"use strict";Nn()});function TR(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function _R(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function AR(t){let e=t.size(),r=new Uint32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function vR(t,e){if(!Object.prototype.hasOwnProperty.call(e,t))return t;let r=/^(.*)_([0-9]+)$/.exec(t),n=r?r[1]:t,s=r?BigInt(r[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${s}`);)s++;return`${n}_${s}`}function IR(t){if(t.quantization_transform){let{quantization_bits:e,min_values:r,range:n}=t.quantization_transform;if(e!==void 0&&r&&n!==void 0)return{type:"quantization",bits:e,origin:Array.from(r),range:n}}if(t.octahedron_transform?.quantization_bits!==void 0)return{type:"octahedron",bits:t.octahedron_transform.quantization_bits}}function LR(t){if(t.includeAttributes&&t.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function SR(t,e){for(let r of t.includeAttributes||t.excludeAttributes||[])if(!e.includes(r))throw new Error(`DracoLoader: selected attribute "${r}" does not exist`)}function ER(t){let e=rn(t);if(!e)throw new Error("Decoded mesh is missing positions");let r=t.POSITION;if(r?.transform?.type!=="quantization")return e;let{bits:n,origin:s,range:i}=r.transform,o=i/(2**n-1);return e.map(a=>a.map((c,u)=>s[u]+c*o))}var bv,yR,xR,wR,jc,gv=p(()=>{"use strict";Nn();mv();bv={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},yR={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},xR=2,wR=4,jc=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){LR(r);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);this._disableAttributeTransforms(r);let s=this.decoder.GetEncodedGeometryType(n),i=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,o=null;try{switch(s){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeArrayToMesh(n,n.byteLength,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(i,s,r),c=this._getMeshData(i,a,r),u=ER(c.attributes),f=hv(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...c,schema:f}}finally{o&&this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,r,n){let s=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:i}}_getDracoAttributes(e,r){let n={};for(let s=0;s<e.num_attributes();s++){let i=this.decoder.GetAttribute(e,s),o=this._getAttributeMetadata(e,s);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:s,metadata:o};let a=this._getQuantizationTransform(i,r);a&&(n[i.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(i,r);c&&(n[i.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,r,n){let s=this._getMeshAttributes(r,e,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(e,r,n){let s={},i={},a=Object.values(e.attributes).sort((c,u)=>c.attribute_index-u.attribute_index).map(c=>{let u=this._deduceAttributeName(c,n),f=vR(u,i);return i[f]=!0,c.name=f,{attributeName:f,loaderAttribute:c}});SR(n,Object.keys(i));for(let{attributeName:c,loaderAttribute:u}of a){if(!this._shouldExtractAttribute(c,u,n))continue;let f=this._getAttributeValues(r,u);if(f){let{value:l,size:d}=f;s[c]={value:l,size:d,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized,transform:IR(u)}}}return s}_shouldExtractAttribute(e,r,n){if(r.attribute_type===this.draco.POSITION){if(n.excludeAttributes?.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!n.excludeAttributes?.includes(e)}_getTriangleListIndices(e){let n=e.num_faces()*3,s=e.num_points()<=65536,i=n*(s?xR:wR),o=this.draco._malloc(i);try{if(s){if(!this.decoder.GetTrianglesUInt16Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,o,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),AR(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=yR[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let s=r.num_components,o=e.num_points()*s,a=o*n.BYTES_PER_ELEMENT,c=TR(this.draco,n),u,f=this.draco._malloc(a);try{let l=this.decoder.GetAttribute(e,r.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,l,c,a,f))throw new Error(`DRACO: Failed to decode attribute ${r.unique_id}.`);u=new n(this.draco.HEAPU8.buffer,f,o).slice()}finally{this.draco._free(f)}return{value:u,size:s}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[o,a]of Object.entries(r.extraAttributes||{}))if(a===n)return o;let s=r.attributeNameEntry||"name";if(e.metadata[s]){let o=e.metadata[s].string;return o==="COLOR"?"COLOR_0":o==="TEX_COORD"?"TEXCOORD_0":o}let i=e.attribute_type;for(let o in bv)if(this.draco[o]===i)return bv[o];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let s=0;s<n;s++){let i=this.metadataQuerier.GetEntryName(e,s);r[i]=this._getDracoMetadataField(e,i)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let s=_R(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,s=[...r,...n];for(let i of s)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>o.min_value(c))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeOctahedronTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}});async function na(t,e,r,n){let s=n?.reportProgress||e?.onProgress;s?.({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:i}=await r();(e?.signal||n?.signal)?.throwIfAborted();let o=new jc(i);try{let a=o.parseSync(t,e?.draco);return s?.({phase:"decode",completed:1,total:1,unit:"tasks"}),e?.draco?.shape==="arrow-table"?Ws(a,"arrow-table"):a}finally{o.destroy()}}var Rl=p(()=>{"use strict";Nn();gv()});var yv={};Z(yv,{DracoWASMLoaderWithParser:()=>FR});var DJ,BR,FR,xv=p(()=>{"use strict";Us();Gc();Rl();zc();({preload:DJ,...BR}=on),FR={...BR,parse:async(t,e,r)=>await na(t,e,async()=>await Bl(tn(e),"wasm",e?.draco?.decoderProfile),r)}});var wv={};Z(wv,{DracoJavaScriptLoaderWithParser:()=>MR});var VJ,OR,MR,Tv=p(()=>{"use strict";Us();Gc();Rl();zc();({preload:VJ,...OR}=on),MR={...OR,parse:async(t,e,r)=>await na(t,e,async()=>await Bl(tn(e),"js"),r)}});var _v={};Z(_v,{Draco3DLoaderWithParser:()=>DR});function NR(t){let e=t?.modules?.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var zJ,RR,DR,Av=p(()=>{"use strict";Gc();Rl();zc();({preload:zJ,...RR}=on),DR={...RR,parse:async(t,e,r)=>await na(t,e,async()=>await Gb(NR(e)),r)}});async function CR(t,e){let r=e;switch(kR(r)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(xv(),yv));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(Tv(),wv));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(Av(),_v));return n}default:throw new Error(`DracoLoader: unsupported backend "${r?.draco?.backend}"`)}}function kR(t){return t?.draco?.backend?t.draco.backend==="js"?"javascript":t.draco.backend:on.options.draco.backend}var on,zc=p(()=>{"use strict";fc();Pb();Ub();lv();on={dataType:null,batchType:null,...Vc,version:Pc,worker:!0,serializeWorkerResult:TT,deserializeWorkerResult:_T,options:{draco:fv},preload:CR}});var jb=p(()=>{"use strict";uv();zc()});function vv(t){let e={};for(let r in t){let n=t[r];if(r!=="indices"){let s=zb(n);e[r]=s}}return e}function zb(t){let{buffer:e,size:r,count:n}=GR(t);return{value:e,size:r,byteOffset:0,count:n,type:Ho(r),componentType:Gn(e)}}function GR(t){let e=t,r=1,n=0;return t&&t.value&&(e=t.value,r=t.size||1),e&&(ArrayBuffer.isView(e)||(e=VR(e,Float32Array)),n=e.length/r),{buffer:e,size:r,count:n}}function VR(t,e,r=!1){return t?Array.isArray(t)?new e(t):r&&!(t instanceof e)?new e(t):t:null}var Iv=p(()=>{"use strict";Ks()});var Wb={};Z(Wb,{decode:()=>jR,name:()=>UR,preprocess:()=>PR});function PR(t,e,r){let n=new ae(t);for(let s of n.meshes)for(let i of n.getReferences(s).primitives)n.getExtension(i,sa)}async function jR(t,e,r){if(!e?.gltf?.decompressMeshes)return;let n=new ae(t),s=[];for(let i of n.meshes)for(let o of n.getReferences(i).primitives)n.getExtension(o,sa)&&s.push(zR(n,o,e,r));await Promise.all(s),n.removeExtension(sa)}async function zR(t,e,r,n){let s=t.getExtension(e,sa);if(!s)return;let i=or(t.data,t.gltf.buffers,s.bufferView),o=zi(i.buffer,i.byteOffset,i.byteLength),a={...r,draco:{...r.draco,shape:"mesh",topology:"triangle-list",decoderProfile:r.draco?.decoderProfile||"gltf",extraAttributes:s.attributes}};delete a["3d-tiles"];let c=await lc(o,on,a,n),u=vv(c.attributes);for(let f of Object.keys(s.attributes))if(!Object.hasOwn(u,f))throw new Error(`glTF: Draco decompression did not produce attribute ${f}`);for(let[f,l]of Object.entries(u))if(f in e.attributes){let d=e.attributes[f],h=t.data.accessors?.[d];h?.normalized!==void 0&&(l.normalized=h.normalized),h?.min&&h?.max&&(l.min=h.min,l.max=h.max)}e.attributes={...e.attributes,...u},c.indices&&(e.indices=zb(c.indices),e.mode=4),t.removeExtension(e,sa),WR(e)}function WR(t){if(!t.attributes||Object.keys(t.attributes).length===0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}var sa,UR,Lv=p(()=>{"use strict";Ve();jb();He();Iv();Hi();sa="KHR_draco_mesh_compression",UR=sa});var qb={};Z(qb,{decode:()=>HR,name:()=>$R});async function HR(t,e){let r=new ae(t);if(!r.hasExtension(ia)||!e.gltf?.loadBuffers)return;let s=t.json.materials||[];for(let i=0;i<s.length;i++)XR(i,t,r);s.some(i=>$b(i).length>0)||r.removeExtension(ia)}function XR(t,e,r){let n=e.json.materials?.[t],s=$b(n),i=new Map,o=YR(e);for(let a of s){let c=a.extensions?.[ia];if(c){let u=c.texCoord??a.texCoord??0,f=ZR(u,c),l=i.get(f);if(!l){if(l={sourceTexCoord:u,texCoord:o,matrix:rD(c)},!QR(e,t,l))continue;o++,i.set(f,l)}a.texCoord=l.texCoord,JR(r,a,ia),a.extensions&&Object.keys(a.extensions).length===0&&delete a.extensions}}}function JR(t,e,r){e.extensions?.[r]!==void 0&&(t.recordRemovedExtension(r),delete e.extensions[r])}function $b(t){if(!t||typeof t!="object")return[];let e=t,r=[],n=e.extensions;Number.isFinite(e.index)&&n?.[ia]&&r.push(e);for(let[s,i]of Object.entries(e))s!=="extras"&&r.push(...$b(i));return r}function YR(t){let e=-1;for(let r of t.json.meshes||[])for(let n of r.primitives)for(let s of Object.keys(n.attributes)){let i=/^TEXCOORD_(\d+)$/.exec(s);i&&(e=Math.max(e,Number(i[1])))}return e+1}function ZR(t,e){let{offset:r=[0,0],rotation:n=0,scale:s=[1,1]}=e;return JSON.stringify([t,r,n,s])}function QR(t,e,r){let n=[],s=t.json.meshes||[];for(let i of s)for(let o of i.primitives){let a=o.material;Number.isFinite(a)&&e===a&&n.push(o)}if(n.length===0||n.some(i=>!eD(t,i,r.sourceTexCoord)))return!1;for(let i of n)tD(t,i,r);return!0}function eD(t,e,r){let n=e.attributes[`TEXCOORD_${r}`],s=n;if(ArrayBuffer.isView(s?.value))return!0;if(!Number.isFinite(n))return!1;let i=t.json.accessors?.[n];if(!i||i.bufferView===void 0||i.sparse)return!1;let o=t.json.bufferViews?.[i.bufferView];return!!(o&&t.buffers[o.buffer])}function tD(t,e,r){let{sourceTexCoord:n,texCoord:s,matrix:i}=r,o=e.attributes[`TEXCOORD_${n}`],a=o;if(ArrayBuffer.isView(a?.value)){let c=new Float32Array(a.count*2);for(let u=0;u<a.count;u++)Sv(a.value.subarray(u*2,u*2+2),a,i,c,u*2);Ev(s,a,e,t,c);return}if(Number.isFinite(o)){let c=t.json.accessors?.[o];if(c&&c.bufferView!==void 0){let u=t.json.bufferViews?.[c.bufferView];if(u){let{arrayBuffer:f,byteOffset:l}=t.buffers[u.buffer],d=(l||0)+(c.byteOffset||0)+(u.byteOffset||0),{ArrayType:h,length:m}=Mc(c,u),b=Oc[c.componentType],x=ml[c.type],g=u.byteStride||b*x,w=new Float32Array(m);for(let T=0;T<c.count;T++){let _=new h(f,d+T*g,2);Sv(_,c,i,w,T*x)}Ev(s,c,e,t,w)}}}}function Sv(t,e,r,n,s){let i=e.componentType===5120||e.componentType===5122,o=2**(Oc[e.componentType]*8-(i?1:0))-1;Dl.set(e.normalized?Math.max(t[0]/o,-1):t[0],e.normalized?Math.max(t[1]/o,-1):t[1],1),Dl.transformByMatrix3(r),n.set([Dl[0],Dl[1]],s)}function Ev(t,e,r,n,s){n.buffers.push({arrayBuffer:$i(s.buffer),byteOffset:0,byteLength:s.buffer.byteLength}),n.json.bufferViews=n.json.bufferViews||[];let i=n.json.bufferViews;i.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:i?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes[`TEXCOORD_${t}`]=o.length-1)}function rD(t){let{offset:e=[0,0],rotation:r=0,scale:n=[1,1]}=t,s=new Dn().set(1,0,0,0,1,0,e[0],e[1],1),i=qR.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=KR.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(i).multiplyRight(o)}var ia,$R,Dl,qR,KR,Bv=p(()=>{"use strict";Jf();Ks();Hm();He();Ve();ia="KHR_texture_transform",$R=ia,Dl=new Tc,qR=new Dn,KR=new Dn});var Kb={};Z(Kb,{decode:()=>sD,encode:()=>iD,name:()=>nD});async function sD(t){let e=new ae(t),r=e.getExtension(Qi);r&&(e.data.lights=r.lights,e.removeExtension(Qi));for(let n of e.nodes){let s=e.getExtension(n,Qi);s&&(n.light=s.light),e.removeExtension(n,Qi)}}async function iD(t){let e=new sn(t),{json:r}=e;if(r.lights){let n=e.addExtension(Qi);K(!n.lights),n.lights=r.lights,delete r.lights}if(e.json.lights){for(let n of e.json.lights){let s=n.node;e.addObjectExtension(s,Qi,n)}delete e.json.lights}}var Qi,nD,Fv=p(()=>{"use strict";Ki();He();Rc();Qi="KHR_lights_punctual",nD=Qi});var Hb={};Z(Hb,{decode:()=>aD,encode:()=>cD,name:()=>oD});async function aD(t){let e=new ae(t);for(let r of e.materials)e.getExtension(r,oa)&&(r.unlit=!0),e.removeExtension(r,oa);e.removeExtension(oa)}function cD(t){let e=new sn(t);for(let r of t.json.materials||[]){let n=r;n.unlit&&(delete n.unlit,e.addObjectExtension(r,oa,{}),e.registerRequiredExtension(oa))}for(let r of["extensionsUsed","extensionsRequired"])t.json[r]?.length===0&&delete t.json[r]}var oa,oD,Ov=p(()=>{"use strict";He();Rc();oa="KHR_materials_unlit",oD=oa});var Xb={};Z(Xb,{decode:()=>fD,encode:()=>lD,name:()=>uD});async function fD(t){let e=new ae(t),r=e.getExtension(Wc);if(r){let n=dD(r,e);for(let s of e.materials){let i=e.getExtension(s,Wc);i&&(s.technique=Object.assign({},i,n[i.technique]),s.technique.values=hD(s.technique,e)),e.removeExtension(s,Wc)}e.removeExtension(Wc)}}async function lD(t,e){}function dD(t,e){let{programs:r=[],shaders:n=[],techniques:s=[]}=t,i=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=i.decode(or(e.data,e.gltf.buffers,o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),s.forEach(o=>{o.program=r[o.program]}),s}function hD(t,e){let r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(n=>{t.uniforms[n].value&&!(n in r)&&(r[n]=t.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=e.resolveTexture(r[n].index,`technique.values.${n}.index`))}),r}var Wc,uD,Mv=p(()=>{"use strict";He();Hi();Wc="KHR_techniques_webgl",uD=Wc});var Jb={};Z(Jb,{decode:()=>mD,name:()=>pD});async function mD(t,e){let r=new ae(t);bD(r,e)}function bD(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Rv);r&&(e.gltf?.loadImages&&gD(t,r),yD(t,r))}function gD(t,e){let r=e.schema;if(!r)return;let n=r.classes,{featureTextures:s}=e;if(n&&s)for(let i in n){let o=n[i],a=wD(s,i);a&&_D(t,a,o)}}function yD(t,e){let r=e.schema;if(!r)return;let n=r.classes,s=e.featureTables;if(n&&s)for(let i in n){let o=xD(s,i);o&&TD(t,r,o)}}function xD(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function wD(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function TD(t,e,r){if(!r.class)return;let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let i in n.properties){let o=n.properties[i],a=r.properties?.[i];if(a){let c=AD(t,e,o,s,a);a.data=c}}}function _D(t,e,r){let n=e.class;for(let s in r.properties){let i=e?.properties?.[s];if(i){let o=ED(t,i,n);i.data=o}}}function AD(t,e,r,n,s){let i=[],o=s.bufferView,a=t.getTypedArrayForBufferView(o),c=vD(t,r,s,n),u=ID(t,r,s,n,c);return r.type==="STRING"||r.componentType==="STRING"?i=wl(n,a,c,u,r.type==="ARRAY"?r.componentCount:void 0):LD(r)&&(i=SD(r,n,a,c)),i}function vD(t,e,r,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Xo(t,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function ID(t,e,r,n,s){if(typeof r.stringOffsetBufferView<"u"){let i=s?Number(s[n]):n*(e.type==="ARRAY"&&e.componentCount||1);return Xo(t,r.stringOffsetBufferView,r.offsetType||"UINT32",i)}return null}function LD(t){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function SD(t,e,r,n){let s=t.type==="ARRAY",i=t.componentCount,o="SCALAR",a=t.componentType||t.type,c=Dc(o,a),u=r.byteLength/c,f=Jo(r,o,a,u);return s?n?Nc(f,e,n):i?Cc(f,e,i):[]:f}function ED(t,e,r){let n=t.data;if(!n.meshes)return[];let s=[];for(let i of n.meshes)for(let o of i.primitives)BD(t,r,e,s,o);return s}function BD(t,e,r,n,s){let i={channels:r.channels,...r.texture},o=Yo(t,i,s);o&&xl(t,e,o,n,s)}var Rv,pD,Dv=p(()=>{"use strict";He();Tl();Rv="EXT_feature_metadata",pD=Rv});async function Cv(t,e={},r){let n=Nv.filter(s=>Gv(s.name,e));for(let s of n)await s.preprocess?.(t,e,r)}async function kv(t,e={},r){let n=Nv.filter(s=>Gv(s.name,e));for(let s of n)await s.decode?.(t,e,r)}function Gv(t,e){let r=e?.gltf?.excludeExtensions||{};return Array.isArray(r)?!r.includes(t):!(t in r&&!r[t])}var Nv,Vv=p(()=>{"use strict";wA();TA();AA();vA();LA();EA();BA();kA();VA();UA();PA();jA();Lv();Bv();Lb();Fv();Ov();Mv();Dv();Nv=[Mb,Ob,Wb,wb,bb,_b,vb,Ib,Sb,Eb,Bb,Db,Rb,Nb,Kb,Hb,Xb,qb,Jb]});function Uv(t){let e=new ae(t);for(let r of e.images){let n=e.getExtension(r,Yb);n&&(r.bufferView=n.bufferView,r.mimeType=n.mimeType,delete r.uri),e.removeExtension(r,Yb)}for(let r of e.data.buffers||[])r.id==="binary_glTF"&&delete r.uri;e.removeExtension(Yb)}var Yb,Pv=p(()=>{"use strict";He();Yb="KHR_binary_glTF"});function zv(t,e){let r=t.accessors||[],n=t.bufferViews||[],s=OD(t),i=new Map;for(let[o,a]of r.entries()){let c=a.bufferView;if(c===void 0&&!a.byteStride){delete a.byteStride;continue}let u=n[c],f=s.get(o)||"unused",l=MD(a),d=a.byteStride===0?l:a.byteStride??l,h=a.byteOffset??0,m=u?.byteOffset??0,b=typeof a.componentType=="number"&&Object.hasOwn(Nl,a.componentType)?Nl[a.componentType]:0,x=f==="vertex",g=x?d>=l&&d>=4&&d<=252&&d%4===0&&h%4===0&&(m+h)%4===0:d===l;if(!u||!l||f==="mixed"||!Number.isInteger(d)||!g||x&&d>u.byteLength||!Number.isInteger(a.count)||a.count<1||!Number.isInteger(h)||h<0||!Number.isInteger(m)||m<0||h%b!==0||(m+h)%b!==0||a.type.startsWith("MAT")&&(m+h)%4!==0||!Number.isInteger(u.byteLength)||h+(a.count-1)*d+l>u.byteLength){e(o);continue}let w=`${c}:${f}:${x?d:0}`,T=i.get(w);if(T===void 0){let _={...u};delete _.id,delete _.byteStride,delete _.target,x?(_.byteStride=d,_.target=34962):f==="indices"&&(_.target=34963),T=n.length,n.push(_),i.set(w,T)}a.bufferView=T,delete a.byteStride}}function OD(t){let e=new Map,r=(n,s)=>{if(n===void 0)return;let i=e.get(n);e.set(n,i&&i!==s?"mixed":s)};for(let n of t.meshes||[])for(let s of n.primitives){for(let i of Object.values(s.attributes))r(i,"vertex");r(s.indices,"indices")}for(let n of t.animations||[])for(let s of n.samplers)r(s.input,"animation"),r(s.output,"animation");for(let n of t.skins||[])r(n.inverseBindMatrices,"inverseBind");return e}function MD(t){let e=typeof t.componentType=="number"&&Object.hasOwn(Nl,t.componentType)?Nl[t.componentType]:0,r=Object.hasOwn(jv,t.type)?jv[t.type]:0;if(!e||!r)return 0;let n=t.type==="MAT2"?2:t.type==="MAT3"?3:4;return t.type.startsWith("MAT")&&n*e%4!==0?0:(e||0)*r}var Nl,jv,Wv=p(()=>{"use strict";Nl={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},jv={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}});function $v(t,e,r){let n=t.nodes||[],s=t.skins||[],i=s.length,o=!1;for(let a=0;a<i;a++){let c=s[a],u=c.jointNames;if(!Array.isArray(u)||u.length===0||u.some(m=>typeof m!="string"||!m)||new Set(u).size!==u.length){r(`skin ${a} has invalid joint names`),o=!0;continue}let f=n.flatMap((m,b)=>m.skin===a?[b]:[]),l=(f.length?f:[void 0]).map(m=>RD(n,u,m,e,b=>r(`skin ${a} ${b}`))),d=l.some(m=>!m);o||=d;let h=new Map;for(let m of l){if(!m)continue;let b=`${m.skeletonIndex}:${m.jointIndices.join(",")}`,x=h.get(b);if(x===void 0){let g={...c,joints:m.jointIndices,skeleton:m.skeletonIndex};delete g.jointNames,c.bindShapeMatrix!==void 0&&CD(c.bindShapeMatrix)&&delete g.bindShapeMatrix,!d&&h.size===0?(x=a,s[a]=g):(delete g.id,x=s.length,s.push(g)),h.set(b,x)}m.nodeIndex!==void 0&&(n[m.nodeIndex].skin=x,delete n[m.nodeIndex].skeletons)}}if(!o)for(let a of n)delete a.jointName}function RD(t,e,r,n,s){let i=r===void 0?void 0:t[r].skeletons;if(i!==void 0&&(!Array.isArray(i)||i.some(l=>typeof l!="string"||!l)||new Set(i).size!==i.length))return s("has invalid skeleton roots"),null;let o=(i||[]).map(n),a=o.length?DD(t,o):t.map((l,d)=>d);if(!a)return s("has invalid or overlapping skeleton subtrees"),null;let c=[],u=new Map;for(let l of a){let d=t[l].jointName;if(d===void 0)continue;let h=u.get(d)||[];h.push(l),u.set(d,h)}for(let l of e){let d=u.get(l)||[];if(d.length!==1)return s(`cannot uniquely resolve joint ${l}`),null;c.push(d[0])}let f=ND(t,[...c,...o]);return f===void 0?(s("joints have no unambiguous common hierarchy root"),null):{nodeIndex:r,jointIndices:c,skeletonIndex:o.length===1?o[0]:f}}function DD(t,e){let r=new Set,n=[...e];for(;n.length;){let s=n.pop();if(!Number.isSafeInteger(s)||!t[s]||r.has(s))return null;r.add(s),n.push(...t[s].children||[])}return Array.from(r)}function ND(t,e){let r=new Map;for(let[i,o]of t.entries())for(let a of o.children||[]){if(!Number.isSafeInteger(a)||!t[a]||r.has(a))return;r.set(a,i)}let n=e.map(i=>{let o=[],a=new Set,c=i;for(;c!==void 0;){if(a.has(c))return[];a.add(c),o.push(c),c=r.get(c)}return o}),s=n.map(i=>new Set(i));return n[0].find(i=>s.every(o=>o.has(i)))}function CD(t){return Array.isArray(t)&&t.length===16&&Array.from(t).every((e,r)=>e===(r%5===0?1:0))}var qv=p(()=>{"use strict"});function Cl(t,e){if(!e.length)return;let r=new Map;for(let n of e){let s=r.get(n.bufferIndex)||[];s.push(n),r.set(n.bufferIndex,s)}t.buffers=[...t.buffers],t.json.bufferViews||=[];for(let[n,s]of r){let i=t.json.buffers[n],o=t.buffers[n],a=Te(i.byteLength,4),c=a+s.reduce((l,d)=>l+Te(d.bytes.byteLength,4),0),u=new ArrayBuffer(c),f=new Uint8Array(u);f.set(new Uint8Array(o.arrayBuffer,o.byteOffset,i.byteLength));for(let l of s){f.set(new Uint8Array(l.bytes),a);let d=t.json.bufferViews.length;t.json.bufferViews.push({buffer:n,byteOffset:a,byteLength:l.bytes.byteLength,...l.byteStride===void 0?{}:{byteStride:l.byteStride},...l.target===void 0?{}:{target:l.target}}),l.apply(d),a+=Te(l.bytes.byteLength,4)}i.byteLength=c,i.uri!==void 0&&(i.uri=`data:application/octet-stream;base64,${Up(u)}`),t.buffers[n]={arrayBuffer:u,byteOffset:0,byteLength:c}}}var Zb=p(()=>{"use strict";Ve()});function Kv(t,e){let r=new Map;for(let[n,s]of(t.json.skins||[]).entries()){if(s.bindShapeMatrix===void 0)continue;let i=s.bindShapeMatrix;if(!Hv(i)){e(`skin ${n} non-identity bindShapeMatrix requires a finite affine matrix`);continue}let o=`${s.inverseBindMatrices}:${i.join(",")}`,a=r.get(o);if(a){if((s.joints||s.jointNames||[]).length>a.count){e(`skin ${n} non-identity bindShapeMatrix has too few inverse-bind matrices`);continue}a.skins.push(s);continue}let c=kD(t,s,i);if(typeof c=="string"){e(`skin ${n} non-identity bindShapeMatrix ${c}`);continue}r.set(o,c)}Cl(t,Array.from(r.values(),n=>({bufferIndex:n.bufferIndex,bytes:n.matrixBytes,apply:s=>{t.json.accessors||=[];let i=t.json.accessors.length;t.json.accessors.push({bufferView:s,byteOffset:0,componentType:5126,count:n.count,type:"MAT4"});for(let o of n.skins)o.inverseBindMatrices=i,delete o.bindShapeMatrix}})))}function kD(t,e,r){let n=t.json.accessors?.[e.inverseBindMatrices],s=(e.joints||e.jointNames||[]).length;if(!n||n.componentType!==5126||n.type!=="MAT4"||n.normalized||n.sparse||n.extensions||Object.hasOwn(n,"byteStride")||!Number.isSafeInteger(n.count)||n.count<1)return"requires packed FLOAT MAT4 inverse-bind matrices";if(n.count<s)return"has too few inverse-bind matrices";let i=t.json.bufferViews?.[n.bufferView],o=i?.buffer,a=t.json.buffers?.[o],c=t.buffers[o];if(!i||o===void 0||!a||!c)return"requires a loaded inverse-bind buffer";if(i.extensions)return"does not support inverse-bind buffer-view extensions";let u=i.byteOffset??0,f=n.byteOffset??0,l=n.count*64;if(!(c.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteOffset)||c.byteOffset<0||!Number.isSafeInteger(c.byteLength)||c.byteLength<a.byteLength||c.byteOffset+c.byteLength>c.arrayBuffer.byteLength||!Number.isSafeInteger(u)||u<0||u%4!==0||!Number.isSafeInteger(i.byteLength)||i.byteLength<1||i.byteStride!==void 0||u+i.byteLength>a.byteLength||!Number.isSafeInteger(f)||f<0||f%4!==0||f+l>i.byteLength)return"has an invalid inverse-bind buffer layout";let d=new DataView(c.arrayBuffer),h=c.byteOffset+u+f,m=new ArrayBuffer(l),b=new DataView(m);for(let x=0;x<n.count;x++){let g=Array.from({length:16},(w,T)=>d.getFloat32(h+x*64+T*4,!0));if(!Hv(g))return"requires finite affine inverse-bind matrices";for(let w=0;w<4;w++)for(let T=0;T<4;T++){let _=0;for(let v=0;v<4;v++)_+=g[v*4+T]*r[w*4+v];if(!Number.isFinite(Math.fround(_)))return"produces non-finite FLOAT matrix values";b.setFloat32(x*64+(w*4+T)*4,_,!0)}}return{bufferIndex:o,count:n.count,matrixBytes:m,skins:[e]}}function Hv(t){if(!Array.isArray(t)||t.length!==16)return!1;for(let e=0;e<16;e++)if(!Number.isFinite(t[e]))return!1;return t[3]===0&&t[7]===0&&t[11]===0&&t[15]===1}var Xv=p(()=>{"use strict";Zb()});function Yv(t){let e=t.accessors||[],r=new Map,n=new Map,s=eg(t),i=(o,a)=>{if(!Number.isSafeInteger(o)||o<0||!Object.hasOwn(e,o))return o;let c=e[o];if(!c)return o;let u=r.get(o)||new Map,f=`${a.usage}:${a.mode}:${["unit","signed","direction"].includes(a.mode)?a.semantic?.split("_")[0]:""}:${a.hasOpaqueConsumer?"opaque":""}`,l=u.get(f);return l===void 0&&(l=u.size?e.length:o,u.size&&e.push({...c}),u.set(f,l),n.set(l,a),r.set(o,u)),l};for(let o of t.meshes||[])for(let a of o.primitives){for(let[c,u]of Object.entries(a.attributes)){let f=e[u],l=["NORMAL","TANGENT"].includes(c)&&f&&[5120,5121,5122,5123].includes(f.componentType)?"direction":/^JOINTS_\d+$/.test(c)?"joints":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&f&&[5120,5122].includes(f.componentType)?"signed":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&f&&[5121,5123].includes(f.componentType)&&!f.normalized?"unit":/^WEIGHTS_\d+$/.test(c)?"weights":"copy";a.attributes[c]=i(u,{usage:"vertex",mode:l,semantic:c,...["signed","direction"].includes(l)?{hasOpaqueConsumer:s}:{}})}a.indices!==void 0&&(a.indices=i(a.indices,{usage:"indices",mode:"copy",hasOpaqueConsumer:a.extensions!==void 0}))}for(let o of t.animations||[])for(let a of o.samplers)a.input=i(a.input,{usage:"animation",mode:"copy"}),a.output=i(a.output,{usage:"animation",mode:"copy"});for(let o of t.skins||[])o.inverseBindMatrices!==void 0&&(o.inverseBindMatrices=i(o.inverseBindMatrices,{usage:"inverseBind",mode:"copy"}));for(let o=0;o<e.length;o++)n.has(o)||n.set(o,{usage:"unused",mode:"copy"});return n}function Zv(t,e,r,n,s){let i=[],o=[];for(let[a,c]of e){let u=t.json.accessors[a],f=c.mode==="joints"||c.mode==="weights"||c.semantic?.startsWith("WEIGHTS_"),l=!!(f&&["SCALAR","VEC2","VEC3"].includes(u.type)),d=c.mode==="weights"&&(u.type!=="VEC4"||![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized),h=c.mode==="signed",m=c.mode==="direction",b=h||m,x=c.mode==="joints"&&(![5121,5123].includes(u.componentType)||u.normalized||u.type!=="VEC4");if(!r.has(a)&&!x&&!d&&!b&&!l&&c.usage!=="indices"&&c.mode!=="unit")continue;let g=$c(t,a);if(typeof g=="string"){n(`accessor ${a} layout requires binary repacking: ${g}`);continue}if(f&&!["SCALAR","VEC2","VEC3","VEC4"].includes(u.type)){n(`accessor ${a} skin influences require scalar/vector data`);continue}if(c.mode==="weights"&&(![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized||u.componentType!==5126&&!u.normalized)){n(`accessor ${a} weights require FLOAT or normalized unsigned data`);continue}let w=u.componentType,T=u.normalized;if(b){if(c.hasOpaqueConsumer){n(`accessor ${a} integer conversion cannot interpret opaque extension consumers`);continue}if(!(m?[c.semantic==="NORMAL"?"VEC3":"VEC4"]:c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)||T!==void 0&&typeof T!="boolean"){n(`accessor ${a} integer ${c.semantic} has incompatible shape or normalization`);continue}let se=!0;for(let xe=0;xe<u.count;xe++)if(m){let Et=Math.hypot(Math.fround(aa(g,xe,0)),Math.fround(aa(g,xe,1)),Math.fround(aa(g,xe,2)));(Math.abs(Et-1)>1e-5||c.semantic==="TANGENT"&&![-1,1].includes(aa(g,xe,3)))&&(se=!1)}else if(!c.semantic?.startsWith("TEXCOORD_"))for(let Et=0;Et<g.rows;Et++){let cr=aa(g,xe,Et);(cr<0||cr>1)&&(se=!1)}if(!se){n(m?`accessor ${a} integer ${c.semantic} requires unit directions and tangent handedness of +/-1; values are not repaired`:`accessor ${a} signed ${c.semantic} values must remain in [0, 1]`);continue}w=5126,T=!1}if(c.usage==="indices"){if(u.type!=="SCALAR"||![5121,5123,5125].includes(w)||T){n(`index accessor ${a} requires unnormalized unsigned SCALAR data`);continue}let ce=0;for(let xe=0;xe<u.count;xe++)ce=Math.max(ce,Pt(g,xe,0));if(ce===(w===5121?255:w===5123?65535:4294967295)){if(c.hasOpaqueConsumer){n(`index accessor ${a} cannot widen opaque primitive extension semantics`);continue}if(w===5125){n(`index accessor ${a} contains the unrepresentable uint32 restart value`);continue}w=w===5121?5123:5125}if(!r.has(a)&&w===u.componentType)continue}if(x||c.mode==="unit"){if(x&&u.normalized){n(`accessor ${a} joint indices require unnormalized scalar/vector data`);continue}if(c.mode==="unit"&&!(c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)){n(`accessor ${a} integer ${c.semantic} has an incompatible shape`);continue}let ce=0,se=!0;for(let xe=0;xe<u.count;xe++)for(let Et=0;Et<g.rows*g.columns;Et++){let cr=Pt(g,xe,Et);(!Number.isInteger(cr)||cr<0||x&&cr>65535)&&(se=!1),ce=Math.max(ce,cr)}if(!se){n(`accessor ${a} joint indices require finite integers in [0, 65535]`);continue}if(x)w=ce<=255?5121:5123,T=!1;else if(ce<=1)w=5126,T=!1;else if(n(`accessor ${a} ambiguous integer attribute normalization; best effort assumes normalized unsigned values`),T=!0,!r.has(a)&&!l){o.push(()=>{u.normalized=!0});continue}}let _=l?4:g.rows,v=Qb[w],I=g.columns>1?Te(g.rows*v,4):_*v,Y=I*g.columns,$=c.usage==="vertex"?Te(Y,4):Y,re=new ArrayBuffer(u.count*$),pe=new Uint8Array(re),Re=new Uint8Array(g.data.buffer),De=new DataView(re);for(let ce=0;ce<u.count;ce++)for(let se=0;se<g.columns;se++)if(w===u.componentType){let xe=g.byteOffset+ce*g.byteStride+se*g.rows*g.componentSize;pe.set(Re.subarray(xe,xe+g.rows*g.componentSize),ce*$+se*I)}else for(let xe=0;xe<g.rows;xe++){let Et=(b?aa:Pt)(g,ce,se*g.rows+xe),cr=ce*$+se*I+xe*v;w===5126?De.setFloat32(cr,Et,!0):w===5121?De.setUint8(cr,Et):w===5125?De.setUint32(cr,Et,!0):De.setUint16(cr,Et,!0)}i.push({bufferIndex:g.bufferIndex,bytes:re,...c.usage==="vertex"?{byteStride:$,target:34962}:c.usage==="indices"?{target:34963}:{},apply:ce=>{b&&s(`Converted ${h?"signed":"integer"} ${c.semantic} accessor ${a} to FLOAT, preserving ${g.accessor.normalized?"explicitly normalized":"literal"} values.`),c.usage==="indices"&&w!==u.componentType&&s(`Widened index accessor ${a} to preserve a glTF 1 index reserved by glTF 2.`),u.bufferView=ce,u.byteOffset=0,delete u.byteStride,(w!==u.componentType||l)&&(delete u.min,delete u.max),u.componentType=w,l&&(u.type="VEC4"),T?u.normalized=!0:delete u.normalized}})}Cl(t,i);for(let a of o)a()}function aa(t,e,r){let n=Pt(t,e,r);if(t.accessor.normalized!==!0)return n;let s=GD[t.accessor.componentType];return Math.max(n/s,-1)}function eg(t){let e=[t],r=new Set;for(;e.length;){let n=e.pop();if(!(!n||typeof n!="object"||r.has(n))){r.add(n);for(let[s,i]of Object.entries(n))if(s!=="extras"){if(s==="extensions"&&i&&typeof i=="object"&&Object.keys(i).some(o=>!["KHR_materials_unlit","KHR_materials_common"].includes(o)))return!0;e.push(i)}}}return!1}function $c(t,e){let r=t.json.accessors?.[e];if(!r||!Number.isSafeInteger(e)||e<0)return"invalid accessor reference";let n=typeof r.componentType=="number"&&Object.hasOwn(Qb,r.componentType)?Qb[r.componentType]:void 0,s=typeof r.type=="string"&&Object.hasOwn(Jv,r.type)?Jv[r.type]:void 0;if(!n||!s||!Number.isSafeInteger(r.count)||r.count<1)return"invalid component type, shape, or count";let[i,o]=s,a=t.json.bufferViews?.[r.bufferView],c=t.json.buffers?.[a?.buffer],u=t.buffers[a?.buffer];if(!a||!c||!u)return"requires a loaded accessor buffer";if(r.sparse||r.extensions||a.extensions)return"sparse or extension-bearing data is unsupported";let f=i*o*n,l=r.byteStride??a.byteStride??f,d=l===0?f:l,h=r.byteOffset??0,m=a.byteOffset??0;return!(u.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(d)||d<f||r.byteStride!==void 0&&r.byteStride>255||!Number.isSafeInteger(h)||h<0||!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteLength)||c.byteLength<1||m+a.byteLength>c.byteLength||h+(r.count-1)*d+f>a.byteLength||!Number.isSafeInteger(u.byteOffset)||u.byteOffset<0||!Number.isSafeInteger(u.byteLength)||u.byteLength<c.byteLength||u.byteOffset+u.byteLength>u.arrayBuffer.byteLength?"invalid source buffer span or stride":{accessor:r,bufferIndex:a.buffer,componentSize:n,rows:i,columns:o,byteStride:d,data:new DataView(u.arrayBuffer),byteOffset:u.byteOffset+m+h}}function Pt(t,e,r){let n=t.byteOffset+e*t.byteStride+r*t.componentSize;switch(t.accessor.componentType){case 5120:return t.data.getInt8(n);case 5121:return t.data.getUint8(n);case 5122:return t.data.getInt16(n,!0);case 5123:return t.data.getUint16(n,!0);case 5125:return t.data.getUint32(n,!0);default:return t.data.getFloat32(n,!0)}}var Qb,GD,Jv,qc=p(()=>{"use strict";Ve();Zb();Qb={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},GD={5120:127,5121:255,5122:32767,5123:65535},Jv={SCALAR:[1,1],VEC2:[2,1],VEC3:[3,1],VEC4:[4,1],MAT2:[2,2],MAT3:[3,3],MAT4:[4,4]}});function eI(t,e){let r=t.asset;r.premultipliedAlpha&&e("asset premultipliedAlpha rendering"),Qv(r,["profile","premultipliedAlpha"]);for(let[n,s]of(t.textures||[]).entries()){let i=s;for(let[o,a]of Object.entries({format:6408,internalFormat:6408,target:3553,type:5121}))i[o]!==void 0&&i[o]!==a&&e(`texture ${n} non-default ${o} rendering`);Qv(i,["format","internalFormat","target","type"])}}function Qv(t,e){let r={};for(let a of e)Object.hasOwn(t,a)&&(r[a]=t[a],delete t[a]);if(!Object.keys(r).length)return;let n=tg(t.extras)?t.extras:t.extras===void 0?{}:{originalExtras:t.extras},s=tg(n.gltf1)?n.gltf1:n.gltf1===void 0?{}:{originalExtras:n.gltf1},i=tg(s.legacyFields)?s.legacyFields:s.legacyFields===void 0?{}:{originalExtras:s.legacyFields},o=Object.keys(r).some(a=>Object.hasOwn(i,a));t.extras={...n,gltf1:{...s,legacyFields:{...i,...r,...o?{originalExtras:i}:{}}}}}function tg(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function rg(t){let e=/^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(t);if(e){let r=e[1].startsWith("JOINT")?"JOINTS":e[1].startsWith("WEIGHT")?"WEIGHTS":e[1],n=Number(e[2]||0);if(!Number.isSafeInteger(n)||n>999999999)throw new Error(`glTF v1: invalid attribute set index ${t}`);return`${r}_${n}`}return["POSITION","NORMAL","TANGENT"].includes(t)||t.startsWith("_")||t.includes(":")?t:`_${t}`}var tI=p(()=>{"use strict"});function rI(t,e,r){for(let[s,i]of(t.animations||[]).entries()){let l=function(d,h,m){try{let b=typeof d=="string"?e(d,h):d,x=h==="accessor"?t.accessors:t.nodes;if(typeof b=="number"&&Number.isSafeInteger(b)&&b>=0&&x?.[b])return b}catch{}return r(`animation ${s} ${m} unresolved ${h} reference`),d};var n=l;let o=i,a=o.parameters||{},c=new Map,u=i.samplers,f=Array.isArray(u)?u.map((d,h)=>[String(h),d]):Object.entries(u||{});i.samplers=f.map(([d,h],m)=>{c.set(d,m);for(let b of["input","output"]){let x=h[b],g=Object.hasOwn(a,x)?a[x]:x;h[b]=l(g,"accessor",`sampler ${d} ${b}`)}return h.interpolation??="LINEAR",h}),delete o.parameters;for(let[d,h]of(i.channels||[]).entries()){if(typeof h.sampler=="string"){let b=c.get(h.sampler);b===void 0?r(`animation ${s} channel ${d} unresolved sampler ${h.sampler}`):h.sampler=b}let m=h.target;m?.id!==void 0?(m.node=l(m.id,"node",`channel ${d} target`),delete m.id):typeof m?.node=="string"&&(m.node=l(m.node,"node",`channel ${d} target`))}}}var nI=p(()=>{"use strict"});function sI(t,e,r){let n=t.nodes||[],s=new Map;for(let[a,c]of n.entries())for(let u of c.children||[])s.set(u,s.has(u)?null:a);let i=[];for(let[a,c]of(t.scenes||[]).entries()){let u=o(c.nodes||[]);if(!u){e(`scene ${a} invalid node hierarchy`);continue}for(let f of Array.from(u)){let l=t.skins?.[n[f].skin];if(!Array.isArray(l?.joints)||!l.joints.length||l.skeleton===void 0||u.has(l.skeleton)&&l.joints.every(b=>u.has(b)))continue;let d=l.skeleton,h=new Set;for(;!h.has(d)&&typeof s.get(d)=="number";)h.add(d),d=s.get(d);let m=o([d]);if(h.has(d)||s.get(d)===null||!m||!l.joints.every(b=>m.has(b))||Array.from(m).some(b=>u.has(b)||n[b].mesh!==void 0||n[b].camera!==void 0||n[b].extensions!==void 0)){e(`scene ${a} skin ${n[f].skin} cannot safely attach detached skeleton`);continue}for(let b of m)u.add(b);i.push(()=>{c.nodes||=[],c.nodes.push(d),r(`Attached detached skeleton root ${d} to scene ${a}.`)})}}for(let a of i)a();function o(a){let c=new Set,u=[...a];for(;u.length;){let f=u.pop();if(!Number.isSafeInteger(f)||!n[f]||c.has(f)||s.get(f)===null)return null;c.add(f),u.push(...n[f].children||[])}return c}}var iI=p(()=>{"use strict"});function oI(t,e){for(let[r,n]of(t.cameras||[]).entries()){let s=n.perspective,i=n.orthographic;(n.type==="perspective"?s&&Kc(s.yfov)&&Kc(s.znear)&&(s.aspectRatio===void 0||Kc(s.aspectRatio))&&(s.zfar===void 0||Kc(s.zfar)&&s.zfar>s.znear):n.type==="orthographic"&&i&&Number.isFinite(i.xmag)&&i.xmag!==0&&Number.isFinite(i.ymag)&&i.ymag!==0&&Number.isFinite(i.znear)&&i.znear>=0&&Kc(i.zfar)&&i.zfar>i.znear)||e(`camera ${r} invalid projection parameters`)}}function Kc(t){return Number.isFinite(t)&&t>0}var aI=p(()=>{"use strict"});function cI(t,e,r){let n=new Map,s=new Set;for(let[i,o]of(t.json.meshes||[]).entries())for(let[a,c]of o.primitives.entries()){let u=`mesh ${i} primitive ${a}`;for(let b of["TEXCOORD","COLOR","JOINTS","WEIGHTS"])Object.keys(c.attributes).filter(g=>g.startsWith(`${b}_`)).map(g=>Number(g.slice(b.length+1))).sort((g,w)=>g-w).some((g,w)=>g!==w)&&r(`${u} ${b} sets must be contiguous starting at zero`);for(let[b,x]of Object.entries(c.attributes)){let g=b.split("_")[0];if(!["NORMAL","TANGENT","COLOR","TEXCOORD","JOINTS","WEIGHTS"].includes(g))continue;let w=`${g}:${x}`;if(s.has(w))continue;s.add(w);let T=e(x,`${b} accessor ${x}`);T&&VD(T,g,`${b} accessor ${x}`,r)}let f=Object.values(c.attributes).map(b=>(Number.isSafeInteger(b)?t.json.accessors?.[b]:void 0)?.count);if(!f.length||f.some(b=>!Number.isSafeInteger(b)||b<1)){r(`${u} requires valid vertex attribute accessors`);continue}f.some(b=>b!==f[0])&&r(`${u} vertex attribute counts do not match`);let l=c.indices===void 0?f[0]:t.json.accessors?.[c.indices]?.count,d=c.mode===void 0?4:c.mode;if(!Number.isInteger(d)||d<0||d>6?r(`${u} requires a primitive mode in [0, 6]`):(!c.extensions||!Object.keys(c.extensions).length)&&(!Number.isSafeInteger(l)||l<1||d===1&&l%2!==0||[2,3].includes(d)&&l<2||d===4&&l%3!==0||[5,6].includes(d)&&l<3)&&r(`${u} draw count ${l} is incompatible with primitive mode ${d}`),c.indices===void 0)continue;let h=e(c.indices,`${u} indices`);if(!h)continue;if(h.accessor.type!=="SCALAR"||![5121,5123,5125].includes(h.accessor.componentType)||h.accessor.normalized){r(`${u} indices require unnormalized unsigned SCALAR data`);continue}let m=n.get(c.indices);if(m===void 0){m=0;for(let b=0;b<h.accessor.count;b++)m=Math.max(m,Pt(h,b,0));n.set(c.indices,m)}f.some(b=>m>=b)&&r(`${u} index ${m} is outside its vertex attribute counts`)}}function VD(t,e,r,n){let s=t.accessor,i=s.componentType===5126&&!s.normalized,o=[5121,5123].includes(s.componentType)&&s.normalized===!0,a=s.normalized===void 0||typeof s.normalized=="boolean",c=e==="NORMAL"?s.type==="VEC3"&&i:e==="TANGENT"?s.type==="VEC4"&&i:e==="JOINTS"?s.type==="VEC4"&&[5121,5123].includes(s.componentType)&&!s.normalized:e==="COLOR"?["VEC3","VEC4"].includes(s.type)&&(i||o):s.type===(e==="TEXCOORD"?"VEC2":"VEC4")&&(i||o);if(!a||!c){n(`${r} has incompatible core attribute shape, component type, or normalization`);return}for(let u=0;u<s.count;u++){let f=Array.from({length:t.rows},(l,d)=>Pt(t,u,d));if(f.some(l=>!Number.isFinite(l))||["NORMAL","TANGENT"].includes(e)&&Math.abs(Math.hypot(...f.slice(0,3))-1)>1e-5||e==="TANGENT"&&f[3]!==1&&f[3]!==-1||["COLOR","WEIGHTS"].includes(e)&&i&&f.some(l=>l<0||l>1)){n(`${r} requires finite core values, unit directions, tangent handedness \xB11, and colors/weights in [0, 1]`);return}}}var uI=p(()=>{"use strict";qc()});function fI(t,e,r){let n=new Map,s=new Set,i=[],o=(l,d)=>{let h=n.get(l);return h===void 0&&(h=$c(t,l),n.set(l,h)),typeof h=="string"?(s.has(l)||(s.add(l),e(`${d}: ${h}`)),null):h},a=new Set;for(let l of t.json.meshes||[])for(let d of l.primitives)d.attributes.POSITION!==void 0&&a.add(d.attributes.POSITION);for(let l of a){let d=o(l,`POSITION accessor ${l}`);if(d){if(!kl(d,"VEC3")){e(`POSITION accessor ${l} requires unnormalized FLOAT VEC3 data`);continue}u(d,l)}}f(),c(),UD(t,o,e),cI(t,o,e);for(let l of i)l();function c(){for(let[l,d]of(t.json.skins||[]).entries()){if(d.inverseBindMatrices===void 0)continue;let h=`skin ${l} inverse-bind matrices`,m=o(d.inverseBindMatrices,h);if(m){if(!kl(m,"MAT4")||m.accessor.count<(d.joints?.length||0)){e(`${h} require FLOAT MAT4 data with at least one matrix per joint`);continue}for(let b=0;b<m.accessor.count;b++){let x=Array.from({length:16},(g,w)=>Pt(m,b,w));if(x.some(g=>!Number.isFinite(g))||x[3]!==0||x[7]!==0||x[11]!==0||x[15]!==1){e(`${h} require finite affine matrices`);break}}}}}function u(l,d){let h=new Array(l.rows).fill(1/0),m=new Array(l.rows).fill(-1/0);for(let b=0;b<l.accessor.count;b++)for(let x=0;x<l.rows;x++){let g=Pt(l,b,x);if(!Number.isFinite(g))return e(`accessor ${d} non-finite values cannot supply required bounds`),!1;h[x]=Math.min(h[x],g),m[x]=Math.max(m[x],g)}return(JSON.stringify(l.accessor.min)!==JSON.stringify(h)||JSON.stringify(l.accessor.max)!==JSON.stringify(m))&&i.push(()=>{l.accessor.min=h,l.accessor.max=m,r(`Calculated required bounds for accessor ${d}.`)}),!0}function f(){let l=new Set,d=new Set;for(let[h,m]of(t.json.animations||[]).entries()){let b=new Set;(!m.samplers.length||!m.channels?.length)&&e(`animation ${h} requires samplers and channels`);for(let[x,g]of m.samplers.entries()){let w=`animation ${h} sampler ${x}`;if(["LINEAR","STEP"].includes(g.interpolation??"LINEAR")||e(`${w} unsupported interpolation ${g.interpolation}`),!l.has(g.input)){l.add(g.input);let T=o(g.input,`${w} input`);if(T)if(!kl(T,"SCALAR"))e(`${w} time input requires unnormalized FLOAT SCALAR data`);else{let _=-1/0,v=!0;for(let I=0;I<T.accessor.count;I++){let Y=Pt(T,I,0);(!Number.isFinite(Y)||Y<0||Y<=_)&&(v=!1),_=Y}v?u(T,g.input):e(`${w} times must be finite, nonnegative, and strictly increasing`)}}}for(let[x,g]of(m.channels||[]).entries()){let w=`animation ${h} channel ${x}`,T=Number.isSafeInteger(g.sampler)?m.samplers[g.sampler]:void 0,_=g.target,v=Number.isSafeInteger(_?.node)?t.json.nodes?.[_.node]:void 0;if(!T||!v||!["translation","rotation","scale"].includes(_?.path)){e(`${w} invalid sampler, node, or TRS target`);continue}v.matrix!==void 0&&e(`${w} matrix node requires TRS decomposition`);let I=`${_.node}:${_.path}`;if(b.has(I)&&e(`${w} duplicate node/path target`),b.add(I),!["LINEAR","STEP"].includes(T.interpolation??"LINEAR"))continue;let Y=t.json.accessors?.[T.input],$=o(T.output,`${w} output`);if(!$)continue;if(!kl($,_.path==="rotation"?"VEC4":"VEC3")||$.accessor.count!==Y?.count){e(`${w} output shape, type, or count does not match its target and keys`);continue}let re=`${T.output}:${_.path}`;if(!d.has(re)){d.add(re);for(let pe=0;pe<$.accessor.count;pe++){let Re=Array.from({length:$.rows},(De,ce)=>Pt($,pe,ce));if(Re.some(De=>!Number.isFinite(De))||_.path==="rotation"&&Math.abs(Math.hypot(...Re)-1)>1e-5){e(`${w} output requires finite values and unit rotation quaternions`);break}}}}}}}function kl(t,e){return t.accessor.componentType===5126&&!t.accessor.normalized&&t.accessor.type===e}function UD(t,e,r){let n=new Set;for(let s of t.json.nodes||[]){let i=t.json.skins?.[s.skin],o=t.json.meshes?.[s.mesh];if(!Array.isArray(i?.joints)||!i.joints.length||!o)continue;let a=`${s.mesh}:${s.skin}`;if(!n.has(a)){n.add(a);for(let[c,u]of o.primitives.entries()){let f=`mesh ${s.mesh} primitive ${c} skin ${s.skin}`,l=Object.keys(u.attributes).filter(b=>/^JOINTS_\d+$/.test(b)).map(b=>Number(b.slice(7))).sort((b,x)=>b-x),d=Object.keys(u.attributes).filter(b=>/^WEIGHTS_\d+$/.test(b)).map(b=>Number(b.slice(8))).sort((b,x)=>b-x);if(!l.length&&!d.length){r(`${f} requires JOINTS_0 and WEIGHTS_0 skin influences`);continue}if(JSON.stringify(l)!==JSON.stringify(d)||l.some((b,x)=>b!==x)){r(`${f} requires matching contiguous joint/weight sets starting at zero`);continue}let h=t.json.accessors?.[u.attributes.POSITION]?.count,m=l.map(b=>({joints:e(u.attributes[`JOINTS_${b}`],`${f} joint set ${b}`),weights:e(u.attributes[`WEIGHTS_${b}`],`${f} weight set ${b}`)}));if(!m.some(({joints:b,weights:x})=>!b||!x)){if(m.some(({joints:b,weights:x})=>b.accessor.type!=="VEC4"||x.accessor.type!=="VEC4"||![5121,5123].includes(b.accessor.componentType)||b.accessor.normalized||!(x.accessor.componentType===5126&&!x.accessor.normalized||[5121,5123].includes(x.accessor.componentType)&&x.accessor.normalized)||b.accessor.count!==x.accessor.count||h!==void 0&&b.accessor.count!==h||b.accessor.count!==m[0].joints.accessor.count)){r(`${f} incompatible influence accessor types or vertex counts`);continue}for(let b=0;b<m[0].joints.accessor.count;b++){let x=0,g=0,w=!0,T=new Set;for(let{joints:_,weights:v}of m){let I=v.accessor.normalized?v.accessor.componentType===5121?255:65535:1;for(let Y=0;Y<4;Y++){let $=Pt(_,b,Y),re=Pt(v,b,Y)/I;($>=i.joints.length||!Number.isFinite(re)||re<0||re>1)&&(w=!1),re>0&&(T.has($)&&(w=!1),T.add($),g++),x+=re}}if(!w||Math.abs(x-1)>2e-7*Math.max(g,1)){r(`${f} invalid palette index, repeated weighted joint, or weights not summing to one at vertex ${b}`);break}}}}}}}var lI=p(()=>{"use strict";qc();uI()});function dI(t,e,r,n){let s=new Map,i=new Map,o=new Map;for(let[c,u]of(t.json.buffers||[]).entries()){let f=`buffer ${c}`,l=t.buffers[c],d=!!(l&&l.arrayBuffer instanceof ArrayBuffer&&Number.isSafeInteger(l.byteOffset)&&l.byteOffset>=0&&Number.isSafeInteger(l.byteLength)&&l.byteLength>=0&&Number.isSafeInteger(l.byteOffset+l.byteLength)&&l.byteOffset+l.byteLength<=l.arrayBuffer.byteLength);l&&!d&&r(`${f} invalid borrowed payload span`);let h=u.byteLength;if(h===void 0&&e.has(c)&&!u.extensions&&d&&l.byteLength>0&&(h=l.byteLength,i.set(c,h)),!Number.isSafeInteger(h)||h<1){r(`${f} requires a positive byteLength; missing lengths require unambiguous loaded URI data`);continue}s.set(c,h),d&&l.byteLength<h&&r(`${f} declared byteLength exceeds its loaded payload`)}let a=eg(t.json);for(let[c,u]of(t.json.bufferViews||[]).entries()){let f=u.byteOffset===void 0?0:u.byteOffset,l=s.get(u.buffer),d=u.byteLength===void 0&&!a&&l!==void 0?PD(t,c,s):u.byteLength;u.byteLength===void 0&&d!==void 0&&o.set(c,d),(!Number.isSafeInteger(u.buffer)||u.buffer<0||l===void 0||!Number.isSafeInteger(f)||f<0||!Number.isSafeInteger(d)||(d??0)<1||!Number.isSafeInteger(f+(d??0))||f+(d??0)>l)&&r(`bufferView ${c} requires a valid buffer reference and contained positive byte span`)}for(let[c,u]of o)t.json.bufferViews[c].byteLength=u,n(`Inferred bufferView ${c} byteLength from its dense accessor spans.`);for(let[c,u]of i)t.json.buffers[c].byteLength=u,n(`Inferred buffer ${c} byteLength from its loaded URI payload.`)}function PD(t,e,r){let n=t.json.bufferViews[e];if(n.byteOffset!==void 0&&(!Number.isSafeInteger(n.byteOffset)||n.byteOffset<0)||n.byteStride!==void 0&&(!Number.isSafeInteger(n.byteStride)||n.byteStride<0)||t.json.images?.some(a=>a.bufferView===e)||t.json.accessors?.some(a=>!!a.sparse))return;let s=r.get(n.buffer)-(n.byteOffset??0),i={...t,json:{...t.json,buffers:t.json.buffers.map((a,c)=>({...a,byteLength:r.get(c)})),bufferViews:t.json.bufferViews.map((a,c)=>c===e?{...a,byteLength:s}:a)}},o=0;for(let[a,c]of(t.json.accessors||[]).entries()){if(c.bufferView!==e)continue;let u=c;for(let d of[u.byteOffset,u.byteStride])if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))return;let f=$c(i,a);if(typeof f=="string")return;let l=(c.byteOffset??0)+(c.count-1)*f.byteStride+f.rows*f.columns*f.componentSize;o=Math.max(o,l)}return o>0?o:void 0}var hI=p(()=>{"use strict";qc()});function pI(t,e,r){let n=new Map;for(let i of t.animations||[])for(let o of i.channels||[]){let a=o.target?.node;if(!Number.isSafeInteger(a))continue;let c=n.get(a)||new Set;c.add(o.target.path),n.set(a,c)}let s=[];for(let[i,o]of n){let a=t.nodes?.[i];if(a?.matrix===void 0)continue;let c=`animated matrix node ${i}`;if(o.size!==1||!o.has("translation")){e(`${c} rotation or scale animation requires an unambiguous TRS basis`);continue}if(a.translation!==void 0||a.rotation!==void 0||a.scale!==void 0||a.extensions!==void 0){e(`${c} has conflicting TRS fields or opaque extensions`);continue}let u=jD(a.matrix);if(!u){e(`${c} requires a finite affine, nonsingular matrix without shear`);continue}s.push(()=>{Object.assign(a,u),delete a.matrix,r(`Decomposed translation-only animated matrix node ${i}, preserving its linear transform.`)})}for(let i of s)i()}function jD(t){if(!Array.isArray(t)||t.length!==16||Array.from(t).some(a=>!Number.isFinite(a))||t[3]!==0||t[7]!==0||t[11]!==0||t[15]!==1)return null;let e=[0,1,2].map(a=>Math.hypot(...t.slice(a*4,a*4+3)));if(e.some(a=>!Number.isFinite(a)||a===0))return null;let r=e.map((a,c)=>t.slice(c*4,c*4+3).map(u=>u/a));for(let a=0;a<3;a++)for(let c=a+1;c<3;c++)if(Math.abs(r[a].reduce((u,f,l)=>u+f*r[c][l],0))>1e-6)return null;let n=r[0][0]*(r[1][1]*r[2][2]-r[1][2]*r[2][1])-r[1][0]*(r[0][1]*r[2][2]-r[0][2]*r[2][1])+r[2][0]*(r[0][1]*r[1][2]-r[0][2]*r[1][1]);if(Math.abs(Math.abs(n)-1)>1e-6)return null;n<0&&(e[0]=-e[0],r[0]=r[0].map(a=>-a));let s=Array.from(new _c().fromMatrix3(r.flat()).normalize()),i=t.slice(12,15),o=new js().translate(i).multiplyRight(new js().fromQuaternion(s)).scale(e);return Array.from(o).some((a,c)=>!Number.isFinite(a)||Math.abs(a-t[c])>1e-6*Math.max(1,Math.abs(t[c])))?null:{translation:i,rotation:s,scale:e}}var mI=p(()=>{"use strict";Jf()});function xI(t,e,r){let n=new Set,s=t.extensionsRequired?.includes(kr)||!1;for(let[o,a]of(t.materials||[]).entries()){let c=a,u=a.extensions?.[kr];if(u===void 0){zD(c,t,e,r);continue}_I(c,u);let f=`material ${o}`;if(!ar(u)||typeof u.technique!="string"||!["CONSTANT","LAMBERT","PHONG","BLINN"].includes(u.technique)){e(`${f} unknown ${kr} technique`);continue}if(u.values!==void 0&&!ar(u.values)){e(`${f} common material values must be an object`);continue}let l=u.values||{},d=Object.keys(u).filter(I=>!["technique","values","doubleSided","transparent","jointCount"].includes(I)),h=Object.keys(l).filter(I=>!["ambient","diffuse","emission","specular","shininess","transparency","doubleSided","transparent"].includes(I));(d.length||h.length)&&e(`${f} unrecognized common material fields ${[...d,...h].join(", ")}`),u.jointCount!==void 0&&(!Number.isSafeInteger(u.jointCount)||Number(u.jointCount)<0)&&e(`${f} invalid common material jointCount`);let m=bI(l.emission,t,`${f} emission`,e),b=u.technique==="CONSTANT",x=b?m:bI(l.diffuse,t,`${f} diffuse`,e),g=l.transparency===void 0?1:l.transparency,w=typeof g=="number"&&Number.isFinite(g)&&g>=0&&g<=1;w||e(`${f} common material transparency must be in [0, 1]`);let T=gI(u,l,"transparent",f,e),_=gI(u,l,"doubleSided",f,e);l.ambient!==void 0&&!yI(l.ambient)&&e(`${f} ambient lighting`),["PHONG","BLINN"].includes(String(u.technique))&&(l.specular!==void 0&&!yI(l.specular)&&e(`${f} specular/shininess lighting`),l.shininess!==void 0&&(typeof l.shininess!="number"||!Number.isFinite(l.shininess)||l.shininess<0)&&e(`${f} invalid common material shininess`)),a.pbrMetallicRoughness||={};let v=a.pbrMetallicRoughness;if(v.metallicFactor??=0,v.roughnessFactor??=1,x){let I=[...x.factor];I[3]*=w?g:1,v.baseColorFactor??=I,x.texture&&(v.baseColorTexture??=x.texture)}a.doubleSided??=_,a.alphaMode??=T?"BLEND":"OPAQUE",b?(a.extensions[ng]??={},WD(t,ng,s),r(`Converted ${f} CONSTANT emission to an unlit material.`)):(m&&(a.emissiveFactor??=m.factor.slice(0,3),m.texture&&(a.emissiveTexture??=m.texture)),r(`Approximated ${f} ${String(u.technique)} lighting with rough non-metallic PBR factors.`)),typeof c.technique=="string"?n.add(c.technique):c.technique!==void 0&&e(`${f} invalid fallback technique ID`),delete c.technique,delete c.values,delete a.extensions[kr],Object.keys(a.extensions).length||delete a.extensions}let i=AI(t);return(t.extensions?.[kr]!==void 0||(t.nodes||[]).some(o=>o.extensions?.[kr]!==void 0))&&e(`${kr} lights or scene payloads`),i.has(kr)||(t.extensionsUsed=t.extensionsUsed?.filter(o=>o!==kr),t.extensionsRequired=t.extensionsRequired?.filter(o=>o!==kr)),n}function wI(t,e){if(!e.size||[...AI(t)].some(c=>![kr,ng].includes(c))||(t.materials||[]).some(c=>c.technique!==void 0||c.values!==void 0))return!1;let r=t;if(["techniques","programs","shaders"].some(c=>r[c]!==void 0&&!ar(r[c])))return!1;let n=ar(r.techniques)?r.techniques:{},s=ar(r.programs)?r.programs:{},i=ar(r.shaders)?r.shaders:{},o=new Set,a=new Set;if(Object.keys(n).some(c=>!e.has(c)))return!1;for(let c of Object.values(n))ar(c)&&typeof c.program=="string"&&o.add(c.program);if(Object.keys(s).some(c=>!o.has(c)))return!1;for(let c of Object.values(s))if(ar(c))for(let u of["vertexShader","fragmentShader"])typeof c[u]=="string"&&a.add(c[u]);return Object.keys(i).every(c=>a.has(c))}function zD(t,e,r,n){_I(t);let s=ar(t.values)?t.values:{},i=s.tex||s.texture2d_0||s.diffuseTex||s.diffuse,o=TI(e,i),a=sg(s.diffuse)?s.diffuse:void 0;if(o!==-1||a){let c=a?[...a]:[1,1,1,1],u=s.transparency;typeof u=="number"&&u>=0&&u<=1&&(c[3]*=u),t.pbrMetallicRoughness||={},t.pbrMetallicRoughness.metallicFactor??=0,t.pbrMetallicRoughness.roughnessFactor??=1,t.pbrMetallicRoughness.baseColorFactor??=c,o!==-1&&(t.pbrMetallicRoughness.baseColorTexture??={index:o}),t.pbrMetallicRoughness.baseColorFactor[3]<1&&(t.alphaMode||="BLEND"),n("Approximated glTF v1 diffuse material values with PBR material factors.")}(t.technique||t.values)&&r(`material technique ${t.technique||"<unnamed>"}`)}function bI(t,e,r,n){if(t===void 0)return{factor:[0,0,0,1]};if(sg(t))return{factor:[...t]};let s=TI(e,t);return s!==-1?{factor:[1,1,1,1],texture:{index:s}}:(n(`${r} requires an RGBA factor in [0, 1] or a resolved texture ID`),null)}function TI(t,e){return typeof e!="string"?-1:(t.textures||[]).findIndex(r=>r.id===e)}function gI(t,e,r,n,s){t[r]!==void 0&&e[r]!==void 0&&t[r]!==e[r]&&s(`${n} conflicting common material ${r}`);let i=e[r]!==void 0?e[r]:t[r]!==void 0?t[r]:!1;return typeof i=="boolean"?i:(s(`${n} common material ${r} must be boolean`),!1)}function _I(t,e){let r=ar(t.extras)?t.extras:t.extras===void 0?{}:{originalExtras:t.extras},n=ar(r.gltf1)?r.gltf1:r.gltf1===void 0?{}:{originalExtras:r.gltf1},s={technique:t.technique,values:t.values,...e===void 0?{}:{commonMaterial:e}},i=Object.keys(s).some(o=>Object.hasOwn(n,o));t.extras={...r,gltf1:{...n,...s,...i?{originalExtras:n}:{}}}}function WD(t,e,r){t.extensionsUsed=[...new Set([...t.extensionsUsed||[],e])],r&&(t.extensionsRequired=[...new Set([...t.extensionsRequired||[],e])])}function AI(t){let e=new Set,r=[t],n=new Set;for(;r.length;){let s=r.pop();if(!(!s||typeof s!="object"||n.has(s))){if(n.add(s),ar(s)&&ar(s.extensions))for(let i of Object.keys(s.extensions))e.add(i);for(let[i,o]of Object.entries(s))i!=="extras"&&r.push(o)}}return e}function sg(t){return Array.isArray(t)&&t.length===4&&t.every(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1)}function yI(t){return sg(t)&&t.slice(0,3).every(e=>e===0)}function ar(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}var kr,ng,vI=p(()=>{"use strict";kr="KHR_materials_common",ng="KHR_materials_unlit"});function II(t,e={}){let r=new og;return r.normalize(t,e,!0),()=>r.finishNormalization(t)}var ig,$D,og,LI=p(()=>{"use strict";Pv();Wv();qv();Xv();qc();tI();nI();iI();aI();lI();hI();mI();vI();ig={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",cameras:"camera",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},$D={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",camera:"cameras",inverseBindMatrices:"accessors",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},og=class t{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;report={converted:!1,mutated:!1,unsupported:[],warnings:[]};strict=!1;log;finished=!1;pendingAccessors=new Set;accessorConversions=new Map;uriBufferIndices=new Set;normalize(e,r={},n=!1){if(r.mutate===!1){let o={...e,json:JSON.parse(JSON.stringify(e.json))},a=new t().normalize(o,{...r,mutate:!0});return a.mutated=!1,a}this.strict=r.normalize==="strict",this.log=r.log,this.json=e.json;let s=e.json;switch(s.asset&&s.asset.version){case"2.0":case"2.1":return this.report;case void 0:case"1.0":break;default:return this._warning(`Unknown glTF version ${s.asset.version}`),this.report}if(!r.normalize)throw new Error("glTF v1 is not supported.");this.report.converted=!0,this.report.mutated=!0,this.log?.log(1,"glTF: Converting glTF v1 to glTF v2 using experimental normalization.")(),this._addAsset(s),this._orderBinaryBufferPayloads(e),this._convertTopLevelObjectsToArrays(s),Uv(e),this._convertObjectIdsToArrayIndices(s),this._updateObjects(s);for(let[o,a]of(s.buffers||[]).entries())typeof a.uri=="string"&&this.uriBufferIndices.add(o);let i=xI(s,o=>this._unsupported(o),o=>this._warning(o));return rI(s,(o,a)=>this._convertIdToIndex(o,a),o=>this._unsupported(o)),oI(s,o=>this._unsupported(o)),pI(s,o=>this._unsupported(o),o=>this._warning(o)),eI(s,o=>this._unsupported(o)),this.accessorConversions=Yv(s),zv(s,o=>this.pendingAccessors.add(o)),$v(s,o=>this._convertIdToIndex(o,"node"),o=>this._unsupported(o)),this._updateNodes(s),sI(s,o=>this._unsupported(o),o=>this._warning(o)),this._preserveLegacyResources(s,i),this._removeEmptyCollections(s),n?this.report:this.finishNormalization(e)}finishNormalization(e){return this.report.converted&&!this.finished&&(dI(e,this.uriBufferIndices,r=>this._unsupported(r),r=>this._warning(r)),Zv(e,this.accessorConversions,this.pendingAccessors,r=>this._unsupported(r),r=>this._warning(r)),Kv(e,r=>this._unsupported(r)),fI(e,r=>this._unsupported(r),r=>this._warning(r)),this._finishReport(),this.log?.log(1,`glTF: Completed glTF v1 normalization (${this.report.unsupported.length} unsupported features).`)(),this.finished=!0),this.report}_unsupported(e){if(this.report.unsupported.push(e),this.log?.warn(`glTF v1 normalization does not support ${e}`)(),this.strict)throw new Error(`glTF v1 normalization does not support ${e}`)}_warning(e){this.report.warnings.push(e),this.log?.warn(`glTF: ${e}`)()}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_orderBinaryBufferPayloads(e){let r=this.json.buffers;if(!r||Array.isArray(r)||!r.binary_glTF)return;let s=Object.keys(r).indexOf("binary_glTF");s>0&&e.buffers?.length&&(e.buffers=[e.buffers[s],...e.buffers.filter((i,o)=>o!==s)])}_convertTopLevelObjectsToArrays(e){for(let r in ig)this._convertTopLevelObjectToArray(e,r)}_convertTopLevelObjectToArray(e,r){let n=e[r];if(!n||Array.isArray(n))return;e[r]=[];let s=Object.keys(n),i=r==="buffers"&&s.includes("binary_glTF")?["binary_glTF",...s.filter(o=>o!=="binary_glTF")]:s;for(let o of i){let a=n[o];a.id=a.id||o;let c=e[r].length;e[r].push(a),this.idToIndexMap[r][o]=c}}_convertObjectIdsToArrayIndices(e){for(let r in ig)this._convertIdsToIndices(e,r);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let r of e.textures)this._convertTextureIds(r);for(let r of e.meshes)this._convertMeshIds(r);for(let r of e.nodes)this._convertNodeIds(r);for(let r of e.scenes)this._convertSceneIds(r)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let r of e.primitives){let{attributes:n,indices:s,material:i}=r,o=new Map;for(let a in n){let c=rg(a),u=o.get(c);if(u!==void 0&&n[u]!==n[a])throw new Error(`glTF v1: conflicting attribute aliases ${u} and ${a}`);o.set(c,a)}r.attributes=Object.fromEntries(Object.entries(n).map(([a,c])=>[rg(a),this._convertIdToIndex(c,"accessor")])),s&&(r.indices=this._convertIdToIndex(s,"accessor")),i&&(r.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(r=>this._convertIdToIndex(r,"node"))),e.meshes&&(e.meshes=e.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(e,r){e[r]||(e[r]=[]);for(let n of e[r])for(let s in n){let i=n[s],o=this._convertIdToIndex(i,s);n[s]=o}}_convertIdToIndex(e,r){let n=$D[r];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][e];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${r} with id ${e}`);return s}return e}_updateObjects(e){for(let r of this.json.buffers)delete r.type}_updateNodes(e){let r=e.nodes||[];for(let n=0;n<r.length;n++){let s=r[n];if(!Array.isArray(s.meshes))continue;let i=s.meshes;delete s.meshes,s.mesh=i.shift();for(let o of i){let a={...s,mesh:o,children:void 0};delete a.id,delete a.matrix,delete a.translation,delete a.rotation,delete a.scale,r.push(a),s.children||=[],s.children.push(r.length-1)}}}_preserveLegacyResources(e,r){let n=wI(e,r),s={};for(let i of["techniques","programs","shaders"])e[i]&&(s[i]=e[i],delete e[i],n||this._unsupported(`legacy ${i}`));Object.keys(s).length&&(e.extras={...e.extras,gltf1Resources:s},n&&this._warning("Preserved shader resources overridden by converted common materials."))}_removeEmptyCollections(e){for(let r of e.nodes||[])Array.isArray(r.children)&&r.children.length===0&&delete r.children;for(let r of e.scenes||[])Array.isArray(r.nodes)&&r.nodes.length===0&&delete r.nodes;for(let r of[...Object.keys(ig),"extensionsUsed","extensionsRequired"])Array.isArray(e[r])&&e[r].length===0&&delete e[r]}_finishReport(){this.report.unsupported.length&&this.report.warnings.push(`Converted glTF v1 with unsupported features: ${this.report.unsupported.join(", ")}`)}}});function qD(t,e){let r=t.basis;return{...t,core:{...t.core,mimeType:e},basis:{...r,format:r?.format||"auto"}}}async function SI(t,e,r=0,n,s){return await EI(t,e,r,n,s)}async function EI(t,e,r,n,s,i){KD(t,e,r,n);let o=II(t,{normalize:n?.gltf?.normalize,log:n?.core?.log});return await Cv(t,n,s),n?.gltf?.loadBuffers&&t.json.buffers&&await rN(t,n,s,n.gltf.loadBufferIndices),o(),n?.gltf?.loadFiles&&t.json.files&&await tN(t,n,s),n?.gltf?.loadExternalAssets&&t.json.externalAssets&&await XD(t,n,s,i),n?.gltf?.loadImages&&await nN(t,n,s),await kv(t,n,s),t}function KD(t,e,r,n){if(n.core?.baseUrl&&(t.baseUri=n.core?.baseUrl),e instanceof ArrayBuffer&&!uA(e,r,n.glb)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=Cp(e);else if(e instanceof ArrayBuffer){let f={};r=hl(f,e,r,n.glb),K(f.type==="glTF",`Invalid GLB magic string ${f.type}`),t._glb=f,t.json=f.json}else e&&typeof e=="object"?t.json=e:K(!1,"GLTF: must be ArrayBuffer, string, or parsed JSON object");let s=t.json.buffers||[],i=Array.isArray(s)?s:[],o=Array.isArray(s)?[]:Object.keys(s);if(t.buffers=new Array(Array.isArray(s)?s.length:o.length).fill(null),t._glb){let{binChunks:f}=t._glb;for(let x=0;x<i.length;x++){let g=i[x];if(g.chunk===void 0)continue;K(t._glb.version===3,"glTF buffer.chunk requires a GLB v3 container."),K(g.uri===void 0,`glTF buffer ${x} cannot define both uri and chunk.`);let w=f.find(T=>T.chunkIndex===g.chunk);K(w,`glTF buffer ${x} references missing GLB BIN chunk ${g.chunk}.`),K(g.byteLength<=w.byteLength,`glTF buffer ${x} is larger than GLB BIN chunk ${g.chunk}.`),t.buffers[x]={arrayBuffer:w.arrayBuffer,byteOffset:w.byteOffset,byteLength:g.byteLength}}let l=i.map((x,g)=>x.uri===void 0?g:-1).filter(x=>x!==-1),d=f.find(x=>x.chunkIndex===1),h=t._glb.version<3||t._glb.jsonChunkIndex===0&&i[0]?.chunk===void 0&&l.length===1&&l[0]===0&&!!d,m=t._glb.version<3?f[0]:d,b=t._glb.version===1&&!Array.isArray(s)?o.indexOf("binary_glTF"):0;if(h&&m&&b>=0&&(t.buffers[b]={arrayBuffer:m.arrayBuffer,byteOffset:m.byteOffset,byteLength:m.byteLength}),t._glb.version===3)for(let x of l)K(t.buffers[x],`glTF buffer ${x} without a uri must define a valid GLB v3 chunk.`)}if(!t._glb){let f=i.findIndex(l=>l.chunk!==void 0);K(f===-1,`glTF buffer ${f} uses chunk outside a GLB.`)}let a=t.json.images||[];t.images=new Array(a.length).fill({});let c=t.json.files||[];t.files=new Array(c.length).fill(null);let u=t.json.externalAssets||[];t.externalAssets=new Array(u.length).fill(null)}async function XD(t,e,r,n){let s=t.json.externalAssets||[],i=new Set;for(let a of t.json.nodes||[])a.externalAsset!==void 0&&(K(a.externalAsset>=0&&a.externalAsset<s.length,`glTF node references missing external asset ${a.externalAsset}.`),i.add(a.externalAsset));let o=n||YD(r.url?new Set([pl(r.url)]):new Set);for(let a of i)await JD(t,a,e,r,o)}async function JD(t,e,r,n,s){let i=t.json.externalAssets?.[e];if(!i)throw new Error(`Missing glTF external asset ${e}.`);K(Number.isInteger(i.file)&&i.file>=0&&i.file<(t.json.files?.length||0),`glTF external asset ${e} references missing file ${i.file}.`);let o=await gl(t,i.file,r,n),a=o.url;K(!a||!s.ancestors.has(a),`glTF external asset cycle detected at ${a}.`);let c=a?s.cache.get(a):void 0;if(!c){let u=ZD(t,o,r,n,s),f={...s,ancestors:new Set(s.ancestors)};a&&f.ancestors.add(a);let l=zi(o.arrayBuffer,o.byteOffset,o.byteLength);c=EI({},l,0,r,u,f),a&&s.cache.set(a,c)}t.externalAssets=t.externalAssets||[],t.externalAssets[e]=await c}function YD(t){return{cache:new Map,ancestors:t,packageIds:{next:0}}}function ZD(t,e,r,n,s){if(e.url&&!e.url.startsWith("data:"))return{...n,url:e.url,filename:eN(e.url),baseUrl:QD(e.url)};let i=`${HD}${s.packageIds.next++}`,o=`${i}/`;return{...n,url:e.name,filename:e.name,baseUrl:i,fetch:async(a,c)=>{let u=a;if(u.startsWith("data:"))return await n.fetch(a,c);let f=u.startsWith(o)?u.slice(o.length):u,l=Jm(t,f);K(l>=0,`glTF package does not contain file ${f}.`);let d=await gl(t,l,r,n),h=zi(d.arrayBuffer,d.byteOffset,d.byteLength);return new Response(h,{headers:{"content-type":d.mimeType}})}}}function QD(t){let e=t.lastIndexOf("/");return e>=0?t.slice(0,e):""}function eN(t){let e=t.lastIndexOf("/");return e>=0?t.slice(e+1):t}async function tN(t,e,r){let n=t.json.files||[];await Promise.all(n.map((s,i)=>gl(t,i,e,r)))}async function rN(t,e,r,n){let s=t.json.buffers||[],i=n?new Set(typeof n=="function"?n(t.json):n):void 0;for(let o=0;o<s.length;++o){if(i&&!i.has(o))continue;let a=s[o];if(a.uri){let{fetch:c}=r;K(c);let u=kn(a.uri,e,r),l=await(await r?.fetch?.(u))?.arrayBuffer?.();t.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete a.uri}else t.buffers[o]===null&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function nN(t,e,r){let n=sN(t),s=t.json.images||[],i=[];for(let o of n)i.push(iN(t,s[o],o,e,r));return await Promise.all(i)}function sN(t){let e=new Set;t.json.asset.thumbnail!==void 0&&e.add(t.json.asset.thumbnail);let r=t.json.textures||[];for(let n of r)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function iN(t,e,r,n,s){let i;if(e.uri&&!e.hasOwnProperty("bufferView")){let c=kn(e.uri,n,s),{fetch:u}=s;i=await(await u(c)).arrayBuffer(),e.bufferView={data:i}}if(Number.isFinite(e.bufferView)){let c=or(t.json,t.buffers,e.bufferView);i=zi(c.buffer,c.byteOffset,c.byteLength)}K(i,"glTF image has no data");let o=qD(n,e.mimeType),a=await lc(i,[Ec,Ko],o,s);a&&a[0]&&(a={compressed:!0,mipmaps:!1,width:a[0].width,height:a[0].height,data:a[0]}),t.images=t.images||[],t.images[r]=a}var HD,BI=p(()=>{"use strict";Ve();$s();iA();Ki();Km();Fc();pA();Hi();Vv();LI();HD="gltf-package://"});var cg={};Z(cg,{GLTFLoaderWithParser:()=>ag,parse:()=>FI});async function FI(t,e={},r){let n={...ag.options,...e};n.gltf={...ag.options.gltf,...n.gltf};let s=e?.glb?.byteOffset||0;return await SI({},t,s,n,r)}var gY,oN,ag,ug=p(()=>{"use strict";BI();MI();({preload:gY,...oN}=OI),ag={...oN,parse:FI}});async function aN(){let{GLTFLoaderWithParser:t}=await Promise.resolve().then(()=>(ug(),cg));return t}var OI,MI=p(()=>{"use strict";Om();Mm();OI={dataType:null,batchType:null,...r1,version:sl,preload:aN,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}}});var fg={};Z(fg,{GLBLoaderWithParser:()=>uN});async function fN(t,e){return RI(t,e)}function RI(t,e){let r={};return hl(r,t,e?.glb?.byteOffset||0,e?.glb),r}var AY,cN,uN,lg=p(()=>{"use strict";Km();NI();({preload:AY,...cN}=DI),uN={...cN,parse:fN,parseSync:RI}});async function lN(){let{GLBLoaderWithParser:t}=await Promise.resolve().then(()=>(lg(),fg));return t}var DI,NI=p(()=>{"use strict";Om();Mm();DI={dataType:null,batchType:null,...n1,version:sl,preload:lN,options:{glb:{strict:!1}}}});var NC={};Z(NC,{FetchError:()=>A.FetchError,GLBFormat:()=>fa,GLBLoader:()=>aL,GLBWriter:()=>uL,GLTFFormat:()=>ua,GLTFLoader:()=>PI,GLTFWriter:()=>oL,JSONLoader:()=>A.JSONLoader,MTLFormat:()=>Gl,MTLLoader:()=>hg,MTLWorkerLoader:()=>kI,NullLoader:()=>A.NullLoader,NullWorkerLoader:()=>A.NullWorkerLoader,OBJFormat:()=>ca,OBJLoader:()=>dg,OBJWorkerLoader:()=>CI,OBJWriter:()=>VI,RequestScheduler:()=>A.RequestScheduler,USDLoader:()=>ma,_BrowserFileSystem:()=>A._BrowserFileSystem,_fetchProgress:()=>A._fetchProgress,_selectSource:()=>A._selectSource,_unregisterLoaders:()=>A._unregisterLoaders,assert:()=>A.assert,concatenateArrayBuffersAsync:()=>A.concatenateArrayBuffersAsync,coreApi:()=>A.coreApi,createDataSource:()=>A.createDataSource,document:()=>A.document,encode:()=>A.encode,encodeInBatches:()=>A.encodeInBatches,encodeSync:()=>A.encodeSync,encodeTable:()=>A.encodeTable,encodeTableAsText:()=>A.encodeTableAsText,encodeTableInBatches:()=>A.encodeTableInBatches,encodeText:()=>A.encodeText,encodeTextSync:()=>A.encodeTextSync,encodeURLtoURL:()=>A.encodeURLtoURL,fetchFile:()=>A.fetchFile,forEach:()=>A.forEach,getLoaderOptions:()=>A.getLoaderOptions,getPathPrefix:()=>A.getPathPrefix,global:()=>A.global,isAsyncIterable:()=>A.isAsyncIterable,isBrowser:()=>A.isBrowser,isIterable:()=>A.isIterable,isIterator:()=>A.isIterator,isPromise:()=>A.isPromise,isPureObject:()=>A.isPureObject,isReadableStream:()=>A.isReadableStream,isResponse:()=>A.isResponse,isWorker:()=>A.isWorker,isWritableStream:()=>A.isWritableStream,load:()=>A.load,loadInBatches:()=>A.loadInBatches,makeIterator:()=>A.makeIterator,makeLineIterator:()=>A.makeLineIterator,makeNumberedLineIterator:()=>A.makeNumberedLineIterator,makeStream:()=>A.makeStream,makeTextDecoderIterator:()=>A.makeTextDecoderIterator,makeTextEncoderIterator:()=>A.makeTextEncoderIterator,parse:()=>A.parse,parseFile:()=>A.parseFile,parseInBatches:()=>A.parseInBatches,parseSync:()=>A.parseSync,preload:()=>A.preload,preloadSync:()=>A.preloadSync,readArrayBuffer:()=>A.readArrayBuffer,registerLoaders:()=>A.registerLoaders,resolvePath:()=>A.resolvePath,selectLoader:()=>A.selectLoader,selectLoaderSync:()=>A.selectLoaderSync,self:()=>A.self,setLoaderOptions:()=>A.setLoaderOptions,setPathPrefix:()=>A.setPathPrefix,window:()=>A.window});var A=bL(Qg(),1);Zl();var ca={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]};fc();var dN=typeof __VERSION__<"u"?__VERSION__:"latest";async function hN(){let{OBJLoaderWithParser:t}=await Promise.resolve().then(()=>(Im(),vm));return t}var dg={...ca,dataType:null,batchType:null,version:dN,worker:!0,workerInBatches:!0,serializeWorkerResult:Ui,text:!0,testText:pN,options:{obj:{shape:"arrow-table"}},preload:hN};function pN(t){return t[0]==="v"}var CI=dg;var Gl={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]};var mN=typeof __VERSION__<"u"?__VERSION__:"latest";async function bN(){let{MTLLoaderWithParser:t}=await Promise.resolve().then(()=>(Em(),Sm));return t}var hg={...Gl,dataType:null,batchType:null,version:mN,worker:!0,text:!0,testText:t=>t.includes("newmtl"),options:{mtl:{}},preload:bN},kI=hg;Nn();var gN=typeof __VERSION__<"u"?__VERSION__:"latest",VI={...ca,dataType:null,batchType:null,version:gN,options:{obj:{}},text:!0,encode:async(t,e)=>GI(t,e),encodeSync:GI,encodeTextSync:UI};function GI(t,e){let r=UI(t,e);return new TextEncoder().encode(r).buffer}function UI(t,e){let r=nn(yN(t)),n=xN(r,"POSITION"),s=r.attributes.NORMAL,i=r.attributes.TEXCOORD_0,o=r.attributes.COLOR_0,a=n.value.length/n.size,c=["# loaders.gl OBJ"];for(let f=0;f<a;f++){let l=[Vn(n,f,0),Vn(n,f,1),Vn(n,f,2)];o&&l.push(pg(o,f,0),pg(o,f,1),pg(o,f,2)),c.push(`v ${l.join(" ")}`)}if(i)for(let f=0;f<a;f++)c.push(`vt ${Vn(i,f,0)} ${Vn(i,f,1)}`);if(s)for(let f=0;f<a;f++)c.push(`vn ${Vn(s,f,0)} ${Vn(s,f,1)} ${Vn(s,f,2)}`);let u=wN(r,a);for(let f=0;f<u.length;f+=3){let l=[mg(u[f],!!i,!!s),mg(u[f+1],!!i,!!s),mg(u[f+2],!!i,!!s)];c.push(`f ${l.join(" ")}`)}return`${c.join(`
|
|
38
|
+
`)}}e.length>0&&(yield e)}var qT=p(()=>{"use strict"});async function om(r){let e=[];for await(let t of r)e.push(kF(t));return em(...e)}function kF(r){if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r)){let{buffer:e,byteOffset:t,byteLength:n}=r;return KT(e,t,n)}return KT(r)}function KT(r,e=0,t=r.byteLength-e){let n=new Uint8Array(r,e,t),s=new Uint8Array(n.length);return s.set(n),s.buffer}var HT=p(()=>{"use strict";tm()});function Ki(r){if(r instanceof ArrayBuffer)return r;if(Y0(r))return am(r);let{buffer:e,byteOffset:t,byteLength:n}=r;return e instanceof ArrayBuffer&&t===0&&n===e.byteLength?e:am(e,t,n)}function am(r,e=0,t=r.byteLength-e){let n=new Uint8Array(r,e,t),s=new Uint8Array(n.length);return s.set(n),s.buffer}var XT=p(()=>{"use strict";Q0()});function cm(r){return{...r,batchType:"data",length:r.data.numRows}}var JT=p(()=>{"use strict"});var Y$,Q$,Z$,e5,YT=p(()=>{Y$=Math.PI/2,Q$=Math.PI/4,Z$=Math.PI/6,e5=Math.PI*2});function QT(r,{precision:e=tt.precision}={}){return r=VF(r),`${parseFloat(r.toPrecision(e))}`}function Ko(r){return Array.isArray(r)||ArrayBuffer.isView(r)&&!(r instanceof DataView)}function um(r,e,t){let n=tt.EPSILON;t&&(tt.EPSILON=t);try{if(r===e)return!0;if(Ko(r)&&Ko(e)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;++s)if(!um(r[s],e[s]))return!1;return!0}return r&&r.equals?r.equals(e):e&&e.equals?e.equals(r):typeof r=="number"&&typeof e=="number"?Math.abs(r-e)<=tt.EPSILON*Math.max(1,Math.abs(r),Math.abs(e)):!1}finally{tt.EPSILON=n}}function VF(r){return Math.round(r/tt.EPSILON)*tt.EPSILON}var t5,r5,jF,tt,Ac=p(()=>{t5=1/Math.PI*180,r5=1/180*Math.PI,jF={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...jF}};tt=globalThis.mathgl.config});var zs,$f=p(()=>{Ac();zs=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Ko(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toString(){return this.formatString(tt)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+QT(this[n],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!um(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){if(n===void 0)return this.lerp(this,e,t);for(let s=0;s<this.ELEMENTS;++s){let i=e[s],o=typeof t=="number"?t:t[s];this[s]=i+n*(o-i)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=t[n];return this.check()}subtract(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=t[n];return this.check()}scale(e){if(typeof e=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(let t=0;t<this.ELEMENTS&&t<e.length;++t)this[t]*=e[t];return this.check()}multiplyByScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}check(){if(tt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}});function UF(r,e){if(r.length!==e)return!1;for(let t=0;t<r.length;++t)if(!Number.isFinite(r[t]))return!1;return!0}function Ce(r){if(!Number.isFinite(r))throw new Error(`Invalid number ${JSON.stringify(r)}`);return r}function Ho(r,e,t=""){if(tt.debug&&!UF(r,e))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return r}var Hi=p(()=>{Ac()});var Xo,fm=p(()=>{$f();Hi();Ac();Xo=class extends zs{toString(){let e="[";if(tt.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+t]}`}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=` ${this[t]}`}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=Ce(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)t[s]=this[n+s];return t}setColumn(e,t){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=t[s];return this}}});function lm(r,e){if(!r)throw new Error(`math.gl assertion ${e}`)}var ZT=p(()=>{});var qf,e_=p(()=>{$f();Hi();ZT();qf=class extends zs{get x(){return this[0]}set x(e){this[0]=Ce(e)}get y(){return this[1]}set y(e){this[1]=Ce(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-e[n];t+=s*s}return Ce(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return Ce(t)}normalize(){let e=this.magnitude();if(e!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=t[n];return this.check()}divide(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=t[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return lm(e>=0&&e<this.ELEMENTS,"index is out of range"),Ce(this[e])}setComponent(e,t){return lm(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e[n]*t;return this.check()}}});var Kf,g5,t_=p(()=>{Kf=typeof Float32Array<"u"?Float32Array:Array,g5=Math.PI/180});function r_(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[3]*s+t[6],r[1]=t[1]*n+t[4]*s+t[7],r}function n_(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[4]*s+t[12],r[1]=t[1]*n+t[5]*s+t[13],r}var Hf=p(()=>{});function s_(r,e,t){let n=e[0],s=e[1],i=t[3]*n+t[7]*s||1;return r[0]=(t[0]*n+t[4]*s)/i,r[1]=(t[1]*n+t[5]*s)/i,r}function Xf(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[3]*n+t[7]*s+t[11]*i||1;return r[0]=(t[0]*n+t[4]*s+t[8]*i)/o,r[1]=(t[1]*n+t[5]*s+t[9]*i)/o,r[2]=(t[2]*n+t[6]*s+t[10]*i)/o,r}function i_(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[2]*s,r[1]=t[1]*n+t[3]*s,r[2]=e[2],r}function o_(r,e,t){let n=e[0],s=e[1],i=e[2];return r[0]=t[0]*n+t[3]*s+t[6]*i,r[1]=t[1]*n+t[4]*s+t[7]*i,r[2]=t[2]*n+t[5]*s+t[8]*i,r[3]=e[3],r}var Jf=p(()=>{});function a_(){let r=new Kf(3);return Kf!==Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function PF(r){let e=r[0],t=r[1],n=r[2];return Math.sqrt(e*e+t*t+n*n)}function dm(r,e,t){let n=new Kf(3);return n[0]=r,n[1]=e,n[2]=t,n}function c_(r,e){let t=e[0],n=e[1],s=e[2],i=t*t+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function hm(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Jo(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[0],a=t[1],c=t[2];return r[0]=s*c-i*a,r[1]=i*o-n*c,r[2]=n*a-s*o,r}function Yf(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[3]*n+t[7]*s+t[11]*i+t[15];return o=o||1,r[0]=(t[0]*n+t[4]*s+t[8]*i+t[12])/o,r[1]=(t[1]*n+t[5]*s+t[9]*i+t[13])/o,r[2]=(t[2]*n+t[6]*s+t[10]*i+t[14])/o,r}function Qf(r,e,t){let n=e[0],s=e[1],i=e[2];return r[0]=n*t[0]+s*t[3]+i*t[6],r[1]=n*t[1]+s*t[4]+i*t[7],r[2]=n*t[2]+s*t[5]+i*t[8],r}function u_(r,e,t){let n=t[0],s=t[1],i=t[2],o=t[3],a=e[0],c=e[1],u=e[2],f=s*u-i*c,l=i*a-n*u,d=n*c-s*a,h=s*d-i*l,m=i*f-n*d,b=n*l-s*f,w=o*2;return f*=w,l*=w,d*=w,h*=2,m*=2,b*=2,r[0]=a+f+h,r[1]=c+l+m,r[2]=u+d+b,r}function f_(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[0],i[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),i[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function l_(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),i[1]=s[1],i[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function d_(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),i[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),i[2]=s[2],r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function h_(r,e){let t=r[0],n=r[1],s=r[2],i=e[0],o=e[1],a=e[2],c=Math.sqrt((t*t+n*n+s*s)*(i*i+o*o+a*a)),u=c&&hm(r,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}var p_,Yo=p(()=>{t_();p_=PF});var pm,Zf,Ic,m_=p(()=>{e_();Ac();Hi();Yo();Jf();pm=[0,0,0],Ic=class r extends qf{static get ZERO(){return Zf||(Zf=new r(0,0,0),Object.freeze(Zf)),Zf}constructor(e=0,t=0,n=0){super(-0,-0,-0),arguments.length===1&&Ko(e)?this.copy(e):(tt.debug&&(Ce(e),Ce(t),Ce(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return tt.debug&&(Ce(e.x),Ce(e.y),Ce(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Ce(e)}angle(e){return h_(this,e)}cross(e){return Jo(this,this,e),this.check()}rotateX({radians:e,origin:t=pm}){return f_(this,this,t,e),this.check()}rotateY({radians:e,origin:t=pm}){return l_(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=pm}){return d_(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Yf(this,this,e),this.check()}transformAsVector(e){return Xf(this,this,e),this.check()}transformByMatrix3(e){return Qf(this,this,e),this.check()}transformByMatrix2(e){return i_(this,this,e),this.check()}transformByQuaternion(e){return u_(this,this,e),this.check()}}});function b_(r,e){if(r===e){let t=e[1],n=e[2],s=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=n,r[7]=s}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}function g_(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],l=f*o-a*u,d=-f*i+a*c,h=u*i-o*c,m=t*l+n*d+s*h;return m?(m=1/m,r[0]=l*m,r[1]=(-f*n+s*u)*m,r[2]=(a*n-s*o)*m,r[3]=d*m,r[4]=(f*t-s*c)*m,r[5]=(-a*t+s*i)*m,r[6]=h*m,r[7]=(-u*t+n*c)*m,r[8]=(o*t-n*i)*m,r):null}function y_(r){let e=r[0],t=r[1],n=r[2],s=r[3],i=r[4],o=r[5],a=r[6],c=r[7],u=r[8];return e*(u*i-o*c)+t*(-u*s+o*a)+n*(c*s-i*a)}function mm(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=t[0],h=t[1],m=t[2],b=t[3],w=t[4],g=t[5],x=t[6],T=t[7],_=t[8];return r[0]=d*n+h*o+m*u,r[1]=d*s+h*a+m*f,r[2]=d*i+h*c+m*l,r[3]=b*n+w*o+g*u,r[4]=b*s+w*a+g*f,r[5]=b*i+w*c+g*l,r[6]=x*n+T*o+_*u,r[7]=x*s+T*a+_*f,r[8]=x*i+T*c+_*l,r}function w_(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=t[0],h=t[1];return r[0]=n,r[1]=s,r[2]=i,r[3]=o,r[4]=a,r[5]=c,r[6]=d*n+h*o+u,r[7]=d*s+h*a+f,r[8]=d*i+h*c+l,r}function x_(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=Math.sin(t),h=Math.cos(t);return r[0]=h*n+d*o,r[1]=h*s+d*a,r[2]=h*i+d*c,r[3]=h*o-d*n,r[4]=h*a-d*s,r[5]=h*c-d*i,r[6]=u,r[7]=f,r[8]=l,r}function bm(r,e,t){let n=t[0],s=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=s*e[3],r[4]=s*e[4],r[5]=s*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function T_(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t+t,a=n+n,c=s+s,u=t*o,f=n*o,l=n*a,d=s*o,h=s*a,m=s*c,b=i*o,w=i*a,g=i*c;return r[0]=1-l-m,r[3]=f-g,r[6]=d+w,r[1]=f+g,r[4]=1-u-m,r[7]=h-b,r[2]=d-w,r[5]=h+b,r[8]=1-u-l,r}var gm=p(()=>{});function $F(){return el||(el=new kn([0,0,0,0,0,0,0,0,0]),Object.freeze(el)),el}function qF(){return tl||(tl=new kn,Object.freeze(tl)),tl}var ym,WF,kn,el,tl,__=p(()=>{fm();Hi();Jf();gm();Hf();Yo();(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL1ROW0=3]="COL1ROW0",r[r.COL1ROW1=4]="COL1ROW1",r[r.COL1ROW2=5]="COL1ROW2",r[r.COL2ROW0=6]="COL2ROW0",r[r.COL2ROW1=7]="COL2ROW1",r[r.COL2ROW2=8]="COL2ROW2"})(ym||(ym={}));WF=Object.freeze([1,0,0,0,1,0,0,0,1]),kn=class extends Xo{static get IDENTITY(){return qF()}static get ZERO(){return $F()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ym}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(WF)}fromObject(e){return this.check()}fromQuaternion(e){return T_(this,e),this.check()}fromMatrix4(e){return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])}set(e,t,n,s,i,o,a,c,u){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this.check()}setRowMajor(e,t,n,s,i,o,a,c,u){return this[0]=e,this[1]=s,this[2]=a,this[3]=t,this[4]=i,this[5]=c,this[6]=n,this[7]=o,this[8]=u,this.check()}determinant(){return y_(this)}transpose(){return b_(this,this),this.check()}invert(){return g_(this,this),this.check()}multiplyLeft(e){return mm(this,e,this),this.check()}multiplyRight(e){return mm(this,this,e),this.check()}rotate(e){return x_(this,this,e),this.check()}scale(e){return Array.isArray(e)?bm(this,this,e):bm(this,this,[e,e]),this.check()}translate(e){return w_(this,this,e),this.check()}transform(e,t){let n;switch(e.length){case 2:n=r_(t||[-0,-0],e,this);break;case 3:n=Qf(t||[-0,-0,-0],e,this);break;case 4:n=o_(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ho(n,e.length),n}},tl=null});function KF(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function A_(r,e){if(r===e){let t=e[1],n=e[2],s=e[3],i=e[6],o=e[7],a=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=i,r[11]=e[14],r[12]=s,r[13]=o,r[14]=a}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function v_(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],l=e[9],d=e[10],h=e[11],m=e[12],b=e[13],w=e[14],g=e[15],x=t*a-n*o,T=t*c-s*o,_=t*u-i*o,v=n*c-s*a,I=n*u-i*a,N=s*u-i*c,q=f*b-l*m,re=f*w-d*m,pe=f*g-h*m,Me=l*w-d*b,Re=l*g-h*b,ce=d*g-h*w,se=x*ce-T*Re+_*Me+v*pe-I*re+N*q;return se?(se=1/se,r[0]=(a*ce-c*Re+u*Me)*se,r[1]=(s*Re-n*ce-i*Me)*se,r[2]=(b*N-w*I+g*v)*se,r[3]=(d*I-l*N-h*v)*se,r[4]=(c*pe-o*ce-u*re)*se,r[5]=(t*ce-s*pe+i*re)*se,r[6]=(w*_-m*N-g*T)*se,r[7]=(f*N-d*_+h*T)*se,r[8]=(o*Re-a*pe+u*q)*se,r[9]=(n*pe-t*Re-i*q)*se,r[10]=(m*I-b*_+g*x)*se,r[11]=(l*_-f*I-h*x)*se,r[12]=(a*re-o*Me-c*q)*se,r[13]=(t*Me-n*re+s*q)*se,r[14]=(b*T-m*v-w*x)*se,r[15]=(f*v-l*T+d*x)*se,r):null}function I_(r){let e=r[0],t=r[1],n=r[2],s=r[3],i=r[4],o=r[5],a=r[6],c=r[7],u=r[8],f=r[9],l=r[10],d=r[11],h=r[12],m=r[13],b=r[14],w=r[15],g=e*o-t*i,x=e*a-n*i,T=t*a-n*o,_=u*m-f*h,v=u*b-l*h,I=f*b-l*m,N=e*I-t*v+n*_,q=i*I-o*v+a*_,re=u*T-f*x+l*g,pe=h*T-m*x+b*g;return c*N-s*q+w*re-d*pe}function wm(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=e[9],h=e[10],m=e[11],b=e[12],w=e[13],g=e[14],x=e[15],T=t[0],_=t[1],v=t[2],I=t[3];return r[0]=T*n+_*a+v*l+I*b,r[1]=T*s+_*c+v*d+I*w,r[2]=T*i+_*u+v*h+I*g,r[3]=T*o+_*f+v*m+I*x,T=t[4],_=t[5],v=t[6],I=t[7],r[4]=T*n+_*a+v*l+I*b,r[5]=T*s+_*c+v*d+I*w,r[6]=T*i+_*u+v*h+I*g,r[7]=T*o+_*f+v*m+I*x,T=t[8],_=t[9],v=t[10],I=t[11],r[8]=T*n+_*a+v*l+I*b,r[9]=T*s+_*c+v*d+I*w,r[10]=T*i+_*u+v*h+I*g,r[11]=T*o+_*f+v*m+I*x,T=t[12],_=t[13],v=t[14],I=t[15],r[12]=T*n+_*a+v*l+I*b,r[13]=T*s+_*c+v*d+I*w,r[14]=T*i+_*u+v*h+I*g,r[15]=T*o+_*f+v*m+I*x,r}function L_(r,e,t){let n=t[0],s=t[1],i=t[2],o,a,c,u,f,l,d,h,m,b,w,g;return e===r?(r[12]=e[0]*n+e[4]*s+e[8]*i+e[12],r[13]=e[1]*n+e[5]*s+e[9]*i+e[13],r[14]=e[2]*n+e[6]*s+e[10]*i+e[14],r[15]=e[3]*n+e[7]*s+e[11]*i+e[15]):(o=e[0],a=e[1],c=e[2],u=e[3],f=e[4],l=e[5],d=e[6],h=e[7],m=e[8],b=e[9],w=e[10],g=e[11],r[0]=o,r[1]=a,r[2]=c,r[3]=u,r[4]=f,r[5]=l,r[6]=d,r[7]=h,r[8]=m,r[9]=b,r[10]=w,r[11]=g,r[12]=o*n+f*s+m*i+e[12],r[13]=a*n+l*s+b*i+e[13],r[14]=c*n+d*s+w*i+e[14],r[15]=u*n+h*s+g*i+e[15]),r}function S_(r,e,t){let n=t[0],s=t[1],i=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*s,r[5]=e[5]*s,r[6]=e[6]*s,r[7]=e[7]*s,r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11]*i,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function E_(r,e,t,n){let s=n[0],i=n[1],o=n[2],a=Math.sqrt(s*s+i*i+o*o),c,u,f,l,d,h,m,b,w,g,x,T,_,v,I,N,q,re,pe,Me,Re,ce,se,we;return a<1e-6?null:(a=1/a,s*=a,i*=a,o*=a,u=Math.sin(t),c=Math.cos(t),f=1-c,l=e[0],d=e[1],h=e[2],m=e[3],b=e[4],w=e[5],g=e[6],x=e[7],T=e[8],_=e[9],v=e[10],I=e[11],N=s*s*f+c,q=i*s*f+o*u,re=o*s*f-i*u,pe=s*i*f-o*u,Me=i*i*f+c,Re=o*i*f+s*u,ce=s*o*f+i*u,se=i*o*f-s*u,we=o*o*f+c,r[0]=l*N+b*q+T*re,r[1]=d*N+w*q+_*re,r[2]=h*N+g*q+v*re,r[3]=m*N+x*q+I*re,r[4]=l*pe+b*Me+T*Re,r[5]=d*pe+w*Me+_*Re,r[6]=h*pe+g*Me+v*Re,r[7]=m*pe+x*Me+I*Re,r[8]=l*ce+b*se+T*we,r[9]=d*ce+w*se+_*we,r[10]=h*ce+g*se+v*we,r[11]=m*ce+x*se+I*we,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function B_(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[4],o=e[5],a=e[6],c=e[7],u=e[8],f=e[9],l=e[10],d=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=i*s+u*n,r[5]=o*s+f*n,r[6]=a*s+l*n,r[7]=c*s+d*n,r[8]=u*s-i*n,r[9]=f*s-o*n,r[10]=l*s-a*n,r[11]=d*s-c*n,r}function F_(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[0],o=e[1],a=e[2],c=e[3],u=e[8],f=e[9],l=e[10],d=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=i*s-u*n,r[1]=o*s-f*n,r[2]=a*s-l*n,r[3]=c*s-d*n,r[8]=i*n+u*s,r[9]=o*n+f*s,r[10]=a*n+l*s,r[11]=c*n+d*s,r}function O_(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[0],o=e[1],a=e[2],c=e[3],u=e[4],f=e[5],l=e[6],d=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=i*s+u*n,r[1]=o*s+f*n,r[2]=a*s+l*n,r[3]=c*s+d*n,r[4]=u*s-i*n,r[5]=f*s-o*n,r[6]=l*s-a*n,r[7]=d*s-c*n,r}function M_(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t+t,a=n+n,c=s+s,u=t*o,f=n*o,l=n*a,d=s*o,h=s*a,m=s*c,b=i*o,w=i*a,g=i*c;return r[0]=1-l-m,r[1]=f+g,r[2]=d-w,r[3]=0,r[4]=f-g,r[5]=1-u-m,r[6]=h+b,r[7]=0,r[8]=d+w,r[9]=h-b,r[10]=1-u-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function R_(r,e,t,n,s,i,o){let a=1/(t-e),c=1/(s-n),u=1/(i-o);return r[0]=i*2*a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i*2*c,r[6]=0,r[7]=0,r[8]=(t+e)*a,r[9]=(s+n)*c,r[10]=(o+i)*u,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*i*2*u,r[15]=0,r}function HF(r,e,t,n,s){let i=1/Math.tan(e/2);if(r[0]=i/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,s!=null&&s!==1/0){let o=1/(n-s);r[10]=(s+n)*o,r[14]=2*s*n*o}else r[10]=-1,r[14]=-2*n;return r}function XF(r,e,t,n,s,i,o){let a=1/(e-t),c=1/(n-s),u=1/(i-o);return r[0]=-2*a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*c,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*u,r[11]=0,r[12]=(e+t)*a,r[13]=(s+n)*c,r[14]=(o+i)*u,r[15]=1,r}function k_(r,e,t,n){let s,i,o,a,c,u,f,l,d,h,m=e[0],b=e[1],w=e[2],g=n[0],x=n[1],T=n[2],_=t[0],v=t[1],I=t[2];return Math.abs(m-_)<1e-6&&Math.abs(b-v)<1e-6&&Math.abs(w-I)<1e-6?KF(r):(l=m-_,d=b-v,h=w-I,s=1/Math.sqrt(l*l+d*d+h*h),l*=s,d*=s,h*=s,i=x*h-T*d,o=T*l-g*h,a=g*d-x*l,s=Math.sqrt(i*i+o*o+a*a),s?(s=1/s,i*=s,o*=s,a*=s):(i=0,o=0,a=0),c=d*a-h*o,u=h*i-l*a,f=l*o-d*i,s=Math.sqrt(c*c+u*u+f*f),s?(s=1/s,c*=s,u*=s,f*=s):(c=0,u=0,f=0),r[0]=i,r[1]=c,r[2]=l,r[3]=0,r[4]=o,r[5]=u,r[6]=d,r[7]=0,r[8]=a,r[9]=f,r[10]=h,r[11]=0,r[12]=-(i*m+o*b+a*w),r[13]=-(c*m+u*b+f*w),r[14]=-(l*m+d*b+h*w),r[15]=1,r)}var D_,N_,xm=p(()=>{D_=HF;N_=XF});function C_(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function j_(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function V_(r){let e=r[0],t=r[1],n=r[2],s=r[3];return Math.sqrt(e*e+t*t+n*n+s*s)}function U_(r){let e=r[0],t=r[1],n=r[2],s=r[3];return e*e+t*t+n*n+s*s}function G_(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t*t+n*n+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=n*o,r[2]=s*o,r[3]=i*o,r}function P_(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function z_(r,e,t,n){let s=e[0],i=e[1],o=e[2],a=e[3];return r[0]=s+n*(t[0]-s),r[1]=i+n*(t[1]-i),r[2]=o+n*(t[2]-o),r[3]=a+n*(t[3]-a),r}function W_(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3];return r[0]=t[0]*n+t[4]*s+t[8]*i+t[12]*o,r[1]=t[1]*n+t[5]*s+t[9]*i+t[13]*o,r[2]=t[2]*n+t[6]*s+t[10]*i+t[14]*o,r[3]=t[3]*n+t[7]*s+t[11]*i+t[15]*o,r}var rl=p(()=>{});function eO(){return nl||(nl=new Ws([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(nl)),nl}function tO(){return sl||(sl=new Ws,Object.freeze(sl)),sl}function $_(r){if(r>Math.PI*2)throw Error("expected radians")}function rO(r,e,t,n,s,i){let o=2*i/(t-e),a=2*i/(s-n),c=(t+e)/(t-e),u=(s+n)/(s-n),f=-1,l=-1,d=-2*i;return r[0]=o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=l,r[12]=0,r[13]=0,r[14]=d,r[15]=0,r}var Am,YF,QF,Tm,_m,ZF,Ws,nl,sl,q_=p(()=>{fm();Hi();Jf();xm();Hf();Yo();rl();(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL0ROW3=3]="COL0ROW3",r[r.COL1ROW0=4]="COL1ROW0",r[r.COL1ROW1=5]="COL1ROW1",r[r.COL1ROW2=6]="COL1ROW2",r[r.COL1ROW3=7]="COL1ROW3",r[r.COL2ROW0=8]="COL2ROW0",r[r.COL2ROW1=9]="COL2ROW1",r[r.COL2ROW2=10]="COL2ROW2",r[r.COL2ROW3=11]="COL2ROW3",r[r.COL3ROW0=12]="COL3ROW0",r[r.COL3ROW1=13]="COL3ROW1",r[r.COL3ROW2=14]="COL3ROW2",r[r.COL3ROW3=15]="COL3ROW3"})(Am||(Am={}));YF=45*Math.PI/180,QF=1,Tm=.1,_m=500,ZF=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Ws=class extends Xo{static get IDENTITY(){return tO()}static get ZERO(){return eO()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Am}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,s,i,o,a,c,u,f,l,d,h,m,b,w){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this[9]=f,this[10]=l,this[11]=d,this[12]=h,this[13]=m,this[14]=b,this[15]=w,this.check()}setRowMajor(e,t,n,s,i,o,a,c,u,f,l,d,h,m,b,w){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=o,this[6]=f,this[7]=m,this[8]=n,this[9]=a,this[10]=l,this[11]=b,this[12]=s,this[13]=c,this[14]=d,this[15]=w,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(ZF)}fromObject(e){return this.check()}fromQuaternion(e){return M_(this,e),this.check()}fromMatrix3(e){return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)}frustum(e){let{left:t,right:n,bottom:s,top:i,near:o=Tm,far:a=_m}=e;return a===1/0?rO(this,t,n,s,i,o):R_(this,t,n,s,i,o,a),this.check()}lookAt(e){let{eye:t,center:n=[0,0,0],up:s=[0,1,0]}=e;return k_(this,t,n,s),this.check()}ortho(e){let{left:t,right:n,bottom:s,top:i,near:o=Tm,far:a=_m}=e;return N_(this,t,n,s,i,o,a),this.check()}orthographic(e){let{fovy:t=YF,aspect:n=QF,focalDistance:s=1,near:i=Tm,far:o=_m}=e;$_(t);let a=t/2,c=s*Math.tan(a),u=c*n;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:i,far:o})}perspective(e){let{fovy:t=45*Math.PI/180,aspect:n=1,near:s=.1,far:i=500}=e;return $_(t),D_(this,t,n,s,i),this.check()}determinant(){return I_(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let n=this.getScale(t),s=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*s,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*s,e[5]=this[5]*i,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*s,e[9]=this[9]*i,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let n=this.getScale(t),s=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*s,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=this[4]*s,e[4]=this[5]*i,e[5]=this[6]*o,e[6]=this[8]*s,e[7]=this[9]*i,e[8]=this[10]*o,e}transpose(){return A_(this,this),this.check()}invert(){return v_(this,this),this.check()}multiplyLeft(e){return wm(this,e,this),this.check()}multiplyRight(e){return wm(this,this,e),this.check()}rotateX(e){return B_(this,this,e),this.check()}rotateY(e){return F_(this,this,e),this.check()}rotateZ(e){return O_(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,t){return E_(this,this,e,t),this.check()}scale(e){return S_(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return L_(this,this,e),this.check()}transform(e,t){return e.length===4?(t=W_(t||[-0,-0,-0,-0],e,this),Ho(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){let{length:n}=e,s;switch(n){case 2:s=n_(t||[-0,-0],e,this);break;case 3:s=Yf(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ho(s,e.length),s}transformAsVector(e,t){let n;switch(e.length){case 2:n=s_(t||[-0,-0],e,this);break;case 3:n=Xf(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ho(n,e.length),n}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}}});function K_(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function vm(r,e,t){t=t*.5;let n=Math.sin(t);return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=Math.cos(t),r}function Im(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=t[0],c=t[1],u=t[2],f=t[3];return r[0]=n*f+o*a+s*u-i*c,r[1]=s*f+o*c+i*a-n*u,r[2]=i*f+o*u+n*c-s*a,r[3]=o*f-n*a-s*c-i*u,r}function H_(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c+o*a,r[1]=s*c+i*a,r[2]=i*c-s*a,r[3]=o*c-n*a,r}function X_(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c-i*a,r[1]=s*c+o*a,r[2]=i*c+n*a,r[3]=o*c-s*a,r}function J_(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c+s*a,r[1]=s*c-n*a,r[2]=i*c+o*a,r[3]=o*c-i*a,r}function Y_(r,e){let t=e[0],n=e[1],s=e[2];return r[0]=t,r[1]=n,r[2]=s,r[3]=Math.sqrt(Math.abs(1-t*t-n*n-s*s)),r}function Q_(r,e,t,n){let s=e[0],i=e[1],o=e[2],a=e[3],c=t[0],u=t[1],f=t[2],l=t[3],d,h,m,b,w;return d=s*c+i*u+o*f+a*l,d<0&&(d=-d,c=-c,u=-u,f=-f,l=-l),1-d>1e-6?(h=Math.acos(d),w=Math.sin(h),m=Math.sin((1-n)*h)/w,b=Math.sin(n*h)/w):(m=1-n,b=n),r[0]=m*s+b*c,r[1]=m*i+b*u,r[2]=m*o+b*f,r[3]=m*a+b*l,r}function Z_(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t*t+n*n+s*s+i*i,a=o?1/o:0;return r[0]=-t*a,r[1]=-n*a,r[2]=-s*a,r[3]=i*a,r}function eA(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function tA(r,e){let t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{let s=0;e[4]>e[0]&&(s=1),e[8]>e[s*3+s]&&(s=2);let i=(s+1)%3,o=(s+2)%3;n=Math.sqrt(e[s*3+s]-e[i*3+i]-e[o*3+o]+1),r[s]=.5*n,n=.5/n,r[3]=(e[i*3+o]-e[o*3+i])*n,r[i]=(e[i*3+s]+e[s*3+i])*n,r[o]=(e[o*3+s]+e[s*3+o])*n}return r}var rA,nA,sA,iA,oA,aA,nO,cA,Lm=p(()=>{Yo();rl();rA=C_,nA=j_,sA=P_,iA=z_,oA=V_,aA=U_,nO=G_,cA=(function(){let r=a_(),e=dm(1,0,0),t=dm(0,1,0);return function(n,s,i){let o=hm(s,i);return o<-.999999?(Jo(r,e,s),p_(r)<1e-6&&Jo(r,t,s),c_(r,r),vm(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Jo(r,s,i),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,nO(n,n))}})()});var Lc,uA=p(()=>{$f();Hi();Lm();Lc=class extends zs{constructor(e=0,t=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,t,n,s)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,s){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return tA(this,e),this.check()}fromEuler(e){switch(this.identity(),e.order){case"xyz":return this.rotateX(e.x).rotateY(e.y).rotateZ(e.z);case"yxz":return this.rotateY(e.y).rotateX(e.x).rotateZ(e.z);case"zxy":return this.rotateZ(e.z).rotateX(e.x).rotateY(e.y);case"zyx":return this.rotateZ(e.z).rotateY(e.y).rotateX(e.x);case"yzx":return this.rotateY(e.y).rotateZ(e.z).rotateX(e.x);case"xzy":return this.rotateX(e.x).rotateZ(e.z).rotateY(e.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(e,t){return vm(this,e,t),this.check()}identity(){return K_(this),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Ce(e)}get y(){return this[1]}set y(e){this[1]=Ce(e)}get z(){return this[2]}set z(e){this[2]=Ce(e)}get w(){return this[3]}set w(e){this[3]=Ce(e)}len(){return oA(this)}lengthSquared(){return aA(this)}dot(e){return sA(this,e)}rotationTo(e,t){return cA(this,e,t),this.check()}add(e){return rA(this,this,e),this.check()}calculateW(){return Y_(this,this),this.check()}conjugate(){return eA(this,this),this.check()}invert(){return Z_(this,this),this.check()}lerp(e,t,n){return n===void 0?this.lerp(this,e,t):(iA(this,e,t,n),this.check())}multiplyRight(e){return Im(this,this,e),this.check()}multiplyLeft(e){return Im(this,e,this),this.check()}normalize(){let e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,e===0&&(this[3]=1),this.check()}rotateX(e){return H_(this,this,e),this.check()}rotateY(e){return X_(this,this,e),this.check()}rotateZ(e){return J_(this,this,e),this.check()}scale(e){return nA(this,this,e),this.check()}slerp(e,t,n){let s,i,o;return arguments.length===2?(s=this,i=e,o=t):(s=e,i=t,o=n),Q_(this,s,i,o),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}});function il(){return Qo??Uint16Array}var Qo,fA=p(()=>{Qo=globalThis.Float16Array});var lA=p(()=>{fA()});var dA=p(()=>{lA()});var hA=p(()=>{gm()});var pA=p(()=>{xm()});var mA=p(()=>{Lm()});var bA=p(()=>{Hf()});var gA=p(()=>{Yo()});var yA=p(()=>{rl()});var ol=p(()=>{m_();__();q_();uA();YT();dA();hA();pA();mA();bA();gA();yA()});var je=p(()=>{"use strict";X0();Bp();Fp();Z0();Rp();Rp();jT();PT();tm();rm();WT();$T();qT();HT();XT();JT()});function dO(r,e="float32"){return r instanceof Date?"date-millisecond":typeof r=="number"?e:typeof r=="boolean"?"bool":typeof r=="string"?"utf8":"null"}function Sc(r){let e=Sm(r);return e!=="null"?{type:e,nullable:!1}:r.length>0?(e=dO(r[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function Sm(r){if(typeof Float16Array<"u"&&r instanceof Float16Array)return"float16";switch(r.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var al=p(()=>{"use strict"});function an(r){let e=r?.POSITION;if(!e||!("value"in e)||!e.value.length)return null;let t=1/0,n=1/0,s=1/0,i=-1/0,o=-1/0,a=-1/0,c=e.value,u=c.length;for(let f=0;f<u;f+=3){let l=c[f],d=c[f+1],h=c[f+2];t=l<t?l:t,n=d<n?d:n,s=h<s?h:s,i=l>i?l:i,o=d>o?d:o,a=h>a?h:a}return[[t,n,s],[i,o,a]]}var Em=p(()=>{"use strict"});function Bm(r){let e=il();return new e(r)}function $s(r){return!!(Qo&&r instanceof Qo)}function Fm(r,e,t){$s(r)?r[e]=t:r[e]=wA(t)}function Om(r,e){return $s(r)?r[e]:hO(r[e])}function Ec(r){return $s(r)?new Uint16Array(r.buffer,r.byteOffset,r.length):r}function wA(r){if(!Number.isFinite(r))return r===1/0?31744:r===-1/0?64512:32256;let e=r<0||Object.is(r,-0)?32768:0,t=Math.abs(r);if(t===0)return e;if(t>=65520)return e|31744;if(t>=65504)return e|31743;let n=Math.floor(Math.log2(t));if(n<-14)return e|Math.round(t/2**-24);let s=n+15,i=Math.round((t/2**n-1)*1024);return i===1024?e|s+1<<10:e|s<<10|i}function hO(r){let e=r&32768?-1:1,t=r>>10&31,n=r&1023;return t===0?e*n*2**-24:t===31?n?NaN:e*(1/0):e*(1+n/1024)*2**(t-15)}var xA=p(()=>{"use strict";ol()});var cl,Mm,TA=p(()=>{"use strict";Gs();cl=new J([new F("POSITION",new Se(3,new F("value",new wt,!1)),!1)]),Mm=new J([...cl.fields,new F("indices",new Ve(new F("item",new yt,!1)),!0)])});var Bc=p(()=>{"use strict";xA();TA()});function _A(r){return r.type instanceof Se?r.type.listSize:1}function Rm(r,e,t){let n=pO(r,e,t);return new E([n])}function pO(r,e,t){let n=mO(r,e,t),s=n.children[0].type,i=t==="float16"&&$s(r)?Ec(r):r,o={[te.DATA]:i},a=new k(s,0,i.length,0,o);return new k(n,0,i.length/e,0,void 0,[a])}function mO(r,e,t){let n=t||Sc(r).type,s=Go(n);return new Se(e,new F("value",s,!1))}var Dm=p(()=>{"use strict";Bc();Gs();al();bc()});function qs(r,e){switch(e){case"columnar-table":return bO(r);case"arrow-table":return gO(r);default:throw new Error(e)}}function bO(r){let e={},t=IA(r);for(let[n,s]of Object.entries(r.attributes))e[n]=s.value;return{shape:"columnar-table",schema:r.schema,data:e,topology:r.topology,indices:t?r.indices:void 0}}function gO(r,e){return vA(r.attributes,{schema:r.schema,topology:r.topology,mode:r.mode,boundingBox:r.header?.boundingBox,indices:IA(r)?r.indices:void 0})}function vA(r,e={}){let t=[],n={},s=wO(r);for(let c of s){let u=r[c],{value:f,size:l=1}=u,d=yO(f,l,u.componentType);if(n[c]=d,t.push(xO(e.schema,c,d,u.componentType)),c==="POSITION"&&e.indices?.value?.length){let h=Mm.fields.find(m=>m.name==="indices");n.indices=_O(e.indices.value,d.length,h.type),t.push(h)}}let i=new J(t,AO(e)),o=n[s[0]]?.length===0?new be(i):new be(i,n);return{shape:"arrow-table",schema:Uo(o.schema),data:o,topology:e.topology||"point-list",indices:e.indices}}function yO(r,e,t){if(t==="float16"){let n=$s(r)?Ec(r):r;if(e===1){let s=new k(new Br,0,n.length,0,{[te.DATA]:n});return new E([s])}return Rm(r,e,t)}return e===1?Hr(r):Rm(r,e)}function wO(r){let e=Object.keys(r),t=AA.filter(s=>s in r),n=e.filter(s=>!AA.includes(s));return[...t,...n]}function IA(r){return!!r.indices?.value?.length}function xO(r,e,t,n){if(e==="POSITION"&&TO(t)){let i=cl.fields[0],o=r?.fields.find(c=>c.name===e);if(!o?.metadata)return i;let a=new Map(i.metadata);for(let[c,u]of Object.entries(o.metadata))a.set(c,u);return new F(i.name,i.type,i.nullable,a)}let s=r?.fields.find(i=>i.name===e);if(n==="float16"){let i=new Map(Object.entries(s?.metadata||{}));return i.set("componentType","float16"),new F(e,t.type,!1,i)}if(s&&s.type.toString()!==t.type.toString()){let i=Zr(s);return new F(e,t.type,i.nullable,i.metadata)}return s?Zr(s):new F(e,t.type,!1)}function TO(r){return r.type instanceof Se&&r.type.listSize===3&&r.type.children[0].type instanceof wt}function _O(r,e,t){let n=t,s=r instanceof Uint32Array?r:Uint32Array.from(r),i=new Int32Array(e+1);e>0&&i.fill(s.length,1);let o=new Uint8Array(Math.ceil(e/8));e>0&&(o[0]=1);let a=new k(n.children[0].type,0,s.length,0,{[te.DATA]:s}),c=new k(n,0,e,Math.max(0,e-1),{[te.OFFSET]:i,[te.VALIDITY]:o},[a]);return new E([c])}function AO(r){let e={...r.schema?.metadata};return r.topology&&(e.topology||=r.topology),Number.isFinite(r.mode)&&(e.mode||=String(r.mode)),r.boundingBox&&(e.boundingBox||=JSON.stringify(r.boundingBox)),Df(e)}var AA,LA=p(()=>{"use strict";Bc();Bc();Gs();Dm();bc();AA=["POSITION"]});function cn(r){if(r.shape==="arrow-table")return vO(r);throw new Error(r.shape)}function vO(r){let e=r.data,t=Uo(e.schema),n=t.fields,s={},i=[];for(let f of n){let{name:l}=f;if(l==="indices")continue;let d=e.getChild(l),h=_A(d),m=BO(d,h),b=LO(f.metadata),w=b.componentType==="float16"?FO(m):m,g=i.find(x=>x.data.length===d.data.length&&s[x.name].value.constructor===w.constructor&&x.data.every((T,_)=>SA(T,d.data[_])));s[l]={value:g?s[g.name].value:w,size:h,...b},g||i.push({name:l,data:d.data})}EO(t);let o=t.metadata.topology,a=OO(t),c=MO(e),u=s.POSITION?.transform?.type==="quantization"?IO(t)||an(s):an(s);return{schema:t,attributes:s,topology:o,mode:a,indices:c,header:{vertexCount:e.numRows,boundingBox:u??void 0}}}function IO(r){let e=r.metadata?.boundingBox;if(!e)return null;try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length===2&&t.every(n=>Array.isArray(n)&&n.length===3&&n.every(s=>typeof s=="number")))return t}catch{}return null}function LO(r={}){let e={};if(r.byteOffset!==void 0&&(e.byteOffset=Number(r.byteOffset)),r.byteStride!==void 0&&(e.byteStride=Number(r.byteStride)),r.normalized!==void 0&&(e.normalized=r.normalized==="true"),r.componentType==="float16"&&(e.componentType="float16"),r["loaders.gl.transform"])try{let t=JSON.parse(r["loaders.gl.transform"]);SO(t)&&(e.transform=t)}catch{}return e}function SO(r){if(!r||typeof r!="object"||!("type"in r))return!1;let e=r;return e.type==="octahedron"?Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30:e.type==="quantization"&&Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30&&Array.isArray(e.origin)&&e.origin.every(t=>typeof t=="number")&&typeof e.range=="number"}function EO(r){r.metadata||={},r.metadata.topology||="point-list",r.metadata.mode||="0"}function BO(r,e){if(!(r.type instanceof Se))return r.toArray();let n=r.data[0].children[0].values.constructor,s=new n(r.length*e),i=0;for(let o of r.data){let a=o.children[0],c=o.length*e,u=a.offset||o.offset*e,f=u+c<=a.values.length?u:0,l=a.values.subarray(f,f+c);s.set(l,i),i+=c}return s}function FO(r){let e=Bm(r.length);for(let t=0;t<r.length;t++)Fm(e,t,Om(r,t));return e}function OO(r){let e=Number(r.metadata?.mode);return Number.isFinite(e)?e:0}function MO(r){let e=r.getChild("indices");if(!e?.isValid(0))return;let t=e.data[0],n=t.valueOffsets,s=n[t.offset],i=n[t.offset+1];return{value:t.children[0].values.subarray(s,i),size:1}}function SA(r,e){let t=Object.values(e.buffers);return r.type.toString()===e.type.toString()&&r.offset===e.offset&&r.length===e.length&&r.nullCount===e.nullCount&&r.dictionary===e.dictionary&&Object.values(r.buffers).every((n,s)=>{let i=t[s];return n===i||!!(n&&i&&n.buffer===i.buffer&&n.byteOffset===i.byteOffset&&n.byteLength===i.byteLength)})&&r.children.length===e.children.length&&r.children.every((n,s)=>SA(n,e.children[s]))}var EA=p(()=>{"use strict";Bc();Gs();Dm();bc();Em()});function Nm(r,e,t){let n=e.componentType||Sm(e.value),s=t||ul(e),i=e.size===1?n:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]};return{name:r,type:i,nullable:!1,metadata:s}}function ul(r){let e={};return"byteOffset"in r&&(e.byteOffset=r.byteOffset.toString(10)),"byteStride"in r&&(e.byteStride=r.byteStride.toString(10)),"normalized"in r&&(e.normalized=r.normalized.toString()),r.componentType&&(e.componentType=r.componentType),r.transform&&(e["loaders.gl.transform"]=JSON.stringify(r.transform)),e}var BA=p(()=>{"use strict";al()});var Cn=p(()=>{"use strict";al();Em();LA();EA();BA()});function fl(r,e={}){let t={};for(let s in e)s!=="value"&&(t[s]=JSON.stringify(e[s]));let n=[];for(let s in r){let i=r[s],o=RO(s,i);n.push(o)}return{fields:n,metadata:t}}function RO(r,e){let t={};for(let i in e)i!=="value"&&(t[i]=JSON.stringify(e[i]));let{type:n}=Sc(e.value);return e.size===1||e.size===void 0||(n={type:"fixed-size-list",listSize:e.size,children:[{name:"values",type:n}]}),{name:r,type:n,nullable:!1,metadata:t}}var km=p(()=>{"use strict";Cn()});function OA(r){let e=new Vm;r.indexOf(`\r
|
|
39
|
+
`)!==-1&&(r=r.replace(/\r\n/g,`
|
|
40
|
+
`)),r.indexOf(`\\
|
|
41
|
+
`)!==-1&&(r=r.replace(/\\\n/g,""));let t=r.split(`
|
|
42
|
+
`),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let f=0,l=t.length;f<l;f++)if(n=t[f],n=a?n.trimLeft():n.trim(),i=n.length,i!==0&&(s=n.charAt(0),s!=="#"))if(s==="v"){let d=n.split(/\s+/);switch(d[0]){case"v":e.vertices.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),d.length>=7&&e.colors.push(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]));break;case"vn":e.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":e.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break;default:}}else if(s==="f"){let h=n.substr(1).trim().split(/\s+/),m=[];for(let w=0,g=h.length;w<g;w++){let x=h[w];if(x.length>0){let T=x.split("/");m.push(T)}}let b=m[0];for(let w=1,g=m.length-1;w<g;w++){let x=m[w],T=m[w+1];e.addFace(b[0],x[0],T[0],b[1],x[1],T[1],b[2],x[2],T[2])}}else if(s==="l"){let d=n.substring(1).trim().split(" "),h,m=[];if(n.indexOf("/")===-1)h=d;else{h=[];for(let b=0,w=d.length;b<w;b++){let g=d[b].split("/");g[0]!==""&&h.push(g[0]),g[1]!==""&&m.push(g[1])}}e.addLineGeometry(h,m)}else if(s==="p"){let h=n.substr(1).trim().split(" ");e.addPointGeometry(h)}else if(FA.test(n)){o=FA.exec(n)||[];let d=(" "+o[0].substr(1).trim()).substr(1);e.startObject(d)}else if(NO.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(DO.test(n))e.materialLibraries.push(n.substring(7).trim());else if(s==="s"){if(o=n.split(" "),o.length>1){let h=o[1].trim().toLowerCase();e.object.smooth=h!=="0"&&h!=="off"}else e.object.smooth=!0;let d=e.object.currentMaterial();d&&(d.smooth=e.object.smooth)}else{if(n==="\0")continue;throw new Error(`Unexpected line: "${n}"`)}e.finalize();let c=[],u=[];for(let f of e.objects){let{geometry:l}=f;if(l.vertices.length===0)continue;let d={header:{vertexCount:l.vertices.length/3},attributes:{}};switch(l.type){case"Points":d.mode=0;break;case"Line":d.mode=1;break;default:d.mode=4;break}d.attributes.POSITION={value:new Float32Array(l.vertices),size:3},l.normals.length>0&&(d.attributes.NORMAL={value:new Float32Array(l.normals),size:3}),l.colors.length>0&&(d.attributes.COLOR_0={value:new Float32Array(l.colors),size:3}),l.uvs.length>0&&(d.attributes.TEXCOORD_0={value:new Float32Array(l.uvs),size:2}),d.materials=[];for(let h of f.materials){let m={name:h.name,flatShading:!h.smooth};d.materials.push(m),u.push(m)}d.name=f.name,c.push(d)}return{meshes:c,materials:u}}var FA,DO,NO,Cm,jm,Vm,MA=p(()=>{"use strict";FA=/^[og]\s*(.+)?/,DO=/^mtllib /,NO=/^usemtl /,Cm=class r{constructor({index:e,name:t="",mtllib:n,smooth:s,groupStart:i}){this.index=e,this.name=t,this.mtllib=n,this.smooth=s,this.groupStart=i,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(e=this.index){return new r({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}},jm=class{constructor(e=""){this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}startMaterial(e,t){let n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);let s=new Cm({index:this.materials.length,name:e,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:n!==void 0?n.smooth:this.smooth,groupStart:n!==void 0?n.groupEnd:0});return this.materials.push(s),s}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(e){let t=this.currentMaterial();if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),t}},Vm=class{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(e,t=!0){if(this.object&&!this.object.fromDeclaration){this.object.name=e,this.object.fromDeclaration=t;return}let n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object=new jm(e),this.object.fromDeclaration=t,n&&n.name&&typeof n.clone=="function"){let s=n.clone(0);s.inherited=!0,this.object.materials.push(s)}this.objects.push(this.object)}finalize(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)}parseVertexIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseNormalIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseUVIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/2)*2}addVertex(e,t,n){let s=this.vertices,i=this.object.geometry.vertices;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addVertexPoint(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addVertexLine(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addNormal(e,t,n){let s=this.normals,i=this.object.geometry.normals;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addColor(e,t,n){let s=this.colors,i=this.object.geometry.colors;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addUV(e,t,n){let s=this.uvs,i=this.object.geometry.uvs;i.push(s[e+0],s[e+1]),i.push(s[t+0],s[t+1]),i.push(s[n+0],s[n+1])}addUVLine(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])}addFace(e,t,n,s,i,o,a,c,u){let f=this.vertices.length,l=this.parseVertexIndex(e,f),d=this.parseVertexIndex(t,f),h=this.parseVertexIndex(n,f);if(this.addVertex(l,d,h),s!==void 0&&s!==""){let m=this.uvs.length;l=this.parseUVIndex(s,m),d=this.parseUVIndex(i,m),h=this.parseUVIndex(o,m),this.addUV(l,d,h)}if(a!==void 0&&a!==""){let m=this.normals.length;l=this.parseNormalIndex(a,m),d=a===c?l:this.parseNormalIndex(c,m),h=a===u?l:this.parseNormalIndex(u,m),this.addNormal(l,d,h)}this.colors.length>0&&this.addColor(l,d,h)}addPointGeometry(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let n of e)this.addVertexPoint(this.parseVertexIndex(n,t))}addLineGeometry(e,t){this.object.geometry.type="Line";let n=this.vertices.length,s=this.uvs.length;for(let i of e)this.addVertexLine(this.parseVertexIndex(i,n));for(let i of t)this.addUVLine(this.parseUVIndex(i,s))}}});function ll(r,e){let{meshes:t}=OA(r),n=t.reduce((a,c)=>a+c.header.vertexCount,0),s=kO(t,n),i={vertexCount:n,boundingBox:an(s)??void 0},o=fl(s,{mode:4,boundingBox:i.boundingBox});return{loaderData:{header:{}},schema:o,header:i,mode:4,topology:"point-list",attributes:s}}function kO(r,e){let t=new Float32Array(e*3),n,s,i,o=0;for(let c of r){let{POSITION:u,NORMAL:f,COLOR_0:l,TEXCOORD_0:d}=c.attributes;t.set(u.value,o*3),f&&(n=n||new Float32Array(e*3),n.set(f.value,o*3)),l&&(s=s||new Float32Array(e*3),s.set(l.value,o*3)),d&&(i=i||new Float32Array(e*2),i.set(d.value,o*2)),o+=u.value.length/3}let a={};return a.POSITION={value:t,size:3},n&&(a.NORMAL={value:n,size:3}),s&&(a.COLOR_0={value:s,size:3}),i&&(a.TEXCOORD_0={value:i,size:2}),a}var RA=p(()=>{"use strict";Cn();MA();km()});function DA(r,e){let t=qs(r,"arrow-table");return e?.obj?.shape==="mesh"?cn(t):t}function VO(r){let e=r?.batchSize??r?.core?.batchSize;return typeof e=="number"?e:void 0}function UO(r){return r.split(/\r?\n/).some(e=>{let t=e.trimStart();return t.startsWith("f ")||t.startsWith("l ")})}function*GO(r,e,t){let n=r.split(/\r?\n/).filter(s=>s.trimStart().startsWith("v "));yield*zO(n,e,t)}async function*PO(r,e,t){let n=t||1e3,s=[];for await(let i of r)i.trimStart().startsWith("v ")&&(s.push(i),s.length>=n&&(yield dl(Um(s),e),s=[]));s.length>0&&(yield dl(Um(s),e))}function*zO(r,e,t){let n=t||r.length||1;for(let s=0;s<r.length;s+=n){let i=Um(r.slice(s,s+n));yield dl(i,e)}}function Um(r){let e=new Float32Array(r.length*3);for(let s=0;s<r.length;s++){let i=r[s].trim().split(/\s+/);e[s*3+0]=Number(i[1]),e[s*3+1]=Number(i[2]),e[s*3+2]=Number(i[3])}let t={POSITION:{value:e,size:3}},n=an(t);return{loaderData:{header:{}},schema:fl(t,{mode:0,boundingBox:n??void 0}),header:{vertexCount:r.length,boundingBox:n??void 0},mode:0,topology:"point-list",attributes:t}}function dl(r,e){let t=qs(r,"arrow-table");if(e?.obj?.shape==="mesh"){let n=cn(t);return{shape:"mesh",batchType:"data",data:n,length:n.header?.vertexCount||0}}return cm(t)}function WO(r,e){let t=Lp(r);return e?.obj?.shape==="mesh"?cn(t):t}function $O(r,e){let t=Lp(r);return e?.obj?.shape!=="mesh"?t:{shape:"mesh",batchType:"data",data:cn(t),length:t.length}}var ZK,CO,jO,NA=p(()=>{"use strict";je();Po();Cn();km();RA();CA();({preload:ZK,...CO}=kA);jO={...CO,parse:async(r,e)=>DA(ll(new TextDecoder().decode(r),e),e),parseTextSync:(r,e)=>DA(ll(r,e),e),parseInBatches:async function*(r,e){let t=VO(e);if(e?.obj?.pointCloud){let i=sm(r),o=im(i);yield*PO(o,e,t);return}let n=await om(r),s=new TextDecoder().decode(n);if(UO(s)){yield dl(ll(s,e),e);return}yield*GO(s,e,t)},serializeWorkerResult:Gi,deserializeWorkerResult:WO,serializeWorkerBatch:Gi,deserializeWorkerBatch:$O}});var Gm={};Q(Gm,{OBJLoaderWithParser:()=>jO});var Pm=p(()=>{"use strict";NA()});async function KO(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Pm(),Gm));return r}function HO(r){return r[0]==="v"}var qO,kA,CA=p(()=>{"use strict";jy();Po();qO="5.0.0-beta.2";kA={...Cy,dataType:null,batchType:null,version:qO,worker:!0,workerInBatches:!0,serializeWorkerResult:Gi,text:!0,testText:HO,options:{obj:{shape:"arrow-table"}},preload:KO}});var jA,VA=p(()=>{"use strict";jA={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]}});function zm(r,e){let t=[],n={name:"placeholder"},s=r.split(`
|
|
43
|
+
`);for(let i of s){if(i=i.trim(),i.length===0||i.charAt(0)==="#")continue;let o=i.indexOf(" "),a=o>=0?i.substring(0,o):i;a=a.toLowerCase();let c=o>=0?i.substring(o+1):"";switch(c=c.trim(),a){case"newmtl":n={name:c},t.push(n);break;case"ka":n.ambientColor=hl(c);break;case"kd":n.diffuseColor=hl(c);break;case"map_kd":n.diffuseTextureUrl=c;break;case"ks":n.specularColor=hl(c);break;case"map_ks":n.specularTextureUrl=c;break;case"ke":n.emissiveColor=hl(c);break;case"map_ke":n.emissiveTextureUrl=c;break;case"ns":n.shininess=parseFloat(c);break;case"map_ns":break;case"ni":n.refraction=parseFloat(c);break;case"illum":n.illumination=parseFloat(c);break;default:break}}return t}function hl(r,e){let t=r.split(XO,3);return[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}var XO,UA=p(()=>{"use strict";XO=/\s+/});var fH,JO,lH,YO,QO,ZO,GA=p(()=>{"use strict";UA();Wm();Wm();({preload:fH,...JO}=pl),{preload:lH,...YO}=pl,QO={...JO},ZO={...YO,parse:async(r,e)=>zm(new TextDecoder().decode(r),e?.mtl),parseTextSync:(r,e)=>zm(r,e?.mtl)}});var $m={};Q($m,{MTLLoaderWithParser:()=>ZO,MTLWorkerLoaderWithParser:()=>QO});var qm=p(()=>{"use strict";GA()});async function tM(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(qm(),$m));return r}var eM,pl,Wm=p(()=>{"use strict";VA();eM="5.0.0-beta.2";pl={...jA,dataType:null,batchType:null,version:eM,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:tM}});var ml,Km=p(()=>{"use strict";ml="5.0.0-beta.2"});var PA,zA,Hm=p(()=>{"use strict";PA={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},zA={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]}});function WA(r){return!iM(r,"ftyp",4)||(r[8]&96)===0?null:rM(r)}function rM(r){switch(nM(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function nM(r,e,t){return String.fromCharCode(...r.slice(e,t))}function sM(r){return[...r].map(e=>e.charCodeAt(0))}function iM(r,e,t=0){let n=sM(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var $A=p(()=>{"use strict"});function jn(r){let e=Oc(r);return aM(e)||fM(e)||cM(e)||uM(e)||oM(e)}function oM(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=WA(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function aM(r){let e=Oc(r);return e.byteLength>=33&&e.getUint32(0,or)===2303741511&&e.getUint32(4,or)===218765834&&e.getUint32(8,or)===13&&e.getUint32(12,or)===1229472850?{mimeType:"image/png",width:e.getUint32(16,or),height:e.getUint32(20,or)}:null}function cM(r){let e=Oc(r);return e.byteLength>=10&&e.getUint32(0,or)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Fc),height:e.getUint16(8,Fc)}:null}function uM(r){let e=Oc(r);return e.byteLength>=14&&e.getUint16(0,or)===16973&&e.getUint32(2,Fc)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Fc),height:e.getUint32(22,Fc)}:null}function fM(r){let e=Oc(r);if(!(e.byteLength>=3&&e.getUint16(0,or)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=lM(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,or);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,or),width:e.getUint16(i+7,or)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,or)}return null}function lM(){let r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Oc(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}var or,Fc,bl=p(()=>{"use strict";$A();or=!1,Fc=!0});var dM,hM,pM,qA,KA=p(()=>{"use strict";bl();dM=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],hM=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],pM={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:hM,extensions:dM,tests:[r=>!!jn(new DataView(r))]},qA={...pM,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var gl,Xm=p(()=>{"use strict";gl="5.0.0-beta.2"});function Zo(r){if(!r)return!1;if(mM.test(r))return!0;for(let e=r.indexOf(".svg");e>=0;e=r.indexOf(".svg",e+4)){let t=r[e+4];if(t===void 0||t==="?"||t==="#")return!0}return!1}function HA(r,e){if(Zo(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Jm(r,e)}function Jm(r,e){if(Zo(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}var mM,yl=p(()=>{"use strict";mM=/^data:image\/svg\+xml/});async function XA(r,e,t){let n=HA(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await bM(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function bM(r,e){let t=new Image;return t.src=r,e?.image?.decode&&t.decode?(await t.decode(),t):await new Promise((n,s)=>{try{t.onload=()=>n(t),t.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var JA=p(()=>{"use strict";yl()});async function QA(r,e,t){let n;Zo(t)?n=await XA(r,e,t):n=Jm(r,t);let s=e&&e.imagebitmap;return await e1(n,s)}async function ZA(r,e){let t=e&&e.imagebitmap;return await e1(r,t)}async function e1(r,e=null){if((gM(e)||!YA)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),YA=!1}return await createImageBitmap(r)}function gM(r){if(!r)return!0;for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}var YA,t1=p(()=>{"use strict";yl();JA();YA=!0});async function r1(r,e){let{mimeType:t}=jn(r)||{},n=globalThis.loaders?.parseImageNode;ir(n);let s=globalThis.loaders?.createImageBitmapNode;if(!s)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let i=await n(r,t);return s(i)}var n1=p(()=>{"use strict";je();bl()});async function Ym(r,e,t){e=e||{},o1(e);let n=!!globalThis.loaders?.parseImageNode;if(!Nn||n)return await r1(r,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(s1);return await QA(r,e,t?.url)}async function i1(r,e,t){e=e||{},o1(e);let n=!!globalThis.loaders?.parseImageNode;if(!Nn||n||Zo(t?.url)||r.type.startsWith("image/svg+xml"))return await Ym(await r.arrayBuffer(),e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(s1);return await ZA(r,e)}function o1(r){let e=r.image?.type;if(e&&e!=="imagebitmap")throw new Error(yM)}var yM,s1,a1=p(()=>{"use strict";je();t1();yl();n1();yM="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",s1="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var c1={};Q(c1,{ImageLoaderWithParser:()=>xM});var UH,wM,xM,u1=p(()=>{"use strict";a1();Qm();({preload:UH,...wM}=Mc),xM={...wM,parse:Ym,parseBlob:i1}});async function _M(){let{ImageLoaderWithParser:r}=await Promise.resolve().then(()=>(u1(),c1));return r}var TM,Mc,Qm=p(()=>{"use strict";Xm();KA();TM={image:{}};Mc={dataType:null,batchType:null,...qA,version:gl,options:TM,preload:_M}});function l1(r){let e=LM(r);if(!e)throw new Error("Not an image");return e}function Rc(r){switch(l1(r)){case"data":return r;case"imagebitmap":return AM(r)?vM(r):f1(r);case"image":return f1(r);default:throw new Error("getImageData")}}function AM(r){let e=globalThis.loaders?.isImageBitmapNode;return!!e?.(r)}function vM(r){let e=globalThis.loaders?.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(r)}function f1(r){let e=IM(r.width,r.height),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height)}function IM(r,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(r,e);if(typeof document<"u"){let t=document.createElement("canvas");return t.width=r,t.height=e,t}throw new Error("getImageData")}function LM(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}var d1=p(()=>{"use strict"});async function eb(){return wl?await wl:(wl=EM(),await wl)}async function EM(){let r=new Set;for(let e of SM)(Nn?await OM(e):h1(e))&&r.add(e);return r}function tb(r){if(Zm[r]===void 0){let e=Nn?BM(r):h1(r);Zm[r]=e}return Zm[r]}function h1(r){let e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function BM(r){switch(r){case"image/avif":case"image/webp":return MM(r);default:return!0}}async function OM(r){let e=FM[r];return e?await RM(e):!0}function MM(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}async function RM(r){return new Promise(e=>{let t=new Image;t.src=r,t.onload=()=>e(t.height>0),t.onerror=()=>e(!1)})}var SM,wl,Zm,FM,rb=p(()=>{"use strict";je();SM=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg","image/svg+xml","image/bmp","image/vnd.microsoft.icon"],wl=null;Zm={};FM={"image/avif":"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=","image/webp":"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}});var p1,m1=p(()=>{"use strict";p1={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]}});function g1(r){if(!xl){r=r||NM()||void 0,xl=new Set;for(let e of DM)for(let t in b1)if(r&&r.getExtension(`${e}${t}`))for(let n of b1[t])xl.add(n)}return xl}function NM(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var DM,b1,xl,y1=p(()=>{"use strict";DM=["","WEBKIT_","MOZ_"],b1={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},xl=null});function x1(r=g1(),e,t={}){let n=new Set(r);if(!e)return CM(n);if(e.isHDR){let s=w1(e);return t.astcHDR&&(s==="astc-4x4"||s==="astc-6x6")&&Tl(n,s.slice(5))?s==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return sb(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let s=w1(e);return s&&Tl(n,s.slice(5))?s:nb(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?Tl(n,"4x4")?"astc-4x4":nb(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):nb(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function CM(r){return Tl(r,"4x4")?"astc-4x4":sb(r)?"bc7":T1(r)?{alpha:"bc3",noAlpha:"bc1"}:_1(r)?"etc2":r.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:A1(r)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:v1(r)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function nb(r,e,t){for(let n of t)switch(n){case"bc7":if(sb(r))return"bc7";break;case"bc":if(T1(r))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(_1(r))return"etc2";break;case"etc1":if(!e.hasAlpha&&r.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(A1(r))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(v1(r))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function w1(r){let e=`${r.blockWidth}x${r.blockHeight}`;return kM.includes(e)?`astc-${e}`:null}function Tl(r,e){return ea(r,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function sb(r){return ea(r,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function T1(r){return ea(r,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function _1(r){return ea(r,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function A1(r){return ea(r,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function v1(r){return ea(r,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function ea(r,e){return e.some(t=>r.has(t))}var kM,I1=p(()=>{"use strict";y1();kM=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function E1(r){Op(r.modules);let e=Mp("basis");return e||(S1||=jM(r),await S1)}async function jM(r){let e=null,t=null;return[e,t]=await Promise.all([await qo(L1.TRANSCODER,"images",r,null,"basis_transcoder.mjs"),await qo(L1.TRANSCODER_WASM,"images",r)]),e=e||globalThis.BASIS,await VM(e,t)}function VM(r,e){let t={};return e&&(t.wasmBinary=e),Pi(()=>r(t),n=>{let{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:u}=n;return c(),{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,isFormatSupported:u}})}var L1,S1,B1=p(()=>{"use strict";je();Ps();L1={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function F1(r){if(r.byteLength<ib.byteLength)return!1;let e=new Uint8Array(r,0,ib.byteLength);return ib.every((t,n)=>e[n]===t)}var ib,O1=p(()=>{"use strict";ib=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10])});async function zM(r){let e=M1,t;M1=new Promise(n=>{t=n}),await e;try{return await r()}finally{t()}}async function D1(r,e={}){return await zM(async()=>{let t=await E1(on(e)),n=e.basis?.containerFormat||"auto";if(n==="ktx2"||n==="auto"&&F1(r)){if(!t.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return $M(t,r,e)}return WM(t,r,e)})}function WM(r,e,t){let n=new r.BasisFile(new Uint8Array(e));try{let s=k1(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let i=[];for(let o=0;o<n.getNumImages();o++){let a=[];for(let c=0;c<n.getNumLevels(o);c++){let u=n.getImageWidth(o,c),f=n.getImageHeight(o,c);a.push(N1(n,s,u,f,t,l=>n.getImageTranscodedSizeInBytes(o,c,l),(l,d)=>n.transcodeImage(l,o,c,d,0,0)))}i.push(a)}return i}finally{n.close(),n.delete()}}function $M(r,e,t){let n=new r.KTX2File(new Uint8Array(e));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let i=k1(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let o=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let u=0;u<o;u++)for(let f=0;f<a;f++){let l=[];for(let d=0;d<n.getLevels();d++){let h=n.getImageLevelInfo(d,u,f);l.push(N1(n,{...i,hasAlpha:!!h.alphaFlag},h.width,h.height,t,m=>n.getImageTranscodedSizeInBytes(d,u,f,m),(m,b)=>n.transcodeImage(m,d,u,f,b,0,-1,-1)))}c.push(l)}return c}finally{n.close(),n.delete()}}function N1(r,e,t,n,s,i,o){let a=KM(s,e);qM(e,ob(s,e));let c=i(a.basisFormat),u=XM(c,a.dataType);if(!o(u,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${ob(s,e)}`);let f=e.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:t,height:n,data:u,compressed:a.compressed,format:f&&a.srgbFormat||a.format,textureFormat:f?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:e.hasAlpha}}function qM(r,e){let t=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(r.isHDR!==t)throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`);if(r.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`)}function KM(r,e){let t=ob(r,e),n=R1[t];if(!n)throw new Error(`Unknown Basis format ${t}`);return n}function ob(r,e){let t=r.basis?.format||"auto";return t==="auto"&&(t=x1(r.basis?.supportedTextureFormats,e,r.basis?.supportedTextureFeatures)),typeof t=="object"&&(t=e.hasAlpha?t.alpha:t.noAlpha),t.toLowerCase()}function k1(r,e){let t=r.getBasisTexFormat(),n=HM[t];if(!n)throw new Error(`Unsupported Basis source texture format ${t}`);return{codec:n,isHDR:!!r.isHDR(),isSRGB:e?!!r.isSRGB():!1,hasAlpha:!!r.getHasAlpha(),blockWidth:r.getBlockWidth(),blockHeight:r.getBlockHeight()}}function XM(r,e){return e==="uint16"?new Uint16Array(r/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(r/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function rt(r,e,t){return{basisFormat:r,compressed:!0,format:e,textureFormat:t}}function ta(r,e,t,n,s){return{basisFormat:r,compressed:!1,format:e,textureFormat:t,srgbFormat:n,srgbTextureFormat:s}}function Vt(r,e,t,n){return{...rt(r,e,`astc-${n}-unorm`),srgbFormat:t,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var jt,R1,eJ,M1,HM,C1=p(()=>{"use strict";Ps();I1();B1();O1();jt={"4x4":Vt(10,37808,37840,"4x4"),"5x4":Vt(28,37809,37841,"5x4"),"5x5":Vt(29,37810,37842,"5x5"),"6x5":Vt(30,37811,37843,"6x5"),"6x6":Vt(31,37812,37844,"6x6"),"8x5":Vt(32,37813,37845,"8x5"),"8x6":Vt(33,37814,37846,"8x6"),"8x8":Vt(36,37815,37847,"8x8"),"10x5":Vt(34,37816,37848,"10x5"),"10x6":Vt(35,37817,37849,"10x6"),"10x8":Vt(37,37818,37850,"10x8"),"10x10":Vt(38,37819,37851,"10x10"),"12x10":Vt(39,37820,37852,"12x10"),"12x12":Vt(40,37821,37853,"12x12")},R1={etc1:rt(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...rt(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...rt(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...rt(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:rt(4,36283,"bc4-r-unorm"),bc5:rt(5,36285,"bc5-rg-unorm"),bc7:{...rt(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":rt(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":rt(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":jt["4x4"],"astc-5x4":jt["5x4"],"astc-5x5":jt["5x5"],"astc-6x5":jt["6x5"],"astc-6x6":jt["6x6"],"astc-8x5":jt["8x5"],"astc-8x6":jt["8x6"],"astc-8x8":jt["8x8"],"astc-10x5":jt["10x5"],"astc-10x6":jt["10x6"],"astc-10x8":jt["10x8"],"astc-10x10":jt["10x10"],"astc-12x10":jt["12x10"],"astc-12x12":jt["12x12"],"atc-rgb":rt(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":rt(12,34798,"atc-rgbai-unorm-webgl"),rgba32:ta(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:ta(14,36194,"rgb565unorm-webgl"),bgr565:ta(15,36194,"rgb565unorm-webgl"),rgba4444:ta(16,32854,"rgba4unorm-webgl"),"eac-r11":rt(20,37488,"eac-r11unorm"),"eac-rg11":rt(21,37490,"eac-rg11unorm"),bc6h:rt(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":rt(23,37808,"astc-4x4-unorm"),rgba16f:{...ta(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...ta(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":rt(27,37812,"astc-6x6-unorm")},eJ=Object.freeze(Object.keys(R1)),M1=Promise.resolve();HM={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var j1={};Q(j1,{BasisLoaderWithParser:()=>ZM,BasisWorkerLoaderWithParser:()=>QM});var iJ,JM,oJ,YM,QM,ZM,V1=p(()=>{"use strict";C1();_l();_l();({preload:iJ,...JM}=Xi),{preload:oJ,...YM}=Xi,QM={...JM},ZM={...YM,parse:D1}});async function e2(){let{BasisLoaderWithParser:r}=await Promise.resolve().then(()=>(V1(),j1));return r}var Xi,_l=p(()=>{"use strict";m1();Xm();Xi={...p1,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:gl,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:e2}});var Vn=p(()=>{"use strict";Qm();bl();d1();rb();rb();_l()});function H(r,e){if(!r)throw new Error(e||"assert failed: gltf")}var Ji=p(()=>{"use strict"});function o2(r,e=0){return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}function z1(r,e=0,t={}){let n=new DataView(r),{magic:s=U1}=t,i=n.getUint32(e,!1);return i===s||i===U1}function Il(r,e,t=0,n={}){let s=new DataView(e),i=o2(s,t+0),o=s.getUint32(t+4,Ks),a=o===3?$1(s,t+8,"GLB byte length"):s.getUint32(t+8,Ks);switch(Object.assign(r,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},jsonChunkIndex:-1,binChunks:[]}),r.version){case 1:return a2(r,s,t+Al);case 2:return c2(r,s,t+Al,n);case 3:return u2(r,s,t+P1,n);default:throw new Error(`Invalid GLB version ${r.version}. Only supports versions 1, 2 and 3.`)}}function a2(r,e,t){ir(r.header.byteLength>Al+vl);let n=r.header.byteOffset+r.header.byteLength;ir(n<=e.byteLength);let s=e.getUint32(t+0,Ks),i=e.getUint32(t+4,Ks);if(t+=vl,ir(i===n2),t+s>n)throw new Error("GLB JSON content extends beyond the declared file length.");ab(r,e,t,s,0),t+=s;let o=n-t;return o>0&&cb(r,e,t,o,1),n}function c2(r,e,t,n){return ir(r.header.byteLength>Al+vl),W1(r,e,t,vl,n),r.header.byteOffset+r.header.byteLength}function u2(r,e,t,n){return ir(r.header.byteLength>=P1+G1),W1(r,e,t,G1,n),r.header.byteOffset+r.header.byteLength}function W1(r,e,t,n,s){let i=r.header.byteOffset+r.header.byteLength;ir(i<=e.byteLength);let o=0;for(;t+n<=i;){let a=r.version===3,c=e.getUint32(t+(a?0:4),Ks),u=a?e.getUint32(t+4,Ks):0,f=a?$1(e,t+8,"GLB chunk length"):e.getUint32(t+0,Ks);if(t+=n,u!==0)throw new Error(`Unsupported GLB chunk encoding ${u}.`);if(t+f>i)throw new Error("GLB chunk extends beyond the declared file length.");switch(c){case t2:(r.version!==3||r.jsonChunkIndex===-1)&&ab(r,e,t,f,o);break;case r2:cb(r,e,t,f,o);break;case s2:s.strict||ab(r,e,t,f,o);break;case i2:s.strict||cb(r,e,t,f,o);break;default:break}t+=ub(f),o++}return t}function ab(r,e,t,n,s){let i=new Uint8Array(e.buffer,t,n),a=new TextDecoder("utf8").decode(i);return r.json=JSON.parse(a),r.jsonChunkIndex=s,ub(n)}function cb(r,e,t,n,s){return r.header.hasBinChunk=!0,r.binChunks.push({chunkIndex:s,byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),ub(n)}function $1(r,e,t){let n=r.getBigUint64(e,Ks);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`${t} exceeds JavaScript's safe integer range.`);return Number(n)}function ub(r){return Math.ceil(r/4)*4}var Ks,U1,Al,P1,vl,G1,t2,r2,n2,s2,i2,fb=p(()=>{"use strict";je();Ks=!0,U1=1735152710,Al=12,P1=16,vl=8,G1=16,t2=1313821514,r2=5130562,n2=0,s2=0,i2=1});function Un(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return Ll(r);let s=t?.baseUrl||f2(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return Ll(i)}function Ll(r){try{return new URL(r).href}catch{return r}}function f2(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var Dc=p(()=>{"use strict"});var Sl,Nc,lb=p(()=>{"use strict";Sl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nc={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8}});function ra(r){return q1[r-1]||q1[0]}function Gn(r){let e=d2.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function kc(r,e){let t=m2[r.componentType],n=h2[r.type],s=p2[r.componentType],i=r.count*n,o=r.count*n*s;H(o>=0&&o<=e.byteLength);let a=Nc[r.componentType],c=Sl[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}var q1,l2,d2,h2,p2,m2,Hs=p(()=>{"use strict";Ji();lb();q1=["SCALAR","VEC2","VEC3","VEC4"],l2=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],d2=new Map(l2),h2={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},p2={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},m2={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array}});function ar(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;H(n);let s=n.buffer,i=e[s];H(i),H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=i.byteLength),H(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function K1(r,e,t){let n=r.images[t];return ar(r,e,n.bufferView)}function El(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);H(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=kc(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(H(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=db(r,e,n);let u=n.sparse;if(!u)return c;let f=new s(i);new Uint8Array(f.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),H(u.count>=0&&u.count<=n.count),H([5121,5123,5125].includes(u.indices.componentType));let l=db(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=db(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(f.buffer),b=o*s.BYTES_PER_ELEMENT,w=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let g=0;g<u.count;g++){let x=Number(l[g]);H(x>h&&x<n.count),m.set(w.subarray(g*b,(g+1)*b),x*b),h=x}return f}function db(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];H(s);let{arrayBuffer:i,byteOffset:o}=s;H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=s.byteLength),H(o>=0&&o+s.byteLength<=i.byteLength),H((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:f,numberOfComponentsInElement:l}=kc(t,n),d=f*l,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=Te(h*f,4),b=h>1?h*m:d,w=n.byteStride??b,g=h>1?(h-1)*m+h*f:d;if(H(w>=b),H((t.byteOffset||0)+(t.count===0?0:(t.count-1)*w+g)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*f){let _=n.byteStride??h*m,v=(h-1)*m+h*f;H((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let q=0;q<t.count;q++)for(let re=0;re<h;re++){let pe=new Uint8Array(i,a+q*_+re*m,h*f);N.set(pe,q*d+re*h*f)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%f!==0){let v=new Uint8Array(i,a,u*f),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%f!==0){let N=new Uint8Array(i,v,d),q=new Uint8Array(d);q.set(N),I=new c(q.buffer,0,l)}else I=new c(i,v,l);T.set(I,_*l)}return T}var Yi=p(()=>{"use strict";Ji();je();Hs()});function hb(r,e){let t=r.json.files||[],n=[];for(let s=0;s<t.length;s++){let i=t[s];(i.name===e||i.uri===e)&&n.push(s)}return H(n.length<=1,`glTF package file reference ${e} is ambiguous.`),n[0]??-1}async function Bl(r,e,t,n){let s=r.json.files||[],i=typeof e=="number"?e:hb(r,e);H(Number.isInteger(i)&&i>=0&&i<s.length),r.files=r.files||new Array(s.length).fill(null);let o=r.files[i];if(o)return o;let a=s[i];H(a.mimeType,`glTF file ${i} must define mimeType.`);let c=a.uri!==void 0,u=a.bufferView!==void 0;H(c!==u,`glTF file ${i} must define exactly one of uri or bufferView.`);let f;if(a.uri!==void 0){let l=Un(a.uri,t,n),d=await n.fetch(l);H(d?.ok,`Failed to fetch glTF file ${a.uri}: HTTP ${d?.status}.`);let h=await d.arrayBuffer();f={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength,mimeType:a.mimeType,name:a.name,url:l}}else{let l=ar(r.json,r.buffers,a.bufferView);f={arrayBuffer:l.buffer,byteOffset:l.byteOffset,byteLength:l.byteLength,mimeType:a.mimeType,name:a.name}}return r.files[i]=f,f}var H1=p(()=>{"use strict";Yi();Dc();Ji()});function b2(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var un,Cc=p(()=>{"use strict";Vn();je();Ji();Hs();Yi();un=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||b2(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=Te(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return ar(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return El(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return H(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return H(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=jn(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;H(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=Te(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:ra(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:Gn(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=Te(t,8),t=e[o]+Te(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=qi(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&qi(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];H(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let f=e[u.buffer];H(f!==void 0),u.byteOffset=f+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=Te(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let f=o.length/s.size,l=new Uint8Array(f*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<f;m++)l.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(l);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:Gn(o),count:f})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}}});function g2(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return Qi(r.channels)},get samplers(){return Qi(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return Qi(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return Qi(r.primitives)}};case"primitive":return{get attributes(){return X1(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(X1)}};case"node":return{get camera(){return r.camera?.data},get children(){return Qi(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return Qi(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return Qi(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function Zi(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function Qi(r){return(function*(){for(let t of r)yield t.data})()}function X1(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function y2(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function J1(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}var qe,Xs,pb,mb,bb,gb,Fl,yb,wb,xb,Tb,_b,Ab,vb,Ib,Lb,Sb,Eb,Bb,Fb,Ob,Mb,ae,Ke=p(()=>{"use strict";Yi();Hs();qe=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},Xs=class extends qe{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},pb=class extends qe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},mb=class extends qe{get channels(){return Zi(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new bb(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return Zi(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Fl(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},bb=class extends Xs{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new Fl(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new gb(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},gb=class extends Xs{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},Fl=class extends Xs{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},yb=class extends qe{get loadedBuffer(){return this.gltf.buffers[this.index]}},wb=class extends qe{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},xb=class extends qe{},Tb=class extends qe{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},_b=class extends qe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},Ab=class extends qe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},vb=class extends qe{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new Ib(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Ib=class extends Xs{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},Lb=class extends qe{get primitives(){return Zi(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Sb(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Sb=class extends Xs{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},Eb=class extends qe{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return Zi(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},Bb=class extends qe{},Fb=class extends qe{get nodes(){return Zi(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},Ob=class extends qe{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return Zi(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},Mb=class extends qe{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},ae=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return ar(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return El(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return K1(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:ra(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=g2(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof Xs?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(J1(this.data.extensionsUsed,i),J1(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return Zi(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${y2(e)}[${t}]`;switch(e){case"accessor":return new pb(this,e,t,n,s);case"animation":return new mb(this,e,t,n,s);case"buffer":return new yb(this,e,t,n,s);case"bufferView":return new wb(this,e,t,n,s);case"camera":return new xb(this,e,t,n,s);case"externalAsset":return new Tb(this,e,t,n,s);case"file":return new _b(this,e,t,n,s);case"image":return new Ab(this,e,t,n,s);case"material":return new vb(this,e,t,n,s);case"mesh":return new Lb(this,e,t,n,s);case"node":return new Eb(this,e,t,n,s);case"sampler":return new Bb(this,e,t,n,s);case"scene":return new Fb(this,e,t,n,s);case"skin":return new Ob(this,e,t,n,s);case"texture":return new Mb(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}}});function Y1(r){return(r%1+1)%1}function jc(r,e){return Z1[e]*Q1[r]}function na(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=sa(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function sa(r,e,t,n=1){let s=Q1[e],i=w2[t],o=Z1[t],a=n*s,c=a*o,u=r.buffer,f=r.byteOffset;return f%o!==0&&(u=new Uint8Array(u).slice(f,f+c).buffer,f=0),new i(Ki(u),f,a)}function ia(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,f=r.gltf.images?.[c];if(f&&typeof f.width<"u"){let l=[];for(let d=0;d<i.length;d+=2){let h=x2(f,u,i,d,e.channels);l.push(h)}return l}}return[]}function Ol(r,e,t,n,s){if(!t?.length)return;let i=[];for(let l of t){let d=n.findIndex(h=>h===l);d===-1&&(d=n.push(l)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof ae?r:new ae(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),f=a.addAccessor(u,{size:1,componentType:Gn(o),count:o.length});s.attributes[e]=f}function x2(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=T2(o,a,r,c),f=0;for(let l of s){let d=typeof l=="number"?Object.values(i)[l]:i[l],h=u+d.offset,m=Rc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];f|=b<<d.shift}return f}function T2(r,e,t,n=1){let s=t.width,i=Y1(r)*(s-1),o=Math.round(i),a=t.height,c=Y1(e)*(a-1),u=Math.round(c),f=t.components?t.components:n;return(u*s+o)*f}function Vc(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function Uc(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function Ml(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],f=[];for(let l=c;l<u;l++){let d=n[l],h=n[l+1],m=e.subarray(d,h);f.push(i.decode(m))}o.push(f)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),f=Number(n[c+1]);u>=0&&f>=u&&f<=e.length&&o.push(i.decode(e.subarray(u,f)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var Q1,w2,Z1,Rl=p(()=>{"use strict";Ke();Hs();Vn();je();Q1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},w2={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},Z1={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8}});var Rb={};Q(Rb,{createExtMeshFeatures:()=>E2,decode:()=>A2,encode:()=>v2,name:()=>_2});async function A2(r,e){let t=new ae(r);I2(t,e)}function v2(r,e){let t=new un(r);return S2(t,e),t.createBinaryChunk(),t.gltf}function I2(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)L2(r,n,e)}function L2(r,e,t){let s=r.getExtension(e,oa)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=ia(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function S2(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)B2(r,s)}function E2(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[oa];s||(s={featureIds:[]},e.extensions[oa]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,oa,s)}function B2(r,e){let t=e.extensions?.[oa];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=F2(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),f=r.addAccessor(u,{size:1,componentType:Gn(c),count:c.length});e.attributes[o]=f}})}function F2(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var oa,_2,ev=p(()=>{"use strict";Cc();Ke();Rl();Hs();oa="EXT_mesh_features",_2=oa});var Cb={};Q(Cb,{createExtStructuralMetadata:()=>tR,decode:()=>M2,encode:()=>R2,name:()=>O2});async function M2(r,e,t){let n=new ae(r),s=n.getExtension(eo);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=Un(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}D2(n,e)}function R2(r,e){let t=new un(r);return Z2(t,e),t.createBinaryChunk(),t.gltf}function D2(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(eo);t&&(e.gltf?.loadImages&&N2(r,t),k2(r,t))}function N2(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)C2(r,t,i,e)}function k2(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&V2(r,t,i)}function C2(r,e,t,n){if(!e)return;let i=t.extensions?.[eo]?.propertyTextures;if(i)for(let o of i){let a=e[o];j2(r,a,t,n)}}function j2(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=ia(r,a,t);u!==null&&(Ol(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function V2(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=U2(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function U2(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=P2(r,t,s,n),f=z2(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let l=W2(t,s,n,c,u);o=l.data,i&&(i.value=l.rawData);break}case"BOOLEAN":{o=G2(t,n,c,u);break}case"STRING":{o=Ml(n,c,u,f,t.array?t.count:void 0);break}case"ENUM":{o=H2(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function G2(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return Db(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>Db(t,i*r.count,r.count)):Db(t,0,e)}function Db(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function P2(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?na(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function z2(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return na(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function W2(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=jc(r.type,r.componentType),u=n.byteLength/c,f;r.componentType?f=sa(n,r.type,r.componentType,u):f=n;let l=f,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?$2(l,r.componentType,r.type,r.normalized,d,h):l;return i?s?{data:Vc(m,t,s,a),rawData:Vc(l,t,s,a)}:o?{data:Uc(m,t,o,a),rawData:Uc(l,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:l}}function $2(r,e,t,n,s,i){let o=K2(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=q2(t),u=new Float64Array(r.length);for(let f=0;f<r.length;f++){let l=Number(r[f]);a&&(l=e?.startsWith("INT")?Math.max(l/o,-1):l/o);let d=f%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[f]=l*m+h}return u}function q2(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function K2(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function H2(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=jc(e.type,a),u=n.byteLength/c,f=sa(n,e.type,a,u);if(f||(f=n),e.array){if(s)return X2({valuesData:f,numberOfElements:t,arrayOffsets:s,enumEntry:o});let l=e.count;return l?J2(f,t,l,o):[]}return kb(f,0,t,o)}function X2(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=kb(e,a,c,s);i.push(u)}return i}function J2(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=kb(r,o,t,n);s.push(a)}return s}function kb(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=Y2(n,o);a?s.push(a.name):s.push("")}return s}function Y2(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}function Z2(r,e){let t=r.getExtension(eo);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&eR(n,i,r)}}function eR(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=sR(s,i,t);r.properties[n]=o}}}}function tR(r,e,t=Q2){let n=r.getExtension(eo);n||(n=r.addExtension(eo)),n.schema=rR(e,t,n.schema);let s=nR(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function rR(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function nR(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function sR(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=aR(r);n.stringOffsets=Nb(i,t),n.values=Nb(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=oR(r,e.componentType);n.values=Nb(s,t)}return n}function oR(r,e){let t=[];for(let s of r)t.push(Number(s));let n=iR[e];if(!n)throw new Error("Illegal component type");return new n(t)}function aR(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function Nb(r,e){return e.addBufferView(r)}var eo,O2,Q2,iR,tv=p(()=>{"use strict";Cc();Ke();Rl();Dc();eo="EXT_structural_metadata",O2=eo;Q2="schemaClassId";iR={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array}});var Vb={};Q(Vb,{SPZ_COMPRESSION_EXTENSION_NAME:()=>Dl,decode:()=>uR,getGaussianSplatPrimitives:()=>rv,name:()=>jb});async function uR(r,e){let t=rv(r),n=new ae(r);for(let[s,i]of(r.json.meshes||[]).entries())for(let[o,a]of i.primitives.entries()){let c=a.extensions?.[jb];if(!c)continue;lR(r.json,a,c,s,o,n);let u=c.extensions?.[Dl];if(u){let f=t.find(l=>l.meshIndex===s&&l.primitiveIndex===o);if(f){let l=e?.gltf?.splatDecoder,d=r.json.bufferViews?.[u.bufferView];if(d&&r.buffers[d.buffer])f.compressedBytes=fR(r,u.bufferView);else if(l)throw new Error(`KHR_gaussian_splatting: bufferView ${u.bufferView} is not loaded for SPZ2 decoding.`);l&&f.compressedBytes&&(f.decoded=await l(f.compressedBytes.buffer,{sourceCoordinateSystem:"LUF"}))}}}t.length&&(r.gaussianSplatPrimitives=t)}function fR(r,e){let t=r.json.bufferViews?.[e];if(!t)throw new Error(`KHR_gaussian_splatting: bufferView ${e} is not defined.`);let n=r.buffers[t.buffer];if(!n)throw new Error(`KHR_gaussian_splatting: buffer ${t.buffer} is not loaded for SPZ2 payload.`);let s=n.byteOffset+(t.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,t.byteLength).slice()}function rv(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[jb];if(!a)continue;let c=a.extensions?.[Dl]?.bufferView;t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a,compressedBufferView:c})}return t}function lR(r,e,t,n,s,i){if((e.mode??4)!==0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} must use POINTS mode.`);if(typeof t.kernel!="string"||t.kernel.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing kernel.`);if(typeof t.colorSpace!="string"||t.colorSpace.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing colorSpace.`);let o=t.extensions?.[Dl]?.bufferView;if(o!==void 0){if(!Number.isInteger(o)||o<0||o>=(r.bufferViews||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid SPZ bufferView.`)}else for(let a of cR)if(e.attributes[a]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing ${a}.`);for(let[a,c]of Object.entries(e.attributes))if(!Number.isInteger(c)||c<0||c>=(r.accessors||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has invalid accessor ${a}.`);dR(r,e,i,n,s);for(let a=1;a<=3;a++){let c=a*2+1,u=Array.from({length:c},(f,l)=>e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${a}_COEF_${l}`]!==void 0);if(u.some(Boolean)&&!u.every(Boolean))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has incomplete SH degree ${a}.`);if(u.some(Boolean)&&a>1){let f=a-1,l=f*2+1;for(let d=0;d<l;d++)if(e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${f}_COEF_${d}`]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} skips SH degree ${f}.`)}}}function dR(r,e,t,n,s){let i=e.attributes["KHR_gaussian_splatting:SCALE"],o=e.attributes["KHR_gaussian_splatting:OPACITY"];for(let[a,c,u]of[["KHR_gaussian_splatting:SCALE",i,f=>f>=0],["KHR_gaussian_splatting:OPACITY",o,f=>f>=0&&f<=1]]){if(c===void 0||!hR(r,t,c))continue;let f=t.getTypedArrayForAccessor(c);for(let l=0;l<f.length;l++)if(!u(Number(f[l])))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid ${a} value.`)}}function hR(r,e,t){let n=r.accessors?.[t],s=n?.bufferView===void 0?void 0:r.bufferViews?.[n.bufferView];return!!(s&&e.gltf.buffers[s.buffer])}var jb,Dl,cR,nv=p(()=>{"use strict";Ke();jb="KHR_gaussian_splatting",Dl="KHR_gaussian_splatting_compression_spz_2",cR=["POSITION","KHR_gaussian_splatting:ROTATION","KHR_gaussian_splatting:SCALE","KHR_gaussian_splatting:OPACITY","KHR_gaussian_splatting:SH_DEGREE_0_COEF_0"]});var Gb={};Q(Gb,{decode:()=>pR,getVoxelPrimitives:()=>mR,name:()=>Ub});async function pR(r){for(let[e,t]of(r.json.meshes||[]).entries())for(let[n,s]of t.primitives.entries()){let i=s.extensions?.[Ub];i&&bR(r.json,s,i,e,n)}}function mR(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Ub];a&&t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a})}return t}function bR(r,e,t,n,s){if(!Number.isInteger(t.shape)||t.shape<0)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid shape.`);if(!Array.isArray(t.dimensions)||t.dimensions.length!==3||t.dimensions.some(i=>!Number.isInteger(i)||i<=0))throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must provide three positive dimensions.`);if(e.mode!==void 0&&e.mode!==2147483647)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must use voxel mode.`);for(let i of Object.keys(e.attributes)){let o=e.attributes[i];if(!Number.isInteger(o)||o<0||o>=(r.accessors||[]).length)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid accessor ${i}.`)}}var Ub,sv=p(()=>{"use strict";Ub="EXT_primitive_voxels"});var Pb={};Q(Pb,{decode:()=>yR,getPrimitiveRestartRanges:()=>Nl,name:()=>Js});async function yR(r,e){if(!r.json.extensionsUsed?.includes(Js))return;if(!r.json.extensionsRequired?.includes(Js))throw new Error(`${Js} must be declared in extensionsRequired`);if(!e.gltf?.loadBuffers)return;let t=new ae(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives)wR(t,s)}function wR(r,e){if(e.indices===void 0)return;let t=e.indices,n=typeof t=="number"?r.data.accessors?.[t]:t;if(!n)throw new Error(`${Js}: primitive references missing indices accessor ${e.indices}`);let s=xR(n),i=r.getTypedArrayForAccessor(e.indices),o=Array.prototype.includes.call(i,s);if(!gR.has(e.mode??4)){if(o)throw new Error(`${Js}: primitive restart is not valid for mode ${e.mode??4}`);return}Object.defineProperty(e,"primitiveRestart",{configurable:!0,enumerable:!1,writable:!0,value:{restartIndex:s,ranges:Nl(i,s)}})}function xR(r){if(r.type!=="SCALAR")throw new Error(`${Js}: indices accessor must have SCALAR type`);switch(r.componentType){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${Js}: indices accessor must use an unsigned integer component type`)}}function Nl(r,e){let t=[],n=0;for(let s=0;s<=r.length;s++)(s===r.length||r[s]===e)&&(s>n&&t.push({offset:n,count:s-n}),n=s+1);return t}var Js,gR,zb=p(()=>{"use strict";Ke();Js="KHR_mesh_primitive_restart",gR=new Set([2,3,5,6])});var Wb={};Q(Wb,{decode:()=>TR,name:()=>Ut});async function TR(r,e){if(!e.gltf?.loadBuffers)return;let t=new ae(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives){let i=t.getExtension(s,Ut);i&&Object.defineProperty(i,"data",{configurable:!0,enumerable:!1,writable:!0,value:_R(t,s,i)})}}function _R(r,e,t){if(!Number.isInteger(t.count)||t.count<1)throw new Error(`${Ut}: count must be a positive integer`);if((e.mode??4)!==4||e.indices===void 0)throw new Error(`${Ut}: primitive must use TRIANGLES mode with indices`);let n=kl(r,e.indices,"indices"),s=kl(r,t.indicesOffsets,"indicesOffsets",t.count),i=kl(r,t.loopIndices,"loopIndices"),o=kl(r,t.loopIndicesOffsets,"loopIndicesOffsets",t.count),a=r.data.accessors?.[t.loopIndices],c=AR(a.componentType);iv(s,n.length,"indicesOffsets"),iv(o,i.length,"loopIndicesOffsets");let u=[];for(let f=0;f<t.count;f++){let l=Number(s[f]),d=f+1<t.count?Number(s[f+1]):n.length,h=Number(o[f]),m=f+1<t.count?Number(o[f+1]):i.length,b=Array.from(i).slice(h,m),w=Nl(b,c).map(g=>({offset:g.offset+h,count:g.count}));if((d-l)%3!==0)throw new Error(`${Ut}: polygon ${f} triangle range must contain complete triangles`);if(w.length===0)throw new Error(`${Ut}: polygon ${f} must contain at least one loop`);if(w.some(g=>g.count<3))throw new Error(`${Ut}: polygon ${f} loops must contain at least three indices`);u.push({triangleRange:{offset:l,count:d-l},loopRanges:w})}return{indicesOffsets:s,loopIndices:i,loopIndicesOffsets:o,polygons:u}}function kl(r,e,t,n){if(typeof e=="number"&&(!Number.isInteger(e)||e<0))throw new Error(`${Ut}: ${t} must reference an accessor`);let s=typeof e=="number"?r.data.accessors?.[e]:e;if(!s)throw new Error(`${Ut}: ${t} references missing accessor ${e}`);if(s.type!=="SCALAR"||![5121,5123,5125].includes(s.componentType))throw new Error(`${Ut}: ${t} must be an unsigned integer SCALAR accessor`);if(n!==void 0&&s.count!==n)throw new Error(`${Ut}: ${t} count must equal polygon count ${n}`);return r.getTypedArrayForAccessor(e)}function iv(r,e,t){if(Number(r[0])!==0)throw new Error(`${Ut}: ${t} must begin at zero`);let n=-1;for(let s=0;s<r.length;s++){let i=Number(r[s]);if(!Number.isInteger(i)||i<0||i>=e||i<=n)throw new Error(`${Ut}: ${t} must contain increasing in-bounds offsets`);n=i}}function AR(r){switch(r){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${Ut}: unsupported loop index component type ${r}`)}}var Ut,ov=p(()=>{"use strict";Ke();zb();Ut="EXT_mesh_polygon"});var $b={};Q($b,{decode:()=>vR,getSpatialAudio:()=>av,name:()=>aa});function av(r){let e="asset"in r?r:r.json,t=[],n=e.extensions?.[aa];n&&t.push({nodeIndex:null,extension:n});for(let[s,i]of(e.nodes||[]).entries()){let o=i.extensions?.[aa];o&&t.push({nodeIndex:s,extension:o})}return t}async function vR(r){let e=av(r);for(let{extension:t,nodeIndex:n}of e){let s=n===null?"root":`node ${n}`;for(let i of t.sources||[]){if(!Array.isArray(i.accessors)||i.accessors.length===0)throw new Error(`${aa}: ${s} source ${i.id} requires audio accessors.`);for(let o of i.accessors)if(!Number.isInteger(o)||o<0||!r.json.accessors?.[o])throw new Error(`${aa}: ${s} source ${i.id} has invalid accessor ${o}.`);if(i.reverbFeedGain&&i.reverbFeedGain.length!==(i.reverbFeed?.length||0))throw new Error(`${aa}: ${s} source ${i.id} has mismatched reverb feed gains.`)}}e.length&&(r.spatialAudio=e)}var aa,cv=p(()=>{"use strict";aa="MPEG_audio_spatial"});var qb={};Q(qb,{decode:()=>IR,name:()=>Gt});async function IR(r,e,t){let n=r.json.extensions?.[Gt],s=(n?.audio||[]).map(c=>({audio:c})),i=n?.sources||[],o=n?.emitters||[];for(let c of i)c.audio!==void 0&&Cl(s,c.audio,"audio");for(let c of o){if(c.type!=="global"&&c.type!=="positional")throw new Error(`${Gt}: invalid emitter type ${c.type}.`);if(c.type==="global"&&c.positional!==void 0)throw new Error(`${Gt}: global emitters cannot have positional settings.`);for(let u of c.sources||[])Cl(i,u,"source")}let a=[];for(let c of["nodes","scenes"])for(let[u,f]of(r.json[c]||[]).entries()){let l=f.extensions?.[Gt];if(l){if(!Array.isArray(l.emitters)||!l.emitters.length)throw new Error(`${Gt}: ${c} ${u} requires emitters.`);for(let d of l.emitters){let h=Cl(o,d,"emitter");if(c==="scenes"&&h.type!=="global")throw new Error(`${Gt}: scenes may only reference global emitters.`);a.push({emitterIndex:d,nodeIndex:c==="nodes"?u:null,sceneIndex:c==="scenes"?u:null,emitter:h,sources:(h.sources||[]).map(m=>{let b=i[m];return{sourceIndex:m,source:b,clip:b.audio===void 0?void 0:s[b.audio]}})})}}}if(n){for(let c of s)LR(r,c);e.gltf?.loadAudio!==!1&&await Promise.all(s.map(c=>SR(r,c,e,t))),r.audioClips=s,r.audioEmitters=a}}function Cl(r,e,t){if(!Number.isInteger(e)||e<0||!r[e])throw new Error(`${Gt}: invalid ${t} index ${e}.`);return r[e]}function LR(r,e){let{audio:t}=e;if(t.bufferView!==void 0){if(Cl(r.json.bufferViews||[],t.bufferView,"bufferView"),!t.mimeType)throw new Error(`${Gt}: buffer-view audio requires mimeType.`)}else if(!t.uri)throw new Error(`${Gt}: audio requires a uri or bufferView.`)}async function SR(r,e,t,n){let{audio:s}=e;if(s.bufferView!==void 0){let a=r.json.bufferViews[s.bufferView],c=r.buffers[a.buffer];if(!c){if(t.gltf?.loadBuffers===!1)return;throw new Error(`${Gt}: audio buffer ${a.buffer} is not loaded.`)}let u=a.byteOffset??0,f=a.byteLength;if(!Number.isSafeInteger(u)||u<0||!Number.isSafeInteger(f)||f<0||u+f>c.byteLength||c.byteOffset+u+f>c.arrayBuffer.byteLength)throw new Error(`${Gt}: audio bufferView exceeds its buffer.`);e.data=new Uint8Array(c.arrayBuffer,c.byteOffset+u,f);return}if(!n?.fetch)throw new Error(`${Gt}: a loader context is required to load audio.`);let i=Un(s.uri,t,n),o=await n.fetch(i);if(!o.ok)throw new Error(`${Gt}: failed to load audio ${i} (${o.status}).`);e.url=i,e.data=new Uint8Array(await o.arrayBuffer())}var Gt,uv=p(()=>{"use strict";Dc();Gt="KHR_audio_emitter"});var fv={};Q(fv,{MeshoptDecoder:()=>ER});var ER,lv=p(()=>{"use strict";ER=(function(){var r="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;X8:kdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:bsesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:I9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkpPesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?a(e):a(r),i,o=WebAssembly.instantiate(s,{}).then(function(g){i=g.instance,i.exports.__wasm_call_ctors()});function a(g){for(var x=new Uint8Array(g.length),T=0;T<g.length;++T){var _=g.charCodeAt(T);x[T]=_>96?_-97:_>64?_-39:_+4}for(var v=0,T=0;T<g.length;++T)x[v++]=x[T]<60?n[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(g,x,T,_,v,I,N){var q=g.exports.sbrk,re=_+3&-4,pe=q(re*v),Me=q(I.length),Re=new Uint8Array(g.exports.memory.buffer);Re.set(I,Me);var ce=x(pe,_,v,Me,I.length);if(ce==0&&N&&N(pe,re,v),T.set(Re.subarray(pe,pe+_*v)),q(pe-q(0)),ce!=0)throw new Error("Malformed buffer data: "+ce)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},l=[],d=0;function h(g){var x={object:new Worker(g),pending:0,requests:{}};return x.object.onmessage=function(T){var _=T.data;x.pending-=_.count,x.requests[_.id][_.action](_.value),delete x.requests[_.id]},x}function m(g){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+w.name+";"+c.toString()+w.toString(),T=new Blob([x],{type:"text/javascript"}),_=URL.createObjectURL(T),v=l.length;v<g;++v)l[v]=h(_);for(var v=g;v<l.length;++v)l[v].object.postMessage({});l.length=g,URL.revokeObjectURL(_)}function b(g,x,T,_,v){for(var I=l[0],N=1;N<l.length;++N)l[N].pending<I.pending&&(I=l[N]);return new Promise(function(q,re){var pe=new Uint8Array(T),Me=++d;I.pending+=g,I.requests[Me]={resolve:q,reject:re},I.object.postMessage({id:Me,count:g,size:x,source:pe,mode:_,filter:v},[pe.buffer])})}function w(g){var x=g.data;self.ready.then(function(T){if(!x.id)return self.close();try{var _=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],_,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:_},[_.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:o,supported:!0,useWorkers:function(g){m(g)},decodeVertexBuffer:function(g,x,T,_,v){c(i,i.exports.meshopt_decodeVertexBuffer,g,x,T,_,i.exports[u[v]])},decodeIndexBuffer:function(g,x,T,_){c(i,i.exports.meshopt_decodeIndexBuffer,g,x,T,_)},decodeIndexSequence:function(g,x,T,_){c(i,i.exports.meshopt_decodeIndexSequence,g,x,T,_)},decodeGltfBuffer:function(g,x,T,_,v,I){c(i,i.exports[f[v]],g,x,T,_,i.exports[u[I]])},decodeGltfBufferAsync:function(g,x,T,_,v){return l.length>0?b(g,x,T,f[_],u[v]):o.then(function(){var I=new Uint8Array(g*x);return c(i,i.exports[f[_]],I,g,x,T,i.exports[u[v]]),I})}}})()});function dv(){return Promise.resolve().then(()=>(lv(),fv))}var hv=p(()=>{"use strict"});async function BR(){return jl||(jl=dv().then(async({MeshoptDecoder:r})=>(await r.ready,r),r=>{throw jl=void 0,new Error("Failed to load the packaged meshopt decoder.",{cause:r})})),jl}function FR(r){return typeof r=="string"?r:["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL","COLOR"][r]}async function pv(r,e,t,n,s,i="NONE"){(await BR()).decodeGltfBuffer(r,e,t,n,s,FR(i))}var jl,mv=p(()=>{"use strict";hv()});async function Vl(r,e,t){if(!e.gltf?.decompressMeshes&&e.gltf?.decompressBufferViewIndices===void 0||!e.gltf?.loadBuffers)return;OR(r.json);let n=new ae(r),s=e.gltf.decompressBufferViewIndices,i=s?new Set(typeof s=="function"?s(r.json):s):void 0,o=Array.from(n.bufferViews),a=o.map((c,u)=>i?.has(u)===!1?Promise.resolve():MR(n,c,t));if(await Promise.all(a),i){for(let c of i){let u=o[c];u&&n.removeExtension(u,t)}return}for(let c of o)n.removeExtension(c,t);for(let c of n.buffers)n.removeExtension(c,t);n.removeExtension(t)}function OR(r){let e=r.bufferViews||[];for(let n=0;n<e.length;n++){let s=e[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF bufferView ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}let t=r.buffers||[];for(let n=0;n<t.length;n++){let s=t[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF buffer ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}}async function MR(r,e,t){let n=r.getExtension(e,t);if(!n)return;let{byteOffset:s=0,byteLength:i,byteStride:o,count:a,mode:c,filter:u="NONE",buffer:f}=n,l=r.gltf.buffers[f],d=r.gltf.buffers[e.buffer],h=new Uint8Array(l.arrayBuffer,l.byteOffset+s,i),m=new Uint8Array(d.arrayBuffer,d.byteOffset+(e.byteOffset||0),e.byteLength);await pv(m,a,o,h,c,u)}var Kb=p(()=>{"use strict";Ke();mv()});var Hb={};Q(Hb,{decode:()=>RR,name:()=>bv});async function RR(r,e){await Vl(r,e,bv)}var bv,gv=p(()=>{"use strict";Kb();bv="EXT_meshopt_compression"});var Xb={};Q(Xb,{decode:()=>DR,name:()=>yv});async function DR(r,e){await Vl(r,e,yv)}var yv,wv=p(()=>{"use strict";Kb();yv="KHR_meshopt_compression"});var Jb={};Q(Jb,{name:()=>NR,preprocess:()=>kR});function kR(r,e){let t=new ae(r);if(!tb("image/webp")){if(t.isExtensionRequired(ca))throw new Error(`gltf: Required extension ${ca} not supported by browser`);return}for(let n of t.textures){let s=t.getExtension(n,ca);s&&(n.source=s.source),t.removeExtension(n,ca)}t.removeExtension(ca)}var ca,NR,xv=p(()=>{"use strict";Vn();Ke();ca="EXT_texture_webp",NR=ca});var Yb={};Q(Yb,{name:()=>CR,preprocess:()=>jR});async function jR(r,e){let t=new ae(r);if(!t.hasExtension(to))return;if(!(await eb()).has("image/avif")){if(t.isExtensionRequired(to))throw new Error(`gltf: Required extension ${to} not supported by browser`);return}for(let s of t.textures){let i=t.getExtension(s,to);i&&(s.source=i.source),t.removeExtension(s,to)}t.removeExtension(to)}var to,CR,Tv=p(()=>{"use strict";Vn();Ke();to="EXT_texture_avif",CR=to});var Qb={};Q(Qb,{name:()=>VR,preprocess:()=>UR});function UR(r,e){let t=new ae(r);for(let n of t.textures){let s=t.getExtension(n,Ul);s&&(n.source=s.source,t.removeExtension(n,Ul))}t.removeExtension(Ul)}var Ul,VR,_v=p(()=>{"use strict";Ke();Ul="KHR_texture_basisu",VR=Ul});var Gc,Zb=p(()=>{"use strict";Gc="5.0.0-beta.2"});var Pc,eg=p(()=>{"use strict";Pc={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var Av,vv=p(()=>{"use strict";Av={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function ro(r,e=null,t={},n=null,s=null){if(xr&&t.useLocalLibraries&&!t.CDN&&n&&t.modules?.[n]===void 0){let i=zi?"./libs":`modules/${e}/dist/libs`;t={...t,modules:{[n]:`${i}/${n}`,...s?{[s]:`${i}/${s}`}:{},...t.modules}}}return await qo(r,e,t,n,s)}var Iv=p(()=>{"use strict";Ps()});var GR,PR,zc,Lv,_e,no,Sv=p(()=>{"use strict";GR="1.5.7",PR="8786740086a9f4d83f44aa83badfbea4dce7a1b5",zc=`https://www.gstatic.com/draco/versioned/decoders/${GR}`,Lv=`https://cdn.jsdelivr.net/gh/google/draco@${PR}/javascript`,_e={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},no={[_e.DECODER]:`${zc}/${_e.DECODER}`,[_e.DECODER_WASM]:`${zc}/${_e.DECODER_WASM}`,[_e.GLTF_DECODER]:`${zc}/${_e.GLTF_DECODER}`,[_e.GLTF_DECODER_WASM]:`${zc}/${_e.GLTF_DECODER_WASM}`,[_e.FALLBACK_DECODER]:`${zc}/${_e.FALLBACK_DECODER}`,[_e.ENCODER]:`${Lv}/${_e.ENCODER}`,[_e.ENCODER_WASM]:`${Lv}/${_e.ENCODER_WASM}`}});async function Gl(r={},e,t="full"){let n=kv(r);return n?await ng(n):await zR(r,e==="js"?"javascript":e,t)}async function zR(r={},e,t="full"){let n=Cv(`${e}:${t}`,r),s=Ev.get(n);return s||(s=WR(r,e,t),Ev.set(n,s)),await s}async function ng(r){let e=KR(r),t=Fv.get(e);return t||(t=Pi(()=>e.createDecoderModule({}),n=>({draco:n})),Fv.set(e,t)),await t}async function sg(r={}){let e=kv(r);if(e){let s=HR(e),i=Ov.get(s);return i||(i=Pi(()=>s.createEncoderModule({}),o=>({draco:o})),Ov.set(s,i)),await i}let t=Cv("encoder",r),n=Bv.get(t);return n||(n=qR(r),Bv.set(t,n)),await n}async function WR(r,e,t){try{return await Rv(r,e,t)}catch(n){if(e==="javascript")throw n;try{return await Rv(r,"javascript","full")}catch(s){throw new AggregateError([n,s],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function Rv(r,e,t){let n=Mv.then(()=>$R(r,e,t));return Mv=n.then(()=>{},()=>{}),await n}async function $R(r,e,t){if(e==="javascript"){let o;try{o=await ro(no[_e.FALLBACK_DECODER],"scene",r,_e.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(xr||r.useLocalLibraries)throw c;o=await ro(no[_e.FALLBACK_DECODER],"scene",{...r,useLocalLibraries:!0},_e.FALLBACK_DECODER,"draco_decoder.mjs")}let a=rg(o,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await tg(a)}let n,s;try{[n,s]=await Dv(r,t)}catch(o){if(xr||r.useLocalLibraries)throw o;[n,s]=await Dv({...r,useLocalLibraries:!0},t)}let i=rg(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await tg(i,s)}async function Dv(r,e){let t=e==="gltf"?_e.GLTF_DECODER:_e.DECODER,n=e==="gltf"?_e.GLTF_DECODER_WASM:_e.DECODER_WASM;return await Promise.all([ro(no[t],"scene",r,t,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),ro(no[n],"scene",r,n)])}async function qR(r){let e,t;try{[e,t]=await Nv(r)}catch(s){if(xr||r.useLocalLibraries)throw s;[e,t]=await Nv({...r,useLocalLibraries:!0})}let n=rg(e,"DracoEncoderModule")||globalThis.DracoEncoderModule;return await tg(n,t)}async function Nv(r){return await Promise.all([ro(no[_e.ENCODER],"scene",r,_e.ENCODER,"draco_encoder.mjs"),ro(no[_e.ENCODER_WASM],"scene",r,_e.ENCODER_WASM)])}function tg(r,e){if(typeof r!="function")throw new Error("Draco module initializer could not be loaded");return Pi(t=>r({...e?{wasmBinary:e}:{},onModuleLoaded:t}),t=>({draco:t}))}function rg(r,e){if(typeof r=="function")return r;if(r&&typeof r=="object"){let t=r,n=t[e]||t.default;return typeof n=="function"?n:void 0}}function kv(r){let e=r.modules?.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function KR(r){let e=r;if(typeof e?.createDecoderModule!="function")throw new Error("Invalid draco3d decoder module");return e}function HR(r){let e=r;if(typeof e?.createEncoderModule!="function")throw new Error("Invalid draco3d encoder module");return e}function Cv(r,e){let t=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,s])=>`${n}:${String(s)}`).sort().join("|");return[r,e.useLocalLibraries?"local":"remote",e.CDN||"",t].join("|")}var Ev,Bv,Fv,Ov,Mv,Wc=p(()=>{"use strict";je();Iv();Sv();Ev=new Map,Bv=new Map,Fv=new WeakMap,Ov=new WeakMap;Mv=Promise.resolve()});function Vv(r,e,t){let n=Uv(e.metadata),s=[],i=XR(e.attributes);for(let o in r){let a=r[o],c=jv(o,a,i[o]);s.push(c)}if(t){let o=jv("indices",t);s.push(o)}return{fields:s,metadata:n}}function XR(r){let e={};for(let t in r){let n=r[t];e[n.name||"undefined"]=n}return e}function jv(r,e,t){let n={...ul(e),...t?Uv(t.metadata):{}};return Nm(r,e,n)}function Uv(r){Object.entries(r);let e={};for(let t in r)e[`${t}.string`]=JSON.stringify(r[t]);return e}var Gv=p(()=>{"use strict";Cn()});function ZR(r,e){switch(e){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function eD(r){let e=r.size(),t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function tD(r){let e=r.size(),t=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function rD(r,e){if(!Object.prototype.hasOwnProperty.call(e,r))return r;let t=/^(.*)_([0-9]+)$/.exec(r),n=t?t[1]:r,s=t?BigInt(t[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${s}`);)s++;return`${n}_${s}`}function nD(r){if(r.quantization_transform){let{quantization_bits:e,min_values:t,range:n}=r.quantization_transform;if(e!==void 0&&t&&n!==void 0)return{type:"quantization",bits:e,origin:Array.from(t),range:n}}if(r.octahedron_transform?.quantization_bits!==void 0)return{type:"octahedron",bits:r.octahedron_transform.quantization_bits}}function sD(r){if(r.includeAttributes&&r.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function iD(r,e){for(let t of r.includeAttributes||r.excludeAttributes||[])if(!e.includes(t))throw new Error(`DracoLoader: selected attribute "${t}" does not exist`)}function oD(r){let e=an(r);if(!e)throw new Error("Decoded mesh is missing positions");let t=r.POSITION;if(t?.transform?.type!=="quantization")return e;let{bits:n,origin:s,range:i}=t.transform,o=i/(2**n-1);return e.map(a=>a.map((c,u)=>s[u]+c*o))}var Pv,JR,YR,QR,$c,zv=p(()=>{"use strict";Cn();Gv();Pv={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},JR={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},YR=2,QR=4,$c=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){sD(t);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);this._disableAttributeTransforms(t);let s=this.decoder.GetEncodedGeometryType(n),i=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,o=null;try{switch(s){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeArrayToMesh(n,n.byteLength,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(i,s,t),c=this._getMeshData(i,a,t),u=oD(c.attributes),f=Vv(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...c,schema:f}}finally{o&&this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,n){let s=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:i}}_getDracoAttributes(e,t){let n={};for(let s=0;s<e.num_attributes();s++){let i=this.decoder.GetAttribute(e,s),o=this._getAttributeMetadata(e,s);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:s,metadata:o};let a=this._getQuantizationTransform(i,t);a&&(n[i.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(i,t);c&&(n[i.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,t,n){let s=this._getMeshAttributes(t,e,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(e,t,n){let s={},i={},a=Object.values(e.attributes).sort((c,u)=>c.attribute_index-u.attribute_index).map(c=>{let u=this._deduceAttributeName(c,n),f=rD(u,i);return i[f]=!0,c.name=f,{attributeName:f,loaderAttribute:c}});iD(n,Object.keys(i));for(let{attributeName:c,loaderAttribute:u}of a){if(!this._shouldExtractAttribute(c,u,n))continue;let f=this._getAttributeValues(t,u);if(f){let{value:l,size:d}=f;s[c]={value:l,size:d,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized,transform:nD(u)}}}return s}_shouldExtractAttribute(e,t,n){if(t.attribute_type===this.draco.POSITION){if(n.excludeAttributes?.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!n.excludeAttributes?.includes(e)}_getTriangleListIndices(e){let n=e.num_faces()*3,s=e.num_points()<=65536,i=n*(s?YR:QR),o=this.draco._malloc(i);try{if(s){if(!this.decoder.GetTrianglesUInt16Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,o,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),tD(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){let n=JR[t.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let s=t.num_components,o=e.num_points()*s,a=o*n.BYTES_PER_ELEMENT,c=ZR(this.draco,n),u,f=this.draco._malloc(a);try{let l=this.decoder.GetAttribute(e,t.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,l,c,a,f))throw new Error(`DRACO: Failed to decode attribute ${t.unique_id}.`);u=new n(this.draco.HEAPU8.buffer,f,o).slice()}finally{this.draco._free(f)}return{value:u,size:s}}_deduceAttributeName(e,t){let n=e.unique_id;for(let[o,a]of Object.entries(t.extraAttributes||{}))if(a===n)return o;let s=t.attributeNameEntry||"name";if(e.metadata[s]){let o=e.metadata[s].string;return o==="COLOR"?"COLOR_0":o==="TEX_COORD"?"TEXCOORD_0":o}let i=e.attribute_type;for(let o in Pv)if(this.draco[o]===i)return Pv[o];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){let n=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let t={},n=this.metadataQuerier.NumEntries(e);for(let s=0;s<n;s++){let i=this.metadataQuerier.GetEntryName(e,s);t[i]=this._getDracoMetadataField(e,i)}return t}_getDracoMetadataField(e,t){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,n);let s=eD(n);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:t=[],octahedronAttributes:n=[]}=e,s=[...t,...n];for(let i of s)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,t){let{quantizedAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>o.min_value(c))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){let{octahedronAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeOctahedronTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}});async function ua(r,e,t,n){let s=n?.reportProgress||e?.onProgress;s?.({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:i}=await t();(e?.signal||n?.signal)?.throwIfAborted();let o=new $c(i);try{let a=o.parseSync(r,e?.draco);return s?.({phase:"decode",completed:1,total:1,unit:"tasks"}),e?.draco?.shape==="arrow-table"?qs(a,"arrow-table"):a}finally{o.destroy()}}var Pl=p(()=>{"use strict";Cn();zv()});var z7,aD,cD,Wv=p(()=>{"use strict";Ps();Wc();Pl();qc();({preload:z7,...aD}=Pn),cD={...aD,parse:async(r,e,t)=>await ua(r,e,async()=>await Gl(on(e),"wasm",e?.draco?.decoderProfile),t)}});var ig={};Q(ig,{DracoWASMLoaderWithParser:()=>cD});var og=p(()=>{"use strict";Wv()});var J7,uD,fD,$v=p(()=>{"use strict";Ps();Wc();Pl();qc();({preload:J7,...uD}=Pn),fD={...uD,parse:async(r,e,t)=>await ua(r,e,async()=>await Gl(on(e),"js"),t)}});var ag={};Q(ag,{DracoJavaScriptLoaderWithParser:()=>fD});var cg=p(()=>{"use strict";$v()});function hD(r){let e=r?.modules?.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var rY,lD,dD,qv=p(()=>{"use strict";Wc();Pl();qc();({preload:rY,...lD}=Pn),dD={...lD,parse:async(r,e,t)=>await ua(r,e,async()=>await ng(hD(e)),t)}});var ug={};Q(ug,{Draco3DLoaderWithParser:()=>dD});var fg=p(()=>{"use strict";qv()});async function pD(r,e){let t=e;switch(mD(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(og(),ig));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(cg(),ag));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(fg(),ug));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}function mD(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Pn.options.draco.backend}var Pn,qc=p(()=>{"use strict";Po();Zb();eg();vv();Pn={dataType:null,batchType:null,...Pc,version:Gc,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:jf,deserializeWorkerResult:Vf,options:{draco:Av},preload:pD}});var Kv=p(()=>{"use strict";qc()});function Hv(r){let e={};for(let t in r){let n=r[t];if(t!=="indices"){let s=lg(n);e[t]=s}}return e}function lg(r){let{buffer:e,size:t,count:n}=bD(r);return{value:e,size:t,byteOffset:0,count:n,type:ra(t),componentType:Gn(e)}}function bD(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=gD(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function gD(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}var Xv=p(()=>{"use strict";Hs()});var dg={};Q(dg,{decode:()=>xD,name:()=>yD,preprocess:()=>wD});function wD(r,e,t){let n=new ae(r);for(let s of n.meshes)for(let i of n.getReferences(s).primitives)n.getExtension(i,fa)}async function xD(r,e,t){if(!e?.gltf?.decompressMeshes)return;let n=new ae(r),s=[];for(let i of n.meshes)for(let o of n.getReferences(i).primitives)n.getExtension(o,fa)&&s.push(TD(n,o,e,t));await Promise.all(s),n.removeExtension(fa)}async function TD(r,e,t,n){let s=r.getExtension(e,fa);if(!s)return;let i=ar(r.data,r.gltf.buffers,s.bufferView),o=$i(i.buffer,i.byteOffset,i.byteLength),a={...t,draco:{...t.draco,shape:"mesh",topology:"triangle-list",decoderProfile:t.draco?.decoderProfile||"gltf",extraAttributes:s.attributes}};delete a["3d-tiles"];let c=await gc(o,Pn,a,n),u=Hv(c.attributes);for(let f of Object.keys(s.attributes))if(!Object.hasOwn(u,f))throw new Error(`glTF: Draco decompression did not produce attribute ${f}`);for(let[f,l]of Object.entries(u))if(f in e.attributes){let d=e.attributes[f],h=r.data.accessors?.[d];h?.normalized!==void 0&&(l.normalized=h.normalized),h?.min&&h?.max&&(l.min=h.min,l.max=h.max)}e.attributes={...e.attributes,...u},c.indices&&(e.indices=lg(c.indices),e.mode=4),r.removeExtension(e,fa),_D(e)}function _D(r){if(!r.attributes||Object.keys(r.attributes).length===0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}var fa,yD,Jv=p(()=>{"use strict";je();Kv();Ke();Xv();Yi();fa="KHR_draco_mesh_compression",yD=fa});var pg={};Q(pg,{decode:()=>LD,name:()=>AD});async function LD(r,e){let t=new ae(r);if(!t.hasExtension(la)||!e.gltf?.loadBuffers)return;let s=r.json.materials||[];for(let i=0;i<s.length;i++)SD(i,r,t);s.some(i=>hg(i).length>0)||t.removeExtension(la)}function SD(r,e,t){let n=e.json.materials?.[r],s=hg(n),i=new Map,o=BD(e);for(let a of s){let c=a.extensions?.[la];if(c){let u=c.texCoord??a.texCoord??0,f=FD(u,c),l=i.get(f);if(!l){if(l={sourceTexCoord:u,texCoord:o,matrix:DD(c)},!OD(e,r,l))continue;o++,i.set(f,l)}a.texCoord=l.texCoord,ED(t,a,la),a.extensions&&Object.keys(a.extensions).length===0&&delete a.extensions}}}function ED(r,e,t){e.extensions?.[t]!==void 0&&(r.recordRemovedExtension(t),delete e.extensions[t])}function hg(r){if(!r||typeof r!="object")return[];let e=r,t=[],n=e.extensions;Number.isFinite(e.index)&&n?.[la]&&t.push(e);for(let[s,i]of Object.entries(e))s!=="extras"&&t.push(...hg(i));return t}function BD(r){let e=-1;for(let t of r.json.meshes||[])for(let n of t.primitives)for(let s of Object.keys(n.attributes)){let i=/^TEXCOORD_(\d+)$/.exec(s);i&&(e=Math.max(e,Number(i[1])))}return e+1}function FD(r,e){let{offset:t=[0,0],rotation:n=0,scale:s=[1,1]}=e;return JSON.stringify([r,t,n,s])}function OD(r,e,t){let n=[],s=r.json.meshes||[];for(let i of s)for(let o of i.primitives){let a=o.material;Number.isFinite(a)&&e===a&&n.push(o)}if(n.length===0||n.some(i=>!MD(r,i,t.sourceTexCoord)))return!1;for(let i of n)RD(r,i,t);return!0}function MD(r,e,t){let n=e.attributes[`TEXCOORD_${t}`],s=n;if(ArrayBuffer.isView(s?.value))return!0;if(!Number.isFinite(n))return!1;let i=r.json.accessors?.[n];if(!i||i.bufferView===void 0||i.sparse)return!1;let o=r.json.bufferViews?.[i.bufferView];return!!(o&&r.buffers[o.buffer])}function RD(r,e,t){let{sourceTexCoord:n,texCoord:s,matrix:i}=t,o=e.attributes[`TEXCOORD_${n}`],a=o;if(ArrayBuffer.isView(a?.value)){let c=new Float32Array(a.count*2);for(let u=0;u<a.count;u++)Yv(a.value.subarray(u*2,u*2+2),a,i,c,u*2);Qv(s,a,e,r,c);return}if(Number.isFinite(o)){let c=r.json.accessors?.[o];if(c&&c.bufferView!==void 0){let u=r.json.bufferViews?.[c.bufferView];if(u){let{arrayBuffer:f,byteOffset:l}=r.buffers[u.buffer],d=(l||0)+(c.byteOffset||0)+(u.byteOffset||0),{ArrayType:h,length:m}=kc(c,u),b=Nc[c.componentType],w=Sl[c.type],g=u.byteStride||b*w,x=new Float32Array(m);for(let T=0;T<c.count;T++){let _=new h(f,d+T*g,2);Yv(_,c,i,x,T*w)}Qv(s,c,e,r,x)}}}}function Yv(r,e,t,n,s){let i=e.componentType===5120||e.componentType===5122,o=2**(Nc[e.componentType]*8-(i?1:0))-1;zl.set(e.normalized?Math.max(r[0]/o,-1):r[0],e.normalized?Math.max(r[1]/o,-1):r[1],1),zl.transformByMatrix3(t),n.set([zl[0],zl[1]],s)}function Qv(r,e,t,n,s){n.buffers.push({arrayBuffer:Ki(s.buffer),byteOffset:0,byteLength:s.buffer.byteLength}),n.json.bufferViews=n.json.bufferViews||[];let i=n.json.bufferViews;i.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:i?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),t.attributes[`TEXCOORD_${r}`]=o.length-1)}function DD(r){let{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,s=new kn().set(1,0,0,0,1,0,e[0],e[1],1),i=vD.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=ID.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(i).multiplyRight(o)}var la,AD,zl,vD,ID,Zv=p(()=>{"use strict";ol();Hs();lb();Ke();je();la="KHR_texture_transform",AD=la,zl=new Ic,vD=new kn,ID=new kn});var mg={};Q(mg,{decode:()=>kD,encode:()=>CD,name:()=>ND});async function kD(r){let e=new ae(r),t=e.getExtension(so);t&&(e.data.lights=t.lights,e.removeExtension(so));for(let n of e.nodes){let s=e.getExtension(n,so);s&&(n.light=s.light),e.removeExtension(n,so)}}async function CD(r){let e=new un(r),{json:t}=e;if(t.lights){let n=e.addExtension(so);H(!n.lights),n.lights=t.lights,delete t.lights}if(e.json.lights){for(let n of e.json.lights){let s=n.node;e.addObjectExtension(s,so,n)}delete e.json.lights}}var so,ND,eI=p(()=>{"use strict";Ji();Ke();Cc();so="KHR_lights_punctual",ND=so});var bg={};Q(bg,{decode:()=>VD,encode:()=>UD,name:()=>jD});async function VD(r){let e=new ae(r);for(let t of e.materials)e.getExtension(t,da)&&(t.unlit=!0),e.removeExtension(t,da);e.removeExtension(da)}function UD(r){let e=new un(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,da,{}),e.registerRequiredExtension(da))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var da,jD,tI=p(()=>{"use strict";Ke();Cc();da="KHR_materials_unlit",jD=da});var gg={};Q(gg,{decode:()=>PD,encode:()=>zD,name:()=>GD});async function PD(r){let e=new ae(r),t=e.getExtension(Kc);if(t){let n=WD(t,e);for(let s of e.materials){let i=e.getExtension(s,Kc);i&&(s.technique=Object.assign({},i,n[i.technique]),s.technique.values=$D(s.technique,e)),e.removeExtension(s,Kc)}e.removeExtension(Kc)}}async function zD(r,e){}function WD(r,e){let{programs:t=[],shaders:n=[],techniques:s=[]}=r,i=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=i.decode(ar(e.data,e.gltf.buffers,o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),t.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),s.forEach(o=>{o.program=t[o.program]}),s}function $D(r,e){let t=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(n=>{r.uniforms[n].value&&!(n in t)&&(t[n]=r.uniforms[n].value)}),Object.keys(t).forEach(n=>{typeof t[n]=="object"&&t[n].index!==void 0&&(t[n].texture=e.resolveTexture(t[n].index,`technique.values.${n}.index`))}),t}var Kc,GD,rI=p(()=>{"use strict";Ke();Yi();Kc="KHR_techniques_webgl",GD=Kc});var yg={};Q(yg,{decode:()=>KD,name:()=>qD});async function KD(r,e){let t=new ae(r);HD(t,e)}function HD(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(nI);t&&(e.gltf?.loadImages&&XD(r,t),JD(r,t))}function XD(r,e){let t=e.schema;if(!t)return;let n=t.classes,{featureTextures:s}=e;if(n&&s)for(let i in n){let o=n[i],a=QD(s,i);a&&eN(r,a,o)}}function JD(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.featureTables;if(n&&s)for(let i in n){let o=YD(s,i);o&&ZD(r,t,o)}}function YD(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function QD(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function ZD(r,e,t){if(!t.class)return;let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c=tN(r,e,o,s,a);a.data=c}}}function eN(r,e,t){let n=e.class;for(let s in t.properties){let i=e?.properties?.[s];if(i){let o=oN(r,i,n);i.data=o}}}function tN(r,e,t,n,s){let i=[],o=s.bufferView,a=r.getTypedArrayForBufferView(o),c=rN(r,t,s,n),u=nN(r,t,s,n,c);return t.type==="STRING"||t.componentType==="STRING"?i=Ml(n,a,c,u,t.type==="ARRAY"?t.componentCount:void 0):sN(t)&&(i=iN(t,n,a,c)),i}function rN(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?na(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function nN(r,e,t,n,s){if(typeof t.stringOffsetBufferView<"u"){let i=s?Number(s[n]):n*(e.type==="ARRAY"&&e.componentCount||1);return na(r,t.stringOffsetBufferView,t.offsetType||"UINT32",i)}return null}function sN(r){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(r.type)||typeof r.componentType<"u"&&e.includes(r.componentType)}function iN(r,e,t,n){let s=r.type==="ARRAY",i=r.componentCount,o="SCALAR",a=r.componentType||r.type,c=jc(o,a),u=t.byteLength/c,f=sa(t,o,a,u);return s?n?Vc(f,e,n):i?Uc(f,e,i):[]:f}function oN(r,e,t){let n=r.data;if(!n.meshes)return[];let s=[];for(let i of n.meshes)for(let o of i.primitives)aN(r,t,e,s,o);return s}function aN(r,e,t,n,s){let i={channels:t.channels,...t.texture},o=ia(r,i,s);o&&Ol(r,e,o,n,s)}var nI,qD,sI=p(()=>{"use strict";Ke();Rl();nI="EXT_feature_metadata",qD=nI});async function oI(r,e={},t){let n=iI.filter(s=>cI(s.name,e));for(let s of n)await s.preprocess?.(r,e,t)}async function aI(r,e={},t){let n=iI.filter(s=>cI(s.name,e));for(let s of n)await s.decode?.(r,e,t)}function cI(r,e){let t=e?.gltf?.excludeExtensions||{};return Array.isArray(t)?!t.includes(r):!(r in t&&!t[r])}var iI,uI=p(()=>{"use strict";ev();tv();nv();sv();ov();cv();uv();gv();wv();xv();Tv();_v();Jv();Zv();zb();eI();tI();rI();sI();iI=[Xb,Hb,dg,Cb,Rb,Vb,Gb,Pb,Wb,$b,qb,Yb,Jb,Qb,mg,bg,gg,pg,yg]});function fI(r){let e=new ae(r);for(let t of e.images){let n=e.getExtension(t,wg);n&&(t.bufferView=n.bufferView,t.mimeType=n.mimeType,delete t.uri),e.removeExtension(t,wg)}for(let t of e.data.buffers||[])t.id==="binary_glTF"&&delete t.uri;e.removeExtension(wg)}var wg,lI=p(()=>{"use strict";Ke();wg="KHR_binary_glTF"});function hI(r,e){let t=r.accessors||[],n=r.bufferViews||[],s=uN(r),i=new Map;for(let[o,a]of t.entries()){let c=a.bufferView;if(c===void 0&&!a.byteStride){delete a.byteStride;continue}let u=n[c],f=s.get(o)||"unused",l=fN(a),d=a.byteStride===0?l:a.byteStride??l,h=a.byteOffset??0,m=u?.byteOffset??0,b=typeof a.componentType=="number"&&Object.hasOwn(Wl,a.componentType)?Wl[a.componentType]:0,w=f==="vertex",g=w?d>=l&&d>=4&&d<=252&&d%4===0&&h%4===0&&(m+h)%4===0:d===l;if(!u||!l||f==="mixed"||!Number.isInteger(d)||!g||w&&d>u.byteLength||!Number.isInteger(a.count)||a.count<1||!Number.isInteger(h)||h<0||!Number.isInteger(m)||m<0||h%b!==0||(m+h)%b!==0||a.type.startsWith("MAT")&&(m+h)%4!==0||!Number.isInteger(u.byteLength)||h+(a.count-1)*d+l>u.byteLength){e(o);continue}let x=`${c}:${f}:${w?d:0}`,T=i.get(x);if(T===void 0){let _={...u};delete _.id,delete _.byteStride,delete _.target,w?(_.byteStride=d,_.target=34962):f==="indices"&&(_.target=34963),T=n.length,n.push(_),i.set(x,T)}a.bufferView=T,delete a.byteStride}}function uN(r){let e=new Map,t=(n,s)=>{if(n===void 0)return;let i=e.get(n);e.set(n,i&&i!==s?"mixed":s)};for(let n of r.meshes||[])for(let s of n.primitives){for(let i of Object.values(s.attributes))t(i,"vertex");t(s.indices,"indices")}for(let n of r.animations||[])for(let s of n.samplers)t(s.input,"animation"),t(s.output,"animation");for(let n of r.skins||[])t(n.inverseBindMatrices,"inverseBind");return e}function fN(r){let e=typeof r.componentType=="number"&&Object.hasOwn(Wl,r.componentType)?Wl[r.componentType]:0,t=Object.hasOwn(dI,r.type)?dI[r.type]:0;if(!e||!t)return 0;let n=r.type==="MAT2"?2:r.type==="MAT3"?3:4;return r.type.startsWith("MAT")&&n*e%4!==0?0:(e||0)*t}var Wl,dI,pI=p(()=>{"use strict";Wl={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},dI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}});function mI(r,e,t){let n=r.nodes||[],s=r.skins||[],i=s.length,o=!1;for(let a=0;a<i;a++){let c=s[a],u=c.jointNames;if(!Array.isArray(u)||u.length===0||u.some(m=>typeof m!="string"||!m)||new Set(u).size!==u.length){t(`skin ${a} has invalid joint names`),o=!0;continue}let f=n.flatMap((m,b)=>m.skin===a?[b]:[]),l=(f.length?f:[void 0]).map(m=>lN(n,u,m,e,b=>t(`skin ${a} ${b}`))),d=l.some(m=>!m);o||=d;let h=new Map;for(let m of l){if(!m)continue;let b=`${m.skeletonIndex}:${m.jointIndices.join(",")}`,w=h.get(b);if(w===void 0){let g={...c,joints:m.jointIndices,skeleton:m.skeletonIndex};delete g.jointNames,c.bindShapeMatrix!==void 0&&pN(c.bindShapeMatrix)&&delete g.bindShapeMatrix,!d&&h.size===0?(w=a,s[a]=g):(delete g.id,w=s.length,s.push(g)),h.set(b,w)}m.nodeIndex!==void 0&&(n[m.nodeIndex].skin=w,delete n[m.nodeIndex].skeletons)}}if(!o)for(let a of n)delete a.jointName}function lN(r,e,t,n,s){let i=t===void 0?void 0:r[t].skeletons;if(i!==void 0&&(!Array.isArray(i)||i.some(l=>typeof l!="string"||!l)||new Set(i).size!==i.length))return s("has invalid skeleton roots"),null;let o=(i||[]).map(n),a=o.length?dN(r,o):r.map((l,d)=>d);if(!a)return s("has invalid or overlapping skeleton subtrees"),null;let c=[],u=new Map;for(let l of a){let d=r[l].jointName;if(d===void 0)continue;let h=u.get(d)||[];h.push(l),u.set(d,h)}for(let l of e){let d=u.get(l)||[];if(d.length!==1)return s(`cannot uniquely resolve joint ${l}`),null;c.push(d[0])}let f=hN(r,[...c,...o]);return f===void 0?(s("joints have no unambiguous common hierarchy root"),null):{nodeIndex:t,jointIndices:c,skeletonIndex:o.length===1?o[0]:f}}function dN(r,e){let t=new Set,n=[...e];for(;n.length;){let s=n.pop();if(!Number.isSafeInteger(s)||!r[s]||t.has(s))return null;t.add(s),n.push(...r[s].children||[])}return Array.from(t)}function hN(r,e){let t=new Map;for(let[i,o]of r.entries())for(let a of o.children||[]){if(!Number.isSafeInteger(a)||!r[a]||t.has(a))return;t.set(a,i)}let n=e.map(i=>{let o=[],a=new Set,c=i;for(;c!==void 0;){if(a.has(c))return[];a.add(c),o.push(c),c=t.get(c)}return o}),s=n.map(i=>new Set(i));return n[0].find(i=>s.every(o=>o.has(i)))}function pN(r){return Array.isArray(r)&&r.length===16&&Array.from(r).every((e,t)=>e===(t%5===0?1:0))}var bI=p(()=>{"use strict"});function $l(r,e){if(!e.length)return;let t=new Map;for(let n of e){let s=t.get(n.bufferIndex)||[];s.push(n),t.set(n.bufferIndex,s)}r.buffers=[...r.buffers],r.json.bufferViews||=[];for(let[n,s]of t){let i=r.json.buffers[n],o=r.buffers[n],a=Te(i.byteLength,4),c=a+s.reduce((l,d)=>l+Te(d.bytes.byteLength,4),0),u=new ArrayBuffer(c),f=new Uint8Array(u);f.set(new Uint8Array(o.arrayBuffer,o.byteOffset,i.byteLength));for(let l of s){f.set(new Uint8Array(l.bytes),a);let d=r.json.bufferViews.length;r.json.bufferViews.push({buffer:n,byteOffset:a,byteLength:l.bytes.byteLength,...l.byteStride===void 0?{}:{byteStride:l.byteStride},...l.target===void 0?{}:{target:l.target}}),l.apply(d),a+=Te(l.bytes.byteLength,4)}i.byteLength=c,i.uri!==void 0&&(i.uri=`data:application/octet-stream;base64,${nm(u)}`),r.buffers[n]={arrayBuffer:u,byteOffset:0,byteLength:c}}}var xg=p(()=>{"use strict";je()});function gI(r,e){let t=new Map;for(let[n,s]of(r.json.skins||[]).entries()){if(s.bindShapeMatrix===void 0)continue;let i=s.bindShapeMatrix;if(!yI(i)){e(`skin ${n} non-identity bindShapeMatrix requires a finite affine matrix`);continue}let o=`${s.inverseBindMatrices}:${i.join(",")}`,a=t.get(o);if(a){if((s.joints||s.jointNames||[]).length>a.count){e(`skin ${n} non-identity bindShapeMatrix has too few inverse-bind matrices`);continue}a.skins.push(s);continue}let c=mN(r,s,i);if(typeof c=="string"){e(`skin ${n} non-identity bindShapeMatrix ${c}`);continue}t.set(o,c)}$l(r,Array.from(t.values(),n=>({bufferIndex:n.bufferIndex,bytes:n.matrixBytes,apply:s=>{r.json.accessors||=[];let i=r.json.accessors.length;r.json.accessors.push({bufferView:s,byteOffset:0,componentType:5126,count:n.count,type:"MAT4"});for(let o of n.skins)o.inverseBindMatrices=i,delete o.bindShapeMatrix}})))}function mN(r,e,t){let n=r.json.accessors?.[e.inverseBindMatrices],s=(e.joints||e.jointNames||[]).length;if(!n||n.componentType!==5126||n.type!=="MAT4"||n.normalized||n.sparse||n.extensions||Object.hasOwn(n,"byteStride")||!Number.isSafeInteger(n.count)||n.count<1)return"requires packed FLOAT MAT4 inverse-bind matrices";if(n.count<s)return"has too few inverse-bind matrices";let i=r.json.bufferViews?.[n.bufferView],o=i?.buffer,a=r.json.buffers?.[o],c=r.buffers[o];if(!i||o===void 0||!a||!c)return"requires a loaded inverse-bind buffer";if(i.extensions)return"does not support inverse-bind buffer-view extensions";let u=i.byteOffset??0,f=n.byteOffset??0,l=n.count*64;if(!(c.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteOffset)||c.byteOffset<0||!Number.isSafeInteger(c.byteLength)||c.byteLength<a.byteLength||c.byteOffset+c.byteLength>c.arrayBuffer.byteLength||!Number.isSafeInteger(u)||u<0||u%4!==0||!Number.isSafeInteger(i.byteLength)||i.byteLength<1||i.byteStride!==void 0||u+i.byteLength>a.byteLength||!Number.isSafeInteger(f)||f<0||f%4!==0||f+l>i.byteLength)return"has an invalid inverse-bind buffer layout";let d=new DataView(c.arrayBuffer),h=c.byteOffset+u+f,m=new ArrayBuffer(l),b=new DataView(m);for(let w=0;w<n.count;w++){let g=Array.from({length:16},(x,T)=>d.getFloat32(h+w*64+T*4,!0));if(!yI(g))return"requires finite affine inverse-bind matrices";for(let x=0;x<4;x++)for(let T=0;T<4;T++){let _=0;for(let v=0;v<4;v++)_+=g[v*4+T]*t[x*4+v];if(!Number.isFinite(Math.fround(_)))return"produces non-finite FLOAT matrix values";b.setFloat32(w*64+(x*4+T)*4,_,!0)}}return{bufferIndex:o,count:n.count,matrixBytes:m,skins:[e]}}function yI(r){if(!Array.isArray(r)||r.length!==16)return!1;for(let e=0;e<16;e++)if(!Number.isFinite(r[e]))return!1;return r[3]===0&&r[7]===0&&r[11]===0&&r[15]===1}var wI=p(()=>{"use strict";xg()});function TI(r){let e=r.accessors||[],t=new Map,n=new Map,s=_g(r),i=(o,a)=>{if(!Number.isSafeInteger(o)||o<0||!Object.hasOwn(e,o))return o;let c=e[o];if(!c)return o;let u=t.get(o)||new Map,f=`${a.usage}:${a.mode}:${["unit","signed","direction"].includes(a.mode)?a.semantic?.split("_")[0]:""}:${a.hasOpaqueConsumer?"opaque":""}`,l=u.get(f);return l===void 0&&(l=u.size?e.length:o,u.size&&e.push({...c}),u.set(f,l),n.set(l,a),t.set(o,u)),l};for(let o of r.meshes||[])for(let a of o.primitives){for(let[c,u]of Object.entries(a.attributes)){let f=e[u],l=["NORMAL","TANGENT"].includes(c)&&f&&[5120,5121,5122,5123].includes(f.componentType)?"direction":/^JOINTS_\d+$/.test(c)?"joints":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&f&&[5120,5122].includes(f.componentType)?"signed":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&f&&[5121,5123].includes(f.componentType)&&!f.normalized?"unit":/^WEIGHTS_\d+$/.test(c)?"weights":"copy";a.attributes[c]=i(u,{usage:"vertex",mode:l,semantic:c,...["signed","direction"].includes(l)?{hasOpaqueConsumer:s}:{}})}a.indices!==void 0&&(a.indices=i(a.indices,{usage:"indices",mode:"copy",hasOpaqueConsumer:a.extensions!==void 0}))}for(let o of r.animations||[])for(let a of o.samplers)a.input=i(a.input,{usage:"animation",mode:"copy"}),a.output=i(a.output,{usage:"animation",mode:"copy"});for(let o of r.skins||[])o.inverseBindMatrices!==void 0&&(o.inverseBindMatrices=i(o.inverseBindMatrices,{usage:"inverseBind",mode:"copy"}));for(let o=0;o<e.length;o++)n.has(o)||n.set(o,{usage:"unused",mode:"copy"});return n}function _I(r,e,t,n,s){let i=[],o=[];for(let[a,c]of e){let u=r.json.accessors[a],f=c.mode==="joints"||c.mode==="weights"||c.semantic?.startsWith("WEIGHTS_"),l=!!(f&&["SCALAR","VEC2","VEC3"].includes(u.type)),d=c.mode==="weights"&&(u.type!=="VEC4"||![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized),h=c.mode==="signed",m=c.mode==="direction",b=h||m,w=c.mode==="joints"&&(![5121,5123].includes(u.componentType)||u.normalized||u.type!=="VEC4");if(!t.has(a)&&!w&&!d&&!b&&!l&&c.usage!=="indices"&&c.mode!=="unit")continue;let g=Hc(r,a);if(typeof g=="string"){n(`accessor ${a} layout requires binary repacking: ${g}`);continue}if(f&&!["SCALAR","VEC2","VEC3","VEC4"].includes(u.type)){n(`accessor ${a} skin influences require scalar/vector data`);continue}if(c.mode==="weights"&&(![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized||u.componentType!==5126&&!u.normalized)){n(`accessor ${a} weights require FLOAT or normalized unsigned data`);continue}let x=u.componentType,T=u.normalized;if(b){if(c.hasOpaqueConsumer){n(`accessor ${a} integer conversion cannot interpret opaque extension consumers`);continue}if(!(m?[c.semantic==="NORMAL"?"VEC3":"VEC4"]:c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)||T!==void 0&&typeof T!="boolean"){n(`accessor ${a} integer ${c.semantic} has incompatible shape or normalization`);continue}let se=!0;for(let we=0;we<u.count;we++)if(m){let Et=Math.hypot(Math.fround(ha(g,we,0)),Math.fround(ha(g,we,1)),Math.fround(ha(g,we,2)));(Math.abs(Et-1)>1e-5||c.semantic==="TANGENT"&&![-1,1].includes(ha(g,we,3)))&&(se=!1)}else if(!c.semantic?.startsWith("TEXCOORD_"))for(let Et=0;Et<g.rows;Et++){let ur=ha(g,we,Et);(ur<0||ur>1)&&(se=!1)}if(!se){n(m?`accessor ${a} integer ${c.semantic} requires unit directions and tangent handedness of +/-1; values are not repaired`:`accessor ${a} signed ${c.semantic} values must remain in [0, 1]`);continue}x=5126,T=!1}if(c.usage==="indices"){if(u.type!=="SCALAR"||![5121,5123,5125].includes(x)||T){n(`index accessor ${a} requires unnormalized unsigned SCALAR data`);continue}let ce=0;for(let we=0;we<u.count;we++)ce=Math.max(ce,Pt(g,we,0));if(ce===(x===5121?255:x===5123?65535:4294967295)){if(c.hasOpaqueConsumer){n(`index accessor ${a} cannot widen opaque primitive extension semantics`);continue}if(x===5125){n(`index accessor ${a} contains the unrepresentable uint32 restart value`);continue}x=x===5121?5123:5125}if(!t.has(a)&&x===u.componentType)continue}if(w||c.mode==="unit"){if(w&&u.normalized){n(`accessor ${a} joint indices require unnormalized scalar/vector data`);continue}if(c.mode==="unit"&&!(c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)){n(`accessor ${a} integer ${c.semantic} has an incompatible shape`);continue}let ce=0,se=!0;for(let we=0;we<u.count;we++)for(let Et=0;Et<g.rows*g.columns;Et++){let ur=Pt(g,we,Et);(!Number.isInteger(ur)||ur<0||w&&ur>65535)&&(se=!1),ce=Math.max(ce,ur)}if(!se){n(`accessor ${a} joint indices require finite integers in [0, 65535]`);continue}if(w)x=ce<=255?5121:5123,T=!1;else if(ce<=1)x=5126,T=!1;else if(n(`accessor ${a} ambiguous integer attribute normalization; best effort assumes normalized unsigned values`),T=!0,!t.has(a)&&!l){o.push(()=>{u.normalized=!0});continue}}let _=l?4:g.rows,v=Tg[x],I=g.columns>1?Te(g.rows*v,4):_*v,N=I*g.columns,q=c.usage==="vertex"?Te(N,4):N,re=new ArrayBuffer(u.count*q),pe=new Uint8Array(re),Me=new Uint8Array(g.data.buffer),Re=new DataView(re);for(let ce=0;ce<u.count;ce++)for(let se=0;se<g.columns;se++)if(x===u.componentType){let we=g.byteOffset+ce*g.byteStride+se*g.rows*g.componentSize;pe.set(Me.subarray(we,we+g.rows*g.componentSize),ce*q+se*I)}else for(let we=0;we<g.rows;we++){let Et=(b?ha:Pt)(g,ce,se*g.rows+we),ur=ce*q+se*I+we*v;x===5126?Re.setFloat32(ur,Et,!0):x===5121?Re.setUint8(ur,Et):x===5125?Re.setUint32(ur,Et,!0):Re.setUint16(ur,Et,!0)}i.push({bufferIndex:g.bufferIndex,bytes:re,...c.usage==="vertex"?{byteStride:q,target:34962}:c.usage==="indices"?{target:34963}:{},apply:ce=>{b&&s(`Converted ${h?"signed":"integer"} ${c.semantic} accessor ${a} to FLOAT, preserving ${g.accessor.normalized?"explicitly normalized":"literal"} values.`),c.usage==="indices"&&x!==u.componentType&&s(`Widened index accessor ${a} to preserve a glTF 1 index reserved by glTF 2.`),u.bufferView=ce,u.byteOffset=0,delete u.byteStride,(x!==u.componentType||l)&&(delete u.min,delete u.max),u.componentType=x,l&&(u.type="VEC4"),T?u.normalized=!0:delete u.normalized}})}$l(r,i);for(let a of o)a()}function ha(r,e,t){let n=Pt(r,e,t);if(r.accessor.normalized!==!0)return n;let s=bN[r.accessor.componentType];return Math.max(n/s,-1)}function _g(r){let e=[r],t=new Set;for(;e.length;){let n=e.pop();if(!(!n||typeof n!="object"||t.has(n))){t.add(n);for(let[s,i]of Object.entries(n))if(s!=="extras"){if(s==="extensions"&&i&&typeof i=="object"&&Object.keys(i).some(o=>!["KHR_materials_unlit","KHR_materials_common"].includes(o)))return!0;e.push(i)}}}return!1}function Hc(r,e){let t=r.json.accessors?.[e];if(!t||!Number.isSafeInteger(e)||e<0)return"invalid accessor reference";let n=typeof t.componentType=="number"&&Object.hasOwn(Tg,t.componentType)?Tg[t.componentType]:void 0,s=typeof t.type=="string"&&Object.hasOwn(xI,t.type)?xI[t.type]:void 0;if(!n||!s||!Number.isSafeInteger(t.count)||t.count<1)return"invalid component type, shape, or count";let[i,o]=s,a=r.json.bufferViews?.[t.bufferView],c=r.json.buffers?.[a?.buffer],u=r.buffers[a?.buffer];if(!a||!c||!u)return"requires a loaded accessor buffer";if(t.sparse||t.extensions||a.extensions)return"sparse or extension-bearing data is unsupported";let f=i*o*n,l=t.byteStride??a.byteStride??f,d=l===0?f:l,h=t.byteOffset??0,m=a.byteOffset??0;return!(u.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(d)||d<f||t.byteStride!==void 0&&t.byteStride>255||!Number.isSafeInteger(h)||h<0||!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteLength)||c.byteLength<1||m+a.byteLength>c.byteLength||h+(t.count-1)*d+f>a.byteLength||!Number.isSafeInteger(u.byteOffset)||u.byteOffset<0||!Number.isSafeInteger(u.byteLength)||u.byteLength<c.byteLength||u.byteOffset+u.byteLength>u.arrayBuffer.byteLength?"invalid source buffer span or stride":{accessor:t,bufferIndex:a.buffer,componentSize:n,rows:i,columns:o,byteStride:d,data:new DataView(u.arrayBuffer),byteOffset:u.byteOffset+m+h}}function Pt(r,e,t){let n=r.byteOffset+e*r.byteStride+t*r.componentSize;switch(r.accessor.componentType){case 5120:return r.data.getInt8(n);case 5121:return r.data.getUint8(n);case 5122:return r.data.getInt16(n,!0);case 5123:return r.data.getUint16(n,!0);case 5125:return r.data.getUint32(n,!0);default:return r.data.getFloat32(n,!0)}}var Tg,bN,xI,Xc=p(()=>{"use strict";je();xg();Tg={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bN={5120:127,5121:255,5122:32767,5123:65535},xI={SCALAR:[1,1],VEC2:[2,1],VEC3:[3,1],VEC4:[4,1],MAT2:[2,2],MAT3:[3,3],MAT4:[4,4]}});function vI(r,e){let t=r.asset;t.premultipliedAlpha&&e("asset premultipliedAlpha rendering"),AI(t,["profile","premultipliedAlpha"]);for(let[n,s]of(r.textures||[]).entries()){let i=s;for(let[o,a]of Object.entries({format:6408,internalFormat:6408,target:3553,type:5121}))i[o]!==void 0&&i[o]!==a&&e(`texture ${n} non-default ${o} rendering`);AI(i,["format","internalFormat","target","type"])}}function AI(r,e){let t={};for(let a of e)Object.hasOwn(r,a)&&(t[a]=r[a],delete r[a]);if(!Object.keys(t).length)return;let n=Ag(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},s=Ag(n.gltf1)?n.gltf1:n.gltf1===void 0?{}:{originalExtras:n.gltf1},i=Ag(s.legacyFields)?s.legacyFields:s.legacyFields===void 0?{}:{originalExtras:s.legacyFields},o=Object.keys(t).some(a=>Object.hasOwn(i,a));r.extras={...n,gltf1:{...s,legacyFields:{...i,...t,...o?{originalExtras:i}:{}}}}}function Ag(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function vg(r){let e=/^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(r);if(e){let t=e[1].startsWith("JOINT")?"JOINTS":e[1].startsWith("WEIGHT")?"WEIGHTS":e[1],n=Number(e[2]||0);if(!Number.isSafeInteger(n)||n>999999999)throw new Error(`glTF v1: invalid attribute set index ${r}`);return`${t}_${n}`}return["POSITION","NORMAL","TANGENT"].includes(r)||r.startsWith("_")||r.includes(":")?r:`_${r}`}var II=p(()=>{"use strict"});function LI(r,e,t){for(let[s,i]of(r.animations||[]).entries()){let l=function(d,h,m){try{let b=typeof d=="string"?e(d,h):d,w=h==="accessor"?r.accessors:r.nodes;if(typeof b=="number"&&Number.isSafeInteger(b)&&b>=0&&w?.[b])return b}catch{}return t(`animation ${s} ${m} unresolved ${h} reference`),d};var n=l;let o=i,a=o.parameters||{},c=new Map,u=i.samplers,f=Array.isArray(u)?u.map((d,h)=>[String(h),d]):Object.entries(u||{});i.samplers=f.map(([d,h],m)=>{c.set(d,m);for(let b of["input","output"]){let w=h[b],g=Object.hasOwn(a,w)?a[w]:w;h[b]=l(g,"accessor",`sampler ${d} ${b}`)}return h.interpolation??="LINEAR",h}),delete o.parameters;for(let[d,h]of(i.channels||[]).entries()){if(typeof h.sampler=="string"){let b=c.get(h.sampler);b===void 0?t(`animation ${s} channel ${d} unresolved sampler ${h.sampler}`):h.sampler=b}let m=h.target;m?.id!==void 0?(m.node=l(m.id,"node",`channel ${d} target`),delete m.id):typeof m?.node=="string"&&(m.node=l(m.node,"node",`channel ${d} target`))}}}var SI=p(()=>{"use strict"});function EI(r,e,t){let n=r.nodes||[],s=new Map;for(let[a,c]of n.entries())for(let u of c.children||[])s.set(u,s.has(u)?null:a);let i=[];for(let[a,c]of(r.scenes||[]).entries()){let u=o(c.nodes||[]);if(!u){e(`scene ${a} invalid node hierarchy`);continue}for(let f of Array.from(u)){let l=r.skins?.[n[f].skin];if(!Array.isArray(l?.joints)||!l.joints.length||l.skeleton===void 0||u.has(l.skeleton)&&l.joints.every(b=>u.has(b)))continue;let d=l.skeleton,h=new Set;for(;!h.has(d)&&typeof s.get(d)=="number";)h.add(d),d=s.get(d);let m=o([d]);if(h.has(d)||s.get(d)===null||!m||!l.joints.every(b=>m.has(b))||Array.from(m).some(b=>u.has(b)||n[b].mesh!==void 0||n[b].camera!==void 0||n[b].extensions!==void 0)){e(`scene ${a} skin ${n[f].skin} cannot safely attach detached skeleton`);continue}for(let b of m)u.add(b);i.push(()=>{c.nodes||=[],c.nodes.push(d),t(`Attached detached skeleton root ${d} to scene ${a}.`)})}}for(let a of i)a();function o(a){let c=new Set,u=[...a];for(;u.length;){let f=u.pop();if(!Number.isSafeInteger(f)||!n[f]||c.has(f)||s.get(f)===null)return null;c.add(f),u.push(...n[f].children||[])}return c}}var BI=p(()=>{"use strict"});function FI(r,e){for(let[t,n]of(r.cameras||[]).entries()){let s=n.perspective,i=n.orthographic;(n.type==="perspective"?s&&Jc(s.yfov)&&Jc(s.znear)&&(s.aspectRatio===void 0||Jc(s.aspectRatio))&&(s.zfar===void 0||Jc(s.zfar)&&s.zfar>s.znear):n.type==="orthographic"&&i&&Number.isFinite(i.xmag)&&i.xmag!==0&&Number.isFinite(i.ymag)&&i.ymag!==0&&Number.isFinite(i.znear)&&i.znear>=0&&Jc(i.zfar)&&i.zfar>i.znear)||e(`camera ${t} invalid projection parameters`)}}function Jc(r){return Number.isFinite(r)&&r>0}var OI=p(()=>{"use strict"});function MI(r,e,t){let n=new Map,s=new Set;for(let[i,o]of(r.json.meshes||[]).entries())for(let[a,c]of o.primitives.entries()){let u=`mesh ${i} primitive ${a}`;for(let b of["TEXCOORD","COLOR","JOINTS","WEIGHTS"])Object.keys(c.attributes).filter(g=>g.startsWith(`${b}_`)).map(g=>Number(g.slice(b.length+1))).sort((g,x)=>g-x).some((g,x)=>g!==x)&&t(`${u} ${b} sets must be contiguous starting at zero`);for(let[b,w]of Object.entries(c.attributes)){let g=b.split("_")[0];if(!["NORMAL","TANGENT","COLOR","TEXCOORD","JOINTS","WEIGHTS"].includes(g))continue;let x=`${g}:${w}`;if(s.has(x))continue;s.add(x);let T=e(w,`${b} accessor ${w}`);T&&gN(T,g,`${b} accessor ${w}`,t)}let f=Object.values(c.attributes).map(b=>(Number.isSafeInteger(b)?r.json.accessors?.[b]:void 0)?.count);if(!f.length||f.some(b=>!Number.isSafeInteger(b)||b<1)){t(`${u} requires valid vertex attribute accessors`);continue}f.some(b=>b!==f[0])&&t(`${u} vertex attribute counts do not match`);let l=c.indices===void 0?f[0]:r.json.accessors?.[c.indices]?.count,d=c.mode===void 0?4:c.mode;if(!Number.isInteger(d)||d<0||d>6?t(`${u} requires a primitive mode in [0, 6]`):(!c.extensions||!Object.keys(c.extensions).length)&&(!Number.isSafeInteger(l)||l<1||d===1&&l%2!==0||[2,3].includes(d)&&l<2||d===4&&l%3!==0||[5,6].includes(d)&&l<3)&&t(`${u} draw count ${l} is incompatible with primitive mode ${d}`),c.indices===void 0)continue;let h=e(c.indices,`${u} indices`);if(!h)continue;if(h.accessor.type!=="SCALAR"||![5121,5123,5125].includes(h.accessor.componentType)||h.accessor.normalized){t(`${u} indices require unnormalized unsigned SCALAR data`);continue}let m=n.get(c.indices);if(m===void 0){m=0;for(let b=0;b<h.accessor.count;b++)m=Math.max(m,Pt(h,b,0));n.set(c.indices,m)}f.some(b=>m>=b)&&t(`${u} index ${m} is outside its vertex attribute counts`)}}function gN(r,e,t,n){let s=r.accessor,i=s.componentType===5126&&!s.normalized,o=[5121,5123].includes(s.componentType)&&s.normalized===!0,a=s.normalized===void 0||typeof s.normalized=="boolean",c=e==="NORMAL"?s.type==="VEC3"&&i:e==="TANGENT"?s.type==="VEC4"&&i:e==="JOINTS"?s.type==="VEC4"&&[5121,5123].includes(s.componentType)&&!s.normalized:e==="COLOR"?["VEC3","VEC4"].includes(s.type)&&(i||o):s.type===(e==="TEXCOORD"?"VEC2":"VEC4")&&(i||o);if(!a||!c){n(`${t} has incompatible core attribute shape, component type, or normalization`);return}for(let u=0;u<s.count;u++){let f=Array.from({length:r.rows},(l,d)=>Pt(r,u,d));if(f.some(l=>!Number.isFinite(l))||["NORMAL","TANGENT"].includes(e)&&Math.abs(Math.hypot(...f.slice(0,3))-1)>1e-5||e==="TANGENT"&&f[3]!==1&&f[3]!==-1||["COLOR","WEIGHTS"].includes(e)&&i&&f.some(l=>l<0||l>1)){n(`${t} requires finite core values, unit directions, tangent handedness \xB11, and colors/weights in [0, 1]`);return}}}var RI=p(()=>{"use strict";Xc()});function DI(r,e,t){let n=new Map,s=new Set,i=[],o=(l,d)=>{let h=n.get(l);return h===void 0&&(h=Hc(r,l),n.set(l,h)),typeof h=="string"?(s.has(l)||(s.add(l),e(`${d}: ${h}`)),null):h},a=new Set;for(let l of r.json.meshes||[])for(let d of l.primitives)d.attributes.POSITION!==void 0&&a.add(d.attributes.POSITION);for(let l of a){let d=o(l,`POSITION accessor ${l}`);if(d){if(!ql(d,"VEC3")){e(`POSITION accessor ${l} requires unnormalized FLOAT VEC3 data`);continue}u(d,l)}}f(),c(),yN(r,o,e),MI(r,o,e);for(let l of i)l();function c(){for(let[l,d]of(r.json.skins||[]).entries()){if(d.inverseBindMatrices===void 0)continue;let h=`skin ${l} inverse-bind matrices`,m=o(d.inverseBindMatrices,h);if(m){if(!ql(m,"MAT4")||m.accessor.count<(d.joints?.length||0)){e(`${h} require FLOAT MAT4 data with at least one matrix per joint`);continue}for(let b=0;b<m.accessor.count;b++){let w=Array.from({length:16},(g,x)=>Pt(m,b,x));if(w.some(g=>!Number.isFinite(g))||w[3]!==0||w[7]!==0||w[11]!==0||w[15]!==1){e(`${h} require finite affine matrices`);break}}}}}function u(l,d){let h=new Array(l.rows).fill(1/0),m=new Array(l.rows).fill(-1/0);for(let b=0;b<l.accessor.count;b++)for(let w=0;w<l.rows;w++){let g=Pt(l,b,w);if(!Number.isFinite(g))return e(`accessor ${d} non-finite values cannot supply required bounds`),!1;h[w]=Math.min(h[w],g),m[w]=Math.max(m[w],g)}return(JSON.stringify(l.accessor.min)!==JSON.stringify(h)||JSON.stringify(l.accessor.max)!==JSON.stringify(m))&&i.push(()=>{l.accessor.min=h,l.accessor.max=m,t(`Calculated required bounds for accessor ${d}.`)}),!0}function f(){let l=new Set,d=new Set;for(let[h,m]of(r.json.animations||[]).entries()){let b=new Set;(!m.samplers.length||!m.channels?.length)&&e(`animation ${h} requires samplers and channels`);for(let[w,g]of m.samplers.entries()){let x=`animation ${h} sampler ${w}`;if(["LINEAR","STEP"].includes(g.interpolation??"LINEAR")||e(`${x} unsupported interpolation ${g.interpolation}`),!l.has(g.input)){l.add(g.input);let T=o(g.input,`${x} input`);if(T)if(!ql(T,"SCALAR"))e(`${x} time input requires unnormalized FLOAT SCALAR data`);else{let _=-1/0,v=!0;for(let I=0;I<T.accessor.count;I++){let N=Pt(T,I,0);(!Number.isFinite(N)||N<0||N<=_)&&(v=!1),_=N}v?u(T,g.input):e(`${x} times must be finite, nonnegative, and strictly increasing`)}}}for(let[w,g]of(m.channels||[]).entries()){let x=`animation ${h} channel ${w}`,T=Number.isSafeInteger(g.sampler)?m.samplers[g.sampler]:void 0,_=g.target,v=Number.isSafeInteger(_?.node)?r.json.nodes?.[_.node]:void 0;if(!T||!v||!["translation","rotation","scale"].includes(_?.path)){e(`${x} invalid sampler, node, or TRS target`);continue}v.matrix!==void 0&&e(`${x} matrix node requires TRS decomposition`);let I=`${_.node}:${_.path}`;if(b.has(I)&&e(`${x} duplicate node/path target`),b.add(I),!["LINEAR","STEP"].includes(T.interpolation??"LINEAR"))continue;let N=r.json.accessors?.[T.input],q=o(T.output,`${x} output`);if(!q)continue;if(!ql(q,_.path==="rotation"?"VEC4":"VEC3")||q.accessor.count!==N?.count){e(`${x} output shape, type, or count does not match its target and keys`);continue}let re=`${T.output}:${_.path}`;if(!d.has(re)){d.add(re);for(let pe=0;pe<q.accessor.count;pe++){let Me=Array.from({length:q.rows},(Re,ce)=>Pt(q,pe,ce));if(Me.some(Re=>!Number.isFinite(Re))||_.path==="rotation"&&Math.abs(Math.hypot(...Me)-1)>1e-5){e(`${x} output requires finite values and unit rotation quaternions`);break}}}}}}}function ql(r,e){return r.accessor.componentType===5126&&!r.accessor.normalized&&r.accessor.type===e}function yN(r,e,t){let n=new Set;for(let s of r.json.nodes||[]){let i=r.json.skins?.[s.skin],o=r.json.meshes?.[s.mesh];if(!Array.isArray(i?.joints)||!i.joints.length||!o)continue;let a=`${s.mesh}:${s.skin}`;if(!n.has(a)){n.add(a);for(let[c,u]of o.primitives.entries()){let f=`mesh ${s.mesh} primitive ${c} skin ${s.skin}`,l=Object.keys(u.attributes).filter(b=>/^JOINTS_\d+$/.test(b)).map(b=>Number(b.slice(7))).sort((b,w)=>b-w),d=Object.keys(u.attributes).filter(b=>/^WEIGHTS_\d+$/.test(b)).map(b=>Number(b.slice(8))).sort((b,w)=>b-w);if(!l.length&&!d.length){t(`${f} requires JOINTS_0 and WEIGHTS_0 skin influences`);continue}if(JSON.stringify(l)!==JSON.stringify(d)||l.some((b,w)=>b!==w)){t(`${f} requires matching contiguous joint/weight sets starting at zero`);continue}let h=r.json.accessors?.[u.attributes.POSITION]?.count,m=l.map(b=>({joints:e(u.attributes[`JOINTS_${b}`],`${f} joint set ${b}`),weights:e(u.attributes[`WEIGHTS_${b}`],`${f} weight set ${b}`)}));if(!m.some(({joints:b,weights:w})=>!b||!w)){if(m.some(({joints:b,weights:w})=>b.accessor.type!=="VEC4"||w.accessor.type!=="VEC4"||![5121,5123].includes(b.accessor.componentType)||b.accessor.normalized||!(w.accessor.componentType===5126&&!w.accessor.normalized||[5121,5123].includes(w.accessor.componentType)&&w.accessor.normalized)||b.accessor.count!==w.accessor.count||h!==void 0&&b.accessor.count!==h||b.accessor.count!==m[0].joints.accessor.count)){t(`${f} incompatible influence accessor types or vertex counts`);continue}for(let b=0;b<m[0].joints.accessor.count;b++){let w=0,g=0,x=!0,T=new Set;for(let{joints:_,weights:v}of m){let I=v.accessor.normalized?v.accessor.componentType===5121?255:65535:1;for(let N=0;N<4;N++){let q=Pt(_,b,N),re=Pt(v,b,N)/I;(q>=i.joints.length||!Number.isFinite(re)||re<0||re>1)&&(x=!1),re>0&&(T.has(q)&&(x=!1),T.add(q),g++),w+=re}}if(!x||Math.abs(w-1)>2e-7*Math.max(g,1)){t(`${f} invalid palette index, repeated weighted joint, or weights not summing to one at vertex ${b}`);break}}}}}}}var NI=p(()=>{"use strict";Xc();RI()});function kI(r,e,t,n){let s=new Map,i=new Map,o=new Map;for(let[c,u]of(r.json.buffers||[]).entries()){let f=`buffer ${c}`,l=r.buffers[c],d=!!(l&&l.arrayBuffer instanceof ArrayBuffer&&Number.isSafeInteger(l.byteOffset)&&l.byteOffset>=0&&Number.isSafeInteger(l.byteLength)&&l.byteLength>=0&&Number.isSafeInteger(l.byteOffset+l.byteLength)&&l.byteOffset+l.byteLength<=l.arrayBuffer.byteLength);l&&!d&&t(`${f} invalid borrowed payload span`);let h=u.byteLength;if(h===void 0&&e.has(c)&&!u.extensions&&d&&l.byteLength>0&&(h=l.byteLength,i.set(c,h)),!Number.isSafeInteger(h)||h<1){t(`${f} requires a positive byteLength; missing lengths require unambiguous loaded URI data`);continue}s.set(c,h),d&&l.byteLength<h&&t(`${f} declared byteLength exceeds its loaded payload`)}let a=_g(r.json);for(let[c,u]of(r.json.bufferViews||[]).entries()){let f=u.byteOffset===void 0?0:u.byteOffset,l=s.get(u.buffer),d=u.byteLength===void 0&&!a&&l!==void 0?wN(r,c,s):u.byteLength;u.byteLength===void 0&&d!==void 0&&o.set(c,d),(!Number.isSafeInteger(u.buffer)||u.buffer<0||l===void 0||!Number.isSafeInteger(f)||f<0||!Number.isSafeInteger(d)||(d??0)<1||!Number.isSafeInteger(f+(d??0))||f+(d??0)>l)&&t(`bufferView ${c} requires a valid buffer reference and contained positive byte span`)}for(let[c,u]of o)r.json.bufferViews[c].byteLength=u,n(`Inferred bufferView ${c} byteLength from its dense accessor spans.`);for(let[c,u]of i)r.json.buffers[c].byteLength=u,n(`Inferred buffer ${c} byteLength from its loaded URI payload.`)}function wN(r,e,t){let n=r.json.bufferViews[e];if(n.byteOffset!==void 0&&(!Number.isSafeInteger(n.byteOffset)||n.byteOffset<0)||n.byteStride!==void 0&&(!Number.isSafeInteger(n.byteStride)||n.byteStride<0)||r.json.images?.some(a=>a.bufferView===e)||r.json.accessors?.some(a=>!!a.sparse))return;let s=t.get(n.buffer)-(n.byteOffset??0),i={...r,json:{...r.json,buffers:r.json.buffers.map((a,c)=>({...a,byteLength:t.get(c)})),bufferViews:r.json.bufferViews.map((a,c)=>c===e?{...a,byteLength:s}:a)}},o=0;for(let[a,c]of(r.json.accessors||[]).entries()){if(c.bufferView!==e)continue;let u=c;for(let d of[u.byteOffset,u.byteStride])if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))return;let f=Hc(i,a);if(typeof f=="string")return;let l=(c.byteOffset??0)+(c.count-1)*f.byteStride+f.rows*f.columns*f.componentSize;o=Math.max(o,l)}return o>0?o:void 0}var CI=p(()=>{"use strict";Xc()});function jI(r,e,t){let n=new Map;for(let i of r.animations||[])for(let o of i.channels||[]){let a=o.target?.node;if(!Number.isSafeInteger(a))continue;let c=n.get(a)||new Set;c.add(o.target.path),n.set(a,c)}let s=[];for(let[i,o]of n){let a=r.nodes?.[i];if(a?.matrix===void 0)continue;let c=`animated matrix node ${i}`;if(o.size!==1||!o.has("translation")){e(`${c} rotation or scale animation requires an unambiguous TRS basis`);continue}if(a.translation!==void 0||a.rotation!==void 0||a.scale!==void 0||a.extensions!==void 0){e(`${c} has conflicting TRS fields or opaque extensions`);continue}let u=xN(a.matrix);if(!u){e(`${c} requires a finite affine, nonsingular matrix without shear`);continue}s.push(()=>{Object.assign(a,u),delete a.matrix,t(`Decomposed translation-only animated matrix node ${i}, preserving its linear transform.`)})}for(let i of s)i()}function xN(r){if(!Array.isArray(r)||r.length!==16||Array.from(r).some(a=>!Number.isFinite(a))||r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)return null;let e=[0,1,2].map(a=>Math.hypot(...r.slice(a*4,a*4+3)));if(e.some(a=>!Number.isFinite(a)||a===0))return null;let t=e.map((a,c)=>r.slice(c*4,c*4+3).map(u=>u/a));for(let a=0;a<3;a++)for(let c=a+1;c<3;c++)if(Math.abs(t[a].reduce((u,f,l)=>u+f*t[c][l],0))>1e-6)return null;let n=t[0][0]*(t[1][1]*t[2][2]-t[1][2]*t[2][1])-t[1][0]*(t[0][1]*t[2][2]-t[0][2]*t[2][1])+t[2][0]*(t[0][1]*t[1][2]-t[0][2]*t[1][1]);if(Math.abs(Math.abs(n)-1)>1e-6)return null;n<0&&(e[0]=-e[0],t[0]=t[0].map(a=>-a));let s=Array.from(new Lc().fromMatrix3(t.flat()).normalize()),i=r.slice(12,15),o=new Ws().translate(i).multiplyRight(new Ws().fromQuaternion(s)).scale(e);return Array.from(o).some((a,c)=>!Number.isFinite(a)||Math.abs(a-r[c])>1e-6*Math.max(1,Math.abs(r[c])))?null:{translation:i,rotation:s,scale:e}}var VI=p(()=>{"use strict";ol()});function zI(r,e,t){let n=new Set,s=r.extensionsRequired?.includes(jr)||!1;for(let[o,a]of(r.materials||[]).entries()){let c=a,u=a.extensions?.[jr];if(u===void 0){TN(c,r,e,t);continue}qI(c,u);let f=`material ${o}`;if(!cr(u)||typeof u.technique!="string"||!["CONSTANT","LAMBERT","PHONG","BLINN"].includes(u.technique)){e(`${f} unknown ${jr} technique`);continue}if(u.values!==void 0&&!cr(u.values)){e(`${f} common material values must be an object`);continue}let l=u.values||{},d=Object.keys(u).filter(I=>!["technique","values","doubleSided","transparent","jointCount"].includes(I)),h=Object.keys(l).filter(I=>!["ambient","diffuse","emission","specular","shininess","transparency","doubleSided","transparent"].includes(I));(d.length||h.length)&&e(`${f} unrecognized common material fields ${[...d,...h].join(", ")}`),u.jointCount!==void 0&&(!Number.isSafeInteger(u.jointCount)||Number(u.jointCount)<0)&&e(`${f} invalid common material jointCount`);let m=UI(l.emission,r,`${f} emission`,e),b=u.technique==="CONSTANT",w=b?m:UI(l.diffuse,r,`${f} diffuse`,e),g=l.transparency===void 0?1:l.transparency,x=typeof g=="number"&&Number.isFinite(g)&&g>=0&&g<=1;x||e(`${f} common material transparency must be in [0, 1]`);let T=GI(u,l,"transparent",f,e),_=GI(u,l,"doubleSided",f,e);l.ambient!==void 0&&!PI(l.ambient)&&e(`${f} ambient lighting`),["PHONG","BLINN"].includes(String(u.technique))&&(l.specular!==void 0&&!PI(l.specular)&&e(`${f} specular/shininess lighting`),l.shininess!==void 0&&(typeof l.shininess!="number"||!Number.isFinite(l.shininess)||l.shininess<0)&&e(`${f} invalid common material shininess`)),a.pbrMetallicRoughness||={};let v=a.pbrMetallicRoughness;if(v.metallicFactor??=0,v.roughnessFactor??=1,w){let I=[...w.factor];I[3]*=x?g:1,v.baseColorFactor??=I,w.texture&&(v.baseColorTexture??=w.texture)}a.doubleSided??=_,a.alphaMode??=T?"BLEND":"OPAQUE",b?(a.extensions[Ig]??={},_N(r,Ig,s),t(`Converted ${f} CONSTANT emission to an unlit material.`)):(m&&(a.emissiveFactor??=m.factor.slice(0,3),m.texture&&(a.emissiveTexture??=m.texture)),t(`Approximated ${f} ${String(u.technique)} lighting with rough non-metallic PBR factors.`)),typeof c.technique=="string"?n.add(c.technique):c.technique!==void 0&&e(`${f} invalid fallback technique ID`),delete c.technique,delete c.values,delete a.extensions[jr],Object.keys(a.extensions).length||delete a.extensions}let i=KI(r);return(r.extensions?.[jr]!==void 0||(r.nodes||[]).some(o=>o.extensions?.[jr]!==void 0))&&e(`${jr} lights or scene payloads`),i.has(jr)||(r.extensionsUsed=r.extensionsUsed?.filter(o=>o!==jr),r.extensionsRequired=r.extensionsRequired?.filter(o=>o!==jr)),n}function WI(r,e){if(!e.size||[...KI(r)].some(c=>![jr,Ig].includes(c))||(r.materials||[]).some(c=>c.technique!==void 0||c.values!==void 0))return!1;let t=r;if(["techniques","programs","shaders"].some(c=>t[c]!==void 0&&!cr(t[c])))return!1;let n=cr(t.techniques)?t.techniques:{},s=cr(t.programs)?t.programs:{},i=cr(t.shaders)?t.shaders:{},o=new Set,a=new Set;if(Object.keys(n).some(c=>!e.has(c)))return!1;for(let c of Object.values(n))cr(c)&&typeof c.program=="string"&&o.add(c.program);if(Object.keys(s).some(c=>!o.has(c)))return!1;for(let c of Object.values(s))if(cr(c))for(let u of["vertexShader","fragmentShader"])typeof c[u]=="string"&&a.add(c[u]);return Object.keys(i).every(c=>a.has(c))}function TN(r,e,t,n){qI(r);let s=cr(r.values)?r.values:{},i=s.tex||s.texture2d_0||s.diffuseTex||s.diffuse,o=$I(e,i),a=Lg(s.diffuse)?s.diffuse:void 0;if(o!==-1||a){let c=a?[...a]:[1,1,1,1],u=s.transparency;typeof u=="number"&&u>=0&&u<=1&&(c[3]*=u),r.pbrMetallicRoughness||={},r.pbrMetallicRoughness.metallicFactor??=0,r.pbrMetallicRoughness.roughnessFactor??=1,r.pbrMetallicRoughness.baseColorFactor??=c,o!==-1&&(r.pbrMetallicRoughness.baseColorTexture??={index:o}),r.pbrMetallicRoughness.baseColorFactor[3]<1&&(r.alphaMode||="BLEND"),n("Approximated glTF v1 diffuse material values with PBR material factors.")}(r.technique||r.values)&&t(`material technique ${r.technique||"<unnamed>"}`)}function UI(r,e,t,n){if(r===void 0)return{factor:[0,0,0,1]};if(Lg(r))return{factor:[...r]};let s=$I(e,r);return s!==-1?{factor:[1,1,1,1],texture:{index:s}}:(n(`${t} requires an RGBA factor in [0, 1] or a resolved texture ID`),null)}function $I(r,e){return typeof e!="string"?-1:(r.textures||[]).findIndex(t=>t.id===e)}function GI(r,e,t,n,s){r[t]!==void 0&&e[t]!==void 0&&r[t]!==e[t]&&s(`${n} conflicting common material ${t}`);let i=e[t]!==void 0?e[t]:r[t]!==void 0?r[t]:!1;return typeof i=="boolean"?i:(s(`${n} common material ${t} must be boolean`),!1)}function qI(r,e){let t=cr(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},n=cr(t.gltf1)?t.gltf1:t.gltf1===void 0?{}:{originalExtras:t.gltf1},s={technique:r.technique,values:r.values,...e===void 0?{}:{commonMaterial:e}},i=Object.keys(s).some(o=>Object.hasOwn(n,o));r.extras={...t,gltf1:{...n,...s,...i?{originalExtras:n}:{}}}}function _N(r,e,t){r.extensionsUsed=[...new Set([...r.extensionsUsed||[],e])],t&&(r.extensionsRequired=[...new Set([...r.extensionsRequired||[],e])])}function KI(r){let e=new Set,t=[r],n=new Set;for(;t.length;){let s=t.pop();if(!(!s||typeof s!="object"||n.has(s))){if(n.add(s),cr(s)&&cr(s.extensions))for(let i of Object.keys(s.extensions))e.add(i);for(let[i,o]of Object.entries(s))i!=="extras"&&t.push(o)}}return e}function Lg(r){return Array.isArray(r)&&r.length===4&&r.every(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1)}function PI(r){return Lg(r)&&r.slice(0,3).every(e=>e===0)}function cr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}var jr,Ig,HI=p(()=>{"use strict";jr="KHR_materials_common",Ig="KHR_materials_unlit"});function XI(r,e={}){let t=new Eg;return t.normalize(r,e,!0),()=>t.finishNormalization(r)}var Sg,AN,Eg,JI=p(()=>{"use strict";lI();pI();bI();wI();Xc();II();SI();BI();OI();NI();CI();VI();HI();Sg={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",cameras:"camera",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},AN={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",camera:"cameras",inverseBindMatrices:"accessors",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Eg=class r{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;report={converted:!1,mutated:!1,unsupported:[],warnings:[]};strict=!1;log;finished=!1;pendingAccessors=new Set;accessorConversions=new Map;uriBufferIndices=new Set;normalize(e,t={},n=!1){if(t.mutate===!1){let o={...e,json:JSON.parse(JSON.stringify(e.json))},a=new r().normalize(o,{...t,mutate:!0});return a.mutated=!1,a}this.strict=t.normalize==="strict",this.log=t.log,this.json=e.json;let s=e.json;switch(s.asset&&s.asset.version){case"2.0":case"2.1":return this.report;case void 0:case"1.0":break;default:return this._warning(`Unknown glTF version ${s.asset.version}`),this.report}if(!t.normalize)throw new Error("glTF v1 is not supported.");this.report.converted=!0,this.report.mutated=!0,this.log?.log(1,"glTF: Converting glTF v1 to glTF v2 using experimental normalization.")(),this._addAsset(s),this._orderBinaryBufferPayloads(e),this._convertTopLevelObjectsToArrays(s),fI(e),this._convertObjectIdsToArrayIndices(s),this._updateObjects(s);for(let[o,a]of(s.buffers||[]).entries())typeof a.uri=="string"&&this.uriBufferIndices.add(o);let i=zI(s,o=>this._unsupported(o),o=>this._warning(o));return LI(s,(o,a)=>this._convertIdToIndex(o,a),o=>this._unsupported(o)),FI(s,o=>this._unsupported(o)),jI(s,o=>this._unsupported(o),o=>this._warning(o)),vI(s,o=>this._unsupported(o)),this.accessorConversions=TI(s),hI(s,o=>this.pendingAccessors.add(o)),mI(s,o=>this._convertIdToIndex(o,"node"),o=>this._unsupported(o)),this._updateNodes(s),EI(s,o=>this._unsupported(o),o=>this._warning(o)),this._preserveLegacyResources(s,i),this._removeEmptyCollections(s),n?this.report:this.finishNormalization(e)}finishNormalization(e){return this.report.converted&&!this.finished&&(kI(e,this.uriBufferIndices,t=>this._unsupported(t),t=>this._warning(t)),_I(e,this.accessorConversions,this.pendingAccessors,t=>this._unsupported(t),t=>this._warning(t)),gI(e,t=>this._unsupported(t)),DI(e,t=>this._unsupported(t),t=>this._warning(t)),this._finishReport(),this.log?.log(1,`glTF: Completed glTF v1 normalization (${this.report.unsupported.length} unsupported features).`)(),this.finished=!0),this.report}_unsupported(e){if(this.report.unsupported.push(e),this.log?.warn(`glTF v1 normalization does not support ${e}`)(),this.strict)throw new Error(`glTF v1 normalization does not support ${e}`)}_warning(e){this.report.warnings.push(e),this.log?.warn(`glTF: ${e}`)()}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_orderBinaryBufferPayloads(e){let t=this.json.buffers;if(!t||Array.isArray(t)||!t.binary_glTF)return;let s=Object.keys(t).indexOf("binary_glTF");s>0&&e.buffers?.length&&(e.buffers=[e.buffers[s],...e.buffers.filter((i,o)=>o!==s)])}_convertTopLevelObjectsToArrays(e){for(let t in Sg)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){let n=e[t];if(!n||Array.isArray(n))return;e[t]=[];let s=Object.keys(n),i=t==="buffers"&&s.includes("binary_glTF")?["binary_glTF",...s.filter(o=>o!=="binary_glTF")]:s;for(let o of i){let a=n[o];a.id=a.id||o;let c=e[t].length;e[t].push(a),this.idToIndexMap[t][o]=c}}_convertObjectIdsToArrayIndices(e){for(let t in Sg)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let t of e.textures)this._convertTextureIds(t);for(let t of e.meshes)this._convertMeshIds(t);for(let t of e.nodes)this._convertNodeIds(t);for(let t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let t of e.primitives){let{attributes:n,indices:s,material:i}=t,o=new Map;for(let a in n){let c=vg(a),u=o.get(c);if(u!==void 0&&n[u]!==n[a])throw new Error(`glTF v1: conflicting attribute aliases ${u} and ${a}`);o.set(c,a)}t.attributes=Object.fromEntries(Object.entries(n).map(([a,c])=>[vg(a),this._convertIdToIndex(c,"accessor")])),s&&(t.indices=this._convertIdToIndex(s,"accessor")),i&&(t.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(e[t]=[]);for(let n of e[t])for(let s in n){let i=n[s],o=this._convertIdToIndex(i,s);n[s]=o}}_convertIdToIndex(e,t){let n=AN[t];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][e];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return s}return e}_updateObjects(e){for(let t of this.json.buffers)delete t.type}_updateNodes(e){let t=e.nodes||[];for(let n=0;n<t.length;n++){let s=t[n];if(!Array.isArray(s.meshes))continue;let i=s.meshes;delete s.meshes,s.mesh=i.shift();for(let o of i){let a={...s,mesh:o,children:void 0};delete a.id,delete a.matrix,delete a.translation,delete a.rotation,delete a.scale,t.push(a),s.children||=[],s.children.push(t.length-1)}}}_preserveLegacyResources(e,t){let n=WI(e,t),s={};for(let i of["techniques","programs","shaders"])e[i]&&(s[i]=e[i],delete e[i],n||this._unsupported(`legacy ${i}`));Object.keys(s).length&&(e.extras={...e.extras,gltf1Resources:s},n&&this._warning("Preserved shader resources overridden by converted common materials."))}_removeEmptyCollections(e){for(let t of e.nodes||[])Array.isArray(t.children)&&t.children.length===0&&delete t.children;for(let t of e.scenes||[])Array.isArray(t.nodes)&&t.nodes.length===0&&delete t.nodes;for(let t of[...Object.keys(Sg),"extensionsUsed","extensionsRequired"])Array.isArray(e[t])&&e[t].length===0&&delete e[t]}_finishReport(){this.report.unsupported.length&&this.report.warnings.push(`Converted glTF v1 with unsupported features: ${this.report.unsupported.join(", ")}`)}}});function vN(r,e){let t=r.basis;return{...r,core:{...r.core,mimeType:e},basis:{...t,format:t?.format||"auto"}}}async function YI(r,e,t=0,n,s){return await QI(r,e,t,n,s)}async function QI(r,e,t,n,s,i){IN(r,e,t,n);let o=XI(r,{normalize:n?.gltf?.normalize,log:n?.core?.log});return await oI(r,n,s),n?.gltf?.loadBuffers&&r.json.buffers&&await DN(r,n,s,n.gltf.loadBufferIndices),o(),n?.gltf?.loadFiles&&r.json.files&&await RN(r,n,s),n?.gltf?.loadExternalAssets&&r.json.externalAssets&&await SN(r,n,s,i),n?.gltf?.loadImages&&await NN(r,n,s),await aI(r,n,s),r}function IN(r,e,t,n){if(n.core?.baseUrl&&(r.baseUri=n.core?.baseUrl),e instanceof ArrayBuffer&&!z1(e,t,n.glb)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=Zp(e);else if(e instanceof ArrayBuffer){let f={};t=Il(f,e,t,n.glb),H(f.type==="glTF",`Invalid GLB magic string ${f.type}`),r._glb=f,r.json=f.json}else e&&typeof e=="object"?r.json=e:H(!1,"GLTF: must be ArrayBuffer, string, or parsed JSON object");let s=r.json.buffers||[],i=Array.isArray(s)?s:[],o=Array.isArray(s)?[]:Object.keys(s);if(r.buffers=new Array(Array.isArray(s)?s.length:o.length).fill(null),r._glb){let{binChunks:f}=r._glb;for(let w=0;w<i.length;w++){let g=i[w];if(g.chunk===void 0)continue;H(r._glb.version===3,"glTF buffer.chunk requires a GLB v3 container."),H(g.uri===void 0,`glTF buffer ${w} cannot define both uri and chunk.`);let x=f.find(T=>T.chunkIndex===g.chunk);H(x,`glTF buffer ${w} references missing GLB BIN chunk ${g.chunk}.`),H(g.byteLength<=x.byteLength,`glTF buffer ${w} is larger than GLB BIN chunk ${g.chunk}.`),r.buffers[w]={arrayBuffer:x.arrayBuffer,byteOffset:x.byteOffset,byteLength:g.byteLength}}let l=i.map((w,g)=>w.uri===void 0?g:-1).filter(w=>w!==-1),d=f.find(w=>w.chunkIndex===1),h=r._glb.version<3||r._glb.jsonChunkIndex===0&&i[0]?.chunk===void 0&&l.length===1&&l[0]===0&&!!d,m=r._glb.version<3?f[0]:d,b=r._glb.version===1&&!Array.isArray(s)?o.indexOf("binary_glTF"):0;if(h&&m&&b>=0&&(r.buffers[b]={arrayBuffer:m.arrayBuffer,byteOffset:m.byteOffset,byteLength:m.byteLength}),r._glb.version===3)for(let w of l)H(r.buffers[w],`glTF buffer ${w} without a uri must define a valid GLB v3 chunk.`)}if(!r._glb){let f=i.findIndex(l=>l.chunk!==void 0);H(f===-1,`glTF buffer ${f} uses chunk outside a GLB.`)}let a=r.json.images||[];r.images=new Array(a.length).fill({});let c=r.json.files||[];r.files=new Array(c.length).fill(null);let u=r.json.externalAssets||[];r.externalAssets=new Array(u.length).fill(null)}async function SN(r,e,t,n){let s=r.json.externalAssets||[],i=new Set;for(let a of r.json.nodes||[])a.externalAsset!==void 0&&(H(a.externalAsset>=0&&a.externalAsset<s.length,`glTF node references missing external asset ${a.externalAsset}.`),i.add(a.externalAsset));let o=n||BN(t.url?new Set([Ll(t.url)]):new Set);for(let a of i)await EN(r,a,e,t,o)}async function EN(r,e,t,n,s){let i=r.json.externalAssets?.[e];if(!i)throw new Error(`Missing glTF external asset ${e}.`);H(Number.isInteger(i.file)&&i.file>=0&&i.file<(r.json.files?.length||0),`glTF external asset ${e} references missing file ${i.file}.`);let o=await Bl(r,i.file,t,n),a=o.url;H(!a||!s.ancestors.has(a),`glTF external asset cycle detected at ${a}.`);let c=a?s.cache.get(a):void 0;if(!c){let u=FN(r,o,t,n,s),f={...s,ancestors:new Set(s.ancestors)};a&&f.ancestors.add(a);let l=$i(o.arrayBuffer,o.byteOffset,o.byteLength);c=QI({},l,0,t,u,f),a&&s.cache.set(a,c)}r.externalAssets=r.externalAssets||[],r.externalAssets[e]=await c}function BN(r){return{cache:new Map,ancestors:r,packageIds:{next:0}}}function FN(r,e,t,n,s){if(e.url&&!e.url.startsWith("data:"))return{...n,url:e.url,filename:MN(e.url),baseUrl:ON(e.url)};let i=`${LN}${s.packageIds.next++}`,o=`${i}/`;return{...n,url:e.name,filename:e.name,baseUrl:i,fetch:async(a,c)=>{let u=a;if(u.startsWith("data:"))return await n.fetch(a,c);let f=u.startsWith(o)?u.slice(o.length):u,l=hb(r,f);H(l>=0,`glTF package does not contain file ${f}.`);let d=await Bl(r,l,t,n),h=$i(d.arrayBuffer,d.byteOffset,d.byteLength);return new Response(h,{headers:{"content-type":d.mimeType}})}}}function ON(r){let e=r.lastIndexOf("/");return e>=0?r.slice(0,e):""}function MN(r){let e=r.lastIndexOf("/");return e>=0?r.slice(e+1):r}async function RN(r,e,t){let n=r.json.files||[];await Promise.all(n.map((s,i)=>Bl(r,i,e,t)))}async function DN(r,e,t,n){let s=r.json.buffers||[],i=n?new Set(typeof n=="function"?n(r.json):n):void 0;for(let o=0;o<s.length;++o){if(i&&!i.has(o))continue;let a=s[o];if(a.uri){let{fetch:c}=t;H(c);let u=Un(a.uri,e,t),l=await(await t?.fetch?.(u))?.arrayBuffer?.();r.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete a.uri}else r.buffers[o]===null&&(r.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function NN(r,e,t){let n=kN(r),s=r.json.images||[],i=[];for(let o of n)i.push(CN(r,s[o],o,e,t));return await Promise.all(i)}function kN(r){let e=new Set;r.json.asset.thumbnail!==void 0&&e.add(r.json.asset.thumbnail);let t=r.json.textures||[];for(let n of t)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function CN(r,e,t,n,s){let i;if(e.uri&&!e.hasOwnProperty("bufferView")){let c=Un(e.uri,n,s),{fetch:u}=s;i=await(await u(c)).arrayBuffer(),e.bufferView={data:i}}if(Number.isFinite(e.bufferView)){let c=ar(r.json,r.buffers,e.bufferView);i=$i(c.buffer,c.byteOffset,c.byteLength)}H(i,"glTF image has no data");let o=vN(n,e.mimeType),a=await gc(i,[Mc,Xi],o,s);a&&a[0]&&(a={compressed:!0,mipmaps:!1,width:a[0].width,height:a[0].height,data:a[0]}),r.images=r.images||[],r.images[t]=a}var LN,ZI=p(()=>{"use strict";je();Vn();Vn();Ji();fb();Dc();H1();Yi();uI();JI();LN="gltf-package://"});async function eL(r,e={},t){let n={...Bg.options,...e};n.gltf={...Bg.options.gltf,...n.gltf};let s=e?.glb?.byteOffset||0;return await YI({},r,s,n,t)}var FQ,jN,Bg,tL=p(()=>{"use strict";ZI();nL();({preload:FQ,...jN}=rL),Bg={...jN,parse:eL}});var Fg={};Q(Fg,{GLTFLoaderWithParser:()=>Bg,parse:()=>eL});var Og=p(()=>{"use strict";tL()});async function VN(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Og(),Fg));return r}var rL,nL=p(()=>{"use strict";Km();Hm();rL={dataType:null,batchType:null,...PA,version:ml,preload:VN,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}}});async function PN(r,e){return sL(r,e)}function sL(r,e){let t={};return Il(t,r,e?.glb?.byteOffset||0,e?.glb),t}var jQ,UN,GN,iL=p(()=>{"use strict";fb();aL();({preload:jQ,...UN}=oL),GN={...UN,parse:PN,parseSync:sL}});var Mg={};Q(Mg,{GLBLoaderWithParser:()=>GN});var Rg=p(()=>{"use strict";iL()});async function zN(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Rg(),Mg));return r}var oL,aL=p(()=>{"use strict";Km();Hm();oL={dataType:null,batchType:null,...zA,version:ml,preload:zN,options:{glb:{strict:!1}}}});function xL(r){let e=r.size(),t=new ArrayBuffer(e),n=new Int8Array(t);for(let s=0;s<e;++s)n[s]=r.GetValue(s);return t}function fk(r){return r instanceof Map?r.entries():Object.entries(r)}function Zc(r){return ArrayBuffer.isView(r)?r:r&&typeof r=="object"&&"value"in r&&ArrayBuffer.isView(r.value)?r.value:null}function Yl(r,e){return ArrayBuffer.isView(r)?e:r.size}function lk(r,e){for(let t of r)if(!Number.isInteger(t)||t<0||t>=e)throw new Error(`DracoWriter: triangle index ${t} is outside vertex range 0-${e-1}`)}function TL(r){return!!(r.attributeQuantization&&Object.keys(r.attributeQuantization).length)}function Ql(r,e,t){if(!Number.isInteger(e)||e<1||e>30)throw new Error(`DracoWriter: quantization bits for "${r}" must be an integer from 1 to 30`);if(t==="NORMAL"&&(e<2||e>29))throw new Error(`DracoWriter: quantization bits for NORMAL attribute "${r}" must be an integer from 2 to 29`)}function dk(r,e,t){if(Ql(r,t.bits),!Array.isArray(t.origin)||t.origin.length!==e)throw new Error(`DracoWriter: quantization origin for "${r}" must contain ${e} values`);if(!t.origin.every(Number.isFinite))throw new Error(`DracoWriter: quantization origin for "${r}" must be finite`);if(!Number.isFinite(t.range)||t.range<=0)throw new Error(`DracoWriter: quantization range for "${r}" must be positive`)}function _L(r,e){for(let t of["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"])if(r[t]===e)return t;return"GENERIC"}function hk(r){let e={gltf:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},webgpu:{method:"MESH_SEQUENTIAL_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},balanced:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:12,NORMAL:10,TEX_COORD:10}}},t=r.preset?e[r.preset]:{};return{...t,...r,quantization:{...t.quantization,...r.quantization}}}var uk,wL,ya,AL=p(()=>{"use strict";uk={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},wL=()=>{},ya=class{draco;dracoEncoder;dracoMeshBuilder;dracoMetadataBuilder;log=wL;constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder)}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,t={}){return this._encodeSync(e,t,!1).data}encodeSyncWithReport(e,t={}){return this._encodeSync(e,t,!0)}_encodeSync(e,t,n){return t=hk(t),this.log=t.log||wL,t.pointcloud?this._encodePointCloud(e,t,n):this._encodeMesh(e,t,n)}_getAttributesFromMesh(e){return{...e.indices?{indices:e.indices}:{},...e.attributes}}_encodePointCloud(e,t,n){let s=new this.draco.PointCloud,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoPointCloud(s,a,t),u=TL(t),f,l;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),l=o,n&&l.SetTrackEncodedProperties(!0),f=o.EncodeToDracoBuffer(t.deduplicateValues??!1,i)):(this._setOptions(t),l=this.dracoEncoder,n&&l.SetTrackEncodedProperties(!0),f=this.dracoEncoder.EncodePointCloudToDracoBuffer(s,t.deduplicateValues??!1,i)),!(f>0))throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
44
|
+
with ${s.num_attributes()} attributes into ${f} bytes`);let d=xL(i);return{data:d,report:this._getEncodingReport("point-cloud",d.byteLength,s,l,c,t,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_encodeMesh(e,t,n){let s=new this.draco.Mesh,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoMesh(s,a,t),u=TL(t),f,l;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),l=o,n&&l.SetTrackEncodedProperties(!0),f=o.EncodeToDracoBuffer(!1,i)):(this._setOptions(t),l=this.dracoEncoder,n&&l.SetTrackEncodedProperties(!0),f=this.dracoEncoder.EncodeMeshToDracoBuffer(s,i)),f<=0)throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
45
|
+
with ${s.num_attributes()} attributes into ${f} bytes`);let d=xL(i);return{data:d,report:this._getEncodingReport("mesh",d.byteLength,s,l,c,t,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_setOptions(e){if(e.speed&&this.dracoEncoder.SetSpeedOptions(...e.speed),e.method){let t=this.draco[e.method];this.dracoEncoder.SetEncodingMethod(t)}if(e.quantization)for(let t in e.quantization){let n=t,s=e.quantization[n];s!==void 0&&(Ql(n,s,n),this.dracoEncoder.SetAttributeQuantization(this.draco[n],s))}}_setExpertOptions(e,t,n){n.speed&&e.SetSpeedOptions(...n.speed),n.method&&e.SetEncodingMethod(this.draco[n.method]);let s=this._getAttributeQuantization(t,n);for(let[i,o]of s){let a=t[i];typeof o=="number"?e.SetAttributeQuantization(a.attributeId,o):e.SetAttributeExplicitQuantization(a.attributeId,o.bits,a.componentCount,o.origin,o.range)}}_getAttributeQuantization(e,t){let n=new Map;for(let i of Object.keys(t.quantization||{})){let o=t.quantization?.[i];o!==void 0&&(Ql(i,o,i),n.set(this.draco[i],o))}let s=new Map;for(let[i,o]of Object.entries(e)){let a=n.get(o.attributeType);a!==void 0&&s.set(i,a)}for(let[i,o]of Object.entries(t.attributeQuantization||{})){let a=e[i];if(!a)throw new Error(`DracoWriter: quantized attribute "${i}" does not exist`);if(typeof o=="number")Ql(i,o,a.attributeTypeName);else{if(a.attributeTypeName==="NORMAL")throw new Error(`DracoWriter: explicit quantization transforms are not supported for NORMAL attribute "${i}"`);dk(i,e[i].componentCount,o)}s.set(i,o)}for(let i of s.keys())if(!e[i].supportsQuantization)throw new Error(`DracoWriter: quantization for "${i}" requires floating-point attribute data`);return s}_getEncodingReport(e,t,n,s,i,o,a){let c=this._getAttributeQuantization(i,o),u={};for(let[f,l]of Object.entries(i))u[f]={id:l.attributeId,type:l.attributeTypeName,componentCount:l.componentCount,...c.has(f)?{quantization:c.get(f)}:{}};return{geometryType:e,byteLength:t,pointCount:a?s.GetNumberOfEncodedPoints():n.num_points(),faceCount:a?s.GetNumberOfEncodedFaces():e==="mesh"&&typeof n.num_faces=="function"?n.num_faces():0,attributeCount:n.num_attributes(),...o.method?{method:o.method}:{},...o.speed?{speed:o.speed}:{},attributes:u}}_createDracoMesh(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let f=Zc(c),l=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:l,attributeTypeName:_L(this.draco,l),componentCount:Yl(c,f.length/o),supportsQuantization:f instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_createDracoPointCloud(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let f=Zc(c),l=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:l,attributeTypeName:_L(this.draco,l),componentCount:Yl(c,f.length/o),supportsQuantization:f instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_addAttributeToMesh(e,t,n,s,i={}){let o=Zc(n);if(!o)throw new Error(`DracoWriter: attribute "${t}" must contain a typed array`);let a=this._getDracoAttributeType(t,i.attributeTypes),c=Yl(n,o.length/s);if(a==="indices"){if(o.length%3!==0)throw new Error("DracoWriter: triangle indices length must be divisible by 3");lk(o,s);let l=o.length/3;this.log(`Adding attribute ${t}, size ${l}`);let d=o instanceof Uint16Array||o instanceof Uint32Array?o:Uint32Array.from(o);return this.dracoMeshBuilder.AddFacesToMesh(e,l,d),-1}if(!Number.isInteger(c)||c<=0||o.length!==s*c)throw new Error(`DracoWriter: attribute "${t}" has ${o.length} values, expected ${s*c}`);this.log(`Adding attribute ${t}, size ${c}`);let u=this.dracoMeshBuilder,f=-1;if(o instanceof Int8Array)f=u.AddInt8Attribute(e,a,s,c,o);else if(o instanceof Int16Array)f=u.AddInt16Attribute(e,a,s,c,o);else if(o instanceof Int32Array)f=u.AddInt32Attribute(e,a,s,c,o);else if(o instanceof Uint8Array)f=u.AddUInt8Attribute(e,a,s,c,o);else if(o instanceof Uint8ClampedArray){let l=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);f=u.AddUInt8Attribute(e,a,s,c,l)}else if(o instanceof Uint16Array)f=u.AddUInt16Attribute(e,a,s,c,o);else if(o instanceof Uint32Array)f=u.AddUInt32Attribute(e,a,s,c,o);else if(o instanceof Float32Array)f=u.AddFloatAttribute(e,a,s,c,o);else throw new Error(`DracoWriter: attribute "${t}" uses unsupported ${o.constructor.name}`);return!ArrayBuffer.isView(n)&&n.normalized!==void 0&&u.SetNormalizedFlagForAttribute(e,f,n.normalized),f}_getDracoAttributeType(e,t={}){if(e.toLowerCase()==="indices")return"indices";let n=t[e];if(n)return this.draco[n];let s=uk[e];if(s)return this.draco[s];switch(e.toLowerCase()){case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return/^color_\d+$/i.test(e)?this.draco.COLOR:/^texcoord_\d+$/i.test(e)?this.draco.TEX_COORD:this.draco.GENERIC}}_getVertexCount(e,t){let n=this._getPositionAttribute(e,t.attributeTypes),s=n&&Zc(n);if(!n||!s)throw new Error("DracoWriter: POSITION attribute is required");let i=Yl(n,3);if(!Number.isInteger(i)||i<=0||s.length%i!==0)throw new Error("DracoWriter: POSITION attribute has an invalid size or value count");return s.length/i}_getPositionAttribute(e,t={}){for(let n in e){let s=e[n];if(this._getDracoAttributeType(n,t)===this.draco.POSITION&&Zc(s))return s}return null}_addGeometryMetadata(e,t){let n=new this.draco.Metadata;this._populateDracoMetadata(n,t),this.dracoMeshBuilder.AddMetadata(e,n)}_addAttributeMetadata(e,t,n){let s=new this.draco.Metadata;this._populateDracoMetadata(s,n),this.dracoMeshBuilder.SetMetadataForAttribute(e,t,s)}_populateDracoMetadata(e,t){for(let[n,s]of fk(t))switch(typeof s){case"number":Math.trunc(s)===s?this.dracoMetadataBuilder.AddIntEntry(e,n,s):this.dracoMetadataBuilder.AddDoubleEntry(e,n,s);break;case"object":s instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,n,s,s.length);break;default:this.dracoMetadataBuilder.AddStringEntry(e,n,s)}}}});async function bk(r,e={}){return(await vL(r,e)).data}async function vL(r,e={}){let{draco:t}=await sg(on(e)),n=new ya(t);try{return n.encodeSyncWithReport(SL(r),e.draco)}finally{n.destroy()}}async function gk(r,e={}){LL(e.signal);let t=[],n=0;for await(let s of zg([r],e))t.push(s),n++,e.onProgress?.({completed:n,total:r.length});return t}function zg(r,e={}){let t=wk(r);if(Qp(Pg,e)){let{onProgress:n,...s}=e;return Tc(Pg,t,s)}return IL(t,e)}async function*yk(r,e={}){let t=(async function*(){for await(let n of r)yield[n]})();for await(let n of zg(t,e))yield n.data}async function*IL(r,e={}){let{draco:t}=await sg(on(e)),n=new ya(t);try{for await(let s of r)for(let i of s)LL(e.signal),yield n.encodeSyncWithReport(i,e.draco)}finally{n.destroy()}}async function*wk(r){for await(let e of r)yield e.map(SL)}function LL(r){if(!r?.aborted)return;if(r.reason!==void 0)throw r.reason;let e=new Error("Draco batch encoding aborted");throw e.name="AbortError",e}function SL(r){if(xk(r))return cn(r);if(Tk(r))return r;let{indices:e,...t}=r;return{attributes:t,...e?{indices:e}:{}}}function xk(r){return typeof r=="object"&&r!==null&&"shape"in r&&r.shape==="arrow-table"}function Tk(r){return typeof r=="object"&&r!==null&&"attributes"in r&&typeof r.attributes=="object"&&r.attributes!==null&&!ArrayBuffer.isView(r.attributes)}var pk,Pg,mk,EL=p(()=>{"use strict";je();Cn();Ps();AL();Wc();Zb();eg();pk={pointcloud:!1,attributeNameEntry:"name"},Pg={...Pc,id:"draco-writer",name:"Draco compressed geometry writer",module:"scene",version:Gc,worker:!0,workerNode:"draco-writer-worker-node.cjs",workerSourceNode:"draco/workers/draco-writer-worker-node.ts",options:{draco:{}}},mk={...Pc,name:"DRACO",version:Gc,options:{draco:pk},encode:bk,encodeInBatches:yk}});var BL={};Q(BL,{DracoWriter:()=>mk,DracoWriterWorker:()=>Pg,encodeDraco:()=>vL,encodeDracoBatch:()=>gk,encodeDracoInBatches:()=>zg,encodeDracoInBatchesLocally:()=>IL});var FL=p(()=>{"use strict";EL()});var FC={};Q(FC,{DRACO_EXTERNAL_LIBRARIES:()=>mt,DRACO_EXTERNAL_LIBRARY_URLS:()=>QL,DracoFormat:()=>rd,DracoLoader:()=>nd,DracoWorkerLoader:()=>JL,FetchError:()=>A.FetchError,GLBFormat:()=>ba,GLBLoader:()=>$L,GLBWriter:()=>KL,GLTFFormat:()=>ma,GLTFLoader:()=>hL,GLTFWriter:()=>WL,JSONLoader:()=>A.JSONLoader,MTLFormat:()=>Kl,MTLLoader:()=>Ng,MTLWorkerLoader:()=>uL,NullLoader:()=>A.NullLoader,NullWorkerLoader:()=>A.NullWorkerLoader,OBJFormat:()=>pa,OBJLoader:()=>Dg,OBJWorkerLoader:()=>cL,OBJWriter:()=>lL,RequestScheduler:()=>A.RequestScheduler,USDLoader:()=>_a,_BrowserFileSystem:()=>A._BrowserFileSystem,_fetchProgress:()=>A._fetchProgress,_selectSource:()=>A._selectSource,_unregisterLoaders:()=>A._unregisterLoaders,assert:()=>A.assert,concatenateArrayBuffersAsync:()=>A.concatenateArrayBuffersAsync,coreApi:()=>A.coreApi,createDataSource:()=>A.createDataSource,document:()=>A.document,encode:()=>A.encode,encodeInBatches:()=>A.encodeInBatches,encodeSync:()=>A.encodeSync,encodeTable:()=>A.encodeTable,encodeTableAsText:()=>A.encodeTableAsText,encodeTableInBatches:()=>A.encodeTableInBatches,encodeText:()=>A.encodeText,encodeTextSync:()=>A.encodeTextSync,encodeURLtoURL:()=>A.encodeURLtoURL,fetchFile:()=>A.fetchFile,forEach:()=>A.forEach,getLoaderOptions:()=>A.getLoaderOptions,getPathPrefix:()=>A.getPathPrefix,global:()=>A.global,isAsyncIterable:()=>A.isAsyncIterable,isBrowser:()=>A.isBrowser,isIterable:()=>A.isIterable,isIterator:()=>A.isIterator,isPromise:()=>A.isPromise,isPureObject:()=>A.isPureObject,isReadableStream:()=>A.isReadableStream,isResponse:()=>A.isResponse,isWorker:()=>A.isWorker,isWritableStream:()=>A.isWritableStream,load:()=>A.load,loadInBatches:()=>A.loadInBatches,makeIterator:()=>A.makeIterator,makeLineIterator:()=>A.makeLineIterator,makeNumberedLineIterator:()=>A.makeNumberedLineIterator,makeStream:()=>A.makeStream,makeTextDecoderIterator:()=>A.makeTextDecoderIterator,makeTextEncoderIterator:()=>A.makeTextEncoderIterator,parse:()=>A.parse,parseFile:()=>A.parseFile,parseInBatches:()=>A.parseInBatches,parseSync:()=>A.parseSync,preload:()=>A.preload,preloadSync:()=>A.preloadSync,readArrayBuffer:()=>A.readArrayBuffer,registerLoaders:()=>A.registerLoaders,resolvePath:()=>A.resolvePath,selectLoader:()=>A.selectLoader,selectLoaderSync:()=>A.selectLoaderSync,self:()=>A.self,setLoaderOptions:()=>A.setLoaderOptions,setPathPrefix:()=>A.setPathPrefix,window:()=>A.window});var A=iS(Ay(),1);ld();var pa={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]};Po();var WN=typeof __VERSION__<"u"?__VERSION__:"latest";async function $N(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Pm(),Gm));return r}var Dg={...pa,dataType:null,batchType:null,version:WN,worker:!0,workerInBatches:!0,serializeWorkerResult:Gi,text:!0,testText:qN,options:{obj:{shape:"arrow-table"}},preload:$N};function qN(r){return r[0]==="v"}var cL=Dg;var Kl={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]};var KN=typeof __VERSION__<"u"?__VERSION__:"latest";async function HN(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(qm(),$m));return r}var Ng={...Kl,dataType:null,batchType:null,version:KN,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:HN},uL=Ng;Cn();var XN=typeof __VERSION__<"u"?__VERSION__:"latest",lL={...pa,dataType:null,batchType:null,version:XN,options:{obj:{}},text:!0,encode:async(r,e)=>fL(r,e),encodeSync:fL,encodeTextSync:dL};function fL(r,e){let t=dL(r,e);return new TextEncoder().encode(t).buffer}function dL(r,e){let t=cn(JN(r)),n=YN(t,"POSITION"),s=t.attributes.NORMAL,i=t.attributes.TEXCOORD_0,o=t.attributes.COLOR_0,a=n.value.length/n.size,c=["# loaders.gl OBJ"];for(let f=0;f<a;f++){let l=[zn(n,f,0),zn(n,f,1),zn(n,f,2)];o&&l.push(kg(o,f,0),kg(o,f,1),kg(o,f,2)),c.push(`v ${l.join(" ")}`)}if(i)for(let f=0;f<a;f++)c.push(`vt ${zn(i,f,0)} ${zn(i,f,1)}`);if(s)for(let f=0;f<a;f++)c.push(`vn ${zn(s,f,0)} ${zn(s,f,1)} ${zn(s,f,2)}`);let u=QN(t,a);for(let f=0;f<u.length;f+=3){let l=[Cg(u[f],!!i,!!s),Cg(u[f+1],!!i,!!s),Cg(u[f+2],!!i,!!s)];c.push(`f ${l.join(" ")}`)}return`${c.join(`
|
|
46
46
|
`)}
|
|
47
|
-
`}function yN(t){return"shape"in t&&t.shape==="arrow-table"?t:Ws(t,"arrow-table")}function xN(t,e){let r=t.attributes[e];if(!r)throw new Error(`OBJWriter: ${e} attribute is required`);return r}function Vn(t,e,r){return t.value[e*t.size+r]||0}function pg(t,e,r){let n=Vn(t,e,r);return t.normalized||n>1?n/255:n}function wN(t,e){if(t.indices?.value?.length)return Array.from(t.indices.value);if(t.mode!==4&&t.topology!=="triangle-list")return[];let r=[];for(let n=0;n+2<e;n+=3)r.push(n,n+1,n+2);return r}function mg(t,e,r){let n=t+1;return e&&r?`${n}/${n}/${n}`:e?`${n}/${n}`:r?`${n}//${n}`:String(n)}var Js=typeof __VERSION__<"u"?__VERSION__:"latest";var ua={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},fa={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]};async function TN(){let{GLTFLoaderWithParser:t}=await Promise.resolve().then(()=>(ug(),cg));return t}var PI={dataType:null,batchType:null,...ua,version:Js,preload:TN,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}};Ve();var _N=1179937895,jI=1313821514,bg=5130562,St=!0;function Hc(t,e,r=0,n={}){let s=_N,i=n.version??("version"in t?t.version:2),o=t.json??{};if(i===3)return AN(t,e,r,s,o);if(i!==2)throw new Error(`Unsupported GLB writer version ${i}.`);let a="binChunks"in t?t.binary?new Uint8Array(t.binary):t.binChunks?.[0]&&Ul(t.binChunks[0]):t.buffers?.[0]&&Ul(t.buffers[0]),c=r;e&&(e.setUint32(r+0,s,St),e.setUint32(r+4,i,St),e.setUint32(r+8,0,St));let u=r+8;r+=12;let f=r;e&&(e.setUint32(r+0,0,St),e.setUint32(r+4,jI,St)),r+=8;let l=JSON.stringify(o);if(r=Df(e,r,l,4),e){let d=r-f-8;e.setUint32(f+0,d,St)}if(a){let d=r;if(e&&(e.setUint32(r+0,0,St),e.setUint32(r+4,bg,St)),r+=8,r=yc(e,r,a,4),e){let h=r-d-8;e.setUint32(d+0,h,St)}}if(e){let d=r-c;e.setUint32(u,d,St)}return r}function AN(t,e,r,n,s){let i=r,o=[{type:jI,arrayBuffer:vN(s)},...("chunks"in t?t.chunks:[])??[],..."binChunks"in t?(t.binChunks??[]).map(a=>({type:bg,arrayBuffer:Ul(a).slice().buffer})):(t.buffers??[]).map(a=>({type:bg,arrayBuffer:Ul(a).slice().buffer}))];e&&(e.setUint32(r,n,St),e.setUint32(r+4,3,St),Vl(e,r+8,0,"GLB file length")),r+=16;for(let a of o){let c=a.encoding??0;if(c!==0)throw new Error(`Unsupported GLB chunk encoding ${c}.`);let u=r;e&&(e.setUint32(r,a.type,St),e.setUint32(r+4,c,St),Vl(e,r+8,0,"GLB chunk length")),r+=16,r=yc(e,r,new Uint8Array(a.arrayBuffer),4),e&&Vl(e,u+8,r-u-16,"GLB chunk length")}return e&&Vl(e,i+8,r-i,"GLB file length"),r}function Ul(t){return new Uint8Array(t.arrayBuffer,t.byteOffset,t.byteLength)}function vN(t){let e=JSON.stringify(t),r=new TextEncoder().encode(e).byteLength,n=Math.ceil(r/4)*4,s=new ArrayBuffer(n),i=new DataView(s);return Df(i,0,e,4),s}function Vl(t,e,r,n){if(!Number.isSafeInteger(r)||r<0)throw new Error(`${n} is outside the safe integer range.`);t.setBigUint64(e,BigInt(r),St)}function gg(t,e,r,n){return IN(t),Hc(t,e,r,n)}function IN(t){if(t.buffers&&t.buffers.length>1)throw new Error("encodeGLTF: multiple buffers not yet implemented")}jb();function _e(t,e){if(!t)throw new Error(e||"assert failed: gltf")}Ve();var zI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},WI={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8};var $I=["SCALAR","VEC2","VEC3","VEC4"],LN=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],SN=new Map(LN),EN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},BN={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},FN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array};function Pl(t){return $I[t-1]||$I[0]}function eo(t){let e=SN.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function yg(t,e){let r=FN[t.componentType],n=EN[t.type],s=BN[t.componentType],i=t.count*n,o=t.count*n*s;_e(o>=0&&o<=e.byteLength);let a=WI[t.componentType],c=zI[t.type];return{ArrayType:r,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}function Xc(t,e,r){let n=typeof r=="number"?t.bufferViews[r]:r;_e(n);let s=n.buffer,i=e[s];_e(i),_e((n.byteOffset||0)>=0&&n.byteLength>=0),_e((n.byteOffset||0)+n.byteLength<=i.byteLength),_e(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function qI(t,e,r){let n=t.images[r];return Xc(t,e,n.bufferView)}function la(t,e,r){let n=typeof r=="number"?t.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);_e(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=yg(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(_e(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=xg(t,e,n);let u=n.sparse;if(!u)return c;let f=new s(i);new Uint8Array(f.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),_e(u.count>=0&&u.count<=n.count),_e([5121,5123,5125].includes(u.indices.componentType));let l=xg(t,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=xg(t,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(f.buffer),b=o*s.BYTES_PER_ELEMENT,x=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let g=0;g<u.count;g++){let w=Number(l[g]);_e(w>h&&w<n.count),m.set(x.subarray(g*b,(g+1)*b),w*b),h=w}return f}function xg(t,e,r){let n=t.bufferViews?.[r.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];_e(s);let{arrayBuffer:i,byteOffset:o}=s;_e((n.byteOffset||0)>=0&&n.byteLength>=0),_e((n.byteOffset||0)+n.byteLength<=s.byteLength),_e(o>=0&&o+s.byteLength<=i.byteLength),_e((r.byteOffset||0)>=0);let a=(o||0)+(r.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:f,numberOfComponentsInElement:l}=yg(r,n),d=f*l,h=r.type.startsWith("MAT")?Number(r.type.slice(3)):1,m=Te(h*f,4),b=h>1?h*m:d,x=n.byteStride??b,g=h>1?(h-1)*m+h*f:d;if(_e(x>=b),_e((r.byteOffset||0)+(r.count===0?0:(r.count-1)*x+g)<=n.byteLength),r.count===0)return new c(0);if(h>1&&m!==h*f){let _=n.byteStride??h*m,v=(h-1)*m+h*f;_e((r.byteOffset||0)+(r.count-1)*_+v<=n.byteLength);let I=new c(u),Y=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let $=0;$<r.count;$++)for(let re=0;re<h;re++){let pe=new Uint8Array(i,a+$*_+re*m,h*f);Y.set(pe,$*d+re*h*f)}return I}let w=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%f!==0){let v=new Uint8Array(i,a,u*f),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<r.count;_++){let v=a+_*w,I;if(v%f!==0){let Y=new Uint8Array(i,v,d),$=new Uint8Array(d);$.set(Y),I=new c($.buffer,0,l)}else I=new c(i,v,l);T.set(I,_*l)}return T}var wg="KHR_draco_mesh_compression";async function HI(t,e={}){let r=e.gltf?.draco;if(!r?.enabled)return t;if((t.buffers?.length||0)>1)throw new Error("GLTF Draco writer requires a single buffer");let n=MN(t.json),s=RN(t.buffers||[]),i={...t,json:n,buffers:s},o=[];for(let d of n.meshes||[])for(let h of d.primitives||[]){let m=h.mode??4;if(m!==4){if(r.skipUnsupportedPrimitives??!0)continue;throw new Error(`GLTF Draco writer cannot compress primitive mode ${m}; only TRIANGLES (4) is supported`)}if(h.extensions?.[wg])throw new Error("GLTF Draco writer refuses to replace an existing Draco extension");let b=ON(t,h),x=await Ml(b,{core:e.core,modules:e.modules,draco:r});o.push({primitive:h,result:x})}if(o.length===0)return i;let a=DN(s),c=a.byteLength;for(let{result:d}of o)c=Tg(c)+d.data.byteLength;let u=new Uint8Array(c);u.set(a),n.bufferViews=n.bufferViews||[],n.buffers=n.buffers||[{byteLength:0}];let f=Tg(a.byteLength);for(let{primitive:d,result:h}of o){new Uint8Array(u.buffer,f,h.data.byteLength).set(new Uint8Array(h.data));let m=n.bufferViews.length;n.bufferViews.push({buffer:0,byteOffset:f,byteLength:h.data.byteLength}),d.extensions={...d.extensions||{},[wg]:{bufferView:m,attributes:Object.fromEntries(Object.entries(h.report.attributes).map(([b,x])=>[b,x.id]))}},f=Tg(f+h.data.byteLength)}let l=u;return i.buffers[0]={...i.buffers[0]||{byteOffset:0},arrayBuffer:l.buffer,byteOffset:0,byteLength:l.byteLength},n.buffers[0]={...n.buffers[0]||{},byteLength:l.byteLength},n.extensionsUsed=NN(n.extensionsUsed,wg),i}function ON(t,e){if(!e.attributes||e.attributes.POSITION===void 0)throw new Error("GLTF Draco writer requires a POSITION attribute");let r={};for(let[s,i]of Object.entries(e.attributes)){let o=t.json.accessors?.[i];if(!o)throw new Error(`GLTF Draco writer could not resolve accessor ${i}`);if(o.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${i}`);let a=KI(t,i,o.componentType);r[s]={value:a,size:CN(o.type),...o.normalized===void 0?{}:{normalized:o.normalized}}}let n;if(e.indices!==void 0){let s=t.json.accessors?.[e.indices];if(!s)throw new Error(`GLTF Draco writer could not resolve index accessor ${e.indices}`);if(s.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${e.indices}`);n=KI(t,e.indices,s.componentType)}else{let s=t.json.accessors?.[e.attributes.POSITION];if(!s||s.count%3!==0)throw new Error("GLTF Draco writer requires triangle-aligned POSITION data without indices");n=new Uint32Array(s.count);for(let i=0;i<n.length;i++)n[i]=i}return{attributes:r,indices:n}}function KI(t,e,r){let n=la(t.json,t.buffers,e);if(n instanceof BigInt64Array||n instanceof BigUint64Array||n instanceof Float64Array)throw new Error(`GLTF Draco writer does not support 64-bit accessor ${e} (componentType ${r}); the official 1.5.7 encoder binding has no 64-bit attribute API`);return n}function MN(t){return JSON.parse(JSON.stringify(t))}function RN(t){return t.map(e=>({...e,arrayBuffer:e.arrayBuffer.slice(0)}))}function DN(t){let e=t[0]||{arrayBuffer:new ArrayBuffer(0),byteOffset:0,byteLength:0};return new Uint8Array(e.arrayBuffer,e.byteOffset||0,e.byteLength)}function Tg(t){return Math.ceil(t/4)*4}function NN(t,e){return t?.includes(e)?t:[...t||[],e]}function CN(t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:throw new Error(`GLTF Draco writer does not recognize accessor type ${t}`)}}var $g={};Z($g,{createExtMeshFeatures:()=>XN,decode:()=>WN,encode:()=>$N,name:()=>zN});$s();Ve();function kN(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Ys=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||kN(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=Te(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let r=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof r=="string"||typeof n=="string"}getExtension(e){let r=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return r?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,r){return(e.extensions||{})[r]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,r){if(typeof r=="object")return r;let n=this.json[e]&&this.json[e][r];if(!n)throw new Error(`glTF file error: Could not find ${e}[${r}]`);return n}getTypedArrayForBufferView(e){return Xc(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return la(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let r=this.getBufferView(e.bufferView),s=this.getBuffer(r.buffer).data,i=r.byteOffset||0;return new Uint8Array(s,i,r.byteLength)}addApplicationData(e,r){return this.json[e]=r,this}addExtraData(e,r){return this.json.extras=this.json.extras||{},this.json.extras[e]=r,this}addObjectExtension(e,r,n){return e.extensions=e.extensions||{},e.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(e,r,n){let s=e.extensions||{};s[r]=n}removeObjectExtension(e,r){let n=e?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(r)||s.push(r)}delete n[r]}addExtension(e,r={}){return _e(r),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=r,this.registerUsedExtension(e),r}addRequiredExtension(e,r={}){return _e(r),this.addExtension(e,r),this.registerRequiredExtension(e),r}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(e)||r.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:r}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(e){let{meshIndex:r,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:r};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:r,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(r),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,r){let n=Cn(e),s=r||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,r=0,n=this.byteLength){let s=e.byteLength;_e(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:r,byteOffset:n,byteLength:s};return this.byteLength+=Te(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,r){let n=r.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:Pl(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,r={size:3}){let n=this.addBufferView(e),s={min:r.min,max:r.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,r.size));let i={size:r.size,componentType:eo(e),count:Math.round(e.length/r.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,r))}addTexture(e){let{imageIndex:r,samplerIndex:n}=e,s={source:r,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],r=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=Te(r,8),r=e[o]+Te(a.byteLength,4))}let n=new ArrayBuffer(r),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=Wi(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&Wi(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];_e(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let f=e[u.buffer];_e(f!==void 0),u.byteOffset=f+(u.byteOffset||0),u.buffer=0}}}this.byteLength=r,this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,r){let n=!0;for(;n;){let s=e.indexOf(r);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let r={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=Te(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let f=o.length/s.size,l=new Uint8Array(f*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<f;m++)l.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(l);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:eo(o),count:f})}r[i]=u}return r}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,r){let n={min:null,max:null};if(e.length<r)return n;n.min=[],n.max=[];let s=e.subarray(0,r);for(let i of s)n.min.push(i),n.max.push(i);for(let i=r;i<e.length;i+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}};var Xe=class{gltf;type;index;data;path;iterator;constructor(e,r,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=r,this.index=n,this.data=s,this.path=i}},Zs=class extends Xe{parent;constructor(e,r,n,s,i,o){super(e,r,n,s,i),this.parent=o}},_g=class extends Xe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},Ag=class extends Xe{get channels(){return ro(this.data.channels,(e,r)=>this.iterator.getOrCreateNested(e,()=>new vg(this.iterator,"animationChannel",r,e,`${this.path}.channels[${r}]`,this)))}get samplers(){return ro(this.data.samplers,(e,r)=>this.iterator.getOrCreateNested(e,()=>new jl(this.iterator,"animationSampler",r,e,`${this.path}.samplers[${r}]`,this)))}},vg=class extends Zs{get sampler(){let r=this.parent.data.samplers[this.data.sampler];if(!r)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(r,()=>new jl(this.iterator,"animationSampler",this.data.sampler,r,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new Ig(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},Ig=class extends Zs{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},jl=class extends Zs{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},Lg=class extends Xe{get loadedBuffer(){return this.gltf.buffers[this.index]}},Sg=class extends Xe{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let r=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,r,this.data.byteLength)}},Eg=class extends Xe{},Bg=class extends Xe{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},Fg=class extends Xe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},Og=class extends Xe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},Mg=class extends Xe{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(r=>!!r).values()}getTextureInfo(e,r,n){return e?this.iterator.getOrCreateNested(e,()=>new Rg(this.iterator,"textureInfo",r,e,`${this.path}.${n}`,this)):void 0}},Rg=class extends Zs{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},Dg=class extends Xe{get primitives(){return ro(this.data.primitives,(e,r)=>this.iterator.getOrCreateNested(e,()=>new Ng(this.iterator,"primitive",r,e,`${this.path}.primitives[${r}]`,this)))}},Ng=class extends Zs{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,r])=>[e,this.iterator.resolveAccessor(r,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,r)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${r}].${n}`)])))}},Cg=class extends Xe{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return ro(this.data.children||[],(e,r)=>this.iterator.resolveNode(e,`${this.path}.children[${r}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},kg=class extends Xe{},Gg=class extends Xe{get nodes(){return ro(this.data.nodes||[],(e,r)=>this.iterator.resolveNode(e,`${this.path}.nodes[${r}]`))}},Vg=class extends Xe{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return ro(this.data.joints,(e,r)=>this.iterator.resolveNode(e,`${this.path}.joints[${r}]`))}},Ug=class extends Xe{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},Gr=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return Xc(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return la(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return qI(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let r=this.getMetadata(e);return this.gltf.buffers[r.index]}getLoadedBufferView(e){let r=this.getReferences(e).buffer,n=this.getLoadedBuffer(r);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:r,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,r,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:r}),this.data.bufferViews.length-1}addAccessor(e,r){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:Pl(r.size),componentType:r.componentType,count:r.count,min:r.min,max:r.max}),this.data.accessors.length-1}getReferences(e){let r=this.referencesCache.get(e);if(r)return r;let n=this.getObjectIterator(e),s=GN(n);return this.referencesCache.set(e,s),s}getMetadata(e){let r=this.getObjectIterator(e),n=r instanceof Zs?r.parent.data:void 0;return{gltf:this.gltf,type:r.type,index:r.index,parent:n,path:r.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,r){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:r;return n.extensions?.[s]}setExtension(e,r,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:r,a=s?r:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,r){let n=typeof e=="string",s=n?this.data:e,i=n?e:r;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(JI(this.data.extensionsUsed,i),JI(this.data.extensionsRequired,i))}recordRemovedExtension(e){let r=this.data;r.extensionsRemoved||=[],r.extensionsRemoved.includes(e)||r.extensionsRemoved.push(e)}resolveAccessor(e,r){return this.resolveCollectionObject("accessor",e,r)}resolveBuffer(e,r){return this.resolveCollectionObject("buffer",e,r)}resolveBufferView(e,r){return this.resolveCollectionObject("bufferView",e,r)}resolveCamera(e,r){return this.resolveCollectionObject("camera",e,r)}resolveExternalAsset(e,r){return this.resolveCollectionObject("externalAsset",e,r)}resolveFile(e,r){return this.resolveCollectionObject("file",e,r)}resolveImage(e,r){return this.resolveCollectionObject("image",e,r)}resolveMaterial(e,r){return this.resolveCollectionObject("material",e,r)}resolveMesh(e,r){return this.resolveCollectionObject("mesh",e,r)}resolveNode(e,r){return this.resolveCollectionObject("node",e,r)}resolveSampler(e,r){return this.resolveCollectionObject("sampler",e,r)}resolveScene(e,r){return this.resolveCollectionObject("scene",e,r)}resolveSkin(e,r){return this.resolveCollectionObject("skin",e,r)}resolveTexture(e,r){return this.resolveCollectionObject("texture",e,r)}getOrCreateNested(e,r){return this.getOrCreate(e,r)}iterateCollection(e){let r=this.getCollection(e);return ro(r,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let r=this.objectCache.get(e);if(!r)throw new Error("glTF object is not registered with this iterator");return r}resolveCollectionObject(e,r,n){let i=this.getCollection(e)[r];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${r} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,r,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,r,n){let s=`${VN(e)}[${r}]`;switch(e){case"accessor":return new _g(this,e,r,n,s);case"animation":return new Ag(this,e,r,n,s);case"buffer":return new Lg(this,e,r,n,s);case"bufferView":return new Sg(this,e,r,n,s);case"camera":return new Eg(this,e,r,n,s);case"externalAsset":return new Bg(this,e,r,n,s);case"file":return new Fg(this,e,r,n,s);case"image":return new Og(this,e,r,n,s);case"material":return new Mg(this,e,r,n,s);case"mesh":return new Dg(this,e,r,n,s);case"node":return new Cg(this,e,r,n,s);case"sampler":return new kg(this,e,r,n,s);case"scene":return new Gg(this,e,r,n,s);case"skin":return new Vg(this,e,r,n,s);case"texture":return new Ug(this,e,r,n,s)}}getOrCreate(e,r){let n=this.objectCache.get(e);if(n)return n;let s=r();return this.objectCache.set(e,s),s}};function GN(t){switch(t.type){case"accessor":return{get bufferView(){return t.bufferView?.data}};case"animation":return{get channels(){return to(t.channels)},get samplers(){return to(t.samplers)}};case"animationChannel":return{get sampler(){return t.sampler.data},get target(){return t.target.data}};case"animationChannelTarget":return{get node(){return t.node?.data}};case"animationSampler":return{get input(){return t.input.data},get output(){return t.output.data}};case"bufferView":return{get buffer(){return t.buffer.data}};case"externalAsset":return{get file(){return t.file.data}};case"file":case"image":return{get bufferView(){return t.bufferView?.data}};case"material":return{get baseColorTexture(){return t.baseColorTexture?.data},get metallicRoughnessTexture(){return t.metallicRoughnessTexture?.data},get normalTexture(){return t.normalTexture?.data},get occlusionTexture(){return t.occlusionTexture?.data},get emissiveTexture(){return t.emissiveTexture?.data},get textures(){return to(t.textures)}};case"textureInfo":return{get texture(){return t.texture.data}};case"mesh":return{get primitives(){return to(t.primitives)}};case"primitive":return{get attributes(){return XI(t.attributes)},get indices(){return t.indices?.data},get material(){return t.material?.data},get targets(){return t.targets.map(XI)}};case"node":return{get camera(){return t.camera?.data},get children(){return to(t.children)},get skin(){return t.skin?.data},get mesh(){return t.mesh?.data},get externalAsset(){return t.externalAsset?.data}};case"scene":return{get nodes(){return to(t.nodes)}};case"skin":return{get inverseBindMatrices(){return t.inverseBindMatrices?.data},get skeleton(){return t.skeleton?.data},get joints(){return to(t.joints)}};case"texture":return{get sampler(){return t.sampler?.data},get source(){return t.source?.data}};default:return{}}}function ro(t,e){return(function*(){for(let n=0;n<t.length;n++)yield e(t[n],n)})()}function to(t){return(function*(){for(let r of t)yield r.data})()}function XI(t){return new Map(Array.from(t,([e,r])=>[e,r.data]))}function VN(t){switch(t){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${t}s`}}function JI(t,e){if(t)for(let r=t.length-1;r>=0;r--)t[r]===e&&t.splice(r,1)}$s();Ve();function YI(t){return(t%1+1)%1}var ZI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},UN={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},QI={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Pg(t,e){return QI[e]*ZI[t]}function jg(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let s=t.getTypedArrayForBufferView(e),i=zl(s,"SCALAR",r,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function zl(t,e,r,n=1){let s=ZI[e],i=UN[r],o=QI[r],a=n*s,c=a*o,u=t.buffer,f=t.byteOffset;return f%o!==0&&(u=new Uint8Array(u).slice(f,f+c).buffer,f=0),new i($i(u),f,a)}function Wl(t,e,r){let n=`TEXCOORD_${e.texCoord||0}`,s=r.attributes[n],i=t.getTypedArrayForAccessor(s),o=t.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,f=t.gltf.images?.[c];if(f&&typeof f.width<"u"){let l=[];for(let d=0;d<i.length;d+=2){let h=PN(f,u,i,d,e.channels);l.push(h)}return l}}return[]}function eL(t,e,r,n,s){if(!r?.length)return;let i=[];for(let l of r){let d=n.findIndex(h=>h===l);d===-1&&(d=n.push(l)-1),i.push(d)}let o=new Uint32Array(i),a=t instanceof Gr?t:new Gr(t.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),f=a.addAccessor(u,{size:1,componentType:eo(o),count:o.length});s.attributes[e]=f}function PN(t,e,r,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],a=r[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=jN(o,a,t,c),f=0;for(let l of s){let d=typeof l=="number"?Object.values(i)[l]:i[l],h=u+d.offset,m=Bc(t);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];f|=b<<d.shift}return f}function jN(t,e,r,n=1){let s=r.width,i=YI(t)*(s-1),o=Math.round(i),a=r.height,c=YI(e)*(a-1),u=Math.round(c),f=r.components?r.components:n;return(u*s+o)*f}function zg(t,e,r,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(r[i]),a=Number(r[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>t.length)break;let c=o*n,u=a*n;s.push(t.slice(c,c+u))}return s}function Wg(t,e,r,n=1){let s=[],i=r*n;for(let o=0;o<e;o++){let a=o*i;s.push(t.slice(a,a+i))}return s}function tL(t,e,r,n,s){let i=new TextDecoder("utf8");if(r){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<t;a++){let c=r[a],u=r[a+1],f=[];for(let l=c;l<u;l++){let d=n[l],h=n[l+1],m=e.subarray(d,h);f.push(i.decode(m))}o.push(f)}return o}if(n){let o=[],a=t*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),f=Number(n[c+1]);u>=0&&f>=u&&f<=e.length&&o.push(i.decode(e.subarray(u,f)))}return s?Array.from({length:t},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var da="EXT_mesh_features",zN=da;async function WN(t,e){let r=new Gr(t);qN(r,e)}function $N(t,e){let r=new Ys(t);return HN(r,e),r.createBinaryChunk(),r.gltf}function qN(t,e){for(let r of t.meshes)for(let n of t.getReferences(r).primitives)KN(t,n,e)}function KN(t,e,r){let s=t.getExtension(e,da)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!r?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=t.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!r?.gltf?.loadImages)continue;o=Wl(t,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?t.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function HN(t,e){let r=t.gltf.json.meshes;if(r)for(let n of r)for(let s of n.primitives)JN(t,s)}function XN(t,e,r,n){e.extensions||(e.extensions={});let s=e.extensions[da];s||(s={featureIds:[]},e.extensions[da]=s);let{featureIds:i}=s,o={featureCount:r.length,propertyTable:n,data:r};i.push(o),t.addObjectExtension(e,da,s)}function JN(t,e){let r=e.extensions?.[da];if(!r)return;let n=r.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=YN(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=t.addBufferView(c),f=t.addAccessor(u,{size:1,componentType:eo(c),count:c.length});e.attributes[o]=f}})}function YN(t){let e="_FEATURE_ID_",r=Object.keys(t).filter(i=>i.indexOf(e)===0),n=-1;for(let i of r){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var Xg={};Z(Xg,{createExtStructuralMetadata:()=>AC,decode:()=>eC,encode:()=>tC,name:()=>QN});function nL(t,e,r){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return rL(t);let s=r?.baseUrl||ZN(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${t}`);let i=s.endsWith("/")?`${s}${t}`:`${s}/${t}`;return rL(i)}function rL(t){try{return new URL(t).href}catch{return t}}function ZN(t){if(!t)return;if(t.endsWith("/"))return t;let e=t.lastIndexOf("/");return e>=0?t.slice(0,e+1):""}var no="EXT_structural_metadata",QN=no;async function eC(t,e,r){let n=new Gr(t),s=n.getExtension(no);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!r?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=nL(s.schemaUri,e,r),o=await r.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}rC(n,e)}function tC(t,e){let r=new Ys(t);return TC(r,e),r.createBinaryChunk(),r.gltf}function rC(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(no);r&&(e.gltf?.loadImages&&nC(t,r),sC(t,r))}function nC(t,e){let r=e.propertyTextures,n=t.data;if(r&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)iC(t,r,i,e)}function sC(t,e){let r=e.schema;if(!r)return;let n=r.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&aC(t,r,i)}function iC(t,e,r,n){if(!e)return;let i=r.extensions?.[no]?.propertyTextures;if(i)for(let o of i){let a=e[o];oC(t,a,r,n)}}function oC(t,e,r,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=Wl(t,a,r);u!==null&&(eL(t,o,u,c,r),a.data=c,n.dataAttributeNames.push(o))}}function aC(t,e,r){let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let i in n.properties){let o=n.properties[i],a=r.properties?.[i];if(a){let c={},u=cC(t,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function cC(t,e,r,n,s,i){let o=[],a=s.values,c=t.getTypedArrayForBufferView(a),u=fC(t,r,s,n),f=lC(t,r,s,n,u);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let l=dC(r,s,n,c,u);o=l.data,i&&(i.value=l.rawData);break}case"BOOLEAN":{o=uC(r,n,c,u);break}case"STRING":{o=tL(n,c,u,f,r.array?r.count:void 0);break}case"ENUM":{o=bC(e,r,n,c,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return o}function uC(t,e,r,n){return t.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return qg(r,o,a-o)}):t.count===void 0?[]:Array.from({length:e},(s,i)=>qg(r,i*t.count,t.count)):qg(r,0,e)}function qg(t,e,r){if(e+r>t.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:r},(n,s)=>{let i=e+s;return!!(t[Math.floor(i/8)]&1<<i%8)})}function fC(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?jg(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function lC(t,e,r,n,s){if(typeof r.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return jg(t,r.stringOffsets,r.stringOffsetType||"UINT32",i)}return null}function dC(t,e,r,n,s){let i=t.array,o=t.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[t.type]||1,c=Pg(t.type,t.componentType),u=n.byteLength/c,f;t.componentType?f=zl(n,t.type,t.componentType,u):f=n;let l=f,d=e.offset??t.offset,h=e.scale??t.scale,m=t.normalized||d!==void 0||h!==void 0?hC(l,t.componentType,t.type,t.normalized,d,h):l;return i?s?{data:zg(m,r,s,a),rawData:zg(l,r,s,a)}:o?{data:Wg(m,r,o,a),rawData:Wg(l,r,o,a)}:{data:[],rawData:[]}:{data:m,rawData:l}}function hC(t,e,r,n,s,i){let o=mC(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return t;let c=pC(r),u=new Float64Array(t.length);for(let f=0;f<t.length;f++){let l=Number(t[f]);a&&(l=e?.startsWith("INT")?Math.max(l/o,-1):l/o);let d=f%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[f]=l*m+h}return u}function pC(t){switch(t){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function mC(t){switch(t){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function bC(t,e,r,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=t.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=Pg(e.type,a),u=n.byteLength/c,f=zl(n,e.type,a,u);if(f||(f=n),e.array){if(s)return gC({valuesData:f,numberOfElements:r,arrayOffsets:s,enumEntry:o});let l=e.count;return l?yC(f,r,l,o):[]}return Hg(f,0,r,o)}function gC(t){let{valuesData:e,numberOfElements:r,arrayOffsets:n,enumEntry:s}=t,i=[];for(let o=0;o<r;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=Hg(e,a,c,s);i.push(u)}return i}function yC(t,e,r,n){let s=[];for(let i=0;i<e;i++){let o=r*i,a=Hg(t,o,r,n);s.push(a)}return s}function Hg(t,e,r,n){let s=[];for(let i=0;i<r;i++){let o=t[e+i],a=xC(n,o);a?s.push(a.name):s.push("")}return s}function xC(t,e){for(let r of t.values)if(typeof e=="bigint"?Number.isSafeInteger(r.value)&&BigInt(r.value)===e:r.value===e)return r;return null}var wC="schemaClassId";function TC(t,e){let r=t.getExtension(no);if(r&&r.propertyTables)for(let n of r.propertyTables){let s=n.class,i=r.schema?.classes?.[s];n.properties&&i&&_C(n,i,t)}}function _C(t,e,r){for(let n in t.properties){let s=t.properties[n].data;if(s){let i=e.properties[n];if(i){let o=LC(s,i,r);t.properties[n]=o}}}}function AC(t,e,r=wC){let n=t.getExtension(no);n||(n=t.addExtension(no)),n.schema=vC(e,r,n.schema);let s=IC(e,r,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function vC(t,e,r){let n=r??{id:"schema_id"},s={properties:{}};for(let i of t){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function IC(t,e,r){let n={class:e,count:0},s=0,i=r.classes?.[e];for(let o of t){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function LC(t,e,r){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=BC(t);n.stringOffsets=Kg(i,r),n.values=Kg(s,r)}else if(e.type==="SCALAR"&&e.componentType){let s=EC(t,e.componentType);n.values=Kg(s,r)}return n}var SC={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function EC(t,e){let r=[];for(let s of t)r.push(Number(s));let n=SC[e];if(!n)throw new Error("Illegal component type");return new n(r)}function BC(t){let e=new TextEncoder,r=[],n=0;for(let c of t){let u=e.encode(c);n+=u.length,r.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of r)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function Kg(t,e){return e.addBufferView(t)}var Jg={};Z(Jg,{decode:()=>OC,encode:()=>MC,name:()=>FC});var ha="KHR_materials_unlit",FC=ha;async function OC(t){let e=new Gr(t);for(let r of e.materials)e.getExtension(r,ha)&&(r.unlit=!0),e.removeExtension(r,ha);e.removeExtension(ha)}function MC(t){let e=new Ys(t);for(let r of t.json.materials||[]){let n=r;n.unlit&&(delete n.unlit,e.addObjectExtension(r,ha,{}),e.registerRequiredExtension(ha))}for(let r of["extensionsUsed","extensionsRequired"])t.json[r]?.length===0&&delete t.json[r]}var RC=[Jg,Xg,$g];function sL(t,e={}){for(let r of RC)t=r.encode?.(t,e)??t;return t}var oL={dataType:null,batchType:null,...ua,version:Js,options:{gltf:{}},encode:async(t,e={})=>{let r=await HI(t,e),n={...e};return n.gltf=e.gltf?{...e.gltf,draco:void 0}:void 0,iL(r,n)},encodeSync:iL};function iL(t,e={}){if(e.gltf?.draco?.enabled)throw new Error("GLTFWriter Draco compression is asynchronous; use encode() instead of encodeSync()");let{byteOffset:r=0}=e,n=sL(t);t.buffers=n.buffers,t.binary=n.binary;let s=gg(n,null,r,e),i=new ArrayBuffer(s),o=new DataView(i);return gg(n,o,r,e),i}async function DC(){let{GLBLoaderWithParser:t}=await Promise.resolve().then(()=>(lg(),fg));return t}var aL={dataType:null,batchType:null,...fa,version:Js,preload:DC,options:{glb:{strict:!1}}};var uL={...fa,version:Js,options:{glb:{}},encode:async(t,e={})=>cL(t,e),encodeSync:cL};function cL(t,e){let{byteOffset:r=0}=e??{},n=e?.glb??{},s=Hc(t,null,r,n),i=new ArrayBuffer(s),o=new DataView(i);return Hc(t,o,r,n),i}return gL(NC);})();
|
|
47
|
+
`}function JN(r){return"shape"in r&&r.shape==="arrow-table"?r:qs(r,"arrow-table")}function YN(r,e){let t=r.attributes[e];if(!t)throw new Error(`OBJWriter: ${e} attribute is required`);return t}function zn(r,e,t){return r.value[e*r.size+t]||0}function kg(r,e,t){let n=zn(r,e,t);return r.normalized||n>1?n/255:n}function QN(r,e){if(r.indices?.value?.length)return Array.from(r.indices.value);if(r.mode!==4&&r.topology!=="triangle-list")return[];let t=[];for(let n=0;n+2<e;n+=3)t.push(n,n+1,n+2);return t}function Cg(r,e,t){let n=r+1;return e&&t?`${n}/${n}/${n}`:e?`${n}/${n}`:t?`${n}//${n}`:String(n)}var Ys=typeof __VERSION__<"u"?__VERSION__:"latest";var ma={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},ba={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]};async function ZN(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Og(),Fg));return r}var hL={dataType:null,batchType:null,...ma,version:Ys,preload:ZN,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}};je();var ek=1179937895,pL=1313821514,jg=5130562,St=!0;function Yc(r,e,t=0,n={}){let s=ek,i=n.version??("version"in r?r.version:2),o=r.json??{};if(i===3)return tk(r,e,t,s,o);if(i!==2)throw new Error(`Unsupported GLB writer version ${i}.`);let a="binChunks"in r?r.binary?new Uint8Array(r.binary):r.binChunks?.[0]&&Xl(r.binChunks[0]):r.buffers?.[0]&&Xl(r.buffers[0]),c=t;e&&(e.setUint32(t+0,s,St),e.setUint32(t+4,i,St),e.setUint32(t+8,0,St));let u=t+8;t+=12;let f=t;e&&(e.setUint32(t+0,0,St),e.setUint32(t+4,pL,St)),t+=8;let l=JSON.stringify(o);if(t=Wf(e,t,l,4),e){let d=t-f-8;e.setUint32(f+0,d,St)}if(a){let d=t;if(e&&(e.setUint32(t+0,0,St),e.setUint32(t+4,jg,St)),t+=8,t=_c(e,t,a,4),e){let h=t-d-8;e.setUint32(d+0,h,St)}}if(e){let d=t-c;e.setUint32(u,d,St)}return t}function tk(r,e,t,n,s){let i=t,o=[{type:pL,arrayBuffer:rk(s)},...("chunks"in r?r.chunks:[])??[],..."binChunks"in r?(r.binChunks??[]).map(a=>({type:jg,arrayBuffer:Xl(a).slice().buffer})):(r.buffers??[]).map(a=>({type:jg,arrayBuffer:Xl(a).slice().buffer}))];e&&(e.setUint32(t,n,St),e.setUint32(t+4,3,St),Hl(e,t+8,0,"GLB file length")),t+=16;for(let a of o){let c=a.encoding??0;if(c!==0)throw new Error(`Unsupported GLB chunk encoding ${c}.`);let u=t;e&&(e.setUint32(t,a.type,St),e.setUint32(t+4,c,St),Hl(e,t+8,0,"GLB chunk length")),t+=16,t=_c(e,t,new Uint8Array(a.arrayBuffer),4),e&&Hl(e,u+8,t-u-16,"GLB chunk length")}return e&&Hl(e,i+8,t-i,"GLB file length"),t}function Xl(r){return new Uint8Array(r.arrayBuffer,r.byteOffset,r.byteLength)}function rk(r){let e=JSON.stringify(r),t=new TextEncoder().encode(e).byteLength,n=Math.ceil(t/4)*4,s=new ArrayBuffer(n),i=new DataView(s);return Wf(i,0,e,4),s}function Hl(r,e,t,n){if(!Number.isSafeInteger(t)||t<0)throw new Error(`${n} is outside the safe integer range.`);r.setBigUint64(e,BigInt(t),St)}function Vg(r,e,t,n){return nk(r),Yc(r,e,t,n)}function nk(r){if(r.buffers&&r.buffers.length>1)throw new Error("encodeGLTF: multiple buffers not yet implemented")}function Ae(r,e){if(!r)throw new Error(e||"assert failed: gltf")}je();var mL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},bL={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8};var gL=["SCALAR","VEC2","VEC3","VEC4"],sk=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],ik=new Map(sk),ok={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ak={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},ck={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array};function Jl(r){return gL[r-1]||gL[0]}function io(r){let e=ik.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function Ug(r,e){let t=ck[r.componentType],n=ok[r.type],s=ak[r.componentType],i=r.count*n,o=r.count*n*s;Ae(o>=0&&o<=e.byteLength);let a=bL[r.componentType],c=mL[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}function Qc(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;Ae(n);let s=n.buffer,i=e[s];Ae(i),Ae((n.byteOffset||0)>=0&&n.byteLength>=0),Ae((n.byteOffset||0)+n.byteLength<=i.byteLength),Ae(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function yL(r,e,t){let n=r.images[t];return Qc(r,e,n.bufferView)}function ga(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);Ae(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=Ug(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(Ae(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=Gg(r,e,n);let u=n.sparse;if(!u)return c;let f=new s(i);new Uint8Array(f.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),Ae(u.count>=0&&u.count<=n.count),Ae([5121,5123,5125].includes(u.indices.componentType));let l=Gg(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=Gg(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(f.buffer),b=o*s.BYTES_PER_ELEMENT,w=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let g=0;g<u.count;g++){let x=Number(l[g]);Ae(x>h&&x<n.count),m.set(w.subarray(g*b,(g+1)*b),x*b),h=x}return f}function Gg(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];Ae(s);let{arrayBuffer:i,byteOffset:o}=s;Ae((n.byteOffset||0)>=0&&n.byteLength>=0),Ae((n.byteOffset||0)+n.byteLength<=s.byteLength),Ae(o>=0&&o+s.byteLength<=i.byteLength),Ae((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:f,numberOfComponentsInElement:l}=Ug(t,n),d=f*l,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=Te(h*f,4),b=h>1?h*m:d,w=n.byteStride??b,g=h>1?(h-1)*m+h*f:d;if(Ae(w>=b),Ae((t.byteOffset||0)+(t.count===0?0:(t.count-1)*w+g)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*f){let _=n.byteStride??h*m,v=(h-1)*m+h*f;Ae((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let q=0;q<t.count;q++)for(let re=0;re<h;re++){let pe=new Uint8Array(i,a+q*_+re*m,h*f);N.set(pe,q*d+re*h*f)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%f!==0){let v=new Uint8Array(i,a,u*f),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%f!==0){let N=new Uint8Array(i,v,d),q=new Uint8Array(d);q.set(N),I=new c(q.buffer,0,l)}else I=new c(i,v,l);T.set(I,_*l)}return T}var Wg="KHR_draco_mesh_compression";async function ML(r,e={}){let t=e.gltf?.draco;if(!t?.enabled)return r;if((r.buffers?.length||0)>1)throw new Error("GLTF Draco writer requires a single buffer");let n=Ak(r.json),s=vk(r.buffers||[]),i={...r,json:n,buffers:s},o=[];for(let d of n.meshes||[])for(let h of d.primitives||[]){let m=h.mode??4;if(m!==4){if(t.skipUnsupportedPrimitives??!0)continue;throw new Error(`GLTF Draco writer cannot compress primitive mode ${m}; only TRIANGLES (4) is supported`)}if(h.extensions?.[Wg])throw new Error("GLTF Draco writer refuses to replace an existing Draco extension");let b=_k(r,h),{encodeDraco:w}=await Promise.resolve().then(()=>(FL(),BL)),g=await w(b,{core:e.core,modules:e.modules,draco:t});o.push({primitive:h,result:g})}if(o.length===0)return i;let a=Ik(s),c=a.byteLength;for(let{result:d}of o)c=$g(c)+d.data.byteLength;let u=new Uint8Array(c);u.set(a),n.bufferViews=n.bufferViews||[],n.buffers=n.buffers||[{byteLength:0}];let f=$g(a.byteLength);for(let{primitive:d,result:h}of o){new Uint8Array(u.buffer,f,h.data.byteLength).set(new Uint8Array(h.data));let m=n.bufferViews.length;n.bufferViews.push({buffer:0,byteOffset:f,byteLength:h.data.byteLength}),d.extensions={...d.extensions||{},[Wg]:{bufferView:m,attributes:Object.fromEntries(Object.entries(h.report.attributes).map(([b,w])=>[b,w.id]))}},f=$g(f+h.data.byteLength)}let l=u;return i.buffers[0]={...i.buffers[0]||{byteOffset:0},arrayBuffer:l.buffer,byteOffset:0,byteLength:l.byteLength},n.buffers[0]={...n.buffers[0]||{},byteLength:l.byteLength},n.extensionsUsed=Lk(n.extensionsUsed,Wg),i}function _k(r,e){if(!e.attributes||e.attributes.POSITION===void 0)throw new Error("GLTF Draco writer requires a POSITION attribute");let t={};for(let[s,i]of Object.entries(e.attributes)){let o=r.json.accessors?.[i];if(!o)throw new Error(`GLTF Draco writer could not resolve accessor ${i}`);if(o.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${i}`);let a=OL(r,i,o.componentType);t[s]={value:a,size:Sk(o.type),...o.normalized===void 0?{}:{normalized:o.normalized}}}let n;if(e.indices!==void 0){let s=r.json.accessors?.[e.indices];if(!s)throw new Error(`GLTF Draco writer could not resolve index accessor ${e.indices}`);if(s.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${e.indices}`);n=OL(r,e.indices,s.componentType)}else{let s=r.json.accessors?.[e.attributes.POSITION];if(!s||s.count%3!==0)throw new Error("GLTF Draco writer requires triangle-aligned POSITION data without indices");n=new Uint32Array(s.count);for(let i=0;i<n.length;i++)n[i]=i}return{attributes:t,indices:n}}function OL(r,e,t){let n=ga(r.json,r.buffers,e);if(n instanceof BigInt64Array||n instanceof BigUint64Array||n instanceof Float64Array)throw new Error(`GLTF Draco writer does not support 64-bit accessor ${e} (componentType ${t}); the official 1.5.7 encoder binding has no 64-bit attribute API`);return n}function Ak(r){return JSON.parse(JSON.stringify(r))}function vk(r){return r.map(e=>({...e,arrayBuffer:e.arrayBuffer.slice(0)}))}function Ik(r){let e=r[0]||{arrayBuffer:new ArrayBuffer(0),byteOffset:0,byteLength:0};return new Uint8Array(e.arrayBuffer,e.byteOffset||0,e.byteLength)}function $g(r){return Math.ceil(r/4)*4}function Lk(r,e){return r?.includes(e)?r:[...r||[],e]}function Sk(r){switch(r){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:throw new Error(`GLTF Draco writer does not recognize accessor type ${r}`)}}var my={};Q(my,{createExtMeshFeatures:()=>Uk,decode:()=>Nk,encode:()=>kk,name:()=>Dk});Vn();je();function Ek(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Qs=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||Ek(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=Te(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return Qc(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ga(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return Ae(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ae(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=jn(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;Ae(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=Te(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:Jl(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:io(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=Te(t,8),t=e[o]+Te(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=qi(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&qi(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];Ae(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let f=e[u.buffer];Ae(f!==void 0),u.byteOffset=f+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=Te(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let f=o.length/s.size,l=new Uint8Array(f*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<f;m++)l.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(l);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:io(o),count:f})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}};var He=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},Zs=class extends He{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},qg=class extends He{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},Kg=class extends He{get channels(){return ao(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Hg(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return ao(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Zl(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},Hg=class extends Zs{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new Zl(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new Xg(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},Xg=class extends Zs{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},Zl=class extends Zs{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},Jg=class extends He{get loadedBuffer(){return this.gltf.buffers[this.index]}},Yg=class extends He{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},Qg=class extends He{},Zg=class extends He{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},ey=class extends He{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},ty=class extends He{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},ry=class extends He{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new ny(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},ny=class extends Zs{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},sy=class extends He{get primitives(){return ao(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new iy(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},iy=class extends Zs{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},oy=class extends He{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return ao(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},ay=class extends He{},cy=class extends He{get nodes(){return ao(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},uy=class extends He{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return ao(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},fy=class extends He{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},Vr=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return Qc(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ga(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return yL(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:Jl(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=Bk(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof Zs?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(DL(this.data.extensionsUsed,i),DL(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return ao(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${Fk(e)}[${t}]`;switch(e){case"accessor":return new qg(this,e,t,n,s);case"animation":return new Kg(this,e,t,n,s);case"buffer":return new Jg(this,e,t,n,s);case"bufferView":return new Yg(this,e,t,n,s);case"camera":return new Qg(this,e,t,n,s);case"externalAsset":return new Zg(this,e,t,n,s);case"file":return new ey(this,e,t,n,s);case"image":return new ty(this,e,t,n,s);case"material":return new ry(this,e,t,n,s);case"mesh":return new sy(this,e,t,n,s);case"node":return new oy(this,e,t,n,s);case"sampler":return new ay(this,e,t,n,s);case"scene":return new cy(this,e,t,n,s);case"skin":return new uy(this,e,t,n,s);case"texture":return new fy(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}};function Bk(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return oo(r.channels)},get samplers(){return oo(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return oo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return oo(r.primitives)}};case"primitive":return{get attributes(){return RL(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(RL)}};case"node":return{get camera(){return r.camera?.data},get children(){return oo(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return oo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return oo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function ao(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function oo(r){return(function*(){for(let t of r)yield t.data})()}function RL(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function Fk(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function DL(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}Vn();je();function NL(r){return(r%1+1)%1}var kL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},Ok={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},CL={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function ly(r,e){return CL[e]*kL[r]}function dy(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=ed(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function ed(r,e,t,n=1){let s=kL[e],i=Ok[t],o=CL[t],a=n*s,c=a*o,u=r.buffer,f=r.byteOffset;return f%o!==0&&(u=new Uint8Array(u).slice(f,f+c).buffer,f=0),new i(Ki(u),f,a)}function td(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,f=r.gltf.images?.[c];if(f&&typeof f.width<"u"){let l=[];for(let d=0;d<i.length;d+=2){let h=Mk(f,u,i,d,e.channels);l.push(h)}return l}}return[]}function jL(r,e,t,n,s){if(!t?.length)return;let i=[];for(let l of t){let d=n.findIndex(h=>h===l);d===-1&&(d=n.push(l)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof Vr?r:new Vr(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),f=a.addAccessor(u,{size:1,componentType:io(o),count:o.length});s.attributes[e]=f}function Mk(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=Rk(o,a,r,c),f=0;for(let l of s){let d=typeof l=="number"?Object.values(i)[l]:i[l],h=u+d.offset,m=Rc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];f|=b<<d.shift}return f}function Rk(r,e,t,n=1){let s=t.width,i=NL(r)*(s-1),o=Math.round(i),a=t.height,c=NL(e)*(a-1),u=Math.round(c),f=t.components?t.components:n;return(u*s+o)*f}function hy(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function py(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function VL(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],f=[];for(let l=c;l<u;l++){let d=n[l],h=n[l+1],m=e.subarray(d,h);f.push(i.decode(m))}o.push(f)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),f=Number(n[c+1]);u>=0&&f>=u&&f<=e.length&&o.push(i.decode(e.subarray(u,f)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var wa="EXT_mesh_features",Dk=wa;async function Nk(r,e){let t=new Vr(r);Ck(t,e)}function kk(r,e){let t=new Qs(r);return Vk(t,e),t.createBinaryChunk(),t.gltf}function Ck(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)jk(r,n,e)}function jk(r,e,t){let s=r.getExtension(e,wa)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=td(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function Vk(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)Gk(r,s)}function Uk(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[wa];s||(s={featureIds:[]},e.extensions[wa]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,wa,s)}function Gk(r,e){let t=e.extensions?.[wa];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=Pk(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),f=r.addAccessor(u,{size:1,componentType:io(c),count:c.length});e.attributes[o]=f}})}function Pk(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var wy={};Q(wy,{createExtStructuralMetadata:()=>pC,decode:()=>$k,encode:()=>qk,name:()=>Wk});function GL(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return UL(r);let s=t?.baseUrl||zk(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return UL(i)}function UL(r){try{return new URL(r).href}catch{return r}}function zk(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var co="EXT_structural_metadata",Wk=co;async function $k(r,e,t){let n=new Vr(r),s=n.getExtension(co);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=GL(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}Kk(n,e)}function qk(r,e){let t=new Qs(r);return dC(t,e),t.createBinaryChunk(),t.gltf}function Kk(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(co);t&&(e.gltf?.loadImages&&Hk(r,t),Xk(r,t))}function Hk(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)Jk(r,t,i,e)}function Xk(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&Qk(r,t,i)}function Jk(r,e,t,n){if(!e)return;let i=t.extensions?.[co]?.propertyTextures;if(i)for(let o of i){let a=e[o];Yk(r,a,t,n)}}function Yk(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=td(r,a,t);u!==null&&(jL(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function Qk(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=Zk(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function Zk(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=tC(r,t,s,n),f=rC(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let l=nC(t,s,n,c,u);o=l.data,i&&(i.value=l.rawData);break}case"BOOLEAN":{o=eC(t,n,c,u);break}case"STRING":{o=VL(n,c,u,f,t.array?t.count:void 0);break}case"ENUM":{o=aC(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function eC(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return by(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>by(t,i*r.count,r.count)):by(t,0,e)}function by(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function tC(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?dy(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function rC(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return dy(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function nC(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=ly(r.type,r.componentType),u=n.byteLength/c,f;r.componentType?f=ed(n,r.type,r.componentType,u):f=n;let l=f,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?sC(l,r.componentType,r.type,r.normalized,d,h):l;return i?s?{data:hy(m,t,s,a),rawData:hy(l,t,s,a)}:o?{data:py(m,t,o,a),rawData:py(l,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:l}}function sC(r,e,t,n,s,i){let o=oC(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=iC(t),u=new Float64Array(r.length);for(let f=0;f<r.length;f++){let l=Number(r[f]);a&&(l=e?.startsWith("INT")?Math.max(l/o,-1):l/o);let d=f%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[f]=l*m+h}return u}function iC(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function oC(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function aC(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=ly(e.type,a),u=n.byteLength/c,f=ed(n,e.type,a,u);if(f||(f=n),e.array){if(s)return cC({valuesData:f,numberOfElements:t,arrayOffsets:s,enumEntry:o});let l=e.count;return l?uC(f,t,l,o):[]}return yy(f,0,t,o)}function cC(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=yy(e,a,c,s);i.push(u)}return i}function uC(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=yy(r,o,t,n);s.push(a)}return s}function yy(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=fC(n,o);a?s.push(a.name):s.push("")}return s}function fC(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}var lC="schemaClassId";function dC(r,e){let t=r.getExtension(co);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&hC(n,i,r)}}function hC(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=gC(s,i,t);r.properties[n]=o}}}}function pC(r,e,t=lC){let n=r.getExtension(co);n||(n=r.addExtension(co)),n.schema=mC(e,t,n.schema);let s=bC(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function mC(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function bC(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function gC(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=xC(r);n.stringOffsets=gy(i,t),n.values=gy(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=wC(r,e.componentType);n.values=gy(s,t)}return n}var yC={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function wC(r,e){let t=[];for(let s of r)t.push(Number(s));let n=yC[e];if(!n)throw new Error("Illegal component type");return new n(t)}function xC(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function gy(r,e){return e.addBufferView(r)}var xy={};Q(xy,{decode:()=>_C,encode:()=>AC,name:()=>TC});var xa="KHR_materials_unlit",TC=xa;async function _C(r){let e=new Vr(r);for(let t of e.materials)e.getExtension(t,xa)&&(t.unlit=!0),e.removeExtension(t,xa);e.removeExtension(xa)}function AC(r){let e=new Qs(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,xa,{}),e.registerRequiredExtension(xa))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var vC=[xy,wy,my];function PL(r,e={}){for(let t of vC)r=t.encode?.(r,e)??r;return r}var WL={dataType:null,batchType:null,...ma,version:Ys,options:{gltf:{}},encode:async(r,e={})=>{let t=await ML(r,e),n={...e};return n.gltf=e.gltf?{...e.gltf,draco:void 0}:void 0,zL(t,n)},encodeSync:zL};function zL(r,e={}){if(e.gltf?.draco?.enabled)throw new Error("GLTFWriter Draco compression is asynchronous; use encode() instead of encodeSync()");let{byteOffset:t=0}=e,n=PL(r);r.buffers=n.buffers,r.binary=n.binary;let s=Vg(n,null,t,e),i=new ArrayBuffer(s),o=new DataView(i);return Vg(n,o,t,e),i}async function IC(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Rg(),Mg));return r}var $L={dataType:null,batchType:null,...ba,version:Ys,preload:IC,options:{glb:{strict:!1}}};var KL={...ba,version:Ys,options:{glb:{}},encode:async(r,e={})=>qL(r,e),encodeSync:qL};function qL(r,e){let{byteOffset:t=0}=e??{},n=e?.glb??{},s=Yc(r,null,t,n),i=new ArrayBuffer(s),o=new DataView(i);return Yc(r,o,t,n),i}Po();var HL=typeof __VERSION__<"u"?__VERSION__:"latest";var rd={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]};var XL={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"};async function LC(r,e){let t=e;switch(SC(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(og(),ig));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(cg(),ag));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(fg(),ug));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}var nd={dataType:null,batchType:null,...rd,version:HL,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:jf,deserializeWorkerResult:Vf,options:{draco:XL},preload:LC},JL=nd;function SC(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:nd.options.draco.backend}var EC="1.5.7",BC="8786740086a9f4d83f44aa83badfbea4dce7a1b5",eu=`https://www.gstatic.com/draco/versioned/decoders/${EC}`,YL=`https://cdn.jsdelivr.net/gh/google/draco@${BC}/javascript`,mt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},QL={[mt.DECODER]:`${eu}/${mt.DECODER}`,[mt.DECODER_WASM]:`${eu}/${mt.DECODER_WASM}`,[mt.GLTF_DECODER]:`${eu}/${mt.GLTF_DECODER}`,[mt.GLTF_DECODER_WASM]:`${eu}/${mt.GLTF_DECODER_WASM}`,[mt.FALLBACK_DECODER]:`${eu}/${mt.FALLBACK_DECODER}`,[mt.ENCODER]:`${YL}/${mt.ENCODER}`,[mt.ENCODER_WASM]:`${YL}/${mt.ENCODER_WASM}`};return oS(FC);})();
|
|
48
48
|
return __exports__;
|
|
49
49
|
});
|