@loaders.gl/tile-converter 4.0.0-alpha.22 → 4.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/constants.d.ts +0 -2
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +1 -3
  4. package/dist/converter.min.js +106 -106
  5. package/dist/dist.min.js +1744 -1157
  6. package/dist/es5/constants.js +1 -5
  7. package/dist/es5/constants.js.map +1 -1
  8. package/dist/es5/deps-installer/deps-installer.js +1 -1
  9. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +26 -11
  10. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  11. package/dist/es5/i3s-converter/helpers/feature-attributes.js +14 -12
  12. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
  13. package/dist/es5/i3s-converter/helpers/geometry-converter.js +61 -10
  14. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  15. package/dist/es5/i3s-converter/helpers/node-index-document.js +3 -2
  16. package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -1
  17. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +1 -2
  18. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  19. package/dist/es5/i3s-converter/i3s-converter.js +36 -26
  20. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  21. package/dist/es5/i3s-server/controllers/slpk-controller.js +2 -2
  22. package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
  23. package/dist/es5/pgm-loader.js +1 -1
  24. package/dist/es5/slpk-extractor/slpk-extractor.js +1 -1
  25. package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -1
  26. package/dist/esm/constants.js +0 -2
  27. package/dist/esm/constants.js.map +1 -1
  28. package/dist/esm/deps-installer/deps-installer.js +1 -1
  29. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +21 -6
  30. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  31. package/dist/esm/i3s-converter/helpers/feature-attributes.js +6 -4
  32. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
  33. package/dist/esm/i3s-converter/helpers/geometry-converter.js +59 -8
  34. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  35. package/dist/esm/i3s-converter/helpers/node-index-document.js +2 -1
  36. package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -1
  37. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +1 -1
  38. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  39. package/dist/esm/i3s-converter/i3s-converter.js +20 -17
  40. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  41. package/dist/esm/i3s-server/bin/i3s-server.min.js +71 -71
  42. package/dist/esm/i3s-server/controllers/slpk-controller.js +1 -1
  43. package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
  44. package/dist/esm/pgm-loader.js +1 -1
  45. package/dist/esm/slpk-extractor/slpk-extractor.js +2 -1
  46. package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -1
  47. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  48. package/dist/i3s-converter/helpers/batch-ids-extensions.js +37 -16
  49. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
  50. package/dist/i3s-converter/helpers/feature-attributes.js +6 -4
  51. package/dist/i3s-converter/helpers/geometry-converter.d.ts +2 -2
  52. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  53. package/dist/i3s-converter/helpers/geometry-converter.js +93 -12
  54. package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -1
  55. package/dist/i3s-converter/helpers/node-index-document.js +4 -1
  56. package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +2 -2
  57. package/dist/i3s-converter/i3s-converter.d.ts +1 -1
  58. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  59. package/dist/i3s-converter/i3s-converter.js +32 -13
  60. package/dist/i3s-server/controllers/slpk-controller.js +2 -2
  61. package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -1
  62. package/dist/slpk-extractor/slpk-extractor.js +2 -1
  63. package/dist/slpk-extractor.min.js +38 -38
  64. package/package.json +14 -14
  65. package/src/constants.ts +0 -3
  66. package/src/i3s-converter/helpers/batch-ids-extensions.ts +53 -14
  67. package/src/i3s-converter/helpers/feature-attributes.ts +8 -6
  68. package/src/i3s-converter/helpers/geometry-converter.ts +135 -12
  69. package/src/i3s-converter/helpers/node-index-document.ts +5 -1
  70. package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +1 -1
  71. package/src/i3s-converter/i3s-converter.ts +42 -17
  72. package/src/i3s-server/controllers/slpk-controller.ts +1 -1
  73. package/src/slpk-extractor/slpk-extractor.ts +2 -1
package/dist/dist.min.js CHANGED
@@ -10,8 +10,8 @@ var __commonJS = (cb, mod) => function __require() {
10
10
  };
11
11
  var __export = (target, all) => {
12
12
  __markAsModule(target);
13
- for (var name10 in all)
14
- __defProp(target, name10, { get: all[name10], enumerable: true });
13
+ for (var name12 in all)
14
+ __defProp(target, name12, { get: all[name12], enumerable: true });
15
15
  };
16
16
  var __reExport = (target, module2, desc) => {
17
17
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
@@ -13302,7 +13302,7 @@ var require_utils = __commonJS({
13302
13302
  }
13303
13303
  return result;
13304
13304
  };
13305
- exports.prepareContent = function(name10, inputData, isBinary, isOptimizedBinaryString, isBase64) {
13305
+ exports.prepareContent = function(name12, inputData, isBinary, isOptimizedBinaryString, isBase64) {
13306
13306
  var promise = external.Promise.resolve(inputData).then(function(data) {
13307
13307
  var isBlob2 = support.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1);
13308
13308
  if (isBlob2 && typeof FileReader !== "undefined") {
@@ -13323,7 +13323,7 @@ var require_utils = __commonJS({
13323
13323
  return promise.then(function(data) {
13324
13324
  var dataType = exports.getTypeOf(data);
13325
13325
  if (!dataType) {
13326
- return external.Promise.reject(new Error("Can't read the data of '" + name10 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
13326
+ return external.Promise.reject(new Error("Can't read the data of '" + name12 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
13327
13327
  }
13328
13328
  if (dataType === "arraybuffer") {
13329
13329
  data = exports.transformTo("uint8array", data);
@@ -13346,8 +13346,8 @@ var require_utils = __commonJS({
13346
13346
  var require_GenericWorker = __commonJS({
13347
13347
  "../../node_modules/jszip/lib/stream/GenericWorker.js"(exports, module2) {
13348
13348
  "use strict";
13349
- function GenericWorker(name10) {
13350
- this.name = name10 || "default";
13349
+ function GenericWorker(name12) {
13350
+ this.name = name12 || "default";
13351
13351
  this.streamInfo = {};
13352
13352
  this.generatedError = null;
13353
13353
  this.extraStreamInfo = {};
@@ -13395,18 +13395,18 @@ var require_GenericWorker = __commonJS({
13395
13395
  }
13396
13396
  return true;
13397
13397
  },
13398
- on: function(name10, listener) {
13399
- this._listeners[name10].push(listener);
13398
+ on: function(name12, listener) {
13399
+ this._listeners[name12].push(listener);
13400
13400
  return this;
13401
13401
  },
13402
13402
  cleanUp: function() {
13403
13403
  this.streamInfo = this.generatedError = this.extraStreamInfo = null;
13404
13404
  this._listeners = [];
13405
13405
  },
13406
- emit: function(name10, arg) {
13407
- if (this._listeners[name10]) {
13408
- for (var i = 0; i < this._listeners[name10].length; i++) {
13409
- this._listeners[name10][i].call(this, arg);
13406
+ emit: function(name12, arg) {
13407
+ if (this._listeners[name12]) {
13408
+ for (var i = 0; i < this._listeners[name12].length; i++) {
13409
+ this._listeners[name12][i].call(this, arg);
13410
13410
  }
13411
13411
  }
13412
13412
  },
@@ -14115,8 +14115,8 @@ var require_zipObject = __commonJS({
14115
14115
  var utf8 = require_utf8();
14116
14116
  var CompressedObject = require_compressedObject();
14117
14117
  var GenericWorker = require_GenericWorker();
14118
- var ZipObject = function(name10, data, options) {
14119
- this.name = name10;
14118
+ var ZipObject = function(name12, data, options) {
14119
+ this.name = name12;
14120
14120
  this.dir = options.dir;
14121
14121
  this.date = options.date;
14122
14122
  this.comment = options.comment;
@@ -18748,7 +18748,7 @@ var require_object = __commonJS({
18748
18748
  var generate = require_generate();
18749
18749
  var nodejsUtils = require_nodejsUtils();
18750
18750
  var NodejsStreamInputAdapter = require_NodejsStreamInputAdapter();
18751
- var fileAdd = function(name10, data, originalOptions) {
18751
+ var fileAdd = function(name12, data, originalOptions) {
18752
18752
  var dataType = utils.getTypeOf(data), parent;
18753
18753
  var o = utils.extend(originalOptions || {}, defaults);
18754
18754
  o.date = o.date || new Date();
@@ -18765,9 +18765,9 @@ var require_object = __commonJS({
18765
18765
  o.dir = true;
18766
18766
  }
18767
18767
  if (o.dir) {
18768
- name10 = forceTrailingSlash(name10);
18768
+ name12 = forceTrailingSlash(name12);
18769
18769
  }
18770
- if (o.createFolders && (parent = parentFolder(name10))) {
18770
+ if (o.createFolders && (parent = parentFolder(name12))) {
18771
18771
  folderAdd.call(this, parent, true);
18772
18772
  }
18773
18773
  var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false;
@@ -18786,12 +18786,12 @@ var require_object = __commonJS({
18786
18786
  if (data instanceof CompressedObject || data instanceof GenericWorker) {
18787
18787
  zipObjectContent = data;
18788
18788
  } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
18789
- zipObjectContent = new NodejsStreamInputAdapter(name10, data);
18789
+ zipObjectContent = new NodejsStreamInputAdapter(name12, data);
18790
18790
  } else {
18791
- zipObjectContent = utils.prepareContent(name10, data, o.binary, o.optimizedBinaryString, o.base64);
18791
+ zipObjectContent = utils.prepareContent(name12, data, o.binary, o.optimizedBinaryString, o.base64);
18792
18792
  }
18793
- var object = new ZipObject(name10, zipObjectContent, o);
18794
- this.files[name10] = object;
18793
+ var object = new ZipObject(name12, zipObjectContent, o);
18794
+ this.files[name12] = object;
18795
18795
  };
18796
18796
  var parentFolder = function(path2) {
18797
18797
  if (path2.slice(-1) === "/") {
@@ -18806,16 +18806,16 @@ var require_object = __commonJS({
18806
18806
  }
18807
18807
  return path2;
18808
18808
  };
18809
- var folderAdd = function(name10, createFolders) {
18809
+ var folderAdd = function(name12, createFolders) {
18810
18810
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
18811
- name10 = forceTrailingSlash(name10);
18812
- if (!this.files[name10]) {
18813
- fileAdd.call(this, name10, null, {
18811
+ name12 = forceTrailingSlash(name12);
18812
+ if (!this.files[name12]) {
18813
+ fileAdd.call(this, name12, null, {
18814
18814
  dir: true,
18815
18815
  createFolders
18816
18816
  });
18817
18817
  }
18818
- return this.files[name10];
18818
+ return this.files[name12];
18819
18819
  };
18820
18820
  function isRegExp(object) {
18821
18821
  return Object.prototype.toString.call(object) === "[object RegExp]";
@@ -18843,15 +18843,15 @@ var require_object = __commonJS({
18843
18843
  });
18844
18844
  return result;
18845
18845
  },
18846
- file: function(name10, data, o) {
18846
+ file: function(name12, data, o) {
18847
18847
  if (arguments.length === 1) {
18848
- if (isRegExp(name10)) {
18849
- var regexp = name10;
18848
+ if (isRegExp(name12)) {
18849
+ var regexp = name12;
18850
18850
  return this.filter(function(relativePath, file) {
18851
18851
  return !file.dir && regexp.test(relativePath);
18852
18852
  });
18853
18853
  } else {
18854
- var obj = this.files[this.root + name10];
18854
+ var obj = this.files[this.root + name12];
18855
18855
  if (obj && !obj.dir) {
18856
18856
  return obj;
18857
18857
  } else {
@@ -18859,8 +18859,8 @@ var require_object = __commonJS({
18859
18859
  }
18860
18860
  }
18861
18861
  } else {
18862
- name10 = this.root + name10;
18863
- fileAdd.call(this, name10, data, o);
18862
+ name12 = this.root + name12;
18863
+ fileAdd.call(this, name12, data, o);
18864
18864
  }
18865
18865
  return this;
18866
18866
  },
@@ -18873,26 +18873,26 @@ var require_object = __commonJS({
18873
18873
  return file.dir && arg.test(relativePath);
18874
18874
  });
18875
18875
  }
18876
- var name10 = this.root + arg;
18877
- var newFolder = folderAdd.call(this, name10);
18876
+ var name12 = this.root + arg;
18877
+ var newFolder = folderAdd.call(this, name12);
18878
18878
  var ret = this.clone();
18879
18879
  ret.root = newFolder.name;
18880
18880
  return ret;
18881
18881
  },
18882
- remove: function(name10) {
18883
- name10 = this.root + name10;
18884
- var file = this.files[name10];
18882
+ remove: function(name12) {
18883
+ name12 = this.root + name12;
18884
+ var file = this.files[name12];
18885
18885
  if (!file) {
18886
- if (name10.slice(-1) !== "/") {
18887
- name10 += "/";
18886
+ if (name12.slice(-1) !== "/") {
18887
+ name12 += "/";
18888
18888
  }
18889
- file = this.files[name10];
18889
+ file = this.files[name12];
18890
18890
  }
18891
18891
  if (file && !file.dir) {
18892
- delete this.files[name10];
18892
+ delete this.files[name12];
18893
18893
  } else {
18894
18894
  var kids = this.filter(function(relativePath, file2) {
18895
- return file2.name.slice(0, name10.length) === name10;
18895
+ return file2.name.slice(0, name12.length) === name12;
18896
18896
  });
18897
18897
  for (var i = 0; i < kids.length; i++) {
18898
18898
  delete this.files[kids[i].name];
@@ -20074,7 +20074,7 @@ var require_v35 = __commonJS({
20074
20074
  exports.DNS = DNS;
20075
20075
  var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
20076
20076
  exports.URL = URL2;
20077
- function v35(name10, version2, hashfunc) {
20077
+ function v35(name12, version2, hashfunc) {
20078
20078
  function generateUUID(value, namespace, buf, offset) {
20079
20079
  var _namespace;
20080
20080
  if (typeof value === "string") {
@@ -20102,7 +20102,7 @@ var require_v35 = __commonJS({
20102
20102
  return (0, _stringify.unsafeStringify)(bytes);
20103
20103
  }
20104
20104
  try {
20105
- generateUUID.name = name10;
20105
+ generateUUID.name = name12;
20106
20106
  } catch (err) {
20107
20107
  }
20108
20108
  generateUUID.DNS = DNS;
@@ -21297,12 +21297,12 @@ var require_readdir_glob = __commonJS({
21297
21297
  async function* exploreWalkAsync(dir, path2, followSymlinks, useStat, shouldSkip, strict) {
21298
21298
  let files = await readdir2(path2 + dir, strict);
21299
21299
  for (const file of files) {
21300
- let name10 = file.name;
21301
- if (name10 === void 0) {
21302
- name10 = file;
21300
+ let name12 = file.name;
21301
+ if (name12 === void 0) {
21302
+ name12 = file;
21303
21303
  useStat = true;
21304
21304
  }
21305
- const filename2 = dir + "/" + name10;
21305
+ const filename2 = dir + "/" + name12;
21306
21306
  const relative = filename2.slice(1);
21307
21307
  const absolute = path2 + "/" + relative;
21308
21308
  let stats = null;
@@ -22013,7 +22013,7 @@ var require_async = __commonJS({
22013
22013
  newTasks[key] = params.concat(newTask);
22014
22014
  }
22015
22015
  function newTask(results, taskCb) {
22016
- var newArgs = params.map((name10) => results[name10]);
22016
+ var newArgs = params.map((name12) => results[name12]);
22017
22017
  newArgs.push(taskCb);
22018
22018
  wrapAsync(taskFn)(...newArgs);
22019
22019
  }
@@ -22209,18 +22209,18 @@ var require_async = __commonJS({
22209
22209
  }
22210
22210
  return false;
22211
22211
  }
22212
- const eventMethod = (name10) => (handler) => {
22212
+ const eventMethod = (name12) => (handler) => {
22213
22213
  if (!handler) {
22214
22214
  return new Promise((resolve2, reject2) => {
22215
- once2(name10, (err, data) => {
22215
+ once2(name12, (err, data) => {
22216
22216
  if (err)
22217
22217
  return reject2(err);
22218
22218
  resolve2(data);
22219
22219
  });
22220
22220
  });
22221
22221
  }
22222
- off(name10);
22223
- on(name10, handler);
22222
+ off(name12);
22223
+ on(name12, handler);
22224
22224
  };
22225
22225
  var isProcessing = false;
22226
22226
  var q = {
@@ -22463,15 +22463,15 @@ var require_async = __commonJS({
22463
22463
  return _createTester((bool) => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback);
22464
22464
  }
22465
22465
  var detectSeries$1 = awaitify(detectSeries, 3);
22466
- function consoleFunc(name10) {
22466
+ function consoleFunc(name12) {
22467
22467
  return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {
22468
22468
  if (typeof console === "object") {
22469
22469
  if (err) {
22470
22470
  if (console.error) {
22471
22471
  console.error(err);
22472
22472
  }
22473
- } else if (console[name10]) {
22474
- resultArgs.forEach((x) => console[name10](x));
22473
+ } else if (console[name12]) {
22474
+ resultArgs.forEach((x) => console[name12](x));
22475
22475
  }
22476
22476
  }
22477
22477
  });
@@ -23031,8 +23031,8 @@ var require_async = __commonJS({
23031
23031
  var timedOut = false;
23032
23032
  var timer;
23033
23033
  function timeoutCallback() {
23034
- var name10 = asyncFn.name || "anonymous";
23035
- var error = new Error('Callback function "' + name10 + '" timed out.');
23034
+ var name12 = asyncFn.name || "anonymous";
23035
+ var error = new Error('Callback function "' + name12 + '" timed out.');
23036
23036
  error.code = "ETIMEDOUT";
23037
23037
  if (info) {
23038
23038
  error.info = info;
@@ -27000,8 +27000,8 @@ var require_once = __commonJS({
27000
27000
  f.called = true;
27001
27001
  return f.value = fn.apply(this, arguments);
27002
27002
  };
27003
- var name10 = fn.name || "Function wrapped with `once`";
27004
- f.onceError = name10 + " shouldn't be called more than once";
27003
+ var name12 = fn.name || "Function wrapped with `once`";
27004
+ f.onceError = name12 + " shouldn't be called more than once";
27005
27005
  f.called = false;
27006
27006
  return f;
27007
27007
  }
@@ -28329,10 +28329,10 @@ var require_errors = __commonJS({
28329
28329
  return str.indexOf(search, start) !== -1;
28330
28330
  }
28331
28331
  }
28332
- createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
28333
- return 'The value "' + value + '" is invalid for option "' + name10 + '"';
28332
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
28333
+ return 'The value "' + value + '" is invalid for option "' + name12 + '"';
28334
28334
  }, TypeError);
28335
- createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
28335
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
28336
28336
  let determiner;
28337
28337
  if (typeof expected === "string" && startsWith(expected, "not ")) {
28338
28338
  determiner = "must not be";
@@ -28341,22 +28341,22 @@ var require_errors = __commonJS({
28341
28341
  determiner = "must be";
28342
28342
  }
28343
28343
  let msg;
28344
- if (endsWith(name10, " argument")) {
28345
- msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
28344
+ if (endsWith(name12, " argument")) {
28345
+ msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
28346
28346
  } else {
28347
- const type = includes(name10, ".") ? "property" : "argument";
28348
- msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
28347
+ const type = includes(name12, ".") ? "property" : "argument";
28348
+ msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
28349
28349
  }
28350
28350
  msg += `. Received type ${typeof actual}`;
28351
28351
  return msg;
28352
28352
  }, TypeError);
28353
28353
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
28354
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
28355
- return "The " + name10 + " method is not implemented";
28354
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
28355
+ return "The " + name12 + " method is not implemented";
28356
28356
  });
28357
28357
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
28358
- createErrorType("ERR_STREAM_DESTROYED", function(name10) {
28359
- return "Cannot call " + name10 + " after a stream was destroyed";
28358
+ createErrorType("ERR_STREAM_DESTROYED", function(name12) {
28359
+ return "Cannot call " + name12 + " after a stream was destroyed";
28360
28360
  });
28361
28361
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
28362
28362
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -28382,8 +28382,8 @@ var require_state = __commonJS({
28382
28382
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
28383
28383
  if (hwm != null) {
28384
28384
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
28385
- var name10 = isDuplex ? duplexKey : "highWaterMark";
28386
- throw new ERR_INVALID_OPT_VALUE(name10, hwm);
28385
+ var name12 = isDuplex ? duplexKey : "highWaterMark";
28386
+ throw new ERR_INVALID_OPT_VALUE(name12, hwm);
28387
28387
  }
28388
28388
  return Math.floor(hwm);
28389
28389
  }
@@ -31493,9 +31493,9 @@ var require_zip_archive_entry = __commonJS({
31493
31493
  var UnixStat = require_unix_stat();
31494
31494
  var constants = require_constants4();
31495
31495
  var zipUtil = require_util2();
31496
- var ZipArchiveEntry = module2.exports = function(name10) {
31496
+ var ZipArchiveEntry = module2.exports = function(name12) {
31497
31497
  if (!(this instanceof ZipArchiveEntry)) {
31498
- return new ZipArchiveEntry(name10);
31498
+ return new ZipArchiveEntry(name12);
31499
31499
  }
31500
31500
  ArchiveEntry.call(this);
31501
31501
  this.platform = constants.PLATFORM_FAT;
@@ -31512,8 +31512,8 @@ var require_zip_archive_entry = __commonJS({
31512
31512
  this.exattr = 0;
31513
31513
  this.inattr = 0;
31514
31514
  this.comment = null;
31515
- if (name10) {
31516
- this.setName(name10);
31515
+ if (name12) {
31516
+ this.setName(name12);
31517
31517
  }
31518
31518
  };
31519
31519
  inherits(ZipArchiveEntry, ArchiveEntry);
@@ -31610,15 +31610,15 @@ var require_zip_archive_entry = __commonJS({
31610
31610
  }
31611
31611
  this.method = method;
31612
31612
  };
31613
- ZipArchiveEntry.prototype.setName = function(name10, prependSlash = false) {
31614
- name10 = normalizePath(name10, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
31613
+ ZipArchiveEntry.prototype.setName = function(name12, prependSlash = false) {
31614
+ name12 = normalizePath(name12, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
31615
31615
  if (prependSlash) {
31616
- name10 = `/${name10}`;
31616
+ name12 = `/${name12}`;
31617
31617
  }
31618
- if (Buffer.byteLength(name10) !== name10.length) {
31618
+ if (Buffer.byteLength(name12) !== name12.length) {
31619
31619
  this.getGeneralPurposeBit().useUTF8ForNames(true);
31620
31620
  }
31621
- this.name = name10;
31621
+ this.name = name12;
31622
31622
  };
31623
31623
  ZipArchiveEntry.prototype.setPlatform = function(platform) {
31624
31624
  this.platform = platform;
@@ -32073,10 +32073,10 @@ var require_errors2 = __commonJS({
32073
32073
  return str.indexOf(search, start) !== -1;
32074
32074
  }
32075
32075
  }
32076
- createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
32077
- return 'The value "' + value + '" is invalid for option "' + name10 + '"';
32076
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
32077
+ return 'The value "' + value + '" is invalid for option "' + name12 + '"';
32078
32078
  }, TypeError);
32079
- createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
32079
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
32080
32080
  let determiner;
32081
32081
  if (typeof expected === "string" && startsWith(expected, "not ")) {
32082
32082
  determiner = "must not be";
@@ -32085,22 +32085,22 @@ var require_errors2 = __commonJS({
32085
32085
  determiner = "must be";
32086
32086
  }
32087
32087
  let msg;
32088
- if (endsWith(name10, " argument")) {
32089
- msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
32088
+ if (endsWith(name12, " argument")) {
32089
+ msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
32090
32090
  } else {
32091
- const type = includes(name10, ".") ? "property" : "argument";
32092
- msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
32091
+ const type = includes(name12, ".") ? "property" : "argument";
32092
+ msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
32093
32093
  }
32094
32094
  msg += `. Received type ${typeof actual}`;
32095
32095
  return msg;
32096
32096
  }, TypeError);
32097
32097
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
32098
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
32099
- return "The " + name10 + " method is not implemented";
32098
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
32099
+ return "The " + name12 + " method is not implemented";
32100
32100
  });
32101
32101
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
32102
- createErrorType("ERR_STREAM_DESTROYED", function(name10) {
32103
- return "Cannot call " + name10 + " after a stream was destroyed";
32102
+ createErrorType("ERR_STREAM_DESTROYED", function(name12) {
32103
+ return "Cannot call " + name12 + " after a stream was destroyed";
32104
32104
  });
32105
32105
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
32106
32106
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -32126,8 +32126,8 @@ var require_state2 = __commonJS({
32126
32126
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
32127
32127
  if (hwm != null) {
32128
32128
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
32129
- var name10 = isDuplex ? duplexKey : "highWaterMark";
32130
- throw new ERR_INVALID_OPT_VALUE(name10, hwm);
32129
+ var name12 = isDuplex ? duplexKey : "highWaterMark";
32130
+ throw new ERR_INVALID_OPT_VALUE(name12, hwm);
32131
32131
  }
32132
32132
  return Math.floor(hwm);
32133
32133
  }
@@ -35247,10 +35247,10 @@ var require_errors3 = __commonJS({
35247
35247
  return str.indexOf(search, start) !== -1;
35248
35248
  }
35249
35249
  }
35250
- createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
35251
- return 'The value "' + value + '" is invalid for option "' + name10 + '"';
35250
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
35251
+ return 'The value "' + value + '" is invalid for option "' + name12 + '"';
35252
35252
  }, TypeError);
35253
- createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
35253
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
35254
35254
  let determiner;
35255
35255
  if (typeof expected === "string" && startsWith(expected, "not ")) {
35256
35256
  determiner = "must not be";
@@ -35259,22 +35259,22 @@ var require_errors3 = __commonJS({
35259
35259
  determiner = "must be";
35260
35260
  }
35261
35261
  let msg;
35262
- if (endsWith(name10, " argument")) {
35263
- msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
35262
+ if (endsWith(name12, " argument")) {
35263
+ msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
35264
35264
  } else {
35265
- const type = includes(name10, ".") ? "property" : "argument";
35266
- msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
35265
+ const type = includes(name12, ".") ? "property" : "argument";
35266
+ msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
35267
35267
  }
35268
35268
  msg += `. Received type ${typeof actual}`;
35269
35269
  return msg;
35270
35270
  }, TypeError);
35271
35271
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
35272
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
35273
- return "The " + name10 + " method is not implemented";
35272
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
35273
+ return "The " + name12 + " method is not implemented";
35274
35274
  });
35275
35275
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
35276
- createErrorType("ERR_STREAM_DESTROYED", function(name10) {
35277
- return "Cannot call " + name10 + " after a stream was destroyed";
35276
+ createErrorType("ERR_STREAM_DESTROYED", function(name12) {
35277
+ return "Cannot call " + name12 + " after a stream was destroyed";
35278
35278
  });
35279
35279
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
35280
35280
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -35300,8 +35300,8 @@ var require_state3 = __commonJS({
35300
35300
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
35301
35301
  if (hwm != null) {
35302
35302
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
35303
- var name10 = isDuplex ? duplexKey : "highWaterMark";
35304
- throw new ERR_INVALID_OPT_VALUE(name10, hwm);
35303
+ var name12 = isDuplex ? duplexKey : "highWaterMark";
35304
+ throw new ERR_INVALID_OPT_VALUE(name12, hwm);
35305
35305
  }
35306
35306
  return Math.floor(hwm);
35307
35307
  }
@@ -37995,14 +37995,14 @@ var require_zip_archive_output_stream = __commonJS({
37995
37995
  this.write(zipUtil.getLongBytes(ae.getCrc()));
37996
37996
  this.write(zipUtil.getLongBytes(compressedSize));
37997
37997
  this.write(zipUtil.getLongBytes(size));
37998
- var name10 = ae.getName();
37998
+ var name12 = ae.getName();
37999
37999
  var comment = ae.getComment();
38000
38000
  var extra = ae.getCentralDirectoryExtra();
38001
38001
  if (gpb.usesUTF8ForNames()) {
38002
- name10 = Buffer.from(name10);
38002
+ name12 = Buffer.from(name12);
38003
38003
  comment = Buffer.from(comment);
38004
38004
  }
38005
- this.write(zipUtil.getShortBytes(name10.length));
38005
+ this.write(zipUtil.getShortBytes(name12.length));
38006
38006
  this.write(zipUtil.getShortBytes(extra.length));
38007
38007
  this.write(zipUtil.getShortBytes(comment.length));
38008
38008
  this.write(constants.SHORT_ZERO);
@@ -38013,7 +38013,7 @@ var require_zip_archive_output_stream = __commonJS({
38013
38013
  } else {
38014
38014
  this.write(zipUtil.getLongBytes(offsets.file));
38015
38015
  }
38016
- this.write(name10);
38016
+ this.write(name12);
38017
38017
  this.write(extra);
38018
38018
  this.write(comment);
38019
38019
  };
@@ -38031,14 +38031,14 @@ var require_zip_archive_output_stream = __commonJS({
38031
38031
  ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) {
38032
38032
  var gpb = ae.getGeneralPurposeBit();
38033
38033
  var method = ae.getMethod();
38034
- var name10 = ae.getName();
38034
+ var name12 = ae.getName();
38035
38035
  var extra = ae.getLocalFileDataExtra();
38036
38036
  if (ae.isZip64()) {
38037
38037
  gpb.useDataDescriptor(true);
38038
38038
  ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);
38039
38039
  }
38040
38040
  if (gpb.usesUTF8ForNames()) {
38041
- name10 = Buffer.from(name10);
38041
+ name12 = Buffer.from(name12);
38042
38042
  }
38043
38043
  ae._offsets.file = this.offset;
38044
38044
  this.write(zipUtil.getLongBytes(constants.SIG_LFH));
@@ -38056,9 +38056,9 @@ var require_zip_archive_output_stream = __commonJS({
38056
38056
  this.write(zipUtil.getLongBytes(ae.getCompressedSize()));
38057
38057
  this.write(zipUtil.getLongBytes(ae.getSize()));
38058
38058
  }
38059
- this.write(zipUtil.getShortBytes(name10.length));
38059
+ this.write(zipUtil.getShortBytes(name12.length));
38060
38060
  this.write(zipUtil.getShortBytes(extra.length));
38061
- this.write(name10);
38061
+ this.write(name12);
38062
38062
  this.write(extra);
38063
38063
  ae._offsets.contents = this.offset;
38064
38064
  };
@@ -38644,10 +38644,10 @@ var require_errors4 = __commonJS({
38644
38644
  return str.indexOf(search, start) !== -1;
38645
38645
  }
38646
38646
  }
38647
- createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
38648
- return 'The value "' + value + '" is invalid for option "' + name10 + '"';
38647
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
38648
+ return 'The value "' + value + '" is invalid for option "' + name12 + '"';
38649
38649
  }, TypeError);
38650
- createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
38650
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
38651
38651
  let determiner;
38652
38652
  if (typeof expected === "string" && startsWith(expected, "not ")) {
38653
38653
  determiner = "must not be";
@@ -38656,22 +38656,22 @@ var require_errors4 = __commonJS({
38656
38656
  determiner = "must be";
38657
38657
  }
38658
38658
  let msg;
38659
- if (endsWith(name10, " argument")) {
38660
- msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
38659
+ if (endsWith(name12, " argument")) {
38660
+ msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
38661
38661
  } else {
38662
- const type = includes(name10, ".") ? "property" : "argument";
38663
- msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
38662
+ const type = includes(name12, ".") ? "property" : "argument";
38663
+ msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
38664
38664
  }
38665
38665
  msg += `. Received type ${typeof actual}`;
38666
38666
  return msg;
38667
38667
  }, TypeError);
38668
38668
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
38669
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
38670
- return "The " + name10 + " method is not implemented";
38669
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
38670
+ return "The " + name12 + " method is not implemented";
38671
38671
  });
38672
38672
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
38673
- createErrorType("ERR_STREAM_DESTROYED", function(name10) {
38674
- return "Cannot call " + name10 + " after a stream was destroyed";
38673
+ createErrorType("ERR_STREAM_DESTROYED", function(name12) {
38674
+ return "Cannot call " + name12 + " after a stream was destroyed";
38675
38675
  });
38676
38676
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
38677
38677
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -38697,8 +38697,8 @@ var require_state4 = __commonJS({
38697
38697
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
38698
38698
  if (hwm != null) {
38699
38699
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
38700
- var name10 = isDuplex ? duplexKey : "highWaterMark";
38701
- throw new ERR_INVALID_OPT_VALUE(name10, hwm);
38700
+ var name12 = isDuplex ? duplexKey : "highWaterMark";
38701
+ throw new ERR_INVALID_OPT_VALUE(name12, hwm);
38702
38702
  }
38703
38703
  return Math.floor(hwm);
38704
38704
  }
@@ -41548,24 +41548,24 @@ var require_headers = __commonJS({
41548
41548
  };
41549
41549
  exports.encode = function(opts) {
41550
41550
  var buf = alloc(512);
41551
- var name10 = opts.name;
41551
+ var name12 = opts.name;
41552
41552
  var prefix = "";
41553
- if (opts.typeflag === 5 && name10[name10.length - 1] !== "/")
41554
- name10 += "/";
41555
- if (Buffer.byteLength(name10) !== name10.length)
41553
+ if (opts.typeflag === 5 && name12[name12.length - 1] !== "/")
41554
+ name12 += "/";
41555
+ if (Buffer.byteLength(name12) !== name12.length)
41556
41556
  return null;
41557
- while (Buffer.byteLength(name10) > 100) {
41558
- var i = name10.indexOf("/");
41557
+ while (Buffer.byteLength(name12) > 100) {
41558
+ var i = name12.indexOf("/");
41559
41559
  if (i === -1)
41560
41560
  return null;
41561
- prefix += prefix ? "/" + name10.slice(0, i) : name10.slice(0, i);
41562
- name10 = name10.slice(i + 1);
41561
+ prefix += prefix ? "/" + name12.slice(0, i) : name12.slice(0, i);
41562
+ name12 = name12.slice(i + 1);
41563
41563
  }
41564
- if (Buffer.byteLength(name10) > 100 || Buffer.byteLength(prefix) > 155)
41564
+ if (Buffer.byteLength(name12) > 100 || Buffer.byteLength(prefix) > 155)
41565
41565
  return null;
41566
41566
  if (opts.linkname && Buffer.byteLength(opts.linkname) > 100)
41567
41567
  return null;
41568
- buf.write(name10);
41568
+ buf.write(name12);
41569
41569
  buf.write(encodeOct(opts.mode & MASK, 6), 100);
41570
41570
  buf.write(encodeOct(opts.uid, 6), 108);
41571
41571
  buf.write(encodeOct(opts.gid, 6), 116);
@@ -41589,7 +41589,7 @@ var require_headers = __commonJS({
41589
41589
  };
41590
41590
  exports.decode = function(buf, filenameEncoding, allowUnknownFormat) {
41591
41591
  var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
41592
- var name10 = decodeStr(buf, 0, 100, filenameEncoding);
41592
+ var name12 = decodeStr(buf, 0, 100, filenameEncoding);
41593
41593
  var mode = decodeOct(buf, 100, 8);
41594
41594
  var uid = decodeOct(buf, 108, 8);
41595
41595
  var gid = decodeOct(buf, 116, 8);
@@ -41608,17 +41608,17 @@ var require_headers = __commonJS({
41608
41608
  throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
41609
41609
  if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) {
41610
41610
  if (buf[345])
41611
- name10 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name10;
41611
+ name12 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name12;
41612
41612
  } else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 && GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) {
41613
41613
  } else {
41614
41614
  if (!allowUnknownFormat) {
41615
41615
  throw new Error("Invalid tar header: unknown format.");
41616
41616
  }
41617
41617
  }
41618
- if (typeflag === 0 && name10 && name10[name10.length - 1] === "/")
41618
+ if (typeflag === 0 && name12 && name12[name12.length - 1] === "/")
41619
41619
  typeflag = 5;
41620
41620
  return {
41621
- name: name10,
41621
+ name: name12,
41622
41622
  mode,
41623
41623
  uid,
41624
41624
  gid,
@@ -42050,10 +42050,10 @@ var require_errors5 = __commonJS({
42050
42050
  return str.indexOf(search, start) !== -1;
42051
42051
  }
42052
42052
  }
42053
- createErrorType("ERR_INVALID_OPT_VALUE", function(name10, value) {
42054
- return 'The value "' + value + '" is invalid for option "' + name10 + '"';
42053
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
42054
+ return 'The value "' + value + '" is invalid for option "' + name12 + '"';
42055
42055
  }, TypeError);
42056
- createErrorType("ERR_INVALID_ARG_TYPE", function(name10, expected, actual) {
42056
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
42057
42057
  let determiner;
42058
42058
  if (typeof expected === "string" && startsWith(expected, "not ")) {
42059
42059
  determiner = "must not be";
@@ -42062,22 +42062,22 @@ var require_errors5 = __commonJS({
42062
42062
  determiner = "must be";
42063
42063
  }
42064
42064
  let msg;
42065
- if (endsWith(name10, " argument")) {
42066
- msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
42065
+ if (endsWith(name12, " argument")) {
42066
+ msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
42067
42067
  } else {
42068
- const type = includes(name10, ".") ? "property" : "argument";
42069
- msg = `The "${name10}" ${type} ${determiner} ${oneOf(expected, "type")}`;
42068
+ const type = includes(name12, ".") ? "property" : "argument";
42069
+ msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
42070
42070
  }
42071
42071
  msg += `. Received type ${typeof actual}`;
42072
42072
  return msg;
42073
42073
  }, TypeError);
42074
42074
  createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
42075
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name10) {
42076
- return "The " + name10 + " method is not implemented";
42075
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
42076
+ return "The " + name12 + " method is not implemented";
42077
42077
  });
42078
42078
  createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
42079
- createErrorType("ERR_STREAM_DESTROYED", function(name10) {
42080
- return "Cannot call " + name10 + " after a stream was destroyed";
42079
+ createErrorType("ERR_STREAM_DESTROYED", function(name12) {
42080
+ return "Cannot call " + name12 + " after a stream was destroyed";
42081
42081
  });
42082
42082
  createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
42083
42083
  createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
@@ -42103,8 +42103,8 @@ var require_state5 = __commonJS({
42103
42103
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
42104
42104
  if (hwm != null) {
42105
42105
  if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
42106
- var name10 = isDuplex ? duplexKey : "highWaterMark";
42107
- throw new ERR_INVALID_OPT_VALUE(name10, hwm);
42106
+ var name12 = isDuplex ? duplexKey : "highWaterMark";
42107
+ throw new ERR_INVALID_OPT_VALUE(name12, hwm);
42108
42108
  }
42109
42109
  return Math.floor(hwm);
42110
42110
  }
@@ -45388,8 +45388,8 @@ var require_regeneratorRuntime = __commonJS({
45388
45388
  constructor: Context,
45389
45389
  reset: function reset(skipTempReset) {
45390
45390
  if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
45391
- for (var name10 in this)
45392
- name10.charAt(0) === "t" && hasOwn.call(this, name10) && !isNaN(+name10.slice(1)) && (this[name10] = void 0);
45391
+ for (var name12 in this)
45392
+ name12.charAt(0) === "t" && hasOwn.call(this, name12) && !isNaN(+name12.slice(1)) && (this[name12] = void 0);
45393
45393
  },
45394
45394
  stop: function stop() {
45395
45395
  this.done = true;
@@ -46752,9 +46752,9 @@ var WorkerThread = class {
46752
46752
  constructor(props) {
46753
46753
  this.terminated = false;
46754
46754
  this._loadableURL = "";
46755
- const { name: name10, source, url } = props;
46755
+ const { name: name12, source, url } = props;
46756
46756
  assert3(source || url);
46757
- this.name = name10;
46757
+ this.name = name12;
46758
46758
  this.source = source;
46759
46759
  this.url = url;
46760
46760
  this.onMessage = NOOP;
@@ -46871,9 +46871,9 @@ var WorkerPool = class {
46871
46871
  this.onDebug = props.onDebug;
46872
46872
  }
46873
46873
  }
46874
- async startJob(name10, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
46874
+ async startJob(name12, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
46875
46875
  const startPromise = new Promise((onStart) => {
46876
- this.jobQueue.push({ name: name10, onMessage: onMessage3, onError, onStart });
46876
+ this.jobQueue.push({ name: name12, onMessage: onMessage3, onError, onStart });
46877
46877
  return this;
46878
46878
  });
46879
46879
  this._startQueuedJob();
@@ -46924,8 +46924,8 @@ var WorkerPool = class {
46924
46924
  }
46925
46925
  if (this.count < this._getMaxConcurrency()) {
46926
46926
  this.count++;
46927
- const name10 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
46928
- return new WorkerThread({ name: name10, source: this.source, url: this.url });
46927
+ const name12 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
46928
+ return new WorkerThread({ name: name12, source: this.source, url: this.url });
46929
46929
  }
46930
46930
  return null;
46931
46931
  }
@@ -46970,16 +46970,16 @@ var WorkerFarm = class {
46970
46970
  }
46971
46971
  }
46972
46972
  getWorkerPool(options) {
46973
- const { name: name10, source, url } = options;
46974
- let workerPool = this.workerPools.get(name10);
46973
+ const { name: name12, source, url } = options;
46974
+ let workerPool = this.workerPools.get(name12);
46975
46975
  if (!workerPool) {
46976
46976
  workerPool = new WorkerPool({
46977
- name: name10,
46977
+ name: name12,
46978
46978
  source,
46979
46979
  url
46980
46980
  });
46981
46981
  workerPool.setProps(this._getWorkerPoolProps());
46982
- this.workerPools.set(name10, workerPool);
46982
+ this.workerPools.set(name12, workerPool);
46983
46983
  }
46984
46984
  return workerPool;
46985
46985
  }
@@ -47024,10 +47024,10 @@ function getWorkerURL(worker, options = {}) {
47024
47024
 
47025
47025
  // ../worker-utils/src/lib/worker-api/process-on-worker.ts
47026
47026
  async function processOnWorker(worker, data, options = {}, context = {}) {
47027
- const name10 = getWorkerName(worker);
47027
+ const name12 = getWorkerName(worker);
47028
47028
  const workerFarm = WorkerFarm.getWorkerFarm(options);
47029
47029
  const { source } = options;
47030
- const workerPoolProps = { name: name10, source };
47030
+ const workerPoolProps = { name: name12, source };
47031
47031
  if (!source) {
47032
47032
  workerPoolProps.url = getWorkerURL(worker, options);
47033
47033
  }
@@ -47349,10 +47349,10 @@ function canParseWithWorker(loader, options) {
47349
47349
  return loader.worker && options?.worker;
47350
47350
  }
47351
47351
  async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
47352
- const name10 = loader.id;
47352
+ const name12 = loader.id;
47353
47353
  const url = getWorkerURL(loader, options);
47354
47354
  const workerFarm = WorkerFarm.getWorkerFarm(options);
47355
- const workerPool = workerFarm.getWorkerPool({ name: name10, url });
47355
+ const workerPool = workerFarm.getWorkerPool({ name: name12, url });
47356
47356
  options = JSON.parse(JSON.stringify(options));
47357
47357
  context = JSON.parse(JSON.stringify(context || {}));
47358
47358
  const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
@@ -47901,6 +47901,99 @@ async function _readToArrayBuffer(fd, start, length) {
47901
47901
  return toArrayBuffer(buffer);
47902
47902
  }
47903
47903
 
47904
+ // ../loader-utils/src/lib/file-provider/file-provider.ts
47905
+ var isFileProvider = (fileProvider) => {
47906
+ return fileProvider?.getUint8 && fileProvider?.slice && fileProvider?.length;
47907
+ };
47908
+
47909
+ // ../loader-utils/src/lib/file-provider/file-handle.ts
47910
+ var import_fs3 = __toModule(require("fs"));
47911
+ var FileHandle = class {
47912
+ constructor(fileDescriptor, stats) {
47913
+ this.read = (buffer, offset, length, position) => {
47914
+ return new Promise((s) => {
47915
+ (0, import_fs3.read)(this.fileDescriptor, buffer, offset, length, position, (_err, bytesRead, buffer2) => s({ bytesRead, buffer: buffer2 }));
47916
+ });
47917
+ };
47918
+ this.fileDescriptor = fileDescriptor;
47919
+ this.stats = stats;
47920
+ }
47921
+ static async open(path2) {
47922
+ const [fd, stats] = await Promise.all([
47923
+ new Promise((resolve2, reject) => {
47924
+ (0, import_fs3.open)(path2, void 0, void 0, (_err, fd2) => _err ? reject(_err) : resolve2(fd2));
47925
+ }),
47926
+ new Promise((resolve2, reject) => {
47927
+ (0, import_fs3.stat)(path2, { bigint: true }, (_err, stats2) => _err ? reject(_err) : resolve2(stats2));
47928
+ })
47929
+ ]);
47930
+ return new FileHandle(fd, stats);
47931
+ }
47932
+ async close() {
47933
+ return new Promise((resolve2) => {
47934
+ (0, import_fs3.close)(this.fileDescriptor, (_err) => resolve2());
47935
+ });
47936
+ }
47937
+ get stat() {
47938
+ return this.stats;
47939
+ }
47940
+ };
47941
+
47942
+ // ../loader-utils/src/lib/file-provider/file-handle-file.ts
47943
+ var FileHandleFile = class {
47944
+ static async from(path2) {
47945
+ path2 = resolvePath(path2);
47946
+ const fileDescriptor = await FileHandle.open(path2);
47947
+ return new FileHandleFile(fileDescriptor, fileDescriptor.stat.size);
47948
+ }
47949
+ constructor(fileDescriptor, size) {
47950
+ this.fileDescriptor = fileDescriptor;
47951
+ this.size = size;
47952
+ }
47953
+ async destroy() {
47954
+ await this.fileDescriptor.close();
47955
+ }
47956
+ async getUint8(offset) {
47957
+ const val = new Uint8Array((await this.fileDescriptor.read(Buffer.alloc(1), 0, 1, offset)).buffer.buffer).at(0);
47958
+ if (val === void 0) {
47959
+ throw new Error("something went wrong");
47960
+ }
47961
+ return val;
47962
+ }
47963
+ async getUint16(offset) {
47964
+ const val = new Uint16Array((await this.fileDescriptor.read(Buffer.alloc(2), 0, 2, offset)).buffer.buffer).at(0);
47965
+ if (val === void 0) {
47966
+ throw new Error("something went wrong");
47967
+ }
47968
+ return val;
47969
+ }
47970
+ async getUint32(offset) {
47971
+ const val = new Uint32Array((await this.fileDescriptor.read(Buffer.alloc(4), 0, 4, offset)).buffer.buffer).at(0);
47972
+ if (val === void 0) {
47973
+ throw new Error("something went wrong");
47974
+ }
47975
+ return val;
47976
+ }
47977
+ async getBigUint64(offset) {
47978
+ const val = new BigInt64Array((await this.fileDescriptor.read(Buffer.alloc(8), 0, 8, offset)).buffer.buffer).at(0);
47979
+ if (val === void 0) {
47980
+ throw new Error("something went wrong");
47981
+ }
47982
+ return val;
47983
+ }
47984
+ async slice(startOffsset, endOffset) {
47985
+ const bigLength = endOffset - startOffsset;
47986
+ if (bigLength > Number.MAX_SAFE_INTEGER) {
47987
+ throw new Error("too big slice");
47988
+ }
47989
+ const length = Number(bigLength);
47990
+ return (await this.fileDescriptor.read(Buffer.alloc(length), 0, length, startOffsset)).buffer.buffer;
47991
+ }
47992
+ get length() {
47993
+ return this.size;
47994
+ }
47995
+ };
47996
+
47904
47997
  // ../core/src/javascript-utils/is-type.ts
47905
47998
  var isBoolean = (x) => typeof x === "boolean";
47906
47999
  var isFunction = (x) => typeof x === "function";
@@ -48304,7 +48397,7 @@ function autobind(obj) {
48304
48397
  for (const key of propNames) {
48305
48398
  const value = object[key];
48306
48399
  if (typeof value === "function") {
48307
- if (!predefined.find((name10) => key === name10)) {
48400
+ if (!predefined.find((name12) => key === name12)) {
48308
48401
  object[key] = value.bind(obj);
48309
48402
  }
48310
48403
  }
@@ -49625,11 +49718,11 @@ function getMeshBoundingBox(attributes) {
49625
49718
  }
49626
49719
 
49627
49720
  // ../schema/src/lib/mesh/deduce-mesh-schema.ts
49628
- function deduceMeshField(name10, attribute, optionalMetadata) {
49721
+ function deduceMeshField(name12, attribute, optionalMetadata) {
49629
49722
  const type = getDataTypeFromTypedArray(attribute.value);
49630
49723
  const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
49631
49724
  return {
49632
- name: name10,
49725
+ name: name12,
49633
49726
  type: { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] },
49634
49727
  nullable: false,
49635
49728
  metadata
@@ -50169,8 +50262,8 @@ var GLType = class {
50169
50262
  }
50170
50263
  throw new Error(ERR_TYPE_CONVERSION);
50171
50264
  }
50172
- static fromName(name10) {
50173
- const glType = NAME_TO_GL_TYPE[name10];
50265
+ static fromName(name12) {
50266
+ const glType = NAME_TO_GL_TYPE[name12];
50174
50267
  if (!glType) {
50175
50268
  throw new Error(ERR_TYPE_CONVERSION);
50176
50269
  }
@@ -50257,6 +50350,11 @@ function octDecode(x, y, result) {
50257
50350
  return octDecodeInRange(x, y, 255, result);
50258
50351
  }
50259
50352
 
50353
+ // ../math/src/geometry/utils/coordinates.ts
50354
+ function emod(n) {
50355
+ return (n % 1 + 1) % 1;
50356
+ }
50357
+
50260
50358
  // ../3d-tiles/src/lib/parsers/parse-3d-tile-point-cloud.ts
50261
50359
  var import_core5 = __toModule(require_es5());
50262
50360
 
@@ -50682,10 +50780,10 @@ var Tile3DBatchTableParser = class {
50682
50780
  }
50683
50781
  return void 0;
50684
50782
  }
50685
- hasProperty(batchId, name10) {
50783
+ hasProperty(batchId, name12) {
50686
50784
  this._checkBatchId(batchId);
50687
- assert2(typeof name10 === "string", name10);
50688
- return defined3(this._properties[name10]) || this._hasPropertyInHierarchy(batchId, name10);
50785
+ assert2(typeof name12 === "string", name12);
50786
+ return defined3(this._properties[name12]) || this._hasPropertyInHierarchy(batchId, name12);
50689
50787
  }
50690
50788
  getPropertyNames(batchId, results) {
50691
50789
  this._checkBatchId(batchId);
@@ -50698,47 +50796,47 @@ var Tile3DBatchTableParser = class {
50698
50796
  }
50699
50797
  return results;
50700
50798
  }
50701
- getProperty(batchId, name10) {
50799
+ getProperty(batchId, name12) {
50702
50800
  this._checkBatchId(batchId);
50703
- assert2(typeof name10 === "string", name10);
50801
+ assert2(typeof name12 === "string", name12);
50704
50802
  if (this._binaryProperties) {
50705
- const binaryProperty = this._binaryProperties[name10];
50803
+ const binaryProperty = this._binaryProperties[name12];
50706
50804
  if (defined3(binaryProperty)) {
50707
50805
  return this._getBinaryProperty(binaryProperty, batchId);
50708
50806
  }
50709
50807
  }
50710
- const propertyValues = this._properties[name10];
50808
+ const propertyValues = this._properties[name12];
50711
50809
  if (defined3(propertyValues)) {
50712
50810
  return clone(propertyValues[batchId], true);
50713
50811
  }
50714
50812
  if (this._hierarchy) {
50715
- const hierarchyProperty = this._getHierarchyProperty(batchId, name10);
50813
+ const hierarchyProperty = this._getHierarchyProperty(batchId, name12);
50716
50814
  if (defined3(hierarchyProperty)) {
50717
50815
  return hierarchyProperty;
50718
50816
  }
50719
50817
  }
50720
50818
  return void 0;
50721
50819
  }
50722
- setProperty(batchId, name10, value) {
50820
+ setProperty(batchId, name12, value) {
50723
50821
  const featureCount = this.featureCount;
50724
50822
  this._checkBatchId(batchId);
50725
- assert2(typeof name10 === "string", name10);
50823
+ assert2(typeof name12 === "string", name12);
50726
50824
  if (this._binaryProperties) {
50727
- const binaryProperty = this._binaryProperties[name10];
50825
+ const binaryProperty = this._binaryProperties[name12];
50728
50826
  if (binaryProperty) {
50729
50827
  this._setBinaryProperty(binaryProperty, batchId, value);
50730
50828
  return;
50731
50829
  }
50732
50830
  }
50733
50831
  if (this._hierarchy) {
50734
- if (this._setHierarchyProperty(this, batchId, name10, value)) {
50832
+ if (this._setHierarchyProperty(this, batchId, name12, value)) {
50735
50833
  return;
50736
50834
  }
50737
50835
  }
50738
- let propertyValues = this._properties[name10];
50836
+ let propertyValues = this._properties[name12];
50739
50837
  if (!defined3(propertyValues)) {
50740
- this._properties[name10] = new Array(featureCount);
50741
- propertyValues = this._properties[name10];
50838
+ this._properties[name12] = new Array(featureCount);
50839
+ propertyValues = this._properties[name12];
50742
50840
  }
50743
50841
  propertyValues[batchId] = clone(value, true);
50744
50842
  }
@@ -50756,21 +50854,21 @@ var Tile3DBatchTableParser = class {
50756
50854
  }
50757
50855
  _initializeBinaryProperties() {
50758
50856
  let binaryProperties = null;
50759
- for (const name10 in this._properties) {
50760
- const property = this._properties[name10];
50761
- const binaryProperty = this._initializeBinaryProperty(name10, property);
50857
+ for (const name12 in this._properties) {
50858
+ const property = this._properties[name12];
50859
+ const binaryProperty = this._initializeBinaryProperty(name12, property);
50762
50860
  if (binaryProperty) {
50763
50861
  binaryProperties = binaryProperties || {};
50764
- binaryProperties[name10] = binaryProperty;
50862
+ binaryProperties[name12] = binaryProperty;
50765
50863
  }
50766
50864
  }
50767
50865
  return binaryProperties;
50768
50866
  }
50769
- _initializeBinaryProperty(name10, property) {
50867
+ _initializeBinaryProperty(name12, property) {
50770
50868
  if ("byteOffset" in property) {
50771
50869
  const tile3DAccessor = property;
50772
- assert2(this.binary, `Property ${name10} requires a batch table binary.`);
50773
- assert2(tile3DAccessor.type, `Property ${name10} requires a type.`);
50870
+ assert2(this.binary, `Property ${name12} requires a batch table binary.`);
50871
+ assert2(tile3DAccessor.type, `Property ${name12} requires a type.`);
50774
50872
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
50775
50873
  return {
50776
50874
  typedArray: accessor.values,
@@ -50781,14 +50879,14 @@ var Tile3DBatchTableParser = class {
50781
50879
  }
50782
50880
  return null;
50783
50881
  }
50784
- _hasPropertyInHierarchy(batchId, name10) {
50882
+ _hasPropertyInHierarchy(batchId, name12) {
50785
50883
  if (!this._hierarchy) {
50786
50884
  return false;
50787
50885
  }
50788
50886
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
50789
50887
  const classId = hierarchy.classIds[instanceIndex];
50790
50888
  const instances = hierarchy.classes[classId].instances;
50791
- return defined3(instances[name10]);
50889
+ return defined3(instances[name12]);
50792
50890
  });
50793
50891
  return defined3(result);
50794
50892
  }
@@ -50796,21 +50894,21 @@ var Tile3DBatchTableParser = class {
50796
50894
  traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
50797
50895
  const classId = hierarchy.classIds[instanceIndex];
50798
50896
  const instances = hierarchy.classes[classId].instances;
50799
- for (const name10 in instances) {
50800
- if (instances.hasOwnProperty(name10)) {
50801
- if (results.indexOf(name10) === -1) {
50802
- results.push(name10);
50897
+ for (const name12 in instances) {
50898
+ if (instances.hasOwnProperty(name12)) {
50899
+ if (results.indexOf(name12) === -1) {
50900
+ results.push(name12);
50803
50901
  }
50804
50902
  }
50805
50903
  }
50806
50904
  });
50807
50905
  }
50808
- _getHierarchyProperty(batchId, name10) {
50906
+ _getHierarchyProperty(batchId, name12) {
50809
50907
  return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
50810
50908
  const classId = hierarchy.classIds[instanceIndex];
50811
50909
  const instanceClass = hierarchy.classes[classId];
50812
50910
  const indexInClass = hierarchy.classIndexes[instanceIndex];
50813
- const propertyValues = instanceClass.instances[name10];
50911
+ const propertyValues = instanceClass.instances[name12];
50814
50912
  if (defined3(propertyValues)) {
50815
50913
  if (defined3(propertyValues.typedArray)) {
50816
50914
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -50820,14 +50918,14 @@ var Tile3DBatchTableParser = class {
50820
50918
  return null;
50821
50919
  });
50822
50920
  }
50823
- _setHierarchyProperty(batchTable, batchId, name10, value) {
50921
+ _setHierarchyProperty(batchTable, batchId, name12, value) {
50824
50922
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
50825
50923
  const classId = hierarchy.classIds[instanceIndex];
50826
50924
  const instanceClass = hierarchy.classes[classId];
50827
50925
  const indexInClass = hierarchy.classIndexes[instanceIndex];
50828
- const propertyValues = instanceClass.instances[name10];
50926
+ const propertyValues = instanceClass.instances[name12];
50829
50927
  if (defined3(propertyValues)) {
50830
- assert2(instanceIndex === batchId, `Inherited property "${name10}" is read-only.`);
50928
+ assert2(instanceIndex === batchId, `Inherited property "${name12}" is read-only.`);
50831
50929
  if (defined3(propertyValues.typedArray)) {
50832
50930
  this._setBinaryProperty(propertyValues, indexInClass, value);
50833
50931
  } else {
@@ -51244,11 +51342,15 @@ async function loadDraco(tile, dracoData, options, context) {
51244
51342
  };
51245
51343
  }
51246
51344
 
51247
- // ../gltf/src/lib/utils/version.ts
51248
- var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
51345
+ // ../gltf/src/lib/extensions/EXT_mesh_features.ts
51346
+ var EXT_mesh_features_exports = {};
51347
+ __export(EXT_mesh_features_exports, {
51348
+ decode: () => decode2,
51349
+ name: () => name2
51350
+ });
51249
51351
 
51250
51352
  // ../images/src/lib/utils/version.ts
51251
- var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
51353
+ var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
51252
51354
 
51253
51355
  // ../images/src/lib/category-api/image-type.ts
51254
51356
  var { _parseImageNode } = globalThis;
@@ -51639,7 +51741,7 @@ var ImageLoader = {
51639
51741
  id: "image",
51640
51742
  module: "images",
51641
51743
  name: "Images",
51642
- version: VERSION9,
51744
+ version: VERSION8,
51643
51745
  mimeTypes: MIME_TYPES,
51644
51746
  extensions: EXTENSIONS,
51645
51747
  parse: parseImage,
@@ -51702,7 +51804,7 @@ var ImageWriter = {
51702
51804
  name: "Images",
51703
51805
  id: "image",
51704
51806
  module: "images",
51705
- version: VERSION9,
51807
+ version: VERSION8,
51706
51808
  extensions: ["jpeg"],
51707
51809
  options: {
51708
51810
  image: {
@@ -51746,6 +51848,1203 @@ function testBrowserImageFormatSupport(mimeType) {
51746
51848
  }
51747
51849
  }
51748
51850
 
51851
+ // ../gltf/src/lib/utils/assert.ts
51852
+ function assert6(condition, message) {
51853
+ if (!condition) {
51854
+ throw new Error(message || "assert failed: gltf");
51855
+ }
51856
+ }
51857
+
51858
+ // ../gltf/src/lib/gltf-utils/gltf-utils.ts
51859
+ var MIPMAP_FACTOR = 1.33;
51860
+ var TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
51861
+ var ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
51862
+ [Int8Array, 5120],
51863
+ [Uint8Array, 5121],
51864
+ [Int16Array, 5122],
51865
+ [Uint16Array, 5123],
51866
+ [Uint32Array, 5125],
51867
+ [Float32Array, 5126],
51868
+ [Float64Array, 5130]
51869
+ ];
51870
+ var ARRAY_TO_COMPONENT_TYPE = new Map(ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT);
51871
+ var ATTRIBUTE_TYPE_TO_COMPONENTS = {
51872
+ SCALAR: 1,
51873
+ VEC2: 2,
51874
+ VEC3: 3,
51875
+ VEC4: 4,
51876
+ MAT2: 4,
51877
+ MAT3: 9,
51878
+ MAT4: 16
51879
+ };
51880
+ var ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE = {
51881
+ 5120: 1,
51882
+ 5121: 1,
51883
+ 5122: 2,
51884
+ 5123: 2,
51885
+ 5125: 4,
51886
+ 5126: 4
51887
+ };
51888
+ var ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY = {
51889
+ 5120: Int8Array,
51890
+ 5121: Uint8Array,
51891
+ 5122: Int16Array,
51892
+ 5123: Uint16Array,
51893
+ 5125: Uint32Array,
51894
+ 5126: Float32Array
51895
+ };
51896
+ function getAccessorTypeFromSize(size) {
51897
+ const type = TYPES[size - 1];
51898
+ return type || TYPES[0];
51899
+ }
51900
+ function getComponentTypeFromArray(typedArray) {
51901
+ const componentType = ARRAY_TO_COMPONENT_TYPE.get(typedArray.constructor);
51902
+ if (!componentType) {
51903
+ throw new Error("Illegal typed array");
51904
+ }
51905
+ return componentType;
51906
+ }
51907
+ function getAccessorArrayTypeAndLength(accessor, bufferView) {
51908
+ const ArrayType = ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY[accessor.componentType];
51909
+ const components = ATTRIBUTE_TYPE_TO_COMPONENTS[accessor.type];
51910
+ const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
51911
+ const length = accessor.count * components;
51912
+ const byteLength = accessor.count * components * bytesPerComponent;
51913
+ assert6(byteLength >= 0 && byteLength <= bufferView.byteLength);
51914
+ return { ArrayType, length, byteLength };
51915
+ }
51916
+ function getMemoryUsageGLTF(gltf) {
51917
+ let { images, bufferViews } = gltf;
51918
+ images = images || [];
51919
+ bufferViews = bufferViews || [];
51920
+ const imageBufferViews = images.map((i) => i.bufferView);
51921
+ bufferViews = bufferViews.filter((view) => !imageBufferViews.includes(view));
51922
+ const bufferMemory = bufferViews.reduce((acc, view) => acc + view.byteLength, 0);
51923
+ const pixelCount = images.reduce((acc, image) => {
51924
+ const { width, height } = image.image;
51925
+ return acc + width * height;
51926
+ }, 0);
51927
+ return bufferMemory + Math.ceil(4 * pixelCount * MIPMAP_FACTOR);
51928
+ }
51929
+
51930
+ // ../gltf/src/lib/api/gltf-scenegraph.ts
51931
+ function makeDefaultGLTFJson() {
51932
+ return {
51933
+ asset: {
51934
+ version: "2.0",
51935
+ generator: "loaders.gl"
51936
+ },
51937
+ buffers: [],
51938
+ extensions: {},
51939
+ extensionsRequired: [],
51940
+ extensionsUsed: []
51941
+ };
51942
+ }
51943
+ var GLTFScenegraph = class {
51944
+ constructor(gltf) {
51945
+ this.gltf = {
51946
+ json: gltf?.json || makeDefaultGLTFJson(),
51947
+ buffers: gltf?.buffers || [],
51948
+ images: gltf?.images || []
51949
+ };
51950
+ this.sourceBuffers = [];
51951
+ this.byteLength = 0;
51952
+ if (this.gltf.buffers && this.gltf.buffers[0]) {
51953
+ this.byteLength = this.gltf.buffers[0].byteLength;
51954
+ this.sourceBuffers = [this.gltf.buffers[0]];
51955
+ }
51956
+ }
51957
+ get json() {
51958
+ return this.gltf.json;
51959
+ }
51960
+ getApplicationData(key) {
51961
+ const data = this.json[key];
51962
+ return data;
51963
+ }
51964
+ getExtraData(key) {
51965
+ const extras = this.json.extras || {};
51966
+ return extras[key];
51967
+ }
51968
+ hasExtension(extensionName) {
51969
+ const isUsedExtension = this.getUsedExtensions().find((name12) => name12 === extensionName);
51970
+ const isRequiredExtension = this.getRequiredExtensions().find((name12) => name12 === extensionName);
51971
+ return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
51972
+ }
51973
+ getExtension(extensionName) {
51974
+ const isExtension = this.getUsedExtensions().find((name12) => name12 === extensionName);
51975
+ const extensions = this.json.extensions || {};
51976
+ return isExtension ? extensions[extensionName] : null;
51977
+ }
51978
+ getRequiredExtension(extensionName) {
51979
+ const isRequired = this.getRequiredExtensions().find((name12) => name12 === extensionName);
51980
+ return isRequired ? this.getExtension(extensionName) : null;
51981
+ }
51982
+ getRequiredExtensions() {
51983
+ return this.json.extensionsRequired || [];
51984
+ }
51985
+ getUsedExtensions() {
51986
+ return this.json.extensionsUsed || [];
51987
+ }
51988
+ getRemovedExtensions() {
51989
+ return this.json.extensionsRemoved || [];
51990
+ }
51991
+ getObjectExtension(object, extensionName) {
51992
+ const extensions = object.extensions || {};
51993
+ return extensions[extensionName];
51994
+ }
51995
+ getScene(index) {
51996
+ return this.getObject("scenes", index);
51997
+ }
51998
+ getNode(index) {
51999
+ return this.getObject("nodes", index);
52000
+ }
52001
+ getSkin(index) {
52002
+ return this.getObject("skins", index);
52003
+ }
52004
+ getMesh(index) {
52005
+ return this.getObject("meshes", index);
52006
+ }
52007
+ getMaterial(index) {
52008
+ return this.getObject("materials", index);
52009
+ }
52010
+ getAccessor(index) {
52011
+ return this.getObject("accessors", index);
52012
+ }
52013
+ getTexture(index) {
52014
+ return this.getObject("textures", index);
52015
+ }
52016
+ getSampler(index) {
52017
+ return this.getObject("samplers", index);
52018
+ }
52019
+ getImage(index) {
52020
+ return this.getObject("images", index);
52021
+ }
52022
+ getBufferView(index) {
52023
+ return this.getObject("bufferViews", index);
52024
+ }
52025
+ getBuffer(index) {
52026
+ return this.getObject("buffers", index);
52027
+ }
52028
+ getObject(array, index) {
52029
+ if (typeof index === "object") {
52030
+ return index;
52031
+ }
52032
+ const object = this.json[array] && this.json[array][index];
52033
+ if (!object) {
52034
+ throw new Error(`glTF file error: Could not find ${array}[${index}]`);
52035
+ }
52036
+ return object;
52037
+ }
52038
+ getTypedArrayForBufferView(bufferView) {
52039
+ bufferView = this.getBufferView(bufferView);
52040
+ const bufferIndex = bufferView.buffer;
52041
+ const binChunk = this.gltf.buffers[bufferIndex];
52042
+ assert6(binChunk);
52043
+ const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
52044
+ return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
52045
+ }
52046
+ getTypedArrayForAccessor(accessor) {
52047
+ accessor = this.getAccessor(accessor);
52048
+ const bufferView = this.getBufferView(accessor.bufferView);
52049
+ const buffer = this.getBuffer(bufferView.buffer);
52050
+ const arrayBuffer = buffer.data;
52051
+ const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
52052
+ const byteOffset = bufferView.byteOffset + accessor.byteOffset;
52053
+ return new ArrayType(arrayBuffer, byteOffset, length);
52054
+ }
52055
+ getTypedArrayForImageData(image) {
52056
+ image = this.getAccessor(image);
52057
+ const bufferView = this.getBufferView(image.bufferView);
52058
+ const buffer = this.getBuffer(bufferView.buffer);
52059
+ const arrayBuffer = buffer.data;
52060
+ const byteOffset = bufferView.byteOffset || 0;
52061
+ return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);
52062
+ }
52063
+ addApplicationData(key, data) {
52064
+ this.json[key] = data;
52065
+ return this;
52066
+ }
52067
+ addExtraData(key, data) {
52068
+ this.json.extras = this.json.extras || {};
52069
+ this.json.extras[key] = data;
52070
+ return this;
52071
+ }
52072
+ addObjectExtension(object, extensionName, data) {
52073
+ object.extensions = object.extensions || {};
52074
+ object.extensions[extensionName] = data;
52075
+ this.registerUsedExtension(extensionName);
52076
+ return this;
52077
+ }
52078
+ setObjectExtension(object, extensionName, data) {
52079
+ const extensions = object.extensions || {};
52080
+ extensions[extensionName] = data;
52081
+ }
52082
+ removeObjectExtension(object, extensionName) {
52083
+ const extensions = object?.extensions || {};
52084
+ if (extensions[extensionName]) {
52085
+ this.json.extensionsRemoved = this.json.extensionsRemoved || [];
52086
+ const extensionsRemoved = this.json.extensionsRemoved;
52087
+ if (!extensionsRemoved.includes(extensionName)) {
52088
+ extensionsRemoved.push(extensionName);
52089
+ }
52090
+ }
52091
+ delete extensions[extensionName];
52092
+ }
52093
+ addExtension(extensionName, extensionData = {}) {
52094
+ assert6(extensionData);
52095
+ this.json.extensions = this.json.extensions || {};
52096
+ this.json.extensions[extensionName] = extensionData;
52097
+ this.registerUsedExtension(extensionName);
52098
+ return extensionData;
52099
+ }
52100
+ addRequiredExtension(extensionName, extensionData = {}) {
52101
+ assert6(extensionData);
52102
+ this.addExtension(extensionName, extensionData);
52103
+ this.registerRequiredExtension(extensionName);
52104
+ return extensionData;
52105
+ }
52106
+ registerUsedExtension(extensionName) {
52107
+ this.json.extensionsUsed = this.json.extensionsUsed || [];
52108
+ if (!this.json.extensionsUsed.find((ext) => ext === extensionName)) {
52109
+ this.json.extensionsUsed.push(extensionName);
52110
+ }
52111
+ }
52112
+ registerRequiredExtension(extensionName) {
52113
+ this.registerUsedExtension(extensionName);
52114
+ this.json.extensionsRequired = this.json.extensionsRequired || [];
52115
+ if (!this.json.extensionsRequired.find((ext) => ext === extensionName)) {
52116
+ this.json.extensionsRequired.push(extensionName);
52117
+ }
52118
+ }
52119
+ removeExtension(extensionName) {
52120
+ if (this.json.extensions?.[extensionName]) {
52121
+ this.json.extensionsRemoved = this.json.extensionsRemoved || [];
52122
+ const extensionsRemoved = this.json.extensionsRemoved;
52123
+ if (!extensionsRemoved.includes(extensionName)) {
52124
+ extensionsRemoved.push(extensionName);
52125
+ }
52126
+ }
52127
+ if (this.json.extensions) {
52128
+ delete this.json.extensions[extensionName];
52129
+ }
52130
+ if (this.json.extensionsRequired) {
52131
+ this._removeStringFromArray(this.json.extensionsRequired, extensionName);
52132
+ }
52133
+ if (this.json.extensionsUsed) {
52134
+ this._removeStringFromArray(this.json.extensionsUsed, extensionName);
52135
+ }
52136
+ }
52137
+ setDefaultScene(sceneIndex) {
52138
+ this.json.scene = sceneIndex;
52139
+ }
52140
+ addScene(scene) {
52141
+ const { nodeIndices } = scene;
52142
+ this.json.scenes = this.json.scenes || [];
52143
+ this.json.scenes.push({ nodes: nodeIndices });
52144
+ return this.json.scenes.length - 1;
52145
+ }
52146
+ addNode(node2) {
52147
+ const { meshIndex, matrix } = node2;
52148
+ this.json.nodes = this.json.nodes || [];
52149
+ const nodeData = { mesh: meshIndex };
52150
+ if (matrix) {
52151
+ nodeData.matrix = matrix;
52152
+ }
52153
+ this.json.nodes.push(nodeData);
52154
+ return this.json.nodes.length - 1;
52155
+ }
52156
+ addMesh(mesh) {
52157
+ const { attributes, indices, material, mode = 4 } = mesh;
52158
+ const accessors = this._addAttributes(attributes);
52159
+ const glTFMesh = {
52160
+ primitives: [
52161
+ {
52162
+ attributes: accessors,
52163
+ mode
52164
+ }
52165
+ ]
52166
+ };
52167
+ if (indices) {
52168
+ const indicesAccessor = this._addIndices(indices);
52169
+ glTFMesh.primitives[0].indices = indicesAccessor;
52170
+ }
52171
+ if (Number.isFinite(material)) {
52172
+ glTFMesh.primitives[0].material = material;
52173
+ }
52174
+ this.json.meshes = this.json.meshes || [];
52175
+ this.json.meshes.push(glTFMesh);
52176
+ return this.json.meshes.length - 1;
52177
+ }
52178
+ addPointCloud(attributes) {
52179
+ const accessorIndices = this._addAttributes(attributes);
52180
+ const glTFMesh = {
52181
+ primitives: [
52182
+ {
52183
+ attributes: accessorIndices,
52184
+ mode: 0
52185
+ }
52186
+ ]
52187
+ };
52188
+ this.json.meshes = this.json.meshes || [];
52189
+ this.json.meshes.push(glTFMesh);
52190
+ return this.json.meshes.length - 1;
52191
+ }
52192
+ addImage(imageData, mimeTypeOpt) {
52193
+ const metadata = getBinaryImageMetadata(imageData);
52194
+ const mimeType = mimeTypeOpt || metadata?.mimeType;
52195
+ const bufferViewIndex = this.addBufferView(imageData);
52196
+ const glTFImage = {
52197
+ bufferView: bufferViewIndex,
52198
+ mimeType
52199
+ };
52200
+ this.json.images = this.json.images || [];
52201
+ this.json.images.push(glTFImage);
52202
+ return this.json.images.length - 1;
52203
+ }
52204
+ addBufferView(buffer, bufferIndex = 0, byteOffset = this.byteLength) {
52205
+ const byteLength = buffer.byteLength;
52206
+ assert6(Number.isFinite(byteLength));
52207
+ this.sourceBuffers = this.sourceBuffers || [];
52208
+ this.sourceBuffers.push(buffer);
52209
+ const glTFBufferView = {
52210
+ buffer: bufferIndex,
52211
+ byteOffset,
52212
+ byteLength
52213
+ };
52214
+ this.byteLength += padToNBytes(byteLength, 4);
52215
+ this.json.bufferViews = this.json.bufferViews || [];
52216
+ this.json.bufferViews.push(glTFBufferView);
52217
+ return this.json.bufferViews.length - 1;
52218
+ }
52219
+ addAccessor(bufferViewIndex, accessor) {
52220
+ const glTFAccessor = {
52221
+ bufferView: bufferViewIndex,
52222
+ type: getAccessorTypeFromSize(accessor.size),
52223
+ componentType: accessor.componentType,
52224
+ count: accessor.count,
52225
+ max: accessor.max,
52226
+ min: accessor.min
52227
+ };
52228
+ this.json.accessors = this.json.accessors || [];
52229
+ this.json.accessors.push(glTFAccessor);
52230
+ return this.json.accessors.length - 1;
52231
+ }
52232
+ addBinaryBuffer(sourceBuffer, accessor = { size: 3 }) {
52233
+ const bufferViewIndex = this.addBufferView(sourceBuffer);
52234
+ let minMax = { min: accessor.min, max: accessor.max };
52235
+ if (!minMax.min || !minMax.max) {
52236
+ minMax = this._getAccessorMinMax(sourceBuffer, accessor.size);
52237
+ }
52238
+ const accessorDefaults = {
52239
+ size: accessor.size,
52240
+ componentType: getComponentTypeFromArray(sourceBuffer),
52241
+ count: Math.round(sourceBuffer.length / accessor.size),
52242
+ min: minMax.min,
52243
+ max: minMax.max
52244
+ };
52245
+ return this.addAccessor(bufferViewIndex, Object.assign(accessorDefaults, accessor));
52246
+ }
52247
+ addTexture(texture) {
52248
+ const { imageIndex } = texture;
52249
+ const glTFTexture = {
52250
+ source: imageIndex
52251
+ };
52252
+ this.json.textures = this.json.textures || [];
52253
+ this.json.textures.push(glTFTexture);
52254
+ return this.json.textures.length - 1;
52255
+ }
52256
+ addMaterial(pbrMaterialInfo) {
52257
+ this.json.materials = this.json.materials || [];
52258
+ this.json.materials.push(pbrMaterialInfo);
52259
+ return this.json.materials.length - 1;
52260
+ }
52261
+ createBinaryChunk() {
52262
+ this.gltf.buffers = [];
52263
+ const totalByteLength = this.byteLength;
52264
+ const arrayBuffer = new ArrayBuffer(totalByteLength);
52265
+ const targetArray = new Uint8Array(arrayBuffer);
52266
+ let dstByteOffset = 0;
52267
+ for (const sourceBuffer of this.sourceBuffers || []) {
52268
+ dstByteOffset = copyToArray(sourceBuffer, targetArray, dstByteOffset);
52269
+ }
52270
+ if (this.json?.buffers?.[0]) {
52271
+ this.json.buffers[0].byteLength = totalByteLength;
52272
+ } else {
52273
+ this.json.buffers = [{ byteLength: totalByteLength }];
52274
+ }
52275
+ this.gltf.binary = arrayBuffer;
52276
+ this.sourceBuffers = [arrayBuffer];
52277
+ }
52278
+ _removeStringFromArray(array, string) {
52279
+ let found = true;
52280
+ while (found) {
52281
+ const index = array.indexOf(string);
52282
+ if (index > -1) {
52283
+ array.splice(index, 1);
52284
+ } else {
52285
+ found = false;
52286
+ }
52287
+ }
52288
+ }
52289
+ _addAttributes(attributes = {}) {
52290
+ const result = {};
52291
+ for (const attributeKey in attributes) {
52292
+ const attributeData = attributes[attributeKey];
52293
+ const attrName = this._getGltfAttributeName(attributeKey);
52294
+ const accessor = this.addBinaryBuffer(attributeData.value, attributeData);
52295
+ result[attrName] = accessor;
52296
+ }
52297
+ return result;
52298
+ }
52299
+ _addIndices(indices) {
52300
+ return this.addBinaryBuffer(indices, { size: 1 });
52301
+ }
52302
+ _getGltfAttributeName(attributeName) {
52303
+ switch (attributeName.toLowerCase()) {
52304
+ case "position":
52305
+ case "positions":
52306
+ case "vertices":
52307
+ return "POSITION";
52308
+ case "normal":
52309
+ case "normals":
52310
+ return "NORMAL";
52311
+ case "color":
52312
+ case "colors":
52313
+ return "COLOR_0";
52314
+ case "texcoord":
52315
+ case "texcoords":
52316
+ return "TEXCOORD_0";
52317
+ default:
52318
+ return attributeName;
52319
+ }
52320
+ }
52321
+ _getAccessorMinMax(buffer, size) {
52322
+ const result = { min: null, max: null };
52323
+ if (buffer.length < size) {
52324
+ return result;
52325
+ }
52326
+ result.min = [];
52327
+ result.max = [];
52328
+ const initValues = buffer.subarray(0, size);
52329
+ for (const value of initValues) {
52330
+ result.min.push(value);
52331
+ result.max.push(value);
52332
+ }
52333
+ for (let index = size; index < buffer.length; index += size) {
52334
+ for (let componentIndex = 0; componentIndex < size; componentIndex++) {
52335
+ result.min[0 + componentIndex] = Math.min(result.min[0 + componentIndex], buffer[index + componentIndex]);
52336
+ result.max[0 + componentIndex] = Math.max(result.max[0 + componentIndex], buffer[index + componentIndex]);
52337
+ }
52338
+ }
52339
+ return result;
52340
+ }
52341
+ };
52342
+
52343
+ // ../gltf/src/lib/extensions/data-processing.ts
52344
+ var ATTRIBUTE_TYPE_TO_COMPONENTS2 = {
52345
+ SCALAR: 1,
52346
+ VEC2: 2,
52347
+ VEC3: 3,
52348
+ VEC4: 4,
52349
+ MAT2: 4,
52350
+ MAT3: 9,
52351
+ MAT4: 16,
52352
+ BOOLEAN: 1,
52353
+ STRING: 1,
52354
+ ENUM: 1
52355
+ };
52356
+ var ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY2 = {
52357
+ INT8: Int8Array,
52358
+ UINT8: Uint8Array,
52359
+ INT16: Int16Array,
52360
+ UINT16: Uint16Array,
52361
+ INT32: Int32Array,
52362
+ UINT32: Uint32Array,
52363
+ INT64: BigInt64Array,
52364
+ UINT64: BigUint64Array,
52365
+ FLOAT32: Float32Array,
52366
+ FLOAT64: Float64Array
52367
+ };
52368
+ var ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2 = {
52369
+ INT8: 1,
52370
+ UINT8: 1,
52371
+ INT16: 2,
52372
+ UINT16: 2,
52373
+ INT32: 4,
52374
+ UINT32: 4,
52375
+ INT64: 8,
52376
+ UINT64: 8,
52377
+ FLOAT32: 4,
52378
+ FLOAT64: 8
52379
+ };
52380
+ function getArrayElementByteSize(attributeType, componentType) {
52381
+ return ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2[componentType] * ATTRIBUTE_TYPE_TO_COMPONENTS2[attributeType];
52382
+ }
52383
+ function convertRawBufferToMetadataArray(typedArray, attributeType, componentType, elementCount = 1) {
52384
+ const numberOfComponents = ATTRIBUTE_TYPE_TO_COMPONENTS2[attributeType];
52385
+ const ArrayType = ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY2[componentType];
52386
+ const length = elementCount * numberOfComponents;
52387
+ const size = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2[componentType];
52388
+ const offset = typedArray.byteOffset % size ? Math.ceil(typedArray.byteOffset / size) * size : typedArray.byteOffset;
52389
+ return new ArrayType(typedArray.buffer, offset, length);
52390
+ }
52391
+ function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
52392
+ const json = scenegraph.gltf.json;
52393
+ const texCoordAccessorKey = `TEXCOORD_${textureInfo.texCoord || 0}`;
52394
+ const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
52395
+ const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);
52396
+ const texCoordArray = scenegraph.getTypedArrayForBufferView(texCoordBufferView);
52397
+ const textureCoordinates = new Float32Array(texCoordArray.buffer, texCoordArray.byteOffset, texCoordArray.length / 4);
52398
+ const textureIndex = textureInfo.index;
52399
+ const imageIndex = json.textures?.[textureIndex]?.source;
52400
+ if (typeof imageIndex !== "undefined") {
52401
+ const mimeType = json.images?.[imageIndex]?.mimeType;
52402
+ const parsedImage = scenegraph.gltf.images?.[imageIndex];
52403
+ if (parsedImage && typeof parsedImage.width !== "undefined") {
52404
+ const textureData = [];
52405
+ for (let index = 0; index < textureCoordinates.length; index += 2) {
52406
+ const value = getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, textureInfo.channels);
52407
+ textureData.push(value);
52408
+ }
52409
+ return textureData;
52410
+ }
52411
+ }
52412
+ return null;
52413
+ }
52414
+ function primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive) {
52415
+ if (propertyData === null)
52416
+ return;
52417
+ const featureIndices = [];
52418
+ for (const texelData of propertyData) {
52419
+ let index = featureTable.findIndex((item) => item === texelData);
52420
+ if (index === -1) {
52421
+ index = featureTable.push(texelData) - 1;
52422
+ }
52423
+ featureIndices.push(index);
52424
+ }
52425
+ const typedArray = new Uint32Array(featureIndices);
52426
+ const bufferIndex = scenegraph.gltf.buffers.push({
52427
+ arrayBuffer: typedArray.buffer,
52428
+ byteOffset: typedArray.byteOffset,
52429
+ byteLength: typedArray.byteLength
52430
+ }) - 1;
52431
+ const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);
52432
+ const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {
52433
+ size: 1,
52434
+ componentType: getComponentTypeFromArray(typedArray),
52435
+ count: typedArray.length
52436
+ });
52437
+ primitive.attributes[attributeName] = accessorIndex;
52438
+ }
52439
+ function getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, channels = [0]) {
52440
+ const CHANNELS_MAP = [
52441
+ { offset: 0, shift: 0 },
52442
+ { offset: 1, shift: 8 },
52443
+ { offset: 2, shift: 16 },
52444
+ { offset: 3, shift: 24 }
52445
+ ];
52446
+ const u = textureCoordinates[index];
52447
+ const v = textureCoordinates[index + 1];
52448
+ let components = 1;
52449
+ if (mimeType && (mimeType.indexOf("image/jpeg") !== -1 || mimeType.indexOf("image/png") !== -1))
52450
+ components = 4;
52451
+ const offset = coordinatesToOffset(u, v, parsedImage, components);
52452
+ let value = 0;
52453
+ for (const c of channels) {
52454
+ const map = CHANNELS_MAP[c];
52455
+ const imageOffset = offset + map.offset;
52456
+ const imageData = getImageData(parsedImage);
52457
+ if (imageData.data.length <= imageOffset) {
52458
+ throw new Error(`${imageData.data.length} <= ${imageOffset}`);
52459
+ }
52460
+ const imageValue = imageData.data[imageOffset];
52461
+ value |= imageValue << map.shift;
52462
+ }
52463
+ return value;
52464
+ }
52465
+ function coordinatesToOffset(u, v, parsedImage, componentsCount = 1) {
52466
+ const w = parsedImage.width;
52467
+ const iX = emod(u) * (w - 1);
52468
+ const indX = Math.round(iX);
52469
+ const h = parsedImage.height;
52470
+ const iY = emod(v) * (h - 1);
52471
+ const indY = Math.round(iY);
52472
+ const components = parsedImage.components ? parsedImage.components : componentsCount;
52473
+ const offset = (indY * w + indX) * components;
52474
+ return offset;
52475
+ }
52476
+
52477
+ // ../gltf/src/lib/extensions/EXT_structural_metadata.ts
52478
+ var EXT_structural_metadata_exports = {};
52479
+ __export(EXT_structural_metadata_exports, {
52480
+ decode: () => decode,
52481
+ getPropertyTablePopulated: () => getPropertyTablePopulated,
52482
+ name: () => name
52483
+ });
52484
+ var EXT_STRUCTURAL_METADATA_NAME = "EXT_structural_metadata";
52485
+ var name = EXT_STRUCTURAL_METADATA_NAME;
52486
+ async function decode(gltfData, options) {
52487
+ const scenegraph = new GLTFScenegraph(gltfData);
52488
+ decodeExtStructuralMetadata(scenegraph, options);
52489
+ }
52490
+ function getPropertyTablePopulated(scenegraph, propertyTableIndex) {
52491
+ const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
52492
+ const propertyTable = extension?.propertyTables?.[propertyTableIndex];
52493
+ if (extension?.schema && propertyTable) {
52494
+ processPropertyTable(scenegraph, extension.schema, propertyTable);
52495
+ return propertyTable;
52496
+ }
52497
+ throw new Error(`Incorrect data in the EXT_structural_metadata extension: no property table with index ${propertyTableIndex}`);
52498
+ }
52499
+ function decodeExtStructuralMetadata(scenegraph, options) {
52500
+ const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
52501
+ if (!extension?.schema) {
52502
+ return;
52503
+ }
52504
+ const propertyTextures = extension.propertyTextures;
52505
+ const json = scenegraph.gltf.json;
52506
+ if (propertyTextures && json.meshes && options?.gltf?.loadImages) {
52507
+ for (const mesh of json.meshes) {
52508
+ for (const primitive of mesh.primitives) {
52509
+ processPrimitivePropertyTextures(scenegraph, propertyTextures, primitive, extension);
52510
+ }
52511
+ }
52512
+ }
52513
+ const schemaClasses = extension.schema.classes;
52514
+ const propertyTables = extension.propertyTables;
52515
+ if (schemaClasses && propertyTables) {
52516
+ for (const schemaName in schemaClasses) {
52517
+ const propertyTable = findPropertyTableByClass(propertyTables, schemaName);
52518
+ if (propertyTable) {
52519
+ processPropertyTable(scenegraph, extension.schema, propertyTable);
52520
+ }
52521
+ }
52522
+ }
52523
+ }
52524
+ function processPrimitivePropertyTextures(scenegraph, propertyTextures, primitive, extension) {
52525
+ if (!propertyTextures) {
52526
+ return;
52527
+ }
52528
+ const primitiveExtension = primitive.extensions?.[EXT_STRUCTURAL_METADATA_NAME];
52529
+ const primitivePropertyTextureIndices = primitiveExtension?.propertyTextures;
52530
+ if (!primitivePropertyTextureIndices) {
52531
+ return;
52532
+ }
52533
+ for (const primitivePropertyTextureIndex of primitivePropertyTextureIndices) {
52534
+ const propertyTexture = propertyTextures[primitivePropertyTextureIndex];
52535
+ processPrimitivePropertyTexture(scenegraph, propertyTexture, primitive, extension);
52536
+ }
52537
+ }
52538
+ function processPrimitivePropertyTexture(scenegraph, propertyTexture, primitive, extension) {
52539
+ if (!propertyTexture.properties) {
52540
+ return;
52541
+ }
52542
+ if (!extension.dataAttributeNames) {
52543
+ extension.dataAttributeNames = [];
52544
+ }
52545
+ const className = propertyTexture.class;
52546
+ for (const propName in propertyTexture.properties) {
52547
+ const attributeName = `${className}_${propName}`;
52548
+ const textureInfoTopLevel = propertyTexture.properties?.[propName];
52549
+ if (!textureInfoTopLevel) {
52550
+ continue;
52551
+ }
52552
+ if (!textureInfoTopLevel.data) {
52553
+ textureInfoTopLevel.data = [];
52554
+ }
52555
+ const featureTextureTable = textureInfoTopLevel.data;
52556
+ const propertyData = getPrimitiveTextureData(scenegraph, textureInfoTopLevel, primitive);
52557
+ if (propertyData === null) {
52558
+ continue;
52559
+ }
52560
+ primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTextureTable, primitive);
52561
+ textureInfoTopLevel.data = featureTextureTable;
52562
+ extension.dataAttributeNames.push(attributeName);
52563
+ }
52564
+ }
52565
+ function processPropertyTable(scenegraph, schema, propertyTable) {
52566
+ const schemaClass = schema.classes?.[propertyTable.class];
52567
+ if (!schemaClass) {
52568
+ throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${propertyTable.class}`);
52569
+ }
52570
+ const numberOfElements = propertyTable.count;
52571
+ for (const propertyName in schemaClass.properties) {
52572
+ const classProperty = schemaClass.properties[propertyName];
52573
+ const propertyTableProperty = propertyTable.properties?.[propertyName];
52574
+ if (propertyTableProperty) {
52575
+ const data = getPropertyDataFromBinarySource(scenegraph, schema, classProperty, numberOfElements, propertyTableProperty);
52576
+ propertyTableProperty.data = data;
52577
+ }
52578
+ }
52579
+ }
52580
+ function getPropertyDataFromBinarySource(scenegraph, schema, classProperty, numberOfElements, propertyTableProperty) {
52581
+ let data = [];
52582
+ const valuesBufferView = propertyTableProperty.values;
52583
+ const valuesDataBytes = scenegraph.getTypedArrayForBufferView(valuesBufferView);
52584
+ let arrayOffsets = null;
52585
+ if (classProperty.array && typeof classProperty.count === "undefined" && typeof propertyTableProperty.arrayOffsets !== "undefined" && typeof propertyTableProperty.arrayOffsetType !== "undefined") {
52586
+ arrayOffsets = getOffsetArray(scenegraph, propertyTableProperty.arrayOffsets, propertyTableProperty.arrayOffsetType, numberOfElements);
52587
+ }
52588
+ let stringOffsets = null;
52589
+ if (typeof propertyTableProperty.stringOffsets !== "undefined" && typeof propertyTableProperty.stringOffsetType !== "undefined") {
52590
+ stringOffsets = getOffsetArray(scenegraph, propertyTableProperty.stringOffsets, propertyTableProperty.stringOffsetType, numberOfElements);
52591
+ }
52592
+ switch (classProperty.type) {
52593
+ case "SCALAR":
52594
+ case "VEC2":
52595
+ case "VEC3":
52596
+ case "VEC4":
52597
+ case "MAT2":
52598
+ case "MAT3":
52599
+ case "MAT4": {
52600
+ data = getPropertyDataNumeric(classProperty, numberOfElements, valuesDataBytes, arrayOffsets);
52601
+ break;
52602
+ }
52603
+ case "BOOLEAN": {
52604
+ throw new Error(`Not implemented - classProperty.type=${classProperty.type}`);
52605
+ }
52606
+ case "STRING": {
52607
+ data = getPropertyDataString(classProperty, numberOfElements, valuesDataBytes, arrayOffsets, stringOffsets);
52608
+ break;
52609
+ }
52610
+ case "ENUM": {
52611
+ data = getPropertyDataENUM(schema, classProperty, numberOfElements, valuesDataBytes, arrayOffsets);
52612
+ break;
52613
+ }
52614
+ default:
52615
+ throw new Error(`Unknown classProperty type ${classProperty.type}`);
52616
+ }
52617
+ return data;
52618
+ }
52619
+ function getOffsetArray(scenegraph, offsets, offsetType, numberOfElements) {
52620
+ const arrayOffsetsBufferView = offsets;
52621
+ const arrayOffsetsBytes = scenegraph.getTypedArrayForBufferView(arrayOffsetsBufferView);
52622
+ const arrayOffsets = convertRawBufferToMetadataArray(arrayOffsetsBytes, "SCALAR", offsetType, numberOfElements + 1);
52623
+ return arrayOffsets;
52624
+ }
52625
+ function getPropertyDataNumeric(classProperty, numberOfElements, valuesDataBytes, arrayOffsets) {
52626
+ const isArray = classProperty.array;
52627
+ const arrayCount = classProperty.count;
52628
+ const elementSize = getArrayElementByteSize(classProperty.type, classProperty.componentType);
52629
+ const elementCount = valuesDataBytes.byteLength / elementSize;
52630
+ let valuesData;
52631
+ if (classProperty.componentType) {
52632
+ valuesData = convertRawBufferToMetadataArray(valuesDataBytes, classProperty.type, classProperty.componentType, elementCount);
52633
+ } else {
52634
+ valuesData = valuesDataBytes;
52635
+ }
52636
+ if (isArray) {
52637
+ if (arrayOffsets) {
52638
+ return handleVariableLengthArrayNumeric(valuesData, numberOfElements, arrayOffsets, valuesDataBytes.length, elementSize);
52639
+ }
52640
+ if (arrayCount) {
52641
+ return handleFixedLengthArrayNumeric(valuesData, numberOfElements, arrayCount);
52642
+ }
52643
+ return [];
52644
+ }
52645
+ const attributeValueArray = [];
52646
+ for (let index = 0; index < numberOfElements; index++) {
52647
+ const value = valuesData[index];
52648
+ attributeValueArray.push(value);
52649
+ }
52650
+ return attributeValueArray;
52651
+ }
52652
+ function handleVariableLengthArrayNumeric(valuesData, numberOfElements, arrayOffsets, valuesDataBytesLength, elementSize) {
52653
+ const attributeValueArray = [];
52654
+ for (let index = 0; index < numberOfElements; index++) {
52655
+ const array = [];
52656
+ const arrayOffset = arrayOffsets[index];
52657
+ const arrayByteSize = arrayOffsets[index + 1] - arrayOffsets[index];
52658
+ if (arrayByteSize + arrayOffset <= valuesDataBytesLength) {
52659
+ const typedArrayOffset = arrayOffset / elementSize;
52660
+ const elementCount = arrayByteSize / elementSize;
52661
+ for (let i = 0; i < elementCount; i++) {
52662
+ const value = valuesData[typedArrayOffset + i];
52663
+ array.push(value);
52664
+ }
52665
+ }
52666
+ attributeValueArray.push(array);
52667
+ }
52668
+ return attributeValueArray;
52669
+ }
52670
+ function handleFixedLengthArrayNumeric(valuesData, numberOfElements, arrayCount) {
52671
+ const attributeValueArray = [];
52672
+ for (let index = 0; index < numberOfElements; index++) {
52673
+ const array = [];
52674
+ for (let i = 0; i < arrayCount; i++) {
52675
+ const value = valuesData[i];
52676
+ array.push(value);
52677
+ }
52678
+ attributeValueArray.push(array);
52679
+ }
52680
+ return attributeValueArray;
52681
+ }
52682
+ function getPropertyDataString(classProperty, numberOfElements, valuesDataBytes, arrayOffsets, stringOffsets) {
52683
+ if (arrayOffsets) {
52684
+ throw new Error(`Not implemented - classProperty.type=${classProperty.type}`);
52685
+ }
52686
+ if (stringOffsets) {
52687
+ const stringsArray = [];
52688
+ const textDecoder = new TextDecoder("utf8");
52689
+ let stringOffset = 0;
52690
+ for (let index = 0; index < numberOfElements; index++) {
52691
+ const stringByteSize = stringOffsets[index + 1] - stringOffsets[index];
52692
+ if (stringByteSize + stringOffset <= valuesDataBytes.length) {
52693
+ const stringData = valuesDataBytes.subarray(stringOffset, stringByteSize + stringOffset);
52694
+ const stringAttribute = textDecoder.decode(stringData);
52695
+ stringsArray.push(stringAttribute);
52696
+ stringOffset += stringByteSize;
52697
+ }
52698
+ }
52699
+ return stringsArray;
52700
+ }
52701
+ return [];
52702
+ }
52703
+ function getPropertyDataENUM(schema, classProperty, numberOfElements, valuesDataBytes, arrayOffsets) {
52704
+ const data = [];
52705
+ const isArray = classProperty.array;
52706
+ const arrayCount = classProperty.count;
52707
+ const enumType = classProperty.enumType;
52708
+ if (!enumType) {
52709
+ throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");
52710
+ }
52711
+ const enumEntry = schema.enums?.[enumType];
52712
+ if (!enumEntry) {
52713
+ throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${enumType}`);
52714
+ }
52715
+ const enumValueType = enumEntry.valueType || "UINT16";
52716
+ const elementSize = getArrayElementByteSize(classProperty.type, enumValueType);
52717
+ const elementCount = valuesDataBytes.byteLength / elementSize;
52718
+ const valuesData = convertRawBufferToMetadataArray(valuesDataBytes, classProperty.type, enumValueType, elementCount);
52719
+ if (isArray) {
52720
+ if (arrayOffsets) {
52721
+ return handleVariableLengthArrayENUM(valuesData, numberOfElements, arrayOffsets, valuesDataBytes.length, elementSize, enumEntry);
52722
+ }
52723
+ if (arrayCount) {
52724
+ return handleFixedLengthArrayENUM(valuesData, numberOfElements, arrayCount, enumEntry);
52725
+ }
52726
+ return [];
52727
+ }
52728
+ for (let index = 0; index < numberOfElements; index++) {
52729
+ const enumValue = valuesData[index];
52730
+ const enumObject = getEnumByValue(enumEntry, enumValue);
52731
+ if (enumObject) {
52732
+ data.push(enumObject.name);
52733
+ }
52734
+ }
52735
+ return data;
52736
+ }
52737
+ function handleVariableLengthArrayENUM(valuesData, numberOfElements, arrayOffsets, valuesDataBytesLength, elementSize, enumEntry) {
52738
+ const attributeValueArray = [];
52739
+ for (let index = 0; index < numberOfElements; index++) {
52740
+ const array = [];
52741
+ const arrayOffset = arrayOffsets[index];
52742
+ const arrayByteSize = arrayOffsets[index + 1] - arrayOffsets[index];
52743
+ if (arrayByteSize + arrayOffset <= valuesDataBytesLength) {
52744
+ const typedArrayOffset = arrayOffset / elementSize;
52745
+ const elementCount = arrayByteSize / elementSize;
52746
+ for (let i = 0; i < elementCount; i++) {
52747
+ const value = valuesData[typedArrayOffset + i];
52748
+ const enumObject = getEnumByValue(enumEntry, value);
52749
+ if (enumObject) {
52750
+ array.push(enumObject.name);
52751
+ }
52752
+ }
52753
+ }
52754
+ attributeValueArray.push(array);
52755
+ }
52756
+ return attributeValueArray;
52757
+ }
52758
+ function handleFixedLengthArrayENUM(valuesData, numberOfElements, arrayCount, enumEntry) {
52759
+ const attributeValueArray = [];
52760
+ for (let index = 0; index < numberOfElements; index++) {
52761
+ const array = [];
52762
+ for (let i = 0; i < arrayCount; i++) {
52763
+ const value = valuesData[i];
52764
+ const enumObject = getEnumByValue(enumEntry, value);
52765
+ if (enumObject) {
52766
+ array.push(enumObject.name);
52767
+ }
52768
+ }
52769
+ attributeValueArray.push(array);
52770
+ }
52771
+ return attributeValueArray;
52772
+ }
52773
+ function findPropertyTableByClass(propertyTables, schemaClassName) {
52774
+ for (let i = 0, len = propertyTables.length; i < len; i++) {
52775
+ const propertyTable = propertyTables[i];
52776
+ if (propertyTable.class === schemaClassName) {
52777
+ return propertyTable;
52778
+ }
52779
+ }
52780
+ return null;
52781
+ }
52782
+ function getEnumByValue(enumEntry, value) {
52783
+ for (const enumValue of enumEntry.values) {
52784
+ if (enumValue.value === value) {
52785
+ return enumValue;
52786
+ }
52787
+ }
52788
+ return null;
52789
+ }
52790
+
52791
+ // ../gltf/src/lib/extensions/EXT_mesh_features.ts
52792
+ var EXT_MESH_FEATURES_NAME = "EXT_mesh_features";
52793
+ var name2 = EXT_MESH_FEATURES_NAME;
52794
+ async function decode2(gltfData, options) {
52795
+ const scenegraph = new GLTFScenegraph(gltfData);
52796
+ decodeExtMeshFeatures(scenegraph, options);
52797
+ }
52798
+ function decodeExtMeshFeatures(scenegraph, options) {
52799
+ const json = scenegraph.gltf.json;
52800
+ if (!json.meshes) {
52801
+ return;
52802
+ }
52803
+ for (const mesh of json.meshes) {
52804
+ for (const primitive of mesh.primitives) {
52805
+ processMeshPrimitiveFeatures(scenegraph, primitive, options);
52806
+ }
52807
+ }
52808
+ }
52809
+ function processMeshPrimitiveFeatures(scenegraph, primitive, options) {
52810
+ const extension = primitive.extensions?.[EXT_MESH_FEATURES_NAME];
52811
+ const featureIds = extension?.featureIds;
52812
+ if (!featureIds)
52813
+ return;
52814
+ if (!extension.dataAttributeNames) {
52815
+ extension.dataAttributeNames = [];
52816
+ }
52817
+ let featureIdCount = 0;
52818
+ for (const featureId of featureIds) {
52819
+ let propertyTable = null;
52820
+ if (typeof featureId.propertyTable === "number") {
52821
+ propertyTable = getPropertyTablePopulated(scenegraph, featureId.propertyTable);
52822
+ }
52823
+ let propertyData = null;
52824
+ if (typeof featureId.attribute !== "undefined") {
52825
+ const accessorKey = `_FEATURE_ID_${featureId.attribute}`;
52826
+ const accessorIndex = primitive.attributes[accessorKey];
52827
+ const propertyDataTypedArray = scenegraph.getTypedArrayForAccessor(accessorIndex);
52828
+ propertyData = Array.prototype.slice.call(propertyDataTypedArray);
52829
+ } else if (typeof featureId.texture !== "undefined" && options?.gltf?.loadImages) {
52830
+ propertyData = getPrimitiveTextureData(scenegraph, featureId.texture, primitive);
52831
+ } else {
52832
+ }
52833
+ const attributeName = featureId.label || propertyTable?.name || `featureAttribute${featureIdCount}`;
52834
+ const featureTable = [];
52835
+ if (propertyData) {
52836
+ primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive);
52837
+ }
52838
+ extension.dataAttributeNames.push(attributeName);
52839
+ featureId.data = featureTable;
52840
+ featureIdCount++;
52841
+ }
52842
+ }
52843
+
52844
+ // ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
52845
+ var EXT_feature_metadata_exports = {};
52846
+ __export(EXT_feature_metadata_exports, {
52847
+ decode: () => decode3,
52848
+ name: () => name3
52849
+ });
52850
+ var EXT_FEATURE_METADATA_NAME = "EXT_feature_metadata";
52851
+ var name3 = EXT_FEATURE_METADATA_NAME;
52852
+ async function decode3(gltfData, options) {
52853
+ const scenegraph = new GLTFScenegraph(gltfData);
52854
+ decodeExtFeatureMetadata(scenegraph, options);
52855
+ }
52856
+ function decodeExtFeatureMetadata(scenegraph, options) {
52857
+ const extension = scenegraph.getExtension(EXT_FEATURE_METADATA_NAME);
52858
+ if (!extension)
52859
+ return;
52860
+ const schemaClasses = extension.schema?.classes;
52861
+ const { featureTables } = extension;
52862
+ if (schemaClasses && featureTables) {
52863
+ for (const schemaName in schemaClasses) {
52864
+ const schemaClass = schemaClasses[schemaName];
52865
+ const featureTable = findFeatureTableByName(featureTables, schemaName);
52866
+ if (featureTable) {
52867
+ handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
52868
+ }
52869
+ }
52870
+ }
52871
+ const { featureTextures } = extension;
52872
+ if (schemaClasses && featureTextures && options.gltf?.loadImages) {
52873
+ for (const schemaName in schemaClasses) {
52874
+ const schemaClass = schemaClasses[schemaName];
52875
+ const featureTexture = findFeatureTextureByName(featureTextures, schemaName);
52876
+ if (featureTexture) {
52877
+ handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);
52878
+ }
52879
+ }
52880
+ }
52881
+ }
52882
+ function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
52883
+ for (const propertyName in schemaClass.properties) {
52884
+ const schemaProperty = schemaClass.properties[propertyName];
52885
+ const featureTableProperty = featureTable?.properties?.[propertyName];
52886
+ const numberOfFeatures = featureTable.count;
52887
+ if (featureTableProperty) {
52888
+ const data = getPropertyDataFromBinarySource2(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
52889
+ featureTableProperty.data = data;
52890
+ }
52891
+ }
52892
+ }
52893
+ function handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass) {
52894
+ const attributeName = featureTexture.class;
52895
+ for (const propertyName in schemaClass.properties) {
52896
+ const featureTextureProperty = featureTexture?.properties?.[propertyName];
52897
+ if (featureTextureProperty) {
52898
+ const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);
52899
+ featureTextureProperty.data = data;
52900
+ }
52901
+ }
52902
+ }
52903
+ function getPropertyDataFromBinarySource2(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
52904
+ const bufferView = featureTableProperty.bufferView;
52905
+ const dataArray = scenegraph.getTypedArrayForBufferView(bufferView);
52906
+ switch (schemaProperty.type) {
52907
+ case "STRING": {
52908
+ const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
52909
+ const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
52910
+ return getStringAttributes(dataArray, offsetsData, numberOfFeatures);
52911
+ }
52912
+ default:
52913
+ }
52914
+ return dataArray;
52915
+ }
52916
+ function getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName) {
52917
+ const json = scenegraph.gltf.json;
52918
+ if (!json.meshes) {
52919
+ return [];
52920
+ }
52921
+ const featureTextureTable = [];
52922
+ for (const mesh of json.meshes) {
52923
+ for (const primitive of mesh.primitives) {
52924
+ processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive);
52925
+ }
52926
+ }
52927
+ return featureTextureTable;
52928
+ }
52929
+ function processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive) {
52930
+ const json = scenegraph.gltf.json;
52931
+ const textureData = [];
52932
+ const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;
52933
+ const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
52934
+ const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);
52935
+ const texCoordArray = scenegraph.getTypedArrayForBufferView(texCoordBufferView);
52936
+ const textureCoordinates = new Float32Array(texCoordArray.buffer, texCoordArray.byteOffset, texCoordArray.length / 4);
52937
+ const textureIndex = featureTextureProperty.texture.index;
52938
+ const texture = json.textures?.[textureIndex];
52939
+ const imageIndex = texture?.source;
52940
+ if (typeof imageIndex !== "undefined") {
52941
+ const image = json.images?.[imageIndex];
52942
+ const mimeType = image?.mimeType;
52943
+ const parsedImage = scenegraph.gltf.images?.[imageIndex];
52944
+ if (parsedImage) {
52945
+ for (let index = 0; index < textureCoordinates.length; index += 2) {
52946
+ const value = getImageValueByCoordinates2(parsedImage, mimeType, textureCoordinates, index, featureTextureProperty.channels);
52947
+ textureData.push(value);
52948
+ }
52949
+ }
52950
+ }
52951
+ const featureIndices = [];
52952
+ for (const texelData of textureData) {
52953
+ let index = featureTextureTable.findIndex((item) => item === texelData);
52954
+ if (index === -1) {
52955
+ index = featureTextureTable.push(texelData) - 1;
52956
+ }
52957
+ featureIndices.push(index);
52958
+ }
52959
+ const typedArray = new Uint32Array(featureIndices);
52960
+ const bufferIndex = scenegraph.gltf.buffers.push({
52961
+ arrayBuffer: typedArray.buffer,
52962
+ byteOffset: 0,
52963
+ byteLength: typedArray.byteLength
52964
+ }) - 1;
52965
+ const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);
52966
+ const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {
52967
+ size: 1,
52968
+ componentType: getComponentTypeFromArray(typedArray),
52969
+ count: typedArray.length
52970
+ });
52971
+ primitive.attributes[attributeName] = accessorIndex;
52972
+ }
52973
+ function getImageValueByCoordinates2(parsedImage, mimeType, textureCoordinates, index, channels) {
52974
+ const CHANNELS_MAP = {
52975
+ r: { offset: 0, shift: 0 },
52976
+ g: { offset: 1, shift: 8 },
52977
+ b: { offset: 2, shift: 16 },
52978
+ a: { offset: 3, shift: 24 }
52979
+ };
52980
+ const u = textureCoordinates[index];
52981
+ const v = textureCoordinates[index + 1];
52982
+ let components = 1;
52983
+ if (mimeType && (mimeType.indexOf("image/jpeg") !== -1 || mimeType.indexOf("image/png") !== -1))
52984
+ components = 4;
52985
+ const offset = coordinatesToOffset2(u, v, parsedImage, components);
52986
+ let value = 0;
52987
+ for (const c of channels) {
52988
+ const map = CHANNELS_MAP[c];
52989
+ const val = getVal(parsedImage, offset + map.offset);
52990
+ value |= val << map.shift;
52991
+ }
52992
+ return value;
52993
+ }
52994
+ function getVal(parsedImage, offset) {
52995
+ const imageData = getImageData(parsedImage);
52996
+ if (imageData.data.length <= offset) {
52997
+ throw new Error(`${imageData.data.length} <= ${offset}`);
52998
+ }
52999
+ return imageData.data[offset];
53000
+ }
53001
+ function coordinatesToOffset2(u, v, parsedImage, componentsCount = 1) {
53002
+ const w = parsedImage.width;
53003
+ const iX = emod(u) * (w - 1);
53004
+ const indX = Math.round(iX);
53005
+ const h = parsedImage.height;
53006
+ const iY = emod(v) * (h - 1);
53007
+ const indY = Math.round(iY);
53008
+ const components = parsedImage.components ? parsedImage.components : componentsCount;
53009
+ const offset = (indY * w + indX) * components;
53010
+ return offset;
53011
+ }
53012
+ function findFeatureTableByName(featureTables, schemaClassName) {
53013
+ for (const featureTableName in featureTables) {
53014
+ const featureTable = featureTables[featureTableName];
53015
+ if (featureTable.class === schemaClassName) {
53016
+ return featureTable;
53017
+ }
53018
+ }
53019
+ return null;
53020
+ }
53021
+ function findFeatureTextureByName(featureTextures, schemaClassName) {
53022
+ for (const featureTexturesName in featureTextures) {
53023
+ const featureTable = featureTextures[featureTexturesName];
53024
+ if (featureTable.class === schemaClassName) {
53025
+ return featureTable;
53026
+ }
53027
+ }
53028
+ return null;
53029
+ }
53030
+ function getStringAttributes(data, offsetsData, stringsCount) {
53031
+ const stringsArray = [];
53032
+ const textDecoder = new TextDecoder("utf8");
53033
+ let stringOffset = 0;
53034
+ const bytesPerStringSize = 4;
53035
+ for (let index = 0; index < stringsCount; index++) {
53036
+ const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
53037
+ const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
53038
+ const stringAttribute = textDecoder.decode(stringData);
53039
+ stringsArray.push(stringAttribute);
53040
+ stringOffset += stringByteSize;
53041
+ }
53042
+ return stringsArray;
53043
+ }
53044
+
53045
+ // ../gltf/src/lib/utils/version.ts
53046
+ var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
53047
+
51749
53048
  // ../textures/src/lib/utils/version.ts
51750
53049
  var VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
51751
53050
 
@@ -52555,12 +53854,6 @@ function parseCompressedTexture(data) {
52555
53854
  }
52556
53855
 
52557
53856
  // ../textures/src/compressed-texture-loader.ts
52558
- var DEFAULT_TEXTURE_LOADER_OPTIONS = {
52559
- "compressed-texture": {
52560
- libraryPath: "libs/",
52561
- useBasis: false
52562
- }
52563
- };
52564
53857
  var CompressedTextureWorkerLoader = {
52565
53858
  name: "Texture Containers",
52566
53859
  id: "compressed-texture",
@@ -52581,12 +53874,17 @@ var CompressedTextureWorkerLoader = {
52581
53874
  "application/octet-stream"
52582
53875
  ],
52583
53876
  binary: true,
52584
- options: DEFAULT_TEXTURE_LOADER_OPTIONS
53877
+ options: {
53878
+ "compressed-texture": {
53879
+ libraryPath: "libs/",
53880
+ useBasis: false
53881
+ }
53882
+ }
52585
53883
  };
52586
53884
  var CompressedTextureLoader = {
52587
53885
  ...CompressedTextureWorkerLoader,
52588
53886
  parse: async (arrayBuffer, options) => {
52589
- if (options["compressed-texture"].useBasis) {
53887
+ if (options?.["compressed-texture"]?.useBasis) {
52590
53888
  options.basis = {
52591
53889
  format: {
52592
53890
  alpha: "BC3",
@@ -52596,7 +53894,8 @@ var CompressedTextureLoader = {
52596
53894
  containerFormat: "ktx2",
52597
53895
  module: "encoder"
52598
53896
  };
52599
- return (await parseBasis(arrayBuffer, options))[0];
53897
+ const result = await parseBasis(arrayBuffer, options);
53898
+ return result[0];
52600
53899
  }
52601
53900
  return parseCompressedTexture(arrayBuffer);
52602
53901
  }
@@ -52618,13 +53917,6 @@ var KTX2BasisWriterWorker = {
52618
53917
  }
52619
53918
  };
52620
53919
 
52621
- // ../gltf/src/lib/utils/assert.ts
52622
- function assert6(condition, message) {
52623
- if (!condition) {
52624
- throw new Error(message || "assert failed: gltf");
52625
- }
52626
- }
52627
-
52628
53920
  // ../gltf/src/lib/parsers/parse-glb.ts
52629
53921
  var LITTLE_ENDIAN2 = true;
52630
53922
  var MAGIC_glTF = 1735152710;
@@ -52759,495 +54051,10 @@ function getTypedArrayForBufferView(json, buffers, bufferViewIndex) {
52759
54051
  // ../gltf/src/lib/extensions/EXT_meshopt_compression.ts
52760
54052
  var EXT_meshopt_compression_exports = {};
52761
54053
  __export(EXT_meshopt_compression_exports, {
52762
- decode: () => decode2,
52763
- name: () => name
54054
+ decode: () => decode5,
54055
+ name: () => name4
52764
54056
  });
52765
54057
 
52766
- // ../gltf/src/lib/gltf-utils/gltf-utils.ts
52767
- var MIPMAP_FACTOR = 1.33;
52768
- var TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
52769
- var ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
52770
- [Int8Array, 5120],
52771
- [Uint8Array, 5121],
52772
- [Int16Array, 5122],
52773
- [Uint16Array, 5123],
52774
- [Uint32Array, 5125],
52775
- [Float32Array, 5126],
52776
- [Float64Array, 5130]
52777
- ];
52778
- var ARRAY_TO_COMPONENT_TYPE = new Map(ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT);
52779
- var ATTRIBUTE_TYPE_TO_COMPONENTS = {
52780
- SCALAR: 1,
52781
- VEC2: 2,
52782
- VEC3: 3,
52783
- VEC4: 4,
52784
- MAT2: 4,
52785
- MAT3: 9,
52786
- MAT4: 16
52787
- };
52788
- var ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE = {
52789
- 5120: 1,
52790
- 5121: 1,
52791
- 5122: 2,
52792
- 5123: 2,
52793
- 5125: 4,
52794
- 5126: 4
52795
- };
52796
- var ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY = {
52797
- 5120: Int8Array,
52798
- 5121: Uint8Array,
52799
- 5122: Int16Array,
52800
- 5123: Uint16Array,
52801
- 5125: Uint32Array,
52802
- 5126: Float32Array
52803
- };
52804
- function getAccessorTypeFromSize(size) {
52805
- const type = TYPES[size - 1];
52806
- return type || TYPES[0];
52807
- }
52808
- function getComponentTypeFromArray(typedArray) {
52809
- const componentType = ARRAY_TO_COMPONENT_TYPE.get(typedArray.constructor);
52810
- if (!componentType) {
52811
- throw new Error("Illegal typed array");
52812
- }
52813
- return componentType;
52814
- }
52815
- function getAccessorArrayTypeAndLength(accessor, bufferView) {
52816
- const ArrayType = ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY[accessor.componentType];
52817
- const components = ATTRIBUTE_TYPE_TO_COMPONENTS[accessor.type];
52818
- const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
52819
- const length = accessor.count * components;
52820
- const byteLength = accessor.count * components * bytesPerComponent;
52821
- assert6(byteLength >= 0 && byteLength <= bufferView.byteLength);
52822
- return { ArrayType, length, byteLength };
52823
- }
52824
- function getMemoryUsageGLTF(gltf) {
52825
- let { images, bufferViews } = gltf;
52826
- images = images || [];
52827
- bufferViews = bufferViews || [];
52828
- const imageBufferViews = images.map((i) => i.bufferView);
52829
- bufferViews = bufferViews.filter((view) => !imageBufferViews.includes(view));
52830
- const bufferMemory = bufferViews.reduce((acc, view) => acc + view.byteLength, 0);
52831
- const pixelCount = images.reduce((acc, image) => {
52832
- const { width, height } = image.image;
52833
- return acc + width * height;
52834
- }, 0);
52835
- return bufferMemory + Math.ceil(4 * pixelCount * MIPMAP_FACTOR);
52836
- }
52837
-
52838
- // ../gltf/src/lib/api/gltf-scenegraph.ts
52839
- function makeDefaultGLTFJson() {
52840
- return {
52841
- asset: {
52842
- version: "2.0",
52843
- generator: "loaders.gl"
52844
- },
52845
- buffers: [],
52846
- extensions: {},
52847
- extensionsRequired: [],
52848
- extensionsUsed: []
52849
- };
52850
- }
52851
- var GLTFScenegraph = class {
52852
- constructor(gltf) {
52853
- this.gltf = {
52854
- json: gltf?.json || makeDefaultGLTFJson(),
52855
- buffers: gltf?.buffers || [],
52856
- images: gltf?.images || []
52857
- };
52858
- this.sourceBuffers = [];
52859
- this.byteLength = 0;
52860
- if (this.gltf.buffers && this.gltf.buffers[0]) {
52861
- this.byteLength = this.gltf.buffers[0].byteLength;
52862
- this.sourceBuffers = [this.gltf.buffers[0]];
52863
- }
52864
- }
52865
- get json() {
52866
- return this.gltf.json;
52867
- }
52868
- getApplicationData(key) {
52869
- const data = this.json[key];
52870
- return data;
52871
- }
52872
- getExtraData(key) {
52873
- const extras = this.json.extras || {};
52874
- return extras[key];
52875
- }
52876
- hasExtension(extensionName) {
52877
- const isUsedExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
52878
- const isRequiredExtension = this.getRequiredExtensions().find((name10) => name10 === extensionName);
52879
- return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
52880
- }
52881
- getExtension(extensionName) {
52882
- const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
52883
- const extensions = this.json.extensions || {};
52884
- return isExtension ? extensions[extensionName] : null;
52885
- }
52886
- getRequiredExtension(extensionName) {
52887
- const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
52888
- return isRequired ? this.getExtension(extensionName) : null;
52889
- }
52890
- getRequiredExtensions() {
52891
- return this.json.extensionsRequired || [];
52892
- }
52893
- getUsedExtensions() {
52894
- return this.json.extensionsUsed || [];
52895
- }
52896
- getRemovedExtensions() {
52897
- return this.json.extensionsRemoved || [];
52898
- }
52899
- getObjectExtension(object, extensionName) {
52900
- const extensions = object.extensions || {};
52901
- return extensions[extensionName];
52902
- }
52903
- getScene(index) {
52904
- return this.getObject("scenes", index);
52905
- }
52906
- getNode(index) {
52907
- return this.getObject("nodes", index);
52908
- }
52909
- getSkin(index) {
52910
- return this.getObject("skins", index);
52911
- }
52912
- getMesh(index) {
52913
- return this.getObject("meshes", index);
52914
- }
52915
- getMaterial(index) {
52916
- return this.getObject("materials", index);
52917
- }
52918
- getAccessor(index) {
52919
- return this.getObject("accessors", index);
52920
- }
52921
- getTexture(index) {
52922
- return this.getObject("textures", index);
52923
- }
52924
- getSampler(index) {
52925
- return this.getObject("samplers", index);
52926
- }
52927
- getImage(index) {
52928
- return this.getObject("images", index);
52929
- }
52930
- getBufferView(index) {
52931
- return this.getObject("bufferViews", index);
52932
- }
52933
- getBuffer(index) {
52934
- return this.getObject("buffers", index);
52935
- }
52936
- getObject(array, index) {
52937
- if (typeof index === "object") {
52938
- return index;
52939
- }
52940
- const object = this.json[array] && this.json[array][index];
52941
- if (!object) {
52942
- throw new Error(`glTF file error: Could not find ${array}[${index}]`);
52943
- }
52944
- return object;
52945
- }
52946
- getTypedArrayForBufferView(bufferView) {
52947
- bufferView = this.getBufferView(bufferView);
52948
- const bufferIndex = bufferView.buffer;
52949
- const binChunk = this.gltf.buffers[bufferIndex];
52950
- assert6(binChunk);
52951
- const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
52952
- return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
52953
- }
52954
- getTypedArrayForAccessor(accessor) {
52955
- accessor = this.getAccessor(accessor);
52956
- const bufferView = this.getBufferView(accessor.bufferView);
52957
- const buffer = this.getBuffer(bufferView.buffer);
52958
- const arrayBuffer = buffer.data;
52959
- const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
52960
- const byteOffset = bufferView.byteOffset + accessor.byteOffset;
52961
- return new ArrayType(arrayBuffer, byteOffset, length);
52962
- }
52963
- getTypedArrayForImageData(image) {
52964
- image = this.getAccessor(image);
52965
- const bufferView = this.getBufferView(image.bufferView);
52966
- const buffer = this.getBuffer(bufferView.buffer);
52967
- const arrayBuffer = buffer.data;
52968
- const byteOffset = bufferView.byteOffset || 0;
52969
- return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);
52970
- }
52971
- addApplicationData(key, data) {
52972
- this.json[key] = data;
52973
- return this;
52974
- }
52975
- addExtraData(key, data) {
52976
- this.json.extras = this.json.extras || {};
52977
- this.json.extras[key] = data;
52978
- return this;
52979
- }
52980
- addObjectExtension(object, extensionName, data) {
52981
- object.extensions = object.extensions || {};
52982
- object.extensions[extensionName] = data;
52983
- this.registerUsedExtension(extensionName);
52984
- return this;
52985
- }
52986
- setObjectExtension(object, extensionName, data) {
52987
- const extensions = object.extensions || {};
52988
- extensions[extensionName] = data;
52989
- }
52990
- removeObjectExtension(object, extensionName) {
52991
- const extensions = object?.extensions || {};
52992
- if (extensions[extensionName]) {
52993
- this.json.extensionsRemoved = this.json.extensionsRemoved || [];
52994
- const extensionsRemoved = this.json.extensionsRemoved;
52995
- if (!extensionsRemoved.includes(extensionName)) {
52996
- extensionsRemoved.push(extensionName);
52997
- }
52998
- }
52999
- delete extensions[extensionName];
53000
- }
53001
- addExtension(extensionName, extensionData = {}) {
53002
- assert6(extensionData);
53003
- this.json.extensions = this.json.extensions || {};
53004
- this.json.extensions[extensionName] = extensionData;
53005
- this.registerUsedExtension(extensionName);
53006
- return extensionData;
53007
- }
53008
- addRequiredExtension(extensionName, extensionData = {}) {
53009
- assert6(extensionData);
53010
- this.addExtension(extensionName, extensionData);
53011
- this.registerRequiredExtension(extensionName);
53012
- return extensionData;
53013
- }
53014
- registerUsedExtension(extensionName) {
53015
- this.json.extensionsUsed = this.json.extensionsUsed || [];
53016
- if (!this.json.extensionsUsed.find((ext) => ext === extensionName)) {
53017
- this.json.extensionsUsed.push(extensionName);
53018
- }
53019
- }
53020
- registerRequiredExtension(extensionName) {
53021
- this.registerUsedExtension(extensionName);
53022
- this.json.extensionsRequired = this.json.extensionsRequired || [];
53023
- if (!this.json.extensionsRequired.find((ext) => ext === extensionName)) {
53024
- this.json.extensionsRequired.push(extensionName);
53025
- }
53026
- }
53027
- removeExtension(extensionName) {
53028
- if (this.json.extensions?.[extensionName]) {
53029
- this.json.extensionsRemoved = this.json.extensionsRemoved || [];
53030
- const extensionsRemoved = this.json.extensionsRemoved;
53031
- if (!extensionsRemoved.includes(extensionName)) {
53032
- extensionsRemoved.push(extensionName);
53033
- }
53034
- }
53035
- if (this.json.extensions) {
53036
- delete this.json.extensions[extensionName];
53037
- }
53038
- if (this.json.extensionsRequired) {
53039
- this._removeStringFromArray(this.json.extensionsRequired, extensionName);
53040
- }
53041
- if (this.json.extensionsUsed) {
53042
- this._removeStringFromArray(this.json.extensionsUsed, extensionName);
53043
- }
53044
- }
53045
- setDefaultScene(sceneIndex) {
53046
- this.json.scene = sceneIndex;
53047
- }
53048
- addScene(scene) {
53049
- const { nodeIndices } = scene;
53050
- this.json.scenes = this.json.scenes || [];
53051
- this.json.scenes.push({ nodes: nodeIndices });
53052
- return this.json.scenes.length - 1;
53053
- }
53054
- addNode(node2) {
53055
- const { meshIndex, matrix } = node2;
53056
- this.json.nodes = this.json.nodes || [];
53057
- const nodeData = { mesh: meshIndex };
53058
- if (matrix) {
53059
- nodeData.matrix = matrix;
53060
- }
53061
- this.json.nodes.push(nodeData);
53062
- return this.json.nodes.length - 1;
53063
- }
53064
- addMesh(mesh) {
53065
- const { attributes, indices, material, mode = 4 } = mesh;
53066
- const accessors = this._addAttributes(attributes);
53067
- const glTFMesh = {
53068
- primitives: [
53069
- {
53070
- attributes: accessors,
53071
- mode
53072
- }
53073
- ]
53074
- };
53075
- if (indices) {
53076
- const indicesAccessor = this._addIndices(indices);
53077
- glTFMesh.primitives[0].indices = indicesAccessor;
53078
- }
53079
- if (Number.isFinite(material)) {
53080
- glTFMesh.primitives[0].material = material;
53081
- }
53082
- this.json.meshes = this.json.meshes || [];
53083
- this.json.meshes.push(glTFMesh);
53084
- return this.json.meshes.length - 1;
53085
- }
53086
- addPointCloud(attributes) {
53087
- const accessorIndices = this._addAttributes(attributes);
53088
- const glTFMesh = {
53089
- primitives: [
53090
- {
53091
- attributes: accessorIndices,
53092
- mode: 0
53093
- }
53094
- ]
53095
- };
53096
- this.json.meshes = this.json.meshes || [];
53097
- this.json.meshes.push(glTFMesh);
53098
- return this.json.meshes.length - 1;
53099
- }
53100
- addImage(imageData, mimeTypeOpt) {
53101
- const metadata = getBinaryImageMetadata(imageData);
53102
- const mimeType = mimeTypeOpt || metadata?.mimeType;
53103
- const bufferViewIndex = this.addBufferView(imageData);
53104
- const glTFImage = {
53105
- bufferView: bufferViewIndex,
53106
- mimeType
53107
- };
53108
- this.json.images = this.json.images || [];
53109
- this.json.images.push(glTFImage);
53110
- return this.json.images.length - 1;
53111
- }
53112
- addBufferView(buffer, bufferIndex = 0, byteOffset = this.byteLength) {
53113
- const byteLength = buffer.byteLength;
53114
- assert6(Number.isFinite(byteLength));
53115
- this.sourceBuffers = this.sourceBuffers || [];
53116
- this.sourceBuffers.push(buffer);
53117
- const glTFBufferView = {
53118
- buffer: bufferIndex,
53119
- byteOffset,
53120
- byteLength
53121
- };
53122
- this.byteLength += padToNBytes(byteLength, 4);
53123
- this.json.bufferViews = this.json.bufferViews || [];
53124
- this.json.bufferViews.push(glTFBufferView);
53125
- return this.json.bufferViews.length - 1;
53126
- }
53127
- addAccessor(bufferViewIndex, accessor) {
53128
- const glTFAccessor = {
53129
- bufferView: bufferViewIndex,
53130
- type: getAccessorTypeFromSize(accessor.size),
53131
- componentType: accessor.componentType,
53132
- count: accessor.count,
53133
- max: accessor.max,
53134
- min: accessor.min
53135
- };
53136
- this.json.accessors = this.json.accessors || [];
53137
- this.json.accessors.push(glTFAccessor);
53138
- return this.json.accessors.length - 1;
53139
- }
53140
- addBinaryBuffer(sourceBuffer, accessor = { size: 3 }) {
53141
- const bufferViewIndex = this.addBufferView(sourceBuffer);
53142
- let minMax = { min: accessor.min, max: accessor.max };
53143
- if (!minMax.min || !minMax.max) {
53144
- minMax = this._getAccessorMinMax(sourceBuffer, accessor.size);
53145
- }
53146
- const accessorDefaults = {
53147
- size: accessor.size,
53148
- componentType: getComponentTypeFromArray(sourceBuffer),
53149
- count: Math.round(sourceBuffer.length / accessor.size),
53150
- min: minMax.min,
53151
- max: minMax.max
53152
- };
53153
- return this.addAccessor(bufferViewIndex, Object.assign(accessorDefaults, accessor));
53154
- }
53155
- addTexture(texture) {
53156
- const { imageIndex } = texture;
53157
- const glTFTexture = {
53158
- source: imageIndex
53159
- };
53160
- this.json.textures = this.json.textures || [];
53161
- this.json.textures.push(glTFTexture);
53162
- return this.json.textures.length - 1;
53163
- }
53164
- addMaterial(pbrMaterialInfo) {
53165
- this.json.materials = this.json.materials || [];
53166
- this.json.materials.push(pbrMaterialInfo);
53167
- return this.json.materials.length - 1;
53168
- }
53169
- createBinaryChunk() {
53170
- this.gltf.buffers = [];
53171
- const totalByteLength = this.byteLength;
53172
- const arrayBuffer = new ArrayBuffer(totalByteLength);
53173
- const targetArray = new Uint8Array(arrayBuffer);
53174
- let dstByteOffset = 0;
53175
- for (const sourceBuffer of this.sourceBuffers || []) {
53176
- dstByteOffset = copyToArray(sourceBuffer, targetArray, dstByteOffset);
53177
- }
53178
- if (this.json?.buffers?.[0]) {
53179
- this.json.buffers[0].byteLength = totalByteLength;
53180
- } else {
53181
- this.json.buffers = [{ byteLength: totalByteLength }];
53182
- }
53183
- this.gltf.binary = arrayBuffer;
53184
- this.sourceBuffers = [arrayBuffer];
53185
- }
53186
- _removeStringFromArray(array, string) {
53187
- let found = true;
53188
- while (found) {
53189
- const index = array.indexOf(string);
53190
- if (index > -1) {
53191
- array.splice(index, 1);
53192
- } else {
53193
- found = false;
53194
- }
53195
- }
53196
- }
53197
- _addAttributes(attributes = {}) {
53198
- const result = {};
53199
- for (const attributeKey in attributes) {
53200
- const attributeData = attributes[attributeKey];
53201
- const attrName = this._getGltfAttributeName(attributeKey);
53202
- const accessor = this.addBinaryBuffer(attributeData.value, attributeData);
53203
- result[attrName] = accessor;
53204
- }
53205
- return result;
53206
- }
53207
- _addIndices(indices) {
53208
- return this.addBinaryBuffer(indices, { size: 1 });
53209
- }
53210
- _getGltfAttributeName(attributeName) {
53211
- switch (attributeName.toLowerCase()) {
53212
- case "position":
53213
- case "positions":
53214
- case "vertices":
53215
- return "POSITION";
53216
- case "normal":
53217
- case "normals":
53218
- return "NORMAL";
53219
- case "color":
53220
- case "colors":
53221
- return "COLOR_0";
53222
- case "texcoord":
53223
- case "texcoords":
53224
- return "TEXCOORD_0";
53225
- default:
53226
- return attributeName;
53227
- }
53228
- }
53229
- _getAccessorMinMax(buffer, size) {
53230
- const result = { min: null, max: null };
53231
- if (buffer.length < size) {
53232
- return result;
53233
- }
53234
- result.min = [];
53235
- result.max = [];
53236
- const initValues = buffer.subarray(0, size);
53237
- for (const value of initValues) {
53238
- result.min.push(value);
53239
- result.max.push(value);
53240
- }
53241
- for (let index = size; index < buffer.length; index += size) {
53242
- for (let componentIndex = 0; componentIndex < size; componentIndex++) {
53243
- result.min[0 + componentIndex] = Math.min(result.min[0 + componentIndex], buffer[index + componentIndex]);
53244
- result.max[0 + componentIndex] = Math.max(result.max[0 + componentIndex], buffer[index + componentIndex]);
53245
- }
53246
- }
53247
- return result;
53248
- }
53249
- };
53250
-
53251
54058
  // ../gltf/src/meshopt/meshopt-decoder.ts
53252
54059
  var wasm_base = "B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9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QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB";
@@ -53386,7 +54193,7 @@ var DECODERS = {
53386
54193
  };
53387
54194
  async function meshoptDecodeGltfBuffer(target, count, size, source, mode, filter = "NONE") {
53388
54195
  const instance = await loadWasmInstance();
53389
- decode(instance, instance.exports[DECODERS[mode]], target, count, size, source, instance.exports[FILTERS[filter || "NONE"]]);
54196
+ decode4(instance, instance.exports[DECODERS[mode]], target, count, size, source, instance.exports[FILTERS[filter || "NONE"]]);
53390
54197
  }
53391
54198
  var wasmPromise;
53392
54199
  async function loadWasmInstance() {
@@ -53417,7 +54224,7 @@ function unpack(data) {
53417
54224
  }
53418
54225
  return result.buffer.slice(0, write);
53419
54226
  }
53420
- function decode(instance, fun, target, count, size, source, filter) {
54227
+ function decode4(instance, fun, target, count, size, source, filter) {
53421
54228
  const sbrk = instance.exports.sbrk;
53422
54229
  const count4 = count + 3 & ~3;
53423
54230
  const tp = sbrk(count4 * size);
@@ -53437,8 +54244,8 @@ function decode(instance, fun, target, count, size, source, filter) {
53437
54244
 
53438
54245
  // ../gltf/src/lib/extensions/EXT_meshopt_compression.ts
53439
54246
  var EXT_MESHOPT_COMPRESSION = "EXT_meshopt_compression";
53440
- var name = EXT_MESHOPT_COMPRESSION;
53441
- async function decode2(gltfData, options) {
54247
+ var name4 = EXT_MESHOPT_COMPRESSION;
54248
+ async function decode5(gltfData, options) {
53442
54249
  const scenegraph = new GLTFScenegraph(gltfData);
53443
54250
  if (!options?.gltf?.decompressMeshes || !options.gltf?.loadBuffers) {
53444
54251
  return;
@@ -53473,11 +54280,11 @@ async function decodeMeshoptBufferView(scenegraph, bufferView) {
53473
54280
  // ../gltf/src/lib/extensions/EXT_texture_webp.ts
53474
54281
  var EXT_texture_webp_exports = {};
53475
54282
  __export(EXT_texture_webp_exports, {
53476
- name: () => name2,
54283
+ name: () => name5,
53477
54284
  preprocess: () => preprocess
53478
54285
  });
53479
54286
  var EXT_TEXTURE_WEBP = "EXT_texture_webp";
53480
- var name2 = EXT_TEXTURE_WEBP;
54287
+ var name5 = EXT_TEXTURE_WEBP;
53481
54288
  function preprocess(gltfData, options) {
53482
54289
  const scenegraph = new GLTFScenegraph(gltfData);
53483
54290
  if (!isImageFormatSupported("image/webp")) {
@@ -53500,11 +54307,11 @@ function preprocess(gltfData, options) {
53500
54307
  // ../gltf/src/lib/extensions/KHR_texture_basisu.ts
53501
54308
  var KHR_texture_basisu_exports = {};
53502
54309
  __export(KHR_texture_basisu_exports, {
53503
- name: () => name3,
54310
+ name: () => name6,
53504
54311
  preprocess: () => preprocess2
53505
54312
  });
53506
54313
  var KHR_TEXTURE_BASISU = "KHR_texture_basisu";
53507
- var name3 = KHR_TEXTURE_BASISU;
54314
+ var name6 = KHR_TEXTURE_BASISU;
53508
54315
  function preprocess2(gltfData, options) {
53509
54316
  const scene = new GLTFScenegraph(gltfData);
53510
54317
  const { json } = scene;
@@ -53521,20 +54328,20 @@ function preprocess2(gltfData, options) {
53521
54328
  // ../gltf/src/lib/extensions/KHR_draco_mesh_compression.ts
53522
54329
  var KHR_draco_mesh_compression_exports = {};
53523
54330
  __export(KHR_draco_mesh_compression_exports, {
53524
- decode: () => decode3,
54331
+ decode: () => decode6,
53525
54332
  encode: () => encode2,
53526
- name: () => name4,
54333
+ name: () => name7,
53527
54334
  preprocess: () => preprocess3
53528
54335
  });
53529
54336
 
53530
54337
  // ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
53531
54338
  function getGLTFAccessors(attributes) {
53532
54339
  const accessors = {};
53533
- for (const name10 in attributes) {
53534
- const attribute = attributes[name10];
53535
- if (name10 !== "indices") {
54340
+ for (const name12 in attributes) {
54341
+ const attribute = attributes[name12];
54342
+ if (name12 !== "indices") {
53536
54343
  const glTFAccessor = getGLTFAccessor(attribute);
53537
- accessors[name10] = glTFAccessor;
54344
+ accessors[name12] = glTFAccessor;
53538
54345
  }
53539
54346
  }
53540
54347
  return accessors;
@@ -53582,7 +54389,7 @@ function toTypedArray(array, ArrayType, convertTypedArrays = false) {
53582
54389
 
53583
54390
  // ../gltf/src/lib/extensions/KHR_draco_mesh_compression.ts
53584
54391
  var KHR_DRACO_MESH_COMPRESSION = "KHR_draco_mesh_compression";
53585
- var name4 = KHR_DRACO_MESH_COMPRESSION;
54392
+ var name7 = KHR_DRACO_MESH_COMPRESSION;
53586
54393
  function preprocess3(gltfData, options, context) {
53587
54394
  const scenegraph = new GLTFScenegraph(gltfData);
53588
54395
  for (const primitive of makeMeshPrimitiveIterator(scenegraph)) {
@@ -53590,7 +54397,7 @@ function preprocess3(gltfData, options, context) {
53590
54397
  }
53591
54398
  }
53592
54399
  }
53593
- async function decode3(gltfData, options, context) {
54400
+ async function decode6(gltfData, options, context) {
53594
54401
  if (!options?.gltf?.decompressMeshes) {
53595
54402
  return;
53596
54403
  }
@@ -53679,8 +54486,8 @@ function* makeMeshPrimitiveIterator(scenegraph) {
53679
54486
  // ../gltf/src/lib/extensions/KHR_texture_transform.ts
53680
54487
  var KHR_texture_transform_exports = {};
53681
54488
  __export(KHR_texture_transform_exports, {
53682
- decode: () => decode4,
53683
- name: () => name5
54489
+ decode: () => decode7,
54490
+ name: () => name8
53684
54491
  });
53685
54492
  var import_core6 = __toModule(require_es5());
53686
54493
 
@@ -53705,11 +54512,11 @@ var BYTES = {
53705
54512
 
53706
54513
  // ../gltf/src/lib/extensions/KHR_texture_transform.ts
53707
54514
  var EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
53708
- var name5 = EXT_MESHOPT_TRANSFORM;
54515
+ var name8 = EXT_MESHOPT_TRANSFORM;
53709
54516
  var scratchVector = new import_core6.Vector3();
53710
54517
  var scratchRotationMatrix = new import_core6.Matrix3();
53711
54518
  var scratchScaleMatrix = new import_core6.Matrix3();
53712
- async function decode4(gltfData, options) {
54519
+ async function decode7(gltfData, options) {
53713
54520
  const gltfScenegraph = new GLTFScenegraph(gltfData);
53714
54521
  const hasExtension = gltfScenegraph.hasExtension(EXT_MESHOPT_TRANSFORM);
53715
54522
  if (!hasExtension || !options.gltf?.loadBuffers) {
@@ -53855,13 +54662,13 @@ function makeTransformationMatrix(extensionData) {
53855
54662
  // ../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts
53856
54663
  var KHR_lights_punctual_exports = {};
53857
54664
  __export(KHR_lights_punctual_exports, {
53858
- decode: () => decode5,
54665
+ decode: () => decode8,
53859
54666
  encode: () => encode3,
53860
- name: () => name6
54667
+ name: () => name9
53861
54668
  });
53862
54669
  var KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
53863
- var name6 = KHR_LIGHTS_PUNCTUAL;
53864
- async function decode5(gltfData) {
54670
+ var name9 = KHR_LIGHTS_PUNCTUAL;
54671
+ async function decode8(gltfData) {
53865
54672
  const gltfScenegraph = new GLTFScenegraph(gltfData);
53866
54673
  const { json } = gltfScenegraph;
53867
54674
  const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
@@ -53898,13 +54705,13 @@ async function encode3(gltfData) {
53898
54705
  // ../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts
53899
54706
  var KHR_materials_unlit_exports = {};
53900
54707
  __export(KHR_materials_unlit_exports, {
53901
- decode: () => decode6,
54708
+ decode: () => decode9,
53902
54709
  encode: () => encode4,
53903
- name: () => name7
54710
+ name: () => name10
53904
54711
  });
53905
54712
  var KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
53906
- var name7 = KHR_MATERIALS_UNLIT;
53907
- async function decode6(gltfData) {
54713
+ var name10 = KHR_MATERIALS_UNLIT;
54714
+ async function decode9(gltfData) {
53908
54715
  const gltfScenegraph = new GLTFScenegraph(gltfData);
53909
54716
  const { json } = gltfScenegraph;
53910
54717
  for (const material of json.materials || []) {
@@ -53933,13 +54740,13 @@ function encode4(gltfData) {
53933
54740
  // ../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts
53934
54741
  var KHR_techniques_webgl_exports = {};
53935
54742
  __export(KHR_techniques_webgl_exports, {
53936
- decode: () => decode7,
54743
+ decode: () => decode10,
53937
54744
  encode: () => encode5,
53938
- name: () => name8
54745
+ name: () => name11
53939
54746
  });
53940
54747
  var KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
53941
- var name8 = KHR_TECHNIQUES_WEBGL;
53942
- async function decode7(gltfData) {
54748
+ var name11 = KHR_TECHNIQUES_WEBGL;
54749
+ async function decode10(gltfData) {
53943
54750
  const gltfScenegraph = new GLTFScenegraph(gltfData);
53944
54751
  const { json } = gltfScenegraph;
53945
54752
  const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
@@ -53992,213 +54799,10 @@ function resolveValues(technique, gltfScenegraph) {
53992
54799
  return values;
53993
54800
  }
53994
54801
 
53995
- // ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
53996
- var EXT_feature_metadata_exports = {};
53997
- __export(EXT_feature_metadata_exports, {
53998
- decode: () => decode8,
53999
- name: () => name9
54000
- });
54001
- var EXT_FEATURE_METADATA = "EXT_feature_metadata";
54002
- var name9 = EXT_FEATURE_METADATA;
54003
- async function decode8(gltfData, options) {
54004
- const scenegraph = new GLTFScenegraph(gltfData);
54005
- decodeExtFeatureMetadata(scenegraph, options);
54006
- }
54007
- function decodeExtFeatureMetadata(scenegraph, options) {
54008
- const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
54009
- if (!extension)
54010
- return;
54011
- const schemaClasses = extension.schema?.classes;
54012
- const { featureTables } = extension;
54013
- if (schemaClasses && featureTables) {
54014
- for (const schemaName in schemaClasses) {
54015
- const schemaClass = schemaClasses[schemaName];
54016
- const featureTable = findFeatureTableByName(featureTables, schemaName);
54017
- if (featureTable) {
54018
- handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
54019
- }
54020
- }
54021
- }
54022
- const { featureTextures } = extension;
54023
- if (schemaClasses && featureTextures && options.gltf?.loadImages) {
54024
- for (const schemaName in schemaClasses) {
54025
- const schemaClass = schemaClasses[schemaName];
54026
- const featureTexture = findFeatureTextureByName(featureTextures, schemaName);
54027
- if (featureTexture) {
54028
- handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);
54029
- }
54030
- }
54031
- }
54032
- }
54033
- function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
54034
- for (const propertyName in schemaClass.properties) {
54035
- const schemaProperty = schemaClass.properties[propertyName];
54036
- const featureTableProperty = featureTable?.properties?.[propertyName];
54037
- const numberOfFeatures = featureTable.count;
54038
- if (featureTableProperty) {
54039
- const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
54040
- featureTableProperty.data = data;
54041
- }
54042
- }
54043
- }
54044
- function handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass) {
54045
- const attributeName = featureTexture.class;
54046
- for (const propertyName in schemaClass.properties) {
54047
- const featureTextureProperty = featureTexture?.properties?.[propertyName];
54048
- if (featureTextureProperty) {
54049
- const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);
54050
- featureTextureProperty.data = data;
54051
- }
54052
- }
54053
- }
54054
- function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
54055
- const bufferView = featureTableProperty.bufferView;
54056
- const dataArray = scenegraph.getTypedArrayForBufferView(bufferView);
54057
- switch (schemaProperty.type) {
54058
- case "STRING": {
54059
- const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
54060
- const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
54061
- return getStringAttributes(dataArray, offsetsData, numberOfFeatures);
54062
- }
54063
- default:
54064
- }
54065
- return dataArray;
54066
- }
54067
- function getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName) {
54068
- const json = scenegraph.gltf.json;
54069
- if (!json.meshes) {
54070
- return [];
54071
- }
54072
- const featureTextureTable = [];
54073
- for (const mesh of json.meshes) {
54074
- for (const primitive of mesh.primitives) {
54075
- processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive);
54076
- }
54077
- }
54078
- return featureTextureTable;
54079
- }
54080
- function processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive) {
54081
- const json = scenegraph.gltf.json;
54082
- const textureData = [];
54083
- const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;
54084
- const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
54085
- const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);
54086
- const texCoordArray = scenegraph.getTypedArrayForBufferView(texCoordBufferView);
54087
- const textureCoordinates = new Float32Array(texCoordArray.buffer, texCoordArray.byteOffset, texCoordArray.length / 4);
54088
- const textureIndex = featureTextureProperty.texture.index;
54089
- const texture = json.textures?.[textureIndex];
54090
- const imageIndex = texture?.source;
54091
- if (typeof imageIndex !== "undefined") {
54092
- const image = json.images?.[imageIndex];
54093
- const mimeType = image?.mimeType;
54094
- const parsedImage = scenegraph.gltf.images?.[imageIndex];
54095
- if (parsedImage) {
54096
- for (let index = 0; index < textureCoordinates.length; index += 2) {
54097
- const value = getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, featureTextureProperty.channels);
54098
- textureData.push(value);
54099
- }
54100
- }
54101
- }
54102
- const featureIndices = [];
54103
- for (const texelData of textureData) {
54104
- let index = featureTextureTable.findIndex((item) => item === texelData);
54105
- if (index === -1) {
54106
- index = featureTextureTable.push(texelData) - 1;
54107
- }
54108
- featureIndices.push(index);
54109
- }
54110
- const typedArray = new Uint32Array(featureIndices);
54111
- const bufferIndex = scenegraph.gltf.buffers.push({
54112
- arrayBuffer: typedArray.buffer,
54113
- byteOffset: 0,
54114
- byteLength: typedArray.byteLength
54115
- }) - 1;
54116
- const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);
54117
- const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {
54118
- size: 1,
54119
- componentType: getComponentTypeFromArray(typedArray),
54120
- count: typedArray.length
54121
- });
54122
- primitive.attributes[attributeName] = accessorIndex;
54123
- }
54124
- function getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, channels) {
54125
- const CHANNELS_MAP = {
54126
- r: { offset: 0, shift: 0 },
54127
- g: { offset: 1, shift: 8 },
54128
- b: { offset: 2, shift: 16 },
54129
- a: { offset: 3, shift: 24 }
54130
- };
54131
- const u = textureCoordinates[index];
54132
- const v = textureCoordinates[index + 1];
54133
- let components = 1;
54134
- if (mimeType && (mimeType.indexOf("image/jpeg") !== -1 || mimeType.indexOf("image/png") !== -1))
54135
- components = 4;
54136
- const offset = coordinatesToOffset(u, v, parsedImage, components);
54137
- let value = 0;
54138
- for (const c of channels) {
54139
- const map = CHANNELS_MAP[c];
54140
- const val = getVal(parsedImage, offset + map.offset);
54141
- value |= val << map.shift;
54142
- }
54143
- return value;
54144
- }
54145
- function getVal(parsedImage, offset) {
54146
- const imageData = getImageData(parsedImage);
54147
- if (imageData.data.length <= offset) {
54148
- throw new Error(`${imageData.data.length} <= ${offset}`);
54149
- }
54150
- return imageData.data[offset];
54151
- }
54152
- function coordinatesToOffset(u, v, parsedImage, componentsCount = 1) {
54153
- const w = parsedImage.width;
54154
- const iX = emod(u) * (w - 1);
54155
- const indX = Math.round(iX);
54156
- const h = parsedImage.height;
54157
- const iY = emod(v) * (h - 1);
54158
- const indY = Math.round(iY);
54159
- const components = parsedImage.components ? parsedImage.components : componentsCount;
54160
- const offset = (indY * w + indX) * components;
54161
- return offset;
54162
- }
54163
- function emod(n) {
54164
- const a = (n % 1 + 1) % 1;
54165
- return a;
54166
- }
54167
- function findFeatureTableByName(featureTables, schemaClassName) {
54168
- for (const featureTableName in featureTables) {
54169
- const featureTable = featureTables[featureTableName];
54170
- if (featureTable.class === schemaClassName) {
54171
- return featureTable;
54172
- }
54173
- }
54174
- return null;
54175
- }
54176
- function findFeatureTextureByName(featureTextures, schemaClassName) {
54177
- for (const featureTexturesName in featureTextures) {
54178
- const featureTable = featureTextures[featureTexturesName];
54179
- if (featureTable.class === schemaClassName) {
54180
- return featureTable;
54181
- }
54182
- }
54183
- return null;
54184
- }
54185
- function getStringAttributes(data, offsetsData, stringsCount) {
54186
- const stringsArray = [];
54187
- const textDecoder = new TextDecoder("utf8");
54188
- let stringOffset = 0;
54189
- const bytesPerStringSize = 4;
54190
- for (let index = 0; index < stringsCount; index++) {
54191
- const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
54192
- const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
54193
- const stringAttribute = textDecoder.decode(stringData);
54194
- stringsArray.push(stringAttribute);
54195
- stringOffset += stringByteSize;
54196
- }
54197
- return stringsArray;
54198
- }
54199
-
54200
54802
  // ../gltf/src/lib/api/gltf-extensions.ts
54201
54803
  var EXTENSIONS2 = [
54804
+ EXT_mesh_features_exports,
54805
+ EXT_structural_metadata_exports,
54202
54806
  EXT_meshopt_compression_exports,
54203
54807
  EXT_texture_webp_exports,
54204
54808
  KHR_texture_basisu_exports,
@@ -54568,7 +55172,7 @@ var GLTFLoader = {
54568
55172
  name: "glTF",
54569
55173
  id: "gltf",
54570
55174
  module: "gltf",
54571
- version: VERSION8,
55175
+ version: VERSION9,
54572
55176
  extensions: ["gltf", "glb"],
54573
55177
  mimeTypes: ["model/gltf+json", "model/gltf-binary"],
54574
55178
  text: true,
@@ -54666,7 +55270,7 @@ var GLTFWriter = {
54666
55270
  name: "glTF",
54667
55271
  id: "gltf",
54668
55272
  module: "gltf",
54669
- version: VERSION8,
55273
+ version: VERSION9,
54670
55274
  extensions: ["glb"],
54671
55275
  mimeTypes: ["model/gltf-binary"],
54672
55276
  binary: true,
@@ -55275,7 +55879,7 @@ async function parseComposite3DTile(tile, arrayBuffer, byteOffset, options, cont
55275
55879
  byteOffset += 4;
55276
55880
  tile.tiles = [];
55277
55881
  while (tile.tiles.length < tile.tilesLength && (tile.byteLength || 0) - byteOffset > 12) {
55278
- const subtile = {};
55882
+ const subtile = { shape: "tile3d" };
55279
55883
  tile.tiles.push(subtile);
55280
55884
  byteOffset = await parse3DTile2(arrayBuffer, byteOffset, options, context, subtile);
55281
55885
  }
@@ -55288,7 +55892,7 @@ async function parseGltf3DTile(tile, arrayBuffer, options, context) {
55288
55892
  tile.gltfUpAxis = options?.["3d-tiles"]?.assetGltfUpAxis ? options["3d-tiles"].assetGltfUpAxis : "Y";
55289
55893
  if (options?.["3d-tiles"]?.loadGLTF) {
55290
55894
  if (!context) {
55291
- return;
55895
+ return arrayBuffer.byteLength;
55292
55896
  }
55293
55897
  const gltfWithBuffers = await parseFromContext(arrayBuffer, GLTFLoader, options, context);
55294
55898
  tile.gltf = postProcessGLTF(gltfWithBuffers);
@@ -55296,10 +55900,11 @@ async function parseGltf3DTile(tile, arrayBuffer, options, context) {
55296
55900
  } else {
55297
55901
  tile.gltfArrayBuffer = arrayBuffer;
55298
55902
  }
55903
+ return arrayBuffer.byteLength;
55299
55904
  }
55300
55905
 
55301
55906
  // ../3d-tiles/src/lib/parsers/parse-3d-tile.ts
55302
- async function parse3DTile(arrayBuffer, byteOffset = 0, options, context, tile = {}) {
55907
+ async function parse3DTile(arrayBuffer, byteOffset = 0, options, context, tile = { shape: "tile3d" }) {
55303
55908
  tile.byteOffset = byteOffset;
55304
55909
  tile.type = getMagicString3(arrayBuffer, byteOffset);
55305
55910
  switch (tile.type) {
@@ -55553,7 +56158,7 @@ function autobind2(obj) {
55553
56158
  for (const key of propNames) {
55554
56159
  const value = object[key];
55555
56160
  if (typeof value === "function") {
55556
- if (!predefined.find((name10) => key === name10)) {
56161
+ if (!predefined.find((name12) => key === name12)) {
55557
56162
  object[key] = value.bind(obj);
55558
56163
  }
55559
56164
  }
@@ -57512,6 +58117,7 @@ async function parseTileset(data, options, context) {
57512
58117
  const normalizedRoot = await normalizeTileHeaders(tilesetJson, basePath, options || {});
57513
58118
  const tilesetJsonPostprocessed = {
57514
58119
  ...tilesetJson,
58120
+ shape: "tileset3d",
57515
58121
  loader: Tiles3DLoader,
57516
58122
  url: tilesetUrl,
57517
58123
  queryString: context?.queryString || "",
@@ -57526,6 +58132,7 @@ async function parseTileset(data, options, context) {
57526
58132
  async function parseTile(arrayBuffer, options, context) {
57527
58133
  const tile = {
57528
58134
  content: {
58135
+ shape: "tile3d",
57529
58136
  featureIds: null
57530
58137
  }
57531
58138
  };
@@ -57617,94 +58224,6 @@ var CesiumIonLoader = {
57617
58224
  }
57618
58225
  };
57619
58226
 
57620
- // ../zip/src/file-provider/file-handle.ts
57621
- var import_fs3 = __toModule(require("fs"));
57622
- var _FileHandle = class {
57623
- constructor(fileDescriptor, stats) {
57624
- this.read = (buffer, offset, length, position) => {
57625
- return new Promise((s) => {
57626
- (0, import_fs3.read)(this.fileDescriptor, buffer, offset, length, position, (_err, bytesRead, buffer2) => s({ bytesRead, buffer: buffer2 }));
57627
- });
57628
- };
57629
- this.fileDescriptor = fileDescriptor;
57630
- this.stats = stats;
57631
- }
57632
- async close() {
57633
- return new Promise((resolve2) => {
57634
- (0, import_fs3.close)(this.fileDescriptor, (_err) => resolve2());
57635
- });
57636
- }
57637
- get stat() {
57638
- return this.stats;
57639
- }
57640
- };
57641
- var FileHandle = _FileHandle;
57642
- FileHandle.open = async (path2) => {
57643
- const [fd, stats] = await Promise.all([
57644
- new Promise((s) => {
57645
- (0, import_fs3.open)(path2, void 0, void 0, (_err, fd2) => s(fd2));
57646
- }),
57647
- new Promise((s) => {
57648
- (0, import_fs3.stat)(path2, { bigint: true }, (_err, stats2) => s(stats2));
57649
- })
57650
- ]);
57651
- return new _FileHandle(fd, stats);
57652
- };
57653
-
57654
- // ../zip/src/file-provider/file-handle-file.ts
57655
- var FileHandleFile = class {
57656
- static async from(path2) {
57657
- const fileDescriptor = await FileHandle.open(path2);
57658
- return new FileHandleFile(fileDescriptor, fileDescriptor.stat.size);
57659
- }
57660
- constructor(fileDescriptor, size) {
57661
- this.fileDescriptor = fileDescriptor;
57662
- this.size = size;
57663
- }
57664
- async destroy() {
57665
- await this.fileDescriptor.close();
57666
- }
57667
- async getUint8(offset) {
57668
- const val = new Uint8Array((await this.fileDescriptor.read(Buffer.alloc(1), 0, 1, offset)).buffer.buffer).at(0);
57669
- if (val === void 0) {
57670
- throw new Error("something went wrong");
57671
- }
57672
- return val;
57673
- }
57674
- async getUint16(offset) {
57675
- const val = new Uint16Array((await this.fileDescriptor.read(Buffer.alloc(2), 0, 2, offset)).buffer.buffer).at(0);
57676
- if (val === void 0) {
57677
- throw new Error("something went wrong");
57678
- }
57679
- return val;
57680
- }
57681
- async getUint32(offset) {
57682
- const val = new Uint32Array((await this.fileDescriptor.read(Buffer.alloc(4), 0, 4, offset)).buffer.buffer).at(0);
57683
- if (val === void 0) {
57684
- throw new Error("something went wrong");
57685
- }
57686
- return val;
57687
- }
57688
- async getBigUint64(offset) {
57689
- const val = new BigInt64Array((await this.fileDescriptor.read(Buffer.alloc(8), 0, 8, offset)).buffer.buffer).at(0);
57690
- if (val === void 0) {
57691
- throw new Error("something went wrong");
57692
- }
57693
- return val;
57694
- }
57695
- async slice(startOffsset, endOffset) {
57696
- const bigLength = endOffset - startOffsset;
57697
- if (bigLength > Number.MAX_SAFE_INTEGER) {
57698
- throw new Error("too big slice");
57699
- }
57700
- const length = Number(bigLength);
57701
- return (await this.fileDescriptor.read(Buffer.alloc(length), 0, length, startOffsset)).buffer.buffer;
57702
- }
57703
- get length() {
57704
- return this.size;
57705
- }
57706
- };
57707
-
57708
58227
  // ../zip/src/parse-zip/search-from-the-end.ts
57709
58228
  var searchFromTheEnd = async (file, target) => {
57710
58229
  const searchWindow = [
@@ -57895,11 +58414,6 @@ var findBin = (hashToSearch, hashArray) => {
57895
58414
  return void 0;
57896
58415
  };
57897
58416
 
57898
- // ../zip/src/file-provider/file-provider.ts
57899
- var isFileProvider = (fileProvider) => {
57900
- return fileProvider?.getUint8 && fileProvider?.slice && fileProvider?.length;
57901
- };
57902
-
57903
58417
  // ../compression/src/lib/compression.ts
57904
58418
  var Compression = class {
57905
58419
  constructor(options) {
@@ -58836,7 +59350,7 @@ async function getTotalFilesSize(dirPath) {
58836
59350
  }
58837
59351
 
58838
59352
  // src/i3s-converter/helpers/geometry-converter.ts
58839
- var import_core17 = __toModule(require_es5());
59353
+ var import_core16 = __toModule(require_es5());
58840
59354
  var import_geospatial6 = __toModule(require_es52());
58841
59355
  var import_md53 = __toModule(require_md5());
58842
59356
 
@@ -59009,23 +59523,23 @@ function groupAttributesAndRangesByFeatureId(unifiedObjects, featureCount) {
59009
59523
  }
59010
59524
 
59011
59525
  // src/i3s-converter/helpers/coordinate-converter.ts
59012
- var import_core15 = __toModule(require_es5());
59526
+ var import_core14 = __toModule(require_es5());
59013
59527
  var import_geospatial4 = __toModule(require_es52());
59014
59528
  var import_culling3 = __toModule(require_es53());
59015
59529
  function createBoundingVolumes(sourceBoundingVolume, geoidHeightModel) {
59016
59530
  let radius;
59017
59531
  let halfSize;
59018
59532
  let quaternion;
59019
- const cartographicCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(sourceBoundingVolume.center, new import_core15.Vector3());
59533
+ const cartographicCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(sourceBoundingVolume.center, new import_core14.Vector3());
59020
59534
  cartographicCenter[2] = cartographicCenter[2] - geoidHeightModel.getHeight(cartographicCenter[1], cartographicCenter[0]);
59021
59535
  if (sourceBoundingVolume instanceof import_culling3.OrientedBoundingBox) {
59022
59536
  halfSize = sourceBoundingVolume.halfSize;
59023
- radius = new import_core15.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
59537
+ radius = new import_core14.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
59024
59538
  quaternion = sourceBoundingVolume.quaternion;
59025
59539
  } else {
59026
59540
  radius = sourceBoundingVolume.radius;
59027
59541
  halfSize = [radius, radius, radius];
59028
- quaternion = new import_core15.Quaternion().fromMatrix3(new import_core15.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
59542
+ quaternion = new import_core14.Quaternion().fromMatrix3(new import_core14.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
59029
59543
  }
59030
59544
  return {
59031
59545
  mbs: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2], radius],
@@ -59040,8 +59554,8 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
59040
59554
  const positionVectors = convertPositionsToVectors(cartesianPositions);
59041
59555
  const geometryObb = (0, import_culling3.makeOrientedBoundingBoxFromPoints)(positionVectors);
59042
59556
  const geometryMbs = (0, import_culling3.makeBoundingSphereFromPoints)(positionVectors);
59043
- let mbsCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core15.Vector3());
59044
- let obbCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core15.Vector3());
59557
+ let mbsCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core14.Vector3());
59558
+ let obbCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core14.Vector3());
59045
59559
  mbsCenter[2] = mbsCenter[2] - geoidHeightModel.getHeight(mbsCenter[1], mbsCenter[0]);
59046
59560
  obbCenter[2] = obbCenter[2] - geoidHeightModel.getHeight(obbCenter[1], obbCenter[0]);
59047
59561
  return {
@@ -59056,7 +59570,7 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
59056
59570
  function convertPositionsToVectors(positions) {
59057
59571
  const result = [];
59058
59572
  for (let i = 0; i < positions.length; i += 3) {
59059
- const positionVector = new import_core15.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
59573
+ const positionVector = new import_core14.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
59060
59574
  result.push(positionVector);
59061
59575
  }
59062
59576
  return result;
@@ -59070,8 +59584,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
59070
59584
  }
59071
59585
  const center = sphere.center;
59072
59586
  const radius = sphere.radius;
59073
- const vertexMax = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new import_core15.Vector3(center[0] + radius, center[1] + radius, center[2] + radius), new import_core15.Vector3());
59074
- const vertexMin = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new import_core15.Vector3(center[0] - radius, center[1] - radius, center[2] - radius), new import_core15.Vector3());
59587
+ const vertexMax = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new import_core14.Vector3(center[0] + radius, center[1] + radius, center[2] + radius), new import_core14.Vector3());
59588
+ const vertexMin = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new import_core14.Vector3(center[0] - radius, center[1] - radius, center[2] - radius), new import_core14.Vector3());
59075
59589
  return {
59076
59590
  xmin: Math.min(vertexMin[0], vertexMax[0]),
59077
59591
  xmax: Math.max(vertexMin[0], vertexMax[0]),
@@ -59083,13 +59597,13 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
59083
59597
  }
59084
59598
  function createObbFromMbs(mbs) {
59085
59599
  const radius = mbs[3];
59086
- const center = new import_core15.Vector3(mbs[0], mbs[1], mbs[2]);
59087
- const halfAxex = new import_core15.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
59600
+ const center = new import_core14.Vector3(mbs[0], mbs[1], mbs[2]);
59601
+ const halfAxex = new import_core14.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
59088
59602
  return new import_culling3.OrientedBoundingBox(center, halfAxex);
59089
59603
  }
59090
59604
 
59091
59605
  // src/i3s-converter/helpers/gltf-attributes.ts
59092
- var import_core16 = __toModule(require_es5());
59606
+ var import_core15 = __toModule(require_es5());
59093
59607
  var import_geospatial5 = __toModule(require_es52());
59094
59608
  function prepareDataForAttributesConversion(tileContent, tileTransform, boundingVolume) {
59095
59609
  let nodes = tileContent.gltf?.scene?.nodes || tileContent.gltf?.scenes?.[0]?.nodes || tileContent.gltf?.nodes || [];
@@ -59131,7 +59645,7 @@ function getB3DMAttributesWithoutBufferView(attributes) {
59131
59645
  function calculateTransformProps(tileContent, tileTransform, boundingVolume) {
59132
59646
  const { rtcCenter, gltfUpAxis } = tileContent;
59133
59647
  const { center } = boundingVolume;
59134
- let modelMatrix = new import_core16.Matrix4(tileTransform);
59648
+ let modelMatrix = new import_core15.Matrix4(tileTransform);
59135
59649
  if (rtcCenter) {
59136
59650
  modelMatrix.translate(rtcCenter);
59137
59651
  }
@@ -59139,18 +59653,18 @@ function calculateTransformProps(tileContent, tileTransform, boundingVolume) {
59139
59653
  case "Z":
59140
59654
  break;
59141
59655
  case "Y":
59142
- const rotationY = new import_core16.Matrix4().rotateX(Math.PI / 2);
59656
+ const rotationY = new import_core15.Matrix4().rotateX(Math.PI / 2);
59143
59657
  modelMatrix = modelMatrix.multiplyRight(rotationY);
59144
59658
  break;
59145
59659
  case "X":
59146
- const rotationX = new import_core16.Matrix4().rotateY(-Math.PI / 2);
59660
+ const rotationX = new import_core15.Matrix4().rotateY(-Math.PI / 2);
59147
59661
  modelMatrix = modelMatrix.multiplyRight(rotationX);
59148
59662
  break;
59149
59663
  default:
59150
59664
  break;
59151
59665
  }
59152
- const cartesianOrigin = new import_core16.Vector3(center);
59153
- const cartographicOrigin = import_geospatial5.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new import_core16.Vector3());
59666
+ const cartesianOrigin = new import_core15.Vector3(center);
59667
+ const cartographicOrigin = import_geospatial5.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new import_core15.Vector3());
59154
59668
  return { modelMatrix, cartographicOrigin };
59155
59669
  }
59156
59670
  function prepareNodes(nodes) {
@@ -59179,14 +59693,9 @@ function prepareNodes(nodes) {
59179
59693
  }
59180
59694
  }
59181
59695
 
59182
- // src/constants.ts
59183
- var BROWSER_ERROR_MESSAGE = "Tile converter does not work in browser, only in node js environment";
59184
- var EXT_MESH_FEATURES = "EXT_mesh_features";
59185
- var EXT_FEATURE_METADATA2 = "EXT_feature_metadata";
59186
-
59187
59696
  // src/i3s-converter/helpers/batch-ids-extensions.ts
59188
59697
  function getTextureByMetadataClass(tileContent, metadataClass) {
59189
- const extFeatureMetadata = tileContent.gltf?.extensions?.[EXT_FEATURE_METADATA2];
59698
+ const extFeatureMetadata = tileContent.gltf?.extensions?.[name3];
59190
59699
  if (!extFeatureMetadata?.featureTextures) {
59191
59700
  return null;
59192
59701
  }
@@ -59205,17 +59714,34 @@ function handleBatchIdsExtensions(attributes, primitive, images, featureTexture)
59205
59714
  }
59206
59715
  for (const [extensionName, extensionData] of Object.entries(extensions || {})) {
59207
59716
  switch (extensionName) {
59208
- case EXT_FEATURE_METADATA2:
59717
+ case name3:
59209
59718
  return handleExtFeatureMetadataExtension(attributes, extensionData, images, featureTexture);
59210
- case EXT_MESH_FEATURES:
59211
- console.warn("EXT_mesh_features extension is not supported yet");
59212
- return [];
59719
+ case name2:
59720
+ return handleExtMeshFeaturesExtension(attributes, extensionData);
59721
+ case name:
59722
+ return handleExtStructuralMetadataExtension(attributes, extensionData);
59213
59723
  default:
59214
59724
  return [];
59215
59725
  }
59216
59726
  }
59217
59727
  return [];
59218
59728
  }
59729
+ function handleExtStructuralMetadataExtension(attributes, extStructuralMetadata) {
59730
+ const dataAttributeNames = extStructuralMetadata?.dataAttributeNames;
59731
+ if (dataAttributeNames?.length) {
59732
+ const batchIdsAttribute = attributes[dataAttributeNames[0]];
59733
+ return batchIdsAttribute.value;
59734
+ }
59735
+ return [];
59736
+ }
59737
+ function handleExtMeshFeaturesExtension(attributes, extMeshFeatures) {
59738
+ const dataAttributeNames = extMeshFeatures?.dataAttributeNames;
59739
+ if (dataAttributeNames?.length) {
59740
+ const batchIdsAttribute = attributes[dataAttributeNames[0]];
59741
+ return batchIdsAttribute.value;
59742
+ }
59743
+ return [];
59744
+ }
59219
59745
  function handleExtFeatureMetadataExtension(attributes, extFeatureMetadata, images, featureTexture) {
59220
59746
  const featureIdAttribute = extFeatureMetadata?.featureIdAttributes?.[0];
59221
59747
  if (featureIdAttribute?.featureIds?.attribute) {
@@ -59279,8 +59805,8 @@ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, image
59279
59805
  for (let index = 0; index < textureCoordinates.length; index += 2) {
59280
59806
  const u = textureCoordinates[index];
59281
59807
  const v = textureCoordinates[index + 1];
59282
- const tx = Math.min(emod2(u) * image.width | 0, image.width - 1);
59283
- const ty = Math.min(emod2(v) * image.height | 0, image.height - 1);
59808
+ const tx = Math.min(emod(u) * image.width | 0, image.width - 1);
59809
+ const ty = Math.min(emod(v) * image.height | 0, image.height - 1);
59284
59810
  const offset = (ty * image.width + tx) * image.components + channels;
59285
59811
  const batchId = new Uint8Array(image.data)[offset];
59286
59812
  batchIds.push(batchId);
@@ -59290,9 +59816,6 @@ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, image
59290
59816
  }
59291
59817
  return batchIds;
59292
59818
  }
59293
- function emod2(n) {
59294
- return (n % 1 + 1) % 1;
59295
- }
59296
59819
 
59297
59820
  // src/i3s-converter/helpers/feature-attributes.ts
59298
59821
  function flattenPropertyTableByFeatureIds(featureIds, propertyTable) {
@@ -59305,16 +59828,18 @@ function flattenPropertyTableByFeatureIds(featureIds, propertyTable) {
59305
59828
  }
59306
59829
  function getPropertiesByFeatureIds(properties, featureIds) {
59307
59830
  const resultProperties = [];
59308
- for (const featureId of featureIds) {
59309
- const property = properties[featureId] || null;
59310
- resultProperties.push(property);
59831
+ if (properties) {
59832
+ for (const featureId of featureIds) {
59833
+ const property = properties[featureId] || null;
59834
+ resultProperties.push(property);
59835
+ }
59311
59836
  }
59312
59837
  return resultProperties;
59313
59838
  }
59314
59839
  function checkPropertiesLength(featureIds, propertyTable) {
59315
59840
  let needFlatten = false;
59316
59841
  for (const attribute of Object.values(propertyTable)) {
59317
- if (featureIds.length !== attribute.length) {
59842
+ if (!featureIds || !attribute || featureIds.length !== attribute.length) {
59318
59843
  needFlatten = true;
59319
59844
  }
59320
59845
  }
@@ -59453,7 +59978,7 @@ var SHORT_INT_TYPE2 = "Int32";
59453
59978
  var DOUBLE_TYPE2 = "Float64";
59454
59979
  var OBJECT_ID_TYPE2 = "Oid32";
59455
59980
  var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BATCHID"];
59456
- var scratchVector4 = new import_core17.Vector3();
59981
+ var scratchVector4 = new import_core16.Vector3();
59457
59982
  async function convertB3dmToI3sGeometry(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel, libraries, metadataClass) {
59458
59983
  const useCartesianPositions = generateBoundingVolumes;
59459
59984
  const materialAndTextureList = await convertMaterials(tileContent.gltf?.materials, shouldMergeMaterials);
@@ -59592,7 +60117,7 @@ async function convertAttributes(attributesData, materialAndTextureList, useCart
59592
60117
  }
59593
60118
  return attributesMap;
59594
60119
  }
59595
- function convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core17.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
60120
+ function convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core16.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
59596
60121
  if (nodes) {
59597
60122
  for (const node2 of nodes) {
59598
60123
  convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix, featureTexture);
@@ -59616,7 +60141,7 @@ function getCompositeTransformationMatrix(node2, matrix) {
59616
60141
  }
59617
60142
  return transformationMatrix;
59618
60143
  }
59619
- function convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core17.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
60144
+ function convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core16.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
59620
60145
  const transformationMatrix = getCompositeTransformationMatrix(node2, matrix);
59621
60146
  const mesh = node2.mesh;
59622
60147
  if (mesh) {
@@ -59624,7 +60149,7 @@ function convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, at
59624
60149
  }
59625
60150
  convertNodes(node2.children || [], images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix, featureTexture);
59626
60151
  }
59627
- function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new import_core17.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
60152
+ function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new import_core16.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
59628
60153
  for (const primitive of mesh.primitives) {
59629
60154
  let outputAttributes = null;
59630
60155
  let materialUvRegion;
@@ -59702,7 +60227,7 @@ function transformVertexArray(args) {
59702
60227
  for (let i = 0; i < indices.length; i++) {
59703
60228
  const coordIndex = indices[i] * VALUES_PER_VERTEX2;
59704
60229
  const vertex = vertices.subarray(coordIndex, coordIndex + VALUES_PER_VERTEX2);
59705
- let vertexVector = new import_core17.Vector3(Array.from(vertex));
60230
+ let vertexVector = new import_core16.Vector3(Array.from(vertex));
59706
60231
  vertexVector = attributeSpecificTransformation(vertexVector, args);
59707
60232
  newVertices[i * VALUES_PER_VERTEX2] = vertexVector.x;
59708
60233
  newVertices[i * VALUES_PER_VERTEX2 + 1] = vertexVector.y;
@@ -59954,10 +60479,10 @@ function convertGLTFMaterialToI3sSharedResources(gltfMaterial, nodeId) {
59954
60479
  }
59955
60480
  function extractSharedResourcesMaterialInfo(baseColorFactor, metallicFactor = 1) {
59956
60481
  const matDielectricColorComponent = 0.04 / 255;
59957
- const black = new import_core17.Vector4(0, 0, 0, 1);
59958
- const unitVector = new import_core17.Vector4(1, 1, 1, 1);
59959
- const dielectricSpecular = new import_core17.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
59960
- const baseColorVector = new import_core17.Vector4(baseColorFactor);
60482
+ const black = new import_core16.Vector4(0, 0, 0, 1);
60483
+ const unitVector = new import_core16.Vector4(1, 1, 1, 1);
60484
+ const dielectricSpecular = new import_core16.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
60485
+ const baseColorVector = new import_core16.Vector4(baseColorFactor);
59961
60486
  const firstOperand = unitVector.subtract(dielectricSpecular).multiply(baseColorVector);
59962
60487
  const diffuse = firstOperand.lerp(firstOperand, black, metallicFactor);
59963
60488
  dielectricSpecular[3] = 1;
@@ -60044,9 +60569,11 @@ function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attri
60044
60569
  };
60045
60570
  for (const propertyName in propertyTableWithObjectIds) {
60046
60571
  const type = getAttributeType2(propertyName, attributeStorageInfo);
60047
- const value = propertyTableWithObjectIds[propertyName];
60048
- const attributeBuffer = generateAttributeBuffer(type, value);
60049
- attributeBuffers.push(attributeBuffer);
60572
+ if (type) {
60573
+ const value = propertyTableWithObjectIds[propertyName];
60574
+ const attributeBuffer = generateAttributeBuffer(type, value);
60575
+ attributeBuffers.push(attributeBuffer);
60576
+ }
60050
60577
  }
60051
60578
  return attributeBuffers;
60052
60579
  }
@@ -60070,6 +60597,14 @@ function generateAttributeBuffer(type, value) {
60070
60597
  }
60071
60598
  function getAttributeType2(key, attributeStorageInfo) {
60072
60599
  const attribute = attributeStorageInfo.find((attr) => attr.name === key);
60600
+ if (!attribute) {
60601
+ console.error(`attribute is null, key=${key}, attributeStorageInfo=${JSON.stringify(attributeStorageInfo, null, 2)}`);
60602
+ return "";
60603
+ }
60604
+ if (!attribute.attributeValues) {
60605
+ console.error(`attributeValues is null, attribute=${attribute}`);
60606
+ return "";
60607
+ }
60073
60608
  return attribute.attributeValues.valueType;
60074
60609
  }
60075
60610
  function generateShortIntegerAttributeBuffer(featureIds) {
@@ -60166,25 +60701,35 @@ function getPropertyTable(tileContent, metadataClass) {
60166
60701
  if (!tileContent) {
60167
60702
  return null;
60168
60703
  }
60704
+ let propertyTable;
60169
60705
  const batchTableJson = tileContent?.batchTableJson;
60170
60706
  if (batchTableJson) {
60171
60707
  return batchTableJson;
60172
60708
  }
60173
60709
  const { extensionName, extension } = getPropertyTableExtension(tileContent);
60174
60710
  switch (extensionName) {
60175
- case EXT_MESH_FEATURES: {
60176
- console.warn("The I3S converter does not yet support the EXT_mesh_features extension");
60177
- return null;
60711
+ case name2: {
60712
+ propertyTable = getPropertyTableFromExtMeshFeatures(extension, metadataClass);
60713
+ return propertyTable;
60178
60714
  }
60179
- case EXT_FEATURE_METADATA2: {
60180
- return getPropertyTableFromExtFeatureMetadata(extension, metadataClass);
60715
+ case name: {
60716
+ propertyTable = getPropertyTableFromExtStructuralMetadata(extension, metadataClass);
60717
+ return propertyTable;
60718
+ }
60719
+ case name3: {
60720
+ propertyTable = getPropertyTableFromExtFeatureMetadata(extension, metadataClass);
60721
+ return propertyTable;
60181
60722
  }
60182
60723
  default:
60183
60724
  return null;
60184
60725
  }
60185
60726
  }
60186
60727
  function getPropertyTableExtension(tileContent) {
60187
- const extensionsWithPropertyTables = [EXT_FEATURE_METADATA2, EXT_MESH_FEATURES];
60728
+ const extensionsWithPropertyTables = [
60729
+ name3,
60730
+ name,
60731
+ name2
60732
+ ];
60188
60733
  const extensionsUsed = tileContent?.gltf?.extensionsUsed;
60189
60734
  if (!extensionsUsed) {
60190
60735
  return { extensionName: null, extension: null };
@@ -60234,6 +60779,40 @@ function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
60234
60779
  console.warn("The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension.");
60235
60780
  return null;
60236
60781
  }
60782
+ function getPropertyTableFromExtStructuralMetadata(extension, metadataClass) {
60783
+ if (extension?.propertyTables) {
60784
+ const firstPropertyTable = extension?.propertyTables[0];
60785
+ const propertyTableWithData = {};
60786
+ for (const propertyName in firstPropertyTable.properties) {
60787
+ propertyTableWithData[propertyName] = firstPropertyTable.properties[propertyName].data;
60788
+ }
60789
+ return propertyTableWithData;
60790
+ }
60791
+ if (extension?.propertyTextures) {
60792
+ if (extension?.propertyTextures) {
60793
+ const firstPropertyTexture = extension?.propertyTextures[0];
60794
+ const propertyTableWithData = {};
60795
+ for (const propertyName in firstPropertyTexture.properties) {
60796
+ propertyTableWithData[propertyName] = firstPropertyTexture.properties[propertyName].data;
60797
+ }
60798
+ return propertyTableWithData;
60799
+ }
60800
+ }
60801
+ console.warn("The I3S converter couldn't handle EXT_structural_metadata extension: There is neither propertyTables, no propertyTextures in the extension.");
60802
+ return null;
60803
+ }
60804
+ function getPropertyTableFromExtMeshFeatures(extension, metadataClass) {
60805
+ if (extension?.featureIds) {
60806
+ const firstFeatureId = extension?.featureIds[0];
60807
+ const propertyTableWithData = {};
60808
+ if (!firstFeatureId.propertyTable) {
60809
+ console.warn("Should be implemented as we have the tileset with Ext_mesh_features not linked with EXT_structural_metadata extension");
60810
+ }
60811
+ return propertyTableWithData;
60812
+ }
60813
+ console.warn("The I3S converter couldn't handle EXT_mesh_features extension: There is no featureIds in the extension.");
60814
+ return null;
60815
+ }
60237
60816
 
60238
60817
  // src/i3s-converter/helpers/create-scene-server-path.ts
60239
60818
  var import_json_map_transform2 = __toModule(require_json_map_transform());
@@ -60779,7 +61358,7 @@ function transfromTextureDefinitions(textureDefinitionInfos, thisObject, origina
60779
61358
 
60780
61359
  // src/i3s-converter/helpers/node-debug.ts
60781
61360
  var import_culling4 = __toModule(require_es53());
60782
- var import_core19 = __toModule(require_es5());
61361
+ var import_core18 = __toModule(require_es5());
60783
61362
  var import_geospatial7 = __toModule(require_es52());
60784
61363
  var CUBE_POSITIONS = new Float32Array([
60785
61364
  -1,
@@ -60896,7 +61475,7 @@ function getTileObbVertices(node2) {
60896
61475
  const obbCenterCartesian = import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(node2.obb.center);
60897
61476
  let vertices = [];
60898
61477
  for (let i = 0; i < positions.length; i += 3) {
60899
- const positionsVector = new import_core19.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
61478
+ const positionsVector = new import_core18.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
60900
61479
  const rotatedPositions = positionsVector.transformByQuaternion(node2.obb.quaternion).add(obbCenterCartesian);
60901
61480
  vertices = vertices.concat(rotatedPositions);
60902
61481
  }
@@ -61016,6 +61595,9 @@ var WriteQueue = class extends Queue {
61016
61595
  }
61017
61596
  };
61018
61597
 
61598
+ // src/constants.ts
61599
+ var BROWSER_ERROR_MESSAGE = "Tile converter does not work in browser, only in node js environment";
61600
+
61019
61601
  // src/i3s-converter/helpers/node-index-document.ts
61020
61602
  var import_path7 = __toModule(require("path"));
61021
61603
  var import_json_map_transform7 = __toModule(require_json_map_transform());
@@ -61270,7 +61852,8 @@ var NodeIndexDocument = class {
61270
61852
  }
61271
61853
  if (attributes && attributes.length && parentNode.converter.layers0?.attributeStorageInfo?.length) {
61272
61854
  node2.attributeData = [];
61273
- for (let index = 0; index < attributes.length; index++) {
61855
+ const minimumLength = attributes.length < parentNode.converter.layers0.attributeStorageInfo.length ? attributes.length : parentNode.converter.layers0.attributeStorageInfo.length;
61856
+ for (let index = 0; index < minimumLength; index++) {
61274
61857
  const folderName = parentNode.converter.layers0.attributeStorageInfo[index].key;
61275
61858
  node2.attributeData.push({ href: `./attributes/${folderName}/0` });
61276
61859
  }
@@ -61344,7 +61927,7 @@ function isNestedTileset(tile) {
61344
61927
  }
61345
61928
 
61346
61929
  // src/i3s-converter/i3s-converter.ts
61347
- var import_core23 = __toModule(require_es5());
61930
+ var import_core22 = __toModule(require_es5());
61348
61931
 
61349
61932
  // src/i3s-converter/helpers/tileset-traversal.ts
61350
61933
  var traverseDatasetWith = async (tile, traversalProps, processTile, postprocessTile, maxDepth, level = 0) => {
@@ -61407,7 +61990,7 @@ var getMeshTypesFromGltf = (gltfJson) => {
61407
61990
  };
61408
61991
  var getMetadataClassesFromGltf = (gltfJson) => {
61409
61992
  const result = new Set();
61410
- const classes = gltfJson.extensions?.[EXT_FEATURE_METADATA2]?.schema?.classes;
61993
+ const classes = gltfJson.extensions?.[name3]?.schema?.classes;
61411
61994
  if (classes) {
61412
61995
  for (const classKey of Object.keys(classes)) {
61413
61996
  result.add(classKey);
@@ -61625,7 +62208,7 @@ var I3SConverter = class {
61625
62208
  this.materialDefinitions = [];
61626
62209
  this.materialMap = new Map();
61627
62210
  const sourceRootTile = this.sourceTileset.root;
61628
- const sourceBoundingVolume = createBoundingVolume(sourceRootTile.boundingVolume, new import_core23.Matrix4(sourceRootTile.transform), null);
62211
+ const sourceBoundingVolume = createBoundingVolume(sourceRootTile.boundingVolume, new import_core22.Matrix4(sourceRootTile.transform), null);
61629
62212
  this._formLayers0(tilesetName, sourceBoundingVolume, this.sourceTileset?.root?.boundingVolume?.region);
61630
62213
  const boundingVolumes = createBoundingVolumes(sourceBoundingVolume, this.geoidHeightModel);
61631
62214
  await this.nodePages.push({
@@ -61636,7 +62219,7 @@ var I3SConverter = class {
61636
62219
  });
61637
62220
  const rootNode = await NodeIndexDocument.createRootNode(boundingVolumes, this);
61638
62221
  await traverseDatasetWith(sourceRootTile, {
61639
- transform: new import_core23.Matrix4(sourceRootTile.transform),
62222
+ transform: new import_core22.Matrix4(sourceRootTile.transform),
61640
62223
  parentNodes: [rootNode]
61641
62224
  }, this.convertTile.bind(this), this.finalizeTile.bind(this), this.options.maxDepth);
61642
62225
  this.layers0.materialDefinitions = this.materialDefinitions;
@@ -61756,7 +62339,7 @@ var I3SConverter = class {
61756
62339
  const sourceBoundingVolume = createBoundingVolume(sourceTile.boundingVolume, transformationMatrix, null);
61757
62340
  let boundingVolumes = createBoundingVolumes(sourceBoundingVolume, this.geoidHeightModel);
61758
62341
  const propertyTable = getPropertyTable(tileContent, this.options.metadataClass);
61759
- if (propertyTable && !this.layers0?.attributeStorageInfo?.length) {
62342
+ if (propertyTable) {
61760
62343
  this._convertPropertyTableToNodeAttributes(propertyTable);
61761
62344
  }
61762
62345
  const resourcesData = await this._convertResources(sourceTile, transformationMatrix, sourceBoundingVolume, tileContent, parentNode.inPageId, propertyTable);
@@ -61967,16 +62550,16 @@ var I3SConverter = class {
61967
62550
  }
61968
62551
  }
61969
62552
  }
61970
- async writeTextureFile(textureData, name10, format, childPath, slpkChildPath) {
62553
+ async writeTextureFile(textureData, name12, format, childPath, slpkChildPath) {
61971
62554
  if (this.options.slpk) {
61972
62555
  const slpkTexturePath = (0, import_path8.join)(childPath, "textures");
61973
62556
  const compress = false;
61974
62557
  await this.writeQueue.enqueue({
61975
- archiveKey: `${slpkChildPath}/textures/${name10}.${format}`,
61976
- writePromise: () => writeFileForSlpk(slpkTexturePath, textureData, `${name10}.${format}`, compress)
62558
+ archiveKey: `${slpkChildPath}/textures/${name12}.${format}`,
62559
+ writePromise: () => writeFileForSlpk(slpkTexturePath, textureData, `${name12}.${format}`, compress)
61977
62560
  });
61978
62561
  } else {
61979
- const texturePath = (0, import_path8.join)(childPath, `textures/${name10}/`);
62562
+ const texturePath = (0, import_path8.join)(childPath, `textures/${name12}/`);
61980
62563
  await this.writeQueue.enqueue({
61981
62564
  writePromise: () => writeFile3(texturePath, textureData, `index.${format}`)
61982
62565
  });
@@ -61984,7 +62567,8 @@ var I3SConverter = class {
61984
62567
  }
61985
62568
  async _writeAttributes(attributes = [], childPath, slpkChildPath) {
61986
62569
  if (attributes?.length && this.layers0?.attributeStorageInfo?.length) {
61987
- for (let index = 0; index < attributes.length; index++) {
62570
+ const minimumLength = attributes.length < this.layers0.attributeStorageInfo.length ? attributes.length : this.layers0.attributeStorageInfo.length;
62571
+ for (let index = 0; index < minimumLength; index++) {
61988
62572
  const folderName = this.layers0.attributeStorageInfo[index].key;
61989
62573
  const fileBuffer = new Uint8Array(attributes[index]);
61990
62574
  if (this.options.slpk) {
@@ -62040,16 +62624,19 @@ var I3SConverter = class {
62040
62624
  ...propertyTable
62041
62625
  };
62042
62626
  for (const key in propertyTableWithObjectId) {
62043
- const firstAttribute = propertyTableWithObjectId[key][0];
62044
- const attributeType = getAttributeType(key, firstAttribute);
62045
- const storageAttribute = createdStorageAttribute(attributeIndex, key, attributeType);
62046
- const fieldAttributeType = getFieldAttributeType(attributeType);
62047
- const fieldAttribute = createFieldAttribute(key, fieldAttributeType);
62048
- const popupInfo = createPopupInfo(propertyTableWithObjectId);
62049
- this.layers0.attributeStorageInfo.push(storageAttribute);
62050
- this.layers0.fields.push(fieldAttribute);
62051
- this.layers0.popupInfo = popupInfo;
62052
- this.layers0.layerType = _3D_OBJECT_LAYER_TYPE;
62627
+ const found = this.layers0.attributeStorageInfo.find((element) => element.name === key);
62628
+ if (!found) {
62629
+ const firstAttribute = propertyTableWithObjectId[key][0];
62630
+ const attributeType = getAttributeType(key, firstAttribute);
62631
+ const storageAttribute = createdStorageAttribute(attributeIndex, key, attributeType);
62632
+ const fieldAttributeType = getFieldAttributeType(attributeType);
62633
+ const fieldAttribute = createFieldAttribute(key, fieldAttributeType);
62634
+ const popupInfo = createPopupInfo(propertyTableWithObjectId);
62635
+ this.layers0.attributeStorageInfo.push(storageAttribute);
62636
+ this.layers0.fields.push(fieldAttribute);
62637
+ this.layers0.popupInfo = popupInfo;
62638
+ this.layers0.layerType = _3D_OBJECT_LAYER_TYPE;
62639
+ }
62053
62640
  attributeIndex += 1;
62054
62641
  }
62055
62642
  }
@@ -62112,7 +62699,7 @@ var import_process3 = __toModule(require("process"));
62112
62699
  var import_json_map_transform10 = __toModule(require_json_map_transform());
62113
62700
 
62114
62701
  // ../i3s/src/lib/parsers/constants.ts
62115
- var import_constants14 = __toModule(require_es55());
62702
+ var import_constants11 = __toModule(require_es55());
62116
62703
  function getConstructorForDataFormat(dataType) {
62117
62704
  switch (dataType) {
62118
62705
  case "UInt8":
@@ -62130,11 +62717,11 @@ function getConstructorForDataFormat(dataType) {
62130
62717
  }
62131
62718
  }
62132
62719
  var GL_TYPE_MAP = {
62133
- UInt8: import_constants14.default.UNSIGNED_BYTE,
62134
- UInt16: import_constants14.default.UNSIGNED_SHORT,
62135
- Float32: import_constants14.default.FLOAT,
62136
- UInt32: import_constants14.default.UNSIGNED_INT,
62137
- UInt64: import_constants14.default.DOUBLE
62720
+ UInt8: import_constants11.default.UNSIGNED_BYTE,
62721
+ UInt16: import_constants11.default.UNSIGNED_SHORT,
62722
+ Float32: import_constants11.default.FLOAT,
62723
+ UInt32: import_constants11.default.UNSIGNED_INT,
62724
+ UInt64: import_constants11.default.DOUBLE
62138
62725
  };
62139
62726
  function sizeOf(dataType) {
62140
62727
  switch (dataType) {
@@ -62169,7 +62756,7 @@ var COORDINATE_SYSTEM;
62169
62756
  })(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
62170
62757
 
62171
62758
  // ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
62172
- var import_core26 = __toModule(require_es5());
62759
+ var import_core25 = __toModule(require_es5());
62173
62760
  var import_geospatial8 = __toModule(require_es52());
62174
62761
 
62175
62762
  // ../i3s/src/types.ts
@@ -62286,7 +62873,7 @@ async function customizeColors(colors, featureIds, tileOptions, tilesetOptions,
62286
62873
  if (!options?.i3s?.colorsByAttribute) {
62287
62874
  return colors;
62288
62875
  }
62289
- const colorizeAttributeField = tilesetOptions.fields.find(({ name: name10 }) => name10 === options?.i3s?.colorsByAttribute?.attributeName);
62876
+ const colorizeAttributeField = tilesetOptions.fields.find(({ name: name12 }) => name12 === options?.i3s?.colorsByAttribute?.attributeName);
62290
62877
  if (!colorizeAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(colorizeAttributeField.type)) {
62291
62878
  return colors;
62292
62879
  }
@@ -62334,7 +62921,7 @@ function calculateColorForAttribute(attributeValue, options) {
62334
62921
  return color;
62335
62922
  }
62336
62923
  async function loadFeatureAttributeData(attributeName, { attributeUrls }, { attributeStorageInfo }, options) {
62337
- const attributeIndex = attributeStorageInfo.findIndex(({ name: name10 }) => attributeName === name10);
62924
+ const attributeIndex = attributeStorageInfo.findIndex(({ name: name12 }) => attributeName === name12);
62338
62925
  if (attributeIndex === -1) {
62339
62926
  return null;
62340
62927
  }
@@ -62348,7 +62935,7 @@ async function loadFeatureAttributeData(attributeName, { attributeUrls }, { attr
62348
62935
  }
62349
62936
 
62350
62937
  // ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
62351
- var scratchVector5 = new import_core26.Vector3([0, 0, 0]);
62938
+ var scratchVector5 = new import_core25.Vector3([0, 0, 0]);
62352
62939
  function getLoaderForTextureFormat(textureFormat) {
62353
62940
  switch (textureFormat) {
62354
62941
  case "ktx-etc2":
@@ -62369,7 +62956,7 @@ async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, opt
62369
62956
  indices: null,
62370
62957
  featureIds: [],
62371
62958
  vertexCount: 0,
62372
- modelMatrix: new import_core26.Matrix4(),
62959
+ modelMatrix: new import_core25.Matrix4(),
62373
62960
  coordinateSystem: 0,
62374
62961
  byteLength: 0,
62375
62962
  texture: null
@@ -62596,9 +63183,9 @@ function parsePositions2(attribute, options) {
62596
63183
  const mbs = options.mbs;
62597
63184
  const value = attribute.value;
62598
63185
  const metadata = attribute.metadata;
62599
- const enuMatrix = new import_core26.Matrix4();
62600
- const cartographicOrigin = new import_core26.Vector3(mbs[0], mbs[1], mbs[2]);
62601
- const cartesianOrigin = new import_core26.Vector3();
63186
+ const enuMatrix = new import_core25.Matrix4();
63187
+ const cartographicOrigin = new import_core25.Vector3(mbs[0], mbs[1], mbs[2]);
63188
+ const cartesianOrigin = new import_core25.Vector3();
62602
63189
  import_geospatial8.Ellipsoid.WGS84.cartographicToCartesian(cartographicOrigin, cartesianOrigin);
62603
63190
  import_geospatial8.Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin, enuMatrix);
62604
63191
  attribute.value = offsetsToCartesians(value, metadata, cartographicOrigin);
@@ -62625,7 +63212,7 @@ function getModelMatrix(positions) {
62625
63212
  const metadata = positions.metadata;
62626
63213
  const scaleX = metadata?.["i3s-scale_x"]?.double || 1;
62627
63214
  const scaleY = metadata?.["i3s-scale_y"]?.double || 1;
62628
- const modelMatrix = new import_core26.Matrix4();
63215
+ const modelMatrix = new import_core25.Matrix4();
62629
63216
  modelMatrix[0] = scaleX;
62630
63217
  modelMatrix[5] = scaleY;
62631
63218
  return modelMatrix;
@@ -63107,7 +63694,7 @@ function getMagicNumber(data) {
63107
63694
  }
63108
63695
 
63109
63696
  // src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.ts
63110
- var import_core30 = __toModule(require_es5());
63697
+ var import_core29 = __toModule(require_es5());
63111
63698
  var import_geospatial10 = __toModule(require_es52());
63112
63699
  var import_culling6 = __toModule(require_es53());
63113
63700
  function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
@@ -63116,7 +63703,7 @@ function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
63116
63703
  i3SObb.center[1],
63117
63704
  i3SObb.center[2] + geoidHeightModel.getHeight(i3SObb.center[1], i3SObb.center[0])
63118
63705
  ];
63119
- const cartesianCenter = import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core30.Vector3());
63706
+ const cartesianCenter = import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core29.Vector3());
63120
63707
  const tiles3DObb = new import_culling6.OrientedBoundingBox().fromCenterHalfSizeQuaternion(cartesianCenter, i3SObb.halfSize, i3SObb.quaternion);
63121
63708
  return [...tiles3DObb.center, ...tiles3DObb.halfAxes.toArray()];
63122
63709
  }
@@ -63160,7 +63747,7 @@ var TILESET = () => ({
63160
63747
  });
63161
63748
 
63162
63749
  // src/3d-tiles-converter/helpers/b3dm-converter.ts
63163
- var import_core32 = __toModule(require_es5());
63750
+ var import_core31 = __toModule(require_es5());
63164
63751
  var import_geospatial11 = __toModule(require_es52());
63165
63752
 
63166
63753
  // src/3d-tiles-converter/helpers/texture-atlas.ts
@@ -63195,8 +63782,8 @@ function normalizeRegions(regions) {
63195
63782
  }
63196
63783
 
63197
63784
  // src/3d-tiles-converter/helpers/b3dm-converter.ts
63198
- var Z_UP_TO_Y_UP_MATRIX = new import_core32.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
63199
- var scratchVector6 = new import_core32.Vector3();
63785
+ var Z_UP_TO_Y_UP_MATRIX = new import_core31.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
63786
+ var scratchVector6 = new import_core31.Vector3();
63200
63787
  var B3dmConverter = class {
63201
63788
  async convert(i3sAttributesData, featureAttributes = null) {
63202
63789
  const gltf = await this.buildGltf(i3sAttributesData, featureAttributes);
@@ -63220,8 +63807,8 @@ var B3dmConverter = class {
63220
63807
  if (attributes.uvRegions && attributes.texCoords) {
63221
63808
  attributes.texCoords.value = convertTextureAtlas(attributes.texCoords.value, attributes.uvRegions.value);
63222
63809
  }
63223
- const cartesianOrigin = new import_core32.Vector3(box);
63224
- const cartographicOrigin = import_geospatial11.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new import_core32.Vector3());
63810
+ const cartesianOrigin = new import_core31.Vector3(box);
63811
+ const cartographicOrigin = import_geospatial11.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new import_core31.Vector3());
63225
63812
  attributes.positions.value = this._normalizePositions(positionsValue, cartesianOrigin, cartographicOrigin, modelMatrix);
63226
63813
  this._createBatchIds(tileContent, featureAttributes);
63227
63814
  if (attributes.normals && !this._checkNormals(attributes.normals.value)) {
@@ -63261,8 +63848,8 @@ var B3dmConverter = class {
63261
63848
  const newPositionsValue = new Float32Array(positionsValue.length);
63262
63849
  for (let index = 0; index < positionsValue.length; index += 3) {
63263
63850
  const vertex = positionsValue.subarray(index, index + 3);
63264
- const cartesianOriginVector = new import_core32.Vector3(cartesianOrigin);
63265
- let vertexVector = new import_core32.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
63851
+ const cartesianOriginVector = new import_core31.Vector3(cartesianOrigin);
63852
+ let vertexVector = new import_core31.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
63266
63853
  import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector6);
63267
63854
  vertexVector = scratchVector6.subtract(cartesianOriginVector);
63268
63855
  newPositionsValue.set(vertexVector, index);
@@ -63270,7 +63857,7 @@ var B3dmConverter = class {
63270
63857
  return newPositionsValue;
63271
63858
  }
63272
63859
  _generateTransformMatrix(cartesianOrigin) {
63273
- const translateOriginMatrix = new import_core32.Matrix4().translate(cartesianOrigin);
63860
+ const translateOriginMatrix = new import_core31.Matrix4().translate(cartesianOrigin);
63274
63861
  const result = translateOriginMatrix.multiplyLeft(Z_UP_TO_Y_UP_MATRIX);
63275
63862
  return result;
63276
63863
  }