@loaders.gl/i3s 4.1.0-alpha.9 → 4.1.1

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,5 +1,5 @@
1
1
  import { parseWebscene } from "./lib/parsers/parse-arcgis-webscene.js";
2
- const VERSION = typeof "4.1.0-alpha.9" !== 'undefined' ? "4.1.0-alpha.9" : 'latest';
2
+ const VERSION = typeof "4.1.1" !== 'undefined' ? "4.1.1" : 'latest';
3
3
  export const ArcGISWebSceneLoader = {
4
4
  name: 'ArcGIS Web Scene Loader',
5
5
  id: 'arcgis-web-scene',
@@ -1 +1 @@
1
- {"version":3,"file":"arcgis-webscene-loader.js","names":["parseWebscene","VERSION","ArcGISWebSceneLoader","name","id","module","version","mimeTypes","parse","extensions","options","data"],"sources":["../src/arcgis-webscene-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ArcGISWebSceneData} from './types';\n\nimport {parseWebscene} from './lib/parsers/parse-arcgis-webscene';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type ArcGISWebSceneLoaderOptions = LoaderOptions & {};\n\n/**\n * Loader for ArcGIS WebScene\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/\n */\nexport const ArcGISWebSceneLoader: LoaderWithParser<\n ArcGISWebSceneData,\n never,\n ArcGISWebSceneLoaderOptions\n> = {\n name: 'ArcGIS Web Scene Loader',\n id: 'arcgis-web-scene',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\n/**\n * Parse ArcGIS webscene\n * @param data\n */\nasync function parse(data: ArrayBuffer): Promise<ArcGISWebSceneData> {\n return parseWebscene(data);\n}\n"],"mappings":"SAGQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAQ3E,OAAO,MAAMC,oBAIZ,GAAG;EACFC,IAAI,EAAE,yBAAyB;EAC/BC,EAAE,EAAE,kBAAkB;EACtBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAMD,eAAeF,KAAKA,CAACG,IAAiB,EAA+B;EACnE,OAAOX,aAAa,CAACW,IAAI,CAAC;AAC5B"}
1
+ {"version":3,"file":"arcgis-webscene-loader.js","names":["parseWebscene","VERSION","ArcGISWebSceneLoader","name","id","module","version","mimeTypes","parse","extensions","options","data"],"sources":["../src/arcgis-webscene-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ArcGISWebSceneData} from './types';\n\nimport {parseWebscene} from './lib/parsers/parse-arcgis-webscene';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type ArcGISWebSceneLoaderOptions = LoaderOptions & {};\n\n/**\n * Loader for ArcGIS WebScene\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/\n */\nexport const ArcGISWebSceneLoader: LoaderWithParser<\n ArcGISWebSceneData,\n never,\n ArcGISWebSceneLoaderOptions\n> = {\n name: 'ArcGIS Web Scene Loader',\n id: 'arcgis-web-scene',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\n/**\n * Parse ArcGIS webscene\n * @param data\n */\nasync function parse(data: ArrayBuffer): Promise<ArcGISWebSceneData> {\n return parseWebscene(data);\n}\n"],"mappings":"SAGQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAQ3E,OAAO,MAAMC,oBAIZ,GAAG;EACFC,IAAI,EAAE,yBAAyB;EAC/BC,EAAE,EAAE,kBAAkB;EACtBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAMD,eAAeF,KAAKA,CAACG,IAAiB,EAA+B;EACnE,OAAOX,aAAa,CAACW,IAAI,CAAC;AAC5B"}
package/dist/dist.dev.js CHANGED
@@ -4269,6 +4269,7 @@ var __exports__ = (() => {
4269
4269
  I3SContentLoader: () => I3SContentLoader,
4270
4270
  I3SLoader: () => I3SLoader,
4271
4271
  I3SNodePageLoader: () => I3SNodePageLoader,
4272
+ LayerError: () => LayerError,
4272
4273
  SLPKLoader: () => SLPKLoader,
4273
4274
  customizeColors: () => customizeColors,
4274
4275
  loadFeatureAttributes: () => loadFeatureAttributes,
@@ -4335,7 +4336,7 @@ var __exports__ = (() => {
4335
4336
  console.warn("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
4336
4337
  globalThis._loadersgl_.version = NPM_TAG;
4337
4338
  } else {
4338
- globalThis._loadersgl_.version = "4.1.0-alpha.9";
4339
+ globalThis._loadersgl_.version = "4.1.1";
4339
4340
  }
4340
4341
  }
4341
4342
  return globalThis._loadersgl_.version;
@@ -4464,6 +4465,9 @@ var __exports__ = (() => {
4464
4465
  return true;
4465
4466
  }
4466
4467
  function concatenateArrayBuffers(...sources) {
4468
+ return concatenateArrayBuffersFromArray(sources);
4469
+ }
4470
+ function concatenateArrayBuffersFromArray(sources) {
4467
4471
  const sourceArrays = sources.map((source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2);
4468
4472
  const byteLength = sourceArrays.reduce((length4, typedArray) => length4 + typedArray.byteLength, 0);
4469
4473
  const result = new Uint8Array(byteLength);
@@ -9108,7 +9112,7 @@ var __exports__ = (() => {
9108
9112
  _defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
9109
9113
 
9110
9114
  // ../images/src/lib/utils/version.ts
9111
- var VERSION2 = true ? "4.1.0-alpha.9" : "latest";
9115
+ var VERSION2 = true ? "4.1.1" : "latest";
9112
9116
 
9113
9117
  // ../images/src/lib/category-api/image-type.ts
9114
9118
  var parseImageNode = globalThis.loaders?.parseImageNode;
@@ -9497,7 +9501,7 @@ var __exports__ = (() => {
9497
9501
  };
9498
9502
 
9499
9503
  // ../draco/src/lib/utils/version.ts
9500
- var VERSION3 = true ? "4.1.0-alpha.9" : "latest";
9504
+ var VERSION3 = true ? "4.1.1" : "latest";
9501
9505
 
9502
9506
  // ../draco/src/draco-loader.ts
9503
9507
  var DracoLoader = {
@@ -10072,7 +10076,7 @@ var __exports__ = (() => {
10072
10076
  }
10073
10077
 
10074
10078
  // ../textures/src/lib/utils/version.ts
10075
- var VERSION4 = true ? "4.1.0-alpha.9" : "latest";
10079
+ var VERSION4 = true ? "4.1.1" : "latest";
10076
10080
 
10077
10081
  // ../textures/src/lib/parsers/basis-module-loader.ts
10078
10082
  var BASIS_EXTERNAL_LIBRARIES = {
@@ -11476,7 +11480,7 @@ var __exports__ = (() => {
11476
11480
  }
11477
11481
 
11478
11482
  // src/i3s-content-loader.ts
11479
- var VERSION5 = true ? "4.1.0-alpha.9" : "latest";
11483
+ var VERSION5 = true ? "4.1.1" : "latest";
11480
11484
  var I3SContentLoader = {
11481
11485
  name: "I3S Content (Indexed Scene Layers)",
11482
11486
  id: "i3s-content",
@@ -11986,7 +11990,7 @@ var __exports__ = (() => {
11986
11990
  var import_core16 = __toESM(require_core(), 1);
11987
11991
 
11988
11992
  // src/i3s-node-page-loader.ts
11989
- var VERSION6 = true ? "4.1.0-alpha.9" : "latest";
11993
+ var VERSION6 = true ? "4.1.1" : "latest";
11990
11994
  var I3SNodePageLoader = {
11991
11995
  name: "I3S Node Page",
11992
11996
  id: "i3s-node-page",
@@ -12276,7 +12280,7 @@ var __exports__ = (() => {
12276
12280
  }
12277
12281
 
12278
12282
  // src/i3s-loader.ts
12279
- var VERSION7 = true ? "4.1.0-alpha.9" : "latest";
12283
+ var VERSION7 = true ? "4.1.1" : "latest";
12280
12284
  var TILESET_REGEX = /layers\/[0-9]+$/;
12281
12285
  var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
12282
12286
  var SLPK_HEX = "504b0304";
@@ -12410,6 +12414,97 @@ var __exports__ = (() => {
12410
12414
  }
12411
12415
  };
12412
12416
  };
12417
+ var EOCD_FIELDS = [{
12418
+ offset: 0,
12419
+ size: 4,
12420
+ default: new DataView(eoCDSignature.buffer).getUint32(0, true)
12421
+ }, {
12422
+ offset: 4,
12423
+ size: 2,
12424
+ default: 0
12425
+ }, {
12426
+ offset: 6,
12427
+ size: 2,
12428
+ default: 0
12429
+ }, {
12430
+ offset: 8,
12431
+ size: 2,
12432
+ name: "recordsNumber"
12433
+ }, {
12434
+ offset: 10,
12435
+ size: 2,
12436
+ name: "recordsNumber"
12437
+ }, {
12438
+ offset: 12,
12439
+ size: 4,
12440
+ name: "cdSize"
12441
+ }, {
12442
+ offset: 16,
12443
+ size: 4,
12444
+ name: "cdOffset"
12445
+ }, {
12446
+ offset: 20,
12447
+ size: 2,
12448
+ default: 0
12449
+ }];
12450
+ var ZIP64_EOCD_LOCATOR_FIELDS = [{
12451
+ offset: 0,
12452
+ size: 4,
12453
+ default: new DataView(zip64EoCDLocatorSignature.buffer).getUint32(0, true)
12454
+ }, {
12455
+ offset: 4,
12456
+ size: 4,
12457
+ default: 0
12458
+ }, {
12459
+ offset: 8,
12460
+ size: 8,
12461
+ name: "eoCDStart"
12462
+ }, {
12463
+ offset: 16,
12464
+ size: 4,
12465
+ default: 1
12466
+ }];
12467
+ var ZIP64_EOCD_FIELDS = [{
12468
+ offset: 0,
12469
+ size: 4,
12470
+ default: new DataView(zip64EoCDSignature.buffer).getUint32(0, true)
12471
+ }, {
12472
+ offset: 4,
12473
+ size: 8,
12474
+ default: 44
12475
+ }, {
12476
+ offset: 12,
12477
+ size: 2,
12478
+ default: 45
12479
+ }, {
12480
+ offset: 14,
12481
+ size: 2,
12482
+ default: 45
12483
+ }, {
12484
+ offset: 16,
12485
+ size: 4,
12486
+ default: 0
12487
+ }, {
12488
+ offset: 20,
12489
+ size: 4,
12490
+ default: 0
12491
+ }, {
12492
+ offset: 24,
12493
+ size: 8,
12494
+ name: "recordsNumber"
12495
+ }, {
12496
+ offset: 32,
12497
+ size: 8,
12498
+ name: "recordsNumber"
12499
+ }, {
12500
+ offset: 40,
12501
+ size: 8,
12502
+ name: "cdSize"
12503
+ }, {
12504
+ offset: 48,
12505
+ size: 8,
12506
+ name: "cdOffset"
12507
+ }];
12413
12508
 
12414
12509
  // ../zip/src/parse-zip/cd-file-header.ts
12415
12510
  var CD_COMPRESSED_SIZE_OFFSET = 20n;
@@ -13202,6 +13297,9 @@ var __exports__ = (() => {
13202
13297
  }
13203
13298
  async function makeHashTableFromZipHeaders(fileProvider) {
13204
13299
  const zipCDIterator = makeZipCDHeaderIterator(fileProvider);
13300
+ return getHashTable(zipCDIterator);
13301
+ }
13302
+ async function getHashTable(zipCDIterator) {
13205
13303
  const md5Hash = new MD5Hash();
13206
13304
  const textEncoder = new TextEncoder();
13207
13305
  const hashTable = {};
@@ -13492,7 +13590,7 @@ var __exports__ = (() => {
13492
13590
  }
13493
13591
 
13494
13592
  // src/i3s-slpk-loader.ts
13495
- var VERSION8 = true ? "4.1.0-alpha.9" : "latest";
13593
+ var VERSION8 = true ? "4.1.1" : "latest";
13496
13594
  var SLPKLoader = {
13497
13595
  name: "I3S SLPK (Scene Layer Package)",
13498
13596
  id: "slpk",
@@ -13571,7 +13669,7 @@ var __exports__ = (() => {
13571
13669
  }
13572
13670
 
13573
13671
  // src/i3s-attribute-loader.ts
13574
- var VERSION9 = true ? "4.1.0-alpha.9" : "latest";
13672
+ var VERSION9 = true ? "4.1.1" : "latest";
13575
13673
  var EMPTY_VALUE = "";
13576
13674
  var REJECTED_STATUS = "rejected";
13577
13675
  var I3SAttributeLoader = {
@@ -13724,7 +13822,7 @@ var __exports__ = (() => {
13724
13822
  }
13725
13823
 
13726
13824
  // src/i3s-building-scene-layer-loader.ts
13727
- var VERSION10 = true ? "4.1.0-alpha.9" : "latest";
13825
+ var VERSION10 = true ? "4.1.1" : "latest";
13728
13826
  var I3SBuildingSceneLayerLoader = {
13729
13827
  name: "I3S Building Scene Layer",
13730
13828
  id: "i3s-building-scene-layer",
@@ -13752,6 +13850,13 @@ var __exports__ = (() => {
13752
13850
  var SUPPORTED_LAYERS_TYPES = [ARCGIS_SCENE_SERVER_LAYER_TYPE, INTEGRATED_MESH_LAYER, BUILDING_SCENE_LAYER, GROUP_LAYER];
13753
13851
  var NO_AVAILABLE_SUPPORTED_LAYERS_ERROR = "NO_AVAILABLE_SUPPORTED_LAYERS_ERROR";
13754
13852
  var NOT_SUPPORTED_CRS_ERROR = "NOT_SUPPORTED_CRS_ERROR";
13853
+ var LayerError = class extends Error {
13854
+ constructor(message, details) {
13855
+ super(message);
13856
+ this.details = details;
13857
+ this.name = "LayerError";
13858
+ }
13859
+ };
13755
13860
  async function parseWebscene(data) {
13756
13861
  const layer0 = JSON.parse(new TextDecoder().decode(data));
13757
13862
  const {
@@ -13762,7 +13867,7 @@ var __exports__ = (() => {
13762
13867
  unsupportedLayers
13763
13868
  } = await parseOperationalLayers(operationalLayers, true);
13764
13869
  if (!layers.length) {
13765
- throw new Error(NO_AVAILABLE_SUPPORTED_LAYERS_ERROR);
13870
+ throw new LayerError(NO_AVAILABLE_SUPPORTED_LAYERS_ERROR, unsupportedLayers);
13766
13871
  }
13767
13872
  return {
13768
13873
  header: layer0,
@@ -13812,7 +13917,7 @@ var __exports__ = (() => {
13812
13917
  }
13813
13918
 
13814
13919
  // src/arcgis-webscene-loader.ts
13815
- var VERSION11 = true ? "4.1.0-alpha.9" : "latest";
13920
+ var VERSION11 = true ? "4.1.1" : "latest";
13816
13921
  var ArcGISWebSceneLoader = {
13817
13922
  name: "ArcGIS Web Scene Loader",
13818
13923
  id: "arcgis-web-scene",
@@ -1,7 +1,7 @@
1
1
  import { load } from '@loaders.gl/core';
2
2
  import { parseI3STileAttribute } from "./lib/parsers/parse-i3s-attribute.js";
3
3
  import { getUrlWithToken } from "./lib/utils/url-utils.js";
4
- const VERSION = typeof "4.1.0-alpha.9" !== 'undefined' ? "4.1.0-alpha.9" : 'latest';
4
+ const VERSION = typeof "4.1.1" !== 'undefined' ? "4.1.1" : 'latest';
5
5
  const EMPTY_VALUE = '';
6
6
  const REJECTED_STATUS = 'rejected';
7
7
  export const I3SAttributeLoader = {
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-attribute-loader.js","names":["load","parseI3STileAttribute","getUrlWithToken","VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","arrayBuffer","options","extensions","binary","loadFeatureAttributes","tile","featureId","arguments","length","undefined","attributeStorageInfo","attributeUrls","tilesetFields","getAttributesData","attributes","attributeLoadPromises","index","_options$i3s","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","generateAttributesByFeatureId","_tile$tileset","_tile$tileset$tileset","_tile$header","_tile$tileset2","_tile$tileset2$tilese","tileset","header","fields","attribute","hasOwnProperty","attributeValues","valueType","getFeatureIdsAttributeName","objectIdsAttribute","find","includes","objectIdsAttributeName","objectIds","value","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","codedValues","getAttributeCodedValues","getAttributeByIndexAndAttributeName","formatAttributeValue","_attributeField$domai","attributeField","field","alias","domain","attributesName","attributeObject","status","String","replace","trim","codeValue","codedValue","code","Number"],"sources":["../src/i3s-attribute-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {I3STileAttributes} from './lib/parsers/parse-i3s-attribute';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, I3SLoaderOptions> = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse: async (arrayBuffer: ArrayBuffer, options?: LoaderOptions) => parseI3STileAttribute(arrayBuffer, options),\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\n\n// TODO - these seem to use the loader rather than being part of the loader. Move to different file...\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || featureId < 0) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nexport function getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\n return value;\n}\n"],"mappings":"AACA,SAAQA,IAAI,QAAO,kBAAkB;AAAC,SAG9BC,qBAAqB;AAAA,SACrBC,eAAe;AAIvB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAC3E,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,UAAU;AAKlC,OAAO,MAAMC,kBAAgF,GAAG;EAC9FC,IAAI,EAAE,eA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,EAAE;IACtB,MAAM8D,SAAS,GAAGf,WAAW,CAACV,IAAI,CAAC0B,UAAU,IAAIA,UAAU,CAACC,IAAI,KAAKC,MAAM,CAACxB,KAAK,CAAC,CAAC;IACnFA,KAAK,GAAG,CAAAqB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAE5E,IAAI,KAAIH,WAAW;EACxC;EAEA,OAAO0D,KAAK;AACd"}
1
+ {"version":3,"file":"i3s-attribute-loader.js","names":["load","parseI3STileAttribute","getUrlWithToken","VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","arrayBuffer","options","extensions","binary","loadFeatureAttributes","tile","featureId","arguments","length","undefined","attributeStorageInfo","attributeUrls","tilesetFields","getAttributesData","attributes","attributeLoadPromises","index","_options$i3s","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","generateAttributesByFeatureId","_tile$tileset","_tile$tileset$tileset","_tile$header","_tile$tileset2","_tile$tileset2$tilese","tileset","header","fields","attribute","hasOwnProperty","attributeValues","valueType","getFeatureIdsAttributeName","objectIdsAttribute","find","includes","objectIdsAttributeName","objectIds","value","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","codedValues","getAttributeCodedValues","getAttributeByIndexAndAttributeName","formatAttributeValue","_attributeField$domai","attributeField","field","alias","domain","attributesName","attributeObject","status","String","replace","trim","codeValue","codedValue","code","Number"],"sources":["../src/i3s-attribute-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {I3STileAttributes} from './lib/parsers/parse-i3s-attribute';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, I3SLoaderOptions> = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse: async (arrayBuffer: ArrayBuffer, options?: LoaderOptions) => parseI3STileAttribute(arrayBuffer, options),\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\n\n// TODO - these seem to use the loader rather than being part of the loader. Move to different file...\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || featureId < 0) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nexport function getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\n return value;\n}\n"],"mappings":"AACA,SAAQA,IAAI,QAAO,kBAAkB;AAAC,SAG9BC,qBAAqB;AAAA,SACrBC,eAAe;AAIvB,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAC3E,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,UAAU;AAKlC,OAAO,MAAMC,kBAAgF,GAAG;EAC9FC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEP,OAAO;EAChBQ,SAAS,EAAE,CAAC,oBAAoB,CAAC;EACjCC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAAuB,KAAKb,qBAAqB,CAACY,WAAW,EAAEC,OAAO,CAAC;EAC/GC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBD,OAAO,EAAE,CAAC,CA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neLayer } from "./lib/parsers/parse-i3s-building-scene-layer.js";
2
- const VERSION = typeof "4.1.0-alpha.9" !== 'undefined' ? "4.1.0-alpha.9" : 'latest';
2
+ const VERSION = typeof "4.1.1" !== 'undefined' ? "4.1.1" : 'latest';
3
3
  export const I3SBuildingSceneLayerLoader = {
4
4
  name: 'I3S Building Scene Layer',
5
5
  id: 'i3s-building-scene-layer',
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-building-scene-layer-loader.js","names":["parseBuildingSceneLayer","VERSION","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","context","url","Error"],"sources":["../src/i3s-building-scene-layer-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {BuildingSceneLayerTileset} from './types';\n\nimport {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-layer';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser<\n BuildingSceneLayerTileset,\n never,\n I3SLoaderOptions\n> = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"mappings":"SAIQA,uBAAuB;AAK/B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAI3E,OAAO,MAAMC,2BAIZ,GAAG;EACFC,IAAI,EAAE,0BAA0B;EAChCC,EAAE,EAAE,0BAA0B;EAC9BC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,eAAeF,KAAKA,CAClBG,IAAiB,EACjBD,OAAuB,EACvBE,OAAuB,EACa;EACpC,IAAI,EAACA,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,GAAG,GAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;EACxC;EAEA,OAAOd,uBAAuB,CAACW,IAAI,EAAEC,OAAO,CAACC,GAAG,CAAC;AACnD"}
1
+ {"version":3,"file":"i3s-building-scene-layer-loader.js","names":["parseBuildingSceneLayer","VERSION","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","context","url","Error"],"sources":["../src/i3s-building-scene-layer-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {BuildingSceneLayerTileset} from './types';\n\nimport {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-layer';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser<\n BuildingSceneLayerTileset,\n never,\n I3SLoaderOptions\n> = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"mappings":"SAIQA,uBAAuB;AAK/B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAI3E,OAAO,MAAMC,2BAIZ,GAAG;EACFC,IAAI,EAAE,0BAA0B;EAChCC,EAAE,EAAE,0BAA0B;EAC9BC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,eAAeF,KAAKA,CAClBG,IAAiB,EACjBD,OAAuB,EACvBE,OAAuB,EACa;EACpC,IAAI,EAACA,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,GAAG,GAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;EACxC;EAEA,OAAOd,uBAAuB,CAACW,IAAI,EAAEC,OAAO,CAACC,GAAG,CAAC;AACnD"}
@@ -1,5 +1,5 @@
1
1
  import { parseI3STileContent } from "./lib/parsers/parse-i3s-tile-content.js";
2
- const VERSION = typeof "4.1.0-alpha.9" !== 'undefined' ? "4.1.0-alpha.9" : 'latest';
2
+ const VERSION = typeof "4.1.1" !== 'undefined' ? "4.1.1" : 'latest';
3
3
  export const I3SContentLoader = {
4
4
  name: 'I3S Content (Indexed Scene Layers)',
5
5
  id: 'i3s-content',
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-content-loader.js","names":["parseI3STileContent","VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","tile","_tileOptions","tileset","_tilesetOptions","i3s","tileOptions","tilesetOptions"],"sources":["../src/i3s-content-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\nimport {I3STileContent, I3STileOptions, I3STilesetOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser<I3STileContent | null, never, I3SLoaderOptions> = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {\n const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};\n const tileOptions = _tileOptions || tile;\n const tilesetOptions = _tilesetOptions || tileset;\n if (!tileOptions || !tilesetOptions) {\n return null;\n }\n return await parseI3STileContent(\n data,\n tileOptions as I3STileOptions,\n tilesetOptions as I3STilesetOptions,\n options,\n context\n );\n}\n"],"mappings":"SAEQA,mBAAmB;AAM3B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAK3E,OAAO,MAAMC,gBAAkF,GAAG;EAChGC,IAAI,EAAE,oCAAoC;EAC1CC,EAAE,EAAE,aAAa;EACjBC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK;EACLC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACP,aAAa,EAAE,CAAC;EAClB;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,IAAI,EAAED,OAA0B,EAAEE,OAAuB,EAAE;EAC9E,MAAM;IAACC,IAAI;IAAEC,YAAY;IAAEC,OAAO;IAAEC;EAAe,CAAC,GAAG,CAAAN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,GAAG,KAAI,CAAC,CAAC;EACzE,MAAMC,WAAW,GAAGJ,YAAY,IAAID,IAAI;EACxC,MAAMM,cAAc,GAAGH,eAAe,IAAID,OAAO;EACjD,IAAI,CAACG,WAAW,IAAI,CAACC,cAAc,EAAE;IACnC,OAAO,IAAI;EACb;EACA,OAAO,MAAMpB,mBAAmB,CAC9BY,IAAI,EACJO,WAAW,EACXC,cAAc,EACdT,OAAO,EACPE,OACF,CAAC;AACH"}
1
+ {"version":3,"file":"i3s-content-loader.js","names":["parseI3STileContent","VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","tile","_tileOptions","tileset","_tilesetOptions","i3s","tileOptions","tilesetOptions"],"sources":["../src/i3s-content-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\nimport {I3STileContent, I3STileOptions, I3STilesetOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser<I3STileContent | null, never, I3SLoaderOptions> = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {\n const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};\n const tileOptions = _tileOptions || tile;\n const tilesetOptions = _tilesetOptions || tileset;\n if (!tileOptions || !tilesetOptions) {\n return null;\n }\n return await parseI3STileContent(\n data,\n tileOptions as I3STileOptions,\n tilesetOptions as I3STilesetOptions,\n options,\n context\n );\n}\n"],"mappings":"SAEQA,mBAAmB;AAM3B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAK3E,OAAO,MAAMC,gBAAkF,GAAG;EAChGC,IAAI,EAAE,oCAAoC;EAC1CC,EAAE,EAAE,aAAa;EACjBC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK;EACLC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACP,aAAa,EAAE,CAAC;EAClB;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,IAAI,EAAED,OAA0B,EAAEE,OAAuB,EAAE;EAC9E,MAAM;IAACC,IAAI;IAAEC,YAAY;IAAEC,OAAO;IAAEC;EAAe,CAAC,GAAG,CAAAN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,GAAG,KAAI,CAAC,CAAC;EACzE,MAAMC,WAAW,GAAGJ,YAAY,IAAID,IAAI;EACxC,MAAMM,cAAc,GAAGH,eAAe,IAAID,OAAO;EACjD,IAAI,CAACG,WAAW,IAAI,CAACC,cAAc,EAAE;IACnC,OAAO,IAAI;EACb;EACA,OAAO,MAAMpB,mBAAmB,CAC9BY,IAAI,EACJO,WAAW,EACXC,cAAc,EACdT,OAAO,EACPE,OACF,CAAC;AACH"}