@loaders.gl/scene 5.0.0-beta.2 → 5.0.0-beta.5
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 +1 -1
- package/GLTF-README.md +1 -1
- package/OBJ-README.md +1 -1
- package/README.md +6 -1
- package/THIRD-PARTY-NOTICES.md +6 -0
- package/dist/dist.dev.js +6557 -1363
- package/dist/dist.min.js +24 -16
- package/dist/draco/draco-javascript-loader-with-parser.d.ts +2 -2
- package/dist/draco/draco-loader-types.cjs +3 -3
- package/dist/draco/draco-loader-types.cjs.map +2 -2
- package/dist/draco/draco-loader-types.d.ts +1 -1
- package/dist/draco/draco-loader-types.d.ts.map +1 -1
- package/dist/draco/draco-loader-types.js +1 -1
- package/dist/draco/draco-loader-types.js.map +1 -1
- package/dist/draco/draco-loader.d.ts +2 -2
- package/dist/draco/draco-wasm-loader-with-parser.d.ts +2 -2
- package/dist/draco/draco3d-loader-with-parser.d.ts +2 -2
- package/dist/draco/lib/utils/version.cjs +1 -1
- package/dist/draco/lib/utils/version.js +1 -1
- package/dist/draco-worker-node.js +806 -158
- package/dist/draco-worker-node.js.map +4 -4
- package/dist/draco-worker.js +775 -158
- package/dist/draco-worker.js.map +4 -4
- package/dist/draco-writer-worker-node.cjs +2122 -219
- package/dist/draco-writer-worker-node.cjs.map +4 -4
- package/dist/draco-writer-worker.js +2053 -220
- package/dist/draco-writer-worker.js.map +4 -4
- package/dist/gltf/gltf-loader-types.cjs.map +2 -2
- package/dist/gltf/gltf-loader-types.d.ts +6 -0
- package/dist/gltf/gltf-loader-types.d.ts.map +1 -1
- package/dist/gltf/gltf-loader-types.js.map +1 -1
- package/dist/gltf/index.cjs +2 -0
- package/dist/gltf/index.cjs.map +2 -2
- package/dist/gltf/index.d.ts +2 -2
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js +1 -1
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/lib/api/gltf-extensions.cjs +7 -2
- package/dist/gltf/lib/api/gltf-extensions.cjs.map +2 -2
- package/dist/gltf/lib/api/gltf-extensions.d.ts.map +1 -1
- package/dist/gltf/lib/api/gltf-extensions.js +7 -5
- package/dist/gltf/lib/api/gltf-extensions.js.map +1 -1
- package/dist/gltf/lib/extensions/EXT_texture_webp.cjs +1 -0
- package/dist/gltf/lib/extensions/EXT_texture_webp.cjs.map +2 -2
- package/dist/gltf/lib/extensions/EXT_texture_webp.d.ts.map +1 -1
- package/dist/gltf/lib/extensions/EXT_texture_webp.js +3 -0
- package/dist/gltf/lib/extensions/EXT_texture_webp.js.map +1 -1
- package/dist/gltf/lib/extensions/KHR_accessor_float64.cjs +45 -0
- package/dist/gltf/lib/extensions/KHR_accessor_float64.cjs.map +7 -0
- package/dist/gltf/lib/extensions/KHR_accessor_float64.d.ts +6 -0
- package/dist/gltf/lib/extensions/KHR_accessor_float64.d.ts.map +1 -0
- package/dist/gltf/lib/extensions/KHR_accessor_float64.js +20 -0
- package/dist/gltf/lib/extensions/KHR_accessor_float64.js.map +1 -0
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs +23 -7
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs.map +2 -2
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.d.ts +2 -1
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.d.ts.map +1 -1
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js +21 -5
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js.map +1 -1
- package/dist/gltf/lib/extensions/MSFT_texture_dds.cjs +64 -0
- package/dist/gltf/lib/extensions/MSFT_texture_dds.cjs.map +7 -0
- package/dist/gltf/lib/extensions/MSFT_texture_dds.d.ts +12 -0
- package/dist/gltf/lib/extensions/MSFT_texture_dds.d.ts.map +1 -0
- package/dist/gltf/lib/extensions/MSFT_texture_dds.js +39 -0
- package/dist/gltf/lib/extensions/MSFT_texture_dds.js.map +1 -0
- package/dist/gltf/lib/extensions/utils/3d-tiles-utils.cjs +1 -1
- package/dist/gltf/lib/extensions/utils/3d-tiles-utils.cjs.map +2 -2
- package/dist/gltf/lib/extensions/utils/3d-tiles-utils.d.ts.map +1 -1
- package/dist/gltf/lib/extensions/utils/3d-tiles-utils.js +3 -1
- package/dist/gltf/lib/extensions/utils/3d-tiles-utils.js.map +1 -1
- package/dist/gltf/lib/parsers/parse-gltf.cjs +25 -0
- package/dist/gltf/lib/parsers/parse-gltf.cjs.map +2 -2
- package/dist/gltf/lib/parsers/parse-gltf.d.ts +2 -0
- package/dist/gltf/lib/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/lib/parsers/parse-gltf.js +18 -0
- package/dist/gltf/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.cjs +22 -0
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.cjs.map +2 -2
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.d.ts +23 -0
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.js +22 -0
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.js.map +1 -1
- package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.cjs.map +1 -1
- package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.d.ts +1 -1
- package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-extension-schemas.cjs +8 -0
- package/dist/gltf/lib/types/gltf-extension-schemas.cjs.map +2 -2
- package/dist/gltf/lib/types/gltf-extension-schemas.d.ts +27 -0
- package/dist/gltf/lib/types/gltf-extension-schemas.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-extension-schemas.js +8 -1
- package/dist/gltf/lib/types/gltf-extension-schemas.js.map +1 -1
- package/dist/gltf/lib/types/gltf-json-schema.cjs.map +1 -1
- package/dist/gltf/lib/types/gltf-json-schema.d.ts +2 -2
- package/dist/gltf/lib/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-texture-procedurals.cjs +19 -0
- package/dist/gltf/lib/types/gltf-texture-procedurals.cjs.map +7 -0
- package/dist/gltf/lib/types/gltf-texture-procedurals.d.ts +45 -0
- package/dist/gltf/lib/types/gltf-texture-procedurals.d.ts.map +1 -0
- package/dist/gltf/lib/types/gltf-texture-procedurals.js +5 -0
- package/dist/gltf/lib/types/gltf-texture-procedurals.js.map +1 -0
- package/dist/gltf/lib/types/gltf-types.cjs.map +1 -1
- package/dist/gltf/lib/types/gltf-types.d.ts +7 -0
- package/dist/gltf/lib/types/gltf-types.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-version-zod-schemas.d.ts +34 -0
- package/dist/gltf/lib/types/gltf-version-zod-schemas.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-zod-schema.cjs +4 -1
- package/dist/gltf/lib/types/gltf-zod-schema.cjs.map +2 -2
- package/dist/gltf/lib/types/gltf-zod-schema.d.ts +56 -0
- package/dist/gltf/lib/types/gltf-zod-schema.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-zod-schema.js +6 -2
- package/dist/gltf/lib/types/gltf-zod-schema.js.map +1 -1
- package/dist/gltf/lib/utils/version.cjs +1 -1
- package/dist/gltf/lib/utils/version.js +1 -1
- package/dist/gltf/schema.cjs +3 -0
- package/dist/gltf/schema.cjs.map +2 -2
- package/dist/gltf/schema.d.ts +1 -0
- package/dist/gltf/schema.d.ts.map +1 -1
- package/dist/gltf/schema.js +1 -0
- package/dist/gltf/schema.js.map +1 -1
- package/dist/gltf-loader-types.cjs.map +2 -2
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/materialx/parse-materialx.cjs +61 -0
- package/dist/materialx/parse-materialx.cjs.map +7 -0
- package/dist/materialx/parse-materialx.d.ts +23 -0
- package/dist/materialx/parse-materialx.d.ts.map +1 -0
- package/dist/materialx/parse-materialx.js +39 -0
- package/dist/materialx/parse-materialx.js.map +1 -0
- package/dist/materialx/procedural-graph.cjs +77 -0
- package/dist/materialx/procedural-graph.cjs.map +7 -0
- package/dist/materialx/procedural-graph.d.ts +40 -0
- package/dist/materialx/procedural-graph.d.ts.map +1 -0
- package/dist/materialx/procedural-graph.js +59 -0
- package/dist/materialx/procedural-graph.js.map +1 -0
- package/dist/materialx-loader-types.cjs +57 -0
- package/dist/materialx-loader-types.cjs.map +7 -0
- package/dist/materialx-loader-types.d.ts +34 -0
- package/dist/materialx-loader-types.d.ts.map +1 -0
- package/dist/materialx-loader-types.js +20 -0
- package/dist/materialx-loader-types.js.map +1 -0
- package/dist/materialx-loader.cjs +40 -0
- package/dist/materialx-loader.cjs.map +7 -0
- package/dist/materialx-loader.d.ts +19 -0
- package/dist/materialx-loader.d.ts.map +1 -0
- package/dist/materialx-loader.js +14 -0
- package/dist/materialx-loader.js.map +1 -0
- package/dist/mtl-loader-types.cjs +1 -1
- package/dist/obj/mtl-loader-types.cjs +1 -1
- package/dist/obj/mtl-loader-types.js +1 -1
- package/dist/obj/obj-loader-types.cjs +3 -3
- package/dist/obj/obj-loader-types.cjs.map +2 -2
- package/dist/obj/obj-loader-types.d.ts +1 -1
- package/dist/obj/obj-loader-types.d.ts.map +1 -1
- package/dist/obj/obj-loader-types.js +2 -2
- package/dist/obj/obj-loader-types.js.map +1 -1
- package/dist/obj/obj-loader.cjs +5 -5
- package/dist/obj/obj-loader.cjs.map +2 -2
- package/dist/obj/obj-loader.d.ts +1 -1
- package/dist/obj/obj-loader.d.ts.map +1 -1
- package/dist/obj/obj-loader.js +1 -1
- package/dist/obj/obj-loader.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 +3 -3
- package/dist/obj-loader-types.cjs.map +2 -2
- package/dist/obj-loader.cjs +5 -5
- package/dist/obj-loader.cjs.map +2 -2
- package/dist/obj-worker.js +985 -368
- package/dist/obj-writer.cjs +1 -1
- package/dist/stl/parse-stl.cjs +100 -0
- package/dist/stl/parse-stl.cjs.map +7 -0
- package/dist/stl/parse-stl.d.ts +4 -0
- package/dist/stl/parse-stl.d.ts.map +1 -0
- package/dist/stl/parse-stl.js +84 -0
- package/dist/stl/parse-stl.js.map +1 -0
- package/dist/stl-loader-types.cjs +58 -0
- package/dist/stl-loader-types.cjs.map +7 -0
- package/dist/stl-loader-types.d.ts +32 -0
- package/dist/stl-loader-types.d.ts.map +1 -0
- package/dist/stl-loader-types.js +25 -0
- package/dist/stl-loader-types.js.map +1 -0
- package/dist/stl-loader.cjs +38 -0
- package/dist/stl-loader.cjs.map +7 -0
- package/dist/stl-loader.d.ts +17 -0
- package/dist/stl-loader.d.ts.map +1 -0
- package/dist/stl-loader.js +13 -0
- package/dist/stl-loader.js.map +1 -0
- package/dist/usd/index.cjs.map +1 -1
- package/dist/usd/index.d.ts +1 -1
- package/dist/usd/index.d.ts.map +1 -1
- package/dist/usd/lib/parse-usd.cjs +42 -5
- package/dist/usd/lib/parse-usd.cjs.map +2 -2
- package/dist/usd/lib/parse-usd.d.ts.map +1 -1
- package/dist/usd/lib/parse-usd.js +53 -6
- package/dist/usd/lib/parse-usd.js.map +1 -1
- package/dist/usd/lib/parse-usdc.cjs +187 -0
- package/dist/usd/lib/parse-usdc.cjs.map +7 -0
- package/dist/usd/lib/parse-usdc.d.ts +4 -0
- package/dist/usd/lib/parse-usdc.d.ts.map +1 -0
- package/dist/usd/lib/parse-usdc.js +176 -0
- package/dist/usd/lib/parse-usdc.js.map +1 -0
- package/dist/usd/lib/parse-usdz.cjs +22 -0
- package/dist/usd/lib/parse-usdz.cjs.map +2 -2
- package/dist/usd/lib/parse-usdz.d.ts.map +1 -1
- package/dist/usd/lib/parse-usdz.js +26 -0
- package/dist/usd/lib/parse-usdz.js.map +1 -1
- package/dist/usd/lib/usd-types.cjs.map +1 -1
- package/dist/usd/lib/usd-types.d.ts +14 -1
- package/dist/usd/lib/usd-types.d.ts.map +1 -1
- package/dist/usd/lib/usd-types.js +1 -1
- package/dist/usd/lib/usd-types.js.map +1 -1
- package/dist/usd/libs/README.md +27 -0
- package/dist/usd/libs/THREE-LICENSE +21 -0
- package/dist/usd/libs/usdc-parser.d.ts +78 -0
- package/dist/usd/libs/usdc-parser.d.ts.map +1 -0
- package/dist/usd/libs/usdc-parser.js +1669 -0
- package/dist/usd/libs/usdc-parser.js.map +1 -0
- package/dist/usd/usd-loader-types.cjs +4 -4
- package/dist/usd/usd-loader-types.cjs.map +2 -2
- package/dist/usd/usd-loader-types.d.ts +7 -7
- package/dist/usd/usd-loader-types.d.ts.map +1 -1
- package/dist/usd/usd-loader-types.js +6 -6
- package/dist/usd/usd-loader-types.js.map +1 -1
- package/dist/usd/usd-loader.cjs.map +1 -1
- package/dist/usd/usd-loader.d.ts +4 -4
- package/dist/usd/usd-loader.d.ts.map +1 -1
- package/dist/usd/usd-loader.js +2 -2
- package/dist/usd/usd-loader.js.map +1 -1
- package/dist/usd-loader-types.cjs +4 -4
- package/dist/usd-loader-types.cjs.map +2 -2
- package/dist/usd-loader.cjs.map +1 -1
- package/package.json +19 -7
- package/src/draco/draco-loader-types.ts +1 -1
- package/src/gltf/gltf-loader-types.ts +6 -0
- package/src/gltf/index.ts +4 -1
- package/src/gltf/lib/api/gltf-extensions.ts +7 -2
- package/src/gltf/lib/extensions/EXT_texture_webp.ts +3 -0
- package/src/gltf/lib/extensions/KHR_accessor_float64.ts +22 -0
- package/src/gltf/lib/extensions/KHR_gaussian_splatting.ts +31 -7
- package/src/gltf/lib/extensions/MSFT_texture_dds.ts +52 -0
- package/src/gltf/lib/extensions/utils/3d-tiles-utils.ts +5 -1
- package/src/gltf/lib/parsers/parse-gltf.ts +31 -0
- package/src/gltf/lib/types/gltf-additional-extension-schemas.ts +32 -0
- package/src/gltf/lib/types/gltf-ext-gaussian-splatting-schema.ts +1 -1
- package/src/gltf/lib/types/gltf-extension-schemas.ts +12 -0
- package/src/gltf/lib/types/gltf-json-schema.ts +2 -1
- package/src/gltf/lib/types/gltf-texture-procedurals.ts +67 -0
- package/src/gltf/lib/types/gltf-types.ts +8 -0
- package/src/gltf/lib/types/gltf-zod-schema.ts +7 -1
- package/src/gltf/schema.ts +1 -0
- package/src/index.ts +6 -1
- package/src/materialx/README.md +5 -0
- package/src/materialx/parse-materialx.ts +70 -0
- package/src/materialx/procedural-graph.ts +94 -0
- package/src/materialx-loader-types.ts +24 -0
- package/src/materialx-loader.ts +15 -0
- package/src/obj/obj-loader-types.ts +1 -1
- package/src/obj/obj-loader.ts +1 -1
- package/src/stl/parse-stl.ts +90 -0
- package/src/stl-loader-types.ts +28 -0
- package/src/stl-loader.ts +12 -0
- package/src/usd/index.ts +1 -0
- package/src/usd/lib/parse-usd.ts +68 -7
- package/src/usd/lib/parse-usdc.ts +188 -0
- package/src/usd/lib/parse-usdz.ts +28 -0
- package/src/usd/lib/usd-types.ts +16 -2
- package/src/usd/libs/README.md +27 -0
- package/src/usd/libs/THREE-LICENSE +21 -0
- package/src/usd/libs/usdc-parser.d.ts +18 -0
- package/src/usd/libs/usdc-parser.js +1669 -0
- package/src/usd/usd-loader-types.ts +5 -5
- package/src/usd/usd-loader.ts +2 -2
package/dist/dist.min.js
CHANGED
|
@@ -4,46 +4,54 @@
|
|
|
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 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===`
|
|
7
|
+
"use strict";var __exports__=(()=>{var hB=Object.create;var Au=Object.defineProperty;var pB=Object.getOwnPropertyDescriptor;var mB=Object.getOwnPropertyNames;var bB=Object.getPrototypeOf,gB=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 yB=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},J=(r,e)=>{for(var t in e)Au(r,t,{get:e[t],enumerable:!0})},Pw=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of mB(e))!gB.call(r,s)&&s!==t&&Au(r,s,{get:()=>e[s],enumerable:!(n=pB(e,s))||n.enumerable});return r};var wB=(r,e,t)=>(t=r!=null?hB(bB(r)):{},Pw(e||!r||!r.__esModule?Au(t,"default",{value:r,enumerable:!0}):t,r)),xB=r=>Pw(Au({},"__esModule",{value:!0}),r);var jw=yB((TU,Vw)=>{Vw.exports=globalThis.loaders});function Ie(r,e=8){let t=r*e;if(!Number.isSafeInteger(r)||r<0||!Number.isSafeInteger(t)||t>256*1024*1024-Vd)throw new Error("USDC: decoded allocation limit exceeded");return Vd+=t,r}function Tt(r){if(!Number.isSafeInteger(r)||r<0||r>4e6)throw new Error("USDC: decoded allocation limit exceeded");return Ie(r)}function Gw(r,e,t,n,s,i){for(;e<t;){let o=r[e++];if(e>t)throw new Error("USDC: truncated LZ4 token");let a=o>>4;if(a===15){let f;do{if(e>=t)throw new Error("USDC: truncated LZ4 length");f=r[e++],a+=f}while(f===255)}if(a>0){if(e+a>t)throw new Error("USDC: truncated LZ4 literal");for(let f=0;f<a;f++){if(s>=i)throw new Error("USDC: LZ4 output overflow");n[s++]=r[e++]}}if(e>=t)break;if(e+2>t)throw new Error("USDC: truncated LZ4 offset");let c=r[e++]|r[e++]<<8;if(c===0)throw new Error("USDC: invalid LZ4 match offset");let u=(o&15)+4;if(u===19){let f;do{if(e>=t)throw new Error("USDC: truncated LZ4 length");f=r[e++],u+=f}while(f===255)}let l=s-c;if(l<0)throw new Error("USDC: invalid LZ4 match position");for(let f=0;f<u;f++){if(s>=i)throw new Error("USDC: LZ4 output overflow");n[s++]=n[l+f]}}return s}function Gd(r,e,t=!1){let n=new Uint8Array(Ie(e,1));if(!r.length)throw new Error("USDC: missing LZ4 chunk header");let s=r[0];if(s===0){let i=Gw(r,1,r.length,n,0,e);if(!t&&i!==e)throw new Error("USDC: incomplete LZ4 output");return n.subarray(0,i)}else{if(1+s*4>r.length)throw new Error("USDC: truncated LZ4 chunk sizes");let o=1,a=[];for(let l=0;l<s;l++){let f=(r[o]|r[o+1]<<8|r[o+2]<<16|r[o+3]<<24)>>>0;a.push(f),o+=4}let c=o,u=0;for(let l=0;l<s;l++){let f=a[l],d=Math.min(65536,e-u);if(f>r.length-c)throw new Error("USDC: truncated LZ4 chunk");let h=Gw(r,c,c+f,n,u,u+d);if(c+=f,l<s-1&&h!==u+d)throw new Error("USDC: incomplete LZ4 chunk");u=h}if(c!==r.length||!t&&u!==e)throw new Error("USDC: incomplete LZ4 output");return n.subarray(0,u)}}function Lr(r,e){let t=e*4+(e*2+7>>3)+4,n=Gd(new Uint8Array(r),t,!0);return SB(n,e)}function SB(r,e){let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=0,s=t.getInt32(n,!0);n+=4;let i=e*2+7>>3;if(r.length<n+i)throw new Error("USDC: truncated integer codes");let o=n,a=n+i,c=new Int32Array(Ie(e)),u=0,l=o,f=a;for(let d=0;d<e;){let h=r[l++];for(let m=0;m<4&&d<e;m++,d++){let b=h>>m*2&3,g=0;switch(b){case 0:g=s;break;case 1:g=t.getInt8(f),f+=1;break;case 2:g=t.getInt16(f,!0),f+=2;break;case 3:g=t.getInt32(f,!0),f+=4;break}u+=g,c[d]=u}}return c}var Vd,jd,zw,TB,S,_B,AB,vB,IB,zd,ci,vu,Ww=p(()=>{"use strict";Vd=0;jd=new TextDecoder,zw=new Float32Array(32);for(let r=0;r<32;r++)zw[r]=Math.pow(2,r-15);TB=Math.pow(2,-14),S={Invalid:0,Bool:1,UChar:2,Int:3,UInt:4,Int64:5,UInt64:6,Half:7,Float:8,Double:9,String:10,Token:11,AssetPath:12,Matrix2d:13,Matrix3d:14,Matrix4d:15,Quatd:16,Quatf:17,Quath:18,Vec2d:19,Vec2f:20,Vec2h:21,Vec2i:22,Vec3d:23,Vec3f:24,Vec3h:25,Vec3i:26,Vec4d:27,Vec4f:28,Vec4h:29,Vec4i:30,Dictionary:31,TokenListOp:32,StringListOp:33,PathListOp:34,ReferenceListOp:35,IntListOp:36,Int64ListOp:37,UIntListOp:38,UInt64ListOp:39,PathVector:40,TokenVector:41,Specifier:42,Permission:43,Variability:44,VariantSelectionMap:45,TimeSamples:46,Payload:47,DoubleVector:48,LayerOffsetVector:49,StringVector:50,ValueBlock:51,Value:52,UnregisteredValue:53,UnregisteredValueListOp:54,PayloadListOp:55,TimeCode:56,PathExpression:57,Relocates:58,Spline:59,AnimationBlock:60},_B=new Set([S.Int,S.UInt,S.Float,S.Double,S.Half,S.String,S.Token]),AB=4294967295,vB=105,IB=116;zd=class{constructor(e){this.buffer=e,this.view=new DataView(e),this.offset=0}seek(e){if(!Number.isSafeInteger(e)||e<0||e>this.buffer.byteLength)throw new Error("USDC: invalid seek");this.offset=e}tell(){return this.offset}readUint8(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}readInt8(){let e=this.view.getInt8(this.offset);return this.offset+=1,e}readUint16(){let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readInt16(){let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUint32(){let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readInt32(){let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readUint64(){let e=this.view.getUint32(this.offset,!0),t=this.view.getUint32(this.offset+4,!0);this.offset+=8;let n=t*4294967296+e;if(!Number.isSafeInteger(n))throw new Error("USDC: integer exceeds safe precision");return n}readInt64(){let e=this.view.getUint32(this.offset,!0),t=this.view.getInt32(this.offset+4,!0);this.offset+=8;let n=t*4294967296+e;if(!Number.isSafeInteger(n))throw new Error("USDC: integer exceeds safe precision");return n}readFloat32(){let e=this.view.getFloat32(this.offset,!0);return this.offset+=4,e}readFloat64(){let e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readBytes(e){let t=new Uint8Array(this.buffer,this.offset,e);return this.offset+=e,t}readString(e){let t=this.readBytes(e),n=0;for(;n<e&&t[n]!==0;)n++;return jd.decode(t.subarray(0,n))}},ci=class{constructor(e,t){this.lo=e,this.hi=t}get isArray(){return(this.hi&2147483648)!==0}get isInlined(){return(this.hi&1073741824)!==0}get isCompressed(){return(this.hi&536870912)!==0}get typeEnum(){return this.hi>>16&255}get payload(){return this.lo+(this.hi&65535)*4294967296}getInlinedValue(){return this.lo}},vu=class{parseData(e){Vd=0,this._valueReadCount=0,this._activeDictionaries=new Set,this.buffer=e instanceof ArrayBuffer?e:e.buffer,this.reader=new zd(this.buffer),this.version={major:0,minor:0,patch:0},this._conversionBuffer=new ArrayBuffer(4),this._conversionView=new DataView(this._conversionBuffer),this._readBootstrap(),this._readTOC(),this._readTokens(),this._readStrings(),this._readFields(),this._readFieldSets(),this._readPaths(),this._readSpecs(),this.specsByPath=Object.create(null);for(let t of this.specs){let n=this.paths[t.pathIndex];if(!n)continue;let s=this._getFieldsForSpec(t);this.specsByPath[n]={specType:t.specType,fields:s}}return{specsByPath:this.specsByPath}}_readBootstrap(){let e=this.reader;if(e.seek(0),e.readString(8)!=="PXR-USDC")throw new Error("THREE.USDCParser: Not a valid USDC file.");this.version.major=e.readUint8(),this.version.minor=e.readUint8(),this.version.patch=e.readUint8(),e.readBytes(5),this.tocOffset=e.readUint64()}_readTOC(){let e=this.reader;e.seek(this.tocOffset);let t=e.readUint64();if(t>16)throw new Error("USDC: invalid section count");this.sections=Object.create(null);for(let n=0;n<t;n++){let s=e.readString(16),i=e.readUint64(),o=e.readUint64();this.sections[s]={start:i,size:o}}}_readTokens(){let e=this.sections.TOKENS;if(!e)return;let t=this.reader;t.seek(e.start);let n=Tt(t.readUint64());if(this.tokens=[],this.version.major===0&&this.version.minor<4){let s=t.readUint64(),i=t.readBytes(s),o=0;for(let a=0;a<n;a++){let c=o;for(;c<i.length&&i[c]!==0;)c++;if(c>=i.length)throw new Error("USDC: unterminated token data");this.tokens.push(jd.decode(i.subarray(o,c))),o=c+1}}else{let s=t.readUint64(),i=t.readUint64(),o=t.readBytes(i),a=Gd(o,s);Ie(a.length,2);let c=0;for(let u=0;u<n;u++){let l=c;for(;l<a.length&&a[l]!==0;)l++;if(l>=a.length)throw new Error("USDC: unterminated token data");this.tokens.push(jd.decode(a.subarray(c,l))),c=l+1}}}_readStrings(){let e=this.sections.STRINGS;if(!e){this.strings=[];return}let t=this.reader;t.seek(e.start);let n=Tt(t.readUint64());this.strings=[];for(let s=0;s<n;s++)this.strings.push(t.readUint32())}_readFields(){let e=this.sections.FIELDS;if(!e)return;let t=this.reader;if(t.seek(e.start),this.fields=[],this.version.major===0&&this.version.minor<4){let n=Math.floor(e.size/12);for(let s=0;s<n;s++){let i=t.readUint32(),o=t.readUint32(),a=t.readUint32();this.fields.push({tokenIndex:i,valueRep:new ci(o,a)})}}else{let n=Tt(t.readUint64()),s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n),a=t.readUint64(),c=t.readBytes(a),u=Gd(c,n*8),l=new DataView(u.buffer,u.byteOffset,u.byteLength);for(let f=0;f<n;f++){let d=l.getUint32(f*8,!0),h=l.getUint32(f*8+4,!0);this.fields.push({tokenIndex:o[f],valueRep:new ci(d,h)})}}}_readFieldSets(){let e=this.sections.FIELDSETS;if(!e)return;let t=this.reader;if(t.seek(e.start),this.fieldSets=[],this.version.major===0&&this.version.minor<4){let n=Math.floor(e.size/4);for(let s=0;s<n;s++)this.fieldSets.push(t.readUint32())}else{let n=Tt(t.readUint64()),s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n);for(let a=0;a<n;a++)this.fieldSets.push(o[a])}}_readPaths(){let e=this.sections.PATHS;if(!e)return;let t=this.reader;t.seek(e.start);let n=Tt(t.readUint64());if(this.paths=new Array(Ie(n)).fill(""),this.version.major===0&&this.version.minor<4)this._readPathsRecursive("");else{t.readUint64();let s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n),a=t.readUint64(),c=t.readBytes(a),u=Lr(c.buffer.slice(c.byteOffset,c.byteOffset+a),n),l=t.readUint64(),f=t.readBytes(l),d=Lr(f.buffer.slice(f.byteOffset,f.byteOffset+l),n);this._buildPathsFromCompressed(o,u,d)}}_readPathsRecursive(e,t=0){let n=this.reader;if(t>1e3)return;let s=n.readUint32(),i=n.readUint32(),o=n.readUint8(),a=(o&1)!==0,c=(o&2)!==0,u=(o&4)!==0,l;if(e==="")l="/";else{let f=this.tokens[i]||"";u?l=e+"."+f:l=e==="/"?"/"+f:e+"/"+f}if(Ie(l.length,2),this.paths[s]=l,a&&c){let f=n.readUint64();this._readPathsRecursive(l,t+1),n.seek(f),this._readPathsRecursive(e,t+1)}else a?this._readPathsRecursive(l,t+1):c&&this._readPathsRecursive(e,t+1)}_buildPathsFromCompressed(e,t,n){let s=0,i=[{startIndex:0,parentPath:""}];for(;i.length;){let o=i.pop(),a=o.startIndex,c=o.parentPath;for(;a<e.length;){if(++s>e.length*2)throw new Error("USDC: path traversal limit exceeded");let u=a++,l=e[u],f=t[u],d=n[u];if(l<0||l>=this.paths.length||Math.abs(f)>=this.tokens.length||d<-2)throw new Error("USDC: invalid compressed path index");let h;if(c==="")h="/",c=h;else{let g=this.tokens[Math.abs(f)];h=f<0?c+"."+g:c==="/"?"/"+g:c+"/"+g}Ie(h.length,2),this.paths[l]=h;let m=d>0||d===-1,b=d>=0;if((m||b)&&a>=e.length)throw new Error("USDC: missing compressed path entry");if(m&&b){let g=u+d;if(g<=a||g>=e.length)throw new Error("USDC: invalid compressed path jump");i.push({startIndex:g,parentPath:c})}if(m)c=h;else if(!b)break}}}_readSpecs(){let e=this.sections.SPECS;if(!e)return;let t=this.reader;if(t.seek(e.start),this.specs=[],this.version.major===0&&this.version.minor<4){let n=this.version.minor===0&&this.version.patch===1?16:12,s=Math.floor(e.size/n);for(let i=0;i<s;i++){let o=t.readUint32(),a=t.readUint32(),c=t.readUint32();n===16&&t.readUint32(),this.specs.push({pathIndex:o,fieldSetIndex:a,specType:c})}}else{let n=Tt(t.readUint64()),s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n),a=t.readUint64(),c=t.readBytes(a),u=Lr(c.buffer.slice(c.byteOffset,c.byteOffset+a),n),l=t.readUint64(),f=t.readBytes(l),d=Lr(f.buffer.slice(f.byteOffset,f.byteOffset+l),n);for(let h=0;h<n;h++)this.specs.push({pathIndex:o[h],fieldSetIndex:u[h],specType:d[h]})}}_readValue(e){if(this._valueReadCount=(this._valueReadCount||0)+1,this._valueReadCount>1e6)throw new Error("USDC: value traversal limit exceeded");let t=e.typeEnum,n=e.isArray,s=e.isInlined;if(t===S.TimeSamples)return this._readTimeSamples(e);if(s)return this._readInlinedValue(e);let i=e.payload;if(i===0&&n)return[];if(i<0||i>=this.buffer.byteLength)throw new RangeError("USDCParser: Invalid payload offset "+i+" for type "+t+".");let o=this.reader.tell();this.reader.seek(i);let a;return n?a=this._readArrayValue(e):a=this._readScalarValue(t),this.reader.seek(o),a}_readInlinedValue(e){let t=e.typeEnum,n=e.getInlinedValue(),s=this._conversionView;switch(t){case S.Dictionary:if(n!==0)throw new Error("USDC: invalid inline dictionary");return Object.create(null);case S.Bool:return n!==0;case S.UChar:return n&255;case S.Int:case S.Int64:return n|0;case S.UInt:case S.UInt64:return n>>>0;case S.Half:return this._halfToFloat(n&65535);case S.Float:return s.setUint32(0,n,!0),s.getFloat32(0,!0);case S.Double:return s.setUint32(0,n,!0),s.getFloat32(0,!0);case S.Token:return this.tokens[n]||"";case S.String:return this.tokens[this.strings[n]]||"";case S.AssetPath:return this.tokens[n]||"";case S.Specifier:return n;case S.Permission:case S.Variability:return n;case S.Vec2h:return s.setUint32(0,n,!0),[this._halfToFloat(s.getUint16(0,!0)),this._halfToFloat(s.getUint16(2,!0))];case S.Vec2f:case S.Vec2i:return s.setUint32(0,n,!0),[s.getInt8(0),s.getInt8(1)];case S.Vec3f:case S.Vec3i:return s.setUint32(0,n,!0),[s.getInt8(0),s.getInt8(1),s.getInt8(2)];case S.Vec4f:case S.Vec4i:return s.setUint32(0,n,!0),[s.getInt8(0),s.getInt8(1),s.getInt8(2),s.getInt8(3)];case S.Matrix2d:{s.setUint32(0,n,!0);let i=s.getInt8(0),o=s.getInt8(1);return[i,0,0,o]}case S.Matrix3d:{s.setUint32(0,n,!0);let i=s.getInt8(0),o=s.getInt8(1),a=s.getInt8(2);return[i,0,0,0,o,0,0,0,a]}case S.Matrix4d:{s.setUint32(0,n,!0);let i=s.getInt8(0),o=s.getInt8(1),a=s.getInt8(2),c=s.getInt8(3);return[i,0,0,0,0,o,0,0,0,0,a,0,0,0,0,c]}default:throw new Error("USDC: unsupported inline value type "+t)}}_readTimeSamples(e){let t=this.reader,n=e.payload,s=t.tell();t.seek(n);let i=t.tell(),o=t.readInt64();t.seek(i+o);let a=t.readUint32(),c=t.readUint32(),u=new ci(a,c),l=this._readValue(u),f=i+o+8;t.seek(f);let d=t.tell(),h=t.readInt64();t.seek(d+h);let m=Tt(t.readUint64()),b=[];for(let x=0;x<m;x++){let T=t.readUint32(),_=t.readUint32();b.push(new ci(T,_))}let g=[];for(let x=0;x<m;x++)g.push(this._readValue(b[x]));return t.seek(s),{times:l instanceof Float64Array?Array.from(l):Array.isArray(l)?l:[l],values:g}}_readScalarValue(e){let t=this.reader;switch(e){case S.Invalid:return null;case S.Bool:return t.readUint8()!==0;case S.UChar:return t.readUint8();case S.Int:return t.readInt32();case S.UInt:return t.readUint32();case S.Int64:return t.readInt64();case S.UInt64:return t.readUint64();case S.Half:return this._readHalf();case S.Float:return t.readFloat32();case S.Double:return t.readFloat64();case S.String:case S.Token:{let n=t.readUint32();return this.tokens[n]||""}case S.AssetPath:{let n=t.readUint32();return this.tokens[n]||""}case S.Vec2f:return[t.readFloat32(),t.readFloat32()];case S.Vec2d:return[t.readFloat64(),t.readFloat64()];case S.Vec2i:return[t.readInt32(),t.readInt32()];case S.Vec3f:return[t.readFloat32(),t.readFloat32(),t.readFloat32()];case S.Vec3d:return[t.readFloat64(),t.readFloat64(),t.readFloat64()];case S.Vec3i:return[t.readInt32(),t.readInt32(),t.readInt32()];case S.Vec4f:return[t.readFloat32(),t.readFloat32(),t.readFloat32(),t.readFloat32()];case S.Vec4d:return[t.readFloat64(),t.readFloat64(),t.readFloat64(),t.readFloat64()];case S.Quatf:return[t.readFloat32(),t.readFloat32(),t.readFloat32(),t.readFloat32()];case S.Quatd:return[t.readFloat64(),t.readFloat64(),t.readFloat64(),t.readFloat64()];case S.Matrix4d:{let n=[];for(let s=0;s<16;s++)n.push(t.readFloat64());return n}case S.TokenVector:{let n=Tt(t.readUint64()),s=[];for(let i=0;i<n;i++){let o=t.readUint32();s.push(this.tokens[o]||"")}return s}case S.PathVector:{let n=Tt(t.readUint64()),s=[];for(let i=0;i<n;i++){let o=t.readUint32();s.push(this.paths[o]||"")}return s}case S.DoubleVector:{let n=Tt(t.readUint64()),s=new Float64Array(Ie(n));for(let i=0;i<n;i++)s[i]=t.readFloat64();return s}case S.Dictionary:return this._readDictionary();case S.TokenListOp:case S.StringListOp:case S.IntListOp:case S.Int64ListOp:case S.UIntListOp:case S.UInt64ListOp:throw new Error("USDC: value list operations are unsupported");case S.PathListOp:{let n=t.readUint8();if(n&24||(n&102).toString(2).replaceAll("0","").length>1)throw new Error("USDC: compound path list operations are unsupported");let s=(n&2)!==0,i=(n&4)!==0,o=(n&8)!==0,a=(n&16)!==0,c=(n&32)!==0,u=(n&64)!==0,l=()=>{let b=Tt(t.readUint64()),g=[];for(let y=0;y<b;y++){let x=t.readUint32();g.push(this.paths[x])}return g},f=null,d=null,h=null,m=null;return s&&(f=l()),i&&(d=l()),c&&(h=l()),u&&(m=l()),o&&l(),a&&l(),h&&h.length>0?h:f&&f.length>0?f:m&&m.length>0?m:d&&d.length>0?d:null}case S.VariantSelectionMap:{let n=Tt(t.readUint64()),s=Object.create(null);for(let i=0;i<n;i++){let o=t.readUint32(),a=t.readUint32(),c=this.tokens[this.strings[o]],u=this.tokens[this.strings[a]];c&&u&&(s[c]=u)}return s}default:throw new Error("USDC: unsupported encoding: "+["USDCParser: Unsupported scalar type",e].join(" "))}}_readDictionary(){let e=this.reader,t=e.tell();if(this._activeDictionaries||=new Set,this._activeDictionaries.has(t))throw new Error("USDC: cyclic dictionary value");if(this._activeDictionaries.size>=64)throw new Error("USDC: dictionary depth limit exceeded");this._activeDictionaries.add(t);try{let n=Tt(e.readUint64());if(n>Math.floor((this.buffer.byteLength-e.tell())/20))throw new Error("USDC: truncated dictionary entries");let s=Object.create(null);for(let i=0;i<n;i++){let o=e.readUint32(),a=this.tokens[this.strings[o]];if(typeof a!="string"||Object.hasOwn(s,a))throw new Error("USDC: invalid dictionary key");let c=e.tell(),u=e.readInt64();if(u<8)throw new Error("USDC: invalid dictionary value offset");e.seek(c+u);let l=new ci(e.readUint32(),e.readUint32());if(l.typeEnum<S.Bool||l.typeEnum>S.AssetPath&&l.typeEnum!==S.Dictionary||l.isArray&&!_B.has(l.typeEnum))throw new Error("USDC: unsupported dictionary value type");let f=e.tell(),d=this._readValue(l);s[a]=l.typeEnum===S.AssetPath?{assetPath:d}:d,e.seek(f)}return s}finally{this._activeDictionaries.delete(t)}}_readArrayValue(e){let t=this.reader,n=e.typeEnum,s=e.isCompressed,i;if(this.version.major===0&&this.version.minor<7?i=t.readUint32():i=t.readUint64(),!Number.isSafeInteger(i)||i<0)throw new RangeError("USDCParser: Invalid array size "+i+" for type "+n+".");if(i>2147483647)throw new RangeError("USDCParser: Array size "+i+" exceeds implementation limits.");if(i=Tt(i),i===0)return[];if(s)return this._readCompressedArray(n,i);switch(n){case S.Int:{let o=new Int32Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readInt32();return o}case S.UInt:{let o=new Uint32Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readUint32();return o}case S.Float:{let o=new Float32Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readFloat32();return o}case S.Double:{let o=new Float64Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readFloat64();return o}case S.Vec2f:{let o=new Float32Array(Ie(i*2));for(let a=0;a<i*2;a++)o[a]=t.readFloat32();return o}case S.Vec3f:{let o=new Float32Array(Ie(i*3));for(let a=0;a<i*3;a++)o[a]=t.readFloat32();return o}case S.Vec4f:{let o=new Float32Array(Ie(i*4));for(let a=0;a<i*4;a++)o[a]=t.readFloat32();return o}case S.Vec3h:{let o=new Float32Array(Ie(i*3));for(let a=0;a<i*3;a++)o[a]=this._readHalf();return o}case S.Quatf:{let o=new Float32Array(Ie(i*4));for(let a=0;a<i*4;a++)o[a]=t.readFloat32();return o}case S.Quath:{let o=new Float32Array(Ie(i*4));for(let a=0;a<i*4;a++)o[a]=this._readHalf();return o}case S.Matrix4d:{let o=new Float64Array(Ie(i*16));for(let a=0;a<i*16;a++)o[a]=t.readFloat64();return o}case S.String:case S.Token:{let o=[];for(let a=0;a<i;a++){let c=t.readUint32(),u=n===S.String?this.strings[c]:c,l=this.tokens[u];if(typeof l!="string")throw new Error("USDC: invalid string array index");o.push(l)}return o}case S.Half:{let o=new Float32Array(Ie(i));for(let a=0;a<i;a++)o[a]=this._readHalf();return o}default:throw new Error("USDC: unsupported encoding: "+["USDCParser: Unsupported array type",n].join(" "))}}_readCompressedArray(e,t){let n=this.reader;switch(e){case S.Int:case S.UInt:{let s=n.readUint64(),i=n.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),t);return e===S.UInt?new Uint32Array(o.buffer,o.byteOffset,o.length):o}case S.Half:case S.Double:case S.Float:{let s=n.readInt8();if(s===vB){let i=n.readUint64(),o=n.readBytes(i),a=Lr(o.buffer.slice(o.byteOffset,o.byteOffset+i),t),c=e===S.Double?new Float64Array(Ie(t)):new Float32Array(Ie(t));for(let u=0;u<t;u++)c[u]=e===S.Half?this._convertHalfInteger(a[u]):a[u];return c}else if(s===IB){let i=Tt(n.readUint32());if(i===0)throw new Error("USDC: invalid float lookup table");let o=e===S.Double?new Float64Array(Ie(i)):new Float32Array(Ie(i));for(let f=0;f<i;f++)o[f]=e===S.Half?this._readHalf():e===S.Double?n.readFloat64():n.readFloat32();let a=n.readUint64(),c=n.readBytes(a),u=Lr(c.buffer.slice(c.byteOffset,c.byteOffset+a),t),l=e===S.Double?new Float64Array(Ie(t)):new Float32Array(Ie(t));for(let f=0;f<t;f++){if(u[f]<0||u[f]>=i)throw new Error("USDC: invalid float lookup index");l[f]=o[u[f]]}return l}throw new Error("USDC: unsupported encoding: "+["USDCParser: Unknown float compression code",s].join(" "))}default:throw new Error("USDC: unsupported encoding: "+["USDCParser: Unsupported compressed array type",e].join(" "))}}_convertHalfInteger(e){let t=Math.abs(e);if(t<=2048)return e;if(t>=65520)return Math.sign(e)*(1/0);let n=2**(Math.floor(Math.log2(t))-10),s=t/n,i=Math.floor(s),o=s-i,a=o>.5||o===.5&&i%2!==0?i+1:i;return Math.sign(e)*a*n}_readHalf(){return this._halfToFloat(this.reader.readUint16())}_halfToFloat(e){let t=(e&32768)>>15,n=(e&31744)>>10,s=e&1023;return n===0?s===0?t?-0:0:(t?-1:1)*TB*(s/1024):n===31?s?NaN:t?-1/0:1/0:(t?-1:1)*zw[n]*(1+s/1024)}_getFieldsForSpec(e){let t=Object.create(null),n=e.fieldSetIndex,s=1e4,i=0;for(;n<this.fieldSets.length&&i<s;){let o=this.fieldSets[n];if(o===AB||o===-1)break;let a=this.fields[o];if(!a)throw new Error("USDC: invalid field index");if(a){let c=this.tokens[a.tokenIndex],u=this._readValue(a.valueRep);t[c]=u}n++,i++}if(i>=s)throw new Error("USDC: field traversal limit exceeded");return t}}});function qw(r,e){if(r.byteLength<88||r.byteLength>64*1024*1024)throw new Error("USDC: invalid input size");let t=new Uint8Array(r);if(t[8]!==0||t[9]!==8||t[10]!==0)throw new Error("USDC: initial decoder requires crate version 0.8.0");let n=new DataView(r),s=n.getBigUint64(16,!0);if(s>BigInt(r.byteLength-8))throw new Error("USDC: invalid section table");let i=Number(s),o=n.getBigUint64(i,!0);if(o>16n||i+8+Number(o)*32>r.byteLength)throw new Error("USDC: invalid section table length");let a=new Set;for(let f=0;f<Number(o);f++){let d=i+8+f*32,h=t.subarray(d,d+16),m=h.indexOf(0),b=new TextDecoder().decode(h.subarray(0,m<0?h.length:m));if(a.has(b))throw new Error("USDC: duplicate section");a.add(b);let g=n.getBigUint64(d+16,!0),y=n.getBigUint64(d+24,!0);if(g<88n||g+y>BigInt(r.byteLength))throw new Error("USDC: section out of bounds")}for(let f of["TOKENS","STRINGS","FIELDS","FIELDSETS","PATHS","SPECS"])if(!a.has(f))throw new Error("USDC: missing required section");let{specsByPath:c}=new vu().parseData(r),u=new Map;for(let[f,d]of Object.entries(c)){if(d.specType===7&&f==="/"||d.specType===1||d.specType===8)continue;if(d.specType!==6||!/^\/(?:[A-Za-z_][\w:]*\/)*[A-Za-z_][\w:]*$/.test(f))throw new Error("USDC: unsupported prim specification");let h=d.fields,m=h.specifier??0;if(m!==0&&m!==1&&m!==2)throw new Error("USDC: invalid prim specifier");let b=Iu(h,new Set(["specifier","typeName","primChildren","properties"]));u.set(f,{name:f.slice(f.lastIndexOf("/")+1),path:f,sourceUrl:e,type:String(h.typeName||""),specifier:["def","over","class"][m],attributes:Object.create(null),metadata:b,variants:Object.create(null),children:[]})}let l=[];for(let f of u.values()){let d=f.path.slice(0,f.path.lastIndexOf("/"));if(!d)l.push(f);else{let h=u.get(d);if(!h)throw new Error("USDC: missing parent prim");h.children.push(f)}}$w(l,c["/"]?.fields.primChildren);for(let f of u.values())$w(f.children,c[f.path]?.fields.primChildren);for(let[f,d]of Object.entries(c)){if(d.specType!==1&&d.specType!==8)continue;let h=f.indexOf("."),m=u.get(f.slice(0,h));if(h<0||!m)throw new Error("USDC: property has no owning prim");let b=f.slice(h+1),g=d.fields,y=d.specType===8?"rel":String(g.typeName||""),x=Kw(d.specType===8?g.targetPaths:g.default,y),T=Iu(g,new Set(["typeName","default","targetPaths","timeSamples"]));g.timeSamples!==void 0&&(T.timeSamples=EB(g.timeSamples,y)),m.attributes[b]={name:b,type:y,value:x,metadata:T}}return{format:"usdc",url:e,metadata:Iu(c["/"]?.fields||{},new Set(["primChildren"])),rootPrims:l,layers:[]}}function Iu(r,e){let t=Object.create(null);for(let[n,s]of Object.entries(r))e.has(n)||(t[n]=Su(s));return t}function Su(r){if(r==null)return null;if(typeof r=="number"||typeof r=="string"||typeof r=="boolean")return r;if(Array.isArray(r))return r.map(Su);if(ArrayBuffer.isView(r)&&!(r instanceof DataView))return Array.from(r);if(typeof r=="object")return Iu(r,new Set);throw new Error("USDC: unsupported decoded value")}function Kw(r,e){let t=Su(r);if(e==="asset"&&typeof t=="string")return{assetPath:t};if(e==="rel"&&Array.isArray(t))return t.map(s=>typeof s=="string"?{path:s}:s);let n=/^(?:(?:point|normal|vector|color|texCoord)([234])[fdh]|(?:float|double|half|int)([234]))\[\]$/.exec(e);if(n&&Array.isArray(t)){let s=Number(n[1]||n[2]);if(t.length%s)throw new Error("USDC: incomplete vector tuple");let i=[];for(let o=0;o<t.length;o+=s)i.push(t.slice(o,o+s));return i}return t}function $w(r,e){if(e===void 0)return;if(!Array.isArray(e))throw new Error("USDC: invalid primChildren order");let t=new Map(r.map(s=>[s.name,s])),n=[];for(let s of e){let i=typeof s=="string"?t.get(s):void 0;if(!i)throw new Error("USDC: invalid primChildren reference");n.push(i),t.delete(s)}for(let s of t.values())n.push(s);for(let s=0;s<n.length;s++)r[s]=n[s]}function EB(r,e){if(!r||typeof r!="object")throw new Error("USDC: invalid time samples");let t=r,n=Su(t.times);if(!Array.isArray(n)||!Array.isArray(t.values)||n.length!==t.values.length)throw new Error("USDC: invalid time samples");return{times:n,values:t.values.map(s=>Kw(s,e))}}var Xw=p(()=>{"use strict";Ww()});function Hw(r,e){if(!r.trimStart().startsWith("#usda"))throw new Error("OpenUSD ASCII layers must begin with the #usda header.");return new Wd(r,e).parse()}var LB,BB,Wd,$d,Jw=p(()=>{"use strict";LB=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/,BB=new Set(["uniform","varying","custom","prepend","append","add","delete","reorder"]);Wd=class{tokenizer;url;constructor(e,t){this.tokenizer=new $d(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 l=this.parsePrimContents(c);return{name:a,path:c,sourceUrl:this.url,type:o,specifier:n,attributes:l.attributes,metadata:{...u,...l.metadata},variants:l.variants,children:l.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=>!BB.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"}},$d=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(LB);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
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=`
|
|
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 Yw(r){let e=new DataView(r),t=FB(e),n=e.getUint16(t+10,!0),s=e.getUint32(t+16,!0),i=s,o=new Map,a=new TextDecoder,c=0;for(let u=0;u<n;u++){if(s+46>t)throw new Error("USDZ archive contains a truncated ZIP central-directory entry.");if(e.getUint32(s,!0)!==33639248)throw new Error("USDZ archive contains an invalid ZIP central-directory entry.");let l=e.getUint16(s+10,!0),f=e.getUint32(s+20,!0),d=e.getUint32(s+24,!0),h=e.getUint16(s+28,!0),m=e.getUint16(s+30,!0),b=e.getUint16(s+32,!0),g=e.getUint32(s+42,!0);if(s+46+h+m+b>t)throw new Error("USDZ archive contains a truncated ZIP filename or extra field.");let y=a.decode(new Uint8Array(r,s+46,h));if(l!==0)throw new Error(`USDZ entry "${y}" is compressed; USDZ requires stored ZIP entries.`);if(g+30>i||f!==d)throw new Error(`USDZ entry "${y}" has invalid stored ZIP bounds.`);if(e.getUint32(g,!0)!==67324752)throw new Error(`USDZ entry "${y}" has an invalid local ZIP header.`);let x=e.getUint16(g+26,!0),T=e.getUint16(g+28,!0),_=g+30+x+T;if((e.getUint16(s+8,!0)|e.getUint16(g+6,!0))&1)throw new Error(`USDZ entry "${y}" is encrypted.`);if(_+f>i||e.getUint16(g+8,!0)!==0||a.decode(new Uint8Array(r,g+30,x))!==y||o.has(y))throw new Error(`USDZ entry "${y}" has invalid or duplicate stored ZIP data.`);if(c+=f,c>r.byteLength)throw new Error("USDZ archive exceeds its stored data budget.");o.set(y,r.slice(_,_+f)),s+=46+h+m+b}return o}function FB(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 Qw=p(()=>{"use strict"});async function Jd(r,e={},t){let n=RB(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:{...NB,...e.usd}}},i;if(VB(r)){let o=Yw(r),a=o.keys().next().value;if(!a||!/\.(?:usd[ac]?)$/i.test(a))throw new Error("USDZ archive has no supported USD root layer.");let c="https://usd.archive/",u=Object.create(null);for(let[f,d]of o){let h=new URL(f,c);if(f.startsWith("/")||/^[a-z][a-z\d+.-]*:/i.test(f)||f.includes("\\")||/[\u0000-\u001f\u007f]/.test(f)||f.trim()!==f||f.split("/").some(m=>{let b=m.replace(/%2e/gi,".");return b==="."||b===".."})||h.origin!==new URL(c).origin||h.search||h.hash||u[h.href])throw new Error(`USDZ entry "${f}" has an ambiguous package URL.`);s.archiveFiles.set(h.href,d),u[h.href]=DB(f,d)}let l=new URL(a,c).href;i=qd(o.get(a),l),i.format="usdz",i.assets=u}else i=qd(r,n);return i.url&&(tx(i,i.url),s.layers.add(i.url)),s.options.usd?.compose!==!1&&(i.rootPrims=await Kd(i.rootPrims,i.url,{},s,0)),i.layers=Array.from(s.layers),n&&(i.url=n),i}function DB(r,e){let t=r.slice(r.lastIndexOf(".")+1).toLowerCase(),n=t==="png"?"image/png":/^(?:jpe?g)$/.test(t)?"image/jpeg":void 0;return n?{path:r,data:e,mimeType:n}:{path:r,data:e}}function RB(r,e){let t=ex(r);return t||ex(e)||r||e}function ex(r){try{return r?new URL(r).href:void 0}catch{return}}function kB(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 qd(r,e){return Zw.decode(r.slice(0,8))===OB?qw(r,e):Hw(Zw.decode(r),e)}function tx(r,e){let t=[...r.rootPrims];for(;t.length;){let n=t.pop();for(let s of Object.values(n.attributes))s.sourceUrl=e;for(let s of n.children)t.push(s);if("variants"in n)for(let s of Object.values(n.variants))for(let i of Object.values(s))t.push(i)}}async function Kd(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={...PB(o.metadata.variants),...t,...n.options.usd?.variantSelections},u=o.sourceUrl||e,l=ka(o);for(let[d,h]of Object.entries(l.variants)){let m=c[d]||Object.keys(h)[0],b=h[m];b&&(l=Hd(l,{...l,attributes:b.attributes,metadata:b.metadata,children:b.children,variants:{}}))}let f=nx(l);if(n.options.usd?.loadReferences!==!1&&f.length>0)for(let d of f){if(!u)throw new Error("OpenUSD references require a source URL or options.core.baseUrl.");let h=kB(d.assetPath,u),m=await CB(h,n),b=UB(m,d.primPath),g=await Kd(b,h,c,n,s+1);for(let y of g)l=Hd(sx(y,l.path),l)}l.children=await Kd(l.children,u,c,n,s),i.push(l)}return i}async function CB(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=qd(await s,r);return tx(i,r),e.layers.add(r),i})(),e.cache.set(r,t)),t}function UB(r,e){let t=e||r.metadata.defaultPrim;if(typeof t!="string")return r.rootPrims;let n=t.startsWith("/")?t:`/${t}`,s=rx(r.rootPrims,n);return s?[s]:[]}function rx(r,e){for(let t of r){if(t.path===e)return t;let n=rx(t.children,e);if(n)return n}}function nx(r){let e=[];for(let t of[r.metadata.references,r.metadata.payload,r.metadata.payloads])Array.isArray(t)?e.push(...t.filter(Xd)):Xd(t)&&e.push(t);return e}function PB(r){return!r||typeof r!="object"||Array.isArray(r)||Xd(r)?{}:Object.fromEntries(Object.entries(r).filter(e=>typeof e[1]=="string"))}function Xd(r){return!!(r&&typeof r=="object"&&!Array.isArray(r)&&"assetPath"in r)}function ka(r){return{...r,attributes:{...r.attributes},metadata:{...r.metadata},variants:{...r.variants},children:r.children.map(ka)}}function sx(r,e){let t=ka(r);return t.path=e,t.children=t.children.map(n=>sx(n,`${e}/${n.name}`)),t}function Hd(r,e){let t=r.children.map(ka);for(let n of e.children){let s=t.findIndex(i=>i.name===n.name);s>=0?t[s]=Hd(t[s],n):t.push(ka(n))}return{...r,...e,sourceUrl:nx(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 VB(r){return r.byteLength>=4&&new DataView(r).getUint32(0,!0)===MB}var Zw,OB,MB,NB,ix=p(()=>{"use strict";Xw();Jw();Qw();Zw=new TextDecoder,OB="PXR-USDC",MB=67324752;NB={compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}});async function zB(r,e,t){return Jd(new TextEncoder().encode(r).buffer,e,t)}var DU,jB,GB,ox=p(()=>{"use strict";ix();Yd();({preload:DU,...jB}=Na),GB={...jB,parse:Jd,parseText:zB}});var ax={};J(ax,{USDLoaderWithParser:()=>GB});var cx=p(()=>{"use strict";ox()});async function $B(){let{USDLoaderWithParser:r}=await Promise.resolve().then(()=>(cx(),ax));return r}var WB,Na,Yd=p(()=>{"use strict";WB="5.0.0-beta.5";Na={dataType:null,batchType:null,name:"Universal Scene Description",id:"usd",module:"scene",version:WB,extensions:["usd","usda","usdc","usdz"],mimeTypes:["model/vnd.usd","model/vnd.usda","model/vnd.usdc","model/vnd.usdz+zip"],text:!0,binary:!0,tests:["#usda","PXR-USDC","PK"],options:{usd:{compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}},preload:$B}});var ux,lx=p(()=>{"use strict";ux={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]}});function dx(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 F(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(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function fx(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 Y(r){return this instanceof Y?(this.v=r,this):new Y(r)}function _t(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,f)}}function a(h,m){n[h]&&(s[h]=function(b){return new Promise(function(g,y){i.push([h,b,g,y])>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 Y?Promise.resolve(h.value.v).then(l,f):d(i[0][2],h)}function l(h){c("next",h)}function f(h){c("throw",h)}function d(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Ao(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:Y(r[s](o)),done:!1}:i?i(o):o}:i}}function Ht(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 fx=="function"?fx(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 kt=p(()=>{});var hx,vo,qB,Jt,gn=p(()=>{hx=new TextDecoder("utf-8"),vo=hx.decode.bind(hx),qB=new TextEncoder,Jt=r=>qB.encode(r)});var KB,px,qe,At,Yt,Br,br,Eu,Lu,Bu,Fu,Ou,mx,Ca,bx,Mu,gx,Yn=p(()=>{KB=r=>typeof r=="number",px=r=>typeof r=="boolean",qe=r=>typeof r=="function",At=r=>r!=null&&Object(r)===r,Yt=r=>At(r)&&qe(r.then),Br=r=>At(r)&&qe(r[Symbol.iterator]),br=r=>At(r)&&qe(r[Symbol.asyncIterator]),Eu=r=>At(r)&&At(r.schema),Lu=r=>At(r)&&"done"in r&&"value"in r,Bu=r=>At(r)&&qe(r.stat)&&KB(r.fd),Fu=r=>At(r)&&Ca(r.body),Ou=r=>"_getDOMStream"in r&&"_getNodeStream"in r,mx=r=>At(r)&&qe(r.abort)&&qe(r.getWriter)&&!Ou(r),Ca=r=>At(r)&&qe(r.cancel)&&qe(r.getReader)&&!Ou(r),bx=r=>At(r)&&qe(r.end)&&qe(r.write)&&px(r.writable)&&!Ou(r),Mu=r=>At(r)&&qe(r.read)&&qe(r.pipe)&&px(r.readable)&&!Ou(r),gx=r=>At(r)&&qe(r.clear)&&qe(r.bytes)&&qe(r.position)&&qe(r.setPosition)&&qe(r.capacity)&&qe(r.getBufferIdentifier)&&qe(r.createLong)});var nh={};J(nh,{compareArrayLike:()=>rh,joinUint8Arrays:()=>Qt,memcpy:()=>Ua,rebaseValueOffsets:()=>Du,toArrayBufferView:()=>ee,toArrayBufferViewAsyncIterator:()=>Fr,toArrayBufferViewIterator:()=>Xr,toBigInt64Array:()=>Pa,toBigUint64Array:()=>ZB,toFloat32Array:()=>eF,toFloat32ArrayAsyncIterator:()=>bF,toFloat32ArrayIterator:()=>cF,toFloat64Array:()=>tF,toFloat64ArrayAsyncIterator:()=>gF,toFloat64ArrayIterator:()=>uF,toInt16Array:()=>JB,toInt16ArrayAsyncIterator:()=>dF,toInt16ArrayIterator:()=>sF,toInt32Array:()=>ui,toInt32ArrayAsyncIterator:()=>hF,toInt32ArrayIterator:()=>iF,toInt8Array:()=>HB,toInt8ArrayAsyncIterator:()=>fF,toInt8ArrayIterator:()=>nF,toUint16Array:()=>YB,toUint16ArrayAsyncIterator:()=>pF,toUint16ArrayIterator:()=>oF,toUint32Array:()=>QB,toUint32ArrayAsyncIterator:()=>mF,toUint32ArrayIterator:()=>aF,toUint8Array:()=>k,toUint8ArrayAsyncIterator:()=>th,toUint8ArrayIterator:()=>eh,toUint8ClampedArray:()=>rF,toUint8ClampedArrayAsyncIterator:()=>yF,toUint8ClampedArrayIterator:()=>lF});function XB(r){let e=r[0]?[r[0]]:[],t,n,s,i;for(let o,a,c=0,u=0,l=r.length;++c<l;){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 Ua(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=XB(r),n=t.reduce((l,f)=>l+f.byteLength,0),s,i,o,a=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,n);for(let l=t.length;++c<l;){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?Ua(o,i,a):o=i;break}Ua(o||(o=new Uint8Array(u)),i,a),a+=i.length}return[o||new Uint8Array(0),t.slice(c),n-(o?o.byteLength:0)]}function ee(r,e){let t=Lu(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=Jt(t)),t instanceof ArrayBuffer?new r(t):t instanceof Zd?new r(t):gx(t)?ee(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*Xr(r,e){let t=function*(s){yield s},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Zd?t(e):Br(e)?e:t(e);return yield*Qd((function*(s){let i=null;do i=s.next(yield ee(r,i));while(!i.done)})(n[Symbol.iterator]())),new r}function Fr(r,e){return _t(this,arguments,function*(){if(Yt(e))return yield Y(yield Y(yield*Ao(Ht(Fr(r,yield Y(e))))));let n=function(o){return _t(this,arguments,function*(){yield yield Y(yield Y(o))})},s=function(o){return _t(this,arguments,function*(){yield Y(yield*Ao(Ht(Qd((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 Zd?n(e):Br(e)?s(e):br(e)?e:n(e);return yield Y(yield*Ao(Ht(Qd((function(o){return _t(this,arguments,function*(){let a=null;do a=yield Y(o.next(yield yield Y(ee(r,a))));while(!a.done)})})(i[Symbol.asyncIterator]()))))),yield Y(new r)})}function Du(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 rh(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 Zd,HB,JB,ui,Pa,k,YB,QB,ZB,eF,tF,rF,Qd,nF,sF,iF,eh,oF,aF,cF,uF,lF,fF,dF,hF,th,pF,mF,bF,gF,yF,Ke=p(()=>{kt();gn();Yn();Zd=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;HB=r=>ee(Int8Array,r),JB=r=>ee(Int16Array,r),ui=r=>ee(Int32Array,r),Pa=r=>ee(BigInt64Array,r),k=r=>ee(Uint8Array,r),YB=r=>ee(Uint16Array,r),QB=r=>ee(Uint32Array,r),ZB=r=>ee(BigUint64Array,r),eF=r=>ee(Float32Array,r),tF=r=>ee(Float64Array,r),rF=r=>ee(Uint8ClampedArray,r),Qd=r=>(r.next(),r);nF=r=>Xr(Int8Array,r),sF=r=>Xr(Int16Array,r),iF=r=>Xr(Int32Array,r),eh=r=>Xr(Uint8Array,r),oF=r=>Xr(Uint16Array,r),aF=r=>Xr(Uint32Array,r),cF=r=>Xr(Float32Array,r),uF=r=>Xr(Float64Array,r),lF=r=>Xr(Uint8ClampedArray,r);fF=r=>Fr(Int8Array,r),dF=r=>Fr(Int16Array,r),hF=r=>Fr(Int32Array,r),th=r=>Fr(Uint8Array,r),pF=r=>Fr(Uint16Array,r),mF=r=>Fr(Uint32Array,r),bF=r=>Fr(Float32Array,r),gF=r=>Fr(Float64Array,r),yF=r=>Fr(Uint8ClampedArray,r)});function*wF(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=eh(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(l){t=!0,typeof u.throw=="function"&&u.throw(l)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function xF(r){return _t(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 Y(null))||{cmd:"read",size:0});let l=th(r)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.next()):yield Y(l.next(a-c)),!t&&i.byteLength>0&&(s.push(i),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,typeof l.throw=="function"&&(yield Y(l.throw(f)))}finally{n===!1&&typeof l.return=="function"&&(yield Y(l.return(new Uint8Array(0))))}return yield Y(null)})}function TF(r){return _t(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 Y(null))||{cmd:"read",size:0});let l=new ih(r);try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.read()):yield Y(l.read(a-c)),!t&&i.byteLength>0&&(s.push(k(i)),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,yield Y(l.cancel(f))}finally{n===!1?yield Y(l.cancel()):r.locked&&l.releaseLock()}return yield Y(null)})}function _F(r){return _t(this,arguments,function*(){let t=[],n="error",s=!1,i=null,o,a,c=0,u=[],l;function f(){return o==="peek"?Qt(u,a)[0]:([l,u,c]=Qt(u,a),l)}if({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0},r.isTTY)return yield yield Y(new Uint8Array(0)),yield Y(null);try{t[0]=sh(r,"end"),t[1]=sh(r,"error");do{if(t[2]=sh(r,"readable"),[n,i]=yield Y(Promise.race(t.map(h=>h[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(l=k(r.read(a-c)),l.byteLength<a-c&&(l=k(r.read()))):l=k(r.read()),l.byteLength>0&&(u.push(l),c+=l.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield Y(f()));while(a<c)}while(!s)}finally{yield Y(d(t,n==="error"?i:null))}return yield Y(null);function d(h,m){return l=u=null,new Promise((b,g)=>{for(let[y,x]of h)r.off(y,x);try{let y=r.destroy;y&&y.call(r,m),m=void 0}catch(y){m=y||m}finally{m!=null?g(m):b()}})}})}var Qe,Ru,ih,sh,Va=p(()=>{kt();Ke();Qe={fromIterable(r){return Ru(wF(r))},fromAsyncIterable(r){return Ru(xF(r))},fromDOMStream(r){return Ru(TF(r))},fromNodeStream(r){return Ru(_F(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')}},Ru=r=>(r.next(),r);ih=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 F(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 F(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=k(t)),t})}},sh=(r,e)=>{let t=s=>n([e,s]),n;return[e,t,new Promise(s=>(n=s)&&r.once(e,t))]}});var ge,ku=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"})(ge||(ge={}))});var he,oh=p(()=>{(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(he||(he={}))});var le,ah=p(()=>{(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(le||(le={}))});var ye,ch=p(()=>{(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(ye||(ye={}))});var L,ja=p(()=>{(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(L||(L={}))});var ae,uh=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"})(ae||(ae={}))});var Nu=p(()=>{});var Hr,Cu,Uu,Io,lh=p(()=>{Hr=new Int32Array(2),Cu=new Float32Array(Hr.buffer),Uu=new Float64Array(Hr.buffer),Io=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Ga,fh=p(()=>{(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ga||(Ga={}))});var Ze,dh=p(()=>{Nu();fh();lh();Ze=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 Hr[0]=this.readInt32(e),Cu[0]}readFloat64(e){return Hr[Io?0:1]=this.readInt32(e),Hr[Io?1:0]=this.readInt32(e+4),Uu[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){Cu[0]=t,this.writeInt32(e,Hr[0])}writeFloat64(e,t){Uu[0]=t,this.writeInt32(e,Hr[Io?0:1]),this.writeInt32(e+4,Hr[Io?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===Ga.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 li,yx=p(()=>{dh();Nu();li=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=Ze.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=Ze.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 ce=p(()=>{Nu();lh();yx();dh();fh()});var fi,hh=p(()=>{(function(r){r[r.BUFFER=0]="BUFFER"})(fi||(fi={}))});var et,So=p(()=>{(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(et||(et={}))});var yn,ph=p(()=>{ce();hh();So();yn=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):et.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):fi.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,et.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,fi.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 Eo,mh=p(()=>{Eo=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 Lo,bh=p(()=>{Lo=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 ot,gh=p(()=>{ce();ph();mh();bh();ot=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 Lo).__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 Eo).__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 yn).__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 wn,wx=p(()=>{ce();gh();wn=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 ot).__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 Qn,yh=p(()=>{(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Qn||(Qn={}))});var za,xx=p(()=>{(function(r){r[r.DenseArray=0]="DenseArray"})(za||(za={}))});var Mr,Vu=p(()=>{ce();Mr=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 Jr,wh=p(()=>{ce();xx();Vu();Jr=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 Mr).__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):za.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,za.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Oe,Bo=p(()=>{ce();Oe=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 Wa,Tx=p(()=>{ce();Wa=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 $a,_x=p(()=>{ce();$a=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 qa,Ax=p(()=>{ce();qa=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 Zn,xh=p(()=>{ce();ch();Zn=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):ye.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ye.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return r.startDate(e),r.addUnit(e,t),r.endDate(e)}}});var Yr,Th=p(()=>{ce();Yr=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 es,_h=p(()=>{ce();ja();es=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):L.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,L.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return r.startDuration(e),r.addUnit(e,t),r.endDuration(e)}}});var ts,Ah=p(()=>{ce();ts=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 rs,vh=p(()=>{ce();rs=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 ns,Ih=p(()=>{ce();ah();ns=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):le.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,le.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return r.startFloatingPoint(e),r.addPrecision(e,t),r.endFloatingPoint(e)}}});var ss,Sh=p(()=>{ce();uh();ss=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):ae.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ae.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return r.startInterval(e),r.addUnit(e,t),r.endInterval(e)}}});var Ka,vx=p(()=>{ce();Ka=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 Xa,Ix=p(()=>{ce();Xa=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 Ha,Sx=p(()=>{ce();Ha=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 Ja,Ex=p(()=>{ce();Ja=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 is,Eh=p(()=>{ce();is=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 Ya,Lx=p(()=>{ce();Ya=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 Qa,Bx=p(()=>{ce();Qa=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 xn,Lh=p(()=>{ce();ja();xn=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):L.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,L.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 Tn,Bh=p(()=>{ce();ja();Tn=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):L.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,L.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 Dr,Fh=p(()=>{ce();oh();Dr=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):he.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,he.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 Za,Fx=p(()=>{ce();Za=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 ec,Ox=p(()=>{ce();ec=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 z,ju=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"})(z||(z={}))});var at,Oh=p(()=>{ce();wh();Bo();ju();at=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):z.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 Jr).__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 Oe).__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,z.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 Nt,Mh=p(()=>{ce();yh();Oh();Bo();Nt=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):Qn.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new at).__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 Oe).__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,Qn.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 se,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"})(se||(se={}))});var w,re,Me=p(()=>{ku();oh();ah();ch();ja();uh();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"})(w||(w={}));(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(re||(re={}))});var Dh={};J(Dh,{valueToString:()=>Rr});function Rr(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=>Rr(e))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(e,t)=>typeof t=="bigint"?`${t}`:t)}var tc=p(()=>{});function te(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 Rh(r,e){return te(r/e)+te(r%e)/te(e)}var Qr=p(()=>{});var Ch={};J(Ch,{BN:()=>di,bigNumToBigInt:()=>Dx,bigNumToNumber:()=>Nh,bigNumToString:()=>Mo,isArrowBigNumSymbol:()=>Mx});function kr(r,...e){return e.length===0?Object.setPrototypeOf(ee(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}function Fo(...r){return kr.apply(this,r)}function Oo(...r){return kr.apply(this,r)}function rc(...r){return kr.apply(this,r)}function Nh(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 l of o)c|=(l^vF)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let l of o)c|=l*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let l=BigInt("1".padEnd(e+1,"0")),f=c/l,d=a?-(c%l):c%l,h=te(f),m=`${d}`.padStart(e,"0");return+`${a&&h===0?"-":""}${h}.${m}`}return te(c)}function Mo(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return kh(r);let e=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return kh(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`-${kh(e)}`}function Dx(r){return r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Mo(r)}function kh(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 Mx,AF,vF,di,zu=p(()=>{Ke();Qr();Mx=Symbol.for("isArrowBigNum");kr.prototype[Mx]=!0;kr.prototype.toJSON=function(){return`"${Mo(this)}"`};kr.prototype.valueOf=function(r){return Nh(this,r)};kr.prototype.toString=function(){return Mo(this)};kr.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Nh(this);case"string":return Mo(this);case"default":return Dx(this)}return Mo(this)};Object.setPrototypeOf(Fo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Oo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(rc.prototype,Object.create(Uint32Array.prototype));Object.assign(Fo.prototype,kr.prototype,{constructor:Fo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Oo.prototype,kr.prototype,{constructor:Oo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(rc.prototype,kr.prototype,{constructor:rc,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});AF=BigInt(4294967296)*BigInt(4294967296),vF=AF-BigInt(1);di=class r{static new(e,t){switch(t){case!0:return new Fo(e);case!1:return new Oo(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Fo(e)}return e.byteLength===16?new rc(e):new Oo(e)}static signed(e){return new Fo(e)}static unsigned(e){return new Oo(e)}static decimal(e){return new rc(e)}constructor(e,t){return r.new(e,t)}}});function or(r){let e=r;switch(r.typeId){case w.Decimal:return r.bitWidth/32;case w.Interval:return e.unit===ae.MONTH_DAY_NANO?4:1+e.unit;case w.BinaryView:case w.Utf8View:return 16;case w.FixedSizeList:return e.listSize;case w.FixedSizeBinary:return e.byteWidth;default:return 1}}var Rx,kx,Nx,Cx,Ux,Px,Vx,jx,Gx,zx,Wx,$x,qx,Kx,Xx,Hx,Jx,Yx,Qx,Zx,eT,tT,rT,nT,sT,iT,E,Ne,Fe,Zt,er,Pe,tr,rr,nr,vt,Nr,ct,Cr,It,sr,Ct,Z,Ur,ut,St,Pr,lt,Ut,Et,os,as,tt,cs,us,ls,fs,rt,ds,Zr,hs,ps,ft,ms,bs,nc,Lt,sc,ic,oc,ac,je,ir,pe,Bt,_n,gs,Pt,Be,dt,IF,Ge,we=p(()=>{Qr();Me();iT=Symbol.for("apache-arrow/DataType"),E=class r{static isDataType(e){return e?.[iT]===!0}static isNull(e){return e?.typeId===w.Null}static isInt(e){return e?.typeId===w.Int}static isFloat(e){return e?.typeId===w.Float}static isBinary(e){return e?.typeId===w.Binary}static isBinaryView(e){return e?.typeId===w.BinaryView}static isLargeBinary(e){return e?.typeId===w.LargeBinary}static isUtf8(e){return e?.typeId===w.Utf8}static isUtf8View(e){return e?.typeId===w.Utf8View}static isLargeUtf8(e){return e?.typeId===w.LargeUtf8}static isBool(e){return e?.typeId===w.Bool}static isDecimal(e){return e?.typeId===w.Decimal}static isDate(e){return e?.typeId===w.Date}static isTime(e){return e?.typeId===w.Time}static isTimestamp(e){return e?.typeId===w.Timestamp}static isInterval(e){return e?.typeId===w.Interval}static isDuration(e){return e?.typeId===w.Duration}static isList(e){return e?.typeId===w.List}static isLargeList(e){return e?.typeId===w.LargeList}static isStruct(e){return e?.typeId===w.Struct}static isUnion(e){return e?.typeId===w.Union}static isFixedSizeBinary(e){return e?.typeId===w.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===w.FixedSizeList}static isMap(e){return e?.typeId===w.Map}static isDictionary(e){return e?.typeId===w.Dictionary}static isDenseUnion(e){return r.isUnion(e)&&e.mode===he.Dense}static isSparseUnion(e){return r.isUnion(e)&&e.mode===he.Sparse}constructor(e){this.typeId=e}};Rx=Symbol.toStringTag;E[Rx]=(r=>(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[iT]=!0,r[Symbol.toStringTag]="DataType"))(E.prototype);Ne=class extends E{constructor(){super(w.Null)}toString(){return"Null"}};kx=Symbol.toStringTag;Ne[kx]=(r=>r[Symbol.toStringTag]="Null")(Ne.prototype);Fe=class extends E{constructor(e,t){super(w.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}`}};Nx=Symbol.toStringTag;Fe[Nx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Fe.prototype);Zt=class extends Fe{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},er=class extends Fe{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Pe=class extends Fe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},tr=class extends Fe{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},rr=class extends Fe{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},nr=class extends Fe{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},vt=class extends Fe{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Nr=class extends Fe{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Zt.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(er.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Pe.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(tr.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(rr.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(nr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(vt.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Nr.prototype,"ArrayType",{value:BigUint64Array});ct=class extends E{constructor(e){super(w.Float),this.precision=e}get ArrayType(){switch(this.precision){case le.HALF:return Uint16Array;case le.SINGLE:return Float32Array;case le.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Cx=Symbol.toStringTag;ct[Cx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ct.prototype);Cr=class extends ct{constructor(){super(le.HALF)}},It=class extends ct{constructor(){super(le.SINGLE)}},sr=class extends ct{constructor(){super(le.DOUBLE)}};Object.defineProperty(Cr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(It.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(sr.prototype,"ArrayType",{value:Float64Array});Ct=class extends E{constructor(){super(w.Binary)}toString(){return"Binary"}};Ux=Symbol.toStringTag;Ct[Ux]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ct.prototype);Z=class extends E{constructor(){super(w.BinaryView)}toString(){return"BinaryView"}};Px=Symbol.toStringTag;Z.ELEMENT_WIDTH=16;Z.INLINE_CAPACITY=12;Z.LENGTH_OFFSET=0;Z.INLINE_OFFSET=4;Z.BUFFER_INDEX_OFFSET=8;Z.BUFFER_OFFSET_OFFSET=12;Z[Px]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="BinaryView"))(Z.prototype);Ur=class extends E{constructor(){super(w.LargeBinary)}toString(){return"LargeBinary"}};Vx=Symbol.toStringTag;Ur[Vx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Ur.prototype);ut=class extends E{constructor(){super(w.Utf8)}toString(){return"Utf8"}};jx=Symbol.toStringTag;ut[jx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ut.prototype);St=class extends E{constructor(){super(w.Utf8View)}toString(){return"Utf8View"}};Gx=Symbol.toStringTag;St.ELEMENT_WIDTH=Z.ELEMENT_WIDTH;St.INLINE_CAPACITY=Z.INLINE_CAPACITY;St[Gx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8View"))(St.prototype);Pr=class extends E{constructor(){super(w.LargeUtf8)}toString(){return"LargeUtf8"}};zx=Symbol.toStringTag;Pr[zx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Pr.prototype);lt=class extends E{constructor(){super(w.Bool)}toString(){return"Bool"}};Wx=Symbol.toStringTag;lt[Wx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(lt.prototype);Ut=class extends E{constructor(e,t,n=128){super(w.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};$x=Symbol.toStringTag;Ut[$x]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ut.prototype);Et=class extends E{constructor(e){super(w.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ye[this.unit]}>`}get ArrayType(){return this.unit===ye.DAY?Int32Array:BigInt64Array}};qx=Symbol.toStringTag;Et[qx]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Et.prototype);os=class extends Et{constructor(){super(ye.DAY)}},as=class extends Et{constructor(){super(ye.MILLISECOND)}},tt=class extends E{constructor(e,t){super(w.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${L[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Kx=Symbol.toStringTag;tt[Kx]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(tt.prototype);cs=class extends tt{constructor(){super(L.SECOND,32)}},us=class extends tt{constructor(){super(L.MILLISECOND,32)}},ls=class extends tt{constructor(){super(L.MICROSECOND,64)}},fs=class extends tt{constructor(){super(L.NANOSECOND,64)}},rt=class extends E{constructor(e,t){super(w.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${L[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Xx=Symbol.toStringTag;rt[Xx]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(rt.prototype);ds=class extends rt{constructor(e){super(L.SECOND,e)}},Zr=class extends rt{constructor(e){super(L.MILLISECOND,e)}},hs=class extends rt{constructor(e){super(L.MICROSECOND,e)}},ps=class extends rt{constructor(e){super(L.NANOSECOND,e)}},ft=class extends E{constructor(e){super(w.Interval),this.unit=e}toString(){return`Interval<${ae[this.unit]}>`}};Hx=Symbol.toStringTag;ft[Hx]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(ft.prototype);ms=class extends ft{constructor(){super(ae.DAY_TIME)}},bs=class extends ft{constructor(){super(ae.YEAR_MONTH)}},nc=class extends ft{constructor(){super(ae.MONTH_DAY_NANO)}},Lt=class extends E{constructor(e){super(w.Duration),this.unit=e}toString(){return`Duration<${L[this.unit]}>`}};Jx=Symbol.toStringTag;Lt[Jx]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Lt.prototype);sc=class extends Lt{constructor(){super(L.SECOND)}},ic=class extends Lt{constructor(){super(L.MILLISECOND)}},oc=class extends Lt{constructor(){super(L.MICROSECOND)}},ac=class extends Lt{constructor(){super(L.NANOSECOND)}},je=class extends E{constructor(e){super(w.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}};Yx=Symbol.toStringTag;je[Yx]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(je.prototype);ir=class extends E{constructor(e){super(w.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}};Qx=Symbol.toStringTag;ir[Qx]=(r=>(r.children=null,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeList"))(ir.prototype);pe=class extends E{constructor(e){super(w.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};Zx=Symbol.toStringTag;pe[Zx]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(pe.prototype);Bt=class extends E{constructor(e,t,n){super(w.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(" | ")}>`}};eT=Symbol.toStringTag;Bt[eT]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Bt.prototype);_n=class extends Bt{constructor(e,t){super(he.Dense,e,t)}},gs=class extends Bt{constructor(e,t){super(he.Sparse,e,t)}},Pt=class extends E{constructor(e){super(w.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};tT=Symbol.toStringTag;Pt[tT]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Pt.prototype);Be=class extends E{constructor(e,t){super(w.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}>`}};rT=Symbol.toStringTag;Be[rT]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Be.prototype);dt=class extends E{constructor(e,t=!1){var n,s,i;if(super(w.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(", ")}}>`}};nT=Symbol.toStringTag;dt[nT]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(dt.prototype);IF=(r=>()=>++r)(-1),Ge=class extends E{constructor(e,t,n,s){super(w.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=s||!1,this.id=n==null?IF():te(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}>`}};sT=Symbol.toStringTag;Ge[sT]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Ge.prototype)});function SF(r,e,t=!0){return typeof e=="number"?Do(r,e,t):typeof e=="string"&&e in w?Do(r,w[e],t):e&&e instanceof E?Do(r,aT(e),t):e?.type&&e.type instanceof E?Do(r,aT(e.type),t):Do(r,w.NONE,t)}function Do(r,e,t=!0){let n=null;switch(e){case w.Null:n=r.visitNull;break;case w.Bool:n=r.visitBool;break;case w.Int:n=r.visitInt;break;case w.Int8:n=r.visitInt8||r.visitInt;break;case w.Int16:n=r.visitInt16||r.visitInt;break;case w.Int32:n=r.visitInt32||r.visitInt;break;case w.Int64:n=r.visitInt64||r.visitInt;break;case w.Uint8:n=r.visitUint8||r.visitInt;break;case w.Uint16:n=r.visitUint16||r.visitInt;break;case w.Uint32:n=r.visitUint32||r.visitInt;break;case w.Uint64:n=r.visitUint64||r.visitInt;break;case w.Float:n=r.visitFloat;break;case w.Float16:n=r.visitFloat16||r.visitFloat;break;case w.Float32:n=r.visitFloat32||r.visitFloat;break;case w.Float64:n=r.visitFloat64||r.visitFloat;break;case w.Utf8:n=r.visitUtf8;break;case w.LargeUtf8:n=r.visitLargeUtf8;break;case w.Utf8View:n=r.visitUtf8View||r.visitUtf8;break;case w.Binary:n=r.visitBinary;break;case w.LargeBinary:n=r.visitLargeBinary;break;case w.BinaryView:n=r.visitBinaryView||r.visitBinary;break;case w.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case w.Date:n=r.visitDate;break;case w.DateDay:n=r.visitDateDay||r.visitDate;break;case w.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case w.Timestamp:n=r.visitTimestamp;break;case w.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case w.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case w.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case w.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case w.Time:n=r.visitTime;break;case w.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case w.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case w.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case w.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case w.Decimal:n=r.visitDecimal;break;case w.List:n=r.visitList;break;case w.LargeList:n=r.visitLargeList;break;case w.Struct:n=r.visitStruct;break;case w.Union:n=r.visitUnion;break;case w.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case w.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case w.Dictionary:n=r.visitDictionary;break;case w.Interval:n=r.visitInterval;break;case w.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case w.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case w.IntervalMonthDayNano:n=r.visitIntervalMonthDayNano||r.visitInterval;break;case w.Duration:n=r.visitDuration;break;case w.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case w.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case w.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case w.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case w.FixedSizeList:n=r.visitFixedSizeList;break;case w.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${w[e]}'`)}function aT(r){switch(r.typeId){case w.Null:return w.Null;case w.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?w.Int8:w.Uint8;case 16:return t?w.Int16:w.Uint16;case 32:return t?w.Int32:w.Uint32;case 64:return t?w.Int64:w.Uint64}return w.Int}case w.Float:switch(r.precision){case le.HALF:return w.Float16;case le.SINGLE:return w.Float32;case le.DOUBLE:return w.Float64}return w.Float;case w.Binary:return w.Binary;case w.LargeBinary:return w.LargeBinary;case w.BinaryView:return w.BinaryView;case w.Utf8:return w.Utf8;case w.LargeUtf8:return w.LargeUtf8;case w.Utf8View:return w.Utf8View;case w.Bool:return w.Bool;case w.Decimal:return w.Decimal;case w.Time:switch(r.unit){case L.SECOND:return w.TimeSecond;case L.MILLISECOND:return w.TimeMillisecond;case L.MICROSECOND:return w.TimeMicrosecond;case L.NANOSECOND:return w.TimeNanosecond}return w.Time;case w.Timestamp:switch(r.unit){case L.SECOND:return w.TimestampSecond;case L.MILLISECOND:return w.TimestampMillisecond;case L.MICROSECOND:return w.TimestampMicrosecond;case L.NANOSECOND:return w.TimestampNanosecond}return w.Timestamp;case w.Date:switch(r.unit){case ye.DAY:return w.DateDay;case ye.MILLISECOND:return w.DateMillisecond}return w.Date;case w.Interval:switch(r.unit){case ae.DAY_TIME:return w.IntervalDayTime;case ae.YEAR_MONTH:return w.IntervalYearMonth;case ae.MONTH_DAY_NANO:return w.IntervalMonthDayNano}return w.Interval;case w.Duration:switch(r.unit){case L.SECOND:return w.DurationSecond;case L.MILLISECOND:return w.DurationMillisecond;case L.MICROSECOND:return w.DurationMicrosecond;case L.NANOSECOND:return w.DurationNanosecond}return w.Duration;case w.Map:return w.Map;case w.List:return w.List;case w.LargeList:return w.LargeList;case w.Struct:return w.Struct;case w.Union:switch(r.mode){case he.Dense:return w.DenseUnion;case he.Sparse:return w.SparseUnion}return w.Union;case w.FixedSizeBinary:return w.FixedSizeBinary;case w.FixedSizeList:return w.FixedSizeList;case w.Dictionary:return w.Dictionary}throw new Error(`Unrecognized type '${w[r.typeId]}'`)}var R,Vt=p(()=>{Me();we();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 SF(this,e,t)}getVisitFnByTypeId(e,t=!0){return Do(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 Uh={};J(Uh,{float64ToUint16:()=>cc,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 cc(r){if(r!==r)return 32256;cT[0]=r;let e=(Ro[1]&2147483648)>>16&65535,t=Ro[1]&2146435072,n=0;return t>=1089470464?Ro[0]>0?t=31744:(t=(t&2080374784)>>16,n=(Ro[1]&1048575)>>10):t<=1056964608?(n=1048576+(Ro[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(Ro[1]&1048575)+512>>10),e|t|n&65535}var cT,Ro,uc=p(()=>{cT=new Float64Array(1),Ro=new Uint32Array(cT.buffer)});function q(r){return(e,t,n)=>{if(e.setValid(t,n!=null))return r(e,t,n)}}var j,EF,uT,LF,An,Ph,lT,BF,$u,qu,Vh,fT,FF,dT,OF,hT,MF,jh,Ku,Xu,Hu,Ju,Gh,Yu,Qu,Zu,el,zh,Wh,pT,DF,RF,kF,NF,CF,UF,PF,mT,bT,VF,$h,tl,rl,nl,sl,il,ol,al,qh,jF,nt,ar=p(()=>{ht();Vt();Qr();gn();uc();Me();we();j=class extends R{};EF=(r,e,t)=>{r[e]=Math.floor(t/864e5)},uT=(r,e,t,n)=>{if(t+1<e.length){let s=te(e[t]),i=te(e[t+1]);r.set(n.subarray(0,i-s),s)}},LF=({offset:r,values:e},t,n)=>{let s=r+t;n?e[s>>3]|=1<<s%8:e[s>>3]&=~(1<<s%8)},An=({values:r},e,t)=>{r[e]=t},Ph=({values:r},e,t)=>{r[e]=t},lT=({values:r},e,t)=>{r[e]=cc(t)},BF=(r,e,t)=>{switch(r.type.precision){case le.HALF:return lT(r,e,t);case le.SINGLE:case le.DOUBLE:return Ph(r,e,t)}},$u=({values:r},e,t)=>{EF(r,e,t.valueOf())},qu=({values:r},e,t)=>{r[e]=BigInt(t)},Vh=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},fT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,n),FF=r=>{let e=r.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),r.variadicBuffers=e),e},dT=(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=Z.ELEMENT_WIDTH,u=e*c,l=u+c;if(u<0||l>a.length)throw new RangeError(`BinaryView index ${e} out of bounds`);a.fill(0,u,l);let f=new DataView(a.buffer,a.byteOffset+u,c),d=t.length;if(f.setInt32(Z.LENGTH_OFFSET,d,!0),d<=Z.INLINE_CAPACITY){a.set(t,u+Z.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;f.setUint32(Z.INLINE_OFFSET,h>>>0,!0);let m=FF(r),b=t.slice(),g=m.push(b)-1;f.setInt32(Z.BUFFER_INDEX_OFFSET,g,!0),f.setInt32(Z.BUFFER_OFFSET_OFFSET,0,!0)},OF=(r,e,t)=>{let n=t instanceof Uint8Array?t:new Uint8Array(t);dT(r,e,n)},hT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,Jt(n)),MF=(r,e,t)=>{let n=Jt(t);dT(r,e,n)},jh=(r,e,t)=>{r.type.unit===ye.DAY?$u(r,e,t):qu(r,e,t)},Ku=({values:r},e,t)=>{r[e]=BigInt(t/1e3)},Xu=({values:r},e,t)=>{r[e]=BigInt(t)},Hu=({values:r},e,t)=>{r[e]=BigInt(t*1e3)},Ju=({values:r},e,t)=>{r[e]=BigInt(t*1e6)},Gh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Ku(r,e,t);case L.MILLISECOND:return Xu(r,e,t);case L.MICROSECOND:return Hu(r,e,t);case L.NANOSECOND:return Ju(r,e,t)}},Yu=({values:r},e,t)=>{r[e]=t},Qu=({values:r},e,t)=>{r[e]=t},Zu=({values:r},e,t)=>{r[e]=t},el=({values:r},e,t)=>{r[e]=t},zh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Yu(r,e,t);case L.MILLISECOND:return Qu(r,e,t);case L.MICROSECOND:return Zu(r,e,t);case L.NANOSECOND:return el(r,e,t)}},Wh=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},pT=(r,e,t)=>{let n=r.children[0],s=r.valueOffsets,i=nt.getVisitFn(n),o=te(s[e]),a=te(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))},DF=(r,e,t)=>{let n=r.children[0],{valueOffsets:s}=r,i=nt.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},RF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[i]),kF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(i)),NF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(s.name)),CF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[s.name]),UF=(r,e,t)=>{let n=r.type.children.map(i=>nt.getVisitFn(i.type)),s=t instanceof Map?NF(e,t):t instanceof B?kF(e,t):Array.isArray(t)?RF(e,t):CF(e,t);r.type.children.forEach((i,o)=>s(n[o],r.children[o],i,o))},PF=(r,e,t)=>{r.type.mode===he.Dense?mT(r,e,t):bT(r,e,t)},mT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,r.valueOffsets[e],t)},bT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,e,t)},VF=(r,e,t)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[e],t)},$h=(r,e,t)=>{switch(r.type.unit){case ae.YEAR_MONTH:return rl(r,e,t);case ae.DAY_TIME:return tl(r,e,t);case ae.MONTH_DAY_NANO:return nl(r,e,t)}},tl=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},rl=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},nl=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},sl=({values:r},e,t)=>{r[e]=t},il=({values:r},e,t)=>{r[e]=t},ol=({values:r},e,t)=>{r[e]=t},al=({values:r},e,t)=>{r[e]=t},qh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return sl(r,e,t);case L.MILLISECOND:return il(r,e,t);case L.MICROSECOND:return ol(r,e,t);case L.NANOSECOND:return al(r,e,t)}},jF=(r,e,t)=>{let{stride:n}=r,s=r.children[0],i=nt.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))};j.prototype.visitBool=q(LF);j.prototype.visitInt=q(An);j.prototype.visitInt8=q(An);j.prototype.visitInt16=q(An);j.prototype.visitInt32=q(An);j.prototype.visitInt64=q(An);j.prototype.visitUint8=q(An);j.prototype.visitUint16=q(An);j.prototype.visitUint32=q(An);j.prototype.visitUint64=q(An);j.prototype.visitFloat=q(BF);j.prototype.visitFloat16=q(lT);j.prototype.visitFloat32=q(Ph);j.prototype.visitFloat64=q(Ph);j.prototype.visitUtf8=q(hT);j.prototype.visitLargeUtf8=q(hT);j.prototype.visitUtf8View=q(MF);j.prototype.visitBinary=q(fT);j.prototype.visitLargeBinary=q(fT);j.prototype.visitBinaryView=q(OF);j.prototype.visitFixedSizeBinary=q(Vh);j.prototype.visitDate=q(jh);j.prototype.visitDateDay=q($u);j.prototype.visitDateMillisecond=q(qu);j.prototype.visitTimestamp=q(Gh);j.prototype.visitTimestampSecond=q(Ku);j.prototype.visitTimestampMillisecond=q(Xu);j.prototype.visitTimestampMicrosecond=q(Hu);j.prototype.visitTimestampNanosecond=q(Ju);j.prototype.visitTime=q(zh);j.prototype.visitTimeSecond=q(Yu);j.prototype.visitTimeMillisecond=q(Qu);j.prototype.visitTimeMicrosecond=q(Zu);j.prototype.visitTimeNanosecond=q(el);j.prototype.visitDecimal=q(Wh);j.prototype.visitList=q(pT);j.prototype.visitLargeList=q(pT);j.prototype.visitStruct=q(UF);j.prototype.visitUnion=q(PF);j.prototype.visitDenseUnion=q(mT);j.prototype.visitSparseUnion=q(bT);j.prototype.visitDictionary=q(VF);j.prototype.visitInterval=q($h);j.prototype.visitIntervalDayTime=q(tl);j.prototype.visitIntervalYearMonth=q(rl);j.prototype.visitIntervalMonthDayNano=q(nl);j.prototype.visitDuration=q(qh);j.prototype.visitDurationSecond=q(sl);j.prototype.visitDurationMillisecond=q(il);j.prototype.visitDurationMicrosecond=q(ol);j.prototype.visitDurationNanosecond=q(al);j.prototype.visitFixedSizeList=q(jF);j.prototype.visitMap=q(DF);nt=new j});var Vr,ko,en,Kh,Xh,GF,cl=p(()=>{tc();hi();ar();Vr=Symbol.for("parent"),ko=Symbol.for("rowIndex"),en=class{constructor(e,t){return this[Vr]=e,this[ko]=t,new Proxy(this,GF)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ko],t=this[Vr],n=t.type.children,s={};for(let i=-1,o=n.length;++i<o;)s[n[i].name]=ze.visit(t.children[i],e);return s}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Kh(this[Vr],this[ko])}},Kh=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,ze.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(en.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Vr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ko]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Xh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Vr].type.children.map(t=>t.name)}has(e,t){return e[Vr].type.children.some(n=>n.name===t)}getOwnPropertyDescriptor(e,t){if(e[Vr].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[Vr].type.children.findIndex(s=>s.name===t);if(n!==-1){let s=ze.visit(e[Vr].children[n],e[ko]);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Vr].type.children.findIndex(i=>i.name===t);return s!==-1?(nt.visit(e[Vr].children[s],e[ko],n),Reflect.set(e,t,n)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,n):!1}},GF=new Xh});function W(r){return(e,t)=>e.getValid(t)?r(e,t):null}var C,zF,No,WF,$F,gT,qF,yT,wT,ys,KF,xT,XF,TT,_T,HF,AT,JF,YF,QF,ZF,vT,IT,ST,ET,eO,LT,BT,FT,OT,tO,rO,MT,nO,sO,iO,DT,RT,oO,aO,kT,NT,CT,UT,PT,VT,jT,cO,uO,ze,hi=p(()=>{zu();ht();Vt();lc();cl();Qr();gn();uc();Me();C=class extends R{};zF=(r,e)=>864e5*r[e],No=16,WF=12,$F=(r,e)=>null,gT=(r,e,t)=>{if(t+1>=e.length)return null;let n=te(e[t]),s=te(e[t+1]);return r.subarray(n,s)},qF=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},yT=({values:r},e)=>zF(r,e),wT=({values:r},e)=>te(r[e]),ys=({stride:r,values:e},t)=>e[r*t],KF=({stride:r,values:e},t)=>Wu(e[r*t]),xT=({values:r},e)=>r[e],XF=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),TT=({values:r,valueOffsets:e},t)=>gT(r,e,t),_T=(r,e)=>{var t;let n=r.values;if(!n)throw new Error("BinaryView data is missing view buffer");let s=e*No,i=s+No;if(s<0||i>n.length)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${Math.max(0,n.length-s)}`);let o=n.subarray(s,i);if(o.length<No)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${o.length}`);let a=new DataView(n.buffer,o.byteOffset,No),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=WF)return o.subarray(4,4+c);let u=a.getInt32(8,!0),l=a.getInt32(12,!0),f=(t=r.variadicBuffers)===null||t===void 0?void 0:t[u];if(!f)throw new Error(`BinaryView variadic buffer ${u} is missing`);return f.subarray(l,l+c)},HF=(r,e)=>_T(r,e),AT=({values:r,valueOffsets:e},t)=>{let n=gT(r,e,t);return n!==null?vo(n):null},JF=(r,e)=>{let t=_T(r,e);return vo(t)},YF=({values:r},e)=>r[e],QF=({type:r,values:e},t)=>r.precision!==le.HALF?e[t]:Wu(e[t]),ZF=(r,e)=>r.type.unit===ye.DAY?yT(r,e):wT(r,e),vT=({values:r},e)=>1e3*te(r[e]),IT=({values:r},e)=>te(r[e]),ST=({values:r},e)=>Rh(r[e],BigInt(1e3)),ET=({values:r},e)=>Rh(r[e],BigInt(1e6)),eO=(r,e)=>{switch(r.type.unit){case L.SECOND:return vT(r,e);case L.MILLISECOND:return IT(r,e);case L.MICROSECOND:return ST(r,e);case L.NANOSECOND:return ET(r,e)}},LT=({values:r},e)=>r[e],BT=({values:r},e)=>r[e],FT=({values:r},e)=>r[e],OT=({values:r},e)=>r[e],tO=(r,e)=>{switch(r.type.unit){case L.SECOND:return LT(r,e);case L.MILLISECOND:return BT(r,e);case L.MICROSECOND:return FT(r,e);case L.NANOSECOND:return OT(r,e)}},rO=({values:r,stride:e},t)=>di.decimal(r.subarray(e*t,e*(t+1))),MT=(r,e)=>{let{valueOffsets:t,stride:n,children:s}=r,i=te(t[e*n]),o=te(t[e*n+1]),c=s[0].slice(i,o-i);return new B([c])},nO=(r,e)=>{let{valueOffsets:t,children:n}=r,{[e]:s,[e+1]:i}=t,o=n[0];return new yr(o.slice(s,i-s))},sO=(r,e)=>new en(r,e),iO=(r,e)=>r.type.mode===he.Dense?DT(r,e):RT(r,e),DT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,r.valueOffsets[e])},RT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,e)},oO=(r,e)=>{var t;return(t=r.dictionary)===null||t===void 0?void 0:t.get(r.values[e])},aO=(r,e)=>r.type.unit===ae.MONTH_DAY_NANO?CT(r,e):r.type.unit===ae.DAY_TIME?kT(r,e):NT(r,e),kT=({values:r},e)=>r.subarray(2*e,2*(e+1)),NT=({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},CT=({values:r},e)=>r.subarray(4*e,4*(e+1)),UT=({values:r},e)=>r[e],PT=({values:r},e)=>r[e],VT=({values:r},e)=>r[e],jT=({values:r},e)=>r[e],cO=(r,e)=>{switch(r.type.unit){case L.SECOND:return UT(r,e);case L.MILLISECOND:return PT(r,e);case L.MICROSECOND:return VT(r,e);case L.NANOSECOND:return jT(r,e)}},uO=(r,e)=>{let{stride:t,children:n}=r,i=n[0].slice(e*t,t);return new B([i])};C.prototype.visitNull=W($F);C.prototype.visitBool=W(qF);C.prototype.visitInt=W(YF);C.prototype.visitInt8=W(ys);C.prototype.visitInt16=W(ys);C.prototype.visitInt32=W(ys);C.prototype.visitInt64=W(xT);C.prototype.visitUint8=W(ys);C.prototype.visitUint16=W(ys);C.prototype.visitUint32=W(ys);C.prototype.visitUint64=W(xT);C.prototype.visitFloat=W(QF);C.prototype.visitFloat16=W(KF);C.prototype.visitFloat32=W(ys);C.prototype.visitFloat64=W(ys);C.prototype.visitUtf8=W(AT);C.prototype.visitLargeUtf8=W(AT);C.prototype.visitUtf8View=W(JF);C.prototype.visitBinary=W(TT);C.prototype.visitLargeBinary=W(TT);C.prototype.visitBinaryView=W(HF);C.prototype.visitFixedSizeBinary=W(XF);C.prototype.visitDate=W(ZF);C.prototype.visitDateDay=W(yT);C.prototype.visitDateMillisecond=W(wT);C.prototype.visitTimestamp=W(eO);C.prototype.visitTimestampSecond=W(vT);C.prototype.visitTimestampMillisecond=W(IT);C.prototype.visitTimestampMicrosecond=W(ST);C.prototype.visitTimestampNanosecond=W(ET);C.prototype.visitTime=W(tO);C.prototype.visitTimeSecond=W(LT);C.prototype.visitTimeMillisecond=W(BT);C.prototype.visitTimeMicrosecond=W(FT);C.prototype.visitTimeNanosecond=W(OT);C.prototype.visitDecimal=W(rO);C.prototype.visitList=W(MT);C.prototype.visitLargeList=W(MT);C.prototype.visitStruct=W(sO);C.prototype.visitUnion=W(iO);C.prototype.visitDenseUnion=W(DT);C.prototype.visitSparseUnion=W(RT);C.prototype.visitDictionary=W(oO);C.prototype.visitInterval=W(aO);C.prototype.visitIntervalDayTime=W(kT);C.prototype.visitIntervalYearMonth=W(NT);C.prototype.visitIntervalMonthDayNano=W(CT);C.prototype.visitDuration=W(cO);C.prototype.visitDurationSecond=W(UT);C.prototype.visitDurationMillisecond=W(PT);C.prototype.visitDurationMicrosecond=W(VT);C.prototype.visitDurationNanosecond=W(jT);C.prototype.visitFixedSizeList=W(uO);C.prototype.visitMap=W(nO);ze=new C});var ws,Uo,Co,Hh,yr,Jh,Yh,lc=p(()=>{ht();tc();hi();ar();ws=Symbol.for("keys"),Uo=Symbol.for("vals"),Co=Symbol.for("kKeysAsStrings"),Hh=Symbol.for("_kKeysAsStrings"),yr=class{constructor(e){return this[ws]=new B([e.children[0]]).memoize(),this[Uo]=e.children[1],new Proxy(this,new Yh)}get[Co](){return this[Hh]||(this[Hh]=Array.from(this[ws].toArray(),String))}[Symbol.iterator](){return new Jh(this[ws],this[Uo])}get size(){return this[ws].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ws],t=this[Uo],n={};for(let s=-1,i=e.length;++s<i;)n[e.get(s)]=ze.visit(t,s);return n}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Jh=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),ze.visit(this.vals,e)]})}},Yh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Co]}has(e,t){return e[Co].includes(t)}getOwnPropertyDescriptor(e,t){if(e[Co].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Co].indexOf(t);if(n!==-1){let s=ze.visit(Reflect.get(e,Uo),n);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Co].indexOf(t);return s!==-1?(nt.visit(Reflect.get(e,Uo),s,n),Reflect.set(e,t,n)):Reflect.has(e,t)?Reflect.set(e,t,n):!1}};Object.defineProperties(yr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ws]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Uo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hh]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Qh={};J(Qh,{clampRange:()=>fc,createElementComparator:()=>xs,wrapIndex:()=>pi});function fc(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&&(GT=i,i=o,o=GT),o>s&&(o=s),n?n(r,i,o):[i,o]}function xs(r){if(typeof r!=="object"||r===null)return zT(r)?zT: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?rh(r,t):!1:r instanceof Map?fO(r):Array.isArray(r)?lO(r):r instanceof B?dO(r):hO(r,!0)}function lO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r[t]);return ul(e)}function fO(r){let e=-1,t=[];for(let n of r.values())t[++e]=xs(n);return ul(t)}function dO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r.get(t));return ul(e)}function hO(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]=xs(r[t[s]]);return ul(n,t)}function ul(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return pO(r,t);case Map:return WT(r,t,t.keys());case yr:case en:case Object:case void 0:return WT(r,t,e||Object.keys(t))}return t instanceof B?mO(r,t):!1}}function pO(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 mO(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 WT(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(),l=s.next();for(;o<a&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!r[o](c.value));++o,u=n.next(),l=s.next(),c=i.next());return o===a&&u.done&&l.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),i.return&&i.return(),!1)}var GT,pi,zT,Po=p(()=>{ht();lc();cl();Ke();pi=(r,e)=>r<0?e+r:r,zT=r=>r!==r});var Zh={};J(Zh,{BitIterator:()=>tn,getBit:()=>fl,getBool:()=>Vo,packBools:()=>bi,popcnt_array:()=>$T,popcnt_bit_range:()=>dc,popcnt_uint32:()=>ll,setBool:()=>bO,truncateBitmap:()=>mi});function Vo(r,e,t,n){return(t&1<<n)!==0}function fl(r,e,t,n){return(t&1<<n)>>n}function bO(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}function mi(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):bi(new tn(t,r,e,null,Vo)).subarray(0,n)),s}return t}function bi(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 dc(r,e,t){if(t-e<=0)return 0;if(t-e<8){let i=0;for(let o of new tn(r,e,t-e,r,fl))i+=o;return i}let n=t>>3<<3,s=e+(e%8===0?0:8-e%8);return dc(r,e,s)+dc(r,n,t)+$T(r,s>>3,n-s>>3)}function $T(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+=ll(i.getUint32(s)),s+=4;for(;o-s>=2;)n+=ll(i.getUint16(s)),s+=2;for(;o-s>=1;)n+=ll(i.getUint8(s)),s+=1;return n}function ll(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 tn,gi=p(()=>{tn=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 D(r){return yO.visit(r)}var gO,qT,G,ep,yO,wr=p(()=>{ht();Me();we();gi();we();Vt();Ke();gO=-1,qT=Symbol.for("apache-arrow/Data"),G=class r{static isData(e){return e?.[qT]===!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 E.isSparseUnion(e)?this.children.some(t=>t.nullable):E.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(E.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let e=this._nullCount,t;return e<=gO&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-dc(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 l;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=or(e),i&&((l=i[0])&&(this.valueOffsets=l),(l=i[1])&&(this.values=l),(l=i[2])&&(this.nullBitmap=l),(l=i[3])&&(this.typeIds=l)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:t}=this;if(E.isUnion(t)){let n=t,s=this.typeIds[e],i=n.typeIdToChildIndex[s],o=this.children[i],a=this.valueOffsets,c=n.mode===he.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(E.isUnion(s)){let i=s,o=this.typeIds[e],a=i.typeIdToChildIndex[o],c=this.children[a],u=this.valueOffsets,l=i.mode===he.Dense&&u?Number(u[e]):e;n=c.getValid(l),c.setValid(l,t)}else{let{nullBitmap:i}=this,{offset:o,length:a}=this,c=o+e,u=1<<c%8,l=c>>3;(!i||i.byteLength<=l)&&(i=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(i.set(mi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:i})):Object.assign(this,{nullBitmap:i,_nullCount:0}));let f=i[l];n=(f&u)!==0,i[l]=t?f|u:f&~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===w.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(mi(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[re.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[re.TYPE])&&(o[re.TYPE]=i.subarray(e,e+t)),E.isBinaryView(this.type)||E.isUtf8View(this.type)){let a=Z.ELEMENT_WIDTH;(i=o[re.DATA])&&(o[re.DATA]=i.subarray(e*a,(e+t)*a))}else(i=o[re.OFFSET])&&(o[re.OFFSET]=i.subarray(e,e+t+1))||(i=o[re.DATA])&&(o[re.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))}};G.prototype.children=Object.freeze([]);G.prototype[qT]=!0;Object.defineProperty(G,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===G&&G.isData(e)}});ep=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 G(t,n,s,s)}visitBool(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitInt(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitFloat(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitUtf8View(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/St.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinaryView(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/Z.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDate(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTimestamp(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTime(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDecimal(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitLargeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitStruct(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=k(e.nullBitmap),{length:o=s.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,void 0,i],s)}visitUnion(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=ee(t.ArrayType,e.typeIds),{["length"]:o=i.length,["nullCount"]:a=-1}=e;if(E.isSparseUnion(t))return new G(t,n,o,a,[void 0,void 0,void 0,i],s);let c=ui(e.valueOffsets);return new G(t,n,o,a,[c,void 0,void 0,i],s)}visitDictionary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.indices.ArrayType,e.data),{["dictionary"]:o=new B([new r().visit({type:t.dictionary})])}=e,{["length"]:a=i.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[void 0,i,s],[],o)}visitInterval(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDuration(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(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=k(e.nullBitmap),{["length"]:o=s.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(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=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}},yO=new ep});function KT(r){return r.some(e=>e.nullable)}function dl(r){return r.reduce((e,t)=>e+t.nullCount,0)}function hl(r){return r.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(r.length+1))}function pl(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 l=Math.max(0,t-c),f=Math.min(n-c,u);s.push(a.slice(l,f-l))}return s.length===0&&s.push(r[0].slice(0,0)),s}function tp(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 pc(r,e){return r.getValid(e)}function jo(r){function e(t,n,s){return r(t[n],s)}return function(t){let n=this.data;return tp(n,this._offsets,t,e)}}function ml(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=tp(i,this._offsets,n,t);return e=void 0,o}}function bl(r){let e;function t(n,s,i){let o=i,a=0,c=0;for(let u=s-1,l=n.length;++u<l;){let f=n[u];if(~(a=r(f,e,o)))return c+a;o=0,c+=f.length}return-1}return function(n,s){e=n;let i=this.data,o=typeof s!="number"?t(i,0,0):tp(i,this._offsets,s,t);return e=void 0,o}}var hc,gl=p(()=>{hc=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 wO(r,e){return e===null&&r.length>0?0:-1}function xO(r,e){let{nullBitmap:t}=r;if(!t||r.nullCount<=0)return-1;let n=0;for(let s of new tn(t,r.offset+(e||0),r.length,t,Vo)){if(!s)return n;++n}return-1}function X(r,e,t){if(e===void 0)return-1;if(e===null)switch(r.typeId){case w.Union:break;case w.Dictionary:break;default:return xO(r,t)}let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}function XT(r,e,t){let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}var U,yi,yl=p(()=>{Me();Vt();hi();gi();Po();U=class extends R{};U.prototype.visitNull=wO;U.prototype.visitBool=X;U.prototype.visitInt=X;U.prototype.visitInt8=X;U.prototype.visitInt16=X;U.prototype.visitInt32=X;U.prototype.visitInt64=X;U.prototype.visitUint8=X;U.prototype.visitUint16=X;U.prototype.visitUint32=X;U.prototype.visitUint64=X;U.prototype.visitFloat=X;U.prototype.visitFloat16=X;U.prototype.visitFloat32=X;U.prototype.visitFloat64=X;U.prototype.visitUtf8=X;U.prototype.visitLargeUtf8=X;U.prototype.visitUtf8View=X;U.prototype.visitBinary=X;U.prototype.visitLargeBinary=X;U.prototype.visitBinaryView=X;U.prototype.visitFixedSizeBinary=X;U.prototype.visitDate=X;U.prototype.visitDateDay=X;U.prototype.visitDateMillisecond=X;U.prototype.visitTimestamp=X;U.prototype.visitTimestampSecond=X;U.prototype.visitTimestampMillisecond=X;U.prototype.visitTimestampMicrosecond=X;U.prototype.visitTimestampNanosecond=X;U.prototype.visitTime=X;U.prototype.visitTimeSecond=X;U.prototype.visitTimeMillisecond=X;U.prototype.visitTimeMicrosecond=X;U.prototype.visitTimeNanosecond=X;U.prototype.visitDecimal=X;U.prototype.visitList=X;U.prototype.visitLargeList=X;U.prototype.visitStruct=X;U.prototype.visitUnion=X;U.prototype.visitDenseUnion=XT;U.prototype.visitSparseUnion=XT;U.prototype.visitDictionary=X;U.prototype.visitInterval=X;U.prototype.visitIntervalDayTime=X;U.prototype.visitIntervalYearMonth=X;U.prototype.visitIntervalMonthDayNano=X;U.prototype.visitDuration=X;U.prototype.visitDurationSecond=X;U.prototype.visitDurationMillisecond=X;U.prototype.visitDurationMicrosecond=X;U.prototype.visitDurationNanosecond=X;U.prototype.visitFixedSizeList=X;U.prototype.visitMap=X;yi=new U});function $(r){let{type:e}=r;if(r.nullCount===0&&r.stride===1&&(E.isInt(e)&&e.bitWidth!==64||E.isTime(e)&&e.bitWidth!==64||E.isFloat(e)&&e.precision!==le.HALF))return new hc(r.data.length,n=>{let s=r.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let t=0;return new hc(r.data.length,n=>{let i=r.data[n].length,o=r.slice(t,t+i);return t+=i,new rp(o)})}var P,rp,Go,wl=p(()=>{Vt();Me();we();gl();P=class extends R{};rp=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}};P.prototype.visitNull=$;P.prototype.visitBool=$;P.prototype.visitInt=$;P.prototype.visitInt8=$;P.prototype.visitInt16=$;P.prototype.visitInt32=$;P.prototype.visitInt64=$;P.prototype.visitUint8=$;P.prototype.visitUint16=$;P.prototype.visitUint32=$;P.prototype.visitUint64=$;P.prototype.visitFloat=$;P.prototype.visitFloat16=$;P.prototype.visitFloat32=$;P.prototype.visitFloat64=$;P.prototype.visitUtf8=$;P.prototype.visitLargeUtf8=$;P.prototype.visitUtf8View=$;P.prototype.visitBinary=$;P.prototype.visitLargeBinary=$;P.prototype.visitBinaryView=$;P.prototype.visitFixedSizeBinary=$;P.prototype.visitDate=$;P.prototype.visitDateDay=$;P.prototype.visitDateMillisecond=$;P.prototype.visitTimestamp=$;P.prototype.visitTimestampSecond=$;P.prototype.visitTimestampMillisecond=$;P.prototype.visitTimestampMicrosecond=$;P.prototype.visitTimestampNanosecond=$;P.prototype.visitTime=$;P.prototype.visitTimeSecond=$;P.prototype.visitTimeMillisecond=$;P.prototype.visitTimeMicrosecond=$;P.prototype.visitTimeNanosecond=$;P.prototype.visitDecimal=$;P.prototype.visitList=$;P.prototype.visitLargeList=$;P.prototype.visitStruct=$;P.prototype.visitUnion=$;P.prototype.visitDenseUnion=$;P.prototype.visitSparseUnion=$;P.prototype.visitDictionary=$;P.prototype.visitInterval=$;P.prototype.visitIntervalDayTime=$;P.prototype.visitIntervalYearMonth=$;P.prototype.visitIntervalMonthDayNano=$;P.prototype.visitDuration=$;P.prototype.visitDurationSecond=$;P.prototype.visitDurationMillisecond=$;P.prototype.visitDurationMicrosecond=$;P.prototype.visitDurationNanosecond=$;P.prototype.visitFixedSizeList=$;P.prototype.visitMap=$;Go=new P});function rn(r){if(r){if(r instanceof G)return new B([r]);if(r instanceof B)return new B(r.data);if(r.type instanceof E)return new B([D(r)]);if(Array.isArray(r))return new B(r.flatMap(e=>TO(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 B([D(Object.assign(Object.assign({},e),{type:new Zt}))]);if(r instanceof Int16Array)return new B([D(Object.assign(Object.assign({},e),{type:new er}))]);if(r instanceof Int32Array)return new B([D(Object.assign(Object.assign({},e),{type:new Pe}))]);if(r instanceof BigInt64Array)return new B([D(Object.assign(Object.assign({},e),{type:new tr}))]);if(r instanceof Uint8Array||r instanceof Uint8ClampedArray)return new B([D(Object.assign(Object.assign({},e),{type:new rr}))]);if(r instanceof Uint16Array)return new B([D(Object.assign(Object.assign({},e),{type:new nr}))]);if(r instanceof Uint32Array)return new B([D(Object.assign(Object.assign({},e),{type:new vt}))]);if(r instanceof BigUint64Array)return new B([D(Object.assign(Object.assign({},e),{type:new Nr}))]);if(r instanceof Float32Array)return new B([D(Object.assign(Object.assign({},e),{type:new It}))]);if(r instanceof Float64Array)return new B([D(Object.assign(Object.assign({},e),{type:new sr}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function TO(r){return r instanceof G?[r]:r instanceof B?r.data:rn(r).data}var HT,JT,YT,QT,B,xl,ht=p(()=>{Me();Po();we();wr();gl();hi();ar();yl();wl();we();JT=Symbol.for("apache-arrow/Vector"),YT={},QT={},B=class r{static isVector(e){return e?.[JT]===!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 G)))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}=YT[o.typeId],l=i[0];this.isValid=f=>pc(l,f),this.get=f=>a(l,f),this.set=(f,d)=>c(l,f,d),this.indexOf=f=>u(l,f),this._offsets=[0,l.length];break}default:Object.setPrototypeOf(this,QT[o.typeId]),this._offsets=hl(i);break}this.data=i,this.type=o,this.stride=or(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 KT(this.data)}get nullCount(){return dl(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${w[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(pi(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Go.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(fc(this,e,t,({data:n,_offsets:s},i,o)=>pl(n,s,i,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:s,ArrayType:i}=this;switch(e.typeId){case w.Int:case w.Float:case w.Decimal:case w.Time:case w.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 E.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(E.isDictionary(this.type)){let e=new xl(this.data[0].dictionary),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return new xl(this)}unmemoize(){if(E.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}};HT=Symbol.toStringTag;B[HT]=(r=>{r.type=E.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0,r[JT]=!0;let e=Object.keys(w).map(t=>w[t]).filter(t=>typeof t=="number"&&t!==w.NONE);for(let t of e){let n=ze.getVisitFnByTypeId(t),s=nt.getVisitFnByTypeId(t),i=yi.getVisitFnByTypeId(t);YT[t]={get:n,set:s,indexOf:i},QT[t]=Object.create(r,{isValid:{value:jo(pc)},get:{value:jo(ze.getVisitFnByTypeId(t))},set:{value:ml(nt.getVisitFnByTypeId(t))},indexOf:{value:bl(yi.getVisitFnByTypeId(t))}})}return"Vector"})(B.prototype);Object.defineProperty(B,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===B&&B.isVector(e)}});xl=class r extends B{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 B(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function ZT(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
13
|
switch (x) {${t.map(n=>`
|
|
14
|
-
case ${
|
|
14
|
+
case ${_O(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 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`[
|
|
18
|
+
return true;`)}function _O(r){return typeof r!="bigint"?Rr(r):`${Rr(r)}n`}var e0=p(()=>{tc()});function np(r,e){let t=Math.ceil(r)*e-1;return(t-t%64+64||64)/e}function t0(r,e=0){return r.length>=e?r.subarray(0,e):Ua(new r.constructor(e),r,0)}var jt,vn,zo,Ts,jr=p(()=>{Ke();jt=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?np(n*1,this.BYTES_PER_ELEMENT):np(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=np(e*this.stride,this.BYTES_PER_ELEMENT);let t=t0(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=t0(this.buffer,e)}},vn=class extends jt{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}},zo=class extends vn{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()}},Ts=class extends vn{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 Te,We,pt,Se=p(()=>{ht();wr();lc();we();e0();jr();Te=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=or(e),this._nulls=new zo,t&&t.length>0&&(this._isValid=ZT(t))}toVector(){return new B([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:l,_nulls:f}=this;(t=c?.flush(o))?s=u?.flush(o):(s=u?.flush(o))?e=l?.flush(u.last()):e=l?.flush(o),a>0&&(n=f?.flush(o));let d=this.children.map(h=>h.flush());return this.clear(),D({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}};Te.prototype.length=1;Te.prototype.stride=1;Te.prototype.children=null;Te.prototype.finished=!1;Te.prototype.nullValues=null;Te.prototype._isValid=()=>!0;We=class extends Te{constructor(e){super(e),this._values=new vn(this.ArrayType,0,this.stride)}setValue(e,t){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,t)}},pt=class extends Te{constructor(e){super(e),this._pendingLength=0,this._offsets=new Ts(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 yr?t[ws].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 wi,sp=p(()=>{wi=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 cr,r0=p(()=>{ce();sp();Bo();ku();Mh();cr=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):ge.V1}schema(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}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new wi).__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 wi).__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 Oe).__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,ge.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 Tl(r,e){return new Map([...r||new Map,...e||new Map])}function ip(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let i=r[t].type;if(E.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&&ip(i.children,e)}return e}var n0,s0,Q,O,mt=p(()=>{Me();we();n0=Symbol.for("apache-arrow/Schema"),s0=Symbol.for("apache-arrow/Field"),Q=class r{static isSchema(e){return e?.[n0]===!0}constructor(e=[],t,n,s=ge.V5){this.fields=e||[],this.metadata=t||new Map,n||(n=ip(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=Tl(Tl(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:Tl(Tl(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=ip(i,new Map);return new r([...n,...i],s,new Map([...this.dictionaries,...o]))}};Q.prototype.fields=null;Q.prototype.metadata=null;Q.prototype.dictionaries=null;Q.prototype[n0]=!0;Object.defineProperty(Q,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Q&&Q.isSchema(e)}});O=class r{static isField(e){return e?.[s0]===!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)}};O.prototype.type=null;O.prototype.name=null;O.prototype.nullable=null;O.prototype.metadata=null;O.prototype[s0]=!0;Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===O&&O.isField(e)}})});var AO,vO,In,op,Gr,ap=p(()=>{sp();r0();ce();mt();Me();Ke();Qr();AO=li,vO=Ze,In=class{static decode(e){e=new vO(k(e));let t=cr.getRootAsFooter(e),n=Q.decode(t.schema(),new Map,t.version());return new op(n,t)}static encode(e){let t=new AO,n=Q.encode(t,e.schema);cr.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())Gr.encode(t,o);let s=t.endVector();cr.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())Gr.encode(t,o);let i=t.endVector();return cr.startFooter(t),cr.addSchema(t,n),cr.addVersion(t,ge.V5),cr.addRecordBatches(t,s),cr.addDictionaries(t,i),cr.finishFooterBuffer(t,cr.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=ge.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}},op=class extends In{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 Gr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return Gr.decode(t)}return null}},Gr=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 wi.createBlock(e,s,n,i)}constructor(e,t,n){this.metaDataLength=e,this.offset=te(n),this.bodyLength=te(t)}}});var ur,i0=p(()=>{ce();Bo();Gu();ku();ur=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):ge.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):se.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 Oe).__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,ge.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,se.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 cp,_l,o0=p(()=>{Vt();Lx();Vu();Ih();Tx();_x();vx();Ax();Fx();Ox();Sx();Th();xh();Lh();Bh();Sh();_h();Ex();Ix();Bx();Fh();wh();Ah();vh();Eh();cp=class extends R{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Ya.startNull(t),Ya.endNull(t)}visitInt(e,t){return Mr.startInt(t),Mr.addBitWidth(t,e.bitWidth),Mr.addIsSigned(t,e.isSigned),Mr.endInt(t)}visitFloat(e,t){return ns.startFloatingPoint(t),ns.addPrecision(t,e.precision),ns.endFloatingPoint(t)}visitBinary(e,t){return Wa.startBinary(t),Wa.endBinary(t)}visitBinaryView(e,t){return $a.startBinaryView(t),$a.endBinaryView(t)}visitLargeBinary(e,t){return Ka.startLargeBinary(t),Ka.endLargeBinary(t)}visitBool(e,t){return qa.startBool(t),qa.endBool(t)}visitUtf8(e,t){return Za.startUtf8(t),Za.endUtf8(t)}visitUtf8View(e,t){return ec.startUtf8View(t),ec.endUtf8View(t)}visitLargeUtf8(e,t){return Ha.startLargeUtf8(t),Ha.endLargeUtf8(t)}visitDecimal(e,t){return Yr.startDecimal(t),Yr.addScale(t,e.scale),Yr.addPrecision(t,e.precision),Yr.addBitWidth(t,e.bitWidth),Yr.endDecimal(t)}visitDate(e,t){return Zn.startDate(t),Zn.addUnit(t,e.unit),Zn.endDate(t)}visitTime(e,t){return xn.startTime(t),xn.addUnit(t,e.unit),xn.addBitWidth(t,e.bitWidth),xn.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return Tn.startTimestamp(t),Tn.addUnit(t,e.unit),n!==void 0&&Tn.addTimezone(t,n),Tn.endTimestamp(t)}visitInterval(e,t){return ss.startInterval(t),ss.addUnit(t,e.unit),ss.endInterval(t)}visitDuration(e,t){return es.startDuration(t),es.addUnit(t,e.unit),es.endDuration(t)}visitList(e,t){return Ja.startList(t),Ja.endList(t)}visitLargeList(e,t){return Xa.startLargeList(t),Xa.endLargeList(t)}visitStruct(e,t){return Qa.startStruct_(t),Qa.endStruct_(t)}visitUnion(e,t){Dr.startTypeIdsVector(t,e.typeIds.length);let n=Dr.createTypeIdsVector(t,e.typeIds);return Dr.startUnion(t),Dr.addMode(t,e.mode),Dr.addTypeIds(t,n),Dr.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Jr.startDictionaryEncoding(t),Jr.addId(t,BigInt(e.id)),Jr.addIsOrdered(t,e.isOrdered),n!==void 0&&Jr.addIndexType(t,n),Jr.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return ts.startFixedSizeBinary(t),ts.addByteWidth(t,e.byteWidth),ts.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return rs.startFixedSizeList(t),rs.addListSize(t,e.listSize),rs.endFixedSizeList(t)}visitMap(e,t){return is.startMap(t),is.addKeysSorted(t,e.keysSorted),is.endMap(t)}},_l=new cp});function l0(r,e=new Map){return new Q(IO(r,e),Al(r.metadata),e)}function up(r){return new $e(r.count,d0(r.columns),h0(r.columns),null,p0(r.columns))}function f0(r){return new bt(up(r.data),r.id,r.isDelta)}function IO(r,e){return(r.fields||[]).filter(Boolean).map(t=>O.fromJSON(t,e))}function a0(r,e){return(r.children||[]).filter(Boolean).map(t=>O.fromJSON(t,e))}function d0(r){return(r||[]).reduce((e,t)=>[...e,new xr(t.count,SO(t.VALIDITY)),...d0(t.children)],[])}function h0(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let s=r[t];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=h0(s.children,e)}return e}function SO(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function p0(r){return(r||[]).reduce((e,t)=>[...e,...t.VARIADIC_DATA_BUFFERS?[t.VARIADIC_DATA_BUFFERS.length]:[],...p0(t.children)],[])}function m0(r,e){let t,n,s,i,o,a;return!e||!(i=r.dictionary)?(o=u0(r,a0(r,e)),s=new O(r.name,o,r.nullable,Al(r.metadata))):e.has(t=i.id)?(n=(n=i.indexType)?c0(n):new Pe,a=new Ge(e.get(t),n,t,i.isOrdered),s=new O(r.name,a,r.nullable,Al(r.metadata))):(n=(n=i.indexType)?c0(n):new Pe,e.set(t,o=u0(r,a0(r,e))),a=new Ge(o,n,t,i.isOrdered),s=new O(r.name,a,r.nullable,Al(r.metadata))),s||null}function Al(r=[]){return new Map(r.map(({key:e,value:t})=>[e,t]))}function c0(r){return new Fe(r.isSigned,r.bitWidth)}function u0(r,e){let t=r.type.name;switch(t){case"NONE":return new Ne;case"null":return new Ne;case"binary":return new Ct;case"largebinary":return new Ur;case"binaryview":return new Z;case"utf8":return new ut;case"largeutf8":return new Pr;case"utf8view":return new St;case"bool":return new lt;case"list":return new je((e||[])[0]);case"largelist":return new ir((e||[])[0]);case"struct":return new pe(e||[]);case"struct_":return new pe(e||[])}switch(t){case"int":{let n=r.type;return new Fe(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new ct(le[n.precision])}case"decimal":{let n=r.type;return new Ut(n.scale,n.precision,n.bitWidth)}case"date":{let n=r.type;return new Et(ye[n.unit])}case"time":{let n=r.type;return new tt(L[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new rt(L[n.unit],n.timezone)}case"interval":{let n=r.type;return new ft(ae[n.unit])}case"duration":{let n=r.type;return new Lt(L[n.unit])}case"union":{let n=r.type,[s,...i]=(n.mode+"").toLowerCase(),o=s.toUpperCase()+i.join("");return new Bt(he[o],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new Pt(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Be(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new dt((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}var b0=p(()=>{mt();we();_s();Me()});function BO(r,e){return(()=>{switch(e){case se.Schema:return Q.fromJSON(r);case se.RecordBatch:return $e.fromJSON(r);case se.DictionaryBatch:return bt.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${se[e]}, type: ${e} }`)})}function FO(r,e){return(()=>{switch(e){case se.Schema:return Q.decode(r.header(new Nt),new Map,r.version());case se.RecordBatch:return $e.decode(r.header(new ot),r.version());case se.DictionaryBatch:return bt.decode(r.header(new wn),r.version())}throw new Error(`Unrecognized Message type: { name: ${se[e]}, type: ${e} }`)})}function OO(r,e=new Map,t=ge.V5){let n=PO(r,e);return new Q(n,vl(r),e,t)}function MO(r,e=ge.V5){return new $e(r.length(),NO(r),CO(r,e),x0(r.compression()),UO(r))}function DO(r,e=ge.V5){return new bt($e.decode(r.data(),e),r.id(),r.isDelta())}function RO(r){return new Ce(r.offset(),r.length())}function kO(r){return new xr(r.length(),r.nullCount())}function NO(r){let e=[];for(let t,n=-1,s=-1,i=r.nodesLength();++n<i;)(t=r.nodes(n))&&(e[++s]=xr.decode(t));return e}function CO(r,e){let t=[];for(let n,s=-1,i=-1,o=r.buffersLength();++s<o;)(n=r.buffers(s))&&(e<ge.V4&&(n.bb_pos+=8*(s+1)),t[++i]=Ce.decode(n));return t}function UO(r){let e=[],t=Math.trunc(r.variadicBufferCountsLength());for(let n=0;n<t;++n)e.push(te(r.variadicBufferCounts(n)));return e}function PO(r,e){let t=[];for(let n,s=-1,i=-1,o=r.fieldsLength();++s<o;)(n=r.fields(s))&&(t[++i]=O.decode(n,e));return t}function g0(r,e){let t=[];for(let n,s=-1,i=-1,o=r.childrenLength();++s<o;)(n=r.children(s))&&(t[++i]=O.decode(n,e));return t}function VO(r,e){let t,n,s,i,o,a;return!e||!(a=r.dictionary())?(s=w0(r,g0(r,e)),n=new O(r.name(),s,r.nullable(),vl(r))):e.has(t=te(a.id()))?(i=(i=a.indexType())?y0(i):new Pe,o=new Ge(e.get(t),i,t,a.isOrdered()),n=new O(r.name(),o,r.nullable(),vl(r))):(i=(i=a.indexType())?y0(i):new Pe,e.set(t,s=w0(r,g0(r,e))),o=new Ge(s,i,t,a.isOrdered()),n=new O(r.name(),o,r.nullable(),vl(r))),n||null}function vl(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 jO(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 y0(r){return new Fe(r.isSigned(),r.bitWidth())}function w0(r,e){let t=r.typeType();switch(t){case z.NONE:return new Ne;case z.Null:return new Ne;case z.Binary:return new Ct;case z.LargeBinary:return new Ur;case z.BinaryView:return new Z;case z.Utf8:return new ut;case z.LargeUtf8:return new Pr;case z.Utf8View:return new St;case z.Bool:return new lt;case z.List:return new je((e||[])[0]);case z.LargeList:return new ir((e||[])[0]);case z.Struct_:return new pe(e||[])}switch(t){case z.Int:{let n=r.type(new Mr);return new Fe(n.isSigned(),n.bitWidth())}case z.FloatingPoint:{let n=r.type(new ns);return new ct(n.precision())}case z.Decimal:{let n=r.type(new Yr);return new Ut(n.scale(),n.precision(),n.bitWidth())}case z.Date:{let n=r.type(new Zn);return new Et(n.unit())}case z.Time:{let n=r.type(new xn);return new tt(n.unit(),n.bitWidth())}case z.Timestamp:{let n=r.type(new Tn);return new rt(n.unit(),n.timezone())}case z.Interval:{let n=r.type(new ss);return new ft(n.unit())}case z.Duration:{let n=r.type(new es);return new Lt(n.unit())}case z.Union:{let n=r.type(new Dr);return new Bt(n.mode(),n.typeIdsArray()||[],e||[])}case z.FixedSizeBinary:{let n=r.type(new ts);return new Pt(n.byteWidth())}case z.FixedSizeList:{let n=r.type(new rs);return new Be(n.listSize(),(e||[])[0])}case z.Map:{let n=r.type(new is);return new dt((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${z[t]}" (${t})`)}function x0(r){return r?new xi(r.codec(),r.method()):null}function GO(r,e){let t=e.fields.map(i=>O.encode(r,i));Nt.startFieldsVector(r,t.length);let n=Nt.createFieldsVector(r,t),s=e.metadata&&e.metadata.size>0?Nt.createCustomMetadataVector(r,[...e.metadata].map(([i,o])=>{let a=r.createString(`${i}`),c=r.createString(`${o}`);return Oe.startKeyValue(r),Oe.addKey(r,a),Oe.addValue(r,c),Oe.endKeyValue(r)})):-1;return Nt.startSchema(r),Nt.addFields(r,n),Nt.addEndianness(r,XO?Qn.Little:Qn.Big),s!==-1&&Nt.addCustomMetadata(r,s),Nt.endSchema(r)}function zO(r,e){let t=-1,n=-1,s=-1,i=e.type,o=e.typeId;E.isDictionary(i)?(o=i.dictionary.typeId,s=_l.visit(i,r),n=_l.visit(i.dictionary,r)):n=_l.visit(i,r);let a=(i.children||[]).map(l=>O.encode(r,l)),c=at.createChildrenVector(r,a),u=e.metadata&&e.metadata.size>0?at.createCustomMetadataVector(r,[...e.metadata].map(([l,f])=>{let d=r.createString(`${l}`),h=r.createString(`${f}`);return Oe.startKeyValue(r),Oe.addKey(r,d),Oe.addValue(r,h),Oe.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),at.startField(r),at.addType(r,n),at.addTypeType(r,o),at.addChildren(r,c),at.addNullable(r,!!e.nullable),t!==-1&&at.addName(r,t),s!==-1&&at.addDictionary(r,s),u!==-1&&at.addCustomMetadata(r,u),at.endField(r)}function WO(r,e){let t=e.nodes||[],n=e.buffers||[],s=e.variadicBufferCounts||[];ot.startNodesVector(r,t.length);for(let u of t.slice().reverse())xr.encode(r,u);let i=r.endVector();ot.startBuffersVector(r,n.length);for(let u of n.slice().reverse())Ce.encode(r,u);let o=r.endVector(),a=null;e.compression!==null&&(a=T0(r,e.compression));let c=-1;return s.length>0&&(c=ot.createVariadicBufferCountsVector(r,s.map(BigInt))),ot.startRecordBatch(r),ot.addLength(r,BigInt(e.length)),ot.addNodes(r,i),ot.addBuffers(r,o),e.compression!==null&&a&&ot.addCompression(r,a),c!==-1&&ot.addVariadicBufferCounts(r,c),ot.endRecordBatch(r)}function T0(r,e){return yn.startBodyCompression(r),yn.addCodec(r,e.type),yn.addMethod(r,e.method),yn.endBodyCompression(r)}function $O(r,e){let t=$e.encode(r,e.data);return wn.startDictionaryBatch(r),wn.addId(r,BigInt(e.id)),wn.addIsDelta(r,e.isDelta),wn.addData(r,t),wn.endDictionaryBatch(r)}function qO(r,e){return Lo.createFieldNode(r,BigInt(e.length),BigInt(e.nullCount))}function KO(r,e){return Eo.createBuffer(r,BigInt(e.offset),BigInt(e.length))}var EO,LO,gt,$e,bt,Ce,xr,xi,XO,_s=p(()=>{ce();Mh();Vu();gh();wx();mh();Oh();bh();ju();Bo();yh();Ih();Th();xh();Lh();Bh();Sh();_h();Fh();Ah();vh();Eh();i0();ph();hh();mt();Ke();Qr();Me();o0();b0();we();EO=li,LO=Ze,gt=class r{static fromJSON(e,t){let n=new r(0,ge.V5,t);return n._createHeader=BO(e,t),n}static decode(e){e=new LO(k(e));let t=ur.getRootAsMessage(e),n=t.bodyLength(),s=t.version(),i=t.headerType(),o=jO(t),a=new r(n,s,i,void 0,o);return a._createHeader=FO(t,i),a}static encode(e){let t=new EO,n=-1;e.isSchema()?n=Q.encode(t,e.header()):e.isRecordBatch()?n=$e.encode(t,e.header()):e.isDictionaryBatch()&&(n=bt.encode(t,e.header()));let s=e.metadata&&e.metadata.size>0?ur.createCustomMetadataVector(t,[...e.metadata].map(([i,o])=>{let a=t.createString(`${i}`),c=t.createString(`${o}`);return Oe.startKeyValue(t),Oe.addKey(t,a),Oe.addValue(t,c),Oe.endKeyValue(t)})):-1;return ur.startMessage(t),ur.addVersion(t,ge.V5),ur.addHeader(t,n),ur.addHeaderType(t,e.headerType),ur.addBodyLength(t,BigInt(e.bodyLength)),s!==-1&&ur.addCustomMetadata(t,s),ur.finishMessageBuffer(t,ur.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof Q)return new r(0,ge.V5,se.Schema,e);if(e instanceof $e)return new r(t,ge.V5,se.RecordBatch,e,e.metadata);if(e instanceof bt)return new r(t,ge.V5,se.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===se.Schema}isRecordBatch(){return this.headerType===se.RecordBatch}isDictionaryBatch(){return this.headerType===se.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=te(e),this._metadata=i||new Map}},$e=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=te(e),this._compression=s,this._variadicBufferCounts=i,this._metadata=o||new Map}},bt=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=te(t)}},Ce=class{constructor(e,t){this.offset=te(e),this.length=te(t)}},xr=class{constructor(e,t){this.length=te(e),this.nullCount=te(t)}},xi=class{constructor(e,t=fi.BUFFER){this.type=e,this.method=t}};O.encode=zO;O.decode=VO;O.fromJSON=m0;Q.encode=GO;Q.decode=OO;Q.fromJSON=l0;$e.encode=WO;$e.decode=MO;$e.fromJSON=up;bt.encode=$O;bt.decode=DO;bt.fromJSON=f0;xr.encode=qO;xr.decode=kO;Ce.encode=KO;Ce.decode=RO;xi.encode=T0;xi.decode=x0;XO=(()=>{let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})()});var Ee,mc,Ti,Il,bc=p(()=>{kt();Va();Ee=Object.freeze({done:!0,value:void 0}),mc=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Ti=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())}},Il=class extends Ti{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return F(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(Ee);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Qe.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Qe.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return F(this,void 0,void 0,function*(){return yield this.abort(e),Ee})}return(e){return F(this,void 0,void 0,function*(){return yield this.close(),Ee})}read(e){return F(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return F(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(Ee)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Tr,_r,Gt,lp,Sn,As=p(()=>{kt();Va();gn();bc();Ke();Yn();Tr=class extends Il{write(e){if((e=k(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?vo(this.toUint8Array(!0)):this.toUint8Array(!1).then(vo)}toUint8Array(e=!1){return e?Qt(this._values)[0]:F(this,void 0,void 0,function*(){var t,n,s,i;let o=[],a=0;try{for(var c=!0,u=Ht(this),l;l=yield u.next(),t=l.done,!t;c=!0){i=l.value,c=!1;let f=i;o.push(f),a+=f.byteLength}}catch(f){n={error:f}}finally{try{!c&&!t&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return Qt(o,a)[0]})}},_r=class{constructor(e){e&&(this.source=new lp(Qe.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)}},Gt=class r{constructor(e){e instanceof r?this.source=e.source:e instanceof Tr?this.source=new Sn(Qe.fromAsyncIterable(e)):Mu(e)?this.source=new Sn(Qe.fromNodeStream(e)):Ca(e)?this.source=new Sn(Qe.fromDOMStream(e)):Fu(e)?this.source=new Sn(Qe.fromDOMStream(e.body)):Br(e)?this.source=new Sn(Qe.fromIterable(e)):Yt(e)?this.source=new Sn(Qe.fromAsyncIterable(e)):br(e)&&(this.source=new Sn(Qe.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)}},lp=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)||Ee)}return(e){return Object.create(this.source.return&&this.source.return(e)||Ee)}},Sn=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return F(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return F(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return F(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return F(this,arguments,void 0,function*(t,n="read"){return yield this.source.next({cmd:n,size:t})})}throw(e){return F(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Ee;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return F(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Ee;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}});var gc,vs,fp=p(()=>{kt();As();Ke();gc=class extends _r{constructor(e,t){super(),this.position=0,this.buffer=k(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}}},vs=class extends Gt{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=F(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return F(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 F(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 F(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 F(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 F(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return F(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return F(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var hp={};J(hp,{BaseInt64:()=>yc,Int128:()=>wc,Int64:()=>En,Uint64:()=>De});function Wo(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var $o,dp,yc,De,En,wc,pp=p(()=>{$o=8,dp=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],yc=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`${Wo(this.buffer[1])} ${Wo(this.buffer[0])}`}},De=class r extends yc{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=$o<n-i?$o:n-i,a=new r(new Uint32Array([Number.parseInt(e.slice(i,i+o),10),0])),c=new r(new Uint32Array([dp[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)}},En=class r extends yc{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=$o<s-o?$o:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0])),u=new r(new Uint32Array([dp[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)}},wc=class r{constructor(e){this.buffer=e}high(){return new En(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new En(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 De(new Uint32Array([this.buffer[3],0])),n=new De(new Uint32Array([this.buffer[2],0])),s=new De(new Uint32Array([this.buffer[1],0])),i=new De(new Uint32Array([this.buffer[0],0])),o=new De(new Uint32Array([e.buffer[3],0])),a=new De(new Uint32Array([e.buffer[2],0])),c=new De(new Uint32Array([e.buffer[1],0])),u=new De(new Uint32Array([e.buffer[0],0])),l=De.multiply(i,u);this.buffer[0]=l.low();let f=new De(new Uint32Array([l.high(),0]));return l=De.multiply(s,u),f.plus(l),l=De.multiply(i,c),f.plus(l),this.buffer[1]=f.low(),this.buffer[3]=f.lessThan(l)?1:0,this.buffer[2]=f.high(),new De(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(De.multiply(n,u)).plus(De.multiply(s,c)).plus(De.multiply(i,a)),this.buffer[3]+=De.multiply(t,u).plus(De.multiply(n,c)).plus(De.multiply(s,a)).plus(De.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`${Wo(this.buffer[3])} ${Wo(this.buffer[2])} ${Wo(this.buffer[1])} ${Wo(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=$o<s-o?$o:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0,0,0])),u=new r(new Uint32Array([dp[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 wp={};J(wp,{toIntervalDayTimeInt32Array:()=>mp,toIntervalDayTimeObjects:()=>gp,toIntervalMonthDayNanoInt32Array:()=>bp,toIntervalMonthDayNanoObjects:()=>yp});function mp(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 bp(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 gp(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 yp(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 Sl=p(()=>{});function A0(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 HO(r){return A0(r.join(""))}function v0(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 JO(r){return v0(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 YO(r){return v0(r,e=>new TextEncoder().encode(e))}var qo,El,Ll,I0=p(()=>{wr();mt();we();Vt();gi();gn();pp();Me();Ke();Sl();qo=class extends R{constructor(e,t,n,s,i=ge.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 O?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return D({type:e,length:t})}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({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 D({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 D({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({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 D({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 D({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitFixedSizeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({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 D({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 D({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<ge.V5&&this.readNullBitmap(e,n),e.mode===he.Sparse?this.visitSparseUnion(e,{length:t,nullCount:n}):this.visitDenseUnion(e,{length:t,nullCount:n})}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({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 D({type:e,length:t,nullCount:n,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({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 D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDuration(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({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 D({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)}},El=class extends qo{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):bi(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return ee(Uint8Array,ee(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return ee(Uint8Array,ee(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;if(E.isTimestamp(e))return ee(Uint8Array,En.convertArray(n[t]));if((E.isInt(e)||E.isTime(e))&&e.bitWidth===64||E.isDuration(e))return ee(Uint8Array,En.convertArray(n[t]));if(E.isDate(e)&&e.unit===ye.MILLISECOND)return ee(Uint8Array,En.convertArray(n[t]));if(E.isDecimal(e))return ee(Uint8Array,wc.convertArray(n[t]));if(E.isBinary(e)||E.isLargeBinary(e)||E.isFixedSizeBinary(e))return HO(n[t]);if(E.isBinaryView(e))return JO(n[t]);if(E.isUtf8View(e))return YO(n[t]);if(E.isBool(e))return bi(n[t]);if(E.isUtf8(e)||E.isLargeUtf8(e))return Jt(n[t].join(""));if(E.isInterval(e))switch(e.unit){case ae.DAY_TIME:return mp(n[t]);case ae.MONTH_DAY_NANO:return bp(n[t]);default:break}return ee(Uint8Array,ee(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(A0(i))}return t}};Ll=class extends qo{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 Ln,Bl=p(()=>{jr();Se();Ke();Ln=class extends pt{constructor(e){super(e),this._values=new jt(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,k(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 Bn,Fl=p(()=>{Ke();jr();Se();Bn=class extends pt{constructor(e){super(e),this._values=new jt(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,k(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 _i,xp=p(()=>{jr();Se();_i=class extends Te{constructor(e){super(e),this._values=new zo}setValue(e,t){this._values.set(e,+t)}}});var nn,Is,Ss,Tp=p(()=>{Se();ar();nn=class extends We{};nn.prototype._setValue=jh;Is=class extends nn{};Is.prototype._setValue=$u;Ss=class extends nn{};Ss.prototype._setValue=qu});var Es,_p=p(()=>{Se();ar();Es=class extends We{};Es.prototype._setValue=Wh});var Ai,Ap=p(()=>{we();Se();xc();Ai=class extends Te{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new Ge(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=zr({type:this.type.indices,nullValues:t}),this.dictionary=zr({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 Ls,vp=p(()=>{Se();ar();Ls=class extends We{};Ls.prototype._setValue=Vh});var vi,Ip=p(()=>{mt();Se();we();vi=class extends Te{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 Be(this.type.listSize,new O(t,e.type,!0)),n}}});var sn,Ii,Si,Ei,Sp=p(()=>{uc();Se();sn=class extends We{setValue(e,t){this._values.set(e,t)}},Ii=class extends sn{setValue(e,t){super.setValue(e,cc(t))}},Si=class extends sn{},Ei=class extends sn{}});var Wr,Bs,Fs,Os,Ep=p(()=>{Se();ar();Wr=class extends We{};Wr.prototype._setValue=$h;Bs=class extends Wr{};Bs.prototype._setValue=tl;Fs=class extends Wr{};Fs.prototype._setValue=rl;Os=class extends Wr{};Os.prototype._setValue=nl});var Ar,Ms,Ds,Rs,ks,Lp=p(()=>{Se();ar();Ar=class extends We{};Ar.prototype._setValue=qh;Ms=class extends Ar{};Ms.prototype._setValue=sl;Ds=class extends Ar{};Ds.prototype._setValue=il;Rs=class extends Ar{};Rs.prototype._setValue=ol;ks=class extends Ar{};ks.prototype._setValue=al});var Ft,Li,Bi,Fi,Oi,Mi,Di,Ri,ki,Bp=p(()=>{Se();Ft=class extends We{setValue(e,t){this._values.set(e,t)}},Li=class extends Ft{},Bi=class extends Ft{},Fi=class extends Ft{},Oi=class extends Ft{},Mi=class extends Ft{},Di=class extends Ft{},Ri=class extends Ft{},ki=class extends Ft{}});var Ni,Fp=p(()=>{mt();we();jr();Se();Ni=class extends pt{constructor(e){super(e),this._offsets=new Ts(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 je(new O(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 Ci,Op=p(()=>{mt();we();jr();Qr();Se();Ci=class extends pt{constructor(e){super(e),this._offsets=new Ts(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 ir(new O(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=te(t.set(s,BigInt(a)).buffer[s]);for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Ui,Mp=p(()=>{mt();we();Se();Ui=class extends pt{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 dt(new O(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 Pi,Dp=p(()=>{Se();Pi=class extends Te{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}}});var Vi,Rp=p(()=>{mt();Se();we();Vi=class extends Te{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 pe([...this.type.children,new O(t,e.type,!0)]),n}}});var vr,Ns,Cs,Us,Ps,kp=p(()=>{Se();ar();vr=class extends We{};vr.prototype._setValue=Gh;Ns=class extends vr{};Ns.prototype._setValue=Ku;Cs=class extends vr{};Cs.prototype._setValue=Xu;Us=class extends vr{};Us.prototype._setValue=Hu;Ps=class extends vr{};Ps.prototype._setValue=Ju});var Ir,Vs,js,Gs,zs,Np=p(()=>{Se();ar();Ir=class extends We{};Ir.prototype._setValue=zh;Vs=class extends Ir{};Vs.prototype._setValue=Yu;js=class extends Ir{};js.prototype._setValue=Qu;Gs=class extends Ir{};Gs.prototype._setValue=Zu;zs=class extends Ir{};zs.prototype._setValue=el});var Fn,ji,Gi,Cp=p(()=>{mt();jr();Se();we();Fn=class extends Te{constructor(e){super(e),this._typeIds=new vn(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 O(t,e.type)];return this.type=new Bt(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.")}},ji=class extends Fn{},Gi=class extends Fn{constructor(e){super(e),this._offsets=new vn(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 Ws,Up=p(()=>{gn();Bl();jr();Se();Ws=class extends pt{constructor(e){super(e),this._values=new jt(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,Jt(t))}_flushPending(e,t){}};Ws.prototype._flushPending=Ln.prototype._flushPending});var $s,Pp=p(()=>{gn();jr();Se();Fl();$s=class extends pt{constructor(e){super(e),this._values=new jt(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,Jt(t))}_flushPending(e,t){}};$s.prototype._flushPending=Bn.prototype._flushPending});var On,Ol=p(()=>{we();Se();jr();Ke();wr();On=class extends Te{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new jt(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)*Z.ELEMENT_WIDTH,i=this._views.length;s>i&&this._views.reserve(s-i);let o=this._views.buffer,a=e*Z.ELEMENT_WIDTH,c=new DataView(o.buffer,o.byteOffset+a,Z.ELEMENT_WIDTH);if(c.setInt32(Z.LENGTH_OFFSET,n,!0),n<=Z.INLINE_CAPACITY){o.set(t,a+Z.INLINE_OFFSET);for(let u=n;u<Z.INLINE_CAPACITY;u++)o[a+Z.INLINE_OFFSET+u]=0}else{let u=new DataView(t.buffer,t.byteOffset,Math.min(4,n));c.setUint32(Z.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 jt(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(t,this._currentBufferOffset),c.setInt32(Z.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Z.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(e){return k(e)}setValid(e,t){let n=(e+1)*Z.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*Z.ELEMENT_WIDTH;for(let c=0;c<Z.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*Z.ELEMENT_WIDTH),a=n>0?i.flush(t):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),D({type:e,length:t,nullCount:n,nullBitmap:a,views:o,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var zi,Vp=p(()=>{Ol();gn();zi=class extends On{constructor(e){super(e)}setValue(e,t){return this.writeBinaryValue(e,Jt(t))}}});var jp,S0,E0=p(()=>{Vt();Bl();Fl();xp();Tp();_p();Ap();vp();Ip();Sp();Ep();Lp();Bp();Fp();Op();Mp();Dp();Rp();kp();Np();Cp();Up();Pp();Ol();Vp();jp=class extends R{visitNull(){return Pi}visitBool(){return _i}visitInt(){return Ft}visitInt8(){return Li}visitInt16(){return Bi}visitInt32(){return Fi}visitInt64(){return Oi}visitUint8(){return Mi}visitUint16(){return Di}visitUint32(){return Ri}visitUint64(){return ki}visitFloat(){return sn}visitFloat16(){return Ii}visitFloat32(){return Si}visitFloat64(){return Ei}visitUtf8(){return Ws}visitLargeUtf8(){return $s}visitBinary(){return Ln}visitLargeBinary(){return Bn}visitFixedSizeBinary(){return Ls}visitDate(){return nn}visitDateDay(){return Is}visitDateMillisecond(){return Ss}visitTimestamp(){return vr}visitTimestampSecond(){return Ns}visitTimestampMillisecond(){return Cs}visitTimestampMicrosecond(){return Us}visitTimestampNanosecond(){return Ps}visitTime(){return Ir}visitTimeSecond(){return Vs}visitTimeMillisecond(){return js}visitTimeMicrosecond(){return Gs}visitTimeNanosecond(){return zs}visitDecimal(){return Es}visitList(){return Ni}visitLargeList(){return Ci}visitStruct(){return Vi}visitUnion(){return Fn}visitDenseUnion(){return Gi}visitSparseUnion(){return ji}visitDictionary(){return Ai}visitInterval(){return Wr}visitIntervalDayTime(){return Bs}visitIntervalYearMonth(){return Fs}visitIntervalMonthDayNano(){return Os}visitDuration(){return Ar}visitDurationSecond(){return Ms}visitDurationMillisecond(){return Ds}visitDurationMicrosecond(){return Rs}visitDurationNanosecond(){return ks}visitFixedSizeList(){return vi}visitMap(){return Ui}visitBinaryView(){return On}visitUtf8View(){return zi}},S0=new jp});function Ot(r,e){return e instanceof r.constructor}function Mn(r,e){return r===e||Ot(r,e)}function Dn(r,e){return r===e||Ot(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function Ml(r,e){return r===e||Ot(r,e)&&r.precision===e.precision}function QO(r,e){return r===e||Ot(r,e)&&r.byteWidth===e.byteWidth}function Gp(r,e){return r===e||Ot(r,e)&&r.unit===e.unit}function Tc(r,e){return r===e||Ot(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function _c(r,e){return r===e||Ot(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function L0(r,e){return r===e||Ot(r,e)&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function ZO(r,e){return r===e||Ot(r,e)&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function zp(r,e){return r===e||Ot(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&on.compareManyFields(r.children,e.children)}function eM(r,e){return r===e||Ot(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&on.visit(r.indices,e.indices)&&on.visit(r.dictionary,e.dictionary)}function Dl(r,e){return r===e||Ot(r,e)&&r.unit===e.unit}function Ac(r,e){return r===e||Ot(r,e)&&r.unit===e.unit}function tM(r,e){return r===e||Ot(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function rM(r,e){return r===e||Ot(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function Wi(r,e){return on.compareSchemas(r,e)}function B0(r,e){return on.compareFields(r,e)}function Rl(r,e){return on.visit(r,e)}var V,on,vc=p(()=>{Vt();V=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)}};V.prototype.visitNull=Mn;V.prototype.visitBool=Mn;V.prototype.visitInt=Dn;V.prototype.visitInt8=Dn;V.prototype.visitInt16=Dn;V.prototype.visitInt32=Dn;V.prototype.visitInt64=Dn;V.prototype.visitUint8=Dn;V.prototype.visitUint16=Dn;V.prototype.visitUint32=Dn;V.prototype.visitUint64=Dn;V.prototype.visitFloat=Ml;V.prototype.visitFloat16=Ml;V.prototype.visitFloat32=Ml;V.prototype.visitFloat64=Ml;V.prototype.visitUtf8=Mn;V.prototype.visitLargeUtf8=Mn;V.prototype.visitUtf8View=Mn;V.prototype.visitBinary=Mn;V.prototype.visitLargeBinary=Mn;V.prototype.visitBinaryView=Mn;V.prototype.visitFixedSizeBinary=QO;V.prototype.visitDate=Gp;V.prototype.visitDateDay=Gp;V.prototype.visitDateMillisecond=Gp;V.prototype.visitTimestamp=Tc;V.prototype.visitTimestampSecond=Tc;V.prototype.visitTimestampMillisecond=Tc;V.prototype.visitTimestampMicrosecond=Tc;V.prototype.visitTimestampNanosecond=Tc;V.prototype.visitTime=_c;V.prototype.visitTimeSecond=_c;V.prototype.visitTimeMillisecond=_c;V.prototype.visitTimeMicrosecond=_c;V.prototype.visitTimeNanosecond=_c;V.prototype.visitDecimal=Mn;V.prototype.visitList=L0;V.prototype.visitLargeList=L0;V.prototype.visitStruct=ZO;V.prototype.visitUnion=zp;V.prototype.visitDenseUnion=zp;V.prototype.visitSparseUnion=zp;V.prototype.visitDictionary=eM;V.prototype.visitInterval=Dl;V.prototype.visitIntervalDayTime=Dl;V.prototype.visitIntervalYearMonth=Dl;V.prototype.visitIntervalMonthDayNano=Dl;V.prototype.visitDuration=Ac;V.prototype.visitDurationSecond=Ac;V.prototype.visitDurationMillisecond=Ac;V.prototype.visitDurationMicrosecond=Ac;V.prototype.visitDurationNanosecond=Ac;V.prototype.visitFixedSizeList=tM;V.prototype.visitMap=rM;on=new V});function zr(r){let e=r.type,t=new(S0.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(zr(Object.assign(Object.assign({},u),{type:c})))}}return t}function Ko(r,e){if(r instanceof G||r instanceof B||r.type instanceof E||ArrayBuffer.isView(r))return rn(r);let t={type:e??kl(r),nullValues:[null]},n=[...Nl(t)(r)],s=n.length===1?n[0]:n.reduce((i,o)=>i.concat(o));return E.isDictionary(s.type)?s.memoize():s}function Wp(r){let e=Ko(r),t=new de(new Q(e.type.children),e.data[0]);return new me(t)}function kl(r){if(r.length===0)return new Ne;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 sr;if(i+e===r.length)return new Ge(new ut,new Pe);if(o+e===r.length)return new tr;if(a+e===r.length)return new lt;if(c+e===r.length)return new Zr;if(t+e===r.length){let u=r,l=kl(u[u.findIndex(f=>f!=null)]);if(u.every(f=>f==null||Rl(l,kl(f))))return new je(new O("",l,!0))}else if(n+e===r.length){let u=new Map;for(let l of r)for(let f of Object.keys(l))!u.has(f)&&l[f]!=null&&u.set(f,new O(f,kl([l[f]]),!0));return new pe([...u.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function Nl(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=zr(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 $p(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 _t(this,arguments,function*(){var i,o,a,c;let u=0,l=zr(r);try{for(var f=!0,d=Ht(s),h;h=yield Y(d.next()),i=h.done,!i;f=!0){c=h.value,f=!1;let m=c;l.append(m)[n]>=t&&++u&&(yield yield Y(l.toVector()))}}catch(m){o={error:m}}finally{try{!f&&!i&&(a=d.return)&&(yield Y(a.call(d)))}finally{if(o)throw o.error}}(l.finish().length>0||u===0)&&(yield yield Y(l.toVector()))})}}var xc=p(()=>{kt();mt();we();wr();ht();E0();$i();Rn();vc()});function Cl(r,e){return nM(r,e.map(t=>t.data.concat()))}function nM(r,e){let t=[...r.fields],n=[],s={numBatches:e.reduce((f,d)=>Math.max(f,d.length),0)},i=0,o=0,a=-1,c=e.length,u,l=[];for(;s.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)l[a]=u=e[a].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(l=sM(t,o,l,e,s),o>0&&(n[i++]=D({type:new pe(t),length:o,nullCount:0,children:l.slice()})))}return[r=r.assign(t),n.map(f=>new de(r,f))]}function sM(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],l=u?.length;if(l>=e)l===e?t[a]=u:(t[a]=u.slice(0,e),s.numBatches=Math.max(s.numBatches,n[a].unshift(u.slice(e,l-e))));else{let f=r[a];r[a]=f.clone({nullable:!0}),t[a]=(i=u?._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:D({type:f.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return t}var F0=p(()=>{wr();we();Rn()});function qp(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=rn(s);return new me(e)}function Kp(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=Ko(s);return new me(e)}var O0,M0,me,$i=p(()=>{Me();wr();xc();ht();mt();we();vc();F0();gl();hi();ar();yl();wl();Po();Rn();M0=Symbol.for("apache-arrow/Table"),me=class r{static isTable(e){return e?.[M0]===!0}constructor(...e){var t,n;if(e.length===0)return this.batches=[],this.schema=new Q([]),this._offsets=[0],this;let s,i;e[0]instanceof Q&&(s=e.shift()),e.at(-1)instanceof Uint32Array&&(i=e.pop());let o=c=>{if(c){if(c instanceof de)return[c];if(c instanceof r)return c.batches;if(c instanceof G){if(c.type instanceof pe)return[new de(new Q(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),l=u.map(h=>new B([c[h]])),f=s??new Q(u.map((h,m)=>new O(String(h),l[m].type,l[m].nullable))),[,d]=Cl(f,l);return d.length===0?[new de(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 Q([]),!(s instanceof Q))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof de))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Wi(s,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=a,this._offsets=i??hl(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=dl(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(pi(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Go.visit(new B(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
19
19
|
${this.toArray().join(`,
|
|
20
20
|
`)}
|
|
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=>
|
|
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 de(t,s)))}slice(e,t){let n=this.schema;[e,t]=fc({length:this.numRows},e,t);let s=pl(this.data,this._offsets,e,t);return new r(n,s.map(i=>new de(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=D({type:n,length:0,nullCount:0});t.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new B(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 B([D({type:new Ne,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]=Cl(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[l,f]=a,d=t.findIndex(h=>h.name===c.name);return~d?f[d]=u:l.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(...Cl(i,o))}};O0=Symbol.toStringTag;me[O0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[M0]=!0,r.isValid=jo(pc),r.get=jo(ze.getVisitFn(w.Struct)),r.set=ml(nt.getVisitFn(w.Struct)),r.indexOf=bl(yi.getVisitFn(w.Struct)),"Table"))(me.prototype);Object.defineProperty(me,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===me&&me.isTable(e)}})});function D0(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:D({type:c.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)}))}return[r.assign(s),D({type:new pe(s),length:t,children:i})]}function N0(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)||[]])N0(a.children,u?.children,t);if(E.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 R0,k0,de,qi,Rn=p(()=>{wr();$i();ht();mt();we();Po();hi();ar();yl();wl();k0=Symbol.for("apache-arrow/RecordBatch"),de=class r{static isRecordBatch(e){return e?.[k0]===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof Q))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=D({nullCount:0,type:new pe(this.schema.fields),children:this.schema.fields.map(t=>D({type:t.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof G))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=D0(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,l)=>(c.children[l]=t[u],c.length=Math.max(c.length,t[u].length),c.fields[l]=O.new({name:u,type:t[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new Q(n),a=D({type:new pe(n),length:i,children:s,nullCount:0});[this.schema,this.data]=D0(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=N0(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 ze.visit(this.data,e)}at(e){return this.get(pi(e,this.numRows))}set(e,t){return nt.visit(this.data,e,t)}indexOf(e,t){return yi.visit(this.data,e,t)}[Symbol.iterator](){return Go.visit(new B([this.data]))}toArray(){return[...this]}concat(...e){return new me(this.schema,[this,...e])}slice(e,t){let[n]=new B([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 B([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 B([D({type:new Ne,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 Q(i,new Map(this.schema.metadata)),s=D({type:new pe(i),length:s.length,children:o})}return new r(n,s,this._metadata)}select(e){let t=this.schema.select(e),n=new pe(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,D({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=D({type:new pe(t.fields),length:this.numRows,children:n});return new r(t,s,this._metadata)}};R0=Symbol.toStringTag;de[R0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[k0]=!0,"RecordBatch"))(de.prototype);Object.defineProperty(de,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===de&&de.isRecordBatch(e)}});qi=class extends de{constructor(e,t){let n=e.fields.map(i=>D({type:i.type})),s=D({type:new pe(e.fields),length:0,nullCount:0,children:n});super(e,s,t||new Map)}}});function Pl(r,e=0){for(let t=-1,n=Xo.length;++t<n;)if(Xo[t]!==r[e+t])return!1;return!0}var Hp,Jp,C0,U0,qs,Ki,Xi,Ul,Xp,Xo,Ho,Yp,P0,Vl=p(()=>{kt();Me();ce();_s();Yn();fp();Ke();As();bc();Hp=r=>`Expected ${se[r]} Message in stream, but was null or length 0.`,Jp=r=>`Header pointer of flatbuffer-encoded ${se[r]} Message is null or length 0.`,C0=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,U0=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,qs=class{constructor(e){this.source=e instanceof _r?e:new _r(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?Ee:e.value===-1&&(e=this.readMetadataLength()).done?Ee:(e=this.readMetadata(e.value)).done?Ee: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(Hp(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=k(this.source.read(e));if(t.byteLength<e)throw new Error(U0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=se.Schema,n=this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(Jp(t));return s}readMetadataLength(){let e=this.source.read(Ul),t=e&&new Ze(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Ee;if(t.byteLength<e)throw new Error(C0(e,t.byteLength));return{done:!1,value:gt.decode(t)}}},Ki=class{constructor(e,t){this.source=e instanceof Gt?e:Bu(e)?new vs(e,t):new Gt(e)}[Symbol.asyncIterator](){return this}next(){return F(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?Ee:e.value===-1&&(e=yield this.readMetadataLength()).done?Ee:(e=yield this.readMetadata(e.value)).done?Ee:e})}throw(e){return F(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return F(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return F(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(Hp(e));return t.value})}readMessageBody(e){return F(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=k(yield this.source.read(e));if(t.byteLength<e)throw new Error(U0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return F(this,arguments,void 0,function*(e=!1){let t=se.Schema,n=yield this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(Jp(t));return s})}readMetadataLength(){return F(this,void 0,void 0,function*(){let e=yield this.source.read(Ul),t=e&&new Ze(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(e){return F(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return Ee;if(t.byteLength<e)throw new Error(C0(e,t.byteLength));return{done:!1,value:gt.decode(t)}})}},Xi=class extends qs{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof mc?e:new mc(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:gt.fromJSON(e.schema,se.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:gt.fromJSON(t,se.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:gt.fromJSON(t,se.RecordBatch)}}return this._body=[],Ee}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(Hp(e));return t.value}readSchema(){let e=se.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw new Error(Jp(e));return n}},Ul=4,Xp="ARROW1",Xo=new Uint8Array(Xp.length);for(let r=0;r<Xp.length;r+=1)Xo[r]=Xp.codePointAt(r);Ho=Xo.length,Yp=Ho+Ul,P0=Ho*2+Ul});var Qp,Zp,V0,j0=p(()=>{So();Qp=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}},Zp=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)}},V0={[et.LZ4_FRAME]:new Qp,[et.ZSTD]:new Zp}});var em,Ks,jl=p(()=>{So();j0();em=class{constructor(){this.registry={}}set(e,t){if(t?.encode&&typeof t.encode=="function"&&!V0[e].isValidCodecEncode(t))throw new Error(`Encoder for ${et[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}},Ks=new em});function $0(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*G0(r){let e=Mt.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function z0(r){return _t(this,arguments,function*(){let t=yield Y(Mt.from(r));try{if(!(yield Y(t.open({autoDestroy:!1}))).closed)do yield yield Y(t);while(!(yield Y(t.reset().open())).closed)}finally{yield Y(t.cancel())}})}function oM(r){return new $r(new rm(r))}function aM(r){let e=r.peek(Ho+7&-8);return e&&e.byteLength>=4?Pl(e)?new Nn(new zl(r.read())):new $r(new Yo(r)):new $r(new Yo((function*(){})()))}function cM(r){return F(this,void 0,void 0,function*(){let e=yield r.peek(Ho+7&-8);return e&&e.byteLength>=4?Pl(e)?new Nn(new zl(yield r.read())):new kn(new Qo(r)):new kn(new Qo((function(){return _t(this,arguments,function*(){})})()))})}function uM(r){return F(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new vs(r,e);return e>=P0&&Pl(yield t.readAt(0,Ho+7&-8))?new Jo(new tm(t)):new kn(new Qo(t))})}var Mt,$r,kn,Nn,Jo,Gl,Yo,Qo,zl,tm,rm,Ic=p(()=>{kt();wr();ht();we();Me();ap();Va();_s();As();fp();I0();Rn();bc();Vl();Yn();jl();Qr();ce();Mt=class r extends Ti{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 Yt(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 Qe.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Qe.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:Eu(e)?oM(e):Bu(e)?uM(e):Yt(e)?F(this,void 0,void 0,function*(){return yield r.from(yield e)}):Fu(e)||Ca(e)||Mu(e)||br(e)?cM(new Gt(e)):aM(new _r(e))}static readAll(e){return e instanceof r?e.isSync()?G0(e):z0(e):Eu(e)||ArrayBuffer.isView(e)||Br(e)||Lu(e)?G0(e):z0(e)}},$r=class extends Mt{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return _t(this,arguments,function*(){yield Y(yield*Ao(Ht(this[Symbol.iterator]())))})}},kn=class extends Mt{constructor(e){super(e),this._impl=e}readAll(){return F(this,void 0,void 0,function*(){var e,t,n,s;let i=new Array;try{for(var o=!0,a=Ht(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]()}},Nn=class extends $r{constructor(e){super(e),this._impl=e}},Jo=class extends kn{constructor(e){super(e),this._impl=e}},Gl=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=Ks.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 $e(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=D({type:new pe(this.schema.fields),length:e.length,children:s});return new de(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 l=Ks.get(e.data.compression.type);if(l?.decode&&typeof l.decode=="function"){let{decommpressedBody:f,buffers:d}=this._decompressBuffers(e.data,t,l);u=this._loadCompressedVectors(e.data,f,[c]),e=new bt(new $e(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 B(u)):new B(u)).memoize()}_loadVectors(e,t,n){return new qo(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(e,t,n){return new Ll(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 Ce(o,0));continue}let u=new Ze(t.subarray(a,a+c)),l=te(u.readInt64(0)),f=u.bytes().subarray(8),d=l===-1?f:n.decode(f);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}}},Yo=class extends Gl{constructor(e,t){super(t),this._reader=Eu(e)?new Xi(this._handle=e):new qs(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=$0(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):Ee}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ee}next(){if(this.closed)return Ee;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 qi(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Qo=class extends Gl{constructor(e,t){super(t),this._reader=new Ki(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return F(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 F(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=$0(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return F(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ee})}return(e){return F(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ee})}next(){return F(this,void 0,void 0,function*(){if(this.closed)return Ee;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 qi(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return F(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},zl=class extends Yo{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 gc?e:new gc(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(se.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(se.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-Yp,n=e.readInt32(t),s=e.readAt(t-n,n);return In.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}},tm=class extends Qo{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 vs?e:new vs(e,n),s)}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return F(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 F(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(se.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 F(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(se.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 F(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Yp,n=yield e.readInt32(t),s=yield e.readAt(t-n,n);return In.decode(s)})}_readNextMessageAndValidate(e){return F(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})}},rm=class extends Yo{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new El(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}}});function lr(r){let e=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ce(this._byteLength,e)),this._byteLength+=e,this}function lM(r){var e;let{type:t,length:n,typeIds:s,valueOffsets:i}=r;if(lr.call(this,s),t.mode===he.Sparse)return nm.call(this,r);if(t.mode===he.Dense){if(r.offset<=0)return lr.call(this,i),nm.call(this,r);{let o=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let u,l,f=-1;++f<n;)(u=s[f])!==void 0&&((l=a[u])===void 0&&(l=a[u]=i[f]),o[f]=i[f]-l,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);lr.call(this,o),this.visitMany(r.children.map((u,l)=>{let f=t.typeIds[l],d=a[f],h=c[f];return u.slice(d,Math.min(n,h))}))}}return this}function fM(r){let e;return r.nullCount>=r.length?lr.call(this,new Uint8Array(r.length+7>>3)):(e=r.values)instanceof Uint8Array?lr.call(this,mi(r.offset,r.length,e)):lr.call(this,bi(r.values))}function Cn(r){return lr.call(this,r.values.subarray(0,r.length*r.stride))}function Wl(r){let{length:e,values:t,valueOffsets:n}=r,s=te(n[0]),i=te(n[e]),o=Math.min(i-s,t.byteLength-s);return lr.call(this,Du(-s,e+1,n)),lr.call(this,t.subarray(s,s+o)),this}function q0(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;lr.call(this,s.subarray(o,a));for(let c of i)lr.call(this,c);return this._variadicBufferCounts.push(i.length),this}function $l(r){let{length:e,valueOffsets:t}=r;if(t){let n=te(t[0]),s=te(t[e]);return lr.call(this,Du(-n,e+1,t)),this.visit(r.children[0].slice(n,s-n))}return this.visit(r.children[0])}function nm(r){return this.visitMany(r.type.children.map((e,t)=>r.children[t]).filter(Boolean))[0]}var Le,K0=p(()=>{ht();Vt();Me();Rn();Ke();gi();_s();we();Qr();Le=class r extends R{static assemble(...e){let t=s=>s.flatMap(i=>Array.isArray(i)?t(i):i instanceof de?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 B)return this.visitMany(e.data),this;let{type:t}=e;if(!E.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(E.isUnion(t))this.nodes.push(new xr(n,0));else{let{nullCount:s}=e;E.isNull(t)||lr.call(this,s<=0?new Uint8Array(0):mi(e.offset,n,e.nullBitmap)),this.nodes.push(new xr(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=fM;Le.prototype.visitInt=Cn;Le.prototype.visitFloat=Cn;Le.prototype.visitUtf8=Wl;Le.prototype.visitLargeUtf8=Wl;Le.prototype.visitUtf8View=q0;Le.prototype.visitBinary=Wl;Le.prototype.visitLargeBinary=Wl;Le.prototype.visitBinaryView=q0;Le.prototype.visitFixedSizeBinary=Cn;Le.prototype.visitDate=Cn;Le.prototype.visitTimestamp=Cn;Le.prototype.visitTime=Cn;Le.prototype.visitDecimal=Cn;Le.prototype.visitList=$l;Le.prototype.visitLargeList=$l;Le.prototype.visitStruct=nm;Le.prototype.visitUnion=lM;Le.prototype.visitInterval=Cn;Le.prototype.visitDuration=Cn;Le.prototype.visitFixedSizeList=$l;Le.prototype.visitMap=$l});var ql,X0=p(()=>{Vt();ju();Me();ql=class extends R{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:z[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:z[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:z[e].toLowerCase(),precision:le[t]}}visitBinary({typeId:e}){return{name:z[e].toLowerCase()}}visitLargeBinary({typeId:e}){return{name:z[e].toLowerCase()}}visitBinaryView({typeId:e}){return{name:z[e].toLowerCase()}}visitBool({typeId:e}){return{name:z[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:z[e].toLowerCase()}}visitLargeUtf8({typeId:e}){return{name:z[e].toLowerCase()}}visitUtf8View({typeId:e}){return{name:z[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n,bitWidth:s}){return{name:z[e].toLowerCase(),scale:t,precision:n,bitWidth:s}}visitDate({typeId:e,unit:t}){return{name:z[e].toLowerCase(),unit:ye[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:z[e].toLowerCase(),unit:L[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:z[e].toLowerCase(),unit:L[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:z[e].toLowerCase(),unit:ae[t]}}visitDuration({typeId:e,unit:t}){return{name:z[e].toLocaleLowerCase(),unit:L[t]}}visitList({typeId:e}){return{name:z[e].toLowerCase()}}visitLargeList({typeId:e}){return{name:z[e].toLowerCase()}}visitStruct({typeId:e}){return{name:z[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:z[e].toLowerCase(),mode:he[t].toUpperCase(),typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:z[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:z[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:z[e].toLowerCase(),keysSorted:t}}}});function*sm(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Un(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`${di.new(t.subarray((n+0)*e,(n+1)*e),!1)}`}function H0(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])),l=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:l.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:u}}var Sc,J0=p(()=>{zu();ht();Vt();Me();Me();gi();Sl();we();Sc=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=E.isDictionary(t.type)?t.type.indices:t.type,c=Object.assign([],t.buffers,{[re.VALIDITY]:void 0});return Object.assign({name:e,count:n,VALIDITY:E.isNull(a)||E.isUnion(a)?void 0:i<=0?Array.from({length:n},()=>1):[...new tn(o,s,n,null,fl)]},super.visit(t.clone(a,s,n,0,c)))}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...new tn(e,t,n,null,Vo)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...Un(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...new B([e])],OFFSET:[...e.valueOffsets]}}visitLargeUtf8(e){return{DATA:[...new B([e])],OFFSET:[...Un(e.valueOffsets,2)]}}visitBinary(e){return{DATA:[...sm(new B([e]))],OFFSET:[...e.valueOffsets]}}visitLargeBinary(e){return{DATA:[...sm(new B([e]))],OFFSET:[...Un(e.valueOffsets,2)]}}visitBinaryView(e){return H0(e,t=>Array.from(t).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(e){return H0(e,t=>Array.from(t).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(e){return{DATA:[...sm(new B([e]))]}}visitDate(e){return{DATA:e.type.unit===ye.DAY?[...e.values]:[...Un(e.values,2)]}}visitTimestamp(e){return{DATA:[...Un(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<L.MICROSECOND?[...e.values]:[...Un(e.values,2)]}}visitDecimal(e){return{DATA:[...Un(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}visitLargeList(e){return{OFFSET:[...Un(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===he.Dense?[...e.valueOffsets]:void 0,children:this.visitMany(e.type.children,e.children)}}visitInterval(e){switch(e.type.unit){case ae.YEAR_MONTH:return{DATA:[...e.values]};case ae.DAY_TIME:return{DATA:gp(e.values)};case ae.MONTH_DAY_NANO:return{DATA:yp(e.values,!0)}}}visitDuration(e){return{DATA:[...Un(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 im(r,e){let t=e;e instanceof me&&(t=e.batches,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function om(r,e){return F(this,void 0,void 0,function*(){var t,n,s,i,o,a,c;try{for(t=!0,n=Ht(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 Y0({name:r,type:e,nullable:t}){let n=new ql;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(s=>Y0(s)),dictionary:E.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function dM(r,e,t=!1){let[n]=Sc.assemble(new de({[e]:r}));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:n}},null,2)}function hM(r){let[e]=Sc.assemble(r);return JSON.stringify({count:r.numRows,columns:e},null,2)}var an,Pn,Vn,Ec,Kl=p(()=>{kt();$i();Vl();ht();we();_s();_s();ap();Me();vc();As();K0();X0();J0();Ke();Rn();bc();Yn();So();jl();ce();an=class extends Ti{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 Tr,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,At(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(et).includes(e.compressionType))this._compression=new xi(e.compressionType);else{let t=Object.values(et).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 Yt(e)?e.then(t=>this.writeAll(t)):br(e)?om(this,e):im(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 Tr?this._sink=e:(this._sink=new Tr,e&&mx(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&bx(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||!Wi(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 me&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof de&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!Wi(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof de?e instanceof qi||this._writeRecordBatch(e):e instanceof me?this.writeAll(e.batches):Br(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,s=gt.encode(e),i=s.byteLength,o=this._writeLegacyIpcFormat?4:8,a=i+o+n&~n,c=a-i-o;return e.headerType===se.RecordBatch?this._recordBatchBlocks.push(new Gr(a,e.bodyLength,this._position)):e.headerType===se.DictionaryBatch&&this._dictionaryBlocks.push(new Gr(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=k(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(gt.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Xo)}_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 $e(e.numRows,n,s,this._compression,o,e.metadata),c=gt.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=Ks.get(this._compression.type);if(!t?.encode||typeof t.encode!="function")throw new Error(`Codec for compression type "${et[this._compression.type]}" has invalid encode method`);let n=0,s=[],i=[];for(let a of e){let c=k(a);if(c.length===0){s.push(new Uint8Array(0),new Uint8Array(0)),i.push(new Ce(n,0));continue}let u=t.encode(c),l=u.length<c.length,f=l?u:c,d=l?f.length:-1,h=new Ze(new Uint8Array(8));h.writeInt64(0,BigInt(d)),s.push(h.bytes(),new Uint8Array(f));let m=(n+7&-8)-n;n+=m;let b=8+f.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,t,n=!1){let{byteLength:s,nodes:i,bufferRegions:o,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new B([e])),u=new $e(e.length,i,o,this._compression,c),l=new bt(u,t,n),f=gt.from(l,s);return this._writeMessage(f)._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,l]of o.entries())this._writeDictionaryBatch(l,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}},Pn=class r extends an{static writeAll(e,t){let n=new r(t);return Yt(e)?e.then(s=>n.writeAll(s)):br(e)?om(n,e):im(n,e)}},Vn=class r extends an{static writeAll(e,t){let n=new r(t);return Yt(e)?e.then(s=>n.writeAll(s)):br(e)?om(n,e):im(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=In.encode(new In(e,ge.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}},Ec=class r extends an{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=>Y0(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(dM(e,t,n)),this._dictionaryBlocks.push(new Gr(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
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(hM(this._recordBatches[e])),this._recordBatchBlocks.push(new Gr(0,0,0));this._write(`
|
|
30
30
|
]`)}return this._schema&&this._write(`
|
|
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 {
|
|
31
|
+
}`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function Q0(r,e){if(br(r))return mM(r,e);if(Br(r))return pM(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function pM(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,l=o.desiredSize||null;for(;!(u=a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()}}function mM(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 F(this,void 0,void 0,function*(){yield i(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return F(this,void 0,void 0,function*(){t?yield i(o,t):o.close()})},cancel(){return F(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 F(this,void 0,void 0,function*(){let c,u=null,l=o.desiredSize||null;for(;!(u=yield a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()})}}var Z0=p(()=>{kt();Ke();Yn()});function r_(r){return new am(r)}var am,e_,t_,n_=p(()=>{kt();xc();am=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=e,i=dx(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=zr(i),this._getSize=s!=="bytes"?e_:t_;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"?e_:t_}),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)}},e_=r=>{var e;return(e=r?.length)!==null&&e!==void 0?e:0},t_=r=>{var e;return(e=r?.byteLength)!==null&&e!==void 0?e:0}});function Xl(r,e){let t=new Tr,n=null,s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield t.close()})},start(a){return F(this,void 0,void 0,function*(){yield o(a,n||(n=yield i()))})},pull(a){return F(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 F(this,void 0,void 0,function*(){return yield(yield Mt.from(t)).open(e)})}function o(a,c){return F(this,void 0,void 0,function*(){let u=a.desiredSize,l=null;for(;!(l=yield c.next()).done;)if(a.enqueue(l.value),u!=null&&--u<=0)return;a.close()})}}var s_=p(()=>{kt();As();Ic()});function Hl(r,e){let t=new this(r),n=new Gt(t),s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return F(this,void 0,void 0,function*(){yield i(o)})},start(o){return F(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 F(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 i_=p(()=>{kt();As()});function Zo(r){let e=Mt.from(r);return Yt(e)?e.then(t=>Zo(t)):e.isAsync()?e.readAll().then(t=>new me(t)):new me(e.readAll())}function Lc(r,e="stream",t=null){let n={compressionType:t};return(e==="stream"?Pn:Vn).writeAll(r,n).toUint8Array(!0)}var o_=p(()=>{$i();Yn();Ic();Kl()});var cm={};J(cm,{isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef});function Jl(r){return Q.isSchema(r)}function Yl(r){return O.isField(r)}function Ql(r){return E.isDataType(r)}function Zl(r){return G.isData(r)}function ef(r){return B.isVector(r)}function tf(r){return de.isRecordBatch(r)}function rf(r){return me.isTable(r)}var um=p(()=>{mt();we();wr();ht();Rn();$i()});var a_,lm=p(()=>{Gu();So();Me();wr();we();$i();ht();Vt();mt();lc();cl();Se();xc();xp();Dp();Tp();_p();Ap();vp();Sp();Bp();Np();kp();Ep();Lp();Up();Vp();Pp();Bl();Ol();Fl();Fp();Op();Ip();Mp();Rp();Cp();As();Ic();Kl();o_();jl();Vl();_s();Rn();um();zu();pp();gi();uc();Ke();Po();tc();Sl();um();vc();a_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ch),hp),Zh),Uh),nh),Qh),Dh),wp),cm),{compareSchemas:Wi,compareFields:B0,compareTypes:Rl})});var cn={};J(cn,{AsyncByteQueue:()=>Tr,AsyncByteStream:()=>Gt,AsyncMessageReader:()=>Ki,AsyncRecordBatchFileReader:()=>Jo,AsyncRecordBatchStreamReader:()=>kn,Binary:()=>Ct,BinaryBuilder:()=>Ln,BinaryView:()=>Z,BinaryViewBuilder:()=>On,Bool:()=>lt,BoolBuilder:()=>_i,BufferType:()=>re,Builder:()=>Te,ByteStream:()=>_r,CompressionType:()=>et,Data:()=>G,DataType:()=>E,DateBuilder:()=>nn,DateDay:()=>os,DateDayBuilder:()=>Is,DateMillisecond:()=>as,DateMillisecondBuilder:()=>Ss,DateUnit:()=>ye,Date_:()=>Et,Decimal:()=>Ut,DecimalBuilder:()=>Es,DenseUnion:()=>_n,DenseUnionBuilder:()=>Gi,Dictionary:()=>Ge,DictionaryBuilder:()=>Ai,Duration:()=>Lt,DurationBuilder:()=>Ar,DurationMicrosecond:()=>oc,DurationMicrosecondBuilder:()=>Rs,DurationMillisecond:()=>ic,DurationMillisecondBuilder:()=>Ds,DurationNanosecond:()=>ac,DurationNanosecondBuilder:()=>ks,DurationSecond:()=>sc,DurationSecondBuilder:()=>Ms,Field:()=>O,FixedSizeBinary:()=>Pt,FixedSizeBinaryBuilder:()=>Ls,FixedSizeList:()=>Be,FixedSizeListBuilder:()=>vi,Float:()=>ct,Float16:()=>Cr,Float16Builder:()=>Ii,Float32:()=>It,Float32Builder:()=>Si,Float64:()=>sr,Float64Builder:()=>Ei,FloatBuilder:()=>sn,Int:()=>Fe,Int16:()=>er,Int16Builder:()=>Bi,Int32:()=>Pe,Int32Builder:()=>Fi,Int64:()=>tr,Int64Builder:()=>Oi,Int8:()=>Zt,Int8Builder:()=>Li,IntBuilder:()=>Ft,Interval:()=>ft,IntervalBuilder:()=>Wr,IntervalDayTime:()=>ms,IntervalDayTimeBuilder:()=>Bs,IntervalMonthDayNano:()=>nc,IntervalMonthDayNanoBuilder:()=>Os,IntervalUnit:()=>ae,IntervalYearMonth:()=>bs,IntervalYearMonthBuilder:()=>Fs,JSONMessageReader:()=>Xi,LargeBinary:()=>Ur,LargeBinaryBuilder:()=>Bn,LargeList:()=>ir,LargeListBuilder:()=>Ci,LargeUtf8:()=>Pr,LargeUtf8Builder:()=>$s,List:()=>je,ListBuilder:()=>Ni,MapBuilder:()=>Ui,MapRow:()=>yr,Map_:()=>dt,Message:()=>gt,MessageHeader:()=>se,MessageReader:()=>qs,MetadataVersion:()=>ge,Null:()=>Ne,NullBuilder:()=>Pi,Precision:()=>le,RecordBatch:()=>de,RecordBatchFileReader:()=>Nn,RecordBatchFileWriter:()=>Vn,RecordBatchJSONWriter:()=>Ec,RecordBatchReader:()=>Mt,RecordBatchStreamReader:()=>$r,RecordBatchStreamWriter:()=>Pn,RecordBatchWriter:()=>an,Schema:()=>Q,SparseUnion:()=>gs,SparseUnionBuilder:()=>ji,Struct:()=>pe,StructBuilder:()=>Vi,StructRow:()=>en,Table:()=>me,Time:()=>tt,TimeBuilder:()=>Ir,TimeMicrosecond:()=>ls,TimeMicrosecondBuilder:()=>Gs,TimeMillisecond:()=>us,TimeMillisecondBuilder:()=>js,TimeNanosecond:()=>fs,TimeNanosecondBuilder:()=>zs,TimeSecond:()=>cs,TimeSecondBuilder:()=>Vs,TimeUnit:()=>L,Timestamp:()=>rt,TimestampBuilder:()=>vr,TimestampMicrosecond:()=>hs,TimestampMicrosecondBuilder:()=>Us,TimestampMillisecond:()=>Zr,TimestampMillisecondBuilder:()=>Cs,TimestampNanosecond:()=>ps,TimestampNanosecondBuilder:()=>Ps,TimestampSecond:()=>ds,TimestampSecondBuilder:()=>Ns,Type:()=>w,Uint16:()=>nr,Uint16Builder:()=>Di,Uint32:()=>vt,Uint32Builder:()=>Ri,Uint64:()=>Nr,Uint64Builder:()=>ki,Uint8:()=>rr,Uint8Builder:()=>Mi,Union:()=>Bt,UnionBuilder:()=>Fn,UnionMode:()=>he,Utf8:()=>ut,Utf8Builder:()=>Ws,Utf8View:()=>St,Utf8ViewBuilder:()=>zi,Vector:()=>B,Visitor:()=>R,builderThroughAsyncIterable:()=>$p,builderThroughIterable:()=>Nl,compressionRegistry:()=>Ks,isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef,makeBuilder:()=>zr,makeData:()=>D,makeTable:()=>qp,makeVector:()=>rn,tableFromArrays:()=>Kp,tableFromIPC:()=>Zo,tableFromJSON:()=>Wp,tableToIPC:()=>Lc,util:()=>a_,vectorFromArray:()=>Ko});var jn=p(()=>{Va();Se();Ic();Kl();Z0();n_();s_();i_();lm();lm();Qe.toDOMStream=Q0;Te.throughDOM=r_;Mt.throughDOM=Xl;Nn.throughDOM=Xl;$r.throughDOM=Xl;an.throughDOM=Hl;Vn.throughDOM=Hl;Pn.throughDOM=Hl});function nf(r){return r.variadicBuffers??[]}function sf(r,e,t,n,s,i,o,a){return Reflect.construct(G,[r,e,t,n,s,i,o,a])}var fm=p(()=>{jn()});function c_(r,e={}){let t={...e,copies:new WeakMap};return bM(r)?wM(r,t):gM(r)?u_(r,t):yM(r)?l_(r,t):of(r,t)}function bM(r){return"batches"in r}function gM(r){return"schema"in r&&"data"in r&&!Array.isArray(r.data)}function yM(r){return"data"in r&&Array.isArray(r.data)}function wM(r,e){let t=r.batches.map(n=>u_(n,e));return new me(r.schema,t)}function u_(r,e){return new de(r.schema,of(r.data,e))}function of(r,e){let t=r.children.map(i=>of(i,e)),n=r.dictionary?l_(r.dictionary,e):void 0,s={[re.OFFSET]:Bc(r.buffers[re.OFFSET],e),[re.DATA]:Bc(r.buffers[re.DATA],e),[re.VALIDITY]:Bc(r.buffers[re.VALIDITY],e),[re.TYPE]:Bc(r.buffers[re.TYPE],e)};return sf(r.type,r.offset,r.length,r._nullCount,s,t,n,nf(r).map(i=>Bc(i,e)))}function l_(r,e){return new B(r.data.map(t=>of(t,e)))}function Bc(r,e){if(!xM(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 instanceof Uint8Array?new Uint8Array(r):r.slice(),e.copies.set(r,t)),t}function xM(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var dm=p(()=>{jn();fm()});var f_=p(()=>{});var d_=p(()=>{});var h_=p(()=>{});var p_=p(()=>{});function mm(r,e){let t=c_(r,e);return{transport:"arrow-js",version:1,schema:Lc(new me(t.schema,[])),metadataVersion:t.schema.metadataVersion,batches:t.batches.map(n=>hm(n.data))}}function bm(r){if(r.transport!=="arrow-js"||r.version!==1)throw new Error("Unsupported Arrow column-buffer transport protocol.");let e=Zo(r.schema).schema,t=new Q(e.fields,e.metadata,e.dictionaries,r.metadataVersion),n=new pe(t.fields),s=r.batches.map(i=>new de(t,pm(i,n)));return new me(t,s)}function hm(r){return{offset:r.offset,length:r.length,nullCount:r.nullCount,buffers:{[re.OFFSET]:r.buffers[re.OFFSET],[re.DATA]:r.buffers[re.DATA],[re.VALIDITY]:r.buffers[re.VALIDITY],[re.TYPE]:r.buffers[re.TYPE]},children:r.children.map(e=>hm(e)),variadicBuffers:nf(r),dictionary:r.dictionary?.data.map(e=>hm(e))}}function pm(r,e){let t=r.children.map((s,i)=>pm(s,e.children[i].type)),n=r.dictionary&&E.isDictionary(e)?new B(r.dictionary.map(s=>pm(s,e.dictionary))):void 0;return sf(e,r.offset,r.length,r.nullCount,r.buffers,t,n,r.variadicBuffers)}var m_=p(()=>{jn();fm();dm()});var b_=p(()=>{d_();f_();h_();p_();dm();m_()});var g_=p(()=>{b_()});function Hi(r){if(!y_(r))throw new Error("Workers require Arrow table output");let{data:e,...t}=r;return{...structuredClone(t),data:mm(e,{copy:"all"})}}function gm(r){if(!w_(r))throw new Error("Workers require Arrow column transport");return{...r,data:bm(r.data)}}function af(r,e){if(!y_(r))return r;let t=e,n=t?.core?.workerTransferBufferCopy??t?.workerTransferBufferCopy;return{...r,data:mm(r.data,n?{copy:n}:void 0)}}function cf(r){return w_(r)?{...r,data:bm(r.data)}:r}function y_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function w_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&e.data.transport==="arrow-js"&&Array.isArray(e.data.batches))}var ea=p(()=>{"use strict";g_()});async function Xs(r,e,t,n){return n._parse(r,e,t,n)}var x_=p(()=>{"use strict"});function fr(r,e){if(!r)throw new Error(e||"loader assertion failed.")}var ym=p(()=>{"use strict"});var un,TM,_M,AM,vM,Gn,T_,IM,wm=p(()=>{"use strict";un={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},TM=un.self||un.window||un.global||{},_M=un.window||un.self||un.global||{},AM=un.global||un.self||un.window||{},vM=un.document||{},Gn=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),T_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),IM=T_&&parseFloat(T_[1])||0});var __,A_=p(()=>{"use strict";__=r=>typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer});function Ji(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 v_=p(()=>{"use strict"});function xm(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Tm(r){return globalThis.loaders?.modules?.[r]||null}var _m=p(()=>{"use strict"});var I_,wq,xq,Am,S_=p(()=>{"use strict";I_="master",wq=`https://raw.githubusercontent.com/visgl/loaders.gl/${I_}/`,xq=`https://github.com/visgl/loaders.gl/raw/${I_}/`,Am="beta"});var E_=p(()=>{"use strict";S_()});function SM(){let r="5.0.0-beta.5";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=r,r}var L_,B_=p(()=>{"use strict";L_=SM()});function uf(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var vm=p(()=>{"use strict"});var ln,Sq,Eq,Lq,Bq,Xe,Yi,O_,F_,Fq,Fc=p(()=>{"use strict";ln={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Sq=ln.self||ln.window||ln.global||{},Eq=ln.window||ln.self||ln.global||{},Lq=ln.global||ln.self||ln.window||{},Bq=ln.document||{},Xe=typeof process!="object"||String(process)!=="[object process]"||process.browser,Yi=typeof importScripts=="function",O_=typeof window<"u"&&typeof window.orientation<"u",F_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Fq=F_&&parseFloat(F_[1])||0});var lf,Im=p(()=>{lf="latest"});function EM(){return typeof __VERSION__>"u"?lf:__VERSION__}var Sm,M_=p(()=>{Im();Sm=EM()});function Qi(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var ff=p(()=>{});var fn,Nq,Cq,Uq,Pq,zt,R_,D_,Vq,ta=p(()=>{fn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Nq=fn.self||fn.window||fn.global||{},Cq=fn.window||fn.self||fn.global||{},Uq=fn.global||fn.self||fn.window||{},Pq=fn.document||{},zt=typeof process!="object"||String(process)!=="[object process]"||process.browser,R_=typeof window<"u"&&typeof window.orientation<"u",D_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Vq=D_&&parseFloat(D_[1])||0});function k_(r){let e=new Error(r);return e.name="AbortError",e}var Oc,N_=p(()=>{Oc=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:k_(`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:k_(`Worker job "${this.name}" was aborted`)))}}});var ra,zq,C_=p(()=>{ra=class{constructor(...e){let n=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(n)return new n(...e)}terminate(){}},zq=globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort??null});function U_(r){if(Qi(r.source&&!r.url||!r.source&&r.url),r.url&&r.workerType==="module"){let t=globalThis.document?.baseURI??globalThis.location?.href;if(!t)return r.url;let n=new URL(r.url,t),s=globalThis.location?.origin;return/^https?:$/.test(n.protocol)&&n.origin!==s?Lm(`import ${JSON.stringify(n.href)};`):r.url}let e=Em.get(r.source||r.url);return e||(r.url&&(e=LM(r.url),Em.set(r.url,e)),r.source&&(e=Lm(r.source),Em.set(r.source,e))),Qi(e),e}function LM(r){if(!r.startsWith("http"))return r;let e=BM(r);return Lm(e)}function Lm(r){let e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function BM(r){return`try {
|
|
32
32
|
importScripts('${r}');
|
|
33
33
|
} catch (error) {
|
|
34
34
|
console.error(error);
|
|
35
35
|
throw error;
|
|
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(`
|
|
36
|
+
}`}var Em,P_=p(()=>{ff();Em=new Map});function yt(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),Bm(o))n.add(o);else if(ArrayBuffer.isView(o))Bm(o.buffer)&&n.add(o.buffer);else if(e&&typeof MessageChannel<"u"&&o instanceof MessageChannel)i(o.port1),i(o.port2);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 Bm(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 na(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||Bm(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 df=p(()=>{});var Fm,Sr,Mc=p(()=>{C_();ta();ff();P_();df();Fm=()=>{},Sr=class{static isSupported(){return typeof Worker<"u"&&zt||typeof ra<"u"&&!zt}constructor(e){this.terminated=!1,this.createdAt=performance.now(),this._loadableURL="";let{name:t,source:n,url:s,getUrl:i,loadWorker:o}=e;Qi(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=Fm,this.onError=c=>console.log(c);let a=performance.now();this.worker=zt?this._createBrowserWorker():this._createNodeWorker(),this.creationTimeMs=performance.now()-a}destroy(){return this.onMessage=Fm,this.onError=Fm,this.terminated?this.termination??Promise.resolve():(this.terminated=!0,this.termination=Promise.resolve(this.worker.terminate()).then(()=>{}).finally(()=>this.releaseModuleWorkerURL()),this.termination.catch(()=>{}),this.termination)}unref(){!zt&&typeof this.worker.unref=="function"&&this.worker.unref()}ref(){!zt&&typeof this.worker.ref=="function"&&this.worker.ref()}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||yt(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 t=this.loadWorker();if(t)return this._initializeBrowserWorker(t)}catch(t){if(!this.source&&!this.url&&!this.getUrl)throw t}let e=this.url||this.getUrl?.();this._loadableURL=U_({source:this.source,url:e,workerType:this.workerType}),this.workerType==="module"&&e&&this._loadableURL!==e&&this._loadableURL.startsWith("blob:")&&(this.ownedModuleWorkerURL=this._loadableURL);try{let t=new Worker(this._loadableURL,{name:this.name,type:this.workerType});return this._initializeBrowserWorker(t)}catch(t){throw this.releaseModuleWorkerURL(),t}}releaseModuleWorkerURL(){this.ownedModuleWorkerURL&&(URL.revokeObjectURL(this.ownedModuleWorkerURL),this.ownedModuleWorkerURL=void 0)}_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 ra(s,{eval:!1,type:i})}else if(this.source)e=new ra(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 Hs,Om=p(()=>{ta();Mc();N_();Hs=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 Sr.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 l=new Promise((f,d)=>{let h=()=>{let g=this.jobQueue.indexOf(m);g>=0&&(this.jobQueue.splice(g,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:f,onReject:d,signal:s,removeAbortListener:()=>s?.removeEventListener("abort",h)},b=this.jobQueue.findIndex(g=>g.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 l}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 Oc(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 Sr({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 R_?this.maxMobileConcurrency:this.maxConcurrency}}});function OM(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:${MM(i)}`:"";return[e,a,c,u,`type:${o||"classic"}`].filter(Boolean).join("|")}function MM(r){let e=j_.get(r);return e||(e=FM++,j_.set(r,e)),e}var V_,j_,FM,sa,G_=p(()=>{Om();Mc();V_={maxQueuedJobs:1/0,maxPendingAdmissions:128,priorityAgingMs:1e3,onMetrics:()=>{},performanceMarks:!1,maxQueuedBytes:1/0,maxInFlightBytes:1/0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},j_=new WeakMap,FM=1,sa=class r{static isSupported(){return Sr.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={...V_},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(V_))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=OM(e),u=this.workerPools.get(c);return u||(u=new Hs({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 Dc,z_=p(()=>{Dc=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 Mm(r){let e=r.version!==Sm?` (worker-utils@${Sm})`:"";return`${r.name}@${r.version}${e}`}function Dm(r,e={}){let t=zt?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=$_(r,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(zt)n=`modules/${r.module}/dist/${t}`;else{let i=r.module==="tasks"&&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 $_(r,e={}){return(e[r.id]||{}).workerUrl||(r.id==="compression"?e.workerUrl:null)||null}function Rm(r,e={}){let t=Dm(r,e),n=typeof r.worker=="string"?r.worker:null,s=t||n||km(r,!0);return Qi(s),s}function km(r,e=!1){let t=zt?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=r.version;n==="latest"&&(n=lf);let s=n?`@${n}`:"",o=`https://unpkg.com/${r.packageName||`@loaders.gl/${r.module}`}${s}/dist/${t}`;return e&&DM(r,o),o}function DM(r,e){if(r.version!=="latest")return;let t=`${r.module}:${r.id}`;W_.has(t)||(W_.add(t),console.warn(`loaders.gl: ${r.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var W_,q_=p(()=>{ff();ta();M_();Im();W_=new Set});function K_(){let r=typeof globalThis.crossOriginIsolated=="boolean"?globalThis.crossOriginIsolated:void 0,e={workers:Sr.isSupported(),sharedMemory:!1,crossOriginIsolated:r};if(zt&&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 RM(){if(!K_().sharedMemory)return null;let r=new Zi(new SharedArrayBuffer(16));return r.setProgress(0),r}function Nm(r){if(r.sharedState===void 0&&r.cancellationMode==="cooperative"){let e=RM();return e?{...r,sharedState:e.buffer}:r}if(r.sharedState){if(!K_().sharedMemory)throw new Error("Shared worker memory is unavailable");new Zi(r.sharedState).throwIfCancelled()}return r}var Zi,X_=p(()=>{Mc();ta();Zi=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 hf(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 H_=p(()=>{});function Cm(r){if(r!==void 0&&r!=="copy"&&r!=="transfer")throw new Error("Invalid worker output ownership")}var J_=p(()=>{});async function Pm(r,e,t={},n={},s={}){if(Cm(t.outputOwnership),t.inputOwnership!==void 0&&!["copy","transfer","share"].includes(t.inputOwnership))throw new Error("Invalid worker input ownership");t=Nm(t),Y_(t.signal),Um(t,[e,Rc(t),s]);let i=Mm(r),o=t.workerPool??sa.getWorkerFarm(t).getWorkerPool(eA(r,t,i)),a=t.jobName||r.name,c=await o.startJob(a,tA.bind(null,n,t),void 0,t.signal,{inputBytes:hf([e,nA(t),s]),priority:t.priority,admission:t.admission,sharedState:t.sharedState?new Zi(t.sharedState):void 0,cancellationMode:t.cancellationMode,cancellationTimeout:t.cancellationTimeout});try{t.signal?.aborted&&!c.isCancelled&&c.abort(Q_(t.signal));let u=Rc(t),l=na(u),f=na(s);return c.isRunning&&c.postMessage("process",{input:e,options:l,context:f},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0),(await c.result).result}catch(u){throw c.isCancelled||c.abort(u),u}}function Vm(r,e,t={},n={},s={}){if(Cm(t.outputOwnership),t.inputOwnership!==void 0&&!["copy","transfer","share"].includes(t.inputOwnership))throw new Error("Invalid worker input ownership");return kM(r,e,t,n,s)}async function*kM(r,e,t,n,s){t=Nm(t),Y_(t.signal);let i=Mm(r),o=t.workerPool??sa.getWorkerFarm(t).getWorkerPool(eA(r,t,i));Um(t,[Rc(t),s]);let a=hf([nA(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 Dc,l=NM(e),f=!1,d=!1,h=!1,m=Promise.resolve(),b=new Error("Worker batch job failed"),g=()=>{!d&&!h&&(h=!0,CM(l))},y=()=>{f||(f=!0,u.close())},x=_=>{f||(f=!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":rA(_,t,I);break;case"input-request":m=m.then(async()=>{if(!_.isRunning)return;let N=await l.next();if(_.isRunning)if(N.done)d=!0,_.postMessage("input-done",{});else{if(Um(t,N.value),t.inputBytes!==void 0&&hf(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),y();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":tA(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 Zi(t.sharedState):void 0,cancellationMode:t.cancellationMode,cancellationTimeout:t.cancellationTimeout}).catch(_=>{throw g(),_});T.result.catch(_=>{x(_),g()});try{let _=Rc(t);T.isRunning&&T.postMessage("process-in-batches",{options:na(_),context:na(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(Z_("Worker batch iterator was closed")),g()}}function Y_(r){if(r?.aborted)throw Q_(r)}function Q_(r){return r?r.reason:Z_("Worker job was aborted")}function Z_(r){let e=new Error(r);return e.name="AbortError",e}function NM(r){return Symbol.asyncIterator in r?r[Symbol.asyncIterator]():(async function*(){yield*r})()}function CM(r){try{Promise.resolve(r.return?.()).catch(()=>{})}catch{}}function eA(r,e,t){if(e.source)return{name:t,source:e.source,workerType:e.workerType};let n=Dm(r,e);return n?{name:t,url:n,workerType:e.workerType}:zt&&r.loadWorker?{name:t,workerType:e.workerType,loadWorker:r.loadWorker,getUrl:()=>Rm(r,e),urlKey:km(r)}:{name:t,url:Rm(r,e),workerType:e.workerType}}async function tA(r,e,t,n,s){if(!(t.isCancelled&&n!=="done"&&n!=="error"))switch(n){case"progress":rA(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 l=u instanceof Error?u.message:"unknown error";t.postMessage("error",{id:o,error:l})}break;default:console.warn(`process-on-worker: unknown message ${n}`)}}function rA(r,e,t){if(!(!r.isRunning||r.isCancelled||!t.progress))try{e.onProgress?.(t.progress)}catch(n){r.abort(n)}}function Rc(r){let{signal:e,onProgress:t,onMetrics:n,workerPool:s,admission:i,workerType:o,...a}=r;return a}function Um(r,e){if(r.inputOwnership==="share"&&yt(e).length)throw new Error("Share ownership requires SharedArrayBuffer storage; ordinary transferables are not allowed")}function nA(r){let{sharedState:e,...t}=Rc(r);return t}var sA=p(()=>{z_();G_();q_();df();X_();ta();H_();J_()});var UM,jm,FK,pf=p(()=>{Om();sA();df();UM={},jm=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",FK=jm?`file://${jm.startsWith("/")?"":"/"}${encodeURI(jm).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:UM.url});function oA(r,e){if(!r.preload)return Promise.resolve();let t=Gm.get(r);return t||(t=Promise.resolve().then(()=>r.preload()).then(()=>{iA.add(r)}),Gm.set(r,t),t.catch(()=>Gm.delete(r))),PM(t,e)}function aA(r){return!r.preload||iA.has(r)}function PM(r,e){return e?new Promise((t,n)=>{let s=()=>{e.removeEventListener("abort",s),n(e.reason)};e.addEventListener("abort",s,{once:!0}),e.aborted&&s(),r.then(i=>{e.removeEventListener("abort",s),t(i)},i=>{e.removeEventListener("abort",s),n(i)})}):r}var Gm,iA,zm=p(()=>{Gm=new WeakMap,iA=new WeakSet});var kc,mf,Wm=p(()=>{kc=class extends Error{},mf=class{constructor(e){this.options=e,this.nextId=1,this.pending=new Map,this.incoming=new Map}request(e,t,n,s=[]){if(this.failure)return Promise.reject(this.failure.reason);if(n?.aborted)return Promise.reject(n.reason);let i=this.nextId++;return new Promise((o,a)=>{let c=()=>{let u=this.pending.get(i);u&&(this.pending.delete(i),u.cleanup(),a(n?.reason),this.send({source:"math.gl/tasks",kind:"cancel",id:i}))};this.pending.set(i,{resolve:o,reject:a,cleanup:()=>n?.removeEventListener("abort",c)}),n?.addEventListener("abort",c,{once:!0}),this.send({source:"math.gl/tasks",kind:"request",id:i,operation:e,value:t},s)})}emit(e,t,n=[]){if(this.failure)throw this.failure.reason;this.send({source:"math.gl/tasks",kind:"event",id:0,operation:e,value:t},n)}receive(e){if(!(this.failure||e?.source!=="math.gl/tasks")){if(e.kind==="failure"){let t=new Error(e.error?.message??"Task channel failed");this.close(t),this.options.onFailure?.(t)}else if(e.kind==="result"||e.kind==="error"){let t=this.pending.get(e.id);if(!t)return;if(this.pending.delete(e.id),t.cleanup(),e.kind==="result")t.resolve(e.value);else{let n=new kc(e.error?.message??"Task request failed");n.name=e.error?.name??"Error",t.reject(n)}}else if(e.kind==="cancel")this.incoming.get(e.id)?.abort(new DOMException("Task request cancelled","AbortError"));else if(e.kind==="event")try{this.options.handleEvent?.(e.operation,e.value)}catch(t){this.fail(t)}else if(e.kind==="request"){if(this.incoming.has(e.id)){this.fail(new Error("Duplicate task request identifier"));return}let t=new AbortController;this.incoming.set(e.id,t),Promise.resolve().then(()=>(t.signal.throwIfAborted(),this.options.handleRequest(e.operation,e.value,t.signal))).then(n=>{!t.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"result",id:e.id,value:n},this.options.getResultTransferList?.(n,e.value))}).catch(n=>{!t.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"error",id:e.id,error:{name:n instanceof Error?n.name:"Error",message:n instanceof Error?n.message:String(n)}})}).finally(()=>this.incoming.delete(e.id))}}}close(e=new Error("Task channel closed")){if(!this.failure){this.failure={reason:e};for(let t of this.pending.values())t.cleanup(),t.reject(e);this.pending.clear();for(let t of this.incoming.values())t.abort(e);this.incoming.clear()}}send(e,t=[]){if(!this.failure)try{this.options.send(e,t)}catch(n){this.fail(n)}}fail(e){if(!this.failure){this.close(e);try{this.options.send({source:"math.gl/tasks",kind:"failure",id:0,error:{name:e instanceof Error?e.name:"Error",message:e instanceof Error?e.message:String(e)}},[])}catch{}this.options.onFailure?.(e)}}}});function dn(r){if(!r||typeof r!="object"||Object.getPrototypeOf(r)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function wt(r,e="copy"){if(dn(r),!["copy","transfer","share"].includes(e))throw new TypeError("Invalid input ownership");let t=yt(r);if(e==="share"&&t.length)throw new TypeError("Share requires shared storage");return structuredClone(r,{transfer:e==="transfer"?t:[]})}function Nc(r,e={}){let t=e.signal??new AbortController().signal;return{state:r,signal:t,requestHost:async(n,s,i)=>{if(t.throwIfAborted(),!e.requestHost)throw new Error("No host request handler configured");return e.requestHost(n,s,i)},emitHost:(n,s)=>{t.throwIfAborted(),e.emitHost?.(n,s)},throwIfAborted:()=>{t.throwIfAborted(),e.throwIfAborted?.()},reportProgress:n=>e.reportProgress?.({...n,phase:n.phase??"process",unit:n.unit??"items"})}}function gf(r){return{signal:r.signal,reportProgress:e=>r.onProgress?.(e)}}var bf,$m=p(()=>{pf();zm();bf=class{constructor(e){this.task=e,this.initialized=!1}async initialize(e,t={}){if(this.initialized)throw new Error("Task is already initialized");return dn(e),await oA(this.task,t.signal),t.signal?.throwIfAborted(),this.state=await this.task.initialize?.(e,Nc(void 0,t)),this.initialized=!0,{}}async destroy(){if(this.initialized){this.initialized=!1;let e=this.state;this.state=void 0,this.task.initialize&&await this.task.destroy?.(e)}return{}}async process(e,t,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");dn(e);let s=await this.task.process(e,t,Nc(this.state,n));return dn(s),s}async*stream(e,t,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.processInBatches)throw new Error("Task has no streaming processor");for await(let s of this.task.processInBatches(e,t,Nc(this.state,n)))dn(s),yield s}}});function cA(r,e,t={}){if(!aA(r))throw new Error("Preload task on the main thread before runTaskSync");if("execution"in t)throw new TypeError("runTaskSync always runs on the calling thread");if(!r.process)throw new TypeError("Task has no atomic processor");for(let f of[r.initialize,r.process,r.destroy])if(f&&Object.prototype.toString.call(f)==="[object AsyncFunction]")throw new TypeError("runTaskSync requires synchronous lifecycle hooks");if(t.outputOwnership&&!["copy","transfer"].includes(t.outputOwnership))throw new TypeError("Invalid output ownership");let n=Nc(void 0,gf(t));n.throwIfAborted();let s=t.options??{};if(t.inputOwnership==="transfer"){let f=new Set(yt(s));if(yt(e).some(d=>f.has(d)))throw new Error("Transferred input aliases reusable options; use inputOwnership: copy")}let i=wt(s),o=wt(t.initialization??{},t.initializationOwnership),a=!1,c,u=!1,l;try{let f=r.initialize?.(o,n);if(qm(f))throw Promise.resolve(f).then(m=>r.destroy?.(m)).catch(()=>{}),new TypeError("runTaskSync initialize returned a promise");n.state=f,a=!0,n.throwIfAborted();let d=wt(e,t.inputOwnership),h=r.process(d,i,n);if(qm(h))throw a=!1,Promise.resolve(h).catch(()=>{}).then(()=>{if(r.initialize)return r.destroy?.(n.state)}).catch(()=>{}),new TypeError("runTaskSync process returned a promise");dn(h),n.throwIfAborted(),l=wt(h,t.outputOwnership??"transfer")}catch(f){u=!0,c=f}finally{if(a&&r.initialize)try{let f=r.destroy?.(n.state);if(qm(f))throw Promise.resolve(f).catch(()=>{}),new TypeError("runTaskSync destroy returned a promise")}catch(f){throw u?new AggregateError([c,f],"Task processing and destruction failed"):f}}if(u)throw c;return l}function qm(r){return!!(r&&(typeof r=="object"||typeof r=="function")&&typeof r.then=="function")}var uA=p(()=>{zm();pf();$m()});var yf,lA=p(()=>{yf=class{constructor(e){if(this.maxConcurrency=e,this.pending=[],this.active=0,this.exclusive=!1,this.closed=!1,this.idleWaiters=new Set,!Number.isSafeInteger(e)||e<1)throw new RangeError("maxConcurrency must be a positive safe integer")}run(e,t,n){return this.closed?Promise.reject(new Error("Task operation queue is closed")):e!=="parallel"&&e!=="exclusive"?Promise.reject(new TypeError("Invalid operation mode")):n?.aborted?Promise.reject(n.reason):new Promise((s,i)=>{let o=()=>{let c=this.pending.indexOf(a);c>=0&&(this.pending.splice(c,1),a.cancel(n?.reason),this.pump())},a={mode:e,cancel:c=>{n?.removeEventListener("abort",o),i(c)},start:()=>{n?.removeEventListener("abort",o),this.active++,e==="exclusive"&&(this.exclusive=!0),Promise.resolve().then(()=>(n?.throwIfAborted(),t())).then(s,i).finally(()=>{this.active--,e==="exclusive"&&(this.exclusive=!1),this.pump()})}};this.pending.push(a),n?.addEventListener("abort",o,{once:!0}),n?.aborted?o():this.pump()})}cancelPending(e){this.closed=!0;for(let t of this.pending.splice(0))t.cancel(e);this.pump()}close(){return this.closed=!0,this.whenIdle()}whenIdle(){return!this.active&&!this.pending.length?Promise.resolve():new Promise(e=>this.idleWaiters.add(e))}pump(){for(;!this.exclusive&&this.pending.length&&this.active<this.maxConcurrency;){let e=this.pending[0];if(e.mode==="exclusive"&&this.active||(this.pending.shift(),e.start(),e.mode==="exclusive"))break}if(!this.active&&!this.pending.length){for(let e of this.idleWaiters)e();this.idleWaiters.clear()}}}});var wf,fA=p(()=>{Mc();Wm();wf=class{constructor(e,t,n){this.thread=new Sr({name:e,url:t.url?.toString(),loadWorker:t.create,workerType:"module"}),this.channel=new mf({...n,send:(s,i)=>this.thread.postMessage({source:"loaders.gl/tasks",type:"task-channel",payload:s},i)}),this.thread.onMessage=s=>{s?.type==="task-channel"&&this.channel.receive(s.payload)},this.thread.onError=s=>{this.channel.close(s),n.onFailure?.(s)}}async destroy(e){this.channel.close(e),await this.thread.destroy()}}});async function VM(r,e){let t;try{t=await e()}catch(n){try{await r.close()}catch(s){throw new AggregateError([n,s],"Task processing and destruction failed")}throw n}return await r.close(),t}async function*Xm(r,e){let t=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator](),n=!1,s=!1;try{for(;;){let i=await new Promise((o,a)=>{let c=()=>e?.removeEventListener("abort",u),u=()=>{c(),a(e?.reason)};if(e?.addEventListener("abort",u,{once:!0}),e?.aborted){u();return}try{s=!0,Promise.resolve(t.next()).then(l=>{s=!1,c(),o(l)},l=>{s=!1,c(),a(l)})}catch(l){s=!1,c(),a(l)}});if(i.done){n=!0;return}yield i.value}}finally{if(!n)if(s)try{Promise.resolve(t.return?.()).catch(()=>{})}catch{}else await t.return?.()}}function dA(r,e,t){if(t==="transfer"){let n=new Set(yt(e));if(yt(r).some(s=>n.has(s)))throw new Error("Transferred input aliases reusable options; use inputOwnership: copy")}}var Km,Cc,hA=p(()=>{pf();$m();uA();lA();fA();Wm();Km=class{constructor(e,t,n){this.task=e,this.release=t,this.initializationControls=n,this.nextProgressId=1,this.progressCallbacks=new Map,this.callbackFailures=new Map,this.closed=!1,this.finalized=!1,this.streams=new Set,this.invalid=!1,this.controller=new AbortController;let s=n;this.runtime=new bf(e);let i=s.operationConcurrency??1,o=e.concurrency?.maxConcurrency??1;if(!Number.isSafeInteger(o)||o<1||!Number.isSafeInteger(i)||i<1||i>o)throw new RangeError("Task concurrency must be between 1 and the task maximum");this.operationQueue=new yf(i),this.concurrent=i>1;let a=s.execution??"auto";if(!["auto","main-thread","worker"].includes(a))throw new TypeError("Invalid execution mode");if(a==="worker"&&!e.worker)throw new Error("Task has no worker");if(a!=="main-thread"&&e.worker){let c=e.worker;if(!!c.url==!!c.create)throw new Error("Supply exactly one worker URL or factory");if(this.concurrent||s.onRequest||s.onEvent){this.workerChannel=new wf(e.id,c,{handleRequest:async(u,l,f)=>{if(u==="task:next-input"){if(!this.channelInputs)throw new Error("No active task stream");return this.channelInputs.next()}if(!s.onRequest)throw new Error("No host request handler configured");let d=l;if(u!=="task:host-request")throw new Error("Unknown host request");return s.onRequest(d.operation,d.payload,f)},getResultTransferList:(u,l)=>l.outputOwnership==="transfer"?yt(u):[],handleEvent:(u,l)=>{let{id:f}=l;try{if(u==="task:progress"){let d=l;(this.progressCallbacks.get(d.id)??this.streamProgress)?.(d.progress)}else if(u==="task:host-event"){let d=l;s.onEvent?.(d.operation,d.payload)}}catch(d){(this.progressCallbacks.has(f)||this.streamProgressId===f)&&(this.callbackFailures.has(f)||this.callbackFailures.set(f,{reason:d}))}},onFailure:u=>{this.invalid=!0,this.operationQueue.cancelPending(u),this.controller.abort(u)}});return}this.pool=new Hs({name:e.id,url:c.url?.toString(),loadWorker:c.create,workerType:"module",maxConcurrency:1,maxMobileConcurrency:1}),this.descriptor={id:e.id,name:e.id,module:"tasks",version:"prototype",options:{},worker:c.url?.toString()??!0,loadWorker:c.create,workerInBatches:c.capabilities.streaming}}}async initialize(e,t){try{dn(e),await this.enqueue(()=>this.invoke("initialize",e,{},t))}catch(n){throw await this.terminate(n),n}}runTask(e,...t){if(this.invalid)return Promise.reject(new Error("Initialized task is invalid; initialize a new instance"));if(this.closed)return Promise.reject(new Error("Initialized task is closed"));let n=t[0]?.timeout;if(n!==void 0&&(!Number.isSafeInteger(n)||n<0||n>4294967295))return Promise.reject(new RangeError("Invalid task timeout"));let s=n===void 0?void 0:AbortSignal.timeout(n),i=s&&t[0]?.signal?AbortSignal.any([s,t[0].signal]):s??t[0]?.signal,o={...t[0],signal:i},a=this.task.concurrency?.getSchedulingMode?.(e)??"exclusive";return this.operationQueue.run(a,async()=>{i?.throwIfAborted(),this.checkCapability("atomic");let c=()=>{this.concurrent&&(this.invalid=!0,this.operationQueue.cancelPending(i?.reason),this.controller.abort(i?.reason))};i?.addEventListener("abort",c,{once:!0});try{return await this.invoke("process",e,t[0]?.options??{},o)}finally{i?.removeEventListener("abort",c)}},i)}runTasks(e,...t){return this.serialStream(async function*(n){n.checkCapability("atomic");for await(let s of Xm(e,n.controls(t[0]).signal))yield await n.invoke("process",s,t[0]?.options??{},t[0])},t[0]?.signal)}runTaskInBatches(e,...t){return this.serialStream(async function*(n){n.checkCapability("streaming");let s=n.controls(t[0]),i=wt(t[0]?.options??{});async function*o(){for await(let c of Xm(e,s.signal))s.signal?.throwIfAborted(),dA(c,t[0]?.options??{},s.inputOwnership),yield wt(c,s.inputOwnership)}let a=!1;try{if(n.workerChannel){n.channelInputs=o()[Symbol.asyncIterator](),n.streamProgress=s.onProgress;try{for(await n.invoke("stream-open",{},i,s);;){let c=await n.invoke("stream-next",{},{},s);if(c.done)break;yield c.value}}finally{try{n.invalid||await n.invoke("stream-close",{},{},s)}finally{await n.channelInputs.return?.(),n.channelInputs=void 0,n.streamProgress=void 0,n.streamProgressId!==void 0&&n.callbackFailures.delete(n.streamProgressId),n.streamProgressId=void 0}}}else if(n.pool)await n.invoke("stream-options",{},i,s),yield*Vm(n.descriptor,o(),{...n.workerOptions(s),inputOwnership:"transfer",workerInBatches:!0});else for await(let c of n.runtime.stream(o(),i,n.runtimeContext(s)))s.signal?.throwIfAborted(),yield wt(c,s.outputOwnership??"transfer");a=!0}catch(c){throw n.workerChannel&&(n.invalid=!0,n.operationQueue.cancelPending(c),n.controller.abort(c),await n.workerChannel.destroy(c)),n.pool&&(n.invalid=!0,await n.pool.destroy(c)),c}finally{if(n.pool&&!a&&(n.invalid=!0),n.workerChannel&&!a&&!n.invalid){let c=new Error("Worker stream ended before completion");n.invalid=!0,n.operationQueue.cancelPending(c),n.controller.abort(c),await n.workerChannel.destroy(c)}}},t[0]?.signal)}get state(){return this.invalid?"invalid":this.finalized?"closed":this.closed?"closing":"ready"}close(){return this.closing||(this.closed=!0,this.closing=(async()=>{try{await this.operationQueue.close(),this.invalid?!this.pool&&!this.workerChannel&&await this.runtime.destroy():await this.invoke("destroy",{},{})}finally{try{await this.pool?.destroy(),await this.workerChannel?.destroy()}finally{this.finalized=!0,this.release()}}})()),this.closing}async terminate(e=new Error("Task terminated")){this.operationQueue.cancelPending(e),this.controller.abort(e),this.workerChannel&&(this.invalid=!0,await this.workerChannel.destroy(e)),this.pool&&(this.invalid=!0,await this.pool.destroy(e)),await Promise.allSettled([...this.streams].map(t=>t())),await this.close()}checkCapability(e){if(this.pool||this.workerChannel?!this.task.worker?.capabilities[e]:!(e==="atomic"?this.task.process:this.task.processInBatches))throw new Error(`Task has no ${e} processor for this execution route`)}controls(e={}){if(e.outputOwnership&&!["copy","transfer"].includes(e.outputOwnership))throw new TypeError("Invalid output ownership");return{...e,signal:e.signal?AbortSignal.any([e.signal,this.controller.signal]):this.controller.signal}}workerOptions(e){return{workerPool:this.pool,workerType:"module",inputOwnership:e.inputOwnership??"copy",outputOwnership:e.outputOwnership??"transfer",signal:e.signal,onProgress:e.onProgress,cancellationMode:"terminate"}}async invoke(e,t,n,s={}){if(this.invalid)throw new Error("Initialized task is invalid; initialize a new instance");let i=e==="destroy"?{}:this.controls(s);i.signal?.throwIfAborted(),dn(t),dA(t,n,i.inputOwnership);let o=wt(n);if(this.workerChannel){let l=this.nextProgressId++,f={input:wt(t,i.inputOwnership),options:o,outputOwnership:i.outputOwnership??"transfer",progressId:l};e==="stream-open"&&(this.streamProgressId=l),this.progressCallbacks.set(l,i.onProgress);let d;try{let h=await this.workerChannel.channel.request(e,f,i.signal,yt(f));if(d=this.callbackFailures.get(l)??(e.startsWith("stream-")&&this.streamProgressId!==void 0?this.callbackFailures.get(this.streamProgressId):void 0),d)throw d.reason;return h}catch(h){throw e==="process"&&!i.signal?.aborted&&(h instanceof kc||d)||(this.invalid=!0,this.operationQueue.cancelPending(h),this.controller.abort(h),await this.workerChannel.destroy(h)),h}finally{this.progressCallbacks.delete(l),this.streamProgressId!==l&&this.callbackFailures.delete(l)}}if(this.pool)try{return await Pm(this.descriptor,{operation:e,input:wt(t,i.inputOwnership),options:o},this.workerOptions({...i,inputOwnership:"transfer"}))}catch(l){throw this.invalid=!0,await this.pool.destroy(l),l}if(e==="destroy")return this.runtime.destroy();let a=wt(t,i.inputOwnership),c=this.runtimeContext(i);if(e==="initialize"){let l=await this.runtime.initialize(a,c);return i.signal?.throwIfAborted(),l}let u=await this.runtime.process(a,o,c);return i.signal?.throwIfAborted(),wt(u,i.outputOwnership??"transfer")}runtimeContext(e){return{...gf(e),requestHost:async(t,n,s={})=>{let i=e.signal??this.controller.signal;i.throwIfAborted();let o=this.initializationControls.onRequest;if(!o)throw new Error("No host request handler configured");let a=await o(t,wt(n,s.inputOwnership),i);return i.throwIfAborted(),structuredClone(a,{transfer:s.outputOwnership==="transfer"?yt(a):[]})},emitHost:(t,n)=>this.initializationControls.onEvent?.(t,structuredClone(n))}}enqueue(e){return this.closed?Promise.reject(new Error("Initialized task is closed")):this.operationQueue.run("exclusive",e)}serialStream(e,t){let n=new AbortController,s=AbortSignal.any([n.signal,this.controller.signal,t].filter(c=>!!c)),i=!1,o=this.acquireStream(e,s,()=>{i=!0}),a=()=>{i||n.abort(new Error("Stream returned before execution"))};return{[Symbol.asyncIterator](){return this},next:()=>o.next(),return:async()=>(a(),o.return(void 0)),throw:async c=>(a(),o.throw(c))}}async*acquireStream(e,t,n){if(this.closed)throw new Error("Initialized task is closed");let s,i=new Promise(d=>{s=d}),o,a=new Promise(d=>{o=d}),c=this.operationQueue.run("exclusive",async()=>{s(),await a},t);if(await Promise.race([i,c]),t.aborted)throw o(),t.reason;n();let u=e(this)[Symbol.asyncIterator](),l,f=()=>(l??(l=(async()=>{try{await u.return?.()}finally{this.streams.delete(f),o()}})()),l);this.streams.add(f);try{for(;;){this.controller.signal.throwIfAborted();let d=await u.next();if(d.done)return;yield d.value}}finally{await f()}}},Cc=class{constructor(e={}){if(this.active=new Set,this.count=0,this.waiters=[],this.closed=!1,this.initializing=new Set,this.iterations=new Set,this.maxConcurrency=e.maxConcurrency??1,!Number.isSafeInteger(this.maxConcurrency)||this.maxConcurrency<1)throw new RangeError("maxConcurrency must be a positive safe integer")}runTaskSync(e,t,...n){if(this.closed)throw new Error("Task runner is closed");if(this.count>=this.maxConcurrency)throw new Error("Task runner has no synchronous capacity");this.count++;try{return cA(e,t,n[0])}finally{let s=this.waiters.shift();s?s.resolve():this.count--}}initializeTask(e,t,n={}){let s=this.open(e,t,n);return this.initializing.add(s),s.then(()=>this.initializing.delete(s),()=>this.initializing.delete(s)),s}async runTask(e,t,...n){let s=n[0]??{},i=await this.initializeTask(e,s.initialization??{},{...s,inputOwnership:s.initializationOwnership??"copy"});return VM(i,()=>i.runTask(t,s))}async*runTasks(e,t,...n){let s=n[0]??{};if(this.closed)throw new Error("Task runner is closed");if(s.initializationOwnership==="transfer")throw new TypeError("runTasks initialization is a reusable template; use copy or share");let i=s.concurrency??1;if(!Number.isSafeInteger(i)||i<1||i>this.maxConcurrency)throw new RangeError("concurrency must be between 1 and maxConcurrency");let o=[],a=new Set,c=[],u=new AbortController;this.iterations.add(u);let l=s.signal?AbortSignal.any([s.signal,u.signal]):u.signal,f=Xm(t,l)[Symbol.asyncIterator](),d=!1,h;try{for(;!d||c.length;){l.throwIfAborted(),!d&&!h&&c.length<i&&(h=f.next().then(y=>({kind:"input",next:y})));let m=await Promise.race([...c.length?[c[0]]:[],...h?[h]:[]]);if(m.kind==="result"){if(c.shift(),a.delete(m.handle),m.failed)throw m.error;yield m.value;continue}if(h=void 0,m.next.done){d=!0;continue}let b=o.find(y=>!a.has(y));if(!b&&(o.length===0||this.count<this.maxConcurrency)&&(b=await this.initializeTask(e,wt(s.initialization??{},s.initializationOwnership),{...s,signal:l,inputOwnership:s.initializationOwnership??"copy"}),o.push(b)),!b){let y=await c.shift();if(a.delete(y.handle),y.failed)throw y.error;yield y.value,b=y.handle}a.add(b);let g=b;c.push(b.runTask(m.next.value,{...s,signal:l}).then(y=>({kind:"result",handle:g,value:y}),y=>({kind:"result",handle:g,failed:!0,error:y})))}}finally{this.iterations.delete(u),u.abort(new Error("Task iteration closed"));try{h&&await h.catch(()=>{}),d||await f.return?.()}finally{await Promise.all(c),await Promise.all(o.map(m=>m.close()))}}}async*runTaskInBatches(e,t,...n){let s=n[0]??{},i=await this.initializeTask(e,s.initialization??{},{...s,inputOwnership:s.initializationOwnership??"copy"});try{yield*i.runTaskInBatches(t,s)}finally{await i.close()}}close(){if(!this.closing){this.closed=!0;for(let e of this.waiters.splice(0))e.reject(new Error("Task runner is closed"));this.closing=(async()=>{await Promise.allSettled(this.initializing);let t=(await Promise.allSettled([...this.active].map(n=>n.close()))).find(n=>n.status==="rejected");if(t?.status==="rejected")throw t.reason})()}return this.closing}async terminate(e=new Error("Task runner terminated")){for(let n of this.iterations)n.abort(e);let t=this.close();await Promise.allSettled([...this.active].map(n=>n.terminate(e))),await t}async open(e,t,n){if(this.closed)throw new Error("Task runner is closed");n.signal?.throwIfAborted(),this.count>=this.maxConcurrency?await new Promise((a,c)=>{let u={resolve:()=>{f(),a()},reject:d=>{f(),c(d)}},l=()=>{this.waiters=this.waiters.filter(d=>d!==u),u.reject(n.signal?.reason)},f=()=>n.signal?.removeEventListener("abort",l);this.waiters.push(u),n.signal?.addEventListener("abort",l,{once:!0}),n.signal?.aborted&&l()}):this.count++;let s,i=!1,o=()=>{if(i)return;i=!0,s&&this.active.delete(s);let a=this.waiters.shift();a?a.resolve():this.count--};try{if(this.closed)throw new Error("Task runner is closed");return s=new Km(e,o,n),this.active.add(s),await s.initialize(t,n),s}catch(a){throw o(),a}}}});var pA=p(()=>{hA()});var mA=p(()=>{pA()});function Hm(r,e={}){let t=Xe?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=Jm(r,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(Xe)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 Jm(r,e={}){return(e[r.id]||{}).workerUrl||(r.id==="compression"?e.workerUrl:null)||null}function gA(r,e={}){let t=Hm(r,e),n=typeof r.worker=="string"?r.worker:null,s=t||n||jM(r,!0);return uf(s),s}function jM(r,e=!1){let t=Xe?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=r.version;n==="latest"&&(n=Am);let s=n?`@${n}`:"",i=`https://unpkg.com/@loaders.gl/${r.module}${s}/dist/${t}`;return e&&GM(r,i),i}function GM(r,e){if(r.version!=="latest")return;let t=`${r.module}:${r.id}`;bA.has(t)||(bA.add(t),console.warn(`loaders.gl: ${r.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var bA,yA=p(()=>{"use strict";vm();Fc();E_();bA=new Set});function wA(r){return{...r,phase:r.phase??"process",unit:r.unit??"items"}}var xA=p(()=>{"use strict"});function Ym(r,e=!0,t){let n=t||new Set;if(r){if(TA(r))n.add(r);else if(TA(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(let s in r)Ym(r[s],e,n)}}return t===void 0?Array.from(n):[]}function TA(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 Qm(r){if(r===null)return{};let e=Object.assign({},r);return Object.keys(e).forEach(t=>{r[t]!==null&&typeof r[t]=="object"&&!ArrayBuffer.isView(r[t])&&!(r[t]instanceof Array)?e[t]=Qm(r[t]):typeof e[t]=="function"||e[t]instanceof RegExp?e[t]={}:e[t]=r[t]}),e}var _A=p(()=>{"use strict"});function Zm(r,e={}){return!!((Xe?typeof Worker<"u":!!e._nodeWorkers)&&e.worker&&(r.worker||r.loadWorker||Jm(r,e)))}async function*eb(r,e,t={},n={},s={}){let i=qM(e),o;try{o=await $M(r,t,n,s);for await(let a of o.handle.runTaskInBatches(i,{...SA(t),options:WM(t)}))yield a.value}finally{i.return?.()?.catch(()=>{}),await o?.close()}}function zM(r,e){if(e.source||e.core?.source)throw new Error("Inline legacy worker source is unsupported; use a TaskRunner worker URL or factory");let t=!Hm(r,e)&&Xe?r.loadWorker:void 0,n=gA(r,e);return{id:`${r.module}:${r.id}`,initialize:s=>s,worker:{...t?{create:()=>t()??KM(n)}:{url:n},capabilities:{atomic:!0,streaming:!0}}}}function SA(r){return{execution:"worker",signal:r.signal,inputOwnership:r.inputOwnership??"transfer",outputOwnership:r.outputOwnership??"transfer",onProgress:r.onProgress?e=>r.onProgress?.(wA(e)):void 0}}function WM(r){let{signal:e,onProgress:t,...n}=r;return Qm(n)}async function $M(r,e,t,n){e.signal?.throwIfAborted();let s=zM(r,e),i=AA.get(r);i||(i={runner:new Cc({maxConcurrency:O_?e.maxMobileConcurrency??1:e.maxConcurrency??3}),requests:0},AA.set(r,i));let o=i,a=t.process?new MessageChannel:void 0,c=new AbortController,u=!1,l=()=>c.abort(e.signal?.reason);e.signal?.addEventListener("abort",l,{once:!0});let f=()=>{u=!0,e.signal?.removeEventListener("abort",l),c.abort(),a?.port1.close(),a?.port2.close()};a&&(a.port1.onmessage=async({data:b})=>{try{let g=await t.process(b.input,b.options,{signal:c.signal,throwIfAborted:()=>c.signal.throwIfAborted()},b.context);!u&&!c.signal.aborted&&a.port1.postMessage({identifier:b.identifier,value:g},Ym(g))}catch(g){if(u||c.signal.aborted)return;a.port1.postMessage({identifier:b.identifier,error:{name:g instanceof Error?g.name:"Error",message:g instanceof Error?g.message:String(g)}})}},a.port1.start()),o.requests++,vA.add(o);let d=!1,h=()=>{d||(d=!0,o.requests--,o.requests||vA.delete(o))},m;try{m=await o.runner.initializeTask(s,{context:structuredClone(n),...a?{port:a.port2}:{}},{...SA(e),inputOwnership:"transfer"})}catch(b){throw h(),f(),b}return{handle:m,async close(){try{await m.close()}finally{f(),h()}}}}function qM(r){let e=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator](),t=!1;return{[Symbol.asyncIterator](){return this},async next(){if(t)return{done:!0,value:void 0};let n=await e.next();return n.done||t?(t=!0,{done:!0,value:void 0}):{done:!1,value:{value:n.value}}},async return(){return t||(t=!0,await e.return?.()),{done:!0,value:void 0}}}}function KM(r){let e=new URL(r,globalThis.document?.baseURI??globalThis.location.href),t=e.href;if(/^https?:$/.test(e.protocol)&&e.origin!==globalThis.location.origin){let n=IA.get(e.href);n||(n=URL.createObjectURL(new Blob([`import ${JSON.stringify(e.href)};`],{type:"application/javascript"})),IA.set(e.href,n)),t=n}return new Worker(t,{type:"module"})}var AA,vA,IA,EA=p(()=>{"use strict";mA();yA();xA();_A();Fc();AA=new WeakMap,vA=new Set,IA=new Map});function hn(r={}){let e=r.useLocalLibraries??r.core?.useLocalLibraries,t=XM(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 XM(r,e){if(typeof r=="string"||r===null)return r;if(typeof e=="string"||e===null)return e}async function ia(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=rb(r,e,t,n),i=s&&(!(typeof c=="string")||typeof t.modules?.[s]=="string")?rb(s,e,t,s):r}let o=HM(r,i,Yi);return tb[o]=tb[o]||JM(r,i),await tb[o]}function HM(r,e,t){return t?JSON.stringify([r,e]):r}function rb(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(!Xe)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 uf(t.CDN.startsWith("http")),`${t.CDN}/${e}@${L_}/dist/libs/${n}`}return Yi?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${e}/src/libs/${n}`}async function JM(r,e){if(r.endsWith("wasm"))return await ZM(r);if(!Xe){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(Yi)return YM(r,e);let t=await e2(r);return QM(t,r)}async function YM(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 QM(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 ZM(r){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(Xe||!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 e2(r){let{readFileAsText:e}=globalThis.loaders||{};if(Xe||!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 tb,LA=p(()=>{"use strict";Fc();vm();B_();tb={}});var Js=p(()=>{"use strict";Fc();EA();LA()});function nb(r,e){let t=e?._nodeWorkers??e?.core?._nodeWorkers,n=e?.worker??e?.core?.worker;return!Gn&&!t?!1:Zm({...r,options:r.options||{}},{worker:!!n,_nodeWorkers:!!t})}var BA=p(()=>{"use strict";Js();wm()});function OA(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?FA(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?FA(r,0,e):""}function FA(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 MA=p(()=>{"use strict"});function sb(r){try{return JSON.parse(r)}catch{throw new Error(`Failed to parse JSON from data starting with "${OA(r)}"`)}}var DA=p(()=>{"use strict";MA()});function ib(...r){return RA(r)}function RA(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 eo(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 ob=p(()=>{"use strict"});function _e(r,e){return fr(r>=0),fr(e>0),r+(e-1)&~(e-1)}function to(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+_e(n.byteLength,4)}var ab=p(()=>{"use strict";ym()});function Uc(r,e,t,n){let s=_e(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 xf(r,e,t,n){let i=new TextEncoder().encode(t);return e=Uc(r,e,i,n),e}var kA=p(()=>{"use strict";ab()});function cb(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 NA=p(()=>{"use strict"});async function*ub(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*lb(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 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
|
|
38
|
+
`)}}e.length>0&&(yield e)}var CA=p(()=>{"use strict"});async function fb(r){let e=[];for await(let t of r)e.push(t2(t));return ib(...e)}function t2(r){if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r)){let{buffer:e,byteOffset:t,byteLength:n}=r;return UA(e,t,n)}return UA(r)}function UA(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 PA=p(()=>{"use strict";ob()});function ro(r){if(r instanceof ArrayBuffer)return r;if(__(r))return db(r);let{buffer:e,byteOffset:t,byteLength:n}=r;return e instanceof ArrayBuffer&&t===0&&n===e.byteLength?e:db(e,t,n)}function db(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 VA=p(()=>{"use strict";A_()});function hb(r){return{...r,batchType:"data",length:r.data.numRows}}var jA=p(()=>{"use strict"});var JX,YX,QX,ZX,GA=p(()=>{JX=Math.PI/2,YX=Math.PI/4,QX=Math.PI/6,ZX=Math.PI*2});function zA(r,{precision:e=st.precision}={}){return r=s2(r),`${parseFloat(r.toPrecision(e))}`}function oa(r){return Array.isArray(r)||ArrayBuffer.isView(r)&&!(r instanceof DataView)}function pb(r,e,t){let n=st.EPSILON;t&&(st.EPSILON=t);try{if(r===e)return!0;if(oa(r)&&oa(e)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;++s)if(!pb(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)<=st.EPSILON*Math.max(1,Math.abs(r),Math.abs(e)):!1}finally{st.EPSILON=n}}function s2(r){return Math.round(r/st.EPSILON)*st.EPSILON}var eH,tH,n2,st,Pc=p(()=>{eH=1/Math.PI*180,tH=1/180*Math.PI,n2={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...n2}};st=globalThis.mathgl.config});var Ys,Tf=p(()=>{Pc();Ys=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:oa(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toString(){return this.formatString(st)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+zA(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(!pb(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(st.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 i2(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 Ve(r){if(!Number.isFinite(r))throw new Error(`Invalid number ${JSON.stringify(r)}`);return r}function aa(r,e,t=""){if(st.debug&&!i2(r,e))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return r}var no=p(()=>{Pc()});var ca,mb=p(()=>{Tf();no();Pc();ca=class extends Ys{toString(){let e="[";if(st.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]=Ve(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 bb(r,e){if(!r)throw new Error(`math.gl assertion ${e}`)}var WA=p(()=>{});var _f,$A=p(()=>{Tf();no();WA();_f=class extends Ys{get x(){return this[0]}set x(e){this[0]=Ve(e)}get y(){return this[1]}set y(e){this[1]=Ve(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 Ve(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return Ve(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 bb(e>=0&&e<this.ELEMENTS,"index is out of range"),Ve(this[e])}setComponent(e,t){return bb(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 Af,bH,qA=p(()=>{Af=typeof Float32Array<"u"?Float32Array:Array,bH=Math.PI/180});function KA(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 XA(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 vf=p(()=>{});function HA(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 If(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 JA(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 YA(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 Sf=p(()=>{});function QA(){let r=new Af(3);return Af!==Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function a2(r){let e=r[0],t=r[1],n=r[2];return Math.sqrt(e*e+t*t+n*n)}function gb(r,e,t){let n=new Af(3);return n[0]=r,n[1]=e,n[2]=t,n}function ZA(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 yb(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function ua(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 Ef(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 Lf(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 e1(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],l=s*u-i*c,f=i*a-n*u,d=n*c-s*a,h=s*d-i*f,m=i*l-n*d,b=n*f-s*l,g=o*2;return l*=g,f*=g,d*=g,h*=2,m*=2,b*=2,r[0]=a+l+h,r[1]=c+f+m,r[2]=u+d+b,r}function t1(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 r1(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 n1(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 s1(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&&yb(r,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}var i1,la=p(()=>{qA();i1=a2});var wb,Bf,jc,o1=p(()=>{$A();Pc();no();la();Sf();wb=[0,0,0],jc=class r extends _f{static get ZERO(){return Bf||(Bf=new r(0,0,0),Object.freeze(Bf)),Bf}constructor(e=0,t=0,n=0){super(-0,-0,-0),arguments.length===1&&oa(e)?this.copy(e):(st.debug&&(Ve(e),Ve(t),Ve(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 st.debug&&(Ve(e.x),Ve(e.y),Ve(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]=Ve(e)}angle(e){return s1(this,e)}cross(e){return ua(this,this,e),this.check()}rotateX({radians:e,origin:t=wb}){return t1(this,this,t,e),this.check()}rotateY({radians:e,origin:t=wb}){return r1(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=wb}){return n1(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Ef(this,this,e),this.check()}transformAsVector(e){return If(this,this,e),this.check()}transformByMatrix3(e){return Lf(this,this,e),this.check()}transformByMatrix2(e){return JA(this,this,e),this.check()}transformByQuaternion(e){return e1(this,this,e),this.check()}}});function a1(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 c1(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],l=e[8],f=l*o-a*u,d=-l*i+a*c,h=u*i-o*c,m=t*f+n*d+s*h;return m?(m=1/m,r[0]=f*m,r[1]=(-l*n+s*u)*m,r[2]=(a*n-s*o)*m,r[3]=d*m,r[4]=(l*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 u1(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 xb(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],l=e[7],f=e[8],d=t[0],h=t[1],m=t[2],b=t[3],g=t[4],y=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*l,r[2]=d*i+h*c+m*f,r[3]=b*n+g*o+y*u,r[4]=b*s+g*a+y*l,r[5]=b*i+g*c+y*f,r[6]=x*n+T*o+_*u,r[7]=x*s+T*a+_*l,r[8]=x*i+T*c+_*f,r}function l1(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],l=e[7],f=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+l,r[8]=d*i+h*c+f,r}function f1(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],l=e[7],f=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]=l,r[8]=f,r}function Tb(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 d1(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,l=n*o,f=n*a,d=s*o,h=s*a,m=s*c,b=i*o,g=i*a,y=i*c;return r[0]=1-f-m,r[3]=l-y,r[6]=d+g,r[1]=l+y,r[4]=1-u-m,r[7]=h-b,r[2]=d-g,r[5]=h+b,r[8]=1-u-f,r}var _b=p(()=>{});function l2(){return Ff||(Ff=new zn([0,0,0,0,0,0,0,0,0]),Object.freeze(Ff)),Ff}function f2(){return Of||(Of=new zn,Object.freeze(Of)),Of}var Ab,u2,zn,Ff,Of,h1=p(()=>{mb();no();Sf();_b();vf();la();(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"})(Ab||(Ab={}));u2=Object.freeze([1,0,0,0,1,0,0,0,1]),zn=class extends ca{static get IDENTITY(){return f2()}static get ZERO(){return l2()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Ab}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(u2)}fromObject(e){return this.check()}fromQuaternion(e){return d1(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 u1(this)}transpose(){return a1(this,this),this.check()}invert(){return c1(this,this),this.check()}multiplyLeft(e){return xb(this,e,this),this.check()}multiplyRight(e){return xb(this,this,e),this.check()}rotate(e){return f1(this,this,e),this.check()}scale(e){return Array.isArray(e)?Tb(this,this,e):Tb(this,this,[e,e]),this.check()}translate(e){return l1(this,this,e),this.check()}transform(e,t){let n;switch(e.length){case 2:n=KA(t||[-0,-0],e,this);break;case 3:n=Lf(t||[-0,-0,-0],e,this);break;case 4:n=YA(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return aa(n,e.length),n}},Of=null});function d2(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 p1(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 m1(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],l=e[8],f=e[9],d=e[10],h=e[11],m=e[12],b=e[13],g=e[14],y=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,K=l*b-f*m,ne=l*g-d*m,be=l*y-h*m,Re=f*g-d*b,ke=f*y-h*b,ue=d*y-h*g,oe=x*ue-T*ke+_*Re+v*be-I*ne+N*K;return oe?(oe=1/oe,r[0]=(a*ue-c*ke+u*Re)*oe,r[1]=(s*ke-n*ue-i*Re)*oe,r[2]=(b*N-g*I+y*v)*oe,r[3]=(d*I-f*N-h*v)*oe,r[4]=(c*be-o*ue-u*ne)*oe,r[5]=(t*ue-s*be+i*ne)*oe,r[6]=(g*_-m*N-y*T)*oe,r[7]=(l*N-d*_+h*T)*oe,r[8]=(o*ke-a*be+u*K)*oe,r[9]=(n*be-t*ke-i*K)*oe,r[10]=(m*I-b*_+y*x)*oe,r[11]=(f*_-l*I-h*x)*oe,r[12]=(a*ne-o*Re-c*K)*oe,r[13]=(t*Re-n*ne+s*K)*oe,r[14]=(b*T-m*v-g*x)*oe,r[15]=(l*v-f*T+d*x)*oe,r):null}function b1(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],l=r[9],f=r[10],d=r[11],h=r[12],m=r[13],b=r[14],g=r[15],y=e*o-t*i,x=e*a-n*i,T=t*a-n*o,_=u*m-l*h,v=u*b-f*h,I=l*b-f*m,N=e*I-t*v+n*_,K=i*I-o*v+a*_,ne=u*T-l*x+f*y,be=h*T-m*x+b*y;return c*N-s*K+g*ne-d*be}function vb(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],l=e[7],f=e[8],d=e[9],h=e[10],m=e[11],b=e[12],g=e[13],y=e[14],x=e[15],T=t[0],_=t[1],v=t[2],I=t[3];return r[0]=T*n+_*a+v*f+I*b,r[1]=T*s+_*c+v*d+I*g,r[2]=T*i+_*u+v*h+I*y,r[3]=T*o+_*l+v*m+I*x,T=t[4],_=t[5],v=t[6],I=t[7],r[4]=T*n+_*a+v*f+I*b,r[5]=T*s+_*c+v*d+I*g,r[6]=T*i+_*u+v*h+I*y,r[7]=T*o+_*l+v*m+I*x,T=t[8],_=t[9],v=t[10],I=t[11],r[8]=T*n+_*a+v*f+I*b,r[9]=T*s+_*c+v*d+I*g,r[10]=T*i+_*u+v*h+I*y,r[11]=T*o+_*l+v*m+I*x,T=t[12],_=t[13],v=t[14],I=t[15],r[12]=T*n+_*a+v*f+I*b,r[13]=T*s+_*c+v*d+I*g,r[14]=T*i+_*u+v*h+I*y,r[15]=T*o+_*l+v*m+I*x,r}function g1(r,e,t){let n=t[0],s=t[1],i=t[2],o,a,c,u,l,f,d,h,m,b,g,y;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],l=e[4],f=e[5],d=e[6],h=e[7],m=e[8],b=e[9],g=e[10],y=e[11],r[0]=o,r[1]=a,r[2]=c,r[3]=u,r[4]=l,r[5]=f,r[6]=d,r[7]=h,r[8]=m,r[9]=b,r[10]=g,r[11]=y,r[12]=o*n+l*s+m*i+e[12],r[13]=a*n+f*s+b*i+e[13],r[14]=c*n+d*s+g*i+e[14],r[15]=u*n+h*s+y*i+e[15]),r}function y1(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 w1(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,l,f,d,h,m,b,g,y,x,T,_,v,I,N,K,ne,be,Re,ke,ue,oe,xe;return a<1e-6?null:(a=1/a,s*=a,i*=a,o*=a,u=Math.sin(t),c=Math.cos(t),l=1-c,f=e[0],d=e[1],h=e[2],m=e[3],b=e[4],g=e[5],y=e[6],x=e[7],T=e[8],_=e[9],v=e[10],I=e[11],N=s*s*l+c,K=i*s*l+o*u,ne=o*s*l-i*u,be=s*i*l-o*u,Re=i*i*l+c,ke=o*i*l+s*u,ue=s*o*l+i*u,oe=i*o*l-s*u,xe=o*o*l+c,r[0]=f*N+b*K+T*ne,r[1]=d*N+g*K+_*ne,r[2]=h*N+y*K+v*ne,r[3]=m*N+x*K+I*ne,r[4]=f*be+b*Re+T*ke,r[5]=d*be+g*Re+_*ke,r[6]=h*be+y*Re+v*ke,r[7]=m*be+x*Re+I*ke,r[8]=f*ue+b*oe+T*xe,r[9]=d*ue+g*oe+_*xe,r[10]=h*ue+y*oe+v*xe,r[11]=m*ue+x*oe+I*xe,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function x1(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],l=e[9],f=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+l*n,r[6]=a*s+f*n,r[7]=c*s+d*n,r[8]=u*s-i*n,r[9]=l*s-o*n,r[10]=f*s-a*n,r[11]=d*s-c*n,r}function T1(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],l=e[9],f=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-l*n,r[2]=a*s-f*n,r[3]=c*s-d*n,r[8]=i*n+u*s,r[9]=o*n+l*s,r[10]=a*n+f*s,r[11]=c*n+d*s,r}function _1(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],l=e[5],f=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+l*n,r[2]=a*s+f*n,r[3]=c*s+d*n,r[4]=u*s-i*n,r[5]=l*s-o*n,r[6]=f*s-a*n,r[7]=d*s-c*n,r}function A1(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,l=n*o,f=n*a,d=s*o,h=s*a,m=s*c,b=i*o,g=i*a,y=i*c;return r[0]=1-f-m,r[1]=l+y,r[2]=d-g,r[3]=0,r[4]=l-y,r[5]=1-u-m,r[6]=h+b,r[7]=0,r[8]=d+g,r[9]=h-b,r[10]=1-u-f,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function v1(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 h2(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 p2(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 E1(r,e,t,n){let s,i,o,a,c,u,l,f,d,h,m=e[0],b=e[1],g=e[2],y=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(g-I)<1e-6?d2(r):(f=m-_,d=b-v,h=g-I,s=1/Math.sqrt(f*f+d*d+h*h),f*=s,d*=s,h*=s,i=x*h-T*d,o=T*f-y*h,a=y*d-x*f,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-f*a,l=f*o-d*i,s=Math.sqrt(c*c+u*u+l*l),s?(s=1/s,c*=s,u*=s,l*=s):(c=0,u=0,l=0),r[0]=i,r[1]=c,r[2]=f,r[3]=0,r[4]=o,r[5]=u,r[6]=d,r[7]=0,r[8]=a,r[9]=l,r[10]=h,r[11]=0,r[12]=-(i*m+o*b+a*g),r[13]=-(c*m+u*b+l*g),r[14]=-(f*m+d*b+h*g),r[15]=1,r)}function Ib(r){if(r.length!==16||Array.from(r).some(s=>!Number.isFinite(s))||r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)throw new RangeError("Expected a finite affine matrix");let e=[Math.hypot(r[0],r[1],r[2]),Math.hypot(r[4],r[5],r[6]),Math.hypot(r[8],r[9],r[10])];if(e.some(s=>s===0||!Number.isFinite(s)))throw new RangeError("Singular transform");let t=Array.from({length:9},(s,i)=>r[Math.floor(i/3)*4+i%3]/e[Math.floor(i/3)]);for(let[s,i]of[[0,3],[0,6],[3,6]])if(Math.abs(t[s]*t[i]+t[s+1]*t[i+1]+t[s+2]*t[i+2])>1e-7)throw new RangeError("Sheared transforms do not have a TRS decomposition");if(t[0]*(t[4]*t[8]-t[5]*t[7])-t[3]*(t[1]*t[8]-t[2]*t[7])+t[6]*(t[1]*t[5]-t[2]*t[4])<0){e[0]=-e[0];for(let s=0;s<3;s++)t[s]=-t[s]}return{rotation:t,scale:e,translation:[r[12],r[13],r[14]]}}var I1,S1,Mf=p(()=>{I1=h2;S1=p2});function L1(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 B1(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 F1(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 O1(r){let e=r[0],t=r[1],n=r[2],s=r[3];return e*e+t*t+n*n+s*s}function M1(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 D1(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function R1(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 k1(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 Df=p(()=>{});function w2(){return Rf||(Rf=new Qs([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Rf)),Rf}function x2(){return kf||(kf=new Qs,Object.freeze(kf)),kf}function N1(r){if(r>Math.PI*2)throw Error("expected radians")}function T2(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),l=-1,f=-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]=l,r[11]=f,r[12]=0,r[13]=0,r[14]=d,r[15]=0,r}var Lb,b2,g2,Sb,Eb,y2,Qs,Rf,kf,C1=p(()=>{mb();Mf();no();Sf();Mf();vf();la();Df();(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"})(Lb||(Lb={}));b2=45*Math.PI/180,g2=1,Sb=.1,Eb=500,y2=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Qs=class extends ca{static get IDENTITY(){return x2()}static get ZERO(){return w2()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Lb}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,l,f,d,h,m,b,g){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]=l,this[10]=f,this[11]=d,this[12]=h,this[13]=m,this[14]=b,this[15]=g,this.check()}setRowMajor(e,t,n,s,i,o,a,c,u,l,f,d,h,m,b,g){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=o,this[6]=l,this[7]=m,this[8]=n,this[9]=a,this[10]=f,this[11]=b,this[12]=s,this[13]=c,this[14]=d,this[15]=g,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(y2)}fromObject(e){return this.check()}fromQuaternion(e){return A1(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=Sb,far:a=Eb}=e;return a===1/0?T2(this,t,n,s,i,o):v1(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 E1(this,t,n,s),this.check()}ortho(e){let{left:t,right:n,bottom:s,top:i,near:o=Sb,far:a=Eb}=e;return S1(this,t,n,s,i,o,a),this.check()}orthographic(e){let{fovy:t=b2,aspect:n=g2,focalDistance:s=1,near:i=Sb,far:o=Eb}=e;N1(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 N1(t),I1(this,t,n,s,i),this.check()}determinant(){return b1(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){let{rotation:n,scale:s}=Ib(this);if(e=e||new Array(16),t)for(let i=0;i<3;i++)t[i]=s[i];for(let i=0;i<16;i++)e[i]=0;for(let i=0;i<9;i++)e[Math.floor(i/3)*4+i%3]=n[i];return e[15]=1,e}getRotationMatrix3(e,t){let{rotation:n,scale:s}=Ib(this);if(e=e||new Array(9),t)for(let i=0;i<3;i++)t[i]=s[i];for(let i=0;i<9;i++)e[i]=n[i];return e}transpose(){return p1(this,this),this.check()}invert(){return m1(this,this),this.check()}multiplyLeft(e){return vb(this,e,this),this.check()}multiplyRight(e){return vb(this,this,e),this.check()}rotateX(e){return x1(this,this,e),this.check()}rotateY(e){return T1(this,this,e),this.check()}rotateZ(e){return _1(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,t){return w1(this,this,e,t),this.check()}scale(e){return y1(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return g1(this,this,e),this.check()}transform(e,t){return e.length===4?(t=k1(t||[-0,-0,-0,-0],e,this),aa(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){let{length:n}=e,s;switch(n){case 2:s=XA(t||[-0,-0],e,this);break;case 3:s=Ef(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return aa(s,e.length),s}transformAsVector(e,t){let n;switch(e.length){case 2:n=HA(t||[-0,-0],e,this);break;case 3:n=If(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return aa(n,e.length),n}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}}});function U1(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function Bb(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 Fb(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],l=t[3];return r[0]=n*l+o*a+s*u-i*c,r[1]=s*l+o*c+i*a-n*u,r[2]=i*l+o*u+n*c-s*a,r[3]=o*l-n*a-s*c-i*u,r}function P1(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 V1(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 j1(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 G1(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 Ob(r,e,t,n){let s=e[0],i=e[1],o=e[2],a=e[3],c=t[0],u=t[1],l=t[2],f=t[3],d,h,m,b,g;return d=s*c+i*u+o*l+a*f,d<0&&(d=-d,c=-c,u=-u,l=-l,f=-f),1-d>1e-6?(h=Math.acos(d),g=Math.sin(h),m=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(m=1-n,b=n),r[0]=m*s+b*c,r[1]=m*i+b*u,r[2]=m*o+b*l,r[3]=m*a+b*f,r}function z1(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 W1(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function $1(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}function Z1(r,e,t,n){if(e.length!==4||t.length!==4||[...Array.from(e),...Array.from(t),n].some(d=>!Number.isFinite(d)))throw new RangeError("Expected finite quaternions and step");if(e.length!==4||n<0)throw new RangeError("Expected quaternions and a nonnegative step");let s=Math.max(...Array.from(e,Math.abs)),i=Math.max(...Array.from(t,Math.abs));if(!s||!i)throw new RangeError("Zero quaternion");let o=Array.from(e,d=>d/s),a=Array.from(t,d=>d/i),c=Math.hypot(...o),u=Math.hypot(...a);for(let d=0;d<4;d++)o[d]/=c,a[d]/=u;let l=o.reduce((d,h,m)=>d+h*a[m],0),f=2*Math.acos(Math.min(1,Math.abs(l)));if(r.length<4)throw new RangeError("Result buffer is too short");return Ob(r,o,a,f===0?0:Math.min(1,n/f)),r}var q1,K1,X1,H1,J1,Y1,_2,Q1,Nf=p(()=>{la();Df();q1=L1,K1=B1,X1=D1,H1=R1,J1=F1,Y1=O1,_2=M1,Q1=(function(){let r=QA(),e=gb(1,0,0),t=gb(0,1,0);return function(n,s,i){let o=yb(s,i);return o<-.999999?(ua(r,e,s),i1(r)<1e-6&&ua(r,t,s),ZA(r,r),Bb(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ua(r,s,i),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,_2(n,n))}})()});var Gc,ev=p(()=>{Nf();Tf();no();Nf();Gc=class extends Ys{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 $1(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 Bb(this,e,t),this.check()}rotateTowards(e,t){return Z1(this,this,e,t)}identity(){return U1(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]=Ve(e)}get y(){return this[1]}set y(e){this[1]=Ve(e)}get z(){return this[2]}set z(e){this[2]=Ve(e)}get w(){return this[3]}set w(e){this[3]=Ve(e)}len(){return J1(this)}lengthSquared(){return Y1(this)}dot(e){return X1(this,e)}rotationTo(e,t){return Q1(this,e,t),this.check()}add(e){return q1(this,this,e),this.check()}calculateW(){return G1(this,this),this.check()}conjugate(){return W1(this,this),this.check()}invert(){return z1(this,this),this.check()}lerp(e,t,n){return n===void 0?this.lerp(this,e,t):(H1(this,e,t,n),this.check())}multiplyRight(e){return Fb(this,this,e),this.check()}multiplyLeft(e){return Fb(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 P1(this,this,e),this.check()}rotateY(e){return V1(this,this,e),this.check()}rotateZ(e){return j1(this,this,e),this.check()}scale(e){return K1(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),Ob(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 Cf(){return fa??Uint16Array}var fa,tv=p(()=>{fa=globalThis.Float16Array});var rv=p(()=>{tv()});var nv=p(()=>{rv()});var sv=p(()=>{_b()});var iv=p(()=>{Mf()});var ov=p(()=>{Nf()});var av=p(()=>{vf()});var cv=p(()=>{la()});var uv=p(()=>{Df()});var Uf=p(()=>{o1();h1();C1();ev();GA();nv();sv();iv();ov();av();cv();uv()});var Ue=p(()=>{"use strict";x_();ym();wm();v_();_m();_m();BA();DA();ob();ab();kA();NA();CA();PA();VA();jA()});function O2(r,e="float32"){return r instanceof Date?"date-millisecond":typeof r=="number"?e:typeof r=="boolean"?"bool":typeof r=="string"?"utf8":"null"}function zc(r){let e=Mb(r);return e!=="null"?{type:e,nullable:!1}:r.length>0?(e=O2(r[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function Mb(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 Pf=p(()=>{"use strict"});function Vf(r){return{fields:r.fields.map(e=>so(e)),metadata:hv(r.metadata)}}function hv(r){return Object.fromEntries(r)}function Db(r){return r?new Map(Object.entries(r)):new Map}function so(r){return{name:r.name,type:pv(r.type),nullable:r.nullable,metadata:hv(r.metadata)}}function Wn(r,e){return new O(r.name,jf(r.type,e),r.nullable,Db(r.metadata))}function pv(r){if(lv(r,"BinaryView"))return"binary-view";if(lv(r,"Utf8View"))return"utf8-view";if(M2(r,"LargeList"))return{type:"large-list",children:[so(r.valueField)]};switch(r.constructor){case Ne:return"null";case Ct:return"binary";case Pt:return{type:"fixed-size-binary",byteWidth:r.byteWidth};case lt:return"bool";case Fe:let e=r;return`${e.isSigned?"":"u"}int${e.bitWidth}`;case Zt:return"int8";case er:return"int16";case Pe:return"int32";case tr:return"int64";case rr:return"uint8";case nr:return"uint16";case vt:return"uint32";case Nr:return"uint64";case ct:switch(r.precision){case le.HALF:return"float16";case le.SINGLE:return"float32";case le.DOUBLE:return"float64";default:return"float16"}case Cr:return"float16";case It:return"float32";case sr:return"float64";case ut:return"utf8";case Ut:let n=r;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case Et:return r.unit===ye.DAY?"date-day":"date-millisecond";case os:return"date-day";case as:return"date-millisecond";case tt:switch(r.unit){case L.SECOND:return"time-second";case L.MILLISECOND:return"time-millisecond";case L.MICROSECOND:return"time-microsecond";case L.NANOSECOND:return"time-nanosecond";default:return"time-second"}case us:return"time-millisecond";case cs:return"time-second";case ls:return"time-microsecond";case fs:return"time-nanosecond";case rt:switch(r.unit){case L.SECOND:return"timestamp-second";case L.MILLISECOND:return"timestamp-millisecond";case L.MICROSECOND:return"timestamp-microsecond";case L.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case ds:return"timestamp-second";case Zr:return"timestamp-millisecond";case hs:return"timestamp-microsecond";case ps:return"timestamp-nanosecond";case ft:switch(r.unit){case ae.DAY_TIME:return"interval-daytime";case ae.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case ms:return"interval-daytime";case bs:return"interval-yearmonth";case dt:let c=r;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(b=>so(b))};case je:let l=r.valueField;return{type:"list",children:[so(l)]};case Be:let f=r;return{type:"fixed-size-list",listSize:f.listSize,children:[so(f.children[0])]};case pe:return{type:"struct",children:r.children.map(b=>so(b))};case gs:case _n:let h=r;return{type:h instanceof _n?"dense-union":"sparse-union",typeIds:h.typeIds,children:h.children.map(b=>so(b)),typeIdToChildIndex:{...h.typeIdToChildIndex}};case Ge:let m=r;return{type:"dictionary",id:m.id,indices:D2(m.indices),dictionary:pv(m.dictionary),isOrdered:m.isOrdered};default:throw new Error(`arrow type not supported: ${r.constructor.name}`)}}function jf(r,e){if(typeof r=="object")switch(r.type){case"decimal":return new Ut(r.scale,r.precision,r.bitWidth);case"map":{let t=r.children.map(n=>Wn(n,e));return new dt(t[0],r.keysSorted)}case"list":{let t=Wn(r.children[0],e);return new je(t)}case"large-list":{let t=Wn(r.children[0],e),n=Wc("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=Wn(r.children[0],e);return new Be(r.listSize,t)}case"fixed-size-binary":return new Pt(r.byteWidth);case"struct":{let t=r.children.map(n=>Wn(n,e));return new pe(t)}case"sparse-union":case"dense-union":{let t=r.children.map(n=>Wn(n,e));return r.type==="dense-union"?new _n(r.typeIds,t):new gs(r.typeIds,t)}case"dictionary":return new Ge(jf(r.dictionary,e),k2(r.indices),r.id,r.isOrdered);default:throw new Error("array type not supported")}switch(r){case"null":return new Ne;case"binary":return fv("BinaryView",new Ct,e);case"binary-view":return dv("BinaryView");case"bool":return new lt;case"int8":return new Zt;case"int16":return new er;case"int32":return new Pe;case"int64":return new tr;case"uint8":return new rr;case"uint16":return new nr;case"uint32":return new vt;case"uint64":return new Nr;case"float16":return new Cr;case"float32":return new It;case"float64":return new sr;case"utf8":return fv("Utf8View",new ut,e);case"utf8-view":return dv("Utf8View");case"date-day":return new os;case"date-millisecond":return new as;case"time-second":return new cs;case"time-millisecond":return new us;case"time-microsecond":return new ls;case"time-nanosecond":return new fs;case"timestamp-second":return new ds;case"timestamp-millisecond":return new Zr;case"timestamp-microsecond":return new hs;case"timestamp-nanosecond":return new ps;case"interval-daytime":return new ms;case"interval-yearmonth":return new bs;default:throw new Error("array type not supported")}}function Wc(r){return cn[r]}function lv(r,e){let t=Wc(e);if(t&&r instanceof t)return!0;let n=E;return!!(e==="BinaryView"?n.isBinaryView:n.isUtf8View)?.(r)}function M2(r,e){let t=Wc(e);return!!(t&&r instanceof t)}function fv(r,e,t){let n=t?.viewTypes||"never";if(n==="never")return e;let s=Wc(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 dv(r){let e=Wc(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 D2(r){if(r instanceof Fe){let t=`${r.isSigned?"int":"uint"}${r.bitWidth}`;if(R2(t))return t}switch(r.constructor){case Zt:return"int8";case er:return"int16";case Pe:return"int32";case rr:return"uint8";case nr:return"uint16";case vt:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${r.constructor.name}`)}}function R2(r){return["int8","int16","int32","uint8","uint16","uint32"].includes(r)}function k2(r){switch(r){case"int8":return new Zt;case"int16":return new er;case"int32":return new Pe;case"uint8":return new rr;case"uint16":return new nr;case"uint32":return new vt;default:throw new Error(`schema dictionary index type not supported: ${r}`)}}var Gf=p(()=>{"use strict";jn()});function Er(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 l=0;l<u;l+=3){let f=c[l],d=c[l+1],h=c[l+2];t=f<t?f:t,n=d<n?d:n,s=h<s?h:s,i=f>i?f:i,o=d>o?d:o,a=h>a?h:a}return[[t,n,s],[i,o,a]]}var Rb=p(()=>{"use strict"});function kb(r){let e=Cf();return new e(r)}function Zs(r){return!!(fa&&r instanceof fa)}function Nb(r,e,t){Zs(r)?r[e]=t:r[e]=mv(t)}function Cb(r,e){return Zs(r)?r[e]:N2(r[e])}function $c(r){return Zs(r)?new Uint16Array(r.buffer,r.byteOffset,r.length):r}function mv(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 N2(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 bv=p(()=>{"use strict";Uf()});var zf,Ub,gv=p(()=>{"use strict";jn();zf=new Q([new O("POSITION",new Be(3,new O("value",new It,!1)),!1)]),Ub=new Q([...zf.fields,new O("indices",new je(new O("item",new vt,!1)),!0)])});var qc=p(()=>{"use strict";bv();gv()});function yv(r){return r.type instanceof Be?r.type.listSize:1}function Pb(r,e,t){let n=C2(r,e,t);return new B([n])}function C2(r,e,t){let n=U2(r,e,t),s=n.children[0].type,i=t==="float16"&&Zs(r)?$c(r):r,o={[re.DATA]:i},a=new G(s,0,i.length,0,o);return new G(n,0,i.length/e,0,void 0,[a])}function U2(r,e,t){let n=t||zc(r).type,s=jf(n);return new Be(e,new O("value",s,!1))}var Vb=p(()=>{"use strict";qc();jn();Pf();Gf()});function ei(r,e){switch(e){case"columnar-table":return P2(r);case"arrow-table":return V2(r);default:throw new Error(e)}}function P2(r){let e={},t=Tv(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 V2(r,e){return xv(r.attributes,{schema:r.schema,topology:r.topology,mode:r.mode,boundingBox:r.header?.boundingBox,indices:Tv(r)?r.indices:void 0})}function xv(r,e={}){let t=[],n={},s=G2(r);for(let c of s){let u=r[c],{value:l,size:f=1}=u,d=j2(l,f,u.componentType);if(n[c]=d,t.push(z2(e.schema,c,d,u.componentType)),c==="POSITION"&&e.indices?.value?.length){let h=Ub.fields.find(m=>m.name==="indices");n.indices=$2(e.indices.value,d.length,h.type),t.push(h)}}let i=new Q(t,q2(e)),o=n[s[0]]?.length===0?new me(i):new me(i,n);return{shape:"arrow-table",schema:Vf(o.schema),data:o,topology:e.topology||"point-list",indices:e.indices}}function j2(r,e,t){if(t==="float16"){let n=Zs(r)?$c(r):r;if(e===1){let s=new G(new Cr,0,n.length,0,{[re.DATA]:n});return new B([s])}return Pb(r,e,t)}return e===1?rn(r):Pb(r,e)}function G2(r){let e=Object.keys(r),t=wv.filter(s=>s in r),n=e.filter(s=>!wv.includes(s));return[...t,...n]}function Tv(r){return!!r.indices?.value?.length}function z2(r,e,t,n){if(e==="POSITION"&&W2(t)){let i=zf.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 O(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 O(e,t.type,!1,i)}if(s&&s.type.toString()!==t.type.toString()){let i=Wn(s);return new O(e,t.type,i.nullable,i.metadata)}return s?Wn(s):new O(e,t.type,!1)}function W2(r){return r.type instanceof Be&&r.type.listSize===3&&r.type.children[0].type instanceof It}function $2(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 G(n.children[0].type,0,s.length,0,{[re.DATA]:s}),c=new G(n,0,e,Math.max(0,e-1),{[re.OFFSET]:i,[re.VALIDITY]:o},[a]);return new B([c])}function q2(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)),Db(e)}var wv,_v=p(()=>{"use strict";qc();qc();jn();Vb();Gf();wv=["POSITION"]});function pn(r){if(r.shape==="arrow-table")return K2(r);throw new Error(r.shape)}function K2(r){let e=r.data,t=Vf(e.schema),n=t.fields,s={},i=[];for(let l of n){let{name:f}=l;if(f==="indices")continue;let d=e.getChild(f),h=yv(d),m=Q2(d,h),b=H2(l.metadata),g=b.componentType==="float16"?Z2(m):m,y=i.find(x=>x.data.length===d.data.length&&s[x.name].value.constructor===g.constructor&&x.data.every((T,_)=>Av(T,d.data[_])));s[f]={value:y?s[y.name].value:g,size:h,...b},y||i.push({name:f,data:d.data})}Y2(t);let o=t.metadata.topology,a=eD(t),c=tD(e),u=s.POSITION?.transform?.type==="quantization"?X2(t)||Er(s):Er(s);return{schema:t,attributes:s,topology:o,mode:a,indices:c,header:{vertexCount:e.numRows,boundingBox:u??void 0}}}function X2(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 H2(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"]);J2(t)&&(e.transform=t)}catch{}return e}function J2(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 Y2(r){r.metadata||={},r.metadata.topology||="point-list",r.metadata.mode||="0"}function Q2(r,e){if(!(r.type instanceof Be))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,l=u+c<=a.values.length?u:0,f=a.values.subarray(l,l+c);s.set(f,i),i+=c}return s}function Z2(r){let e=kb(r.length);for(let t=0;t<r.length;t++)Nb(e,t,Cb(r,t));return e}function eD(r){let e=Number(r.metadata?.mode);return Number.isFinite(e)?e:0}function tD(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 Av(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)=>Av(n,e.children[s]))}var vv=p(()=>{"use strict";qc();jn();Vb();Gf();Rb()});function jb(r,e={}){return{fields:rD(r),metadata:e}}function Wf(r,e,t){let n=e.componentType||Mb(e.value),s=t||$f(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 rD(r){let e=[];for(let t in r){let n=r[t];e.push(Wf(t,n))}return e}function $f(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 Iv=p(()=>{"use strict";Pf()});var mn=p(()=>{"use strict";Pf();Rb();_v();vv();Iv()});function qf(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=nD(s,i);n.push(o)}return{fields:n,metadata:t}}function nD(r,e){let t={};for(let i in e)i!=="value"&&(t[i]=JSON.stringify(e[i]));let{type:n}=zc(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 Gb=p(()=>{"use strict";mn()});function Ev(r){let e=new $b;r.indexOf(`\r
|
|
39
39
|
`)!==-1&&(r=r.replace(/\r\n/g,`
|
|
40
40
|
`)),r.indexOf(`\\
|
|
41
41
|
`)!==-1&&(r=r.replace(/\\\n/g,""));let t=r.split(`
|
|
42
|
-
`),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let
|
|
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
|
-
|
|
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(`
|
|
42
|
+
`),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let l=0,f=t.length;l<f;l++)if(n=t[l],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 g=0,y=h.length;g<y;g++){let x=h[g];if(x.length>0){let T=x.split("/");m.push(T)}}let b=m[0];for(let g=1,y=m.length-1;g<y;g++){let x=m[g],T=m[g+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,g=d.length;b<g;b++){let y=d[b].split("/");y[0]!==""&&h.push(y[0]),y[1]!==""&&m.push(y[1])}}e.addLineGeometry(h,m)}else if(s==="p"){let h=n.substr(1).trim().split(" ");e.addPointGeometry(h)}else if(Sv.test(n)){o=Sv.exec(n)||[];let d=(" "+o[0].substr(1).trim()).substr(1);e.startObject(d)}else if(iD.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(sD.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 l of e.objects){let{geometry:f}=l;if(f.vertices.length===0)continue;let d={header:{vertexCount:f.vertices.length/3},attributes:{}};switch(f.type){case"Points":d.mode=0;break;case"Line":d.mode=1;break;default:d.mode=4;break}d.attributes.POSITION={value:new Float32Array(f.vertices),size:3},f.normals.length>0&&(d.attributes.NORMAL={value:new Float32Array(f.normals),size:3}),f.colors.length>0&&(d.attributes.COLOR_0={value:new Float32Array(f.colors),size:3}),f.uvs.length>0&&(d.attributes.TEXCOORD_0={value:new Float32Array(f.uvs),size:2}),d.materials=[];for(let h of l.materials){let m={name:h.name,flatShading:!h.smooth};d.materials.push(m),u.push(m)}d.name=l.name,c.push(d)}return{meshes:c,materials:u}}var Sv,sD,iD,zb,Wb,$b,Lv=p(()=>{"use strict";Sv=/^[og]\s*(.+)?/,sD=/^mtllib /,iD=/^usemtl /,zb=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})}},Wb=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 zb({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}},$b=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 Wb(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 l=this.vertices.length,f=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),h=this.parseVertexIndex(n,l);if(this.addVertex(f,d,h),s!==void 0&&s!==""){let m=this.uvs.length;f=this.parseUVIndex(s,m),d=this.parseUVIndex(i,m),h=this.parseUVIndex(o,m),this.addUV(f,d,h)}if(a!==void 0&&a!==""){let m=this.normals.length;f=this.parseNormalIndex(a,m),d=a===c?f:this.parseNormalIndex(c,m),h=a===u?f:this.parseNormalIndex(u,m),this.addNormal(f,d,h)}this.colors.length>0&&this.addColor(f,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 Kf(r,e){let{meshes:t}=Ev(r),n=t.reduce((a,c)=>a+c.header.vertexCount,0),s=oD(t,n),i={vertexCount:n,boundingBox:Er(s)??void 0},o=qf(s,{mode:4,boundingBox:i.boundingBox});return{loaderData:{header:{}},schema:o,header:i,mode:4,topology:"point-list",attributes:s}}function oD(r,e){let t=new Float32Array(e*3),n,s,i,o=0;for(let c of r){let{POSITION:u,NORMAL:l,COLOR_0:f,TEXCOORD_0:d}=c.attributes;t.set(u.value,o*3),l&&(n=n||new Float32Array(e*3),n.set(l.value,o*3)),f&&(s=s||new Float32Array(e*3),s.set(f.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 Bv=p(()=>{"use strict";mn();Lv();Gb()});function Fv(r,e){let t=ei(r,"arrow-table");return e?.obj?.shape==="mesh"?pn(t):t}function uD(r){let e=r?.batchSize??r?.core?.batchSize;return typeof e=="number"?e:void 0}function lD(r){return r.split(/\r?\n/).some(e=>{let t=e.trimStart();return t.startsWith("f ")||t.startsWith("l ")})}function*fD(r,e,t){let n=r.split(/\r?\n/).filter(s=>s.trimStart().startsWith("v "));yield*hD(n,e,t)}async function*dD(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 Xf(qb(s),e),s=[]));s.length>0&&(yield Xf(qb(s),e))}function*hD(r,e,t){let n=t||r.length||1;for(let s=0;s<r.length;s+=n){let i=qb(r.slice(s,s+n));yield Xf(i,e)}}function qb(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=Er(t);return{loaderData:{header:{}},schema:qf(t,{mode:0,boundingBox:n??void 0}),header:{vertexCount:r.length,boundingBox:n??void 0},mode:0,topology:"point-list",attributes:t}}function Xf(r,e){let t=ei(r,"arrow-table");if(e?.obj?.shape==="mesh"){let n=pn(t);return{shape:"mesh",batchType:"data",data:n,length:n.header?.vertexCount||0}}return hb(t)}function pD(r,e){let t=gm(r);return e?.obj?.shape==="mesh"?pn(t):t}function mD(r,e){let t=gm(r);return e?.obj?.shape!=="mesh"?t:{shape:"mesh",batchType:"data",data:pn(t),length:t.length}}var eY,aD,cD,Ov=p(()=>{"use strict";Ue();ea();mn();Gb();Bv();Dv();({preload:eY,...aD}=Mv);cD={...aD,parse:async(r,e)=>Fv(Kf(new TextDecoder().decode(r),e),e),parseTextSync:(r,e)=>Fv(Kf(r,e),e),parseInBatches:async function*(r,e){let t=uD(e);if(e?.obj?.pointCloud){let i=ub(r),o=lb(i);yield*dD(o,e,t);return}let n=await fb(r),s=new TextDecoder().decode(n);if(lD(s)){yield Xf(Kf(s,e),e);return}yield*fD(s,e,t)},serializeWorkerResult:Hi,deserializeWorkerResult:pD,serializeWorkerBatch:Hi,deserializeWorkerBatch:mD}});var Kb={};J(Kb,{OBJLoaderWithParser:()=>cD});var Xb=p(()=>{"use strict";Ov()});async function gD(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Xb(),Kb));return r}function yD(r){return r[0]==="v"}var bD,Mv,Dv=p(()=>{"use strict";lx();ea();bD="5.0.0-beta.5";Mv={...ux,dataType:null,batchType:null,version:bD,worker:!0,workerInBatches:!0,serializeWorkerResult:Hi,text:!0,testText:yD,options:{obj:{shape:"arrow-table"}},preload:gD}});var Rv,kv=p(()=>{"use strict";Rv={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]}});function Hb(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=Hf(c);break;case"kd":n.diffuseColor=Hf(c);break;case"map_kd":n.diffuseTextureUrl=c;break;case"ks":n.specularColor=Hf(c);break;case"map_ks":n.specularTextureUrl=c;break;case"ke":n.emissiveColor=Hf(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 Hf(r,e){let t=r.split(wD,3);return[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}var wD,Nv=p(()=>{"use strict";wD=/\s+/});var fY,xD,dY,TD,_D,AD,Cv=p(()=>{"use strict";Nv();Jb();Jb();({preload:fY,...xD}=Jf),{preload:dY,...TD}=Jf,_D={...xD},AD={...TD,parse:async(r,e)=>Hb(new TextDecoder().decode(r),e?.mtl),parseTextSync:(r,e)=>Hb(r,e?.mtl)}});var Yb={};J(Yb,{MTLLoaderWithParser:()=>AD,MTLWorkerLoaderWithParser:()=>_D});var Qb=p(()=>{"use strict";Cv()});async function ID(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Qb(),Yb));return r}var vD,Jf,Jb=p(()=>{"use strict";kv();vD="5.0.0-beta.5";Jf={...Rv,dataType:null,batchType:null,version:vD,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:ID}});var Yf,Zb=p(()=>{"use strict";Yf="5.0.0-beta.5"});var Uv,Pv,eg=p(()=>{"use strict";Uv={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"]},Pv={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]}});function Vv(r){return!BD(r,"ftyp",4)||(r[8]&96)===0?null:SD(r)}function SD(r){switch(ED(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ED(r,e,t){return String.fromCharCode(...r.slice(e,t))}function LD(r){return[...r].map(e=>e.charCodeAt(0))}function BD(r,e,t=0){let n=LD(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var jv=p(()=>{"use strict"});function $n(r){let e=Xc(r);return OD(e)||RD(e)||MD(e)||DD(e)||FD(e)}function FD(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=Vv(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function OD(r){let e=Xc(r);return e.byteLength>=33&&e.getUint32(0,dr)===2303741511&&e.getUint32(4,dr)===218765834&&e.getUint32(8,dr)===13&&e.getUint32(12,dr)===1229472850?{mimeType:"image/png",width:e.getUint32(16,dr),height:e.getUint32(20,dr)}:null}function MD(r){let e=Xc(r);return e.byteLength>=10&&e.getUint32(0,dr)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Kc),height:e.getUint16(8,Kc)}:null}function DD(r){let e=Xc(r);return e.byteLength>=14&&e.getUint16(0,dr)===16973&&e.getUint32(2,Kc)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Kc),height:e.getUint32(22,Kc)}:null}function RD(r){let e=Xc(r);if(!(e.byteLength>=3&&e.getUint16(0,dr)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=kD(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,dr);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,dr),width:e.getUint16(i+7,dr)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,dr)}return null}function kD(){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 Xc(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 dr,Kc,Qf=p(()=>{"use strict";jv();dr=!1,Kc=!0});var ND,CD,UD,Gv,zv=p(()=>{"use strict";Qf();ND=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],CD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],UD={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:CD,extensions:ND,tests:[r=>!!$n(new DataView(r))]},Gv={...UD,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Zf,tg=p(()=>{"use strict";Zf="5.0.0-beta.5"});function da(r){if(!r)return!1;if(PD.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 Wv(r,e){if(da(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 rg(r,e)}function rg(r,e){if(da(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}var PD,ed=p(()=>{"use strict";PD=/^data:image\/svg\+xml/});async function $v(r,e,t){let n=Wv(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await VD(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function VD(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 qv=p(()=>{"use strict";ed()});async function Xv(r,e,t){let n;da(t)?n=await $v(r,e,t):n=rg(r,t);let s=e&&e.imagebitmap;return await Jv(n,s)}async function Hv(r,e){let t=e&&e.imagebitmap;return await Jv(r,t)}async function Jv(r,e=null){if((jD(e)||!Kv)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),Kv=!1}return await createImageBitmap(r)}function jD(r){if(!r)return!0;for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}var Kv,Yv=p(()=>{"use strict";ed();qv();Kv=!0});async function Qv(r,e){let{mimeType:t}=$n(r)||{},n=globalThis.loaders?.parseImageNode;fr(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 Zv=p(()=>{"use strict";Ue();Qf()});async function ng(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n)return await Qv(r,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Xv(r,e,t?.url)}async function tI(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n||da(t?.url)||r.type.startsWith("image/svg+xml"))return await ng(await r.arrayBuffer(),e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Hv(r,e)}function rI(r){let e=r.image?.type;if(e&&e!=="imagebitmap")throw new Error(GD)}var GD,eI,nI=p(()=>{"use strict";Ue();Yv();ed();Zv();GD="@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.",eI="@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 sI={};J(sI,{ImageLoaderWithParser:()=>WD});var jY,zD,WD,iI=p(()=>{"use strict";nI();sg();({preload:jY,...zD}=Hc),WD={...zD,parse:ng,parseBlob:tI}});async function qD(){let{ImageLoaderWithParser:r}=await Promise.resolve().then(()=>(iI(),sI));return r}var $D,Hc,sg=p(()=>{"use strict";tg();zv();$D={image:{}};Hc={dataType:null,batchType:null,...Gv,version:Zf,options:$D,preload:qD}});function aI(r){let e=JD(r);if(!e)throw new Error("Not an image");return e}function Jc(r){switch(aI(r)){case"data":return r;case"imagebitmap":return KD(r)?XD(r):oI(r);case"image":return oI(r);default:throw new Error("getImageData")}}function KD(r){let e=globalThis.loaders?.isImageBitmapNode;return!!e?.(r)}function XD(r){let e=globalThis.loaders?.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(r)}function oI(r){let e=HD(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 HD(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 JD(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 cI=p(()=>{"use strict"});async function og(){return td?await td:(td=QD(),await td)}async function QD(){let r=new Set;for(let e of YD)(Gn?await tR(e):uI(e))&&r.add(e);return r}function ag(r){if(ig[r]===void 0){let e=Gn?ZD(r):uI(r);ig[r]=e}return ig[r]}function uI(r){let e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function ZD(r){switch(r){case"image/avif":case"image/webp":return rR(r);default:return!0}}async function tR(r){let e=eR[r];return e?await nR(e):!0}function rR(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}async function nR(r){return new Promise(e=>{let t=new Image;t.src=r,t.onload=()=>e(t.height>0),t.onerror=()=>e(!1)})}var YD,td,ig,eR,cg=p(()=>{"use strict";Ue();YD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg","image/svg+xml","image/bmp","image/vnd.microsoft.icon"],td=null;ig={};eR={"image/avif":"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=","image/webp":"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}});var lI,fI=p(()=>{"use strict";lI={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]}});function hI(r){if(!rd){r=r||iR()||void 0,rd=new Set;for(let e of sR)for(let t in dI)if(r&&r.getExtension(`${e}${t}`))for(let n of dI[t])rd.add(n)}return rd}function iR(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var sR,dI,rd,pI=p(()=>{"use strict";sR=["","WEBKIT_","MOZ_"],dI={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"]},rd=null});function bI(r=hI(),e,t={}){let n=new Set(r);if(!e)return aR(n);if(e.isHDR){let s=mI(e);return t.astcHDR&&(s==="astc-4x4"||s==="astc-6x6")&&nd(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 lg(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let s=mI(e);return s&&nd(n,s.slice(5))?s:ug(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?nd(n,"4x4")?"astc-4x4":ug(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):ug(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function aR(r){return nd(r,"4x4")?"astc-4x4":lg(r)?"bc7":gI(r)?{alpha:"bc3",noAlpha:"bc1"}:yI(r)?"etc2":r.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:wI(r)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:xI(r)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function ug(r,e,t){for(let n of t)switch(n){case"bc7":if(lg(r))return"bc7";break;case"bc":if(gI(r))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(yI(r))return"etc2";break;case"etc1":if(!e.hasAlpha&&r.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(wI(r))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(xI(r))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function mI(r){let e=`${r.blockWidth}x${r.blockHeight}`;return oR.includes(e)?`astc-${e}`:null}function nd(r,e){return ha(r,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function lg(r){return ha(r,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function gI(r){return ha(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 yI(r){return ha(r,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function wI(r){return ha(r,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function xI(r){return ha(r,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function ha(r,e){return e.some(t=>r.has(t))}var oR,TI=p(()=>{"use strict";pI();oR=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function vI(r){xm(r.modules);let e=Tm("basis");return e||(AI||=cR(r),await AI)}async function cR(r){let e=null,t=null;return[e,t]=await Promise.all([await ia(_I.TRANSCODER,"images",r,null,"basis_transcoder.mjs"),await ia(_I.TRANSCODER_WASM,"images",r)]),e=e||globalThis.BASIS,await uR(e,t)}function uR(r,e){let t={};return e&&(t.wasmBinary=e),Ji(()=>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 _I,AI,II=p(()=>{"use strict";Ue();Js();_I={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function SI(r){if(r.byteLength<fg.byteLength)return!1;let e=new Uint8Array(r,0,fg.byteLength);return fg.every((t,n)=>e[n]===t)}var fg,EI=p(()=>{"use strict";fg=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10])});async function hR(r){let e=LI,t;LI=new Promise(n=>{t=n}),await e;try{return await r()}finally{t()}}async function FI(r,e={}){return await hR(async()=>{let t=await vI(hn(e)),n=e.basis?.containerFormat||"auto";if(n==="ktx2"||n==="auto"&&SI(r)){if(!t.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return mR(t,r,e)}return pR(t,r,e)})}function pR(r,e,t){let n=new r.BasisFile(new Uint8Array(e));try{let s=MI(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),l=n.getImageHeight(o,c);a.push(OI(n,s,u,l,t,f=>n.getImageTranscodedSizeInBytes(o,c,f),(f,d)=>n.transcodeImage(f,o,c,d,0,0)))}i.push(a)}return i}finally{n.close(),n.delete()}}function mR(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=MI(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 l=0;l<a;l++){let f=[];for(let d=0;d<n.getLevels();d++){let h=n.getImageLevelInfo(d,u,l);f.push(OI(n,{...i,hasAlpha:!!h.alphaFlag},h.width,h.height,t,m=>n.getImageTranscodedSizeInBytes(d,u,l,m),(m,b)=>n.transcodeImage(m,d,u,l,b,0,-1,-1)))}c.push(f)}return c}finally{n.close(),n.delete()}}function OI(r,e,t,n,s,i,o){let a=gR(s,e);bR(e,dg(s,e));let c=i(a.basisFormat),u=wR(c,a.dataType);if(!o(u,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${dg(s,e)}`);let l=e.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:t,height:n,data:u,compressed:a.compressed,format:l&&a.srgbFormat||a.format,textureFormat:l?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:e.hasAlpha}}function bR(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 gR(r,e){let t=dg(r,e),n=BI[t];if(!n)throw new Error(`Unknown Basis format ${t}`);return n}function dg(r,e){let t=r.basis?.format||"auto";return t==="auto"&&(t=bI(r.basis?.supportedTextureFormats,e,r.basis?.supportedTextureFeatures)),typeof t=="object"&&(t=e.hasAlpha?t.alpha:t.noAlpha),t.toLowerCase()}function MI(r,e){let t=r.getBasisTexFormat(),n=yR[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 wR(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 it(r,e,t){return{basisFormat:r,compressed:!0,format:e,textureFormat:t}}function pa(r,e,t,n,s){return{basisFormat:r,compressed:!1,format:e,textureFormat:t,srgbFormat:n,srgbTextureFormat:s}}function $t(r,e,t,n){return{...it(r,e,`astc-${n}-unorm`),srgbFormat:t,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var Wt,BI,tZ,LI,yR,DI=p(()=>{"use strict";Js();TI();II();EI();Wt={"4x4":$t(10,37808,37840,"4x4"),"5x4":$t(28,37809,37841,"5x4"),"5x5":$t(29,37810,37842,"5x5"),"6x5":$t(30,37811,37843,"6x5"),"6x6":$t(31,37812,37844,"6x6"),"8x5":$t(32,37813,37845,"8x5"),"8x6":$t(33,37814,37846,"8x6"),"8x8":$t(36,37815,37847,"8x8"),"10x5":$t(34,37816,37848,"10x5"),"10x6":$t(35,37817,37849,"10x6"),"10x8":$t(37,37818,37850,"10x8"),"10x10":$t(38,37819,37851,"10x10"),"12x10":$t(39,37820,37852,"12x10"),"12x12":$t(40,37821,37853,"12x12")},BI={etc1:it(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...it(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...it(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...it(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:it(4,36283,"bc4-r-unorm"),bc5:it(5,36285,"bc5-rg-unorm"),bc7:{...it(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":it(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":it(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":Wt["4x4"],"astc-5x4":Wt["5x4"],"astc-5x5":Wt["5x5"],"astc-6x5":Wt["6x5"],"astc-6x6":Wt["6x6"],"astc-8x5":Wt["8x5"],"astc-8x6":Wt["8x6"],"astc-8x8":Wt["8x8"],"astc-10x5":Wt["10x5"],"astc-10x6":Wt["10x6"],"astc-10x8":Wt["10x8"],"astc-10x10":Wt["10x10"],"astc-12x10":Wt["12x10"],"astc-12x12":Wt["12x12"],"atc-rgb":it(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":it(12,34798,"atc-rgbai-unorm-webgl"),rgba32:pa(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:pa(14,36194,"rgb565unorm-webgl"),bgr565:pa(15,36194,"rgb565unorm-webgl"),rgba4444:pa(16,32854,"rgba4unorm-webgl"),"eac-r11":it(20,37488,"eac-r11unorm"),"eac-rg11":it(21,37490,"eac-rg11unorm"),bc6h:it(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":it(23,37808,"astc-4x4-unorm"),rgba16f:{...pa(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...pa(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":it(27,37812,"astc-6x6-unorm")},tZ=Object.freeze(Object.keys(BI)),LI=Promise.resolve();yR={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 RI={};J(RI,{BasisLoaderWithParser:()=>AR,BasisWorkerLoaderWithParser:()=>_R});var oZ,xR,aZ,TR,_R,AR,kI=p(()=>{"use strict";DI();sd();sd();({preload:oZ,...xR}=io),{preload:aZ,...TR}=io,_R={...xR},AR={...TR,parse:FI}});async function vR(){let{BasisLoaderWithParser:r}=await Promise.resolve().then(()=>(kI(),RI));return r}var io,sd=p(()=>{"use strict";fI();tg();io={...lI,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Zf,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:vR}});var qn=p(()=>{"use strict";sg();Qf();cI();cg();cg();sd()});function H(r,e){if(!r)throw new Error(e||"assert failed: gltf")}var oo=p(()=>{"use strict"});function FR(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 PI(r,e=0,t={}){let n=new DataView(r),{magic:s=NI}=t,i=n.getUint32(e,!1);return i===s||i===NI}function ad(r,e,t=0,n={}){let s=new DataView(e),i=FR(s,t+0),o=s.getUint32(t+4,ti),a=o===3?jI(s,t+8,"GLB byte length"):s.getUint32(t+8,ti);switch(Object.assign(r,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},jsonChunkIndex:-1,binChunks:[]}),r.version){case 1:return OR(r,s,t+id);case 2:return MR(r,s,t+id,n);case 3:return DR(r,s,t+UI,n);default:throw new Error(`Invalid GLB version ${r.version}. Only supports versions 1, 2 and 3.`)}}function OR(r,e,t){fr(r.header.byteLength>id+od);let n=r.header.byteOffset+r.header.byteLength;fr(n<=e.byteLength);let s=e.getUint32(t+0,ti),i=e.getUint32(t+4,ti);if(t+=od,fr(i===ER),t+s>n)throw new Error("GLB JSON content extends beyond the declared file length.");hg(r,e,t,s,0),t+=s;let o=n-t;return o>0&&pg(r,e,t,o,1),n}function MR(r,e,t,n){return fr(r.header.byteLength>id+od),VI(r,e,t,od,n),r.header.byteOffset+r.header.byteLength}function DR(r,e,t,n){return fr(r.header.byteLength>=UI+CI),VI(r,e,t,CI,n),r.header.byteOffset+r.header.byteLength}function VI(r,e,t,n,s){let i=r.header.byteOffset+r.header.byteLength;fr(i<=e.byteLength);let o=0;for(;t+n<=i;){let a=r.version===3,c=e.getUint32(t+(a?0:4),ti),u=a?e.getUint32(t+4,ti):0,l=a?jI(e,t+8,"GLB chunk length"):e.getUint32(t+0,ti);if(t+=n,u!==0)throw new Error(`Unsupported GLB chunk encoding ${u}.`);if(t+l>i)throw new Error("GLB chunk extends beyond the declared file length.");switch(c){case IR:(r.version!==3||r.jsonChunkIndex===-1)&&hg(r,e,t,l,o);break;case SR:pg(r,e,t,l,o);break;case LR:s.strict||hg(r,e,t,l,o);break;case BR:s.strict||pg(r,e,t,l,o);break;default:break}t+=mg(l),o++}return t}function hg(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,mg(n)}function pg(r,e,t,n,s){return r.header.hasBinChunk=!0,r.binChunks.push({chunkIndex:s,byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),mg(n)}function jI(r,e,t){let n=r.getBigUint64(e,ti);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`${t} exceeds JavaScript's safe integer range.`);return Number(n)}function mg(r){return Math.ceil(r/4)*4}var ti,NI,id,UI,od,CI,IR,SR,ER,LR,BR,bg=p(()=>{"use strict";Ue();ti=!0,NI=1735152710,id=12,UI=16,od=8,CI=16,IR=1313821514,SR=5130562,ER=0,LR=0,BR=1});function Kn(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return cd(r);let s=t?.baseUrl||RR(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 cd(i)}function cd(r){try{return new URL(r).href}catch{return r}}function RR(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var Yc=p(()=>{"use strict"});var ud,Qc,gg=p(()=>{"use strict";ud={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qc={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8}});function ma(r){return GI[r-1]||GI[0]}function Xn(r){let e=NR.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function Zc(r,e){let t=PR[r.componentType],n=CR[r.type],s=UR[r.componentType],i=r.count*n,o=r.count*n*s;H(o>=0&&o<=e.byteLength);let a=Qc[r.componentType],c=ud[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}var GI,kR,NR,CR,UR,PR,ri=p(()=>{"use strict";oo();gg();GI=["SCALAR","VEC2","VEC3","VEC4"],kR=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],NR=new Map(kR),CR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},UR={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},PR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array}});function hr(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 zI(r,e,t){let n=r.images[t];return hr(r,e,n.bufferView)}function ld(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}=Zc(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=yg(r,e,n);let u=n.sparse;if(!u)return c;let l=new s(i);new Uint8Array(l.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 f=yg(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=yg(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(l.buffer),b=o*s.BYTES_PER_ELEMENT,g=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let y=0;y<u.count;y++){let x=Number(f[y]);H(x>h&&x<n.count),m.set(g.subarray(y*b,(y+1)*b),x*b),h=x}return l}function yg(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:l,numberOfComponentsInElement:f}=Zc(t,n),d=l*f,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=_e(h*l,4),b=h>1?h*m:d,g=n.byteStride??b,y=h>1?(h-1)*m+h*l:d;if(H(g>=b),H((t.byteOffset||0)+(t.count===0?0:(t.count-1)*g+y)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*l){let _=n.byteStride??h*m,v=(h-1)*m+h*l;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 K=0;K<t.count;K++)for(let ne=0;ne<h;ne++){let be=new Uint8Array(i,a+K*_+ne*m,h*l);N.set(be,K*d+ne*h*l)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%l!==0){let v=new Uint8Array(i,a,u*l),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%l!==0){let N=new Uint8Array(i,v,d),K=new Uint8Array(d);K.set(N),I=new c(K.buffer,0,f)}else I=new c(i,v,f);T.set(I,_*f)}return T}var ao=p(()=>{"use strict";oo();Ue();ri()});function wg(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 fd(r,e,t,n){let s=r.json.files||[],i=typeof e=="number"?e:wg(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 l;if(a.uri!==void 0){let f=Kn(a.uri,t,n),d=await n.fetch(f);H(d?.ok,`Failed to fetch glTF file ${a.uri}: HTTP ${d?.status}.`);let h=await d.arrayBuffer();l={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength,mimeType:a.mimeType,name:a.name,url:f}}else{let f=hr(r.json,r.buffers,a.bufferView);l={arrayBuffer:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength,mimeType:a.mimeType,name:a.name}}return r.files[i]=l,l}var WI=p(()=>{"use strict";ao();Yc();oo()});var xg={};J(xg,{name:()=>co,preprocess:()=>VR});function VR(r){let{json:e}=r;if(!(!e.extensionsUsed?.includes(co)&&!e.extensionsRequired?.includes(co))){if(!e.extensionsUsed?.includes(co)||!e.extensionsRequired?.includes(co))throw new Error(`${co}: must be declared in extensionsUsed and extensionsRequired.`);for(let[t,n]of(e.accessors||[]).entries())if(n.componentType===5130&&n.normalized)throw new Error(`${co}: accessor ${t} must not be normalized.`)}}var co,$I=p(()=>{"use strict";co="KHR_accessor_float64"});function jR(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var bn,eu=p(()=>{"use strict";qn();Ue();oo();ri();ao();bn=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||jR(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=_e(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 hr(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(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=$n(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+=_e(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:ma(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:Xn(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]=_e(t,8),t=e[o]+_e(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=to(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&to(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 l=e[u.buffer];H(l!==void 0),u.byteOffset=l+(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=_e(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let l=o.length/s.size,f=new Uint8Array(l*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<l;m++)f.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(f);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:Xn(o),count:l})}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 GR(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return uo(r.channels)},get samplers(){return uo(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 uo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return uo(r.primitives)}};case"primitive":return{get attributes(){return qI(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(qI)}};case"node":return{get camera(){return r.camera?.data},get children(){return uo(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 uo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return uo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function lo(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function uo(r){return(function*(){for(let t of r)yield t.data})()}function qI(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function zR(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function KI(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}var Je,ni,Tg,_g,Ag,vg,dd,Ig,Sg,Eg,Lg,Bg,Fg,Og,Mg,Dg,Rg,kg,Ng,Cg,Ug,Pg,ie,He=p(()=>{"use strict";ao();ri();Je=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}},ni=class extends Je{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},Tg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},_g=class extends Je{get channels(){return lo(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Ag(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return lo(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new dd(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},Ag=class extends ni{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 dd(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 vg(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},vg=class extends ni{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},dd=class extends ni{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},Ig=class extends Je{get loadedBuffer(){return this.gltf.buffers[this.index]}},Sg=class extends Je{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)}},Eg=class extends Je{},Lg=class extends Je{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},Bg=class extends Je{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]}},Fg=class extends Je{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]}},Og=class extends Je{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 Mg(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Mg=class extends ni{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},Dg=class extends Je{get primitives(){return lo(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Rg(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Rg=class extends ni{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}`)])))}},kg=class extends Je{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return lo(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`)}},Ng=class extends Je{},Cg=class extends Je{get nodes(){return lo(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},Ug=class extends Je{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 lo(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},Pg=class extends Je{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`)}},ie=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return hr(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return zI(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:ma(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=GR(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof ni?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&&(KI(this.data.extensionsUsed,i),KI(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 lo(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=`${zR(e)}[${t}]`;switch(e){case"accessor":return new Tg(this,e,t,n,s);case"animation":return new _g(this,e,t,n,s);case"buffer":return new Ig(this,e,t,n,s);case"bufferView":return new Sg(this,e,t,n,s);case"camera":return new Eg(this,e,t,n,s);case"externalAsset":return new Lg(this,e,t,n,s);case"file":return new Bg(this,e,t,n,s);case"image":return new Fg(this,e,t,n,s);case"material":return new Og(this,e,t,n,s);case"mesh":return new Dg(this,e,t,n,s);case"node":return new kg(this,e,t,n,s);case"sampler":return new Ng(this,e,t,n,s);case"scene":return new Cg(this,e,t,n,s);case"skin":return new Ug(this,e,t,n,s);case"texture":return new Pg(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 XI(r){return(r%1+1)%1}function tu(r,e){return JI[e]*HI[r]}function ba(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=ga(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 ga(r,e,t,n=1){let s=HI[e],i=WR[t],o=JI[t],a=n*s,c=a*o,u=r.buffer,l=r.byteOffset;return l%o!==0&&(u=new Uint8Array(u).slice(l,l+c).buffer,l=0),new i(ro(u),l,a)}function ya(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,l=r.gltf.images?.[c];if(l&&typeof l.width<"u"&&!("compressed"in l&&l.compressed)){let f=[];for(let d=0;d<i.length;d+=2){let h=$R(l,u,i,d,e.channels);f.push(h)}return f}}return[]}function hd(r,e,t,n,s){if(!t?.length)return;let i=[];for(let f of t){let d=n.findIndex(h=>h===f);d===-1&&(d=n.push(f)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof ie?r:new ie(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),l=a.addAccessor(u,{size:1,componentType:Xn(o),count:o.length});s.attributes[e]=l}function $R(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=qR(o,a,r,c),l=0;for(let f of s){let d=typeof f=="number"?Object.values(i)[f]:i[f],h=u+d.offset,m=Jc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];l|=b<<d.shift}return l}function qR(r,e,t,n=1){let s=t.width,i=XI(r)*(s-1),o=Math.round(i),a=t.height,c=XI(e)*(a-1),u=Math.round(c),l=t.components?t.components:n;return(u*s+o)*l}function ru(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 nu(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 pd(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],l=[];for(let f=c;f<u;f++){let d=n[f],h=n[f+1],m=e.subarray(d,h);l.push(i.decode(m))}o.push(l)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),l=Number(n[c+1]);u>=0&&l>=u&&l<=e.length&&o.push(i.decode(e.subarray(u,l)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var HI,WR,JI,md=p(()=>{"use strict";He();ri();qn();Ue();HI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},WR={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},JI={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8}});var Vg={};J(Vg,{createExtMeshFeatures:()=>ZR,decode:()=>XR,encode:()=>HR,name:()=>KR});async function XR(r,e){let t=new ie(r);JR(t,e)}function HR(r,e){let t=new bn(r);return QR(t,e),t.createBinaryChunk(),t.gltf}function JR(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)YR(r,n,e)}function YR(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=ya(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 QR(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)ek(r,s)}function ZR(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 ek(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}=tk(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),l=r.addAccessor(u,{size:1,componentType:Xn(c),count:c.length});e.attributes[o]=l}})}function tk(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 wa,KR,YI=p(()=>{"use strict";eu();He();md();ri();wa="EXT_mesh_features",KR=wa});var Wg={};J(Wg,{createExtStructuralMetadata:()=>Sk,decode:()=>nk,encode:()=>sk,name:()=>rk});async function nk(r,e,t){let n=new ie(r),s=n.getExtension(fo);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=Kn(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()}ik(n,e)}function sk(r,e){let t=new bn(r);return vk(t,e),t.createBinaryChunk(),t.gltf}function ik(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(fo);t&&(e.gltf?.loadImages&&ok(r,t),ak(r,t))}function ok(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)ck(r,t,i,e)}function ak(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]&&lk(r,t,i)}function ck(r,e,t,n){if(!e)return;let i=t.extensions?.[fo]?.propertyTextures;if(i)for(let o of i){let a=e[o];uk(r,a,t,n)}}function uk(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=ya(r,a,t);u!==null&&(hd(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function lk(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=fk(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 fk(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=hk(r,t,s,n),l=pk(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let f=mk(t,s,n,c,u);o=f.data,i&&(i.value=f.rawData);break}case"BOOLEAN":{o=dk(t,n,c,u);break}case"STRING":{o=pd(n,c,u,l,t.array?t.count:void 0);break}case"ENUM":{o=wk(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function dk(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 jg(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>jg(t,i*r.count,r.count)):jg(t,0,e)}function jg(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 hk(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?ba(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function pk(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return ba(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function mk(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=tu(r.type,r.componentType),u=n.byteLength/c,l;r.componentType?l=ga(n,r.type,r.componentType,u):l=n;let f=l,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?bk(f,r.componentType,r.type,r.normalized,d,h):f;return i?s?{data:ru(m,t,s,a),rawData:ru(f,t,s,a)}:o?{data:nu(m,t,o,a),rawData:nu(f,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:f}}function bk(r,e,t,n,s,i){let o=yk(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=gk(t),u=new Float64Array(r.length);for(let l=0;l<r.length;l++){let f=Number(r[l]);a&&(f=e?.startsWith("INT")?Math.max(f/o,-1):f/o);let d=l%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[l]=f*m+h}return u}function gk(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 yk(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 wk(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=tu(e.type,a),u=n.byteLength/c,l=ga(n,e.type,a,u);if(l||(l=n),e.array){if(s)return xk({valuesData:l,numberOfElements:t,arrayOffsets:s,enumEntry:o});let f=e.count;return f?Tk(l,t,f,o):[]}return zg(l,0,t,o)}function xk(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=zg(e,a,c,s);i.push(u)}return i}function Tk(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=zg(r,o,t,n);s.push(a)}return s}function zg(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=_k(n,o);a?s.push(a.name):s.push("")}return s}function _k(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 vk(r,e){let t=r.getExtension(fo);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&Ik(n,i,r)}}function Ik(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=Bk(s,i,t);r.properties[n]=o}}}}function Sk(r,e,t=Ak){let n=r.getExtension(fo);n||(n=r.addExtension(fo)),n.schema=Ek(e,t,n.schema);let s=Lk(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function Ek(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 Lk(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 Bk(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=Mk(r);n.stringOffsets=Gg(i,t),n.values=Gg(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=Ok(r,e.componentType);n.values=Gg(s,t)}return n}function Ok(r,e){let t=[];for(let s of r)t.push(Number(s));let n=Fk[e];if(!n)throw new Error("Illegal component type");return new n(t)}function Mk(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 Gg(r,e){return e.addBufferView(r)}var fo,rk,Ak,Fk,QI=p(()=>{"use strict";eu();He();md();Yc();fo="EXT_structural_metadata",rk=fo;Ak="schemaClassId";Fk={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array}});var qg={};J(qg,{SPZ_COMPRESSION_EXTENSION_NAME:()=>su,decode:()=>Rk,getGaussianSplatPrimitives:()=>ZI,name:()=>$g});async function Rk(r,e,t){let n=t?.loaders?.find(o=>o.extensions?.includes("spz")),s=ZI(r),i=new ie(r);for(let[o,a]of(r.json.meshes||[]).entries())for(let[c,u]of a.primitives.entries()){let l=u.extensions?.[$g];if(!l)continue;let f=s.find(b=>b.meshIndex===o&&b.primitiveIndex===c),d=e?.gltf?.legacyGaussianSplatColorSpace,h=d&&l.extensions?.[su]?{...l,kernel:l.kernel??"ellipse",colorSpace:l.colorSpace??d}:l;f&&(f.extension=h),Nk(r.json,u,h,o,c,i);let m=l.extensions?.[su];if(m&&f){let b=e?.gltf?.splatDecoder,g=r.json.bufferViews?.[m.bufferView];if(g&&r.buffers[g.buffer])f.compressedBytes=kk(r,m.bufferView);else if(b||n)throw new Error(`KHR_gaussian_splatting: bufferView ${m.bufferView} is not loaded for SPZ2 decoding.`);n&&t&&f.compressedBytes?f.decoded=await Xs(f.compressedBytes.buffer,n,{...e,splats:{...e.splats,sourceCoordinateSystem:"LUF"}},t):b&&f.compressedBytes&&(f.decoded=await b(f.compressedBytes.buffer,{sourceCoordinateSystem:"LUF"}))}}s.length&&(r.gaussianSplatPrimitives=s)}function kk(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 ZI(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?.[$g];if(!a)continue;let c=a.extensions?.[su]?.bufferView;t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a,compressedBufferView:c})}return t}function Nk(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?.[su]?.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 Dk)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}.`);Ck(r,e,i,n,s);for(let a=1;a<=3;a++){let c=a*2+1,u=Array.from({length:c},(l,f)=>e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${a}_COEF_${f}`]!==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 l=a-1,f=l*2+1;for(let d=0;d<f;d++)if(e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${l}_COEF_${d}`]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} skips SH degree ${l}.`)}}}function Ck(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,l=>l>=0],["KHR_gaussian_splatting:OPACITY",o,l=>l>=0&&l<=1]]){if(c===void 0||!Uk(r,t,c))continue;let l=t.getTypedArrayForAccessor(c);for(let f=0;f<l.length;f++)if(!u(Number(l[f])))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid ${a} value.`)}}function Uk(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 $g,su,Dk,eS=p(()=>{"use strict";Ue();He();$g="KHR_gaussian_splatting",su="KHR_gaussian_splatting_compression_spz_2",Dk=["POSITION","KHR_gaussian_splatting:ROTATION","KHR_gaussian_splatting:SCALE","KHR_gaussian_splatting:OPACITY","KHR_gaussian_splatting:SH_DEGREE_0_COEF_0"]});var Xg={};J(Xg,{decode:()=>Pk,getVoxelPrimitives:()=>Vk,name:()=>Kg});async function Pk(r){for(let[e,t]of(r.json.meshes||[]).entries())for(let[n,s]of t.primitives.entries()){let i=s.extensions?.[Kg];i&&jk(r.json,s,i,e,n)}}function Vk(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?.[Kg];a&&t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a})}return t}function jk(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 Kg,tS=p(()=>{"use strict";Kg="EXT_primitive_voxels"});var Hg={};J(Hg,{decode:()=>zk,getPrimitiveRestartRanges:()=>bd,name:()=>si});async function zk(r,e){if(!r.json.extensionsUsed?.includes(si))return;if(!r.json.extensionsRequired?.includes(si))throw new Error(`${si} must be declared in extensionsRequired`);if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives)Wk(t,s)}function Wk(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(`${si}: primitive references missing indices accessor ${e.indices}`);let s=$k(n),i=r.getTypedArrayForAccessor(e.indices),o=Array.prototype.includes.call(i,s);if(!Gk.has(e.mode??4)){if(o)throw new Error(`${si}: 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:bd(i,s)}})}function $k(r){if(r.type!=="SCALAR")throw new Error(`${si}: 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(`${si}: indices accessor must use an unsigned integer component type`)}}function bd(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 si,Gk,Jg=p(()=>{"use strict";He();si="KHR_mesh_primitive_restart",Gk=new Set([2,3,5,6])});var Yg={};J(Yg,{decode:()=>qk,name:()=>qt});async function qk(r,e){if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives){let i=t.getExtension(s,qt);i&&Object.defineProperty(i,"data",{configurable:!0,enumerable:!1,writable:!0,value:Kk(t,s,i)})}}function Kk(r,e,t){if(!Number.isInteger(t.count)||t.count<1)throw new Error(`${qt}: count must be a positive integer`);if((e.mode??4)!==4||e.indices===void 0)throw new Error(`${qt}: primitive must use TRIANGLES mode with indices`);let n=gd(r,e.indices,"indices"),s=gd(r,t.indicesOffsets,"indicesOffsets",t.count),i=gd(r,t.loopIndices,"loopIndices"),o=gd(r,t.loopIndicesOffsets,"loopIndicesOffsets",t.count),a=r.data.accessors?.[t.loopIndices],c=Xk(a.componentType);rS(s,n.length,"indicesOffsets"),rS(o,i.length,"loopIndicesOffsets");let u=[];for(let l=0;l<t.count;l++){let f=Number(s[l]),d=l+1<t.count?Number(s[l+1]):n.length,h=Number(o[l]),m=l+1<t.count?Number(o[l+1]):i.length,b=Array.from(i).slice(h,m),g=bd(b,c).map(y=>({offset:y.offset+h,count:y.count}));if((d-f)%3!==0)throw new Error(`${qt}: polygon ${l} triangle range must contain complete triangles`);if(g.length===0)throw new Error(`${qt}: polygon ${l} must contain at least one loop`);if(g.some(y=>y.count<3))throw new Error(`${qt}: polygon ${l} loops must contain at least three indices`);u.push({triangleRange:{offset:f,count:d-f},loopRanges:g})}return{indicesOffsets:s,loopIndices:i,loopIndicesOffsets:o,polygons:u}}function gd(r,e,t,n){if(typeof e=="number"&&(!Number.isInteger(e)||e<0))throw new Error(`${qt}: ${t} must reference an accessor`);let s=typeof e=="number"?r.data.accessors?.[e]:e;if(!s)throw new Error(`${qt}: ${t} references missing accessor ${e}`);if(s.type!=="SCALAR"||![5121,5123,5125].includes(s.componentType))throw new Error(`${qt}: ${t} must be an unsigned integer SCALAR accessor`);if(n!==void 0&&s.count!==n)throw new Error(`${qt}: ${t} count must equal polygon count ${n}`);return r.getTypedArrayForAccessor(e)}function rS(r,e,t){if(Number(r[0])!==0)throw new Error(`${qt}: ${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(`${qt}: ${t} must contain increasing in-bounds offsets`);n=i}}function Xk(r){switch(r){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${qt}: unsupported loop index component type ${r}`)}}var qt,nS=p(()=>{"use strict";He();Jg();qt="EXT_mesh_polygon"});var Qg={};J(Qg,{decode:()=>Hk,getSpatialAudio:()=>sS,name:()=>xa});function sS(r){let e="asset"in r?r:r.json,t=[],n=e.extensions?.[xa];n&&t.push({nodeIndex:null,extension:n});for(let[s,i]of(e.nodes||[]).entries()){let o=i.extensions?.[xa];o&&t.push({nodeIndex:s,extension:o})}return t}async function Hk(r){let e=sS(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(`${xa}: ${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(`${xa}: ${s} source ${i.id} has invalid accessor ${o}.`);if(i.reverbFeedGain&&i.reverbFeedGain.length!==(i.reverbFeed?.length||0))throw new Error(`${xa}: ${s} source ${i.id} has mismatched reverb feed gains.`)}}e.length&&(r.spatialAudio=e)}var xa,iS=p(()=>{"use strict";xa="MPEG_audio_spatial"});var Zg={};J(Zg,{decode:()=>Jk,name:()=>Kt});async function Jk(r,e,t){let n=r.json.extensions?.[Kt],s=(n?.audio||[]).map(c=>({audio:c})),i=n?.sources||[],o=n?.emitters||[];for(let c of i)c.audio!==void 0&&yd(s,c.audio,"audio");for(let c of o){if(c.type!=="global"&&c.type!=="positional")throw new Error(`${Kt}: invalid emitter type ${c.type}.`);if(c.type==="global"&&c.positional!==void 0)throw new Error(`${Kt}: global emitters cannot have positional settings.`);for(let u of c.sources||[])yd(i,u,"source")}let a=[];for(let c of["nodes","scenes"])for(let[u,l]of(r.json[c]||[]).entries()){let f=l.extensions?.[Kt];if(f){if(!Array.isArray(f.emitters)||!f.emitters.length)throw new Error(`${Kt}: ${c} ${u} requires emitters.`);for(let d of f.emitters){let h=yd(o,d,"emitter");if(c==="scenes"&&h.type!=="global")throw new Error(`${Kt}: 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)Yk(r,c);e.gltf?.loadAudio!==!1&&await Promise.all(s.map(c=>Qk(r,c,e,t))),r.audioClips=s,r.audioEmitters=a}}function yd(r,e,t){if(!Number.isInteger(e)||e<0||!r[e])throw new Error(`${Kt}: invalid ${t} index ${e}.`);return r[e]}function Yk(r,e){let{audio:t}=e;if(t.bufferView!==void 0){if(yd(r.json.bufferViews||[],t.bufferView,"bufferView"),!t.mimeType)throw new Error(`${Kt}: buffer-view audio requires mimeType.`)}else if(!t.uri)throw new Error(`${Kt}: audio requires a uri or bufferView.`)}async function Qk(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(`${Kt}: audio buffer ${a.buffer} is not loaded.`)}let u=a.byteOffset??0,l=a.byteLength;if(!Number.isSafeInteger(u)||u<0||!Number.isSafeInteger(l)||l<0||u+l>c.byteLength||c.byteOffset+u+l>c.arrayBuffer.byteLength)throw new Error(`${Kt}: audio bufferView exceeds its buffer.`);e.data=new Uint8Array(c.arrayBuffer,c.byteOffset+u,l);return}if(!n?.fetch)throw new Error(`${Kt}: a loader context is required to load audio.`);let i=Kn(s.uri,t,n),o=await n.fetch(i);if(!o.ok)throw new Error(`${Kt}: failed to load audio ${i} (${o.status}).`);e.url=i,e.data=new Uint8Array(await o.arrayBuffer())}var Kt,oS=p(()=>{"use strict";Yc();Kt="KHR_audio_emitter"});var aS={};J(aS,{MeshoptDecoder:()=>Zk});var Zk,cS=p(()=>{"use strict";Zk=(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(y){i=y.instance,i.exports.__wasm_call_ctors()});function a(y){for(var x=new Uint8Array(y.length),T=0;T<y.length;++T){var _=y.charCodeAt(T);x[T]=_>96?_-97:_>64?_-39:_+4}for(var v=0,T=0;T<y.length;++T)x[v++]=x[T]<60?n[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(y,x,T,_,v,I,N){var K=y.exports.sbrk,ne=_+3&-4,be=K(ne*v),Re=K(I.length),ke=new Uint8Array(y.exports.memory.buffer);ke.set(I,Re);var ue=x(be,_,v,Re,I.length);if(ue==0&&N&&N(be,ne,v),T.set(ke.subarray(be,be+_*v)),K(be-K(0)),ue!=0)throw new Error("Malformed buffer data: "+ue)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],d=0;function h(y){var x={object:new Worker(y),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(y){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 = "+g.name+";"+c.toString()+g.toString(),T=new Blob([x],{type:"text/javascript"}),_=URL.createObjectURL(T),v=f.length;v<y;++v)f[v]=h(_);for(var v=y;v<f.length;++v)f[v].object.postMessage({});f.length=y,URL.revokeObjectURL(_)}function b(y,x,T,_,v){for(var I=f[0],N=1;N<f.length;++N)f[N].pending<I.pending&&(I=f[N]);return new Promise(function(K,ne){var be=new Uint8Array(T),Re=++d;I.pending+=y,I.requests[Re]={resolve:K,reject:ne},I.object.postMessage({id:Re,count:y,size:x,source:be,mode:_,filter:v},[be.buffer])})}function g(y){var x=y.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(y){m(y)},decodeVertexBuffer:function(y,x,T,_,v){c(i,i.exports.meshopt_decodeVertexBuffer,y,x,T,_,i.exports[u[v]])},decodeIndexBuffer:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexBuffer,y,x,T,_)},decodeIndexSequence:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexSequence,y,x,T,_)},decodeGltfBuffer:function(y,x,T,_,v,I){c(i,i.exports[l[v]],y,x,T,_,i.exports[u[I]])},decodeGltfBufferAsync:function(y,x,T,_,v){return f.length>0?b(y,x,T,l[_],u[v]):o.then(function(){var I=new Uint8Array(y*x);return c(i,i.exports[l[_]],I,y,x,T,i.exports[u[v]]),I})}}})()});function uS(){return Promise.resolve().then(()=>(cS(),aS))}var lS=p(()=>{"use strict"});async function eN(){return wd||(wd=uS().then(async({MeshoptDecoder:r})=>(await r.ready,r),r=>{throw wd=void 0,new Error("Failed to load the packaged meshopt decoder.",{cause:r})})),wd}function tN(r){return typeof r=="string"?r:["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL","COLOR"][r]}async function fS(r,e,t,n,s,i="NONE"){(await eN()).decodeGltfBuffer(r,e,t,n,s,tN(i))}var wd,dS=p(()=>{"use strict";lS()});async function xd(r,e,t){if(!e.gltf?.decompressMeshes&&e.gltf?.decompressBufferViewIndices===void 0||!e.gltf?.loadBuffers)return;rN(r.json);let n=new ie(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():nN(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 rN(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 nN(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:l}=n,f=r.gltf.buffers[l],d=r.gltf.buffers[e.buffer],h=new Uint8Array(f.arrayBuffer,f.byteOffset+s,i),m=new Uint8Array(d.arrayBuffer,d.byteOffset+(e.byteOffset||0),e.byteLength);await fS(m,a,o,h,c,u)}var ey=p(()=>{"use strict";He();dS()});var ty={};J(ty,{decode:()=>sN,name:()=>hS});async function sN(r,e){await xd(r,e,hS)}var hS,pS=p(()=>{"use strict";ey();hS="EXT_meshopt_compression"});var ry={};J(ry,{decode:()=>iN,name:()=>mS});async function iN(r,e){await xd(r,e,mS)}var mS,bS=p(()=>{"use strict";ey();mS="KHR_meshopt_compression"});var ny={};J(ny,{name:()=>oN,preprocess:()=>aN});function aN(r,e){let t=new ie(r);if(t.hasExtension(ho)){if(!ag("image/webp")){if(t.isExtensionRequired(ho))throw new Error(`gltf: Required extension ${ho} not supported by browser`);return}for(let n of t.textures){let s=t.getExtension(n,ho);s&&(n.source=s.source),t.removeExtension(n,ho)}t.removeExtension(ho)}}var ho,oN,gS=p(()=>{"use strict";qn();He();ho="EXT_texture_webp",oN=ho});var sy={};J(sy,{name:()=>cN,preprocess:()=>uN});async function uN(r,e){let t=new ie(r);if(!t.hasExtension(po))return;if(!(await og()).has("image/avif")){if(t.isExtensionRequired(po))throw new Error(`gltf: Required extension ${po} not supported by browser`);return}for(let s of t.textures){let i=t.getExtension(s,po);i&&(s.source=i.source),t.removeExtension(s,po)}t.removeExtension(po)}var po,cN,yS=p(()=>{"use strict";qn();He();po="EXT_texture_avif",cN=po});var iy={};J(iy,{decode:()=>fN,getDDSLoader:()=>iu,name:()=>mo,preprocess:()=>lN});function iu(r){return r?.loaders?.find(e=>e.extensions?.includes("dds")||e.mimeTypes?.includes("image/vnd-ms.dds"))}function lN(r,e,t){let n=new ie(r);if(n.hasExtension(mo)){if(!iu(t)){if(n.isExtensionRequired(mo))throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");return}for(let s of n.textures){let i=n.getExtension(s,mo);i&&(s.source=i.source)}}}async function fN(r,e,t){if(!iu(t)||e.gltf?.loadImages===!1)return;let n=new ie(r);if(n.hasExtension(mo)){for(let s of n.textures)n.removeExtension(s,mo);n.removeExtension(mo)}}var mo,oy=p(()=>{"use strict";He();mo="MSFT_texture_dds"});var ay={};J(ay,{name:()=>dN,preprocess:()=>hN});function hN(r,e){let t=new ie(r);for(let n of t.textures){let s=t.getExtension(n,Td);s&&(n.source=s.source,t.removeExtension(n,Td))}t.removeExtension(Td)}var Td,dN,wS=p(()=>{"use strict";He();Td="KHR_texture_basisu",dN=Td});var ou,cy=p(()=>{"use strict";ou="5.0.0-beta.5"});var au,uy=p(()=>{"use strict";au={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var xS,TS=p(()=>{"use strict";xS={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function bo(r,e=null,t={},n=null,s=null){if(Xe&&t.useLocalLibraries&&!t.CDN&&n&&t.modules?.[n]===void 0){let i=Yi?"./libs":`modules/${e}/dist/libs`;t={...t,modules:{[n]:`${i}/${n}`,...s?{[s]:`${i}/${s}`}:{},...t.modules}}}return await ia(r,e,t,n,s)}var _S=p(()=>{"use strict";Js()});var pN,mN,cu,AS,Ae,go,vS=p(()=>{"use strict";pN="1.5.7",mN="8786740086a9f4d83f44aa83badfbea4dce7a1b5",cu=`https://www.gstatic.com/draco/versioned/decoders/${pN}`,AS=`https://cdn.jsdelivr.net/gh/google/draco@${mN}/javascript`,Ae={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"},go={[Ae.DECODER]:`${cu}/${Ae.DECODER}`,[Ae.DECODER_WASM]:`${cu}/${Ae.DECODER_WASM}`,[Ae.GLTF_DECODER]:`${cu}/${Ae.GLTF_DECODER}`,[Ae.GLTF_DECODER_WASM]:`${cu}/${Ae.GLTF_DECODER_WASM}`,[Ae.FALLBACK_DECODER]:`${cu}/${Ae.FALLBACK_DECODER}`,[Ae.ENCODER]:`${AS}/${Ae.ENCODER}`,[Ae.ENCODER_WASM]:`${AS}/${Ae.ENCODER_WASM}`}});async function _d(r={},e,t="full"){let n=DS(r);return n?await dy(n):await bN(r,e==="js"?"javascript":e,t)}async function bN(r={},e,t="full"){let n=RS(`${e}:${t}`,r),s=IS.get(n);return s||(s=gN(r,e,t),IS.set(n,s)),await s}async function dy(r){let e=xN(r),t=ES.get(e);return t||(t=Ji(()=>e.createDecoderModule({}),n=>({draco:n})),ES.set(e,t)),await t}async function hy(r={}){let e=DS(r);if(e){let s=TN(e),i=LS.get(s);return i||(i=Ji(()=>s.createEncoderModule({}),o=>({draco:o})),LS.set(s,i)),await i}let t=RS("encoder",r),n=SS.get(t);return n||(n=wN(r),SS.set(t,n)),await n}async function gN(r,e,t){try{return await FS(r,e,t)}catch(n){if(e==="javascript")throw n;try{return await FS(r,"javascript","full")}catch(s){throw new AggregateError([n,s],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function FS(r,e,t){let n=BS.then(()=>yN(r,e,t));return BS=n.then(()=>{},()=>{}),await n}async function yN(r,e,t){if(e==="javascript"){let o;try{o=await bo(go[Ae.FALLBACK_DECODER],"scene",r,Ae.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Xe||r.useLocalLibraries)throw c;o=await bo(go[Ae.FALLBACK_DECODER],"scene",{...r,useLocalLibraries:!0},Ae.FALLBACK_DECODER,"draco_decoder.mjs")}let a=fy(o,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(a)}let n,s;try{[n,s]=await OS(r,t)}catch(o){if(Xe||r.useLocalLibraries)throw o;[n,s]=await OS({...r,useLocalLibraries:!0},t)}let i=fy(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(i,s)}async function OS(r,e){let t=e==="gltf"?Ae.GLTF_DECODER:Ae.DECODER,n=e==="gltf"?Ae.GLTF_DECODER_WASM:Ae.DECODER_WASM;return await Promise.all([bo(go[t],"scene",r,t,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),bo(go[n],"scene",r,n)])}async function wN(r){let e,t;try{[e,t]=await MS(r)}catch(s){if(Xe||r.useLocalLibraries)throw s;[e,t]=await MS({...r,useLocalLibraries:!0})}let n=fy(e,"DracoEncoderModule")||globalThis.DracoEncoderModule;return await ly(n,t)}async function MS(r){return await Promise.all([bo(go[Ae.ENCODER],"scene",r,Ae.ENCODER,"draco_encoder.mjs"),bo(go[Ae.ENCODER_WASM],"scene",r,Ae.ENCODER_WASM)])}function ly(r,e){if(typeof r!="function")throw new Error("Draco module initializer could not be loaded");return Ji(t=>r({...e?{wasmBinary:e}:{},onModuleLoaded:t}),t=>({draco:t}))}function fy(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 DS(r){let e=r.modules?.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function xN(r){let e=r;if(typeof e?.createDecoderModule!="function")throw new Error("Invalid draco3d decoder module");return e}function TN(r){let e=r;if(typeof e?.createEncoderModule!="function")throw new Error("Invalid draco3d encoder module");return e}function RS(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 IS,SS,ES,LS,BS,uu=p(()=>{"use strict";Ue();_S();vS();IS=new Map,SS=new Map,ES=new WeakMap,LS=new WeakMap;BS=Promise.resolve()});function NS(r,e,t){let n=CS(e.metadata),s=[],i=_N(e.attributes);for(let o in r){let a=r[o],c=kS(o,a,i[o]);s.push(c)}if(t){let o=kS("indices",t);s.push(o)}return{fields:s,metadata:n}}function _N(r){let e={};for(let t in r){let n=r[t];e[n.name||"undefined"]=n}return e}function kS(r,e,t){let n={...$f(e),...t?CS(t.metadata):{}};return Wf(r,e,n)}function CS(r){Object.entries(r);let e={};for(let t in r)e[`${t}.string`]=JSON.stringify(r[t]);return e}var US=p(()=>{"use strict";mn()});function SN(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 EN(r){let e=r.size(),t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function LN(r){let e=r.size(),t=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function BN(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 FN(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 ON(r){if(r.includeAttributes&&r.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function MN(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 DN(r){let e=Er(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 PS,AN,vN,IN,lu,VS=p(()=>{"use strict";mn();US();PS={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},AN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},vN=2,IN=4,lu=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={}){ON(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=DN(c.attributes),l=NS(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...c,schema:l}}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),l=BN(u,i);return i[l]=!0,c.name=l,{attributeName:l,loaderAttribute:c}});MN(n,Object.keys(i));for(let{attributeName:c,loaderAttribute:u}of a){if(!this._shouldExtractAttribute(c,u,n))continue;let l=this._getAttributeValues(t,u);if(l){let{value:f,size:d}=l;s[c]={value:f,size:d,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized,transform:FN(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?vN:IN),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),LN(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){let n=AN[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=SN(this.draco,n),u,l=this.draco._malloc(a);try{let f=this.decoder.GetAttribute(e,t.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,f,c,a,l))throw new Error(`DRACO: Failed to decode attribute ${t.unique_id}.`);u=new n(this.draco.HEAPU8.buffer,l,o).slice()}finally{this.draco._free(l)}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 PS)if(this.draco[o]===i)return PS[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=EN(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 Ta(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 lu(i);try{let a=o.parseSync(r,e?.draco);return s?.({phase:"decode",completed:1,total:1,unit:"tasks"}),e?.draco?.shape==="arrow-table"?ei(a,"arrow-table"):a}finally{o.destroy()}}var Ad=p(()=>{"use strict";mn();VS()});var qee,RN,kN,jS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:qee,...RN}=Hn),kN={...RN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"wasm",e?.draco?.decoderProfile),t)}});var py={};J(py,{DracoWASMLoaderWithParser:()=>kN});var my=p(()=>{"use strict";jS()});var Zee,NN,CN,GS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:Zee,...NN}=Hn),CN={...NN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"js"),t)}});var by={};J(by,{DracoJavaScriptLoaderWithParser:()=>CN});var gy=p(()=>{"use strict";GS()});function VN(r){let e=r?.modules?.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var ite,UN,PN,zS=p(()=>{"use strict";uu();Ad();fu();({preload:ite,...UN}=Hn),PN={...UN,parse:async(r,e,t)=>await Ta(r,e,async()=>await dy(VN(e)),t)}});var yy={};J(yy,{Draco3DLoaderWithParser:()=>PN});var wy=p(()=>{"use strict";zS()});async function jN(r,e){let t=e;switch(GN(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(my(),py));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(gy(),by));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(wy(),yy));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}function GN(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Hn.options.draco.backend}var Hn,fu=p(()=>{"use strict";ea();cy();uy();TS();Hn={dataType:null,batchType:null,...au,version:ou,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:af,deserializeWorkerResult:cf,options:{draco:xS},preload:jN}});var WS=p(()=>{"use strict";fu()});function $S(r){let e={};for(let t in r){let n=r[t];if(t!=="indices"){let s=xy(n);e[t]=s}}return e}function xy(r){let{buffer:e,size:t,count:n}=zN(r);return{value:e,size:t,byteOffset:0,count:n,type:ma(t),componentType:Xn(e)}}function zN(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=WN(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function WN(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}var qS=p(()=>{"use strict";ri()});var Ty={};J(Ty,{decode:()=>KN,name:()=>$N,preprocess:()=>qN});function qN(r,e,t){let n=new ie(r);for(let s of n.meshes)for(let i of n.getReferences(s).primitives)n.getExtension(i,_a)}async function KN(r,e,t){if(!e?.gltf?.decompressMeshes)return;let n=new ie(r),s=[];for(let i of n.meshes)for(let o of n.getReferences(i).primitives)n.getExtension(o,_a)&&s.push(XN(n,o,e,t));await Promise.all(s),n.removeExtension(_a)}async function XN(r,e,t,n){let s=r.getExtension(e,_a);if(!s)return;let i=hr(r.data,r.gltf.buffers,s.bufferView),o=eo(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 Xs(o,Hn,a,n),u=$S(c.attributes);for(let l of Object.keys(s.attributes))if(!Object.hasOwn(u,l))throw new Error(`glTF: Draco decompression did not produce attribute ${l}`);for(let[l,f]of Object.entries(u))if(l in e.attributes){let d=e.attributes[l],h=r.data.accessors?.[d];h?.normalized!==void 0&&(f.normalized=h.normalized),h?.min&&h?.max&&(f.min=h.min,f.max=h.max)}e.attributes={...e.attributes,...u},c.indices&&(e.indices=xy(c.indices),e.mode=4),r.removeExtension(e,_a),HN(e)}function HN(r){if(!r.attributes||Object.keys(r.attributes).length===0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}var _a,$N,KS=p(()=>{"use strict";Ue();WS();He();qS();ao();_a="KHR_draco_mesh_compression",$N=_a});var Ay={};J(Ay,{decode:()=>ZN,name:()=>JN});async function ZN(r,e){let t=new ie(r);if(!t.hasExtension(Aa)||!e.gltf?.loadBuffers)return;let s=r.json.materials||[];for(let i=0;i<s.length;i++)eC(i,r,t);s.some(i=>_y(i).length>0)||t.removeExtension(Aa)}function eC(r,e,t){let n=e.json.materials?.[r],s=_y(n),i=new Map,o=rC(e);for(let a of s){let c=a.extensions?.[Aa];if(c){let u=c.texCoord??a.texCoord??0,l=nC(u,c),f=i.get(l);if(!f){if(f={sourceTexCoord:u,texCoord:o,matrix:aC(c)},!sC(e,r,f))continue;o++,i.set(l,f)}a.texCoord=f.texCoord,tC(t,a,Aa),a.extensions&&Object.keys(a.extensions).length===0&&delete a.extensions}}}function tC(r,e,t){e.extensions?.[t]!==void 0&&(r.recordRemovedExtension(t),delete e.extensions[t])}function _y(r){if(!r||typeof r!="object")return[];let e=r,t=[],n=e.extensions;Number.isFinite(e.index)&&n?.[Aa]&&t.push(e);for(let[s,i]of Object.entries(e))s!=="extras"&&t.push(..._y(i));return t}function rC(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 nC(r,e){let{offset:t=[0,0],rotation:n=0,scale:s=[1,1]}=e;return JSON.stringify([r,t,n,s])}function sC(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=>!iC(r,i,t.sourceTexCoord)))return!1;for(let i of n)oC(r,i,t);return!0}function iC(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 oC(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++)XS(a.value.subarray(u*2,u*2+2),a,i,c,u*2);HS(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:l,byteOffset:f}=r.buffers[u.buffer],d=(f||0)+(c.byteOffset||0)+(u.byteOffset||0),{ArrayType:h,length:m}=Zc(c,u),b=Qc[c.componentType],g=ud[c.type],y=u.byteStride||b*g,x=new Float32Array(m);for(let T=0;T<c.count;T++){let _=new h(l,d+T*y,2);XS(_,c,i,x,T*g)}HS(s,c,e,r,x)}}}}function XS(r,e,t,n,s){let i=e.componentType===5120||e.componentType===5122,o=2**(Qc[e.componentType]*8-(i?1:0))-1;vd.set(e.normalized?Math.max(r[0]/o,-1):r[0],e.normalized?Math.max(r[1]/o,-1):r[1],1),vd.transformByMatrix3(t),n.set([vd[0],vd[1]],s)}function HS(r,e,t,n,s){n.buffers.push({arrayBuffer:ro(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 aC(r){let{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,s=new zn().set(1,0,0,0,1,0,e[0],e[1],1),i=YN.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=QN.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(i).multiplyRight(o)}var Aa,JN,vd,YN,QN,JS=p(()=>{"use strict";Uf();ri();gg();He();Ue();Aa="KHR_texture_transform",JN=Aa,vd=new jc,YN=new zn,QN=new zn});var vy={};J(vy,{decode:()=>uC,encode:()=>lC,name:()=>cC});async function uC(r){let e=new ie(r),t=e.getExtension(yo);t&&(e.data.lights=t.lights,e.removeExtension(yo));for(let n of e.nodes){let s=e.getExtension(n,yo);s&&(n.light=s.light),e.removeExtension(n,yo)}}async function lC(r){let e=new bn(r),{json:t}=e;if(t.lights){let n=e.addExtension(yo);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,yo,n)}delete e.json.lights}}var yo,cC,YS=p(()=>{"use strict";oo();He();eu();yo="KHR_lights_punctual",cC=yo});var Iy={};J(Iy,{decode:()=>dC,encode:()=>hC,name:()=>fC});async function dC(r){let e=new ie(r);for(let t of e.materials)e.getExtension(t,va)&&(t.unlit=!0),e.removeExtension(t,va);e.removeExtension(va)}function hC(r){let e=new bn(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,va,{}),e.registerRequiredExtension(va))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var va,fC,QS=p(()=>{"use strict";He();eu();va="KHR_materials_unlit",fC=va});var Sy={};J(Sy,{decode:()=>mC,encode:()=>bC,name:()=>pC});async function mC(r){let e=new ie(r),t=e.getExtension(du);if(t){let n=gC(t,e);for(let s of e.materials){let i=e.getExtension(s,du);i&&(s.technique=Object.assign({},i,n[i.technique]),s.technique.values=yC(s.technique,e)),e.removeExtension(s,du)}e.removeExtension(du)}}async function bC(r,e){}function gC(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(hr(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 yC(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 du,pC,ZS=p(()=>{"use strict";He();ao();du="KHR_techniques_webgl",pC=du});var Ey={};J(Ey,{decode:()=>xC,name:()=>wC});async function xC(r,e){let t=new ie(r);TC(t,e)}function TC(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(eE);t&&(e.gltf?.loadImages&&_C(r,t),AC(r,t))}function _C(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=IC(s,i);a&&EC(r,a,o)}}function AC(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=vC(s,i);o&&SC(r,t,o)}}function vC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function IC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function SC(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=LC(r,e,o,s,a);a.data=c}}}function EC(r,e,t){let n=e.class;for(let s in t.properties){let i=e?.properties?.[s];if(i){let o=DC(r,i,n);i.data=o}}}function LC(r,e,t,n,s){let i=[],o=s.bufferView,a=r.getTypedArrayForBufferView(o),c=BC(r,t,s,n),u=FC(r,t,s,n,c);return t.type==="STRING"||t.componentType==="STRING"?i=pd(n,a,c,u,t.type==="ARRAY"?t.componentCount:void 0):OC(t)&&(i=MC(t,n,a,c)),i}function BC(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?ba(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function FC(r,e,t,n,s){if(typeof t.stringOffsetBufferView<"u"){let i=s?Number(s[n]):n*(e.type==="ARRAY"&&e.componentCount||1);return ba(r,t.stringOffsetBufferView,t.offsetType||"UINT32",i)}return null}function OC(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 MC(r,e,t,n){let s=r.type==="ARRAY",i=r.componentCount,o="SCALAR",a=r.componentType||r.type,c=tu(o,a),u=t.byteLength/c,l=ga(t,o,a,u);return s?n?ru(l,e,n):i?nu(l,e,i):[]:l}function DC(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)RC(r,t,e,s,o);return s}function RC(r,e,t,n,s){let i={channels:t.channels,...t.texture},o=ya(r,i,s);o&&hd(r,e,o,n,s)}var eE,wC,tE=p(()=>{"use strict";He();md();eE="EXT_feature_metadata",wC=eE});async function nE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.preprocess?.(r,e,t)}async function sE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.decode?.(r,e,t)}function iE(r,e){let t=e?.gltf?.excludeExtensions||{};return Array.isArray(t)?!t.includes(r):!(r in t&&!t[r])}var rE,oE=p(()=>{"use strict";$I();YI();QI();eS();tS();nS();iS();oS();pS();bS();gS();yS();oy();wS();KS();JS();Jg();YS();QS();ZS();tE();rE=[xg,ry,ty,Ty,Wg,Vg,qg,Xg,Hg,Yg,Qg,Zg,ny,sy,iy,ay,vy,Iy,Sy,Ay,Ey]});function aE(r){let e=new ie(r);for(let t of e.images){let n=e.getExtension(t,Ly);n&&(t.bufferView=n.bufferView,t.mimeType=n.mimeType,delete t.uri),e.removeExtension(t,Ly)}for(let t of e.data.buffers||[])t.id==="binary_glTF"&&delete t.uri;e.removeExtension(Ly)}var Ly,cE=p(()=>{"use strict";He();Ly="KHR_binary_glTF"});function lE(r,e){let t=r.accessors||[],n=r.bufferViews||[],s=NC(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],l=s.get(o)||"unused",f=CC(a),d=a.byteStride===0?f:a.byteStride??f,h=a.byteOffset??0,m=u?.byteOffset??0,b=typeof a.componentType=="number"&&Object.hasOwn(Id,a.componentType)?Id[a.componentType]:0,g=l==="vertex",y=g?d>=f&&d>=4&&d<=252&&d%4===0&&h%4===0&&(m+h)%4===0:d===f;if(!u||!f||l==="mixed"||!Number.isInteger(d)||!y||g&&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+f>u.byteLength){e(o);continue}let x=`${c}:${l}:${g?d:0}`,T=i.get(x);if(T===void 0){let _={...u};delete _.id,delete _.byteStride,delete _.target,g?(_.byteStride=d,_.target=34962):l==="indices"&&(_.target=34963),T=n.length,n.push(_),i.set(x,T)}a.bufferView=T,delete a.byteStride}}function NC(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 CC(r){let e=typeof r.componentType=="number"&&Object.hasOwn(Id,r.componentType)?Id[r.componentType]:0,t=Object.hasOwn(uE,r.type)?uE[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 Id,uE,fE=p(()=>{"use strict";Id={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},uE={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}});function dE(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 l=n.flatMap((m,b)=>m.skin===a?[b]:[]),f=(l.length?l:[void 0]).map(m=>UC(n,u,m,e,b=>t(`skin ${a} ${b}`))),d=f.some(m=>!m);o||=d;let h=new Map;for(let m of f){if(!m)continue;let b=`${m.skeletonIndex}:${m.jointIndices.join(",")}`,g=h.get(b);if(g===void 0){let y={...c,joints:m.jointIndices,skeleton:m.skeletonIndex};delete y.jointNames,c.bindShapeMatrix!==void 0&&jC(c.bindShapeMatrix)&&delete y.bindShapeMatrix,!d&&h.size===0?(g=a,s[a]=y):(delete y.id,g=s.length,s.push(y)),h.set(b,g)}m.nodeIndex!==void 0&&(n[m.nodeIndex].skin=g,delete n[m.nodeIndex].skeletons)}}if(!o)for(let a of n)delete a.jointName}function UC(r,e,t,n,s){let i=t===void 0?void 0:r[t].skeletons;if(i!==void 0&&(!Array.isArray(i)||i.some(f=>typeof f!="string"||!f)||new Set(i).size!==i.length))return s("has invalid skeleton roots"),null;let o=(i||[]).map(n),a=o.length?PC(r,o):r.map((f,d)=>d);if(!a)return s("has invalid or overlapping skeleton subtrees"),null;let c=[],u=new Map;for(let f of a){let d=r[f].jointName;if(d===void 0)continue;let h=u.get(d)||[];h.push(f),u.set(d,h)}for(let f of e){let d=u.get(f)||[];if(d.length!==1)return s(`cannot uniquely resolve joint ${f}`),null;c.push(d[0])}let l=VC(r,[...c,...o]);return l===void 0?(s("joints have no unambiguous common hierarchy root"),null):{nodeIndex:t,jointIndices:c,skeletonIndex:o.length===1?o[0]:l}}function PC(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 VC(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 jC(r){return Array.isArray(r)&&r.length===16&&Array.from(r).every((e,t)=>e===(t%5===0?1:0))}var hE=p(()=>{"use strict"});function Sd(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=_e(i.byteLength,4),c=a+s.reduce((f,d)=>f+_e(d.bytes.byteLength,4),0),u=new ArrayBuffer(c),l=new Uint8Array(u);l.set(new Uint8Array(o.arrayBuffer,o.byteOffset,i.byteLength));for(let f of s){l.set(new Uint8Array(f.bytes),a);let d=r.json.bufferViews.length;r.json.bufferViews.push({buffer:n,byteOffset:a,byteLength:f.bytes.byteLength,...f.byteStride===void 0?{}:{byteStride:f.byteStride},...f.target===void 0?{}:{target:f.target}}),f.apply(d),a+=_e(f.bytes.byteLength,4)}i.byteLength=c,i.uri!==void 0&&(i.uri=`data:application/octet-stream;base64,${cb(u)}`),r.buffers[n]={arrayBuffer:u,byteOffset:0,byteLength:c}}}var By=p(()=>{"use strict";Ue()});function pE(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(!mE(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=GC(r,s,i);if(typeof c=="string"){e(`skin ${n} non-identity bindShapeMatrix ${c}`);continue}t.set(o,c)}Sd(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 GC(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,l=n.byteOffset??0,f=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(l)||l<0||l%4!==0||l+f>i.byteLength)return"has an invalid inverse-bind buffer layout";let d=new DataView(c.arrayBuffer),h=c.byteOffset+u+l,m=new ArrayBuffer(f),b=new DataView(m);for(let g=0;g<n.count;g++){let y=Array.from({length:16},(x,T)=>d.getFloat32(h+g*64+T*4,!0));if(!mE(y))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++)_+=y[v*4+T]*t[x*4+v];if(!Number.isFinite(Math.fround(_)))return"produces non-finite FLOAT matrix values";b.setFloat32(g*64+(x*4+T)*4,_,!0)}}return{bufferIndex:o,count:n.count,matrixBytes:m,skins:[e]}}function mE(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 bE=p(()=>{"use strict";By()});function yE(r){let e=r.accessors||[],t=new Map,n=new Map,s=Oy(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,l=`${a.usage}:${a.mode}:${["unit","signed","direction"].includes(a.mode)?a.semantic?.split("_")[0]:""}:${a.hasOpaqueConsumer?"opaque":""}`,f=u.get(l);return f===void 0&&(f=u.size?e.length:o,u.size&&e.push({...c}),u.set(l,f),n.set(f,a),t.set(o,u)),f};for(let o of r.meshes||[])for(let a of o.primitives){for(let[c,u]of Object.entries(a.attributes)){let l=e[u],f=["NORMAL","TANGENT"].includes(c)&&l&&[5120,5121,5122,5123].includes(l.componentType)?"direction":/^JOINTS_\d+$/.test(c)?"joints":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5120,5122].includes(l.componentType)?"signed":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5121,5123].includes(l.componentType)&&!l.normalized?"unit":/^WEIGHTS_\d+$/.test(c)?"weights":"copy";a.attributes[c]=i(u,{usage:"vertex",mode:f,semantic:c,...["signed","direction"].includes(f)?{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 wE(r,e,t,n,s){let i=[],o=[];for(let[a,c]of e){let u=r.json.accessors[a],l=c.mode==="joints"||c.mode==="weights"||c.semantic?.startsWith("WEIGHTS_"),f=!!(l&&["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,g=c.mode==="joints"&&(![5121,5123].includes(u.componentType)||u.normalized||u.type!=="VEC4");if(!t.has(a)&&!g&&!d&&!b&&!f&&c.usage!=="indices"&&c.mode!=="unit")continue;let y=hu(r,a);if(typeof y=="string"){n(`accessor ${a} layout requires binary repacking: ${y}`);continue}if(l&&!["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 oe=!0;for(let xe=0;xe<u.count;xe++)if(m){let Rt=Math.hypot(Math.fround(Ia(y,xe,0)),Math.fround(Ia(y,xe,1)),Math.fround(Ia(y,xe,2)));(Math.abs(Rt-1)>1e-5||c.semantic==="TANGENT"&&![-1,1].includes(Ia(y,xe,3)))&&(oe=!1)}else if(!c.semantic?.startsWith("TEXCOORD_"))for(let Rt=0;Rt<y.rows;Rt++){let mr=Ia(y,xe,Rt);(mr<0||mr>1)&&(oe=!1)}if(!oe){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 ue=0;for(let xe=0;xe<u.count;xe++)ue=Math.max(ue,Xt(y,xe,0));if(ue===(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(g||c.mode==="unit"){if(g&&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 ue=0,oe=!0;for(let xe=0;xe<u.count;xe++)for(let Rt=0;Rt<y.rows*y.columns;Rt++){let mr=Xt(y,xe,Rt);(!Number.isInteger(mr)||mr<0||g&&mr>65535)&&(oe=!1),ue=Math.max(ue,mr)}if(!oe){n(`accessor ${a} joint indices require finite integers in [0, 65535]`);continue}if(g)x=ue<=255?5121:5123,T=!1;else if(ue<=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)&&!f){o.push(()=>{u.normalized=!0});continue}}let _=f?4:y.rows,v=Fy[x],I=y.columns>1?_e(y.rows*v,4):_*v,N=I*y.columns,K=c.usage==="vertex"?_e(N,4):N,ne=new ArrayBuffer(u.count*K),be=new Uint8Array(ne),Re=new Uint8Array(y.data.buffer),ke=new DataView(ne);for(let ue=0;ue<u.count;ue++)for(let oe=0;oe<y.columns;oe++)if(x===u.componentType){let xe=y.byteOffset+ue*y.byteStride+oe*y.rows*y.componentSize;be.set(Re.subarray(xe,xe+y.rows*y.componentSize),ue*K+oe*I)}else for(let xe=0;xe<y.rows;xe++){let Rt=(b?Ia:Xt)(y,ue,oe*y.rows+xe),mr=ue*K+oe*I+xe*v;x===5126?ke.setFloat32(mr,Rt,!0):x===5121?ke.setUint8(mr,Rt):x===5125?ke.setUint32(mr,Rt,!0):ke.setUint16(mr,Rt,!0)}i.push({bufferIndex:y.bufferIndex,bytes:ne,...c.usage==="vertex"?{byteStride:K,target:34962}:c.usage==="indices"?{target:34963}:{},apply:ue=>{b&&s(`Converted ${h?"signed":"integer"} ${c.semantic} accessor ${a} to FLOAT, preserving ${y.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=ue,u.byteOffset=0,delete u.byteStride,(x!==u.componentType||f)&&(delete u.min,delete u.max),u.componentType=x,f&&(u.type="VEC4"),T?u.normalized=!0:delete u.normalized}})}Sd(r,i);for(let a of o)a()}function Ia(r,e,t){let n=Xt(r,e,t);if(r.accessor.normalized!==!0)return n;let s=zC[r.accessor.componentType];return Math.max(n/s,-1)}function Oy(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 hu(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(Fy,t.componentType)?Fy[t.componentType]:void 0,s=typeof t.type=="string"&&Object.hasOwn(gE,t.type)?gE[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 l=i*o*n,f=t.byteStride??a.byteStride??l,d=f===0?l:f,h=t.byteOffset??0,m=a.byteOffset??0;return!(u.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(d)||d<l||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+l>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 Xt(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 Fy,zC,gE,pu=p(()=>{"use strict";Ue();By();Fy={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},zC={5120:127,5121:255,5122:32767,5123:65535},gE={SCALAR:[1,1],VEC2:[2,1],VEC3:[3,1],VEC4:[4,1],MAT2:[2,2],MAT3:[3,3],MAT4:[4,4]}});function TE(r,e){let t=r.asset;t.premultipliedAlpha&&e("asset premultipliedAlpha rendering"),xE(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`);xE(i,["format","internalFormat","target","type"])}}function xE(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=My(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},s=My(n.gltf1)?n.gltf1:n.gltf1===void 0?{}:{originalExtras:n.gltf1},i=My(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 My(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Dy(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 _E=p(()=>{"use strict"});function AE(r,e,t){for(let[s,i]of(r.animations||[]).entries()){let f=function(d,h,m){try{let b=typeof d=="string"?e(d,h):d,g=h==="accessor"?r.accessors:r.nodes;if(typeof b=="number"&&Number.isSafeInteger(b)&&b>=0&&g?.[b])return b}catch{}return t(`animation ${s} ${m} unresolved ${h} reference`),d};var n=f;let o=i,a=o.parameters||{},c=new Map,u=i.samplers,l=Array.isArray(u)?u.map((d,h)=>[String(h),d]):Object.entries(u||{});i.samplers=l.map(([d,h],m)=>{c.set(d,m);for(let b of["input","output"]){let g=h[b],y=Object.hasOwn(a,g)?a[g]:g;h[b]=f(y,"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=f(m.id,"node",`channel ${d} target`),delete m.id):typeof m?.node=="string"&&(m.node=f(m.node,"node",`channel ${d} target`))}}}var vE=p(()=>{"use strict"});function IE(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 l of Array.from(u)){let f=r.skins?.[n[l].skin];if(!Array.isArray(f?.joints)||!f.joints.length||f.skeleton===void 0||u.has(f.skeleton)&&f.joints.every(b=>u.has(b)))continue;let d=f.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||!f.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[l].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 l=u.pop();if(!Number.isSafeInteger(l)||!n[l]||c.has(l)||s.get(l)===null)return null;c.add(l),u.push(...n[l].children||[])}return c}}var SE=p(()=>{"use strict"});function EE(r,e){for(let[t,n]of(r.cameras||[]).entries()){let s=n.perspective,i=n.orthographic;(n.type==="perspective"?s&&mu(s.yfov)&&mu(s.znear)&&(s.aspectRatio===void 0||mu(s.aspectRatio))&&(s.zfar===void 0||mu(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&&mu(i.zfar)&&i.zfar>i.znear)||e(`camera ${t} invalid projection parameters`)}}function mu(r){return Number.isFinite(r)&&r>0}var LE=p(()=>{"use strict"});function BE(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(y=>y.startsWith(`${b}_`)).map(y=>Number(y.slice(b.length+1))).sort((y,x)=>y-x).some((y,x)=>y!==x)&&t(`${u} ${b} sets must be contiguous starting at zero`);for(let[b,g]of Object.entries(c.attributes)){let y=b.split("_")[0];if(!["NORMAL","TANGENT","COLOR","TEXCOORD","JOINTS","WEIGHTS"].includes(y))continue;let x=`${y}:${g}`;if(s.has(x))continue;s.add(x);let T=e(g,`${b} accessor ${g}`);T&&WC(T,y,`${b} accessor ${g}`,t)}let l=Object.values(c.attributes).map(b=>(Number.isSafeInteger(b)?r.json.accessors?.[b]:void 0)?.count);if(!l.length||l.some(b=>!Number.isSafeInteger(b)||b<1)){t(`${u} requires valid vertex attribute accessors`);continue}l.some(b=>b!==l[0])&&t(`${u} vertex attribute counts do not match`);let f=c.indices===void 0?l[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(f)||f<1||d===1&&f%2!==0||[2,3].includes(d)&&f<2||d===4&&f%3!==0||[5,6].includes(d)&&f<3)&&t(`${u} draw count ${f} 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,Xt(h,b,0));n.set(c.indices,m)}l.some(b=>m>=b)&&t(`${u} index ${m} is outside its vertex attribute counts`)}}function WC(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 l=Array.from({length:r.rows},(f,d)=>Xt(r,u,d));if(l.some(f=>!Number.isFinite(f))||["NORMAL","TANGENT"].includes(e)&&Math.abs(Math.hypot(...l.slice(0,3))-1)>1e-5||e==="TANGENT"&&l[3]!==1&&l[3]!==-1||["COLOR","WEIGHTS"].includes(e)&&i&&l.some(f=>f<0||f>1)){n(`${t} requires finite core values, unit directions, tangent handedness \xB11, and colors/weights in [0, 1]`);return}}}var FE=p(()=>{"use strict";pu()});function OE(r,e,t){let n=new Map,s=new Set,i=[],o=(f,d)=>{let h=n.get(f);return h===void 0&&(h=hu(r,f),n.set(f,h)),typeof h=="string"?(s.has(f)||(s.add(f),e(`${d}: ${h}`)),null):h},a=new Set;for(let f of r.json.meshes||[])for(let d of f.primitives)d.attributes.POSITION!==void 0&&a.add(d.attributes.POSITION);for(let f of a){let d=o(f,`POSITION accessor ${f}`);if(d){if(!Ed(d,"VEC3")){e(`POSITION accessor ${f} requires unnormalized FLOAT VEC3 data`);continue}u(d,f)}}l(),c(),$C(r,o,e),BE(r,o,e);for(let f of i)f();function c(){for(let[f,d]of(r.json.skins||[]).entries()){if(d.inverseBindMatrices===void 0)continue;let h=`skin ${f} inverse-bind matrices`,m=o(d.inverseBindMatrices,h);if(m){if(!Ed(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 g=Array.from({length:16},(y,x)=>Xt(m,b,x));if(g.some(y=>!Number.isFinite(y))||g[3]!==0||g[7]!==0||g[11]!==0||g[15]!==1){e(`${h} require finite affine matrices`);break}}}}}function u(f,d){let h=new Array(f.rows).fill(1/0),m=new Array(f.rows).fill(-1/0);for(let b=0;b<f.accessor.count;b++)for(let g=0;g<f.rows;g++){let y=Xt(f,b,g);if(!Number.isFinite(y))return e(`accessor ${d} non-finite values cannot supply required bounds`),!1;h[g]=Math.min(h[g],y),m[g]=Math.max(m[g],y)}return(JSON.stringify(f.accessor.min)!==JSON.stringify(h)||JSON.stringify(f.accessor.max)!==JSON.stringify(m))&&i.push(()=>{f.accessor.min=h,f.accessor.max=m,t(`Calculated required bounds for accessor ${d}.`)}),!0}function l(){let f=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[g,y]of m.samplers.entries()){let x=`animation ${h} sampler ${g}`;if(["LINEAR","STEP"].includes(y.interpolation??"LINEAR")||e(`${x} unsupported interpolation ${y.interpolation}`),!f.has(y.input)){f.add(y.input);let T=o(y.input,`${x} input`);if(T)if(!Ed(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=Xt(T,I,0);(!Number.isFinite(N)||N<0||N<=_)&&(v=!1),_=N}v?u(T,y.input):e(`${x} times must be finite, nonnegative, and strictly increasing`)}}}for(let[g,y]of(m.channels||[]).entries()){let x=`animation ${h} channel ${g}`,T=Number.isSafeInteger(y.sampler)?m.samplers[y.sampler]:void 0,_=y.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],K=o(T.output,`${x} output`);if(!K)continue;if(!Ed(K,_.path==="rotation"?"VEC4":"VEC3")||K.accessor.count!==N?.count){e(`${x} output shape, type, or count does not match its target and keys`);continue}let ne=`${T.output}:${_.path}`;if(!d.has(ne)){d.add(ne);for(let be=0;be<K.accessor.count;be++){let Re=Array.from({length:K.rows},(ke,ue)=>Xt(K,be,ue));if(Re.some(ke=>!Number.isFinite(ke))||_.path==="rotation"&&Math.abs(Math.hypot(...Re)-1)>1e-5){e(`${x} output requires finite values and unit rotation quaternions`);break}}}}}}}function Ed(r,e){return r.accessor.componentType===5126&&!r.accessor.normalized&&r.accessor.type===e}function $C(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 l=`mesh ${s.mesh} primitive ${c} skin ${s.skin}`,f=Object.keys(u.attributes).filter(b=>/^JOINTS_\d+$/.test(b)).map(b=>Number(b.slice(7))).sort((b,g)=>b-g),d=Object.keys(u.attributes).filter(b=>/^WEIGHTS_\d+$/.test(b)).map(b=>Number(b.slice(8))).sort((b,g)=>b-g);if(!f.length&&!d.length){t(`${l} requires JOINTS_0 and WEIGHTS_0 skin influences`);continue}if(JSON.stringify(f)!==JSON.stringify(d)||f.some((b,g)=>b!==g)){t(`${l} requires matching contiguous joint/weight sets starting at zero`);continue}let h=r.json.accessors?.[u.attributes.POSITION]?.count,m=f.map(b=>({joints:e(u.attributes[`JOINTS_${b}`],`${l} joint set ${b}`),weights:e(u.attributes[`WEIGHTS_${b}`],`${l} weight set ${b}`)}));if(!m.some(({joints:b,weights:g})=>!b||!g)){if(m.some(({joints:b,weights:g})=>b.accessor.type!=="VEC4"||g.accessor.type!=="VEC4"||![5121,5123].includes(b.accessor.componentType)||b.accessor.normalized||!(g.accessor.componentType===5126&&!g.accessor.normalized||[5121,5123].includes(g.accessor.componentType)&&g.accessor.normalized)||b.accessor.count!==g.accessor.count||h!==void 0&&b.accessor.count!==h||b.accessor.count!==m[0].joints.accessor.count)){t(`${l} incompatible influence accessor types or vertex counts`);continue}for(let b=0;b<m[0].joints.accessor.count;b++){let g=0,y=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 K=Xt(_,b,N),ne=Xt(v,b,N)/I;(K>=i.joints.length||!Number.isFinite(ne)||ne<0||ne>1)&&(x=!1),ne>0&&(T.has(K)&&(x=!1),T.add(K),y++),g+=ne}}if(!x||Math.abs(g-1)>2e-7*Math.max(y,1)){t(`${l} invalid palette index, repeated weighted joint, or weights not summing to one at vertex ${b}`);break}}}}}}}var ME=p(()=>{"use strict";pu();FE()});function DE(r,e,t,n){let s=new Map,i=new Map,o=new Map;for(let[c,u]of(r.json.buffers||[]).entries()){let l=`buffer ${c}`,f=r.buffers[c],d=!!(f&&f.arrayBuffer instanceof ArrayBuffer&&Number.isSafeInteger(f.byteOffset)&&f.byteOffset>=0&&Number.isSafeInteger(f.byteLength)&&f.byteLength>=0&&Number.isSafeInteger(f.byteOffset+f.byteLength)&&f.byteOffset+f.byteLength<=f.arrayBuffer.byteLength);f&&!d&&t(`${l} invalid borrowed payload span`);let h=u.byteLength;if(h===void 0&&e.has(c)&&!u.extensions&&d&&f.byteLength>0&&(h=f.byteLength,i.set(c,h)),!Number.isSafeInteger(h)||h<1){t(`${l} requires a positive byteLength; missing lengths require unambiguous loaded URI data`);continue}s.set(c,h),d&&f.byteLength<h&&t(`${l} declared byteLength exceeds its loaded payload`)}let a=Oy(r.json);for(let[c,u]of(r.json.bufferViews||[]).entries()){let l=u.byteOffset===void 0?0:u.byteOffset,f=s.get(u.buffer),d=u.byteLength===void 0&&!a&&f!==void 0?qC(r,c,s):u.byteLength;u.byteLength===void 0&&d!==void 0&&o.set(c,d),(!Number.isSafeInteger(u.buffer)||u.buffer<0||f===void 0||!Number.isSafeInteger(l)||l<0||!Number.isSafeInteger(d)||(d??0)<1||!Number.isSafeInteger(l+(d??0))||l+(d??0)>f)&&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 qC(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 l=hu(i,a);if(typeof l=="string")return;let f=(c.byteOffset??0)+(c.count-1)*l.byteStride+l.rows*l.columns*l.componentSize;o=Math.max(o,f)}return o>0?o:void 0}var RE=p(()=>{"use strict";pu()});function kE(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=KC(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 KC(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,l,f)=>u+l*t[c][f],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 Gc().fromMatrix3(t.flat()).normalize()),i=r.slice(12,15),o=new Qs().translate(i).multiplyRight(new Qs().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 NE=p(()=>{"use strict";Uf()});function VE(r,e,t){let n=new Set,s=r.extensionsRequired?.includes(qr)||!1;for(let[o,a]of(r.materials||[]).entries()){let c=a,u=a.extensions?.[qr];if(u===void 0){XC(c,r,e,t);continue}zE(c,u);let l=`material ${o}`;if(!pr(u)||typeof u.technique!="string"||!["CONSTANT","LAMBERT","PHONG","BLINN"].includes(u.technique)){e(`${l} unknown ${qr} technique`);continue}if(u.values!==void 0&&!pr(u.values)){e(`${l} common material values must be an object`);continue}let f=u.values||{},d=Object.keys(u).filter(I=>!["technique","values","doubleSided","transparent","jointCount"].includes(I)),h=Object.keys(f).filter(I=>!["ambient","diffuse","emission","specular","shininess","transparency","doubleSided","transparent"].includes(I));(d.length||h.length)&&e(`${l} unrecognized common material fields ${[...d,...h].join(", ")}`),u.jointCount!==void 0&&(!Number.isSafeInteger(u.jointCount)||Number(u.jointCount)<0)&&e(`${l} invalid common material jointCount`);let m=CE(f.emission,r,`${l} emission`,e),b=u.technique==="CONSTANT",g=b?m:CE(f.diffuse,r,`${l} diffuse`,e),y=f.transparency===void 0?1:f.transparency,x=typeof y=="number"&&Number.isFinite(y)&&y>=0&&y<=1;x||e(`${l} common material transparency must be in [0, 1]`);let T=UE(u,f,"transparent",l,e),_=UE(u,f,"doubleSided",l,e);f.ambient!==void 0&&!PE(f.ambient)&&e(`${l} ambient lighting`),["PHONG","BLINN"].includes(String(u.technique))&&(f.specular!==void 0&&!PE(f.specular)&&e(`${l} specular/shininess lighting`),f.shininess!==void 0&&(typeof f.shininess!="number"||!Number.isFinite(f.shininess)||f.shininess<0)&&e(`${l} invalid common material shininess`)),a.pbrMetallicRoughness||={};let v=a.pbrMetallicRoughness;if(v.metallicFactor??=0,v.roughnessFactor??=1,g){let I=[...g.factor];I[3]*=x?y:1,v.baseColorFactor??=I,g.texture&&(v.baseColorTexture??=g.texture)}a.doubleSided??=_,a.alphaMode??=T?"BLEND":"OPAQUE",b?(a.extensions[Ry]??={},HC(r,Ry,s),t(`Converted ${l} CONSTANT emission to an unlit material.`)):(m&&(a.emissiveFactor??=m.factor.slice(0,3),m.texture&&(a.emissiveTexture??=m.texture)),t(`Approximated ${l} ${String(u.technique)} lighting with rough non-metallic PBR factors.`)),typeof c.technique=="string"?n.add(c.technique):c.technique!==void 0&&e(`${l} invalid fallback technique ID`),delete c.technique,delete c.values,delete a.extensions[qr],Object.keys(a.extensions).length||delete a.extensions}let i=WE(r);return(r.extensions?.[qr]!==void 0||(r.nodes||[]).some(o=>o.extensions?.[qr]!==void 0))&&e(`${qr} lights or scene payloads`),i.has(qr)||(r.extensionsUsed=r.extensionsUsed?.filter(o=>o!==qr),r.extensionsRequired=r.extensionsRequired?.filter(o=>o!==qr)),n}function jE(r,e){if(!e.size||[...WE(r)].some(c=>![qr,Ry].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&&!pr(t[c])))return!1;let n=pr(t.techniques)?t.techniques:{},s=pr(t.programs)?t.programs:{},i=pr(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))pr(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(pr(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 XC(r,e,t,n){zE(r);let s=pr(r.values)?r.values:{},i=s.tex||s.texture2d_0||s.diffuseTex||s.diffuse,o=GE(e,i),a=ky(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 CE(r,e,t,n){if(r===void 0)return{factor:[0,0,0,1]};if(ky(r))return{factor:[...r]};let s=GE(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 GE(r,e){return typeof e!="string"?-1:(r.textures||[]).findIndex(t=>t.id===e)}function UE(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 zE(r,e){let t=pr(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},n=pr(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 HC(r,e,t){r.extensionsUsed=[...new Set([...r.extensionsUsed||[],e])],t&&(r.extensionsRequired=[...new Set([...r.extensionsRequired||[],e])])}function WE(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),pr(s)&&pr(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 ky(r){return Array.isArray(r)&&r.length===4&&r.every(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1)}function PE(r){return ky(r)&&r.slice(0,3).every(e=>e===0)}function pr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}var qr,Ry,$E=p(()=>{"use strict";qr="KHR_materials_common",Ry="KHR_materials_unlit"});function qE(r,e={}){let t=new Cy;return t.normalize(r,e,!0),()=>t.finishNormalization(r)}var Ny,JC,Cy,KE=p(()=>{"use strict";cE();fE();hE();bE();pu();_E();vE();SE();LE();ME();RE();NE();$E();Ny={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"},JC={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"},Cy=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),aE(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=VE(s,o=>this._unsupported(o),o=>this._warning(o));return AE(s,(o,a)=>this._convertIdToIndex(o,a),o=>this._unsupported(o)),EE(s,o=>this._unsupported(o)),kE(s,o=>this._unsupported(o),o=>this._warning(o)),TE(s,o=>this._unsupported(o)),this.accessorConversions=yE(s),lE(s,o=>this.pendingAccessors.add(o)),dE(s,o=>this._convertIdToIndex(o,"node"),o=>this._unsupported(o)),this._updateNodes(s),IE(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&&(DE(e,this.uriBufferIndices,t=>this._unsupported(t),t=>this._warning(t)),wE(e,this.accessorConversions,this.pendingAccessors,t=>this._unsupported(t),t=>this._warning(t)),pE(e,t=>this._unsupported(t)),OE(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 Ny)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 Ny)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=Dy(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])=>[Dy(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=JC[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=jE(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(Ny),"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 YC(r,e){let t=r.basis;return{...r,core:{...r.core,mimeType:e},basis:{...t,format:t?.format||"auto"}}}async function XE(r,e,t=0,n,s){return await HE(r,e,t,n,s)}async function HE(r,e,t,n,s,i){QC(r,e,t,n);let o=qE(r,{normalize:n?.gltf?.normalize,log:n?.core?.log});return await nE(r,n,s),n?.gltf?.loadBuffers&&r.json.buffers&&await a3(r,n,s,n.gltf.loadBufferIndices),o(),n?.gltf?.loadFiles&&r.json.files&&await o3(r,n,s),n?.gltf?.loadExternalAssets&&r.json.externalAssets&&await e3(r,n,s,i),n?.gltf?.loadImages&&await c3(r,n,s),await sE(r,n,s),r}function QC(r,e,t,n){if(n.core?.baseUrl&&(r.baseUri=n.core?.baseUrl),e instanceof ArrayBuffer&&!PI(e,t,n.glb)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=sb(e);else if(e instanceof ArrayBuffer){let l={};t=ad(l,e,t,n.glb),H(l.type==="glTF",`Invalid GLB magic string ${l.type}`),r._glb=l,r.json=l.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:l}=r._glb;for(let g=0;g<i.length;g++){let y=i[g];if(y.chunk===void 0)continue;H(r._glb.version===3,"glTF buffer.chunk requires a GLB v3 container."),H(y.uri===void 0,`glTF buffer ${g} cannot define both uri and chunk.`);let x=l.find(T=>T.chunkIndex===y.chunk);H(x,`glTF buffer ${g} references missing GLB BIN chunk ${y.chunk}.`),H(y.byteLength<=x.byteLength,`glTF buffer ${g} is larger than GLB BIN chunk ${y.chunk}.`),r.buffers[g]={arrayBuffer:x.arrayBuffer,byteOffset:x.byteOffset,byteLength:y.byteLength}}let f=i.map((g,y)=>g.uri===void 0?y:-1).filter(g=>g!==-1),d=l.find(g=>g.chunkIndex===1),h=r._glb.version<3||r._glb.jsonChunkIndex===0&&i[0]?.chunk===void 0&&f.length===1&&f[0]===0&&!!d,m=r._glb.version<3?l[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 g of f)H(r.buffers[g],`glTF buffer ${g} without a uri must define a valid GLB v3 chunk.`)}if(!r._glb){let l=i.findIndex(f=>f.chunk!==void 0);H(l===-1,`glTF buffer ${l} 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 e3(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||r3(t.url?new Set([cd(t.url)]):new Set);for(let a of i)await t3(r,a,e,t,o)}async function t3(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 fd(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=n3(r,o,t,n,s),l={...s,ancestors:new Set(s.ancestors)};a&&l.ancestors.add(a);let f=eo(o.arrayBuffer,o.byteOffset,o.byteLength);c=HE({},f,0,t,u,l),a&&s.cache.set(a,c)}r.externalAssets=r.externalAssets||[],r.externalAssets[e]=await c}function r3(r){return{cache:new Map,ancestors:r,packageIds:{next:0}}}function n3(r,e,t,n,s){if(e.url&&!e.url.startsWith("data:"))return{...n,url:e.url,filename:i3(e.url),baseUrl:s3(e.url)};let i=`${ZC}${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 l=u.startsWith(o)?u.slice(o.length):u,f=wg(r,l);H(f>=0,`glTF package does not contain file ${l}.`);let d=await fd(r,f,t,n),h=eo(d.arrayBuffer,d.byteOffset,d.byteLength);return new Response(h,{headers:{"content-type":d.mimeType}})}}}function s3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(0,e):""}function i3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(e+1):r}async function o3(r,e,t){let n=r.json.files||[];await Promise.all(n.map((s,i)=>fd(r,i,e,t)))}async function a3(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=Kn(a.uri,e,t),f=await(await t?.fetch?.(u))?.arrayBuffer?.();r.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri}else r.buffers[o]===null&&(r.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function c3(r,e,t){let n=u3(r),s=r.json.images||[],i=[];for(let o of n)i.push(l3(r,s[o],o,e,t));return await Promise.all(i)}function u3(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 l3(r,e,t,n,s){let i;if(e.uri&&!e.hasOwnProperty("bufferView")){let l=Kn(e.uri,n,s),{fetch:f}=s;i=await(await f(l)).arrayBuffer(),e.bufferView={data:i}}if(Number.isFinite(e.bufferView)){let l=hr(r.json,r.buffers,e.bufferView);i=eo(l.buffer,l.byteOffset,l.byteLength)}H(i,"glTF image has no data");let o=YC(n,e.mimeType),a=iu(s);if(!!(a&&!n.gltf?.excludeExtensions?.includes("MSFT_texture_dds")&&r.json.textures?.some(l=>l.source===t&&l.extensions?.MSFT_texture_dds?.source===t))){let l=await Xs(i,a,n,s);H(l.length>0,"MSFT_texture_dds parser returned no texture levels"),r.images=r.images||[],r.images[t]={compressed:!0,mipmaps:!0,width:l[0].width,height:l[0].height,data:l};return}let u=await Xs(i,[Hc,io],o,s);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),r.images=r.images||[],r.images[t]=u}var ZC,JE=p(()=>{"use strict";Ue();qn();qn();oo();bg();Yc();WI();ao();oE();oy();KE();ZC="gltf-package://"});async function YE(r,e={},t){let n={...Uy.options,...e};n.gltf={...Uy.options.gltf,...n.gltf};let s=e?.glb?.byteOffset||0;return await XE({},r,s,n,t)}var Rre,f3,Uy,QE=p(()=>{"use strict";JE();eL();({preload:Rre,...f3}=ZE),Uy={...f3,parse:YE}});var Py={};J(Py,{GLTFLoaderWithParser:()=>Uy,parse:()=>YE});var Vy=p(()=>{"use strict";QE()});async function d3(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Vy(),Py));return r}var ZE,eL=p(()=>{"use strict";Zb();eg();ZE={dataType:null,batchType:null,...Uv,version:Yf,preload:d3,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}}});async function m3(r,e){return tL(r,e)}function tL(r,e){let t={};return ad(t,r,e?.glb?.byteOffset||0,e?.glb),t}var Gre,h3,p3,rL=p(()=>{"use strict";bg();sL();({preload:Gre,...h3}=nL),p3={...h3,parse:m3,parseSync:tL}});var jy={};J(jy,{GLBLoaderWithParser:()=>p3});var Gy=p(()=>{"use strict";rL()});async function b3(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Gy(),jy));return r}var nL,sL=p(()=>{"use strict";Zb();eg();nL={dataType:null,batchType:null,...Pv,version:Yf,preload:b3,options:{glb:{strict:!1}}}});function g3(r){return typeof r=="string"?r.charAt(0).toLowerCase()+r.slice(1):r}function Ld(r){if(Array.isArray(r))return r.map(e=>Ld(e));if(r&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))Object.defineProperty(e,g3(t),{value:Ld(n),enumerable:!0,configurable:!0,writable:!0});return e}return r}var iL=p(()=>{"use strict"});var oL,y3,w3,x3,bu,zy,T3,_3,gu,Wy,Sa,aL=p(()=>{"use strict";oL={ontext:()=>{},onprocessinginstruction:()=>{},onsgmldeclaration:()=>{},ondoctype:()=>{},oncomment:()=>{},onopentagstart:()=>{},onattribute:()=>{},onopentag:()=>{},onclosetag:()=>{},onopencdata:()=>{},oncdata:()=>{},onclosecdata:()=>{},onerror:()=>{},onend:()=>{},onready:()=>{},onscript:()=>{},onopennamespace:()=>{},onclosenamespace:()=>{}},y3={...oL,strict:!1,MAX_BUFFER_LENGTH:64*1024,lowercase:!1,lowercasetags:!1,noscript:!1,strictEntities:!1,preserveCase:!1,caseInsensitiveTags:!1,processEntities:!0,xmlns:void 0,position:void 0,trim:void 0,normalize:void 0},w3=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],x3=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"],bu=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,zy=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,T3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,gu={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(gu).forEach(r=>{let e=gu[r];gu[r]=typeof e=="number"?String.fromCharCode(e):e});Wy=class r{EVENTS=w3;ENTITIES={...gu};XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};S=0;opt;trackPosition=!1;column=0;line=0;c="";error;q="";bufferCheckPosition;closed=!1;tags=[];looseCase="";closedRoot=!1;sawRoot=!1;strict=!1;tag;strictEntities;state;noscript=!1;attribList=[];ns;position=0;STATE={BEGIN:this.S++,BEGIN_WHITESPACE:this.S++,TEXT:this.S++,TEXT_ENTITY:this.S++,OPEN_WAKA:this.S++,SGML_DECL:this.S++,SGML_DECL_QUOTED:this.S++,DOCTYPE:this.S++,DOCTYPE_QUOTED:this.S++,DOCTYPE_DTD:this.S++,DOCTYPE_DTD_QUOTED:this.S++,COMMENT_STARTING:this.S++,COMMENT:this.S++,COMMENT_ENDING:this.S++,COMMENT_ENDED:this.S++,CDATA:this.S++,CDATA_ENDING:this.S++,CDATA_ENDING_2:this.S++,PROC_INST:this.S++,PROC_INST_BODY:this.S++,PROC_INST_ENDING:this.S++,OPEN_TAG:this.S++,OPEN_TAG_SLASH:this.S++,ATTRIB:this.S++,ATTRIB_NAME:this.S++,ATTRIB_NAME_SAW_WHITE:this.S++,ATTRIB_VALUE:this.S++,ATTRIB_VALUE_QUOTED:this.S++,ATTRIB_VALUE_CLOSED:this.S++,ATTRIB_VALUE_UNQUOTED:this.S++,ATTRIB_VALUE_ENTITY_Q:this.S++,ATTRIB_VALUE_ENTITY_U:this.S++,CLOSE_TAG:this.S++,CLOSE_TAG_SAW_WHITE:this.S++,SCRIPT:this.S++,SCRIPT_ENDING:this.S++};BUFFERS=x3;CDATA="[CDATA[";DOCTYPE="DOCTYPE";XML_NAMESPACE="http://www.w3.org/XML/1998/namespace";XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/";rootNS={xml:this.XML_NAMESPACE,xmlns:this.XMLNS_NAMESPACE};comment;sgmlDecl;textNode="";tagName;doctype;procInstName;procInstBody;entity="";attribName;attribValue;cdata="";script="";startTagPosition=0;constructor(){this.S=0;for(let e in this.STATE)this.STATE.hasOwnProperty(e)&&(this.STATE[this.STATE[e]]=e);this.S=this.STATE}static charAt(e,t){let n="";return t<e.length&&(n=e.charAt(t)),n}static isWhitespace(e){return e===" "||e===`
|
|
44
|
+
`||e==="\r"||e===" "}static isQuote(e){return e==='"'||e==="'"}static isAttribEnd(e){return e===">"||r.isWhitespace(e)}static isMatch(e,t){return e.test(t)}static notMatch(e,t){return!r.isMatch(e,t)}static qname(e,t){let s=e.indexOf(":")<0?["",e]:e.split(":"),i=s[0],o=s[1];return t&&e==="xmlns"&&(i="xmlns",o=""),{prefix:i,local:o}}write(e){if(this.error)throw this.error;if(this.closed)return this.errorFunction("Cannot write after close. Assign an onready handler.");if(e===null)return this.end();typeof e=="object"&&(e=e.toString());let t=0,n;for(;n=r.charAt(e,t++),this.c=n,!!n;)switch(this.trackPosition&&(this.position++,n===`
|
|
45
|
+
`?(this.line++,this.column=0):this.column++),this.state){case this.S.BEGIN:if(this.state=this.S.BEGIN_WHITESPACE,n==="\uFEFF")continue;this.beginWhiteSpace(n);continue;case this.S.BEGIN_WHITESPACE:this.beginWhiteSpace(n);continue;case this.S.TEXT:if(this.sawRoot&&!this.closedRoot){let o=t-1;for(;n&&n!=="<"&&n!=="&";)n=r.charAt(e,t++),n&&this.trackPosition&&(this.position++,n===`
|
|
46
|
+
`?(this.line++,this.column=0):this.column++);this.textNode+=e.substring(o,t-1)}n==="<"&&!(this.sawRoot&&this.closedRoot&&!this.strict)?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):(!r.isWhitespace(n)&&(!this.sawRoot||this.closedRoot)&&this.strictFail("Text data outside of root node."),n==="&"?this.state=this.S.TEXT_ENTITY:this.textNode+=n);continue;case this.S.SCRIPT:n==="<"?this.state=this.S.SCRIPT_ENDING:this.script+=n;continue;case this.S.SCRIPT_ENDING:n==="/"?this.state=this.S.CLOSE_TAG:(this.script+=`<${n}`,this.state=this.S.SCRIPT);continue;case this.S.OPEN_WAKA:if(n==="!")this.state=this.S.SGML_DECL,this.sgmlDecl="";else if(!r.isWhitespace(n))if(r.isMatch(bu,n))this.state=this.S.OPEN_TAG,this.tagName=n;else if(n==="/")this.state=this.S.CLOSE_TAG,this.tagName="";else if(n==="?")this.state=this.S.PROC_INST,this.procInstName=this.procInstBody="";else{if(this.strictFail("Unencoded <"),this.startTagPosition+1<this.position){let o=this.position-this.startTagPosition;n=new Array(o).join(" ")+n}this.textNode+=`<${n}`,this.state=this.S.TEXT}continue;case this.S.SGML_DECL:(this.sgmlDecl+n).toUpperCase()===this.CDATA?(this.emitNode("onopencdata"),this.state=this.S.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+n==="--"?(this.state=this.S.COMMENT,this.comment="",this.sgmlDecl=""):(this.sgmlDecl+n).toUpperCase()===this.DOCTYPE?(this.state=this.S.DOCTYPE,(this.doctype||this.sawRoot)&&this.strictFail("Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):n===">"?(this.emitNode("onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=this.S.TEXT):r.isQuote(n)?(this.state=this.S.SGML_DECL_QUOTED,this.sgmlDecl+=n):this.sgmlDecl+=n;continue;case this.S.SGML_DECL_QUOTED:n===this.q&&(this.state=this.S.SGML_DECL,this.q=""),this.sgmlDecl+=n;continue;case this.S.DOCTYPE:n===">"?(this.state=this.S.TEXT,this.emitNode("ondoctype",this.doctype),this.doctype=!0):(this.doctype+=n,n==="["?this.state=this.S.DOCTYPE_DTD:r.isQuote(n)&&(this.state=this.S.DOCTYPE_QUOTED,this.q=n));continue;case this.S.DOCTYPE_QUOTED:this.doctype+=n,n===this.q&&(this.q="",this.state=this.S.DOCTYPE);continue;case this.S.DOCTYPE_DTD:this.doctype+=n,n==="]"?this.state=this.S.DOCTYPE:r.isQuote(n)&&(this.state=this.S.DOCTYPE_DTD_QUOTED,this.q=n);continue;case this.S.DOCTYPE_DTD_QUOTED:this.doctype+=n,n===this.q&&(this.state=this.S.DOCTYPE_DTD,this.q="");continue;case this.S.COMMENT:n==="-"?this.state=this.S.COMMENT_ENDING:this.comment+=n;continue;case this.S.COMMENT_ENDING:n==="-"?(this.state=this.S.COMMENT_ENDED,this.comment=this.textApplyOptions(this.comment),this.comment&&this.emitNode("oncomment",this.comment),this.comment=""):(this.comment+=`-${n}`,this.state=this.S.COMMENT);continue;case this.S.COMMENT_ENDED:n!==">"?(this.strictFail("Malformed comment"),this.comment+=`--${n}`,this.state=this.S.COMMENT):this.state=this.S.TEXT;continue;case this.S.CDATA:n==="]"?this.state=this.S.CDATA_ENDING:this.cdata+=n;continue;case this.S.CDATA_ENDING:n==="]"?this.state=this.S.CDATA_ENDING_2:(this.cdata+=`]${n}`,this.state=this.S.CDATA);continue;case this.S.CDATA_ENDING_2:n===">"?(this.cdata&&this.emitNode("oncdata",this.cdata),this.emitNode("onclosecdata"),this.cdata="",this.state=this.S.TEXT):n==="]"?this.cdata+="]":(this.cdata+=`]]${n}`,this.state=this.S.CDATA);continue;case this.S.PROC_INST:n==="?"?this.state=this.S.PROC_INST_ENDING:r.isWhitespace(n)?this.state=this.S.PROC_INST_BODY:this.procInstName+=n;continue;case this.S.PROC_INST_BODY:if(!this.procInstBody&&r.isWhitespace(n))continue;n==="?"?this.state=this.S.PROC_INST_ENDING:this.procInstBody+=n;continue;case this.S.PROC_INST_ENDING:n===">"?(this.emitNode("onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=this.S.TEXT):(this.procInstBody+=`?${n}`,this.state=this.S.PROC_INST_BODY);continue;case this.S.OPEN_TAG:r.isMatch(zy,n)?this.tagName+=n:(this.newTag(),n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:(r.isWhitespace(n)||this.strictFail("Invalid character in tag name"),this.state=this.S.ATTRIB));continue;case this.S.OPEN_TAG_SLASH:n===">"?(this.openTag(!0),this.closeTag()):(this.strictFail("Forward-slash in opening tag not followed by >"),this.state=this.S.ATTRIB);continue;case this.S.ATTRIB:if(r.isWhitespace(n))continue;n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:r.isMatch(bu,n)?(this.attribName=n,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME:n==="="?this.state=this.S.ATTRIB_VALUE:n===">"?(this.strictFail("Attribute without value"),this.attribValue=this.attribName,this.attrib(),this.openTag()):r.isWhitespace(n)?this.state=this.S.ATTRIB_NAME_SAW_WHITE:r.isMatch(zy,n)?this.attribName+=n:this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME_SAW_WHITE:if(n==="=")this.state=this.S.ATTRIB_VALUE;else{if(r.isWhitespace(n))continue;this.strictFail("Attribute without value"),Object.defineProperty(this.tag.attributes,this.attribName,{value:"",enumerable:!0,configurable:!0,writable:!0}),this.attribValue="",this.emitNode("onattribute",{name:this.attribName,value:""}),this.attribName="",n===">"?this.openTag():r.isMatch(bu,n)?(this.attribName=n,this.state=this.S.ATTRIB_NAME):(this.strictFail("Invalid attribute name"),this.state=this.S.ATTRIB)}continue;case this.S.ATTRIB_VALUE:if(r.isWhitespace(n))continue;r.isQuote(n)?(this.q=n,this.state=this.S.ATTRIB_VALUE_QUOTED):(this.strictFail("Unquoted attribute value"),this.state=this.S.ATTRIB_VALUE_UNQUOTED,this.attribValue=n);continue;case this.S.ATTRIB_VALUE_QUOTED:if(n!==this.q){n==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=n;continue}this.attrib(),this.q="",this.state=this.S.ATTRIB_VALUE_CLOSED;continue;case this.S.ATTRIB_VALUE_CLOSED:r.isWhitespace(n)?this.state=this.S.ATTRIB:n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:r.isMatch(bu,n)?(this.strictFail("No whitespace between attributes"),this.attribName=n,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_VALUE_UNQUOTED:if(!r.isAttribEnd(n)){n==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_U:this.attribValue+=n;continue}this.attrib(),n===">"?this.openTag():this.state=this.S.ATTRIB;continue;case this.S.CLOSE_TAG:if(this.tagName)n===">"?this.closeTag():r.isMatch(zy,n)?this.tagName+=n:this.script?(this.script+=`</${this.tagName}`,this.tagName="",this.state=this.S.SCRIPT):(r.isWhitespace(n)||this.strictFail("Invalid tagname in closing tag"),this.state=this.S.CLOSE_TAG_SAW_WHITE);else{if(r.isWhitespace(n))continue;r.notMatch(bu,n)?this.script?(this.script+=`</${n}`,this.state=this.S.SCRIPT):this.strictFail("Invalid tagname in closing tag."):this.tagName=n}continue;case this.S.CLOSE_TAG_SAW_WHITE:if(r.isWhitespace(n))continue;n===">"?this.closeTag():this.strictFail("Invalid characters in closing tag");continue;case this.S.TEXT_ENTITY:case this.S.ATTRIB_VALUE_ENTITY_Q:case this.S.ATTRIB_VALUE_ENTITY_U:let s,i;switch(this.state){case this.S.TEXT_ENTITY:s=this.S.TEXT,i="textNode";break;case this.S.ATTRIB_VALUE_ENTITY_Q:s=this.S.ATTRIB_VALUE_QUOTED,i="attribValue";break;case this.S.ATTRIB_VALUE_ENTITY_U:s=this.S.ATTRIB_VALUE_UNQUOTED,i="attribValue";break;default:throw new Error(`Unknown state: ${this.state}`)}n===";"?(this[i]+=this.parseEntity(),this.entity="",this.state=s):r.isMatch(this.entity.length?_3:T3,n)?this.entity+=n:(this.strictFail("Invalid character in entity name"),this[i]+=`&${this.entity}${n}`,this.entity="",this.state=s);continue;default:throw new Error(`Unknown state: ${this.state}`)}return this.position>=this.bufferCheckPosition&&this.checkBufferLength(),this}emit(e,t){if(this.events.hasOwnProperty(e)){let n=e.replace(/^on/,"");this.events[e](t,n,this)}}clearBuffers(){for(let e=0,t=this.BUFFERS.length;e<t;e++)this[this[e]]=""}flushBuffers(){this.closeText(),this.cdata!==""&&(this.emitNode("oncdata",this.cdata),this.cdata=""),this.script!==""&&(this.emitNode("onscript",this.script),this.script="")}end(){return this.sawRoot&&!this.closedRoot&&this.strictFail("Unclosed root tag"),this.strict&&this.state!==this.S.BEGIN&&this.state!==this.S.BEGIN_WHITESPACE&&this.state!==this.S.TEXT&&this.errorFunction("Unexpected end"),this.closeText(),this.c="",this.closed=!0,this.emit("onend"),new Sa(this.opt)}errorFunction(e){this.closeText(),this.trackPosition&&(e+=`
|
|
47
|
+
Line: ${this.line}
|
|
48
|
+
Column: ${this.column}
|
|
49
|
+
Char: ${this.c}`);let t=new Error(e);return this.error=t,this.emit("onerror",t),this}attrib(){if(!this.strict&&!this.opt.preserveCase&&(this.attribName=this.attribName[this.looseCase]()),this.attribList.indexOf(this.attribName)!==-1||Object.hasOwn(this.tag.attributes,this.attribName)){this.strictFail("Duplicate attribute"),this.attribName=this.attribValue="";return}if(this.opt.xmlns){let e=r.qname(this.attribName,!0),t=e.prefix,n=e.local;if(t==="xmlns")if(n==="xml"&&this.attribValue!==this.XML_NAMESPACE)this.strictFail(`xml: prefix must be bound to ${this.XML_NAMESPACE}
|
|
50
|
+
Actual: ${this.attribValue}`);else if(n==="xmlns"&&this.attribValue!==this.XMLNS_NAMESPACE)this.strictFail(`xmlns: prefix must be bound to ${this.XMLNS_NAMESPACE}
|
|
51
|
+
Actual: ${this.attribValue}`);else{let s=this.tag,i=this.tags[this.tags.length-1]||this;s.ns===i.ns&&(s.ns=Object.create(i.ns)),s.ns[n]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else Object.defineProperty(this.tag.attributes,this.attribName,{value:this.attribValue,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){!this.strict&&!this.opt.preserveCase&&(this.tagName=this.tagName[this.looseCase]());let e=this.tags[this.tags.length-1]||this,t={name:this.tagName,attributes:{}};this.tag=t,this.opt.xmlns&&(t.ns=e.ns),this.attribList.length=0,this.emitNode("onopentagstart",t)}parseEntity(){let e=this.decodeEntity();return this.opt.processEntities===!1?`&${this.entity};`:e}decodeEntity(){let e=this.entity,t=e.toLowerCase(),n=NaN,s="";return typeof this.ENTITIES[e]=="string"||typeof this.ENTITIES[e]=="number"?this.ENTITIES[e]:typeof this.ENTITIES[t]=="string"||typeof this.ENTITIES[t]=="number"?this.ENTITIES[t]:(e=t,e.charAt(0)==="#"&&(e.charAt(1)==="x"?(e=e.slice(2),n=parseInt(e,16),s=n.toString(16)):(e=e.slice(1),n=parseInt(e,10),s=n.toString(10))),e=e.replace(/^0+/,""),Number.isNaN(n)||s.toLowerCase()!==e?(this.strictFail("Invalid character entity"),`&${this.entity};`):n<0||n>1114111||n>=55296&&n<=57343||n<32&&![9,10,13].includes(n)||n===65534||n===65535?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(n))}beginWhiteSpace(e){e==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):r.isWhitespace(e)||(this.strictFail("Non-whitespace before first tag."),this.textNode=e,this.state=this.S.TEXT)}strictFail(e){if(typeof this!="object"||!(this instanceof Sa))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(e)}textApplyOptions(e){return this.opt.trim&&(e=e.trim()),this.opt.normalize&&(e=e.replace(/\s+/g," ")),e}emitNode(e,t){this.textNode&&this.closeText(),this.emit(e,t)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let e=Math.max(this.opt.MAX_BUFFER_LENGTH,10),t=0;for(let s=0,i=this.BUFFERS.length;s<i;s++){let o=this[this.BUFFERS[s]]?.length||0;if(o>e)switch(this.BUFFERS[s]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[s]}`)}t=Math.max(t,o)}let n=this.opt.MAX_BUFFER_LENGTH-t;this.bufferCheckPosition=n+this.position}openTag(e){if(this.opt.xmlns){let t=this.tag,n=r.qname(this.tagName);t.prefix=n.prefix,t.local=n.local,t.uri=t.ns[n.prefix]||"",t.prefix&&!t.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),t.uri=n.prefix);let s=this.tags[this.tags.length-1]||this;if(t.ns&&s.ns!==t.ns){let i=this;Object.keys(t.ns).forEach(o=>{i.emitNode("onopennamespace",{prefix:o,uri:t.ns[o]})})}for(let i=0,o=this.attribList.length;i<o;i++){let a=this.attribList[i],c=a[0],u=a[1],l=r.qname(c,!0),f=l.prefix,d=l.local,h=f===""?"":t.ns[f]||"",m={name:c,value:u,prefix:f,local:d,uri:h};f&&f!=="xmlns"&&!h&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(f)}`),m.uri=f),Object.defineProperty(this.tag.attributes,c,{value:m,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",m)}this.attribList.length=0}this.tag.isSelfClosing=!!e,this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),e||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}let e=!this.strict&&(this.opt.caseInsensitiveTags||!this.opt.preserveCase);if(this.script){if((e?this.tagName.toLowerCase():this.tagName)!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,n=this.tagName,s=e?n.toLowerCase():n;for(;t--;){let o=this.tags[t];if((e?o.name.toLowerCase():o.name)!==s)this.strictFail("Unexpected close tag");else break}if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=n;let i=this.tags.length;for(;i-- >t;){let o=this.tags.pop();this.tag=o,this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let a={};for(let u in o.ns)o.ns.hasOwnProperty(u)&&(a[u]=o.ns[u]);let c=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&o.ns!==c.ns){let u=this;Object.keys(o.ns).forEach(l=>{let f=o.ns[l];u.emitNode("onclosenamespace",{prefix:l,uri:f})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},Sa=class extends Wy{static ENTITIES=gu;opt=y3;events=oL;constructor(e){super(),this.clearBuffers(),this.opt=e={...this.opt,...e},this.events={...this.events,...e},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!this.opt.strict,this.noscript=!!(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}}});function Ea(r,e,t){Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0})}function cL(r,e={}){if(e.strict!==!1&&/[^\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd\u{10000}-\u{10ffff}]/u.test(r))throw new Error("XML: invalid XML character");let t=e.maxDepth??256;if(!Number.isSafeInteger(t)||t<1||t>4096)throw new Error("XML: maxDepth must be an integer between 1 and 4096");let n=new $y(e,t);if(new Sa({strict:e.strict!==!1,strictEntities:!e.htmlEntities,preserveCase:!0,caseInsensitiveTags:e.strict===!1,processEntities:e.processEntities!==!1,onopentag:i=>n.openElement(i.name,i.attributes||{}),ontext:i=>n.addText(i),oncdata:i=>n.addText(i),onscript:i=>n.addText(i),onclosetag:()=>n.closeElement(),onerror:i=>{throw i}}).write(r).close(),e.strict===!1)for(;n.stack.length;)n.closeElement();if(n.result===void 0)throw new Error("XML: document requires a root element");return n.result}var $y,uL=p(()=>{"use strict";aL();$y=class{options;maximumDepth;stack=[];result;constructor(e,t){this.options=e,this.maximumDepth=t}openElement(e,t){if(this.stack.length>=this.maximumDepth)throw new Error("XML: maximum nesting depth exceeded");if(!this.stack.length&&this.result!==void 0&&this.options.strict!==!1)throw new Error("XML: document requires a single root element");let n=this.normalizeName(e),s=this.stack[this.stack.length-1];this.stack.push({name:n,path:s?`${s.path}.${n}`:n,attributes:this.normalizeAttributes(t),children:{},orderedChildren:[],text:""})}addText(e){let t=this.stack[this.stack.length-1];t&&(t.text+=e)}closeElement(){let e=this.stack.pop();if(!e)return;let t=this.finalizeElement(e),n=this.stack[this.stack.length-1];if(this.options.preserveOrder){n?n.orderedChildren.push(t):this.result=t;return}n?this.addChild(n.children,e.name,e.path,t):(this.result===void 0&&(this.result={}),this.addChild(this.result,e.name,e.path,t))}finalizeElement(e){let t=this.options.trimValues===!1?e.text:e.text.trim();if(this.options.preserveOrder)return{name:e.name,attributes:e.attributes,children:e.orderedChildren,text:t};let n=Object.keys(e.attributes).length>0;if(!n&&!Object.keys(e.children).length)return this.parseValue(t,this.options.parseTagValue!==!1);let s=e.children;if(t&&Ea(s,this.options.textNodeName??"value",this.parseValue(t,this.options.parseTagValue!==!1)),n&&this.options.attributesGroupName)Ea(s,this.options.attributesGroupName,e.attributes);else for(let[i,o]of Object.entries(e.attributes))Ea(s,i,o);return s}addChild(e,t,n,s){if(!Object.hasOwn(e,t))Ea(e,t,this.options.arrayPaths?.includes(n)?[s]:s);else{let i=e[t];Array.isArray(i)?i.push(s):Ea(e,t,[i,s])}}normalizeAttributes(e){let t={};if(this.options.ignoreAttributes)return t;for(let[n,s]of Object.entries(e)){if(this.options.removeNSPrefix&&(n==="xmlns"||n.startsWith("xmlns:")))continue;let i=this.options.trimValues===!1?s:s.trim();Ea(t,(this.options.attributeNamePrefix??"")+this.normalizeName(n),this.parseValue(i,this.options.parseAttributeValue===!0))}return t}normalizeName(e){return this.options.removeNSPrefix?e.slice(e.indexOf(":")+1):e}parseValue(e,t){return t?e==="true"||e==="false"?e==="true":e!==""&&e.trim()!==""&&Number.isFinite(Number(e))?Number(e):e:e}}});function qy(r,e={}){if(Object.hasOwn(e,"_fastXML")||Object.hasOwn(e,"_sax"))throw new Error("XML: backend-specific options were removed; use native XML options");if(e._parser&&!["internal","sax"].includes(e._parser))throw new Error("XML: unsupported parser backend; use the native documents parser");let t=cL(r,e);return e.uncapitalizeKeys?Ld(t):t}var lL=p(()=>{"use strict";iL();uL()});var fL=p(()=>{"use strict";lL()});function yu(r){if(/<!DOCTYPE|<!ENTITY/i.test(r))throw new Error("MaterialX: document types and entity declarations are unsupported.");let e;try{e=qy(r,{preserveOrder:!0,parseAttributeValue:!1,trimValues:!1})}catch(n){throw new Error("MaterialX: malformed XML.",{cause:n})}if(e.name!=="materialx")throw new Error("MaterialX: expected a materialx root element.");let t=e.attributes.version;if(!t||!/^1\.\d+$/.test(t))throw new Error("MaterialX: expected a MaterialX 1.x version.");return{version:t,root:dL(e,0)}}function dL(r,e){return{category:r.name,attributes:r.attributes,children:r.children.map(t=>dL(t,e+1))}}var hL=p(()=>{"use strict";fL()});var Ky={};J(Ky,{MaterialXLoaderWithParser:()=>v3});var cne,A3,v3,Xy=p(()=>{"use strict";mL();hL();({preload:cne,...A3}=pL),v3={...A3,parse:async r=>yu(new TextDecoder().decode(r)),parseSync:r=>yu(new TextDecoder().decode(r)),parseText:async r=>yu(r),parseTextSync:yu}});async function I3(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(Xy(),Ky));return r}var pL,mL=p(()=>{"use strict";pL={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:I3}});function Hy(r){let e=new DataView(r),t=r.byteLength>=84&&84+e.getUint32(80,!0)*50===r.byteLength,n,s,i;if(t){let a=e.getUint32(80,!0);n=new Float32Array(a*9),s=new Float32Array(a*9),i=new TextDecoder().decode(r.slice(0,80));for(let c=0;c<a;c++){let u=84+c*50;for(let l=0;l<9;l++)n[c*9+l]=e.getFloat32(u+12+l*4,!0),s[c*9+l]=e.getFloat32(u+l%3*4,!0)}}else{let a=new TextDecoder().decode(r).trim().split(/\r?\n/).map(f=>f.trim()).filter(Boolean),c=[],u=[];i=a[0]||"";let l=0;for(;l<a.length;){if(!/^solid(?:\s|$)/i.test(a[l++]))throw new Error("STL: expected solid header or exact binary length");for(;l<a.length&&!/^endsolid(?:\s|$)/i.test(a[l]);){let f=bL(a[l++],"facet normal");if(!/^outer\s+loop$/i.test(a[l++]||""))throw new Error("STL: expected outer loop");for(let d=0;d<3;d++)c.push(...bL(a[l++],"vertex")),u.push(...f);if(!/^endloop$/i.test(a[l++]||"")||!/^endfacet$/i.test(a[l++]||""))throw new Error("STL: incomplete facet")}if(l>=a.length)throw new Error("STL: missing endsolid");l++}if(!a.length)throw new Error("STL: empty input");n=new Float32Array(c),s=new Float32Array(u)}if(!n.every(Number.isFinite)||!s.every(Number.isFinite))throw new Error("STL: non-finite coordinates");let o={POSITION:{value:n,size:3},NORMAL:{value:s,size:3}};return{topology:"triangle-list",mode:4,attributes:o,schema:jb(o),header:{vertexCount:n.length/3,boundingBox:Er(o)??void 0},loaderData:{header:i,format:t?"binary":"ascii"}}}function bL(r,e){let t=r?.split(/\s+/)||[],n=e.split(" "),s=t.slice(n.length);if(n.some((i,o)=>t[o]?.toLowerCase()!==i)||s.length!==3||s.some(i=>!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(i)))throw new Error(`STL: invalid ${e} record`);return s.map(Number)}var gL=p(()=>{"use strict";mn()});var Jy={};J(Jy,{STLLoaderWithParser:()=>E3});var pne,S3,E3,Yy=p(()=>{"use strict";wL();gL();({preload:pne,...S3}=yL),E3={...S3,parse:async r=>Hy(r),parseSync:Hy}});async function B3(){let{STLLoaderWithParser:r}=await Promise.resolve().then(()=>(Yy(),Jy));return r}var L3,yL,wL=p(()=>{"use strict";L3="5.0.0-beta.5";yL={name:"STL",id:"stl",module:"scene",version:L3,extensions:["stl"],mimeTypes:["model/stl"],binary:!0,dataType:null,batchType:null,options:{},preload:B3}});function ML(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 J3(r){return r instanceof Map?r.entries():Object.entries(r)}function Tu(r){return ArrayBuffer.isView(r)?r:r&&typeof r=="object"&&"value"in r&&ArrayBuffer.isView(r.value)?r.value:null}function Dd(r,e){return ArrayBuffer.isView(r)?e:r.size}function Y3(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 DL(r){return!!(r.attributeQuantization&&Object.keys(r.attributeQuantization).length)}function Rd(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 Q3(r,e,t){if(Rd(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 RL(r,e){for(let t of["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"])if(r[t]===e)return t;return"GENERIC"}function Z3(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 H3,OL,Ma,kL=p(()=>{"use strict";H3={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},OL=()=>{},Ma=class{draco;dracoEncoder;dracoMeshBuilder;dracoMetadataBuilder;log=OL;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=Z3(t),this.log=t.log||OL,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=DL(t),l,f;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),f=o,n&&f.SetTrackEncodedProperties(!0),l=o.EncodeToDracoBuffer(t.deduplicateValues??!1,i)):(this._setOptions(t),f=this.dracoEncoder,n&&f.SetTrackEncodedProperties(!0),l=this.dracoEncoder.EncodePointCloudToDracoBuffer(s,t.deduplicateValues??!1,i)),!(l>0))throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
52
|
+
with ${s.num_attributes()} attributes into ${l} bytes`);let d=ML(i);return{data:d,report:this._getEncodingReport("point-cloud",d.byteLength,s,f,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=DL(t),l,f;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),f=o,n&&f.SetTrackEncodedProperties(!0),l=o.EncodeToDracoBuffer(!1,i)):(this._setOptions(t),f=this.dracoEncoder,n&&f.SetTrackEncodedProperties(!0),l=this.dracoEncoder.EncodeMeshToDracoBuffer(s,i)),l<=0)throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
53
|
+
with ${s.num_attributes()} attributes into ${l} bytes`);let d=ML(i);return{data:d,report:this._getEncodingReport("mesh",d.byteLength,s,f,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&&(Rd(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&&(Rd(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")Rd(i,o,a.attributeTypeName);else{if(a.attributeTypeName==="NORMAL")throw new Error(`DracoWriter: explicit quantization transforms are not supported for NORMAL attribute "${i}"`);Q3(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[l,f]of Object.entries(i))u[l]={id:f.attributeId,type:f.attributeTypeName,componentCount:f.componentCount,...c.has(l)?{quantization:c.get(l)}:{}};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 l=Tu(c),f=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:f,attributeTypeName:RL(this.draco,f),componentCount:Dd(c,l.length/o),supportsQuantization:l 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 l=Tu(c),f=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:f,attributeTypeName:RL(this.draco,f),componentCount:Dd(c,l.length/o),supportsQuantization:l instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_addAttributeToMesh(e,t,n,s,i={}){let o=Tu(n);if(!o)throw new Error(`DracoWriter: attribute "${t}" must contain a typed array`);let a=this._getDracoAttributeType(t,i.attributeTypes),c=Dd(n,o.length/s);if(a==="indices"){if(o.length%3!==0)throw new Error("DracoWriter: triangle indices length must be divisible by 3");Y3(o,s);let f=o.length/3;this.log(`Adding attribute ${t}, size ${f}`);let d=o instanceof Uint16Array||o instanceof Uint32Array?o:Uint32Array.from(o);return this.dracoMeshBuilder.AddFacesToMesh(e,f,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,l=-1;if(o instanceof Int8Array)l=u.AddInt8Attribute(e,a,s,c,o);else if(o instanceof Int16Array)l=u.AddInt16Attribute(e,a,s,c,o);else if(o instanceof Int32Array)l=u.AddInt32Attribute(e,a,s,c,o);else if(o instanceof Uint8Array)l=u.AddUInt8Attribute(e,a,s,c,o);else if(o instanceof Uint8ClampedArray){let f=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);l=u.AddUInt8Attribute(e,a,s,c,f)}else if(o instanceof Uint16Array)l=u.AddUInt16Attribute(e,a,s,c,o);else if(o instanceof Uint32Array)l=u.AddUInt32Attribute(e,a,s,c,o);else if(o instanceof Float32Array)l=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,l,n.normalized),l}_getDracoAttributeType(e,t={}){if(e.toLowerCase()==="indices")return"indices";let n=t[e];if(n)return this.draco[n];let s=H3[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&&Tu(n);if(!n||!s)throw new Error("DracoWriter: POSITION attribute is required");let i=Dd(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&&Tu(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 J3(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 r8(r,e={}){return(await NL(r,e)).data}async function NL(r,e={}){let{draco:t}=await hy(hn(e)),n=new Ma(t);try{return n.encodeSyncWithReport(PL(r),e.draco)}finally{n.destroy()}}async function n8(r,e={}){UL(e.signal);let t=[],n=0;for await(let s of aw([r],e))t.push(s),n++,e.onProgress?.({completed:n,total:r.length});return t}function aw(r,e={}){let t=i8(r);if(nb(ow,e)){let{onProgress:n,...s}=e;return eb(ow,t,s)}return CL(t,e)}async function*s8(r,e={}){let t=(async function*(){for await(let n of r)yield[n]})();for await(let n of aw(t,e))yield n.data}async function*CL(r,e={}){let{draco:t}=await hy(hn(e)),n=new Ma(t);try{for await(let s of r)for(let i of s)UL(e.signal),yield n.encodeSyncWithReport(i,e.draco)}finally{n.destroy()}}async function*i8(r){for await(let e of r)yield e.map(PL)}function UL(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 PL(r){if(o8(r))return pn(r);if(a8(r))return r;let{indices:e,...t}=r;return{attributes:t,...e?{indices:e}:{}}}function o8(r){return typeof r=="object"&&r!==null&&"shape"in r&&r.shape==="arrow-table"}function a8(r){return typeof r=="object"&&r!==null&&"attributes"in r&&typeof r.attributes=="object"&&r.attributes!==null&&!ArrayBuffer.isView(r.attributes)}var e8,ow,t8,VL=p(()=>{"use strict";Ue();mn();Js();kL();uu();cy();uy();e8={pointcloud:!1,attributeNameEntry:"name"},ow={...au,id:"draco-writer",name:"Draco compressed geometry writer",module:"scene",version:ou,worker:!0,workerNode:"draco-writer-worker-node.cjs",workerSourceNode:"draco/workers/draco-writer-worker-node.ts",options:{draco:{}}},t8={...au,name:"DRACO",version:ou,options:{draco:e8},encode:r8,encodeInBatches:s8}});var jL={};J(jL,{DracoWriter:()=>t8,DracoWriterWorker:()=>ow,encodeDraco:()=>NL,encodeDracoBatch:()=>n8,encodeDracoInBatches:()=>aw,encodeDracoInBatchesLocally:()=>CL});var GL=p(()=>{"use strict";VL()});var wU={};J(wU,{DRACO_EXTERNAL_LIBRARIES:()=>xt,DRACO_EXTERNAL_LIBRARY_URLS:()=>lB,DracoFormat:()=>Ud,DracoLoader:()=>Pd,DracoWorkerLoader:()=>cB,FetchError:()=>A.FetchError,GLBFormat:()=>Fa,GLBLoader:()=>nB,GLBWriter:()=>iB,GLTFFormat:()=>Ba,GLTFLoader:()=>IL,GLTFWriter:()=>rB,JSONLoader:()=>A.JSONLoader,MTLFormat:()=>Bd,MTLLoader:()=>Zy,MTLWorkerLoader:()=>TL,MaterialXLoader:()=>fB,NullLoader:()=>A.NullLoader,NullWorkerLoader:()=>A.NullWorkerLoader,OBJFormat:()=>La,OBJLoader:()=>Qy,OBJWorkerLoader:()=>xL,OBJWriter:()=>AL,RequestScheduler:()=>A.RequestScheduler,STLLoader:()=>dB,USDLoader:()=>Na,_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=wB(jw(),1);Yd();var La={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]};ea();var F3=typeof __VERSION__<"u"?__VERSION__:"latest";async function O3(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Xb(),Kb));return r}var Qy={...La,dataType:null,batchType:null,version:F3,worker:!0,workerInBatches:!0,serializeWorkerResult:Hi,text:!0,testText:M3,options:{obj:{shape:"arrow-table"}},preload:O3};function M3(r){return r[0]==="v"}var xL=Qy;var Bd={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]};var D3=typeof __VERSION__<"u"?__VERSION__:"latest";async function R3(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Qb(),Yb));return r}var Zy={...Bd,dataType:null,batchType:null,version:D3,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:R3},TL=Zy;mn();var k3=typeof __VERSION__<"u"?__VERSION__:"latest",AL={...La,dataType:null,batchType:null,version:k3,options:{obj:{}},text:!0,encode:async(r,e)=>_L(r,e),encodeSync:_L,encodeTextSync:vL};function _L(r,e){let t=vL(r,e);return new TextEncoder().encode(t).buffer}function vL(r,e){let t=pn(N3(r)),n=C3(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 l=0;l<a;l++){let f=[Jn(n,l,0),Jn(n,l,1),Jn(n,l,2)];o&&f.push(ew(o,l,0),ew(o,l,1),ew(o,l,2)),c.push(`v ${f.join(" ")}`)}if(i)for(let l=0;l<a;l++)c.push(`vt ${Jn(i,l,0)} ${Jn(i,l,1)}`);if(s)for(let l=0;l<a;l++)c.push(`vn ${Jn(s,l,0)} ${Jn(s,l,1)} ${Jn(s,l,2)}`);let u=U3(t,a);for(let l=0;l<u.length;l+=3){let f=[tw(u[l],!!i,!!s),tw(u[l+1],!!i,!!s),tw(u[l+2],!!i,!!s)];c.push(`f ${f.join(" ")}`)}return`${c.join(`
|
|
46
54
|
`)}
|
|
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);})();
|
|
55
|
+
`}function N3(r){return"shape"in r&&r.shape==="arrow-table"?r:ei(r,"arrow-table")}function C3(r,e){let t=r.attributes[e];if(!t)throw new Error(`OBJWriter: ${e} attribute is required`);return t}function Jn(r,e,t){return r.value[e*r.size+t]||0}function ew(r,e,t){let n=Jn(r,e,t);return r.normalized||n>1?n/255:n}function U3(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 tw(r,e,t){let n=r+1;return e&&t?`${n}/${n}/${n}`:e?`${n}/${n}`:t?`${n}//${n}`:String(n)}var ii=typeof __VERSION__<"u"?__VERSION__:"latest";var Ba={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 P3(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Vy(),Py));return r}var IL={dataType:null,batchType:null,...Ba,version:ii,preload:P3,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}};Ue();var V3=1179937895,SL=1313821514,rw=5130562,Dt=!0;function wu(r,e,t=0,n={}){let s=V3,i=n.version??("version"in r?r.version:2),o=r.json??{};if(i===3)return j3(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]&&Od(r.binChunks[0]):r.buffers?.[0]&&Od(r.buffers[0]),c=t;e&&(e.setUint32(t+0,s,Dt),e.setUint32(t+4,i,Dt),e.setUint32(t+8,0,Dt));let u=t+8;t+=12;let l=t;e&&(e.setUint32(t+0,0,Dt),e.setUint32(t+4,SL,Dt)),t+=8;let f=JSON.stringify(o);if(t=xf(e,t,f,4),e){let d=t-l-8;e.setUint32(l+0,d,Dt)}if(a){let d=t;if(e&&(e.setUint32(t+0,0,Dt),e.setUint32(t+4,rw,Dt)),t+=8,t=Uc(e,t,a,4),e){let h=t-d-8;e.setUint32(d+0,h,Dt)}}if(e){let d=t-c;e.setUint32(u,d,Dt)}return t}function j3(r,e,t,n,s){let i=t,o=[{type:SL,arrayBuffer:G3(s)},...("chunks"in r?r.chunks:[])??[],..."binChunks"in r?(r.binChunks??[]).map(a=>({type:rw,arrayBuffer:Od(a).slice().buffer})):(r.buffers??[]).map(a=>({type:rw,arrayBuffer:Od(a).slice().buffer}))];e&&(e.setUint32(t,n,Dt),e.setUint32(t+4,3,Dt),Fd(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,Dt),e.setUint32(t+4,c,Dt),Fd(e,t+8,0,"GLB chunk length")),t+=16,t=Uc(e,t,new Uint8Array(a.arrayBuffer),4),e&&Fd(e,u+8,t-u-16,"GLB chunk length")}return e&&Fd(e,i+8,t-i,"GLB file length"),t}function Od(r){return new Uint8Array(r.arrayBuffer,r.byteOffset,r.byteLength)}function G3(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 xf(i,0,e,4),s}function Fd(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),Dt)}function nw(r,e,t,n){return z3(r),wu(r,e,t,n)}function z3(r){if(r.buffers&&r.buffers.length>1)throw new Error("encodeGLTF: multiple buffers not yet implemented")}function ve(r,e){if(!r)throw new Error(e||"assert failed: gltf")}Ue();var EL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},LL={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8};var BL=["SCALAR","VEC2","VEC3","VEC4"],W3=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],$3=new Map(W3),q3={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},K3={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},X3={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array};function Md(r){return BL[r-1]||BL[0]}function wo(r){let e=$3.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function sw(r,e){let t=X3[r.componentType],n=q3[r.type],s=K3[r.componentType],i=r.count*n,o=r.count*n*s;ve(o>=0&&o<=e.byteLength);let a=LL[r.componentType],c=EL[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}function xu(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;ve(n);let s=n.buffer,i=e[s];ve(i),ve((n.byteOffset||0)>=0&&n.byteLength>=0),ve((n.byteOffset||0)+n.byteLength<=i.byteLength),ve(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 FL(r,e,t){let n=r.images[t];return xu(r,e,n.bufferView)}function Oa(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);ve(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=sw(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(ve(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=iw(r,e,n);let u=n.sparse;if(!u)return c;let l=new s(i);new Uint8Array(l.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),ve(u.count>=0&&u.count<=n.count),ve([5121,5123,5125].includes(u.indices.componentType));let f=iw(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=iw(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(l.buffer),b=o*s.BYTES_PER_ELEMENT,g=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let y=0;y<u.count;y++){let x=Number(f[y]);ve(x>h&&x<n.count),m.set(g.subarray(y*b,(y+1)*b),x*b),h=x}return l}function iw(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];ve(s);let{arrayBuffer:i,byteOffset:o}=s;ve((n.byteOffset||0)>=0&&n.byteLength>=0),ve((n.byteOffset||0)+n.byteLength<=s.byteLength),ve(o>=0&&o+s.byteLength<=i.byteLength),ve((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:l,numberOfComponentsInElement:f}=sw(t,n),d=l*f,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=_e(h*l,4),b=h>1?h*m:d,g=n.byteStride??b,y=h>1?(h-1)*m+h*l:d;if(ve(g>=b),ve((t.byteOffset||0)+(t.count===0?0:(t.count-1)*g+y)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*l){let _=n.byteStride??h*m,v=(h-1)*m+h*l;ve((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 K=0;K<t.count;K++)for(let ne=0;ne<h;ne++){let be=new Uint8Array(i,a+K*_+ne*m,h*l);N.set(be,K*d+ne*h*l)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%l!==0){let v=new Uint8Array(i,a,u*l),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%l!==0){let N=new Uint8Array(i,v,d),K=new Uint8Array(d);K.set(N),I=new c(K.buffer,0,f)}else I=new c(i,v,f);T.set(I,_*f)}return T}var cw="KHR_draco_mesh_compression";async function WL(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=u8(r.json),s=l8(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?.[cw])throw new Error("GLTF Draco writer refuses to replace an existing Draco extension");let b=c8(r,h),{encodeDraco:g}=await Promise.resolve().then(()=>(GL(),jL)),y=await g(b,{core:e.core,modules:e.modules,draco:t});o.push({primitive:h,result:y})}if(o.length===0)return i;let a=f8(s),c=a.byteLength;for(let{result:d}of o)c=uw(c)+d.data.byteLength;let u=new Uint8Array(c);u.set(a),n.bufferViews=n.bufferViews||[],n.buffers=n.buffers||[{byteLength:0}];let l=uw(a.byteLength);for(let{primitive:d,result:h}of o){new Uint8Array(u.buffer,l,h.data.byteLength).set(new Uint8Array(h.data));let m=n.bufferViews.length;n.bufferViews.push({buffer:0,byteOffset:l,byteLength:h.data.byteLength}),d.extensions={...d.extensions||{},[cw]:{bufferView:m,attributes:Object.fromEntries(Object.entries(h.report.attributes).map(([b,g])=>[b,g.id]))}},l=uw(l+h.data.byteLength)}let f=u;return i.buffers[0]={...i.buffers[0]||{byteOffset:0},arrayBuffer:f.buffer,byteOffset:0,byteLength:f.byteLength},n.buffers[0]={...n.buffers[0]||{},byteLength:f.byteLength},n.extensionsUsed=d8(n.extensionsUsed,cw),i}function c8(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=zL(r,i,o.componentType);t[s]={value:a,size:h8(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=zL(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 zL(r,e,t){let n=Oa(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 u8(r){return JSON.parse(JSON.stringify(r))}function l8(r){return r.map(e=>({...e,arrayBuffer:e.arrayBuffer.slice(0)}))}function f8(r){let e=r[0]||{arrayBuffer:new ArrayBuffer(0),byteOffset:0,byteLength:0};return new Uint8Array(e.arrayBuffer,e.byteOffset||0,e.byteLength)}function uw(r){return Math.ceil(r/4)*4}function d8(r,e){return r?.includes(e)?r:[...r||[],e]}function h8(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 Dw={};J(Dw,{createExtMeshFeatures:()=>S8,decode:()=>T8,encode:()=>_8,name:()=>x8});qn();Ue();function p8(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var oi=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||p8(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=_e(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 xu(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Oa(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 ve(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return ve(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=$n(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;ve(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=_e(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:Md(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:wo(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]=_e(t,8),t=e[o]+_e(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=to(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&to(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];ve(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 l=e[u.buffer];ve(l!==void 0),u.byteOffset=l+(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=_e(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let l=o.length/s.size,f=new Uint8Array(l*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<l;m++)f.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(f);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:wo(o),count:l})}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 Ye=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}},ai=class extends Ye{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},lw=class extends Ye{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},fw=class extends Ye{get channels(){return To(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new dw(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return To(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new kd(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},dw=class extends ai{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 kd(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 hw(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},hw=class extends ai{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},kd=class extends ai{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},pw=class extends Ye{get loadedBuffer(){return this.gltf.buffers[this.index]}},mw=class extends Ye{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)}},bw=class extends Ye{},gw=class extends Ye{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},yw=class extends Ye{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]}},ww=class extends Ye{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]}},xw=class extends Ye{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 Tw(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Tw=class extends ai{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},_w=class extends Ye{get primitives(){return To(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Aw(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Aw=class extends ai{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}`)])))}},vw=class extends Ye{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return To(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`)}},Iw=class extends Ye{},Sw=class extends Ye{get nodes(){return To(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},Ew=class extends Ye{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 To(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},Lw=class extends Ye{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`)}},Kr=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return xu(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Oa(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return FL(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:Md(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=m8(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof ai?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&&(qL(this.data.extensionsUsed,i),qL(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 To(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=`${b8(e)}[${t}]`;switch(e){case"accessor":return new lw(this,e,t,n,s);case"animation":return new fw(this,e,t,n,s);case"buffer":return new pw(this,e,t,n,s);case"bufferView":return new mw(this,e,t,n,s);case"camera":return new bw(this,e,t,n,s);case"externalAsset":return new gw(this,e,t,n,s);case"file":return new yw(this,e,t,n,s);case"image":return new ww(this,e,t,n,s);case"material":return new xw(this,e,t,n,s);case"mesh":return new _w(this,e,t,n,s);case"node":return new vw(this,e,t,n,s);case"sampler":return new Iw(this,e,t,n,s);case"scene":return new Sw(this,e,t,n,s);case"skin":return new Ew(this,e,t,n,s);case"texture":return new Lw(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 m8(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return xo(r.channels)},get samplers(){return xo(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 xo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return xo(r.primitives)}};case"primitive":return{get attributes(){return $L(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map($L)}};case"node":return{get camera(){return r.camera?.data},get children(){return xo(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 xo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return xo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function To(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function xo(r){return(function*(){for(let t of r)yield t.data})()}function $L(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function b8(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function qL(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}qn();Ue();function KL(r){return(r%1+1)%1}var XL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},g8={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},HL={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Bw(r,e){return HL[e]*XL[r]}function Fw(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=Nd(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 Nd(r,e,t,n=1){let s=XL[e],i=g8[t],o=HL[t],a=n*s,c=a*o,u=r.buffer,l=r.byteOffset;return l%o!==0&&(u=new Uint8Array(u).slice(l,l+c).buffer,l=0),new i(ro(u),l,a)}function Cd(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,l=r.gltf.images?.[c];if(l&&typeof l.width<"u"&&!("compressed"in l&&l.compressed)){let f=[];for(let d=0;d<i.length;d+=2){let h=y8(l,u,i,d,e.channels);f.push(h)}return f}}return[]}function JL(r,e,t,n,s){if(!t?.length)return;let i=[];for(let f of t){let d=n.findIndex(h=>h===f);d===-1&&(d=n.push(f)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof Kr?r:new Kr(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),l=a.addAccessor(u,{size:1,componentType:wo(o),count:o.length});s.attributes[e]=l}function y8(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=w8(o,a,r,c),l=0;for(let f of s){let d=typeof f=="number"?Object.values(i)[f]:i[f],h=u+d.offset,m=Jc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];l|=b<<d.shift}return l}function w8(r,e,t,n=1){let s=t.width,i=KL(r)*(s-1),o=Math.round(i),a=t.height,c=KL(e)*(a-1),u=Math.round(c),l=t.components?t.components:n;return(u*s+o)*l}function Ow(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 Mw(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 YL(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],l=[];for(let f=c;f<u;f++){let d=n[f],h=n[f+1],m=e.subarray(d,h);l.push(i.decode(m))}o.push(l)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),l=Number(n[c+1]);u>=0&&l>=u&&l<=e.length&&o.push(i.decode(e.subarray(u,l)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var Da="EXT_mesh_features",x8=Da;async function T8(r,e){let t=new Kr(r);A8(t,e)}function _8(r,e){let t=new oi(r);return I8(t,e),t.createBinaryChunk(),t.gltf}function A8(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)v8(r,n,e)}function v8(r,e,t){let s=r.getExtension(e,Da)?.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=Cd(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 I8(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)E8(r,s)}function S8(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[Da];s||(s={featureIds:[]},e.extensions[Da]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,Da,s)}function E8(r,e){let t=e.extensions?.[Da];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=L8(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),l=r.addAccessor(u,{size:1,componentType:wo(c),count:c.length});e.attributes[o]=l}})}function L8(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 Cw={};J(Cw,{createExtStructuralMetadata:()=>eU,decode:()=>O8,encode:()=>M8,name:()=>F8});function ZL(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return QL(r);let s=t?.baseUrl||B8(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 QL(i)}function QL(r){try{return new URL(r).href}catch{return r}}function B8(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var _o="EXT_structural_metadata",F8=_o;async function O8(r,e,t){let n=new Kr(r),s=n.getExtension(_o);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=ZL(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()}D8(n,e)}function M8(r,e){let t=new oi(r);return Q8(t,e),t.createBinaryChunk(),t.gltf}function D8(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(_o);t&&(e.gltf?.loadImages&&R8(r,t),k8(r,t))}function R8(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)N8(r,t,i,e)}function k8(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]&&U8(r,t,i)}function N8(r,e,t,n){if(!e)return;let i=t.extensions?.[_o]?.propertyTextures;if(i)for(let o of i){let a=e[o];C8(r,a,t,n)}}function C8(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=Cd(r,a,t);u!==null&&(JL(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function U8(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=P8(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 P8(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=j8(r,t,s,n),l=G8(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let f=z8(t,s,n,c,u);o=f.data,i&&(i.value=f.rawData);break}case"BOOLEAN":{o=V8(t,n,c,u);break}case"STRING":{o=YL(n,c,u,l,t.array?t.count:void 0);break}case"ENUM":{o=K8(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function V8(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 Rw(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>Rw(t,i*r.count,r.count)):Rw(t,0,e)}function Rw(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 j8(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?Fw(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function G8(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return Fw(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function z8(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=Bw(r.type,r.componentType),u=n.byteLength/c,l;r.componentType?l=Nd(n,r.type,r.componentType,u):l=n;let f=l,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?W8(f,r.componentType,r.type,r.normalized,d,h):f;return i?s?{data:Ow(m,t,s,a),rawData:Ow(f,t,s,a)}:o?{data:Mw(m,t,o,a),rawData:Mw(f,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:f}}function W8(r,e,t,n,s,i){let o=q8(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=$8(t),u=new Float64Array(r.length);for(let l=0;l<r.length;l++){let f=Number(r[l]);a&&(f=e?.startsWith("INT")?Math.max(f/o,-1):f/o);let d=l%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[l]=f*m+h}return u}function $8(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 q8(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 K8(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=Bw(e.type,a),u=n.byteLength/c,l=Nd(n,e.type,a,u);if(l||(l=n),e.array){if(s)return X8({valuesData:l,numberOfElements:t,arrayOffsets:s,enumEntry:o});let f=e.count;return f?H8(l,t,f,o):[]}return Nw(l,0,t,o)}function X8(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=Nw(e,a,c,s);i.push(u)}return i}function H8(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=Nw(r,o,t,n);s.push(a)}return s}function Nw(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=J8(n,o);a?s.push(a.name):s.push("")}return s}function J8(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 Y8="schemaClassId";function Q8(r,e){let t=r.getExtension(_o);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&Z8(n,i,r)}}function Z8(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=nU(s,i,t);r.properties[n]=o}}}}function eU(r,e,t=Y8){let n=r.getExtension(_o);n||(n=r.addExtension(_o)),n.schema=tU(e,t,n.schema);let s=rU(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function tU(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 rU(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 nU(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=oU(r);n.stringOffsets=kw(i,t),n.values=kw(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=iU(r,e.componentType);n.values=kw(s,t)}return n}var sU={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function iU(r,e){let t=[];for(let s of r)t.push(Number(s));let n=sU[e];if(!n)throw new Error("Illegal component type");return new n(t)}function oU(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 kw(r,e){return e.addBufferView(r)}var Uw={};J(Uw,{decode:()=>cU,encode:()=>uU,name:()=>aU});var Ra="KHR_materials_unlit",aU=Ra;async function cU(r){let e=new Kr(r);for(let t of e.materials)e.getExtension(t,Ra)&&(t.unlit=!0),e.removeExtension(t,Ra);e.removeExtension(Ra)}function uU(r){let e=new oi(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,Ra,{}),e.registerRequiredExtension(Ra))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var lU=[Uw,Cw,Dw];function eB(r,e={}){for(let t of lU)r=t.encode?.(r,e)??r;return r}var rB={dataType:null,batchType:null,...Ba,version:ii,options:{gltf:{}},encode:async(r,e={})=>{let t=await WL(r,e),n={...e};return n.gltf=e.gltf?{...e.gltf,draco:void 0}:void 0,tB(t,n)},encodeSync:tB};function tB(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=eB(r);r.buffers=n.buffers,r.binary=n.binary;let s=nw(n,null,t,e),i=new ArrayBuffer(s),o=new DataView(i);return nw(n,o,t,e),i}async function fU(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Gy(),jy));return r}var nB={dataType:null,batchType:null,...Fa,version:ii,preload:fU,options:{glb:{strict:!1}}};var iB={...Fa,version:ii,options:{glb:{}},encode:async(r,e={})=>sB(r,e),encodeSync:sB};function sB(r,e){let{byteOffset:t=0}=e??{},n=e?.glb??{},s=wu(r,null,t,n),i=new ArrayBuffer(s),o=new DataView(i);return wu(r,o,t,n),i}ea();var oB=typeof __VERSION__<"u"?__VERSION__:"latest";var Ud={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]};var aB={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"};async function dU(r,e){let t=e;switch(hU(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(my(),py));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(gy(),by));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(wy(),yy));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}var Pd={dataType:null,batchType:null,...Ud,version:oB,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:af,deserializeWorkerResult:cf,options:{draco:aB},preload:dU},cB=Pd;function hU(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Pd.options.draco.backend}var pU="1.5.7",mU="8786740086a9f4d83f44aa83badfbea4dce7a1b5",_u=`https://www.gstatic.com/draco/versioned/decoders/${pU}`,uB=`https://cdn.jsdelivr.net/gh/google/draco@${mU}/javascript`,xt={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"},lB={[xt.DECODER]:`${_u}/${xt.DECODER}`,[xt.DECODER_WASM]:`${_u}/${xt.DECODER_WASM}`,[xt.GLTF_DECODER]:`${_u}/${xt.GLTF_DECODER}`,[xt.GLTF_DECODER_WASM]:`${_u}/${xt.GLTF_DECODER_WASM}`,[xt.FALLBACK_DECODER]:`${_u}/${xt.FALLBACK_DECODER}`,[xt.ENCODER]:`${uB}/${xt.ENCODER}`,[xt.ENCODER_WASM]:`${uB}/${xt.ENCODER_WASM}`};async function bU(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(Xy(),Ky));return r}var fB={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:bU};var gU=typeof __VERSION__<"u"?__VERSION__:"latest";async function yU(){let{STLLoaderWithParser:r}=await Promise.resolve().then(()=>(Yy(),Jy));return r}var dB={name:"STL",id:"stl",module:"scene",version:gU,extensions:["stl"],mimeTypes:["model/stl"],binary:!0,dataType:null,batchType:null,options:{},preload:yU};return xB(wU);})();
|
|
48
56
|
return __exports__;
|
|
49
57
|
});
|