@loaders.gl/i3s 3.1.3 → 3.1.7

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.
@@ -55,9 +55,8 @@
55
55
  var nodeVersion = matches && parseFloat(matches[1]) || 0;
56
56
 
57
57
  // ../worker-utils/src/lib/env-utils/version.ts
58
- var DEFAULT_VERSION = "latest";
59
- var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
60
- if (typeof __VERSION__ === "undefined") {
58
+ var VERSION = true ? "3.1.7" : DEFAULT_VERSION;
59
+ if (false) {
61
60
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
62
61
  }
63
62
 
@@ -751,6 +750,21 @@
751
750
  return concatenateArrayBuffers(...arrayBuffers);
752
751
  }
753
752
 
753
+ // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
754
+ function _defineProperty(obj, key, value) {
755
+ if (key in obj) {
756
+ Object.defineProperty(obj, key, {
757
+ value,
758
+ enumerable: true,
759
+ configurable: true,
760
+ writable: true
761
+ });
762
+ } else {
763
+ obj[key] = value;
764
+ }
765
+ return obj;
766
+ }
767
+
754
768
  // ../loader-utils/src/lib/path-utils/file-aliases.ts
755
769
  var pathPrefix = "";
756
770
  var fileAliases = {};
@@ -1002,7 +1016,7 @@
1002
1016
  var process_ = globals3.process || {};
1003
1017
 
1004
1018
  // ../../node_modules/probe.gl/dist/esm/utils/globals.js
1005
- var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
1019
+ var VERSION3 = true ? "3.1.7" : "untranspiled source";
1006
1020
  var isBrowser4 = isBrowser3();
1007
1021
 
1008
1022
  // ../../node_modules/probe.gl/dist/esm/utils/local-storage.js
@@ -1711,6 +1725,555 @@
1711
1725
  return getGlobalLoaderRegistry();
1712
1726
  }
1713
1727
 
1728
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
1729
+ function isElectron2(mockUserAgent) {
1730
+ if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
1731
+ return true;
1732
+ }
1733
+ if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
1734
+ return true;
1735
+ }
1736
+ const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
1737
+ const userAgent = mockUserAgent || realUserAgent;
1738
+ if (userAgent && userAgent.indexOf("Electron") >= 0) {
1739
+ return true;
1740
+ }
1741
+ return false;
1742
+ }
1743
+
1744
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
1745
+ function isBrowser5() {
1746
+ const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
1747
+ return !isNode || isElectron2();
1748
+ }
1749
+
1750
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
1751
+ var globals4 = {
1752
+ self: typeof self !== "undefined" && self,
1753
+ window: typeof window !== "undefined" && window,
1754
+ global: typeof global !== "undefined" && global,
1755
+ document: typeof document !== "undefined" && document,
1756
+ process: typeof process === "object" && process
1757
+ };
1758
+ var self_4 = globals4.self || globals4.window || globals4.global;
1759
+ var window_4 = globals4.window || globals4.self || globals4.global;
1760
+ var document_4 = globals4.document || {};
1761
+ var process_2 = globals4.process || {};
1762
+
1763
+ // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
1764
+ var VERSION4 = true ? "3.1.7" : "untranspiled source";
1765
+ var isBrowser6 = isBrowser5();
1766
+
1767
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
1768
+ function getStorage2(type) {
1769
+ try {
1770
+ const storage = window[type];
1771
+ const x = "__storage_test__";
1772
+ storage.setItem(x, x);
1773
+ storage.removeItem(x);
1774
+ return storage;
1775
+ } catch (e2) {
1776
+ return null;
1777
+ }
1778
+ }
1779
+ var LocalStorage2 = class {
1780
+ constructor(id) {
1781
+ let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1782
+ let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
1783
+ _defineProperty(this, "storage", void 0);
1784
+ _defineProperty(this, "id", void 0);
1785
+ _defineProperty(this, "config", {});
1786
+ this.storage = getStorage2(type);
1787
+ this.id = id;
1788
+ this.config = {};
1789
+ Object.assign(this.config, defaultSettings);
1790
+ this._loadConfiguration();
1791
+ }
1792
+ getConfiguration() {
1793
+ return this.config;
1794
+ }
1795
+ setConfiguration(configuration) {
1796
+ this.config = {};
1797
+ return this.updateConfiguration(configuration);
1798
+ }
1799
+ updateConfiguration(configuration) {
1800
+ Object.assign(this.config, configuration);
1801
+ if (this.storage) {
1802
+ const serialized = JSON.stringify(this.config);
1803
+ this.storage.setItem(this.id, serialized);
1804
+ }
1805
+ return this;
1806
+ }
1807
+ _loadConfiguration() {
1808
+ let configuration = {};
1809
+ if (this.storage) {
1810
+ const serializedConfiguration = this.storage.getItem(this.id);
1811
+ configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
1812
+ }
1813
+ Object.assign(this.config, configuration);
1814
+ return this;
1815
+ }
1816
+ };
1817
+
1818
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
1819
+ function formatTime2(ms) {
1820
+ let formatted;
1821
+ if (ms < 10) {
1822
+ formatted = "".concat(ms.toFixed(2), "ms");
1823
+ } else if (ms < 100) {
1824
+ formatted = "".concat(ms.toFixed(1), "ms");
1825
+ } else if (ms < 1e3) {
1826
+ formatted = "".concat(ms.toFixed(0), "ms");
1827
+ } else {
1828
+ formatted = "".concat((ms / 1e3).toFixed(2), "s");
1829
+ }
1830
+ return formatted;
1831
+ }
1832
+ function leftPad2(string) {
1833
+ let length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
1834
+ const padLength = Math.max(length2 - string.length, 0);
1835
+ return "".concat(" ".repeat(padLength)).concat(string);
1836
+ }
1837
+ function formatImage2(image, message, scale2) {
1838
+ let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
1839
+ const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
1840
+ if (image.width > maxWidth) {
1841
+ scale2 = Math.min(scale2, maxWidth / image.width);
1842
+ }
1843
+ const width = image.width * scale2;
1844
+ const height = image.height * scale2;
1845
+ const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
1846
+ return ["".concat(message, " %c+"), style];
1847
+ }
1848
+
1849
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
1850
+ var COLOR2;
1851
+ (function(COLOR3) {
1852
+ COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
1853
+ COLOR3[COLOR3["RED"] = 31] = "RED";
1854
+ COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
1855
+ COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
1856
+ COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
1857
+ COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
1858
+ COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
1859
+ COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
1860
+ COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
1861
+ COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
1862
+ COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
1863
+ COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
1864
+ COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
1865
+ COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
1866
+ COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
1867
+ COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
1868
+ })(COLOR2 || (COLOR2 = {}));
1869
+ function getColor2(color) {
1870
+ return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
1871
+ }
1872
+ function addColor2(string, color, background) {
1873
+ if (!isBrowser5 && typeof string === "string") {
1874
+ if (color) {
1875
+ color = getColor2(color);
1876
+ string = "[".concat(color, "m").concat(string, "");
1877
+ }
1878
+ if (background) {
1879
+ color = getColor2(background);
1880
+ string = "[".concat(background + 10, "m").concat(string, "");
1881
+ }
1882
+ }
1883
+ return string;
1884
+ }
1885
+
1886
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
1887
+ function autobind2(obj) {
1888
+ let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
1889
+ const proto = Object.getPrototypeOf(obj);
1890
+ const propNames = Object.getOwnPropertyNames(proto);
1891
+ for (const key of propNames) {
1892
+ if (typeof obj[key] === "function") {
1893
+ if (!predefined.find((name) => key === name)) {
1894
+ obj[key] = obj[key].bind(obj);
1895
+ }
1896
+ }
1897
+ }
1898
+ }
1899
+
1900
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
1901
+ function assert4(condition, message) {
1902
+ if (!condition) {
1903
+ throw new Error(message || "Assertion failed");
1904
+ }
1905
+ }
1906
+
1907
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
1908
+ function getHiResTimestamp3() {
1909
+ let timestamp;
1910
+ if (isBrowser5 && "performance" in window_4) {
1911
+ var _window$performance, _window$performance$n;
1912
+ timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
1913
+ } else if ("hrtime" in process_2) {
1914
+ var _process$hrtime;
1915
+ const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
1916
+ timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
1917
+ } else {
1918
+ timestamp = Date.now();
1919
+ }
1920
+ return timestamp;
1921
+ }
1922
+
1923
+ // ../../node_modules/@probe.gl/log/dist/esm/log.js
1924
+ var originalConsole2 = {
1925
+ debug: isBrowser5 ? console.debug || console.log : console.log,
1926
+ log: console.log,
1927
+ info: console.info,
1928
+ warn: console.warn,
1929
+ error: console.error
1930
+ };
1931
+ var DEFAULT_SETTINGS2 = {
1932
+ enabled: true,
1933
+ level: 0
1934
+ };
1935
+ function noop2() {
1936
+ }
1937
+ var cache2 = {};
1938
+ var ONCE2 = {
1939
+ once: true
1940
+ };
1941
+ var Log2 = class {
1942
+ constructor() {
1943
+ let {
1944
+ id
1945
+ } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
1946
+ id: ""
1947
+ };
1948
+ _defineProperty(this, "id", void 0);
1949
+ _defineProperty(this, "VERSION", VERSION4);
1950
+ _defineProperty(this, "_startTs", getHiResTimestamp3());
1951
+ _defineProperty(this, "_deltaTs", getHiResTimestamp3());
1952
+ _defineProperty(this, "_storage", void 0);
1953
+ _defineProperty(this, "userData", {});
1954
+ _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
1955
+ this.id = id;
1956
+ this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
1957
+ this.userData = {};
1958
+ this.timeStamp("".concat(this.id, " started"));
1959
+ autobind2(this);
1960
+ Object.seal(this);
1961
+ }
1962
+ set level(newLevel) {
1963
+ this.setLevel(newLevel);
1964
+ }
1965
+ get level() {
1966
+ return this.getLevel();
1967
+ }
1968
+ isEnabled() {
1969
+ return this._storage.config.enabled;
1970
+ }
1971
+ getLevel() {
1972
+ return this._storage.config.level;
1973
+ }
1974
+ getTotal() {
1975
+ return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
1976
+ }
1977
+ getDelta() {
1978
+ return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
1979
+ }
1980
+ set priority(newPriority) {
1981
+ this.level = newPriority;
1982
+ }
1983
+ get priority() {
1984
+ return this.level;
1985
+ }
1986
+ getPriority() {
1987
+ return this.level;
1988
+ }
1989
+ enable() {
1990
+ let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
1991
+ this._storage.updateConfiguration({
1992
+ enabled
1993
+ });
1994
+ return this;
1995
+ }
1996
+ setLevel(level) {
1997
+ this._storage.updateConfiguration({
1998
+ level
1999
+ });
2000
+ return this;
2001
+ }
2002
+ get(setting) {
2003
+ return this._storage.config[setting];
2004
+ }
2005
+ set(setting, value) {
2006
+ this._storage.updateConfiguration({
2007
+ [setting]: value
2008
+ });
2009
+ }
2010
+ settings() {
2011
+ if (console.table) {
2012
+ console.table(this._storage.config);
2013
+ } else {
2014
+ console.log(this._storage.config);
2015
+ }
2016
+ }
2017
+ assert(condition, message) {
2018
+ assert4(condition, message);
2019
+ }
2020
+ warn(message) {
2021
+ return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
2022
+ }
2023
+ error(message) {
2024
+ return this._getLogFunction(0, message, originalConsole2.error, arguments);
2025
+ }
2026
+ deprecated(oldUsage, newUsage) {
2027
+ return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
2028
+ }
2029
+ removed(oldUsage, newUsage) {
2030
+ return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
2031
+ }
2032
+ probe(logLevel, message) {
2033
+ return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
2034
+ time: true,
2035
+ once: true
2036
+ });
2037
+ }
2038
+ log(logLevel, message) {
2039
+ return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
2040
+ }
2041
+ info(logLevel, message) {
2042
+ return this._getLogFunction(logLevel, message, console.info, arguments);
2043
+ }
2044
+ once(logLevel, message) {
2045
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
2046
+ args[_key - 2] = arguments[_key];
2047
+ }
2048
+ return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
2049
+ }
2050
+ table(logLevel, table, columns) {
2051
+ if (table) {
2052
+ return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
2053
+ tag: getTableHeader2(table)
2054
+ });
2055
+ }
2056
+ return noop2;
2057
+ }
2058
+ image(_ref) {
2059
+ let {
2060
+ logLevel,
2061
+ priority,
2062
+ image,
2063
+ message = "",
2064
+ scale: scale2 = 1
2065
+ } = _ref;
2066
+ if (!this._shouldLog(logLevel || priority)) {
2067
+ return noop2;
2068
+ }
2069
+ return isBrowser5 ? logImageInBrowser2({
2070
+ image,
2071
+ message,
2072
+ scale: scale2
2073
+ }) : logImageInNode2({
2074
+ image,
2075
+ message,
2076
+ scale: scale2
2077
+ });
2078
+ }
2079
+ time(logLevel, message) {
2080
+ return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
2081
+ }
2082
+ timeEnd(logLevel, message) {
2083
+ return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
2084
+ }
2085
+ timeStamp(logLevel, message) {
2086
+ return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
2087
+ }
2088
+ group(logLevel, message) {
2089
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
2090
+ collapsed: false
2091
+ };
2092
+ const options = normalizeArguments2({
2093
+ logLevel,
2094
+ message,
2095
+ opts
2096
+ });
2097
+ const {
2098
+ collapsed
2099
+ } = opts;
2100
+ options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
2101
+ return this._getLogFunction(options);
2102
+ }
2103
+ groupCollapsed(logLevel, message) {
2104
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2105
+ return this.group(logLevel, message, Object.assign({}, opts, {
2106
+ collapsed: true
2107
+ }));
2108
+ }
2109
+ groupEnd(logLevel) {
2110
+ return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
2111
+ }
2112
+ withGroup(logLevel, message, func) {
2113
+ this.group(logLevel, message)();
2114
+ try {
2115
+ func();
2116
+ } finally {
2117
+ this.groupEnd(logLevel)();
2118
+ }
2119
+ }
2120
+ trace() {
2121
+ if (console.trace) {
2122
+ console.trace();
2123
+ }
2124
+ }
2125
+ _shouldLog(logLevel) {
2126
+ return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
2127
+ }
2128
+ _getLogFunction(logLevel, message, method, args, opts) {
2129
+ if (this._shouldLog(logLevel)) {
2130
+ opts = normalizeArguments2({
2131
+ logLevel,
2132
+ message,
2133
+ args,
2134
+ opts
2135
+ });
2136
+ method = method || opts.method;
2137
+ assert4(method);
2138
+ opts.total = this.getTotal();
2139
+ opts.delta = this.getDelta();
2140
+ this._deltaTs = getHiResTimestamp3();
2141
+ const tag = opts.tag || opts.message;
2142
+ if (opts.once) {
2143
+ if (!cache2[tag]) {
2144
+ cache2[tag] = getHiResTimestamp3();
2145
+ } else {
2146
+ return noop2;
2147
+ }
2148
+ }
2149
+ message = decorateMessage2(this.id, opts.message, opts);
2150
+ return method.bind(console, message, ...opts.args);
2151
+ }
2152
+ return noop2;
2153
+ }
2154
+ };
2155
+ _defineProperty(Log2, "VERSION", VERSION4);
2156
+ function normalizeLogLevel2(logLevel) {
2157
+ if (!logLevel) {
2158
+ return 0;
2159
+ }
2160
+ let resolvedLevel;
2161
+ switch (typeof logLevel) {
2162
+ case "number":
2163
+ resolvedLevel = logLevel;
2164
+ break;
2165
+ case "object":
2166
+ resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
2167
+ break;
2168
+ default:
2169
+ return 0;
2170
+ }
2171
+ assert4(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
2172
+ return resolvedLevel;
2173
+ }
2174
+ function normalizeArguments2(opts) {
2175
+ const {
2176
+ logLevel,
2177
+ message
2178
+ } = opts;
2179
+ opts.logLevel = normalizeLogLevel2(logLevel);
2180
+ const args = opts.args ? Array.from(opts.args) : [];
2181
+ while (args.length && args.shift() !== message) {
2182
+ }
2183
+ switch (typeof logLevel) {
2184
+ case "string":
2185
+ case "function":
2186
+ if (message !== void 0) {
2187
+ args.unshift(message);
2188
+ }
2189
+ opts.message = logLevel;
2190
+ break;
2191
+ case "object":
2192
+ Object.assign(opts, logLevel);
2193
+ break;
2194
+ default:
2195
+ }
2196
+ if (typeof opts.message === "function") {
2197
+ opts.message = opts.message();
2198
+ }
2199
+ const messageType = typeof opts.message;
2200
+ assert4(messageType === "string" || messageType === "object");
2201
+ return Object.assign(opts, {
2202
+ args
2203
+ }, opts.opts);
2204
+ }
2205
+ function decorateMessage2(id, message, opts) {
2206
+ if (typeof message === "string") {
2207
+ const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
2208
+ message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
2209
+ message = addColor2(message, opts.color, opts.background);
2210
+ }
2211
+ return message;
2212
+ }
2213
+ function logImageInNode2(_ref2) {
2214
+ let {
2215
+ image,
2216
+ message = "",
2217
+ scale: scale2 = 1
2218
+ } = _ref2;
2219
+ let asciify = null;
2220
+ try {
2221
+ asciify = module.require("asciify-image");
2222
+ } catch (error) {
2223
+ }
2224
+ if (asciify) {
2225
+ return () => asciify(image, {
2226
+ fit: "box",
2227
+ width: "".concat(Math.round(80 * scale2), "%")
2228
+ }).then((data) => console.log(data));
2229
+ }
2230
+ return noop2;
2231
+ }
2232
+ function logImageInBrowser2(_ref3) {
2233
+ let {
2234
+ image,
2235
+ message = "",
2236
+ scale: scale2 = 1
2237
+ } = _ref3;
2238
+ if (typeof image === "string") {
2239
+ const img = new Image();
2240
+ img.onload = () => {
2241
+ const args = formatImage2(img, message, scale2);
2242
+ console.log(...args);
2243
+ };
2244
+ img.src = image;
2245
+ return noop2;
2246
+ }
2247
+ const element = image.nodeName || "";
2248
+ if (element.toLowerCase() === "img") {
2249
+ console.log(...formatImage2(image, message, scale2));
2250
+ return noop2;
2251
+ }
2252
+ if (element.toLowerCase() === "canvas") {
2253
+ const img = new Image();
2254
+ img.onload = () => console.log(...formatImage2(img, message, scale2));
2255
+ img.src = image.toDataURL();
2256
+ return noop2;
2257
+ }
2258
+ return noop2;
2259
+ }
2260
+ function getTableHeader2(table) {
2261
+ for (const key in table) {
2262
+ for (const title in table[key]) {
2263
+ return title || "untitled";
2264
+ }
2265
+ }
2266
+ return "empty";
2267
+ }
2268
+
2269
+ // ../../node_modules/@probe.gl/log/dist/esm/index.js
2270
+ var esm_default2 = new Log2({
2271
+ id: "@probe.gl/log"
2272
+ });
2273
+
2274
+ // ../core/src/lib/utils/log.ts
2275
+ var log = new Log2({ id: "loaders.gl" });
2276
+
1714
2277
  // ../core/src/lib/api/select-loader.ts
1715
2278
  var EXT_PATTERN = /\.([^.]+)$/;
1716
2279
  async function selectLoader(data, loaders = [], options, context) {
@@ -1755,13 +2318,22 @@
1755
2318
  const { url, type } = getResourceUrlAndType(data);
1756
2319
  const testUrl = url || context?.url;
1757
2320
  let loader = null;
2321
+ let reason = "";
1758
2322
  if (options?.mimeType) {
1759
2323
  loader = findLoaderByMIMEType(loaders, options?.mimeType);
2324
+ reason = `match forced by supplied MIME type ${options?.mimeType}`;
1760
2325
  }
1761
2326
  loader = loader || findLoaderByUrl(loaders, testUrl);
2327
+ reason = reason || (loader ? `matched url ${testUrl}` : "");
1762
2328
  loader = loader || findLoaderByMIMEType(loaders, type);
2329
+ reason = reason || (loader ? `matched MIME type ${type}` : "");
1763
2330
  loader = loader || findLoaderByInitialBytes(loaders, data);
2331
+ reason = reason || (loader ? `matched initial data ${getFirstCharacters(data)}` : "");
1764
2332
  loader = loader || findLoaderByMIMEType(loaders, options?.fallbackMimeType);
2333
+ reason = reason || (loader ? `matched fallback MIME type ${type}` : "");
2334
+ if (reason) {
2335
+ log.log(1, `selectLoader selected ${loader?.name}: ${reason}.`);
2336
+ }
1765
2337
  return loader;
1766
2338
  }
1767
2339
  function validHTTPResponse(data) {
@@ -2119,7 +2691,7 @@
2119
2691
  }
2120
2692
 
2121
2693
  // ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
2122
- function assert4(condition, message) {
2694
+ function assert5(condition, message) {
2123
2695
  if (!condition) {
2124
2696
  throw new Error("math.gl assertion ".concat(message));
2125
2697
  }
@@ -2231,7 +2803,7 @@
2231
2803
  }
2232
2804
  var MathArray = class extends _extendableBuiltin(Array) {
2233
2805
  get ELEMENTS() {
2234
- assert4(false);
2806
+ assert5(false);
2235
2807
  return 0;
2236
2808
  }
2237
2809
  clone() {
@@ -2446,11 +3018,11 @@
2446
3018
  // ../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js
2447
3019
  var Vector = class extends MathArray {
2448
3020
  get ELEMENTS() {
2449
- assert4(false);
3021
+ assert5(false);
2450
3022
  return 0;
2451
3023
  }
2452
3024
  copy(vector) {
2453
- assert4(false);
3025
+ assert5(false);
2454
3026
  return this;
2455
3027
  }
2456
3028
  get x() {
@@ -2534,11 +3106,11 @@
2534
3106
  return this.distanceSquared(vector);
2535
3107
  }
2536
3108
  getComponent(i2) {
2537
- assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
3109
+ assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
2538
3110
  return checkNumber(this[i2]);
2539
3111
  }
2540
3112
  setComponent(i2, value) {
2541
- assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
3113
+ assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
2542
3114
  this[i2] = value;
2543
3115
  return this.check();
2544
3116
  }
@@ -2886,11 +3458,11 @@
2886
3458
  // ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
2887
3459
  var Matrix = class extends MathArray {
2888
3460
  get ELEMENTS() {
2889
- assert4(false);
3461
+ assert5(false);
2890
3462
  return 0;
2891
3463
  }
2892
3464
  get RANK() {
2893
- assert4(false);
3465
+ assert5(false);
2894
3466
  return 0;
2895
3467
  }
2896
3468
  toString() {
@@ -3945,13 +4517,13 @@
3945
4517
  };
3946
4518
 
3947
4519
  // ../../node_modules/@math.gl/core/dist/esm/index.js
3948
- var globals4 = {
4520
+ var globals5 = {
3949
4521
  self: typeof self !== "undefined" && self,
3950
4522
  window: typeof window !== "undefined" && window,
3951
4523
  global: typeof global !== "undefined" && global
3952
4524
  };
3953
- var global_4 = globals4.global || globals4.self || globals4.window;
3954
- global_4.mathgl = {
4525
+ var global_5 = globals5.global || globals5.self || globals5.window;
4526
+ global_5.mathgl = {
3955
4527
  config
3956
4528
  };
3957
4529
 
@@ -3969,9 +4541,9 @@
3969
4541
  };
3970
4542
 
3971
4543
  // ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
3972
- var noop2 = (x) => x;
4544
+ var noop3 = (x) => x;
3973
4545
  var scratchVector = new Vector3();
3974
- function fromCartographic(cartographic, result, map3 = noop2) {
4546
+ function fromCartographic(cartographic, result, map3 = noop3) {
3975
4547
  if (isArray(cartographic)) {
3976
4548
  result[0] = map3(cartographic[0]);
3977
4549
  result[1] = map3(cartographic[1]);
@@ -3988,9 +4560,9 @@
3988
4560
  return result;
3989
4561
  }
3990
4562
  function fromCartographicToRadians(cartographic, vector = scratchVector) {
3991
- return fromCartographic(cartographic, vector, config._cartographicRadians ? noop2 : toRadians);
4563
+ return fromCartographic(cartographic, vector, config._cartographicRadians ? noop3 : toRadians);
3992
4564
  }
3993
- function toCartographic(vector, cartographic, map3 = noop2) {
4565
+ function toCartographic(vector, cartographic, map3 = noop3) {
3994
4566
  if (isArray(cartographic)) {
3995
4567
  cartographic[0] = map3(vector[0]);
3996
4568
  cartographic[1] = map3(vector[1]);
@@ -4007,7 +4579,7 @@
4007
4579
  return cartographic;
4008
4580
  }
4009
4581
  function toCartographicFromRadians(vector, cartographic) {
4010
- return toCartographic(vector, cartographic, config._cartographicRadians ? noop2 : toDegrees);
4582
+ return toCartographic(vector, cartographic, config._cartographicRadians ? noop3 : toDegrees);
4011
4583
  }
4012
4584
 
4013
4585
  // ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
@@ -4132,7 +4704,7 @@
4132
4704
  var scratchVector3 = new Vector3();
4133
4705
  function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
4134
4706
  const thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
4135
- assert4(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
4707
+ assert5(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
4136
4708
  let firstAxisVector;
4137
4709
  let secondAxisVector;
4138
4710
  let thirdAxisVector;
@@ -4206,9 +4778,9 @@
4206
4778
  return wgs84;
4207
4779
  }
4208
4780
  constructor(x = 0, y = 0, z = 0) {
4209
- assert4(x >= 0);
4210
- assert4(y >= 0);
4211
- assert4(z >= 0);
4781
+ assert5(x >= 0);
4782
+ assert5(y >= 0);
4783
+ assert5(z >= 0);
4212
4784
  this.radii = new Vector3(x, y, z);
4213
4785
  this.radiiSquared = new Vector3(x * x, y * y, z * z);
4214
4786
  this.radiiToTheFourth = new Vector3(x * x * x * x, y * y * y * y, z * z * z * z);
@@ -4293,8 +4865,8 @@
4293
4865
  return scratchPosition.from(position).scale(this.radii).to(result);
4294
4866
  }
4295
4867
  getSurfaceNormalIntersectionWithZAxis(position, buffer = 0, result = [0, 0, 0]) {
4296
- assert4(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
4297
- assert4(this.radii.z > 0);
4868
+ assert5(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
4869
+ assert5(this.radii.z > 0);
4298
4870
  scratchPosition.from(position);
4299
4871
  const z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);
4300
4872
  if (Math.abs(z) >= this.radii.z - buffer) {
@@ -4305,7 +4877,7 @@
4305
4877
  };
4306
4878
 
4307
4879
  // ../images/src/lib/utils/version.ts
4308
- var VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
4880
+ var VERSION5 = true ? "3.1.7" : "latest";
4309
4881
 
4310
4882
  // ../images/src/lib/category-api/image-type.ts
4311
4883
  var { _parseImageNode } = globalThis;
@@ -4644,7 +5216,7 @@
4644
5216
  id: "image",
4645
5217
  module: "images",
4646
5218
  name: "Images",
4647
- version: VERSION4,
5219
+ version: VERSION5,
4648
5220
  mimeTypes: MIME_TYPES,
4649
5221
  extensions: EXTENSIONS,
4650
5222
  parse: parseImage,
@@ -4653,7 +5225,7 @@
4653
5225
  };
4654
5226
 
4655
5227
  // ../draco/src/lib/utils/version.ts
4656
- var VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
5228
+ var VERSION6 = true ? "3.1.7" : "latest";
4657
5229
 
4658
5230
  // ../draco/src/draco-loader.ts
4659
5231
  var DEFAULT_DRACO_OPTIONS = {
@@ -4669,7 +5241,7 @@
4669
5241
  id: "draco",
4670
5242
  module: "draco",
4671
5243
  shapes: ["mesh"],
4672
- version: VERSION5,
5244
+ version: VERSION6,
4673
5245
  worker: true,
4674
5246
  extensions: ["drc"],
4675
5247
  mimeTypes: ["application/octet-stream"],
@@ -4706,7 +5278,7 @@
4706
5278
  }
4707
5279
 
4708
5280
  // ../schema/src/lib/utils/assert.ts
4709
- function assert5(condition, message) {
5281
+ function assert6(condition, message) {
4710
5282
  if (!condition) {
4711
5283
  throw new Error(message || "loader assertion failed.");
4712
5284
  }
@@ -4715,7 +5287,7 @@
4715
5287
  // ../schema/src/lib/schema/impl/schema.ts
4716
5288
  var Schema = class {
4717
5289
  constructor(fields, metadata) {
4718
- assert5(Array.isArray(fields));
5290
+ assert6(Array.isArray(fields));
4719
5291
  checkNames(fields);
4720
5292
  this.fields = fields;
4721
5293
  this.metadata = metadata || new Map();
@@ -5637,12 +6209,12 @@
5637
6209
  }
5638
6210
 
5639
6211
  // ../textures/src/lib/utils/version.ts
5640
- var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
6212
+ var VERSION7 = true ? "3.1.7" : "latest";
5641
6213
 
5642
6214
  // ../textures/src/lib/parsers/basis-module-loader.ts
5643
- var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
5644
- var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.wasm`;
5645
- var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.js`;
6215
+ var VERSION8 = true ? "3.1.7" : "latest";
6216
+ var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.wasm`;
6217
+ var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.js`;
5646
6218
  var loadBasisTranscoderPromise;
5647
6219
  async function loadBasisTrascoderModule(options) {
5648
6220
  const modules = options.modules || {};
@@ -6231,7 +6803,7 @@
6231
6803
  name: "Basis",
6232
6804
  id: "basis",
6233
6805
  module: "textures",
6234
- version: VERSION6,
6806
+ version: VERSION7,
6235
6807
  worker: true,
6236
6808
  extensions: ["basis", "ktx2"],
6237
6809
  mimeTypes: ["application/octet-stream", "image/ktx2"],
@@ -6544,7 +7116,7 @@
6544
7116
  name: "Texture Containers",
6545
7117
  id: "compressed-texture",
6546
7118
  module: "textures",
6547
- version: VERSION6,
7119
+ version: VERSION7,
6548
7120
  worker: true,
6549
7121
  extensions: [
6550
7122
  "ktx",
@@ -6606,7 +7178,7 @@
6606
7178
  }
6607
7179
 
6608
7180
  // ../../node_modules/@luma.gl/constants/dist/esm/index.js
6609
- var esm_default2 = {
7181
+ var esm_default3 = {
6610
7182
  DEPTH_BUFFER_BIT: 256,
6611
7183
  STENCIL_BUFFER_BIT: 1024,
6612
7184
  COLOR_BUFFER_BIT: 16384,
@@ -7241,11 +7813,11 @@
7241
7813
  }
7242
7814
  }
7243
7815
  var GL_TYPE_MAP = {
7244
- UInt8: esm_default2.UNSIGNED_BYTE,
7245
- UInt16: esm_default2.UNSIGNED_INT,
7246
- Float32: esm_default2.FLOAT,
7247
- UInt32: esm_default2.UNSIGNED_INT,
7248
- UInt64: esm_default2.DOUBLE
7816
+ UInt8: esm_default3.UNSIGNED_BYTE,
7817
+ UInt16: esm_default3.UNSIGNED_INT,
7818
+ Float32: esm_default3.FLOAT,
7819
+ UInt32: esm_default3.UNSIGNED_INT,
7820
+ UInt64: esm_default3.DOUBLE
7249
7821
  };
7250
7822
  function sizeOf(dataType) {
7251
7823
  switch (dataType) {
@@ -7643,13 +8215,13 @@
7643
8215
  }
7644
8216
 
7645
8217
  // src/i3s-content-loader.ts
7646
- var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
8218
+ var VERSION9 = true ? "3.1.7" : "latest";
7647
8219
  var I3SContentLoader = {
7648
8220
  name: "I3S Content (Indexed Scene Layers)",
7649
8221
  id: "i3s-content",
7650
8222
  module: "i3s",
7651
8223
  worker: true,
7652
- version: VERSION8,
8224
+ version: VERSION9,
7653
8225
  mimeTypes: ["application/octet-stream"],
7654
8226
  parse: parse3,
7655
8227
  extensions: ["bin"],