@loaders.gl/schema 4.4.0-alpha.18 → 4.4.0-alpha.19

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.
@@ -1,4 +1,5 @@
1
1
  import type { ImageType } from "./category-image.js";
2
+ import type { TypedArray } from "../types/types.js";
2
3
  /**
3
4
  * These represent the main compressed texture formats
4
5
  * Each format typically has a number of more specific subformats
@@ -6,24 +7,107 @@ import type { ImageType } from "./category-image.js";
6
7
  export type GPUTextureFormat = 'dxt' | 'dxt-srgb' | 'etc1' | 'etc2' | 'pvrtc' | 'atc' | 'astc' | 'rgtc';
7
8
  export type TextureFormat = TextureFormatColorUncompressed | TextureFormatCompressed;
8
9
  export type TextureFormatColorUncompressed = 'r8unorm' | 'rg8unorm' | 'rgb8unorm-webgl' | 'rgba8unorm' | 'rgba8unorm-srgb' | 'r8snorm' | 'rg8snorm' | 'rgb8snorm-webgl' | 'rgba8snorm' | 'r8uint' | 'rg8uint' | 'rgba8uint' | 'r8sint' | 'rg8sint' | 'rgba8sint' | 'bgra8unorm' | 'bgra8unorm-srgb' | 'r16unorm' | 'rg16unorm' | 'rgb16unorm-webgl' | 'rgba16unorm' | 'r16snorm' | 'rg16snorm' | 'rgb16snorm-webgl' | 'rgba16snorm' | 'r16uint' | 'rg16uint' | 'rgba16uint' | 'r16sint' | 'rg16sint' | 'rgba16sint' | 'r16float' | 'rg16float' | 'rgba16float' | 'r32uint' | 'rg32uint' | 'rgba32uint' | 'r32sint' | 'rg32sint' | 'rgba32sint' | 'r32float' | 'rg32float' | 'rgb32float-webgl' | 'rgba32float' | 'rgba4unorm-webgl' | 'rgb565unorm-webgl' | 'rgb5a1unorm-webgl' | 'rgb9e5ufloat' | 'rg11b10ufloat' | 'rgb10a2unorm' | 'rgb10a2uint';
9
- export type TextureFormatCompressed = 'bc1-rgb-unorm-webgl' | 'bc1-rgb-unorm-srgb-webgl' | 'pvrtc-rgb4unorm-webgl' | 'pvrtc-rgba4unorm-webgl' | 'pvrtc-rbg2unorm-webgl' | 'pvrtc-rgba2unorm-webgl' | 'etc1-rbg-unorm-webgl' | 'atc-rgb-unorm-webgl' | 'atc-rgba-unorm-webgl' | 'atc-rgbai-unorm-webgl' | 'bc1-rgba-unorm' | 'bc1-rgba-unorm-srgb' | 'bc2-rgba-unorm' | 'bc2-rgba-unorm-srgb' | 'bc3-rgba-unorm' | 'bc3-rgba-unorm-srgb' | 'bc4-r-unorm' | 'bc4-r-snorm' | 'bc5-rg-unorm' | 'bc5-rg-snorm' | 'bc6h-rgb-ufloat' | 'bc6h-rgb-float' | 'bc7-rgba-unorm' | 'bc7-rgba-unorm-srgb' | 'etc2-rgb8unorm' | 'etc2-rgb8unorm-srgb' | 'etc2-rgb8a1unorm' | 'etc2-rgb8a1unorm-srgb' | 'etc2-rgba8unorm' | 'etc2-rgba8unorm-srgb' | 'eac-r11unorm' | 'eac-r11snorm' | 'eac-rg11unorm' | 'eac-rg11snorm' | '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';
10
- export type GLTextureFormat = 0x1907 | 0x1908 | 0x8056 | 0x8057 | 0x8058 | 0x8d62 | 0x83f0 | 0x83f1 | 0x83f2 | 0x83f3 | 0x9270 | 0x9271 | 0x9272 | 0x9273 | 0x9274 | 0x9275 | 0x9276 | 0x9277 | 0x9278 | 0x9279 | 0x8c00 | 0x8c01 | 0x8c02 | 0x8c03 | 0x8d64 | 0x8c92 | 0x8c93 | 0x87ee | 0x8dbb | 0x8dbc | 0x8dbd | 0x8dbe | 0x8e8c | 0x8e8d | 0x8e8e | 0x8e8f | 0x8c4c | 0x8c4d | 0x8c4e | 0x8c4f | 0x93b0 | 0x93b1 | 0x93b2 | 0x93b3 | 0x93b4 | 0x93b5 | 0x93b6 | 0x93b7 | 0x93b8 | 0x93b9 | 0x93ba | 0x93bb | 0x93bc | 0x93bd | 0x93d0 | 0x93d1 | 0x93d2 | 0x93d3 | 0x93d4 | 0x93d5 | 0x93d6 | 0x93d7 | 0x93d8 | 0x93d9 | 0x93da | 0x93db | 0x93dc | 0x93dd;
10
+ export type TextureFormatCompressed = 'bc1-rgb-unorm-webgl' | 'bc1-rgb-unorm-srgb-webgl' | 'pvrtc-rgb4unorm-webgl' | 'pvrtc-rgba4unorm-webgl' | 'pvrtc-rgb2unorm-webgl' | 'pvrtc-rgba2unorm-webgl' | 'etc1-rgb-unorm-webgl' | 'atc-rgb-unorm-webgl' | 'atc-rgba-unorm-webgl' | 'atc-rgbai-unorm-webgl' | 'bc1-rgba-unorm' | 'bc1-rgba-unorm-srgb' | 'bc2-rgba-unorm' | 'bc2-rgba-unorm-srgb' | 'bc3-rgba-unorm' | 'bc3-rgba-unorm-srgb' | 'bc4-r-unorm' | 'bc4-r-snorm' | 'bc5-rg-unorm' | 'bc5-rg-snorm' | 'bc6h-rgb-ufloat' | 'bc6h-rgb-float' | 'bc7-rgba-unorm' | 'bc7-rgba-unorm-srgb' | 'etc2-rgb8unorm' | 'etc2-rgb8unorm-srgb' | 'etc2-rgb8a1unorm' | 'etc2-rgb8a1unorm-srgb' | 'etc2-rgba8unorm' | 'etc2-rgba8unorm-srgb' | 'eac-r11unorm' | 'eac-r11snorm' | 'eac-rg11unorm' | 'eac-rg11snorm' | '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';
11
+ /** Application-facing metadata attached to texture payloads. */
12
+ export type TextureMetadata = Record<string, unknown>;
13
+ /** Return type of `texture` category loaders. */
14
+ export type Texture<MetadataT extends TextureMetadata = TextureMetadata> = Texture1D<MetadataT> | Texture2D<MetadataT> | Texture3D<MetadataT> | TextureCube<MetadataT> | Texture2DArray<MetadataT> | TextureCubeArray<MetadataT>;
15
+ /** One-dimensional texture with mip levels. */
16
+ export type Texture1D<MetadataT extends TextureMetadata = TextureMetadata> = {
17
+ /** loaders.gl shape tag identifying texture payloads. */
18
+ shape: 'texture';
19
+ /** Application-facing format metadata, when provided by the loader. */
20
+ metadata?: MetadataT;
21
+ /** Texture dimensionality. */
22
+ type: '1d';
23
+ /** Canonical loaders.gl texture format for the texture payload. */
24
+ format: TextureFormat;
25
+ /** Mip levels that make up the texture. */
26
+ data: TextureLevel[];
27
+ };
28
+ /** Two-dimensional texture with mip levels. */
29
+ export type Texture2D<MetadataT extends TextureMetadata = TextureMetadata> = {
30
+ /** loaders.gl shape tag identifying texture payloads. */
31
+ shape: 'texture';
32
+ /** Application-facing format metadata, when provided by the loader. */
33
+ metadata?: MetadataT;
34
+ /** Texture dimensionality. */
35
+ type: '2d';
36
+ /** Canonical loaders.gl texture format for the texture payload. */
37
+ format: TextureFormat;
38
+ /** Mip levels that make up the texture. */
39
+ data: TextureLevel[];
40
+ };
41
+ /** Three-dimensional texture with mip levels for each depth slice. */
42
+ export type Texture3D<MetadataT extends TextureMetadata = TextureMetadata> = {
43
+ /** loaders.gl shape tag identifying texture payloads. */
44
+ shape: 'texture';
45
+ /** Application-facing format metadata, when provided by the loader. */
46
+ metadata?: MetadataT;
47
+ /** Texture dimensionality. */
48
+ type: '3d';
49
+ /** Canonical loaders.gl texture format for the texture payload. */
50
+ format: TextureFormat;
51
+ /** Mip levels grouped by depth slice. */
52
+ data: TextureLevel[][];
53
+ };
54
+ /** Cube texture with mip levels for each face. */
55
+ export type TextureCube<MetadataT extends TextureMetadata = TextureMetadata> = {
56
+ /** loaders.gl shape tag identifying texture payloads. */
57
+ shape: 'texture';
58
+ /** Application-facing format metadata, when provided by the loader. */
59
+ metadata?: MetadataT;
60
+ /** Texture dimensionality. */
61
+ type: 'cube';
62
+ /** Canonical loaders.gl texture format for the texture payload. */
63
+ format: TextureFormat;
64
+ /** Mip levels grouped by cube face. */
65
+ data: TextureLevel[][];
66
+ };
67
+ /** Array of two-dimensional textures with mip levels for each layer. */
68
+ export type Texture2DArray<MetadataT extends TextureMetadata = TextureMetadata> = {
69
+ /** loaders.gl shape tag identifying texture payloads. */
70
+ shape: 'texture';
71
+ /** Application-facing format metadata, when provided by the loader. */
72
+ metadata?: MetadataT;
73
+ /** Texture dimensionality. */
74
+ type: '2d-array';
75
+ /** Canonical loaders.gl texture format for the texture payload. */
76
+ format: TextureFormat;
77
+ /** Mip levels grouped by array layer. */
78
+ data: TextureLevel[][];
79
+ };
80
+ /** Array of cube textures with mip levels for each face in each layer. */
81
+ export type TextureCubeArray<MetadataT extends TextureMetadata = TextureMetadata> = {
82
+ /** loaders.gl shape tag identifying texture payloads. */
83
+ shape: 'texture';
84
+ /** Application-facing format metadata, when provided by the loader. */
85
+ metadata?: MetadataT;
86
+ /** Texture dimensionality. */
87
+ type: 'cube-array';
88
+ /** Canonical loaders.gl texture format for the texture payload. */
89
+ format: TextureFormat;
90
+ /** Mip levels grouped by cube-array layer and face. */
91
+ data: TextureLevel[][][];
92
+ };
11
93
  /** A TextureLevel holds data for one texture mip level */
12
94
  export type TextureLevel = {
13
- /** Shape tag identifying texture level payloads */
95
+ /** loaders.gl shape tag identifying texture level payloads */
14
96
  shape: 'texture-level';
15
97
  /** WebGPU texture format corresponding the format of the data in this TextureLevel */
16
98
  textureFormat?: TextureFormat;
17
- /** WebGL texture format constant corresponding the format of the data in this TextureLevel */
18
- format?: GLTextureFormat;
99
+ /** Numeric API-specific format constant, currently used for WebGL/OpenGL upload paths */
100
+ format?: number;
19
101
  /** Whether the texture is compressed */
20
102
  compressed: boolean;
21
103
  /** Width in texels */
22
104
  width: number;
23
105
  /** Height in texels */
24
106
  height: number;
25
- /** Byte array */
26
- data: Uint8Array;
107
+ /** Optional bitmap handle for image-backed texture levels */
108
+ imageBitmap?: ImageBitmap;
109
+ /** Byte array or float pixel data. Will be a dummy length 0 array if imageBitmap is provided */
110
+ data: TypedArray;
27
111
  levelSize?: number;
28
112
  hasAlpha?: boolean;
29
113
  };
@@ -1 +1 @@
1
- {"version":3,"file":"category-texture.d.ts","sourceRoot":"","sources":["../../src/categories/category-texture.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"category-texture.d.ts","sourceRoot":"","sources":["../../src/categories/category-texture.ts"],"names":[],"mappings":"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"}
package/dist/dist.dev.js CHANGED
@@ -2452,8 +2452,8 @@ var __exports__ = (() => {
2452
2452
  // ../core/src/lib/loader-utils/option-defaults.ts
2453
2453
  var DEFAULT_LOADER_OPTIONS = {
2454
2454
  core: {
2455
- baseUri: void 0,
2456
- // baseUri
2455
+ baseUrl: void 0,
2456
+ // baseUrl
2457
2457
  fetch: null,
2458
2458
  mimeType: void 0,
2459
2459
  fallbackMimeType: void 0,
@@ -2485,8 +2485,8 @@ var __exports__ = (() => {
2485
2485
  }
2486
2486
  };
2487
2487
  var REMOVED_LOADER_OPTIONS = {
2488
- // baseUri
2489
- baseUri: "core.baseUri",
2488
+ // deprecated top-level alias
2489
+ baseUri: "core.baseUrl",
2490
2490
  fetch: "core.fetch",
2491
2491
  mimeType: "core.mimeType",
2492
2492
  fallbackMimeType: "core.fallbackMimeType",
@@ -2511,7 +2511,7 @@ var __exports__ = (() => {
2511
2511
  // Older deprecations
2512
2512
  throws: "nothrow",
2513
2513
  dataType: "(no longer used)",
2514
- uri: "baseUri",
2514
+ uri: "core.baseUrl",
2515
2515
  // Warn if fetch options are used on toplevel
2516
2516
  method: "core.fetch.method",
2517
2517
  headers: "core.fetch.headers",
@@ -2529,7 +2529,7 @@ var __exports__ = (() => {
2529
2529
 
2530
2530
  // ../core/src/lib/loader-utils/option-utils.ts
2531
2531
  var CORE_LOADER_OPTION_KEYS = [
2532
- "baseUri",
2532
+ "baseUrl",
2533
2533
  "fetch",
2534
2534
  "mimeType",
2535
2535
  "fallbackMimeType",
@@ -2679,11 +2679,10 @@ var __exports__ = (() => {
2679
2679
  if (!url) {
2680
2680
  return;
2681
2681
  }
2682
- const hasTopLevelBaseUri = options.baseUri !== void 0;
2683
- const hasCoreBaseUri = options.core?.baseUri !== void 0;
2684
- if (!hasTopLevelBaseUri && !hasCoreBaseUri) {
2682
+ const hasCoreBaseUrl = options.core?.baseUrl !== void 0;
2683
+ if (!hasCoreBaseUrl) {
2685
2684
  options.core ||= {};
2686
- options.core.baseUri = url;
2685
+ options.core.baseUrl = path_exports.dirname(stripQueryString(url));
2687
2686
  }
2688
2687
  }
2689
2688
  function cloneLoaderOptions(options) {
@@ -2694,6 +2693,12 @@ var __exports__ = (() => {
2694
2693
  return clonedOptions;
2695
2694
  }
2696
2695
  function moveDeprecatedTopLevelOptionsToCore(options) {
2696
+ if (options.baseUri !== void 0) {
2697
+ options.core ||= {};
2698
+ if (options.core.baseUrl === void 0) {
2699
+ options.core.baseUrl = options.baseUri;
2700
+ }
2701
+ }
2697
2702
  for (const key of CORE_LOADER_OPTION_KEYS) {
2698
2703
  if (options[key] !== void 0) {
2699
2704
  const coreOptions = options.core = options.core || {};
@@ -2787,6 +2792,18 @@ var __exports__ = (() => {
2787
2792
  }
2788
2793
  const normalizedOptions = normalizeLoaderOptions(options || {});
2789
2794
  normalizedOptions.core ||= {};
2795
+ if (data instanceof Response && mayContainText(data)) {
2796
+ const text = await data.clone().text();
2797
+ const textLoader = selectLoaderSync(
2798
+ text,
2799
+ loaders,
2800
+ { ...normalizedOptions, core: { ...normalizedOptions.core, nothrow: true } },
2801
+ context
2802
+ );
2803
+ if (textLoader) {
2804
+ return textLoader;
2805
+ }
2806
+ }
2790
2807
  let loader = selectLoaderSync(
2791
2808
  data,
2792
2809
  loaders,
@@ -2800,11 +2817,21 @@ var __exports__ = (() => {
2800
2817
  data = await data.slice(0, 10).arrayBuffer();
2801
2818
  loader = selectLoaderSync(data, loaders, normalizedOptions, context);
2802
2819
  }
2820
+ if (!loader && data instanceof Response && mayContainText(data)) {
2821
+ const text = await data.clone().text();
2822
+ loader = selectLoaderSync(text, loaders, normalizedOptions, context);
2823
+ }
2803
2824
  if (!loader && !normalizedOptions.core.nothrow) {
2804
2825
  throw new Error(getNoValidLoaderMessage(data));
2805
2826
  }
2806
2827
  return loader;
2807
2828
  }
2829
+ function mayContainText(response) {
2830
+ const mimeType = getResourceMIMEType(response);
2831
+ return Boolean(
2832
+ mimeType && (mimeType.startsWith("text/") || mimeType === "application/json" || mimeType.endsWith("+json"))
2833
+ );
2834
+ }
2808
2835
  function selectLoaderSync(data, loaders = [], options, context) {
2809
2836
  if (!validHTTPResponse(data)) {
2810
2837
  return null;
@@ -3445,6 +3472,18 @@ var __exports__ = (() => {
3445
3472
  if (isBlob(url)) {
3446
3473
  data = await fetch2(url);
3447
3474
  }
3475
+ if (typeof url === "string") {
3476
+ const normalizedOptions = normalizeLoaderOptions(resolvedOptions || {});
3477
+ if (!normalizedOptions.core?.baseUrl) {
3478
+ resolvedOptions = {
3479
+ ...resolvedOptions,
3480
+ core: {
3481
+ ...resolvedOptions?.core,
3482
+ baseUrl: url
3483
+ }
3484
+ };
3485
+ }
3486
+ }
3448
3487
  return Array.isArray(resolvedLoaders) ? await parse(data, resolvedLoaders, resolvedOptions) : await parse(data, resolvedLoaders, resolvedOptions);
3449
3488
  }
3450
3489
 
package/dist/dist.min.js CHANGED
@@ -4,12 +4,12 @@
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 Ae=Object.defineProperty;var Yt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Xt=Object.prototype.hasOwnProperty;var eo=(e,r,t)=>r in e?Ae(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Nr=(e,r)=>{for(var t in r)Ae(e,t,{get:r[t],enumerable:!0})},ro=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Zt(r))!Xt.call(e,n)&&n!==t&&Ae(e,n,{get:()=>r[n],enumerable:!(o=Yt(r,n))||o.enumerable});return e};var to=e=>ro(Ae({},"__esModule",{value:!0}),e);var Pr=(e,r,t)=>(eo(e,typeof r!="symbol"?r+"":r,t),t);var Tn={};Nr(Tn,{FetchError:()=>X,JSONLoader:()=>dr,NullLoader:()=>Qt,NullWorkerLoader:()=>Ht,RequestScheduler:()=>Z,_BrowserFileSystem:()=>Pe,_fetchProgress:()=>Jt,_selectSource:()=>qt,_unregisterLoaders:()=>_t,assert:()=>z,concatenateArrayBuffersAsync:()=>U,createDataSource:()=>zt,document:()=>ve,encode:()=>$t,encodeInBatches:()=>jt,encodeSync:()=>Cr,encodeTable:()=>Ir,encodeTableAsText:()=>Ft,encodeTableInBatches:()=>Or,encodeText:()=>vt,encodeTextSync:()=>Dt,encodeURLtoURL:()=>Mr,fetchFile:()=>D,forEach:()=>lr,getLoaderOptions:()=>B,getPathPrefix:()=>hr,global:()=>$e,isAsyncIterable:()=>Q,isBrowser:()=>p,isIterable:()=>P,isIterator:()=>J,isPromise:()=>ae,isPureObject:()=>H,isReadableStream:()=>L,isResponse:()=>l,isWorker:()=>De,isWritableStream:()=>Qe,load:()=>Wt,loadInBatches:()=>Pt,makeIterator:()=>ne,makeLineIterator:()=>fr,makeNumberedLineIterator:()=>ur,makeStream:()=>Vt,makeTextDecoderIterator:()=>ar,makeTextEncoderIterator:()=>cr,parse:()=>_,parseInBatches:()=>C,parseSync:()=>Mt,readArrayBuffer:()=>ht,registerLoaders:()=>Tt,resolvePath:()=>I,selectLoader:()=>oe,selectLoaderSync:()=>te,self:()=>Fe,setLoaderOptions:()=>Ar,setPathPrefix:()=>pr,window:()=>Ue});function z(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var T={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Fe=T.self||T.window||T.global||{},Ue=T.window||T.self||T.global||{},$e=T.global||T.self||T.window||{},ve=T.document||{};var p=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser),De=typeof importScripts=="function",Fr=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),oo=Fr&&parseFloat(Fr[1])||0;var _e=globalThis,no=globalThis.document||{},ke=globalThis.process||{},so=globalThis.console,Bn=globalThis.navigator||{};function Ur(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return Boolean(t&&t.indexOf("Electron")>=0)}function M(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Ur()}var je="4.1.1";function q(e,r){if(!e)throw new Error(r||"Assertion failed")}function ze(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return q(Number.isFinite(r)&&r>=0),r}function $r(e){let{logLevel:r,message:t}=e;e.logLevel=ze(r);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&o.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return q(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}var W=()=>{},Se=class{constructor({level:r=0}={}){this.userData={},this._onceCache=new Set,this._level=r}set level(r){this.setLevel(r)}get level(){return this.getLevel()}setLevel(r){return this._level=r,this}getLevel(){return this._level}warn(r,...t){return this._log("warn",0,r,t,{once:!0})}error(r,...t){return this._log("error",0,r,t)}log(r,t,...o){return this._log("log",r,t,o)}info(r,t,...o){return this._log("info",r,t,o)}once(r,t,...o){return this._log("once",r,t,o,{once:!0})}_log(r,t,o,n,s={}){let i=$r({logLevel:t,message:o,args:this._buildArgs(t,o,n),opts:s});return this._createLogFunction(r,i,s)}_buildArgs(r,t,o){return[r,t,...o]}_createLogFunction(r,t,o){if(!this._shouldLog(t.logLevel))return W;let n=this._getOnceTag(o.tag??t.tag??t.message);if((o.once||t.once)&&n!==void 0){if(this._onceCache.has(n))return W;this._onceCache.add(n)}return this._emit(r,t)}_shouldLog(r){return this.getLevel()>=ze(r)}_getOnceTag(r){if(r!==void 0)try{return typeof r=="string"?r:String(r)}catch{return}}};function ao(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var Be=class{constructor(r,t,o="sessionStorage"){this.storage=ao(o),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function vr(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function Dr(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var Ee;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ee||(Ee={}));var co=10;function jr(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ee[e]||Ee.WHITE)}function zr(e,r,t){return!M&&typeof e=="string"&&(r&&(e=`\x1B[${jr(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${jr(t)+co}m${e}\x1B[49m`)),e}function qr(e,r=["constructor"]){let t=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(t),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(r.find(a=>s===a)||(n[s]=i.bind(e)))}}function V(){let e;if(M()&&_e.performance)e=_e?.performance?.now?.();else if("hrtime"in ke){let r=ke?.hrtime?.();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var G={debug:M()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},qe={enabled:!0,level:0},w=class extends Se{constructor({id:r}={id:""}){super({level:0}),this.VERSION=je,this._startTs=V(),this._deltaTs=V(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new Be(`__probe-${this.id}__`,{[this.id]:qe}),this.timeStamp(`${this.id} started`),qr(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((V()-this._startTs).toPrecision(10))}getDelta(){return Number((V()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._updateConfiguration({enabled:r}),this}setLevel(r){return this._updateConfiguration({level:r}),this}get(r){return this._getConfiguration()[r]}set(r,t){this._updateConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r,...t){return this._log("warn",0,r,t,{method:G.warn,once:!0})}error(r,...t){return this._log("error",0,r,t,{method:G.error})}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t,...o){return this._log("log",r,t,o,{method:G.log,time:!0,once:!0})}log(r,t,...o){return this._log("log",r,t,o,{method:G.debug})}info(r,t,...o){return this._log("info",r,t,o,{method:console.info})}once(r,t,...o){return this._log("once",r,t,o,{method:G.debug||G.info,once:!0})}table(r,t,o){return t?this._log("table",r,t,o&&[o]||[],{method:console.table||W,tag:uo(t)}):W}time(r,t){return this._log("time",r,t,[],{method:console.time?console.time:console.info})}timeEnd(r,t){return this._log("time",r,t,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(r,t){return this._log("time",r,t,[],{method:console.timeStamp||W})}group(r,t,o={collapsed:!1}){let n=(o.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",r,t,[],{method:n})}groupCollapsed(r,t,o={}){return this.group(r,t,Object.assign({},o,{collapsed:!0}))}groupEnd(r){return this._log("groupEnd",r,"",[],{method:console.groupEnd||W})}withGroup(r,t,o){this.group(r,t)();try{o()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&super._shouldLog(r)}_emit(r,t){let o=t.method;q(o),t.total=this.getTotal(),t.delta=this.getDelta(),this._deltaTs=V();let n=fo(this.id,t.message,t);return o.bind(console,n,...t.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(qe),this._storage.config[this.id]}_updateConfiguration(r){let t=this._storage.config[this.id]||{...qe};this._storage.setConfiguration({[this.id]:{...t,...r}})}};w.VERSION=je;function fo(e,r,t){if(typeof r=="string"){let o=t.time?Dr(vr(t.total)):"";r=t.time?`${e}: ${o} ${r}`:`${e}: ${r}`,r=zr(r,t.color,t.background)}return r}function uo(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe={};var ts=new w({id:"@probe.gl/log"});var Ve="4.4.0-alpha.18",lo=Ve[0]>="0"&&Ve[0]<="9"?`v${Ve}`:"";function mo(){let e=new w({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=e,globalThis.loaders.version=lo,globalThis.probe||={},globalThis.probe.loaders=e,e}var Ge=mo();var Vr=e=>typeof e=="boolean",u=e=>typeof e=="function",d=e=>e!==null&&typeof e=="object",H=e=>d(e)&&e.constructor==={}.constructor;var He=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer,N=e=>d(e)&&typeof e.byteLength=="number"&&typeof e.slice=="function",ae=e=>d(e)&&"then"in e&&u(e.then),P=e=>Boolean(e)&&u(e[Symbol.iterator]),Q=e=>Boolean(e)&&u(e[Symbol.asyncIterator]),J=e=>Boolean(e)&&u(e.next),l=e=>typeof Response<"u"&&e instanceof Response||d(e)&&u(e.arrayBuffer)&&u(e.text)&&u(e.json);var h=e=>typeof Blob<"u"&&e instanceof Blob;var Gr=e=>d(e)&&u(e.abort)&&u(e.getWriter),Hr=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||d(e)&&u(e.tee)&&u(e.cancel)&&u(e.getReader),Qr=e=>d(e)&&u(e.end)&&u(e.write)&&Vr(e.writable),Jr=e=>d(e)&&u(e.read)&&u(e.pipe)&&Vr(e.readable),L=e=>Hr(e)||Jr(e),Qe=e=>Gr(e)||Qr(e);function Je(e,r){return Kr(e||{},r)}function Kr(e,r,t=0){if(t>3)return r;let o={...e};for(let[n,s]of Object.entries(r))s&&typeof s=="object"&&!Array.isArray(s)?o[n]=Kr(o[n]||{},r[n],t+1):o[n]=r[n];return o}function Ke(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}var Yr="beta";function po(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.4.0-alpha.18"),globalThis._loadersgl_.version}var ce=po();function m(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var A={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},hs=A.self||A.window||A.global||{},ds=A.window||A.self||A.global||{},ys=A.global||A.self||A.window||{},gs=A.document||{};var y=typeof process!="object"||String(process)!=="[object process]"||process.browser;var Xr=typeof window<"u"&&typeof window.orientation<"u",Zr=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),ws=Zr&&parseFloat(Zr[1])||0;var fe=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(r,t){this.name=r,this.workerThread=t,this.result=new Promise((o,n)=>{this._resolve=o,this._reject=n})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){m(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){m(this.isRunning),this.isRunning=!1,this._reject(r)}};var K=class{terminate(){}};var Ye=new Map;function et(e){m(e.source&&!e.url||!e.source&&e.url);let r=Ye.get(e.source||e.url);return r||(e.url&&(r=ho(e.url),Ye.set(e.url,r)),e.source&&(r=rt(e.source),Ye.set(e.source,r))),m(r),r}function ho(e){if(!e.startsWith("http"))return e;let r=yo(e);return rt(r)}function rt(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function yo(e){return`try {
7
+ "use strict";var __exports__=(()=>{var Ae=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var eo=Object.prototype.hasOwnProperty;var ro=(e,r,t)=>r in e?Ae(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Nr=(e,r)=>{for(var t in r)Ae(e,t,{get:r[t],enumerable:!0})},to=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Xt(r))!eo.call(e,n)&&n!==t&&Ae(e,n,{get:()=>r[n],enumerable:!(o=Zt(r,n))||o.enumerable});return e};var oo=e=>to(Ae({},"__esModule",{value:!0}),e);var Pr=(e,r,t)=>(ro(e,typeof r!="symbol"?r+"":r,t),t);var An={};Nr(An,{FetchError:()=>re,JSONLoader:()=>dr,NullLoader:()=>Jt,NullWorkerLoader:()=>Qt,RequestScheduler:()=>ee,_BrowserFileSystem:()=>Pe,_fetchProgress:()=>Kt,_selectSource:()=>Vt,_unregisterLoaders:()=>_t,assert:()=>V,concatenateArrayBuffersAsync:()=>j,createDataSource:()=>qt,document:()=>ve,encode:()=>vt,encodeInBatches:()=>zt,encodeSync:()=>Cr,encodeTable:()=>Ir,encodeTableAsText:()=>Ut,encodeTableInBatches:()=>Or,encodeText:()=>Dt,encodeTextSync:()=>jt,encodeURLtoURL:()=>Wr,fetchFile:()=>q,forEach:()=>lr,getLoaderOptions:()=>L,getPathPrefix:()=>hr,global:()=>$e,isAsyncIterable:()=>K,isBrowser:()=>p,isIterable:()=>v,isIterator:()=>Y,isPromise:()=>ce,isPureObject:()=>J,isReadableStream:()=>I,isResponse:()=>l,isWorker:()=>De,isWritableStream:()=>Qe,load:()=>Nt,loadInBatches:()=>Ft,makeIterator:()=>se,makeLineIterator:()=>fr,makeNumberedLineIterator:()=>ur,makeStream:()=>Gt,makeTextDecoderIterator:()=>ar,makeTextEncoderIterator:()=>cr,parse:()=>_,parseInBatches:()=>P,parseSync:()=>Mt,readArrayBuffer:()=>ht,registerLoaders:()=>Tt,resolvePath:()=>C,selectLoader:()=>ne,selectLoaderSync:()=>N,self:()=>Fe,setLoaderOptions:()=>Ar,setPathPrefix:()=>pr,window:()=>Ue});function V(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var T={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Fe=T.self||T.window||T.global||{},Ue=T.window||T.self||T.global||{},$e=T.global||T.self||T.window||{},ve=T.document||{};var p=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser),De=typeof importScripts=="function",Fr=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),no=Fr&&parseFloat(Fr[1])||0;var _e=globalThis,so=globalThis.document||{},ke=globalThis.process||{},io=globalThis.console,En=globalThis.navigator||{};function Ur(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return Boolean(t&&t.indexOf("Electron")>=0)}function F(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Ur()}var je="4.1.1";function G(e,r){if(!e)throw new Error(r||"Assertion failed")}function ze(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return G(Number.isFinite(r)&&r>=0),r}function $r(e){let{logLevel:r,message:t}=e;e.logLevel=ze(r);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&o.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return G(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}var U=()=>{},Se=class{constructor({level:r=0}={}){this.userData={},this._onceCache=new Set,this._level=r}set level(r){this.setLevel(r)}get level(){return this.getLevel()}setLevel(r){return this._level=r,this}getLevel(){return this._level}warn(r,...t){return this._log("warn",0,r,t,{once:!0})}error(r,...t){return this._log("error",0,r,t)}log(r,t,...o){return this._log("log",r,t,o)}info(r,t,...o){return this._log("info",r,t,o)}once(r,t,...o){return this._log("once",r,t,o,{once:!0})}_log(r,t,o,n,s={}){let i=$r({logLevel:t,message:o,args:this._buildArgs(t,o,n),opts:s});return this._createLogFunction(r,i,s)}_buildArgs(r,t,o){return[r,t,...o]}_createLogFunction(r,t,o){if(!this._shouldLog(t.logLevel))return U;let n=this._getOnceTag(o.tag??t.tag??t.message);if((o.once||t.once)&&n!==void 0){if(this._onceCache.has(n))return U;this._onceCache.add(n)}return this._emit(r,t)}_shouldLog(r){return this.getLevel()>=ze(r)}_getOnceTag(r){if(r!==void 0)try{return typeof r=="string"?r:String(r)}catch{return}}};function co(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var Be=class{constructor(r,t,o="sessionStorage"){this.storage=co(o),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function vr(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function Dr(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var Ee;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ee||(Ee={}));var fo=10;function jr(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ee[e]||Ee.WHITE)}function zr(e,r,t){return!F&&typeof e=="string"&&(r&&(e=`\x1B[${jr(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${jr(t)+fo}m${e}\x1B[49m`)),e}function qr(e,r=["constructor"]){let t=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(t),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(r.find(a=>s===a)||(n[s]=i.bind(e)))}}function H(){let e;if(F()&&_e.performance)e=_e?.performance?.now?.();else if("hrtime"in ke){let r=ke?.hrtime?.();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var Q={debug:F()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},qe={enabled:!0,level:0},w=class extends Se{constructor({id:r}={id:""}){super({level:0}),this.VERSION=je,this._startTs=H(),this._deltaTs=H(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new Be(`__probe-${this.id}__`,{[this.id]:qe}),this.timeStamp(`${this.id} started`),qr(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((H()-this._startTs).toPrecision(10))}getDelta(){return Number((H()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._updateConfiguration({enabled:r}),this}setLevel(r){return this._updateConfiguration({level:r}),this}get(r){return this._getConfiguration()[r]}set(r,t){this._updateConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r,...t){return this._log("warn",0,r,t,{method:Q.warn,once:!0})}error(r,...t){return this._log("error",0,r,t,{method:Q.error})}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t,...o){return this._log("log",r,t,o,{method:Q.log,time:!0,once:!0})}log(r,t,...o){return this._log("log",r,t,o,{method:Q.debug})}info(r,t,...o){return this._log("info",r,t,o,{method:console.info})}once(r,t,...o){return this._log("once",r,t,o,{method:Q.debug||Q.info,once:!0})}table(r,t,o){return t?this._log("table",r,t,o&&[o]||[],{method:console.table||U,tag:lo(t)}):U}time(r,t){return this._log("time",r,t,[],{method:console.time?console.time:console.info})}timeEnd(r,t){return this._log("time",r,t,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(r,t){return this._log("time",r,t,[],{method:console.timeStamp||U})}group(r,t,o={collapsed:!1}){let n=(o.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",r,t,[],{method:n})}groupCollapsed(r,t,o={}){return this.group(r,t,Object.assign({},o,{collapsed:!0}))}groupEnd(r){return this._log("groupEnd",r,"",[],{method:console.groupEnd||U})}withGroup(r,t,o){this.group(r,t)();try{o()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&super._shouldLog(r)}_emit(r,t){let o=t.method;G(o),t.total=this.getTotal(),t.delta=this.getDelta(),this._deltaTs=H();let n=uo(this.id,t.message,t);return o.bind(console,n,...t.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(qe),this._storage.config[this.id]}_updateConfiguration(r){let t=this._storage.config[this.id]||{...qe};this._storage.setConfiguration({[this.id]:{...t,...r}})}};w.VERSION=je;function uo(e,r,t){if(typeof r=="string"){let o=t.time?Dr(vr(t.total)):"";r=t.time?`${e}: ${o} ${r}`:`${e}: ${r}`,r=zr(r,t.color,t.background)}return r}function lo(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe={};var os=new w({id:"@probe.gl/log"});var Ve="4.4.0-alpha.19",mo=Ve[0]>="0"&&Ve[0]<="9"?`v${Ve}`:"";function po(){let e=new w({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=e,globalThis.loaders.version=mo,globalThis.probe||={},globalThis.probe.loaders=e,e}var Ge=po();var Vr=e=>typeof e=="boolean",u=e=>typeof e=="function",d=e=>e!==null&&typeof e=="object",J=e=>d(e)&&e.constructor==={}.constructor;var He=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer,$=e=>d(e)&&typeof e.byteLength=="number"&&typeof e.slice=="function",ce=e=>d(e)&&"then"in e&&u(e.then),v=e=>Boolean(e)&&u(e[Symbol.iterator]),K=e=>Boolean(e)&&u(e[Symbol.asyncIterator]),Y=e=>Boolean(e)&&u(e.next),l=e=>typeof Response<"u"&&e instanceof Response||d(e)&&u(e.arrayBuffer)&&u(e.text)&&u(e.json);var h=e=>typeof Blob<"u"&&e instanceof Blob;var Gr=e=>d(e)&&u(e.abort)&&u(e.getWriter),Hr=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||d(e)&&u(e.tee)&&u(e.cancel)&&u(e.getReader),Qr=e=>d(e)&&u(e.end)&&u(e.write)&&Vr(e.writable),Jr=e=>d(e)&&u(e.read)&&u(e.pipe)&&Vr(e.readable),I=e=>Hr(e)||Jr(e),Qe=e=>Gr(e)||Qr(e);function Je(e,r){return Kr(e||{},r)}function Kr(e,r,t=0){if(t>3)return r;let o={...e};for(let[n,s]of Object.entries(r))s&&typeof s=="object"&&!Array.isArray(s)?o[n]=Kr(o[n]||{},r[n],t+1):o[n]=r[n];return o}function Ke(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}var Yr="beta";function ho(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.4.0-alpha.19"),globalThis._loadersgl_.version}var fe=ho();function m(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var A={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ds=A.self||A.window||A.global||{},ys=A.window||A.self||A.global||{},gs=A.global||A.self||A.window||{},ws=A.document||{};var y=typeof process!="object"||String(process)!=="[object process]"||process.browser;var Xr=typeof window<"u"&&typeof window.orientation<"u",Zr=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),bs=Zr&&parseFloat(Zr[1])||0;var ue=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(r,t){this.name=r,this.workerThread=t,this.result=new Promise((o,n)=>{this._resolve=o,this._reject=n})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){m(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){m(this.isRunning),this.isRunning=!1,this._reject(r)}};var Z=class{terminate(){}};var Ye=new Map;function et(e){m(e.source&&!e.url||!e.source&&e.url);let r=Ye.get(e.source||e.url);return r||(e.url&&(r=yo(e.url),Ye.set(e.url,r)),e.source&&(r=rt(e.source),Ye.set(e.source,r))),m(r),r}function yo(e){if(!e.startsWith("http"))return e;let r=go(e);return rt(r)}function rt(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function go(e){return`try {
8
8
  importScripts('${e}');
9
9
  } catch (error) {
10
10
  console.error(error);
11
11
  throw error;
12
- }`}function Ze(e,r=!0,t){let o=t||new Set;if(e){if(tt(e))o.add(e);else if(tt(e.buffer))o.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)Ze(e[n],r,o)}}return t===void 0?Array.from(o):[]}function tt(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}function Xe(e){if(e===null)return{};let r=Object.assign({},e);return Object.keys(r).forEach(t=>{typeof e[t]=="object"&&!ArrayBuffer.isView(e[t])&&!(e[t]instanceof Array)?r[t]=Xe(e[t]):typeof r[t]=="function"||r[t]instanceof RegExp?r[t]={}:r[t]=e[t]}),r}var er=()=>{},R=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&y||typeof K<"u"&&!y}constructor(r){let{name:t,source:o,url:n}=r;m(o||n),this.name=t,this.source=o,this.url=n,this.onMessage=er,this.onError=s=>console.log(s),this.worker=y?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=er,this.onError=er,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Ze(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=et({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let o=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`,n=this.url.endsWith(".ts")||this.url.endsWith(".mjs")?"module":"commonjs";r=new K(o,{eval:!1,type:n})}else if(this.source)r=new K(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var ue=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return R.isSupported()}constructor(r){this.source=r.source,this.url=r.url,this.setProps(r)}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(n,s,i)=>n.done(i),o=(n,s)=>n.error(s)){let n=new Promise(s=>(this.jobQueue.push({name:r,onMessage:t,onError:o,onStart:s}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let o=new fe(t.name,r);r.onMessage=n=>t.onMessage(o,n.type,n.payload),r.onError=n=>t.onError(o,n),t.onStart(o);try{await o.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!y||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new R({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Xr?this.maxMobileConcurrency:this.maxConcurrency}};var go={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},F=class{props;workerPools=new Map;static isSupported(){return R.isSupported()}static getWorkerFarm(r={}){return F._workerFarm=F._workerFarm||new F({}),F._workerFarm.setProps(r),F._workerFarm}constructor(r){this.props={...go},this.setProps(r),this.workerPools=new Map}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:o,url:n}=r,s=this.workerPools.get(t);return s||(s=new ue({name:t,source:o,url:n}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},g=F;Pr(g,"_workerFarm");function ot(e){let r=e.version!==ce?` (worker-utils@${ce})`:"";return`${e.name}@${e.version}${r}`}function le(e,r={}){let t=r[e.id]||{},o=y?`${e.id}-worker.js`:`${e.id}-worker-node.js`,n=t.workerUrl;if(!n&&e.id==="compression"&&(n=r.workerUrl),(r._workerType||r?.core?._workerType)==="test"&&(y?n=`modules/${e.module}/dist/${o}`:n=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!n){let i=e.version;i==="latest"&&(i=Yr);let a=i?`@${i}`:"";n=`https://unpkg.com/@loaders.gl/${e.module}${a}/dist/${o}`}return m(n),n}async function rr(e,r,t={},o={}){let n=ot(e),s=g.getWorkerFarm(t),{source:i}=t,a={name:n,source:i};i||(a.url=le(e,t));let c=s.getWorkerPool(a),f=t.jobName||e.name,k=await c.startJob(f,wo.bind(null,o)),E=Xe(t);return k.postMessage("process",{input:r,options:E}),(await k.result).result}async function wo(e,r,t,o){switch(t){case"done":r.done(o);break;case"error":r.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{if(!e.process){r.postMessage("error",{id:n,error:"Worker not set up to process on main thread"});return}let a=await e.process(s,i);r.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";r.postMessage("error",{id:n,error:c})}break;default:console.warn(`process-on-worker: unknown message ${t}`)}}function tr(e,r=ce){m(e,"no worker provided");let t=e.version;return!(!r||!t)}function or(e,r){if(!g.isSupported())return!1;let t=r?._nodeWorkers??r?.core?._nodeWorkers;if(!y&&!t)return!1;let o=r?.worker??r?.core?.worker;return Boolean(e.worker&&o)}async function nr(e,r,t,o,n){let s=e.id,i=le(e,t),c=g.getWorkerFarm(t?.core).getWorkerPool({name:s,url:i});t=JSON.parse(JSON.stringify(t)),o=JSON.parse(JSON.stringify(o||{}));let f=await c.startJob("process-on-worker",bo.bind(null,n));return f.postMessage("process",{input:r,options:t,context:o}),await(await f.result).result}async function bo(e,r,t,o){switch(t){case"done":r.done(o);break;case"error":r.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{let a=await e(s,i);r.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";r.postMessage("error",{id:n,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function sr(e,r){if(!g.isSupported())return!1;let t=r?._nodeWorkers??r?.core?._nodeWorkers,o=r?.worker??r?.core?.worker;return!p&&!t?!1:Boolean(e.worker&&o)}function ir(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let o=new Uint8Array(e),n=new Uint8Array(r);for(let s=0;s<o.length;++s)if(o[s]!==n[s])return!1;return!0}function me(...e){return nt(e)}function nt(e){let r=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=r.reduce((s,i)=>s+i.byteLength,0),o=new Uint8Array(t),n=0;for(let s of r)o.set(s,n),n+=s.byteLength;return o.buffer}async function*ar(e,r={}){let t=new TextDecoder(void 0,r);for await(let o of e)yield typeof o=="string"?o:t.decode(o,{stream:!0})}async function*cr(e){let r=new TextEncoder;for await(let t of e)yield typeof t=="string"?r.encode(t).buffer:t}async function*fr(e){let r="";for await(let t of e){r+=t;let o;for(;(o=r.indexOf(`
13
- `))>=0;){let n=r.slice(0,o+1);r=r.slice(o+1),yield n}}r.length>0&&(yield r)}async function*ur(e){let r=1;for await(let t of e)yield{counter:r,line:t},r++}async function lr(e,r){let t=To(e);for(;;){let{done:o,value:n}=await t.next();if(o){t.return&&t.return();return}if(r(n))return}}async function U(e){let r=[];for await(let t of e)r.push(xo(t));return me(...r)}function xo(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:t,byteLength:o}=e;return st(r,t,o)}return st(e)}function st(e,r=0,t=e.byteLength-r){let o=new Uint8Array(e,r,t),n=new Uint8Array(o.length);return n.set(o),n.buffer}function To(e){if(typeof e[Symbol.asyncIterator]=="function")return e[Symbol.asyncIterator]();if(typeof e[Symbol.iterator]=="function"){let r=e[Symbol.iterator]();return Ao(r)}return e}function Ao(e){return{next(r){return Promise.resolve(e.next(r))},return(r){return typeof e.return=="function"?Promise.resolve(e.return(r)):Promise.resolve({done:!0,value:r})},throw(r){return typeof e.throw=="function"?Promise.resolve(e.throw(r)):Promise.reject(r)}}}function pe(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var $=class{constructor(r,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=r,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=pe(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(pe()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Y=class{constructor(r){this.stats={},this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r,t="count"){return this._getOrCreate({name:r,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let t of Object.values(this.stats))r(t)}getTable(){let r={};return this.forEach(t=>{r[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),r}_initializeStats(r=[]){r.forEach(t=>this._getOrCreate(t))}_getOrCreate(r){let{name:t,type:o}=r,n=this.stats[t];return n||(r instanceof $?n=r:n=new $(t,o),this.stats[t]=n),n}};var _o="Queued Requests",ko="Active Requests",So="Cancelled Requests",Bo="Queued Requests Ever",Eo="Active Requests Ever",Lo={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},Z=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(r={}){this.props={...Lo,...r},this.stats=new Y({id:this.props.id}),this.stats.get(_o),this.stats.get(ko),this.stats.get(So),this.stats.get(Bo),this.stats.get(Eo)}setProps(r){r.throttleRequests!==void 0&&(this.props.throttleRequests=r.throttleRequests),r.maxRequests!==void 0&&(this.props.maxRequests=r.maxRequests),r.debounceTime!==void 0&&(this.props.debounceTime=r.debounceTime)}scheduleRequest(r,t=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(r))return this.requestMap.get(r);let o={handle:r,priority:0,getPriority:t},n=new Promise(s=>(o.resolve=s,o));return this.requestQueue.push(o),this.requestMap.set(r,n),this._issueNewRequests(),n}_issueRequest(r){let{handle:t,resolve:o}=r,n=!1,s=()=>{n||(n=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,o?o({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let r=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(r!==0){this._updateAllRequests();for(let t=0;t<r;++t){let o=this.requestQueue.shift();o&&this._issueRequest(o)}}}_updateAllRequests(){let r=this.requestQueue;for(let t=0;t<r.length;++t){let o=r[t];this._updateRequest(o)||(r.splice(t,1),this.requestMap.delete(o.handle),t--)}r.sort((t,o)=>t.priority-o.priority)}_updateRequest(r){return r.priority=r.getPriority(r.handle),r.priority<0?(r.resolve(null),!1):!0}};var mr="",it={};function pr(e){mr=e}function hr(){return mr}function I(e){for(let r in it)if(e.startsWith(r)){let t=it[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${mr}${e}`),e}var Ro="4.4.0-alpha.18",dr={dataType:null,batchType:null,name:"JSON",id:"json",module:"json",version:Ro,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:at,parse:async e=>at(new TextDecoder().decode(e)),options:{}};function at(e){return JSON.parse(e)}function Re(e){return e&&typeof e=="object"&&e.isBuffer}function O(e){if(Re(e))return e;if(e instanceof ArrayBuffer)return e;if(He(e))return Le(e);if(ArrayBuffer.isView(e)){let r=e.buffer;return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function S(e){if(e instanceof ArrayBuffer)return e;if(He(e))return Le(e);let{buffer:r,byteOffset:t,byteLength:o}=e;return r instanceof ArrayBuffer&&t===0&&o===r.byteLength?r:Le(r,t,o)}function Le(e,r=0,t=e.byteLength-r){let o=new Uint8Array(e,r,t),n=new Uint8Array(o.length);return n.set(o),n.buffer}function yr(e){return ArrayBuffer.isView(e)?e:new Uint8Array(e)}var v={};Nr(v,{dirname:()=>Oo,filename:()=>Io,join:()=>Co,resolve:()=>Mo});function ct(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function Io(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):e}function Oo(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function Co(...e){let r="/";return e=e.map((t,o)=>(o&&(t=t.replace(new RegExp(`^${r}`),"")),o!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function Mo(...e){let r=[];for(let s=0;s<e.length;s++)r[s]=e[s];let t="",o=!1,n;for(let s=r.length-1;s>=-1&&!o;s--){let i;s>=0?i=r[s]:(n===void 0&&(n=ct()),i=n),i.length!==0&&(t=`${i}/${t}`,o=i.charCodeAt(0)===he)}return t=Wo(t,!o),o?`/${t}`:t.length>0?t:"."}var he=47,gr=46;function Wo(e,r){let t="",o=-1,n=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===he)break;s=he}if(s===he){if(!(o===a-1||n===1))if(o!==a-1&&n===2){if(t.length<2||!i||t.charCodeAt(t.length-1)!==gr||t.charCodeAt(t.length-2)!==gr){if(t.length>2){let c=t.length-1,f=c;for(;f>=0&&t.charCodeAt(f)!==he;--f);if(f!==c){t=f===-1?"":t.slice(0,f),o=a,n=0,i=!1;continue}}else if(t.length===2||t.length===1){t="",o=a,n=0,i=!1;continue}}r&&(t.length>0?t+="/..":t="..",i=!0)}else{let c=e.slice(o+1,a);t.length>0?t+=`/${c}`:t=c,i=!1}o=a,n=0}else s===gr&&n!==-1?++n:n=-1}return t}var de=class{handle;size;bigsize;url;constructor(r){this.handle=r instanceof ArrayBuffer?new Blob([r]):r,this.size=r instanceof ArrayBuffer?r.byteLength:r.size,this.bigsize=BigInt(this.size),this.url=r instanceof File?r.name:""}async close(){}async stat(){return{size:this.handle.size,bigsize:BigInt(this.handle.size),isDirectory:!1}}async read(r,t){return await this.handle.slice(Number(r),Number(r)+Number(t)).arrayBuffer()}};var ye=new Error("Not implemented"),ge=class{handle;size=0;bigsize=0n;url="";constructor(r,t,o){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(r,t,o);throw p?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(r,t){throw ye}async write(r,t,o){throw ye}async stat(){throw ye}async truncate(r){throw ye}async append(r){throw ye}async close(){}};var X=class extends Error{constructor(r,t){super(r),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var No=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Po=/^([-\w.]+\/[-\w.+]+)/;function wr(e,r){return e.toLowerCase()===r.toLowerCase()}function ft(e){let r=Po.exec(e);return r?r[1]:e}function br(e){let r=No.exec(e);return r?r[1]:""}var ut=/\?.*/;function lt(e){let r=e.match(ut);return r&&r[0]}function ee(e){return e.replace(ut,"")}function mt(e){if(e.length<50)return e;let r=e.slice(e.length-15);return`${e.substr(0,32)}...${r}`}function b(e){return l(e)?e.url:h(e)?("name"in e?e.name:"")||"":typeof e=="string"?e:""}function we(e){if(l(e)){let r=e.headers.get("content-type")||"",t=ee(e.url);return ft(r)||br(t)}return h(e)?e.type||"":typeof e=="string"?br(e):""}function pt(e){return l(e)?e.headers["content-length"]||-1:h(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Ie(e){if(l(e))return e;let r={},t=pt(e);t>=0&&(r["content-length"]=String(t));let o=b(e),n=we(e);n&&(r["content-type"]=n);let s=await Uo(e);s&&(r["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));let i=new Response(e,{headers:r});return Object.defineProperty(i,"url",{value:o}),i}async function xr(e){if(!e.ok)throw await Fo(e)}async function Fo(e){let r=mt(e.url),t=`Failed to fetch resource (${e.status}) ${e.statusText}: ${r}`;t=t.length>100?`${t.slice(0,100)}...`:t;let o={reason:e.statusText,url:e.url,response:e};try{let n=e.headers.get("Content-Type");o.reason=!e.bodyUsed&&n?.includes("application/json")?await e.json():await e.text()}catch{}return new X(t,o)}async function Uo(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(o=>{let n=new FileReader;n.onload=s=>o(s?.target?.result),n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${$o(t)}`}return null}function $o(e){let r="",t=new Uint8Array(e);for(let o=0;o<t.byteLength;o++)r+=String.fromCharCode(t[o]);return btoa(r)}function vo(e){return!Do(e)&&!jo(e)}function Do(e){return e.startsWith("http:")||e.startsWith("https:")}function jo(e){return e.startsWith("data:")}async function D(e,r){if(typeof e=="string"){let t=I(e);return vo(t)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(t,r):await fetch(t,r)}return await Ie(e)}async function ht(e,r,t){e instanceof Blob||(e=new Blob([e]));let o=e.slice(r,r+t);return await zo(o)}async function zo(e){return await new Promise((r,t)=>{let o=new FileReader;o.onload=n=>r(n?.target?.result),o.onerror=n=>t(n),o.readAsArrayBuffer(e)})}var be=new w({id:"loaders.gl"}),Oe=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Ce=class{console;constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var Me={core:{baseUri:void 0,fetch:null,mimeType:void 0,fallbackMimeType:void 0,ignoreRegisteredLoaders:void 0,nothrow:!1,log:new Ce,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:p,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}},dt={baseUri:"core.baseUri",fetch:"core.fetch",mimeType:"core.mimeType",fallbackMimeType:"core.fallbackMimeType",ignoreRegisteredLoaders:"core.ignoreRegisteredLoaders",nothrow:"core.nothrow",log:"core.log",useLocalLibraries:"core.useLocalLibraries",CDN:"core.CDN",worker:"core.worker",maxConcurrency:"core.maxConcurrency",maxMobileConcurrency:"core.maxMobileConcurrency",reuseWorkers:"core.reuseWorkers",_nodeWorkers:"core.nodeWorkers",_workerType:"core._workerType",_worker:"core._workerType",limit:"core.limit",_limitMB:"core._limitMB",batchSize:"core.batchSize",batchDebounceMs:"core.batchDebounceMs",metadata:"core.metadata",transforms:"core.transforms",throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"core.fetch.method",headers:"core.fetch.headers",body:"core.fetch.body",mode:"core.fetch.mode",credentials:"core.fetch.credentials",cache:"core.fetch.cache",redirect:"core.fetch.redirect",referrer:"core.fetch.referrer",referrerPolicy:"core.fetch.referrerPolicy",integrity:"core.fetch.integrity",keepalive:"core.fetch.keepalive",signal:"core.fetch.signal"};var Tr=["baseUri","fetch","mimeType","fallbackMimeType","ignoreRegisteredLoaders","nothrow","log","useLocalLibraries","CDN","worker","maxConcurrency","maxMobileConcurrency","reuseWorkers","_nodeWorkers","_workerType","limit","_limitMB","batchSize","batchDebounceMs","metadata","transforms"];function xe(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function B(){let e=xe();return e.globalOptions=e.globalOptions||{...Me,core:{...Me.core}},j(e.globalOptions)}function Ar(e){let r=xe(),t=B();r.globalOptions=wt(t,e),Ke(e.modules)}function re(e,r,t,o){return t=t||[],t=Array.isArray(t)?t:[t],qo(e,t),j(wt(r,e,o))}function j(e){let r=Ho(e);bt(r);for(let t of Tr)r.core&&r.core[t]!==void 0&&delete r[t];return r.core&&r.core._workerType!==void 0&&delete r._worker,r}function qo(e,r){yt(e,null,Me,dt,r);for(let t of r){let o=e&&e[t.id]||{},n=t.options&&t.options[t.id]||{},s=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};yt(o,t.id,n,s,r)}}function yt(e,r,t,o,n){let s=r||"Top level",i=r?`${r}.`:"";for(let a in e){let c=!r&&d(e[a]),f=a==="baseUri"&&!r,k=a==="workerUrl"&&r;if(!(a in t)&&!f&&!k){if(a in o)be.level>0&&be.warn(`${s} loader option '${i}${a}' no longer supported, use '${o[a]}'`)();else if(!c&&be.level>0){let E=Vo(a,n);be.warn(`${s} loader option '${i}${a}' not recognized. ${E}`)()}}}}function Vo(e,r){let t=e.toLowerCase(),o="";for(let n of r)for(let s in n.options){if(e===s)return`Did you mean '${n.id}.${s}'?`;let i=s.toLowerCase();(t.startsWith(i)||i.startsWith(t))&&(o=o||`Did you mean '${n.id}.${s}'?`)}return o}function wt(e,r,t){let o=e.options||{},n={...o};o.core&&(n.core={...o.core}),bt(n),n.core?.log===null&&(n.core={...n.core,log:new Oe}),gt(n,j(B()));let s=j(r);return gt(n,s),Go(n,t),Qo(n),n}function gt(e,r){for(let t in r)if(t in r){let o=r[t];H(o)&&H(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function Go(e,r){if(!r)return;let t=e.baseUri!==void 0,o=e.core?.baseUri!==void 0;!t&&!o&&(e.core||={},e.core.baseUri=r)}function Ho(e){let r={...e};return e.core&&(r.core={...e.core}),r}function bt(e){for(let t of Tr)if(e[t]!==void 0){let n=e.core=e.core||{};n[t]===void 0&&(n[t]=e[t])}let r=e._worker;r!==void 0&&(e.core||={},e.core._workerType===void 0&&(e.core._workerType=r))}function Qo(e){let r=e.core;if(r)for(let t of Tr)r[t]!==void 0&&(e[t]=r[t])}function x(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function Te(e){z(e,"null loader"),z(x(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var xt=()=>{let e=xe();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Tt(e){let r=xt();e=Array.isArray(e)?e:[e];for(let t of e){let o=Te(t);r.find(n=>o===n)||r.unshift(o)}}function At(){return xt()}function _t(){let e=xe();e.loaderRegistry=[]}var Jo=/\.([^.]+)$/;async function oe(e,r=[],t,o){if(!St(e))return null;let n=j(t||{});n.core||={};let s=te(e,r,{...n,core:{...n.core,nothrow:!0}},o);if(s)return s;if(h(e)&&(e=await e.slice(0,10).arrayBuffer(),s=te(e,r,n,o)),!s&&!n.core.nothrow)throw new Error(Bt(e));return s}function te(e,r=[],t,o){if(!St(e))return null;let n=j(t||{});if(n.core||={},r&&!Array.isArray(r))return Te(r);let s=[];r&&(s=s.concat(r)),n.core.ignoreRegisteredLoaders||s.push(...At()),Yo(s);let i=Ko(e,s,n,o);if(!i&&!n.core.nothrow)throw new Error(Bt(e));return i}function Ko(e,r,t,o){let n=b(e),s=we(e),i=ee(n)||o?.url,a=null,c="";return t?.core?.mimeType&&(a=_r(r,t?.core?.mimeType),c=`match forced by supplied MIME type ${t?.core?.mimeType}`),a=a||Zo(r,i),c=c||(a?`matched url ${i}`:""),a=a||_r(r,s),c=c||(a?`matched MIME type ${s}`:""),a=a||en(r,e),c=c||(a?`matched initial data ${Et(e)}`:""),t?.core?.fallbackMimeType&&(a=a||_r(r,t?.core?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${s}`:"")),c&&Ge.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function St(e){return!(e instanceof Response&&e.status===204)}function Bt(e){let r=b(e),t=we(e),o="No valid loader found (";o+=r?`${v.filename(r)}, `:"no url provided, ",o+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let n=e?Et(e):"";return o+=n?` first bytes: "${n}"`:"first bytes: not available",o+=")",o}function Yo(e){for(let r of e)Te(r)}function Zo(e,r){let t=r&&Jo.exec(r),o=t&&t[1];return o?Xo(e,o):null}function Xo(e,r){r=r.toLowerCase();for(let t of e)for(let o of t.extensions)if(o.toLowerCase()===r)return t;return null}function _r(e,r){for(let t of e)if(t.mimeTypes?.some(o=>wr(r,o))||wr(r,`application/x.${t.id}`))return t;return null}function en(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(rn(r,t))return t}else if(ArrayBuffer.isView(r)){if(kt(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&kt(r,0,t))return t;return null}function rn(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(o=>e.startsWith(o))}function kt(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>tn(e,r,t,n))}function tn(e,r,t,o){if(N(o))return ir(o,e,o.byteLength);switch(typeof o){case"function":return o(S(e));case"string":let n=kr(e,r,o.length);return o===n;default:return!1}}function Et(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?kr(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?kr(e,0,r):""}function kr(e,r,t){if(e.byteLength<r+t)return"";let o=new DataView(e),n="";for(let s=0;s<t;s++)n+=String.fromCharCode(o.getUint8(r+s));return n}var on=256*1024;function*Lt(e,r){let t=r?.chunkSize||on,o=0,n=new TextEncoder;for(;o<e.length;){let s=Math.min(e.length-o,t),i=e.slice(o,o+s);o+=s,yield S(n.encode(i))}}function*Rt(e,r={}){let{chunkSize:t=262144}=r,o=0;for(;o<e.byteLength;){let n=Math.min(e.byteLength-o,t),s=new ArrayBuffer(n),i=new Uint8Array(e,o,n);new Uint8Array(s).set(i),o+=n,yield s}}async function*It(e,r){let t=r?.chunkSize||1048576,o=0;for(;o<e.size;){let n=o+t,s=await e.slice(o,n).arrayBuffer();o=n,yield s}}function Sr(e,r){return p?nn(e,r):sn(e,r)}async function*nn(e,r){let t=e.getReader(),o;try{for(;;){let n=o||t.read();r?._streamReadAhead&&(o=t.read());let{done:s,value:i}=await n;if(s)return;yield O(i)}}catch{t.releaseLock()}}async function*sn(e,r){for await(let t of e)yield O(t)}function ne(e,r){if(typeof e=="string")return Lt(e,r);if(e instanceof ArrayBuffer)return Rt(e,r);if(h(e))return It(e,r);if(L(e))return Sr(e,r);if(l(e)){let t=e.body;if(!t)throw new Error("Readable stream not available on Response");return Sr(t,r)}throw new Error("makeIterator")}var We="Cannot convert supplied data type";function Br(e,r,t){if(r.text&&typeof e=="string")return e;if(Re(e)&&(e=e.buffer),N(e)){let o=yr(e);return r.text&&!r.binary?new TextDecoder("utf8").decode(o):O(o)}throw new Error(We)}async function Ot(e,r,t){if(typeof e=="string"||N(e))return Br(e,r,t);if(h(e)&&(e=await Ie(e)),l(e))return await xr(e),r.binary?await e.arrayBuffer():await e.text();if(L(e)&&(e=ne(e,t)),P(e)||Q(e))return U(e);throw new Error(We)}async function Ct(e,r){if(ae(e)&&(e=await e),J(e))return e;if(l(e)){await xr(e);let t=await e.body;if(!t)throw new Error(We);return ne(t,r)}return h(e)||L(e)?ne(e,r):Q(e)||P(e)?e:an(e)}function an(e){if(ArrayBuffer.isView(e))return function*(){yield O(e)}();if(N(e))return function*(){yield O(e)}();if(J(e))return e;if(P(e))return e[Symbol.iterator]();throw new Error(We)}function se(e,r){let t=B(),o=e||t,n=o.fetch??o.core?.fetch;return typeof n=="function"?n:d(n)?s=>D(s,n):r?.fetch?r?.fetch:D}function ie(e,r,t){if(t)return t;let o={fetch:se(r,e),...e};if(o.url){let n=ee(o.url);o.baseUrl=n,o.queryString=lt(o.url),o.filename=v.filename(n),o.baseUrl=v.dirname(n)}return Array.isArray(o.loaders)||(o.loaders=null),o}function Ne(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let o=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...o]:o}return t&&t.length?t:void 0}async function _(e,r,t,o){r&&!Array.isArray(r)&&!x(r)&&(o=void 0,t=r,r=void 0),e=await e,t=t||{};let n=b(e),i=Ne(r,o),a=await oe(e,i,t);if(!a)return null;let c=re(t,a,i,n);return o=ie({url:n,_parse:_,loaders:i},c,o||null),await cn(a,e,c,o)}async function cn(e,r,t,o){if(tr(e),t=Je(e.options,t),l(r)){let{ok:s,redirected:i,status:a,statusText:c,type:f,url:k}=r,E=Object.fromEntries(r.headers.entries());o.response={headers:E,ok:s,redirected:i,status:a,statusText:c,type:f,url:k}}r=await Ot(r,e,t);let n=e;if(n.parseTextSync&&typeof r=="string")return n.parseTextSync(r,t,o);if(or(e,t))return await nr(e,r,t,o,_);if(n.parseText&&typeof r=="string")return await n.parseText(r,t,o);if(n.parse)return await n.parse(r,t,o);throw m(!n.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Mt(e,r,t,o){!Array.isArray(r)&&!x(r)&&(o=void 0,t=r,r=void 0),t=t||{};let s=Ne(r,o),i=te(e,s,t);if(!i)return null;let a=re(t,i,s),c=b(e),f=()=>{throw new Error("parseSync called parse (which is async")};return o=ie({url:c,_parseSync:f,_parse:f,loaders:r},a,o||null),fn(i,e,a,o)}function fn(e,r,t,o){if(r=Br(r,e,t),e.parseTextSync&&typeof r=="string")return e.parseTextSync(r,t);if(e.parseSync&&r instanceof ArrayBuffer)return e.parseSync(r,t,o);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${o.url||""}`)}function Er(e){switch(typeof e=="object"&&e?.shape){case"array-row-table":case"object-row-table":return Array.isArray(e.data);case"geojson-table":return Array.isArray(e.features);case"columnar-table":return e.data&&typeof e.data=="object";case"arrow-table":return Boolean(e?.data?.numRows!==void 0);default:return!1}}function Lr(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.data.length;case"geojson-table":return e.features.length;case"arrow-table":return e.data.numRows;case"columnar-table":for(let t of Object.values(e.data))return t.length||0;return 0;default:throw new Error("table")}}function Rr(e){return{...e,length:Lr(e),batchType:"data"}}async function C(e,r,t,o){let n=Array.isArray(r)?r:void 0;!Array.isArray(r)&&!x(r)&&(o=void 0,t=r,r=void 0),e=await e,t=t||{};let s=b(e),i=await oe(e,r,t);if(!i)return[];let a=re(t,i,n,s);return o=ie({url:s,_parseInBatches:C,_parse:_,loaders:n},a,o||null),await un(i,e,a,o)}async function un(e,r,t,o){let n=await ln(e,r,t,o);if(!t?.core?.metadata)return n;let s={shape:"metadata",batchType:"metadata",metadata:{_loader:e,_context:o},data:[],bytesUsed:0};async function*i(a){yield s,yield*a}return i(n)}async function ln(e,r,t,o){let n=await Ct(r,t),s=await hn(n,t?.core?.transforms||[]);return e.parseInBatches?e.parseInBatches(s,t,o):mn(s,e,t,o)}async function*mn(e,r,t,o){let n=await U(e),s=await _(n,r,{...t,core:{...t?.core,mimeType:r.mimeTypes[0]}},o);yield pn(s,r)}function pn(e,r){let t=Er(e)?Rr(e):{shape:"unknown",batchType:"data",data:e,length:Array.isArray(e)?e.length:1};return t.mimeType=r.mimeTypes[0],t}async function hn(e,r=[]){let t=e;for await(let o of r)t=o(t);return t}async function Wt(e,r,t,o){let n,s;!Array.isArray(r)&&!x(r)?(n=[],s=r,o=void 0):(n=r,s=t);let i=se(s),a=e;return typeof e=="string"&&(a=await i(e)),h(e)&&(a=await i(e)),Array.isArray(n)?await _(a,n,s):await _(a,n,s)}function Pt(e,r,t,o){let n;!Array.isArray(r)&&!x(r)?(o=void 0,t=r,n=void 0):n=r;let s=se(t||{});return Array.isArray(e)?e.map(a=>Nt(a,n,t||{},s)):Nt(e,n,t||{},s)}async function Nt(e,r,t,o){if(typeof e=="string"){let s=await o(e);return Array.isArray(r)?await C(s,r,t):await C(s,r,t)}return Array.isArray(r)?await C(e,r,t):await C(e,r,t)}async function Ir(e,r,t){if(r.encode)return await r.encode(e,t);if(r.encodeText){let o=await r.encodeText(e,t);return S(new TextEncoder().encode(o))}if(r.encodeInBatches){let o=Or(e,r,t),n=[];for await(let s of o)n.push(s);return me(...n)}throw new Error("Writer could not encode data")}async function Ft(e,r,t){if(r.text&&r.encodeText)return await r.encodeText(e,t);if(r.text){let o=await Ir(e,r,t);return new TextDecoder().decode(o)}throw new Error(`Writer ${r.name} could not encode data as text`)}function Or(e,r,t){if(r.encodeInBatches){let o=dn(e);return r.encodeInBatches(o,t)}throw new Error("Writer could not encode data in batches")}function dn(e){return[{...e,start:0,end:e.length}]}async function $t(e,r,t){let n={...B(),...t};return r.encodeURLtoURL?yn(r,e,n):sr(r,n)?await rr(r,e,n):await r.encode(e,n)}function Cr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);if(r.encodeTextSync)return S(new TextEncoder().encode(r.encodeTextSync(e,t)));throw new Error(`Writer ${r.name} could not synchronously encode data`)}async function vt(e,r,t){if(r.encodeText)return await r.encodeText(e,t);if(r.encodeTextSync)return r.encodeTextSync(e,t);if(r.text){let o=await r.encode(e,t);return new TextDecoder().decode(o)}throw new Error(`Writer ${r.name} could not encode data as text`)}function Dt(e,r,t){if(r.encodeTextSync)return r.encodeTextSync(e,t);if(r.text&&r.encodeSync){let o=Cr(e,r,t);return new TextDecoder().decode(o)}throw new Error(`Writer ${r.name} could not encode data as text`)}function jt(e,r,t){if(r.encodeInBatches){let o=gn(e);return r.encodeInBatches(o,t)}throw new Error(`Writer ${r.name} could not encode in batches`)}async function Mr(e,r,t,o){if(e=I(e),r=I(r),p||!t.encodeURLtoURL)throw new Error;return await t.encodeURLtoURL(e,r,o)}async function yn(e,r,t){if(p)throw new Error(`Writer ${e.name} not supported in browser`);let o=Ut("input");await new ge(o,"w").write(r);let s=Ut("output"),i=await Mr(o,s,e,t);return(await D(i)).arrayBuffer()}function gn(e){return[{...e,start:0,end:e.length}]}function Ut(e){return`/tmp/${e}`}function zt(e,r,t){let o=t?.core?.type||t.type||"auto",n=o==="auto"?wn(e,r):bn(o,r);if(!n)throw new Error("Not a valid source type");return n.createDataSource(e,t)}function wn(e,r){for(let t of r)if(t.testURL&&t.testURL(e))return t;return null}function bn(e,r){for(let t of r)if(t.type===e)return t;return null}function qt(e,r,t){let o=t?.type||"auto",n=null;if(o==="auto"){for(let s of r)if(typeof e=="string"&&s.testURL&&s.testURL(e))return s}else n=xn(o,r);if(!n&&!t?.nothrow)throw new Error("Not a valid image source type");return n}function xn(e,r){for(let t of r)if(t.type===e)return t;return null}function Vt(e,r){if(globalThis.loaders.makeNodeStream)return globalThis.loaders.makeNodeStream(e,r);let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(o){try{let{done:n,value:s}=await t.next();n?o.close():o.enqueue(new Uint8Array(s))}catch(n){o.error(n)}},async cancel(){await t?.return?.()}},{highWaterMark:2**24,...r})}var Gt="4.4.0-alpha.18",Ht={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Gt,worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Qt={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Gt,mimeTypes:["application/x.empty"],extensions:["null"],parse:async(e,r,t)=>Wr(e,r||{},t),parseSync:Wr,parseInBatches:async function*(r,t,o){for await(let n of r)yield Wr(n,t,o)},tests:[()=>!1],options:{null:{}}};function Wr(e,r,t){return null}async function Jt(e,r,t=()=>{},o=()=>{}){if(e=await e,!e.ok)return e;let n=e.body;if(!n)return e;let s=e.headers.get("content-length")||0,i=s?parseInt(s):0;if(!(i>0)||typeof ReadableStream>"u"||!n.getReader)return e;let a=new ReadableStream({async start(c){let f=n.getReader();await Kt(c,f,0,i,r,t,o)}});return new Response(a)}async function Kt(e,r,t,o,n,s,i){try{let{done:a,value:c}=await r.read();if(a){s(),e.close();return}t+=c.byteLength;let f=Math.round(t/o*100);n(f,{loadedBytes:t,totalBytes:o}),e.enqueue(c),await Kt(e,r,t,o,n,s,i)}catch(a){e.error(a),i(a)}}var Pe=class{_fetch;files={};lowerCaseFiles={};usedFiles={};constructor(r,t){this._fetch=t?.fetch||fetch;for(let o=0;o<r.length;++o){let n=r[o];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(r,t){if(r.includes("://"))return this._fetch(r,t);let o=this.files[r];if(!o)return new Response(r,{status:400,statusText:"NOT FOUND"});let s=new Headers(t?.headers).get("Range"),i=s&&/bytes=($1)-($2)/.exec(s);if(i){let c=parseInt(i[1]),f=parseInt(i[2]),k=await o.slice(c,f).arrayBuffer(),E=new Response(k);return Object.defineProperty(E,"url",{value:r}),E}let a=new Response(o);return Object.defineProperty(a,"url",{value:r}),a}async readdir(r){let t=[];for(let o in this.files)t.push(o);return t}async stat(r,t){let o=this.files[r];if(!o)throw new Error(r);return{size:o.size}}async unlink(r){delete this.files[r],delete this.lowerCaseFiles[r],this.usedFiles[r]=!0}async openReadableFile(r,t){return new de(this.files[r])}_getFile(r,t){let o=this.files[r]||this.lowerCaseFiles[r];return o&&t&&(this.usedFiles[r]=!0),o}};return to(Tn);})();
12
+ }`}function Ze(e,r=!0,t){let o=t||new Set;if(e){if(tt(e))o.add(e);else if(tt(e.buffer))o.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)Ze(e[n],r,o)}}return t===void 0?Array.from(o):[]}function tt(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}function Xe(e){if(e===null)return{};let r=Object.assign({},e);return Object.keys(r).forEach(t=>{typeof e[t]=="object"&&!ArrayBuffer.isView(e[t])&&!(e[t]instanceof Array)?r[t]=Xe(e[t]):typeof r[t]=="function"||r[t]instanceof RegExp?r[t]={}:r[t]=e[t]}),r}var er=()=>{},O=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&y||typeof Z<"u"&&!y}constructor(r){let{name:t,source:o,url:n}=r;m(o||n),this.name=t,this.source=o,this.url=n,this.onMessage=er,this.onError=s=>console.log(s),this.worker=y?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=er,this.onError=er,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Ze(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=et({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let o=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`,n=this.url.endsWith(".ts")||this.url.endsWith(".mjs")?"module":"commonjs";r=new Z(o,{eval:!1,type:n})}else if(this.source)r=new Z(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var le=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return O.isSupported()}constructor(r){this.source=r.source,this.url=r.url,this.setProps(r)}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(n,s,i)=>n.done(i),o=(n,s)=>n.error(s)){let n=new Promise(s=>(this.jobQueue.push({name:r,onMessage:t,onError:o,onStart:s}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let o=new ue(t.name,r);r.onMessage=n=>t.onMessage(o,n.type,n.payload),r.onError=n=>t.onError(o,n),t.onStart(o);try{await o.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!y||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new O({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Xr?this.maxMobileConcurrency:this.maxConcurrency}};var wo={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},D=class{props;workerPools=new Map;static isSupported(){return O.isSupported()}static getWorkerFarm(r={}){return D._workerFarm=D._workerFarm||new D({}),D._workerFarm.setProps(r),D._workerFarm}constructor(r){this.props={...wo},this.setProps(r),this.workerPools=new Map}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:o,url:n}=r,s=this.workerPools.get(t);return s||(s=new le({name:t,source:o,url:n}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},g=D;Pr(g,"_workerFarm");function ot(e){let r=e.version!==fe?` (worker-utils@${fe})`:"";return`${e.name}@${e.version}${r}`}function me(e,r={}){let t=r[e.id]||{},o=y?`${e.id}-worker.js`:`${e.id}-worker-node.js`,n=t.workerUrl;if(!n&&e.id==="compression"&&(n=r.workerUrl),(r._workerType||r?.core?._workerType)==="test"&&(y?n=`modules/${e.module}/dist/${o}`:n=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!n){let i=e.version;i==="latest"&&(i=Yr);let a=i?`@${i}`:"";n=`https://unpkg.com/@loaders.gl/${e.module}${a}/dist/${o}`}return m(n),n}async function rr(e,r,t={},o={}){let n=ot(e),s=g.getWorkerFarm(t),{source:i}=t,a={name:n,source:i};i||(a.url=me(e,t));let c=s.getWorkerPool(a),f=t.jobName||e.name,k=await c.startJob(f,bo.bind(null,o)),R=Xe(t);return k.postMessage("process",{input:r,options:R}),(await k.result).result}async function bo(e,r,t,o){switch(t){case"done":r.done(o);break;case"error":r.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{if(!e.process){r.postMessage("error",{id:n,error:"Worker not set up to process on main thread"});return}let a=await e.process(s,i);r.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";r.postMessage("error",{id:n,error:c})}break;default:console.warn(`process-on-worker: unknown message ${t}`)}}function tr(e,r=fe){m(e,"no worker provided");let t=e.version;return!(!r||!t)}function or(e,r){if(!g.isSupported())return!1;let t=r?._nodeWorkers??r?.core?._nodeWorkers;if(!y&&!t)return!1;let o=r?.worker??r?.core?.worker;return Boolean(e.worker&&o)}async function nr(e,r,t,o,n){let s=e.id,i=me(e,t),c=g.getWorkerFarm(t?.core).getWorkerPool({name:s,url:i});t=JSON.parse(JSON.stringify(t)),o=JSON.parse(JSON.stringify(o||{}));let f=await c.startJob("process-on-worker",xo.bind(null,n));return f.postMessage("process",{input:r,options:t,context:o}),await(await f.result).result}async function xo(e,r,t,o){switch(t){case"done":r.done(o);break;case"error":r.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{let a=await e(s,i);r.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";r.postMessage("error",{id:n,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function sr(e,r){if(!g.isSupported())return!1;let t=r?._nodeWorkers??r?.core?._nodeWorkers,o=r?.worker??r?.core?.worker;return!p&&!t?!1:Boolean(e.worker&&o)}function ir(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let o=new Uint8Array(e),n=new Uint8Array(r);for(let s=0;s<o.length;++s)if(o[s]!==n[s])return!1;return!0}function pe(...e){return nt(e)}function nt(e){let r=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=r.reduce((s,i)=>s+i.byteLength,0),o=new Uint8Array(t),n=0;for(let s of r)o.set(s,n),n+=s.byteLength;return o.buffer}async function*ar(e,r={}){let t=new TextDecoder(void 0,r);for await(let o of e)yield typeof o=="string"?o:t.decode(o,{stream:!0})}async function*cr(e){let r=new TextEncoder;for await(let t of e)yield typeof t=="string"?r.encode(t).buffer:t}async function*fr(e){let r="";for await(let t of e){r+=t;let o;for(;(o=r.indexOf(`
13
+ `))>=0;){let n=r.slice(0,o+1);r=r.slice(o+1),yield n}}r.length>0&&(yield r)}async function*ur(e){let r=1;for await(let t of e)yield{counter:r,line:t},r++}async function lr(e,r){let t=Ao(e);for(;;){let{done:o,value:n}=await t.next();if(o){t.return&&t.return();return}if(r(n))return}}async function j(e){let r=[];for await(let t of e)r.push(To(t));return pe(...r)}function To(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:t,byteLength:o}=e;return st(r,t,o)}return st(e)}function st(e,r=0,t=e.byteLength-r){let o=new Uint8Array(e,r,t),n=new Uint8Array(o.length);return n.set(o),n.buffer}function Ao(e){if(typeof e[Symbol.asyncIterator]=="function")return e[Symbol.asyncIterator]();if(typeof e[Symbol.iterator]=="function"){let r=e[Symbol.iterator]();return _o(r)}return e}function _o(e){return{next(r){return Promise.resolve(e.next(r))},return(r){return typeof e.return=="function"?Promise.resolve(e.return(r)):Promise.resolve({done:!0,value:r})},throw(r){return typeof e.throw=="function"?Promise.resolve(e.throw(r)):Promise.reject(r)}}}function he(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var z=class{constructor(r,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=r,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=he(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(he()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var X=class{constructor(r){this.stats={},this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r,t="count"){return this._getOrCreate({name:r,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let t of Object.values(this.stats))r(t)}getTable(){let r={};return this.forEach(t=>{r[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),r}_initializeStats(r=[]){r.forEach(t=>this._getOrCreate(t))}_getOrCreate(r){let{name:t,type:o}=r,n=this.stats[t];return n||(r instanceof z?n=r:n=new z(t,o),this.stats[t]=n),n}};var ko="Queued Requests",So="Active Requests",Bo="Cancelled Requests",Eo="Queued Requests Ever",Lo="Active Requests Ever",Ro={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},ee=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(r={}){this.props={...Ro,...r},this.stats=new X({id:this.props.id}),this.stats.get(ko),this.stats.get(So),this.stats.get(Bo),this.stats.get(Eo),this.stats.get(Lo)}setProps(r){r.throttleRequests!==void 0&&(this.props.throttleRequests=r.throttleRequests),r.maxRequests!==void 0&&(this.props.maxRequests=r.maxRequests),r.debounceTime!==void 0&&(this.props.debounceTime=r.debounceTime)}scheduleRequest(r,t=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(r))return this.requestMap.get(r);let o={handle:r,priority:0,getPriority:t},n=new Promise(s=>(o.resolve=s,o));return this.requestQueue.push(o),this.requestMap.set(r,n),this._issueNewRequests(),n}_issueRequest(r){let{handle:t,resolve:o}=r,n=!1,s=()=>{n||(n=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,o?o({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let r=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(r!==0){this._updateAllRequests();for(let t=0;t<r;++t){let o=this.requestQueue.shift();o&&this._issueRequest(o)}}}_updateAllRequests(){let r=this.requestQueue;for(let t=0;t<r.length;++t){let o=r[t];this._updateRequest(o)||(r.splice(t,1),this.requestMap.delete(o.handle),t--)}r.sort((t,o)=>t.priority-o.priority)}_updateRequest(r){return r.priority=r.getPriority(r.handle),r.priority<0?(r.resolve(null),!1):!0}};var mr="",it={};function pr(e){mr=e}function hr(){return mr}function C(e){for(let r in it)if(e.startsWith(r)){let t=it[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${mr}${e}`),e}var Io="4.4.0-alpha.19",dr={dataType:null,batchType:null,name:"JSON",id:"json",module:"json",version:Io,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:at,parse:async e=>at(new TextDecoder().decode(e)),options:{}};function at(e){return JSON.parse(e)}function Re(e){return e&&typeof e=="object"&&e.isBuffer}function W(e){if(Re(e))return e;if(e instanceof ArrayBuffer)return e;if(He(e))return Le(e);if(ArrayBuffer.isView(e)){let r=e.buffer;return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function S(e){if(e instanceof ArrayBuffer)return e;if(He(e))return Le(e);let{buffer:r,byteOffset:t,byteLength:o}=e;return r instanceof ArrayBuffer&&t===0&&o===r.byteLength?r:Le(r,t,o)}function Le(e,r=0,t=e.byteLength-r){let o=new Uint8Array(e,r,t),n=new Uint8Array(o.length);return n.set(o),n.buffer}function yr(e){return ArrayBuffer.isView(e)?e:new Uint8Array(e)}var B={};Nr(B,{dirname:()=>Co,filename:()=>Oo,join:()=>Wo,resolve:()=>Mo});function ct(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function Oo(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):e}function Co(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function Wo(...e){let r="/";return e=e.map((t,o)=>(o&&(t=t.replace(new RegExp(`^${r}`),"")),o!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function Mo(...e){let r=[];for(let s=0;s<e.length;s++)r[s]=e[s];let t="",o=!1,n;for(let s=r.length-1;s>=-1&&!o;s--){let i;s>=0?i=r[s]:(n===void 0&&(n=ct()),i=n),i.length!==0&&(t=`${i}/${t}`,o=i.charCodeAt(0)===de)}return t=No(t,!o),o?`/${t}`:t.length>0?t:"."}var de=47,gr=46;function No(e,r){let t="",o=-1,n=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===de)break;s=de}if(s===de){if(!(o===a-1||n===1))if(o!==a-1&&n===2){if(t.length<2||!i||t.charCodeAt(t.length-1)!==gr||t.charCodeAt(t.length-2)!==gr){if(t.length>2){let c=t.length-1,f=c;for(;f>=0&&t.charCodeAt(f)!==de;--f);if(f!==c){t=f===-1?"":t.slice(0,f),o=a,n=0,i=!1;continue}}else if(t.length===2||t.length===1){t="",o=a,n=0,i=!1;continue}}r&&(t.length>0?t+="/..":t="..",i=!0)}else{let c=e.slice(o+1,a);t.length>0?t+=`/${c}`:t=c,i=!1}o=a,n=0}else s===gr&&n!==-1?++n:n=-1}return t}var ye=class{handle;size;bigsize;url;constructor(r){this.handle=r instanceof ArrayBuffer?new Blob([r]):r,this.size=r instanceof ArrayBuffer?r.byteLength:r.size,this.bigsize=BigInt(this.size),this.url=r instanceof File?r.name:""}async close(){}async stat(){return{size:this.handle.size,bigsize:BigInt(this.handle.size),isDirectory:!1}}async read(r,t){return await this.handle.slice(Number(r),Number(r)+Number(t)).arrayBuffer()}};var ge=new Error("Not implemented"),we=class{handle;size=0;bigsize=0n;url="";constructor(r,t,o){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(r,t,o);throw p?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(r,t){throw ge}async write(r,t,o){throw ge}async stat(){throw ge}async truncate(r){throw ge}async append(r){throw ge}async close(){}};var re=class extends Error{constructor(r,t){super(r),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var Po=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Fo=/^([-\w.]+\/[-\w.+]+)/;function wr(e,r){return e.toLowerCase()===r.toLowerCase()}function ft(e){let r=Fo.exec(e);return r?r[1]:e}function br(e){let r=Po.exec(e);return r?r[1]:""}var ut=/\?.*/;function lt(e){let r=e.match(ut);return r&&r[0]}function M(e){return e.replace(ut,"")}function mt(e){if(e.length<50)return e;let r=e.slice(e.length-15);return`${e.substr(0,32)}...${r}`}function b(e){return l(e)?e.url:h(e)?("name"in e?e.name:"")||"":typeof e=="string"?e:""}function te(e){if(l(e)){let r=e.headers.get("content-type")||"",t=M(e.url);return ft(r)||br(t)}return h(e)?e.type||"":typeof e=="string"?br(e):""}function pt(e){return l(e)?e.headers["content-length"]||-1:h(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Ie(e){if(l(e))return e;let r={},t=pt(e);t>=0&&(r["content-length"]=String(t));let o=b(e),n=te(e);n&&(r["content-type"]=n);let s=await $o(e);s&&(r["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));let i=new Response(e,{headers:r});return Object.defineProperty(i,"url",{value:o}),i}async function xr(e){if(!e.ok)throw await Uo(e)}async function Uo(e){let r=mt(e.url),t=`Failed to fetch resource (${e.status}) ${e.statusText}: ${r}`;t=t.length>100?`${t.slice(0,100)}...`:t;let o={reason:e.statusText,url:e.url,response:e};try{let n=e.headers.get("Content-Type");o.reason=!e.bodyUsed&&n?.includes("application/json")?await e.json():await e.text()}catch{}return new re(t,o)}async function $o(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(o=>{let n=new FileReader;n.onload=s=>o(s?.target?.result),n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${vo(t)}`}return null}function vo(e){let r="",t=new Uint8Array(e);for(let o=0;o<t.byteLength;o++)r+=String.fromCharCode(t[o]);return btoa(r)}function Do(e){return!jo(e)&&!zo(e)}function jo(e){return e.startsWith("http:")||e.startsWith("https:")}function zo(e){return e.startsWith("data:")}async function q(e,r){if(typeof e=="string"){let t=C(e);return Do(t)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(t,r):await fetch(t,r)}return await Ie(e)}async function ht(e,r,t){e instanceof Blob||(e=new Blob([e]));let o=e.slice(r,r+t);return await qo(o)}async function qo(e){return await new Promise((r,t)=>{let o=new FileReader;o.onload=n=>r(n?.target?.result),o.onerror=n=>t(n),o.readAsArrayBuffer(e)})}var be=new w({id:"loaders.gl"}),Oe=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Ce=class{console;constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var We={core:{baseUrl:void 0,fetch:null,mimeType:void 0,fallbackMimeType:void 0,ignoreRegisteredLoaders:void 0,nothrow:!1,log:new Ce,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:p,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}},dt={baseUri:"core.baseUrl",fetch:"core.fetch",mimeType:"core.mimeType",fallbackMimeType:"core.fallbackMimeType",ignoreRegisteredLoaders:"core.ignoreRegisteredLoaders",nothrow:"core.nothrow",log:"core.log",useLocalLibraries:"core.useLocalLibraries",CDN:"core.CDN",worker:"core.worker",maxConcurrency:"core.maxConcurrency",maxMobileConcurrency:"core.maxMobileConcurrency",reuseWorkers:"core.reuseWorkers",_nodeWorkers:"core.nodeWorkers",_workerType:"core._workerType",_worker:"core._workerType",limit:"core.limit",_limitMB:"core._limitMB",batchSize:"core.batchSize",batchDebounceMs:"core.batchDebounceMs",metadata:"core.metadata",transforms:"core.transforms",throws:"nothrow",dataType:"(no longer used)",uri:"core.baseUrl",method:"core.fetch.method",headers:"core.fetch.headers",body:"core.fetch.body",mode:"core.fetch.mode",credentials:"core.fetch.credentials",cache:"core.fetch.cache",redirect:"core.fetch.redirect",referrer:"core.fetch.referrer",referrerPolicy:"core.fetch.referrerPolicy",integrity:"core.fetch.integrity",keepalive:"core.fetch.keepalive",signal:"core.fetch.signal"};var Tr=["baseUrl","fetch","mimeType","fallbackMimeType","ignoreRegisteredLoaders","nothrow","log","useLocalLibraries","CDN","worker","maxConcurrency","maxMobileConcurrency","reuseWorkers","_nodeWorkers","_workerType","limit","_limitMB","batchSize","batchDebounceMs","metadata","transforms"];function xe(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function L(){let e=xe();return e.globalOptions=e.globalOptions||{...We,core:{...We.core}},E(e.globalOptions)}function Ar(e){let r=xe(),t=L();r.globalOptions=wt(t,e),Ke(e.modules)}function oe(e,r,t,o){return t=t||[],t=Array.isArray(t)?t:[t],Vo(e,t),E(wt(r,e,o))}function E(e){let r=Qo(e);bt(r);for(let t of Tr)r.core&&r.core[t]!==void 0&&delete r[t];return r.core&&r.core._workerType!==void 0&&delete r._worker,r}function Vo(e,r){yt(e,null,We,dt,r);for(let t of r){let o=e&&e[t.id]||{},n=t.options&&t.options[t.id]||{},s=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};yt(o,t.id,n,s,r)}}function yt(e,r,t,o,n){let s=r||"Top level",i=r?`${r}.`:"";for(let a in e){let c=!r&&d(e[a]),f=a==="baseUri"&&!r,k=a==="workerUrl"&&r;if(!(a in t)&&!f&&!k){if(a in o)be.level>0&&be.warn(`${s} loader option '${i}${a}' no longer supported, use '${o[a]}'`)();else if(!c&&be.level>0){let R=Go(a,n);be.warn(`${s} loader option '${i}${a}' not recognized. ${R}`)()}}}}function Go(e,r){let t=e.toLowerCase(),o="";for(let n of r)for(let s in n.options){if(e===s)return`Did you mean '${n.id}.${s}'?`;let i=s.toLowerCase();(t.startsWith(i)||i.startsWith(t))&&(o=o||`Did you mean '${n.id}.${s}'?`)}return o}function wt(e,r,t){let o=e.options||{},n={...o};o.core&&(n.core={...o.core}),bt(n),n.core?.log===null&&(n.core={...n.core,log:new Oe}),gt(n,E(L()));let s=E(r);return gt(n,s),Ho(n,t),Jo(n),n}function gt(e,r){for(let t in r)if(t in r){let o=r[t];J(o)&&J(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function Ho(e,r){if(!r)return;e.core?.baseUrl!==void 0||(e.core||={},e.core.baseUrl=B.dirname(M(r)))}function Qo(e){let r={...e};return e.core&&(r.core={...e.core}),r}function bt(e){e.baseUri!==void 0&&(e.core||={},e.core.baseUrl===void 0&&(e.core.baseUrl=e.baseUri));for(let t of Tr)if(e[t]!==void 0){let n=e.core=e.core||{};n[t]===void 0&&(n[t]=e[t])}let r=e._worker;r!==void 0&&(e.core||={},e.core._workerType===void 0&&(e.core._workerType=r))}function Jo(e){let r=e.core;if(r)for(let t of Tr)r[t]!==void 0&&(e[t]=r[t])}function x(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function Te(e){V(e,"null loader"),V(x(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var xt=()=>{let e=xe();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Tt(e){let r=xt();e=Array.isArray(e)?e:[e];for(let t of e){let o=Te(t);r.find(n=>o===n)||r.unshift(o)}}function At(){return xt()}function _t(){let e=xe();e.loaderRegistry=[]}var Ko=/\.([^.]+)$/;async function ne(e,r=[],t,o){if(!Bt(e))return null;let n=E(t||{});if(n.core||={},e instanceof Response&&kt(e)){let i=await e.clone().text(),a=N(i,r,{...n,core:{...n.core,nothrow:!0}},o);if(a)return a}let s=N(e,r,{...n,core:{...n.core,nothrow:!0}},o);if(s)return s;if(h(e)&&(e=await e.slice(0,10).arrayBuffer(),s=N(e,r,n,o)),!s&&e instanceof Response&&kt(e)){let i=await e.clone().text();s=N(i,r,n,o)}if(!s&&!n.core.nothrow)throw new Error(Et(e));return s}function kt(e){let r=te(e);return Boolean(r&&(r.startsWith("text/")||r==="application/json"||r.endsWith("+json")))}function N(e,r=[],t,o){if(!Bt(e))return null;let n=E(t||{});if(n.core||={},r&&!Array.isArray(r))return Te(r);let s=[];r&&(s=s.concat(r)),n.core.ignoreRegisteredLoaders||s.push(...At()),Zo(s);let i=Yo(e,s,n,o);if(!i&&!n.core.nothrow)throw new Error(Et(e));return i}function Yo(e,r,t,o){let n=b(e),s=te(e),i=M(n)||o?.url,a=null,c="";return t?.core?.mimeType&&(a=_r(r,t?.core?.mimeType),c=`match forced by supplied MIME type ${t?.core?.mimeType}`),a=a||Xo(r,i),c=c||(a?`matched url ${i}`:""),a=a||_r(r,s),c=c||(a?`matched MIME type ${s}`:""),a=a||rn(r,e),c=c||(a?`matched initial data ${Lt(e)}`:""),t?.core?.fallbackMimeType&&(a=a||_r(r,t?.core?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${s}`:"")),c&&Ge.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function Bt(e){return!(e instanceof Response&&e.status===204)}function Et(e){let r=b(e),t=te(e),o="No valid loader found (";o+=r?`${B.filename(r)}, `:"no url provided, ",o+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let n=e?Lt(e):"";return o+=n?` first bytes: "${n}"`:"first bytes: not available",o+=")",o}function Zo(e){for(let r of e)Te(r)}function Xo(e,r){let t=r&&Ko.exec(r),o=t&&t[1];return o?en(e,o):null}function en(e,r){r=r.toLowerCase();for(let t of e)for(let o of t.extensions)if(o.toLowerCase()===r)return t;return null}function _r(e,r){for(let t of e)if(t.mimeTypes?.some(o=>wr(r,o))||wr(r,`application/x.${t.id}`))return t;return null}function rn(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(tn(r,t))return t}else if(ArrayBuffer.isView(r)){if(St(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&St(r,0,t))return t;return null}function tn(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(o=>e.startsWith(o))}function St(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>on(e,r,t,n))}function on(e,r,t,o){if($(o))return ir(o,e,o.byteLength);switch(typeof o){case"function":return o(S(e));case"string":let n=kr(e,r,o.length);return o===n;default:return!1}}function Lt(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?kr(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?kr(e,0,r):""}function kr(e,r,t){if(e.byteLength<r+t)return"";let o=new DataView(e),n="";for(let s=0;s<t;s++)n+=String.fromCharCode(o.getUint8(r+s));return n}var nn=256*1024;function*Rt(e,r){let t=r?.chunkSize||nn,o=0,n=new TextEncoder;for(;o<e.length;){let s=Math.min(e.length-o,t),i=e.slice(o,o+s);o+=s,yield S(n.encode(i))}}function*It(e,r={}){let{chunkSize:t=262144}=r,o=0;for(;o<e.byteLength;){let n=Math.min(e.byteLength-o,t),s=new ArrayBuffer(n),i=new Uint8Array(e,o,n);new Uint8Array(s).set(i),o+=n,yield s}}async function*Ot(e,r){let t=r?.chunkSize||1048576,o=0;for(;o<e.size;){let n=o+t,s=await e.slice(o,n).arrayBuffer();o=n,yield s}}function Sr(e,r){return p?sn(e,r):an(e,r)}async function*sn(e,r){let t=e.getReader(),o;try{for(;;){let n=o||t.read();r?._streamReadAhead&&(o=t.read());let{done:s,value:i}=await n;if(s)return;yield W(i)}}catch{t.releaseLock()}}async function*an(e,r){for await(let t of e)yield W(t)}function se(e,r){if(typeof e=="string")return Rt(e,r);if(e instanceof ArrayBuffer)return It(e,r);if(h(e))return Ot(e,r);if(I(e))return Sr(e,r);if(l(e)){let t=e.body;if(!t)throw new Error("Readable stream not available on Response");return Sr(t,r)}throw new Error("makeIterator")}var Me="Cannot convert supplied data type";function Br(e,r,t){if(r.text&&typeof e=="string")return e;if(Re(e)&&(e=e.buffer),$(e)){let o=yr(e);return r.text&&!r.binary?new TextDecoder("utf8").decode(o):W(o)}throw new Error(Me)}async function Ct(e,r,t){if(typeof e=="string"||$(e))return Br(e,r,t);if(h(e)&&(e=await Ie(e)),l(e))return await xr(e),r.binary?await e.arrayBuffer():await e.text();if(I(e)&&(e=se(e,t)),v(e)||K(e))return j(e);throw new Error(Me)}async function Wt(e,r){if(ce(e)&&(e=await e),Y(e))return e;if(l(e)){await xr(e);let t=await e.body;if(!t)throw new Error(Me);return se(t,r)}return h(e)||I(e)?se(e,r):K(e)||v(e)?e:cn(e)}function cn(e){if(ArrayBuffer.isView(e))return function*(){yield W(e)}();if($(e))return function*(){yield W(e)}();if(Y(e))return e;if(v(e))return e[Symbol.iterator]();throw new Error(Me)}function ie(e,r){let t=L(),o=e||t,n=o.fetch??o.core?.fetch;return typeof n=="function"?n:d(n)?s=>q(s,n):r?.fetch?r?.fetch:q}function ae(e,r,t){if(t)return t;let o={fetch:ie(r,e),...e};if(o.url){let n=M(o.url);o.baseUrl=n,o.queryString=lt(o.url),o.filename=B.filename(n),o.baseUrl=B.dirname(n)}return Array.isArray(o.loaders)||(o.loaders=null),o}function Ne(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let o=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...o]:o}return t&&t.length?t:void 0}async function _(e,r,t,o){r&&!Array.isArray(r)&&!x(r)&&(o=void 0,t=r,r=void 0),e=await e,t=t||{};let n=b(e),i=Ne(r,o),a=await ne(e,i,t);if(!a)return null;let c=oe(t,a,i,n);return o=ae({url:n,_parse:_,loaders:i},c,o||null),await fn(a,e,c,o)}async function fn(e,r,t,o){if(tr(e),t=Je(e.options,t),l(r)){let{ok:s,redirected:i,status:a,statusText:c,type:f,url:k}=r,R=Object.fromEntries(r.headers.entries());o.response={headers:R,ok:s,redirected:i,status:a,statusText:c,type:f,url:k}}r=await Ct(r,e,t);let n=e;if(n.parseTextSync&&typeof r=="string")return n.parseTextSync(r,t,o);if(or(e,t))return await nr(e,r,t,o,_);if(n.parseText&&typeof r=="string")return await n.parseText(r,t,o);if(n.parse)return await n.parse(r,t,o);throw m(!n.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Mt(e,r,t,o){!Array.isArray(r)&&!x(r)&&(o=void 0,t=r,r=void 0),t=t||{};let s=Ne(r,o),i=N(e,s,t);if(!i)return null;let a=oe(t,i,s),c=b(e),f=()=>{throw new Error("parseSync called parse (which is async")};return o=ae({url:c,_parseSync:f,_parse:f,loaders:r},a,o||null),un(i,e,a,o)}function un(e,r,t,o){if(r=Br(r,e,t),e.parseTextSync&&typeof r=="string")return e.parseTextSync(r,t);if(e.parseSync&&r instanceof ArrayBuffer)return e.parseSync(r,t,o);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${o.url||""}`)}function Er(e){switch(typeof e=="object"&&e?.shape){case"array-row-table":case"object-row-table":return Array.isArray(e.data);case"geojson-table":return Array.isArray(e.features);case"columnar-table":return e.data&&typeof e.data=="object";case"arrow-table":return Boolean(e?.data?.numRows!==void 0);default:return!1}}function Lr(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.data.length;case"geojson-table":return e.features.length;case"arrow-table":return e.data.numRows;case"columnar-table":for(let t of Object.values(e.data))return t.length||0;return 0;default:throw new Error("table")}}function Rr(e){return{...e,length:Lr(e),batchType:"data"}}async function P(e,r,t,o){let n=Array.isArray(r)?r:void 0;!Array.isArray(r)&&!x(r)&&(o=void 0,t=r,r=void 0),e=await e,t=t||{};let s=b(e),i=await ne(e,r,t);if(!i)return[];let a=oe(t,i,n,s);return o=ae({url:s,_parseInBatches:P,_parse:_,loaders:n},a,o||null),await ln(i,e,a,o)}async function ln(e,r,t,o){let n=await mn(e,r,t,o);if(!t?.core?.metadata)return n;let s={shape:"metadata",batchType:"metadata",metadata:{_loader:e,_context:o},data:[],bytesUsed:0};async function*i(a){yield s,yield*a}return i(n)}async function mn(e,r,t,o){let n=await Wt(r,t),s=await dn(n,t?.core?.transforms||[]);return e.parseInBatches?e.parseInBatches(s,t,o):pn(s,e,t,o)}async function*pn(e,r,t,o){let n=await j(e),s=await _(n,r,{...t,core:{...t?.core,mimeType:r.mimeTypes[0]}},o);yield hn(s,r)}function hn(e,r){let t=Er(e)?Rr(e):{shape:"unknown",batchType:"data",data:e,length:Array.isArray(e)?e.length:1};return t.mimeType=r.mimeTypes[0],t}async function dn(e,r=[]){let t=e;for await(let o of r)t=o(t);return t}async function Nt(e,r,t,o){let n,s;!Array.isArray(r)&&!x(r)?(n=[],s=r,o=void 0):(n=r,s=t);let i=ie(s),a=e;return typeof e=="string"&&(a=await i(e)),h(e)&&(a=await i(e)),typeof e=="string"&&(E(s||{}).core?.baseUrl||(s={...s,core:{...s?.core,baseUrl:e}})),Array.isArray(n)?await _(a,n,s):await _(a,n,s)}function Ft(e,r,t,o){let n;!Array.isArray(r)&&!x(r)?(o=void 0,t=r,n=void 0):n=r;let s=ie(t||{});return Array.isArray(e)?e.map(a=>Pt(a,n,t||{},s)):Pt(e,n,t||{},s)}async function Pt(e,r,t,o){if(typeof e=="string"){let s=await o(e);return Array.isArray(r)?await P(s,r,t):await P(s,r,t)}return Array.isArray(r)?await P(e,r,t):await P(e,r,t)}async function Ir(e,r,t){if(r.encode)return await r.encode(e,t);if(r.encodeText){let o=await r.encodeText(e,t);return S(new TextEncoder().encode(o))}if(r.encodeInBatches){let o=Or(e,r,t),n=[];for await(let s of o)n.push(s);return pe(...n)}throw new Error("Writer could not encode data")}async function Ut(e,r,t){if(r.text&&r.encodeText)return await r.encodeText(e,t);if(r.text){let o=await Ir(e,r,t);return new TextDecoder().decode(o)}throw new Error(`Writer ${r.name} could not encode data as text`)}function Or(e,r,t){if(r.encodeInBatches){let o=yn(e);return r.encodeInBatches(o,t)}throw new Error("Writer could not encode data in batches")}function yn(e){return[{...e,start:0,end:e.length}]}async function vt(e,r,t){let n={...L(),...t};return r.encodeURLtoURL?gn(r,e,n):sr(r,n)?await rr(r,e,n):await r.encode(e,n)}function Cr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);if(r.encodeTextSync)return S(new TextEncoder().encode(r.encodeTextSync(e,t)));throw new Error(`Writer ${r.name} could not synchronously encode data`)}async function Dt(e,r,t){if(r.encodeText)return await r.encodeText(e,t);if(r.encodeTextSync)return r.encodeTextSync(e,t);if(r.text){let o=await r.encode(e,t);return new TextDecoder().decode(o)}throw new Error(`Writer ${r.name} could not encode data as text`)}function jt(e,r,t){if(r.encodeTextSync)return r.encodeTextSync(e,t);if(r.text&&r.encodeSync){let o=Cr(e,r,t);return new TextDecoder().decode(o)}throw new Error(`Writer ${r.name} could not encode data as text`)}function zt(e,r,t){if(r.encodeInBatches){let o=wn(e);return r.encodeInBatches(o,t)}throw new Error(`Writer ${r.name} could not encode in batches`)}async function Wr(e,r,t,o){if(e=C(e),r=C(r),p||!t.encodeURLtoURL)throw new Error;return await t.encodeURLtoURL(e,r,o)}async function gn(e,r,t){if(p)throw new Error(`Writer ${e.name} not supported in browser`);let o=$t("input");await new we(o,"w").write(r);let s=$t("output"),i=await Wr(o,s,e,t);return(await q(i)).arrayBuffer()}function wn(e){return[{...e,start:0,end:e.length}]}function $t(e){return`/tmp/${e}`}function qt(e,r,t){let o=t?.core?.type||t.type||"auto",n=o==="auto"?bn(e,r):xn(o,r);if(!n)throw new Error("Not a valid source type");return n.createDataSource(e,t)}function bn(e,r){for(let t of r)if(t.testURL&&t.testURL(e))return t;return null}function xn(e,r){for(let t of r)if(t.type===e)return t;return null}function Vt(e,r,t){let o=t?.type||"auto",n=null;if(o==="auto"){for(let s of r)if(typeof e=="string"&&s.testURL&&s.testURL(e))return s}else n=Tn(o,r);if(!n&&!t?.nothrow)throw new Error("Not a valid image source type");return n}function Tn(e,r){for(let t of r)if(t.type===e)return t;return null}function Gt(e,r){if(globalThis.loaders.makeNodeStream)return globalThis.loaders.makeNodeStream(e,r);let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(o){try{let{done:n,value:s}=await t.next();n?o.close():o.enqueue(new Uint8Array(s))}catch(n){o.error(n)}},async cancel(){await t?.return?.()}},{highWaterMark:2**24,...r})}var Ht="4.4.0-alpha.19",Qt={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Ht,worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Jt={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Ht,mimeTypes:["application/x.empty"],extensions:["null"],parse:async(e,r,t)=>Mr(e,r||{},t),parseSync:Mr,parseInBatches:async function*(r,t,o){for await(let n of r)yield Mr(n,t,o)},tests:[()=>!1],options:{null:{}}};function Mr(e,r,t){return null}async function Kt(e,r,t=()=>{},o=()=>{}){if(e=await e,!e.ok)return e;let n=e.body;if(!n)return e;let s=e.headers.get("content-length")||0,i=s?parseInt(s):0;if(!(i>0)||typeof ReadableStream>"u"||!n.getReader)return e;let a=new ReadableStream({async start(c){let f=n.getReader();await Yt(c,f,0,i,r,t,o)}});return new Response(a)}async function Yt(e,r,t,o,n,s,i){try{let{done:a,value:c}=await r.read();if(a){s(),e.close();return}t+=c.byteLength;let f=Math.round(t/o*100);n(f,{loadedBytes:t,totalBytes:o}),e.enqueue(c),await Yt(e,r,t,o,n,s,i)}catch(a){e.error(a),i(a)}}var Pe=class{_fetch;files={};lowerCaseFiles={};usedFiles={};constructor(r,t){this._fetch=t?.fetch||fetch;for(let o=0;o<r.length;++o){let n=r[o];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(r,t){if(r.includes("://"))return this._fetch(r,t);let o=this.files[r];if(!o)return new Response(r,{status:400,statusText:"NOT FOUND"});let s=new Headers(t?.headers).get("Range"),i=s&&/bytes=($1)-($2)/.exec(s);if(i){let c=parseInt(i[1]),f=parseInt(i[2]),k=await o.slice(c,f).arrayBuffer(),R=new Response(k);return Object.defineProperty(R,"url",{value:r}),R}let a=new Response(o);return Object.defineProperty(a,"url",{value:r}),a}async readdir(r){let t=[];for(let o in this.files)t.push(o);return t}async stat(r,t){let o=this.files[r];if(!o)throw new Error(r);return{size:o.size}}async unlink(r){delete this.files[r],delete this.lowerCaseFiles[r],this.usedFiles[r]=!0}async openReadableFile(r,t){return new ye(this.files[r])}_getFile(r,t){let o=this.files[r]||this.lowerCaseFiles[r];return o&&t&&(this.usedFiles[r]=!0),o}};return oo(An);})();
14
14
  return __exports__;
15
15
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/deprecated/mesh-utils.ts"],
4
- "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// COMMON CATEGORY\nexport type {\n TypedArray,\n BigTypedArray,\n TypedArrayConstructor,\n BigTypedArrayConstructor,\n NumberArray,\n ArrayType,\n AnyArray\n} from './types/types';\n\n// SCHEMAS AND DATA TYPES\n\nexport type {Schema, Field, DataType, SchemaMetadata, FieldMetadata} from './types/schema';\nexport type {Batch} from './types/batch';\n\n// TABLE CATEGORY TYPES\nexport type {\n Table,\n RowTable,\n ArrayRowTable,\n ObjectRowTable,\n GeoJSONTable,\n ColumnarTable,\n ArrowTable,\n Tables\n} from './categories/category-table';\nexport type {\n TableBatch,\n ArrayRowTableBatch,\n ObjectRowTableBatch,\n GeoJSONTableBatch,\n ColumnarTableBatch,\n ArrowTableBatch\n} from './categories/category-table';\n\n// MESH CATEGORY\nexport type {\n MeshTable,\n MeshArrowTable,\n Mesh,\n MeshGeometry,\n MeshAttribute,\n MeshAttributes\n} from './categories/category-mesh';\n\n// TEXTURES\nexport type {\n TextureLevel,\n GPUTextureFormat,\n TextureFormat,\n GLTextureFormat\n} from './categories/category-texture';\n\n// IMAGES\nexport type {ImageDataType, ImageType, ImageTypeEnum} from './categories/category-image';\n\n// GIS CATEGORY - GEOARROW\n// export type {GeoArrowMetadata, GeoArrowEncoding} from './geometry/geoarrow-metadata';\n\n// GIS CATEGORY - GEOJSON\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties,\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from './categories/category-gis';\n\n// GIS CATEGORY - FLAT GEOJSON\nexport type {\n FlatFeature,\n FlatIndexedGeometry,\n FlatGeometry,\n FlatGeometryType,\n FlatPoint,\n FlatLineString,\n FlatPolygon\n} from './categories/category-gis';\n\n// GIS CATEGORY - BINARY\nexport type {\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryAttribute\n} from './categories/category-gis';\nexport type {\n BinaryFeatureCollection,\n BinaryFeature,\n BinaryPointFeature,\n BinaryLineFeature,\n BinaryPolygonFeature\n} from './categories/category-gis';\n\n// DEPRECATED\n\n// MESH CATEGORY\n\nexport {getMeshSize, getMeshBoundingBox} from './deprecated/mesh-utils';\n", "// Mesh category utilities\n// TODO - move to mesh category module, or to math.gl/geometry module\nimport {MeshAttributes} from '../categories/category-mesh';\nimport {TypedArray} from '../types/types';\n\ntype TypedArrays = {[key: string]: TypedArray};\n\n/**\n * Holds an axis aligned bounding box\n * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)\n */\ntype BoundingBox = [[number, number, number], [number, number, number]];\n\n/**\n * Get number of vertices in mesh\n * @param attributes\n * @deprecated Import from shema-utils\n */\nexport function getMeshSize(attributes: TypedArrays): number {\n let size = 0;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n if (ArrayBuffer.isView(attribute)) {\n // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT\n size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;\n }\n }\n return size;\n}\n\n/**\n * Get the (axis aligned) bounding box of a mesh\n * @param attributes\n * @returns array of two vectors representing the axis aligned bounding box\n * @deprecated Import from shema-utils\n */\n// eslint-disable-next-line complexity\nexport function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {\n let minX = Infinity;\n let minY = Infinity;\n let minZ = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let maxZ = -Infinity;\n\n const positions = attributes.POSITION ? attributes.POSITION.value : [];\n const len = positions && positions.length;\n\n for (let i = 0; i < len; i += 3) {\n const x = positions[i];\n const y = positions[i + 1];\n const z = positions[i + 2];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n minZ = z < minZ ? z : minZ;\n\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n maxZ = z > maxZ ? z : maxZ;\n }\n return [\n [minX, minY, minZ],\n [maxX, maxY, maxZ]\n ];\n}\n"],
4
+ "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// COMMON CATEGORY\nexport type {\n TypedArray,\n BigTypedArray,\n TypedArrayConstructor,\n BigTypedArrayConstructor,\n NumberArray,\n ArrayType,\n AnyArray\n} from './types/types';\n\n// SCHEMAS AND DATA TYPES\n\nexport type {Schema, Field, DataType, SchemaMetadata, FieldMetadata} from './types/schema';\nexport type {Batch} from './types/batch';\n\n// TABLE CATEGORY TYPES\nexport type {\n Table,\n RowTable,\n ArrayRowTable,\n ObjectRowTable,\n GeoJSONTable,\n ColumnarTable,\n ArrowTable,\n Tables\n} from './categories/category-table';\nexport type {\n TableBatch,\n ArrayRowTableBatch,\n ObjectRowTableBatch,\n GeoJSONTableBatch,\n ColumnarTableBatch,\n ArrowTableBatch\n} from './categories/category-table';\n\n// MESH CATEGORY\nexport type {\n MeshTable,\n MeshArrowTable,\n Mesh,\n MeshGeometry,\n MeshAttribute,\n MeshAttributes\n} from './categories/category-mesh';\n\n// TEXTURES\nexport type {\n TextureMetadata,\n Texture,\n Texture1D,\n Texture2D,\n Texture3D,\n TextureCube,\n Texture2DArray,\n TextureCubeArray,\n TextureLevel,\n GPUTextureFormat,\n TextureFormat\n} from './categories/category-texture';\n\n// IMAGES\nexport type {ImageDataType, ImageType, ImageTypeEnum} from './categories/category-image';\n\n// GIS CATEGORY - GEOARROW\n// export type {GeoArrowMetadata, GeoArrowEncoding} from './geometry/geoarrow-metadata';\n\n// GIS CATEGORY - GEOJSON\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties,\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from './categories/category-gis';\n\n// GIS CATEGORY - FLAT GEOJSON\nexport type {\n FlatFeature,\n FlatIndexedGeometry,\n FlatGeometry,\n FlatGeometryType,\n FlatPoint,\n FlatLineString,\n FlatPolygon\n} from './categories/category-gis';\n\n// GIS CATEGORY - BINARY\nexport type {\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryAttribute\n} from './categories/category-gis';\nexport type {\n BinaryFeatureCollection,\n BinaryFeature,\n BinaryPointFeature,\n BinaryLineFeature,\n BinaryPolygonFeature\n} from './categories/category-gis';\n\n// DEPRECATED\n\n// MESH CATEGORY\n\nexport {getMeshSize, getMeshBoundingBox} from './deprecated/mesh-utils';\n", "// Mesh category utilities\n// TODO - move to mesh category module, or to math.gl/geometry module\nimport {MeshAttributes} from '../categories/category-mesh';\nimport {TypedArray} from '../types/types';\n\ntype TypedArrays = {[key: string]: TypedArray};\n\n/**\n * Holds an axis aligned bounding box\n * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)\n */\ntype BoundingBox = [[number, number, number], [number, number, number]];\n\n/**\n * Get number of vertices in mesh\n * @param attributes\n * @deprecated Import from shema-utils\n */\nexport function getMeshSize(attributes: TypedArrays): number {\n let size = 0;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n if (ArrayBuffer.isView(attribute)) {\n // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT\n size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;\n }\n }\n return size;\n}\n\n/**\n * Get the (axis aligned) bounding box of a mesh\n * @param attributes\n * @returns array of two vectors representing the axis aligned bounding box\n * @deprecated Import from shema-utils\n */\n// eslint-disable-next-line complexity\nexport function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {\n let minX = Infinity;\n let minY = Infinity;\n let minZ = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let maxZ = -Infinity;\n\n const positions = attributes.POSITION ? attributes.POSITION.value : [];\n const len = positions && positions.length;\n\n for (let i = 0; i < len; i += 3) {\n const x = positions[i];\n const y = positions[i + 1];\n const z = positions[i + 2];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n minZ = z < minZ ? z : minZ;\n\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n maxZ = z > maxZ ? z : maxZ;\n }\n return [\n [minX, minY, minZ],\n [maxX, maxY, maxZ]\n ];\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;ACkBM,SAAU,YAAY,YAAuB;AACjD,MAAI,OAAO;AACX,aAAW,iBAAiB,YAAY;AACtC,UAAM,YAAY,WAAW,aAAa;AAC1C,QAAI,YAAY,OAAO,SAAS,GAAG;AAEjC,cAAQ,UAAU,aAAa,UAAU;IAC3C;EACF;AACA,SAAO;AACT;AASM,SAAU,mBAAmB,YAA0B;AAC3D,MAAI,OAAO;AACX,MAAI,OAAO;AACX,MAAI,OAAO;AACX,MAAI,OAAO;AACX,MAAI,OAAO;AACX,MAAI,OAAO;AAEX,QAAM,YAAY,WAAW,WAAW,WAAW,SAAS,QAAQ,CAAA;AACpE,QAAM,MAAM,aAAa,UAAU;AAEnC,WAAS,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG;AAC/B,UAAM,IAAI,UAAU,CAAC;AACrB,UAAM,IAAI,UAAU,IAAI,CAAC;AACzB,UAAM,IAAI,UAAU,IAAI,CAAC;AAEzB,WAAO,IAAI,OAAO,IAAI;AACtB,WAAO,IAAI,OAAO,IAAI;AACtB,WAAO,IAAI,OAAO,IAAI;AAEtB,WAAO,IAAI,OAAO,IAAI;AACtB,WAAO,IAAI,OAAO,IAAI;AACtB,WAAO,IAAI,OAAO,IAAI;EACxB;AACA,SAAO;IACL,CAAC,MAAM,MAAM,IAAI;IACjB,CAAC,MAAM,MAAM,IAAI;;AAErB;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export type { Batch } from "./types/batch.js";
4
4
  export type { Table, RowTable, ArrayRowTable, ObjectRowTable, GeoJSONTable, ColumnarTable, ArrowTable, Tables } from "./categories/category-table.js";
5
5
  export type { TableBatch, ArrayRowTableBatch, ObjectRowTableBatch, GeoJSONTableBatch, ColumnarTableBatch, ArrowTableBatch } from "./categories/category-table.js";
6
6
  export type { MeshTable, MeshArrowTable, Mesh, MeshGeometry, MeshAttribute, MeshAttributes } from "./categories/category-mesh.js";
7
- export type { TextureLevel, GPUTextureFormat, TextureFormat, GLTextureFormat } from "./categories/category-texture.js";
7
+ export type { TextureMetadata, Texture, Texture1D, Texture2D, Texture3D, TextureCube, Texture2DArray, TextureCubeArray, TextureLevel, GPUTextureFormat, TextureFormat } from "./categories/category-texture.js";
8
8
  export type { ImageDataType, ImageType, ImageTypeEnum } from "./categories/category-image.js";
9
9
  export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, GeoJsonProperties, Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection } from "./categories/category-gis.js";
10
10
  export type { FlatFeature, FlatIndexedGeometry, FlatGeometry, FlatGeometryType, FlatPoint, FlatLineString, FlatPolygon } from "./categories/category-gis.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,QAAQ,EACT,yBAAsB;AAIvB,YAAY,EAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAC,0BAAuB;AAC3F,YAAY,EAAC,KAAK,EAAC,yBAAsB;AAGzC,YAAY,EACV,KAAK,EACL,QAAQ,EACR,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,EACV,MAAM,EACP,uCAAoC;AACrC,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EAChB,uCAAoC;AAGrC,YAAY,EACV,SAAS,EACT,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,cAAc,EACf,sCAAmC;AAGpC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,yCAAsC;AAGvC,YAAY,EAAC,aAAa,EAAE,SAAS,EAAE,aAAa,EAAC,uCAAoC;AAMzF,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,qCAAkC;AAGnC,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,WAAW,EACZ,qCAAkC;AAGnC,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EAChB,qCAAkC;AACnC,YAAY,EACV,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACrB,qCAAkC;AAMnC,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,mCAAgC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,QAAQ,EACT,yBAAsB;AAIvB,YAAY,EAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAC,0BAAuB;AAC3F,YAAY,EAAC,KAAK,EAAC,yBAAsB;AAGzC,YAAY,EACV,KAAK,EACL,QAAQ,EACR,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,EACV,MAAM,EACP,uCAAoC;AACrC,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EAChB,uCAAoC;AAGrC,YAAY,EACV,SAAS,EACT,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,cAAc,EACf,sCAAmC;AAGpC,YAAY,EACV,eAAe,EACf,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACd,yCAAsC;AAGvC,YAAY,EAAC,aAAa,EAAE,SAAS,EAAE,aAAa,EAAC,uCAAoC;AAMzF,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,qCAAkC;AAGnC,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,WAAW,EACZ,qCAAkC;AAGnC,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EAChB,qCAAkC;AACnC,YAAY,EACV,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACrB,qCAAkC;AAMnC,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,mCAAgC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AA2GpC,aAAa;AAEb,gBAAgB;AAEhB,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,mCAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAkHpC,aAAa;AAEb,gBAAgB;AAEhB,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,mCAAgC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/schema",
3
- "version": "4.4.0-alpha.18",
3
+ "version": "4.4.0-alpha.19",
4
4
  "description": "Table format APIs for JSON, CSV, etc...",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,5 +44,5 @@
44
44
  "@types/geojson": "^7946.0.7",
45
45
  "apache-arrow": ">= 17.0.0"
46
46
  },
47
- "gitHead": "6f37278ba24a83a68a1a081389eaef2ffac1ff09"
47
+ "gitHead": "e29d8964be2d7304d212560b44e6669ce01e9b8a"
48
48
  }
@@ -3,6 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import type {ImageType} from './category-image';
6
+ import type {TypedArray} from '../types/types';
6
7
 
7
8
  /**
8
9
  * These represent the main compressed texture formats
@@ -78,9 +79,9 @@ export type TextureFormatCompressed =
78
79
  | 'bc1-rgb-unorm-srgb-webgl'
79
80
  | 'pvrtc-rgb4unorm-webgl'
80
81
  | 'pvrtc-rgba4unorm-webgl'
81
- | 'pvrtc-rbg2unorm-webgl'
82
+ | 'pvrtc-rgb2unorm-webgl'
82
83
  | 'pvrtc-rgba2unorm-webgl'
83
- | 'etc1-rbg-unorm-webgl'
84
+ | 'etc1-rgb-unorm-webgl'
84
85
  | 'atc-rgb-unorm-webgl'
85
86
  | 'atc-rgba-unorm-webgl'
86
87
  | 'atc-rgbai-unorm-webgl'
@@ -137,92 +138,120 @@ export type TextureFormatCompressed =
137
138
  | 'astc-12x12-unorm'
138
139
  | 'astc-12x12-unorm-srgb';
139
140
 
140
- export type GLTextureFormat =
141
- | 0x1907
142
- | 0x1908
143
- | 0x8056
144
- | 0x8057
145
- | 0x8058
146
- | 0x8d62
147
- | 0x83f0
148
- | 0x83f1
149
- | 0x83f2
150
- | 0x83f3
151
- | 0x9270
152
- | 0x9271
153
- | 0x9272
154
- | 0x9273
155
- | 0x9274
156
- | 0x9275
157
- | 0x9276
158
- | 0x9277
159
- | 0x9278
160
- | 0x9279
161
- | 0x8c00
162
- | 0x8c01
163
- | 0x8c02
164
- | 0x8c03
165
- | 0x8d64
166
- | 0x8c92
167
- | 0x8c93
168
- | 0x87ee
169
- | 0x8dbb
170
- | 0x8dbc
171
- | 0x8dbd
172
- | 0x8dbe
173
- | 0x8e8c
174
- | 0x8e8d
175
- | 0x8e8e
176
- | 0x8e8f
177
- | 0x8c4c
178
- | 0x8c4d
179
- | 0x8c4e
180
- | 0x8c4f
181
- | 0x93b0
182
- | 0x93b1
183
- | 0x93b2
184
- | 0x93b3
185
- | 0x93b4
186
- | 0x93b5
187
- | 0x93b6
188
- | 0x93b7
189
- | 0x93b8
190
- | 0x93b9
191
- | 0x93ba
192
- | 0x93bb
193
- | 0x93bc
194
- | 0x93bd
195
- | 0x93d0
196
- | 0x93d1
197
- | 0x93d2
198
- | 0x93d3
199
- | 0x93d4
200
- | 0x93d5
201
- | 0x93d6
202
- | 0x93d7
203
- | 0x93d8
204
- | 0x93d9
205
- | 0x93da
206
- | 0x93db
207
- | 0x93dc
208
- | 0x93dd;
141
+ /** Application-facing metadata attached to texture payloads. */
142
+ export type TextureMetadata = Record<string, unknown>;
143
+
144
+ /** Return type of `texture` category loaders. */
145
+ export type Texture<MetadataT extends TextureMetadata = TextureMetadata> =
146
+ | Texture1D<MetadataT>
147
+ | Texture2D<MetadataT>
148
+ | Texture3D<MetadataT>
149
+ | TextureCube<MetadataT>
150
+ | Texture2DArray<MetadataT>
151
+ | TextureCubeArray<MetadataT>;
152
+
153
+ /** One-dimensional texture with mip levels. */
154
+ export type Texture1D<MetadataT extends TextureMetadata = TextureMetadata> = {
155
+ /** loaders.gl shape tag identifying texture payloads. */
156
+ shape: 'texture';
157
+ /** Application-facing format metadata, when provided by the loader. */
158
+ metadata?: MetadataT;
159
+ /** Texture dimensionality. */
160
+ type: '1d';
161
+ /** Canonical loaders.gl texture format for the texture payload. */
162
+ format: TextureFormat;
163
+ /** Mip levels that make up the texture. */
164
+ data: TextureLevel[];
165
+ };
166
+
167
+ /** Two-dimensional texture with mip levels. */
168
+ export type Texture2D<MetadataT extends TextureMetadata = TextureMetadata> = {
169
+ /** loaders.gl shape tag identifying texture payloads. */
170
+ shape: 'texture';
171
+ /** Application-facing format metadata, when provided by the loader. */
172
+ metadata?: MetadataT;
173
+ /** Texture dimensionality. */
174
+ type: '2d';
175
+ /** Canonical loaders.gl texture format for the texture payload. */
176
+ format: TextureFormat;
177
+ /** Mip levels that make up the texture. */
178
+ data: TextureLevel[];
179
+ };
180
+
181
+ /** Three-dimensional texture with mip levels for each depth slice. */
182
+ export type Texture3D<MetadataT extends TextureMetadata = TextureMetadata> = {
183
+ /** loaders.gl shape tag identifying texture payloads. */
184
+ shape: 'texture';
185
+ /** Application-facing format metadata, when provided by the loader. */
186
+ metadata?: MetadataT;
187
+ /** Texture dimensionality. */
188
+ type: '3d';
189
+ /** Canonical loaders.gl texture format for the texture payload. */
190
+ format: TextureFormat;
191
+ /** Mip levels grouped by depth slice. */
192
+ data: TextureLevel[][];
193
+ };
194
+
195
+ /** Cube texture with mip levels for each face. */
196
+ export type TextureCube<MetadataT extends TextureMetadata = TextureMetadata> = {
197
+ /** loaders.gl shape tag identifying texture payloads. */
198
+ shape: 'texture';
199
+ /** Application-facing format metadata, when provided by the loader. */
200
+ metadata?: MetadataT;
201
+ /** Texture dimensionality. */
202
+ type: 'cube';
203
+ /** Canonical loaders.gl texture format for the texture payload. */
204
+ format: TextureFormat;
205
+ /** Mip levels grouped by cube face. */
206
+ data: TextureLevel[][];
207
+ };
208
+
209
+ /** Array of two-dimensional textures with mip levels for each layer. */
210
+ export type Texture2DArray<MetadataT extends TextureMetadata = TextureMetadata> = {
211
+ /** loaders.gl shape tag identifying texture payloads. */
212
+ shape: 'texture';
213
+ /** Application-facing format metadata, when provided by the loader. */
214
+ metadata?: MetadataT;
215
+ /** Texture dimensionality. */
216
+ type: '2d-array';
217
+ /** Canonical loaders.gl texture format for the texture payload. */
218
+ format: TextureFormat;
219
+ /** Mip levels grouped by array layer. */
220
+ data: TextureLevel[][];
221
+ };
222
+
223
+ /** Array of cube textures with mip levels for each face in each layer. */
224
+ export type TextureCubeArray<MetadataT extends TextureMetadata = TextureMetadata> = {
225
+ /** loaders.gl shape tag identifying texture payloads. */
226
+ shape: 'texture';
227
+ /** Application-facing format metadata, when provided by the loader. */
228
+ metadata?: MetadataT;
229
+ /** Texture dimensionality. */
230
+ type: 'cube-array';
231
+ /** Canonical loaders.gl texture format for the texture payload. */
232
+ format: TextureFormat;
233
+ /** Mip levels grouped by cube-array layer and face. */
234
+ data: TextureLevel[][][];
235
+ };
209
236
 
210
237
  /** A TextureLevel holds data for one texture mip level */
211
238
  export type TextureLevel = {
212
- /** Shape tag identifying texture level payloads */
239
+ /** loaders.gl shape tag identifying texture level payloads */
213
240
  shape: 'texture-level';
214
241
  /** WebGPU texture format corresponding the format of the data in this TextureLevel */
215
242
  textureFormat?: TextureFormat;
216
- /** WebGL texture format constant corresponding the format of the data in this TextureLevel */
217
- format?: GLTextureFormat;
243
+ /** Numeric API-specific format constant, currently used for WebGL/OpenGL upload paths */
244
+ format?: number;
218
245
  /** Whether the texture is compressed */
219
246
  compressed: boolean;
220
247
  /** Width in texels */
221
248
  width: number;
222
249
  /** Height in texels */
223
250
  height: number;
224
- /** Byte array */
225
- data: Uint8Array;
251
+ /** Optional bitmap handle for image-backed texture levels */
252
+ imageBitmap?: ImageBitmap;
253
+ /** Byte array or float pixel data. Will be a dummy length 0 array if imageBitmap is provided */
254
+ data: TypedArray;
226
255
  levelSize?: number;
227
256
  hasAlpha?: boolean;
228
257
  };
package/src/index.ts CHANGED
@@ -50,10 +50,17 @@ export type {
50
50
 
51
51
  // TEXTURES
52
52
  export type {
53
+ TextureMetadata,
54
+ Texture,
55
+ Texture1D,
56
+ Texture2D,
57
+ Texture3D,
58
+ TextureCube,
59
+ Texture2DArray,
60
+ TextureCubeArray,
53
61
  TextureLevel,
54
62
  GPUTextureFormat,
55
- TextureFormat,
56
- GLTextureFormat
63
+ TextureFormat
57
64
  } from './categories/category-texture';
58
65
 
59
66
  // IMAGES