lerc-wasm-JMHVUN5O.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. import {
  2. fs_exports,
  3. init_fs,
  4. init_path,
  5. path_exports
  6. } from "./chunk-VUY5VYI5.js";
  7. import {
  8. __toCommonJS
  9. } from "./chunk-S5KM4IGW.js";
  10. // node_modules/@arcgis/core/chunks/lerc-wasm.js
  11. function t(t2, n2) {
  12. for (var e2 = 0; e2 < n2.length; e2++) {
  13. const r2 = n2[e2];
  14. if ("string" != typeof r2 && !Array.isArray(r2)) {
  15. for (const n3 in r2)
  16. if ("default" !== n3 && !(n3 in t2)) {
  17. const e3 = Object.getOwnPropertyDescriptor(r2, n3);
  18. e3 && Object.defineProperty(t2, n3, e3.get ? e3 : { enumerable: true, get: () => r2[n3] });
  19. }
  20. }
  21. }
  22. return Object.freeze(Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }));
  23. }
  24. var n;
  25. var e;
  26. var r;
  27. var i = { exports: {} };
  28. n = i, e = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0, "undefined" != typeof __filename && (e = e || __filename), r = function(t2) {
  29. var n2, r2;
  30. (t2 = void 0 !== (t2 = t2 || {}) ? t2 : {}).ready = new Promise(function(t3, e2) {
  31. n2 = t3, r2 = e2;
  32. });
  33. var i2, o2, u, s, a, c, f = Object.assign({}, t2), p = "object" == typeof window, l = "function" == typeof importScripts, h = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, d = "";
  34. function m(n3) {
  35. return t2.locateFile ? t2.locateFile(n3, d) : d + n3;
  36. }
  37. h ? (d = l ? (init_path(), __toCommonJS(path_exports)).dirname(d) + "/" : __dirname + "/", c = () => {
  38. a || (s = (init_fs(), __toCommonJS(fs_exports)), a = (init_path(), __toCommonJS(path_exports)));
  39. }, i2 = function(t3, n3) {
  40. return c(), t3 = a.normalize(t3), s.readFileSync(t3, n3 ? void 0 : "utf8");
  41. }, u = (t3) => {
  42. var n3 = i2(t3, true);
  43. return n3.buffer || (n3 = new Uint8Array(n3)), n3;
  44. }, o2 = (t3, n3, e2) => {
  45. c(), t3 = a.normalize(t3), s.readFile(t3, function(t4, r3) {
  46. t4 ? e2(t4) : n3(r3.buffer);
  47. });
  48. }, process.argv.length > 1 && process.argv[1].replace(/\\/g, "/"), process.argv.slice(2), process.on("uncaughtException", function(t3) {
  49. if (!(t3 instanceof ht))
  50. throw t3;
  51. }), process.on("unhandledRejection", function(t3) {
  52. throw t3;
  53. }), t2.inspect = function() {
  54. return "[Emscripten Module object]";
  55. }) : (p || l) && (l ? d = self.location.href : "undefined" != typeof document && document.currentScript && (d = document.currentScript.src), e && (d = e), d = 0 !== d.indexOf("blob:") ? d.substr(0, d.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", i2 = (t3) => {
  56. var n3 = new XMLHttpRequest();
  57. return n3.open("GET", t3, false), n3.send(null), n3.responseText;
  58. }, l && (u = (t3) => {
  59. var n3 = new XMLHttpRequest();
  60. return n3.open("GET", t3, false), n3.responseType = "arraybuffer", n3.send(null), new Uint8Array(n3.response);
  61. }), o2 = (t3, n3, e2) => {
  62. var r3 = new XMLHttpRequest();
  63. r3.open("GET", t3, true), r3.responseType = "arraybuffer", r3.onload = () => {
  64. 200 == r3.status || 0 == r3.status && r3.response ? n3(r3.response) : e2();
  65. }, r3.onerror = e2, r3.send(null);
  66. }), t2.print || console.log.bind(console);
  67. var _, y, g = t2.printErr || console.warn.bind(console);
  68. Object.assign(t2, f), f = null, t2.arguments && t2.arguments, t2.thisProgram && t2.thisProgram, t2.quit && t2.quit, t2.wasmBinary && (_ = t2.wasmBinary), t2.noExitRuntime, "object" != typeof WebAssembly && L("no native wasm support detected");
  69. var v, w, b, A, R, x, S = false, P = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0;
  70. function E(t3, n3, e2) {
  71. for (var r3 = n3 + e2, i3 = n3; t3[i3] && !(i3 >= r3); )
  72. ++i3;
  73. if (i3 - n3 > 16 && t3.buffer && P)
  74. return P.decode(t3.subarray(n3, i3));
  75. for (var o3 = ""; n3 < i3; ) {
  76. var u2 = t3[n3++];
  77. if (128 & u2) {
  78. var s2 = 63 & t3[n3++];
  79. if (192 != (224 & u2)) {
  80. var a2 = 63 & t3[n3++];
  81. if ((u2 = 224 == (240 & u2) ? (15 & u2) << 12 | s2 << 6 | a2 : (7 & u2) << 18 | s2 << 12 | a2 << 6 | 63 & t3[n3++]) < 65536)
  82. o3 += String.fromCharCode(u2);
  83. else {
  84. var c2 = u2 - 65536;
  85. o3 += String.fromCharCode(55296 | c2 >> 10, 56320 | 1023 & c2);
  86. }
  87. } else
  88. o3 += String.fromCharCode((31 & u2) << 6 | s2);
  89. } else
  90. o3 += String.fromCharCode(u2);
  91. }
  92. return o3;
  93. }
  94. function I(t3, n3) {
  95. return t3 ? E(b, t3, n3) : "";
  96. }
  97. function j(n3) {
  98. v = n3, t2.HEAP8 = w = new Int8Array(n3), t2.HEAP16 = new Int16Array(n3), t2.HEAP32 = A = new Int32Array(n3), t2.HEAPU8 = b = new Uint8Array(n3), t2.HEAPU16 = new Uint16Array(n3), t2.HEAPU32 = R = new Uint32Array(n3), t2.HEAPF32 = new Float32Array(n3), t2.HEAPF64 = new Float64Array(n3);
  99. }
  100. t2.INITIAL_MEMORY;
  101. var T = [], D = [], H = [];
  102. function M() {
  103. if (t2.preRun)
  104. for ("function" == typeof t2.preRun && (t2.preRun = [t2.preRun]); t2.preRun.length; )
  105. U(t2.preRun.shift());
  106. V(T);
  107. }
  108. function O() {
  109. V(D);
  110. }
  111. function W() {
  112. if (t2.postRun)
  113. for ("function" == typeof t2.postRun && (t2.postRun = [t2.postRun]); t2.postRun.length; )
  114. C(t2.postRun.shift());
  115. V(H);
  116. }
  117. function U(t3) {
  118. T.unshift(t3);
  119. }
  120. function q(t3) {
  121. D.unshift(t3);
  122. }
  123. function C(t3) {
  124. H.unshift(t3);
  125. }
  126. var F = 0, B = null;
  127. function k(n3) {
  128. F++, t2.monitorRunDependencies && t2.monitorRunDependencies(F);
  129. }
  130. function z(n3) {
  131. if (F--, t2.monitorRunDependencies && t2.monitorRunDependencies(F), 0 == F && B) {
  132. var e2 = B;
  133. B = null, e2();
  134. }
  135. }
  136. function L(n3) {
  137. t2.onAbort && t2.onAbort(n3), g(n3 = "Aborted(" + n3 + ")"), S = true, n3 += ". Build with -sASSERTIONS for more info.";
  138. var e2 = new WebAssembly.RuntimeError(n3);
  139. throw r2(e2), e2;
  140. }
  141. var G, X = "data:application/octet-stream;base64,";
  142. function N(t3) {
  143. return t3.startsWith(X);
  144. }
  145. function Y(t3) {
  146. return t3.startsWith("file://");
  147. }
  148. function J(t3) {
  149. try {
  150. if (t3 == G && _)
  151. return new Uint8Array(_);
  152. if (u)
  153. return u(t3);
  154. throw "both async and sync fetching of the wasm failed";
  155. } catch (g2) {
  156. L(g2);
  157. }
  158. }
  159. function K() {
  160. if (!_ && (p || l)) {
  161. if ("function" == typeof fetch && !Y(G))
  162. return fetch(G, { credentials: "same-origin" }).then(function(t3) {
  163. if (!t3.ok)
  164. throw "failed to load wasm binary file at '" + G + "'";
  165. return t3.arrayBuffer();
  166. }).catch(function() {
  167. return J(G);
  168. });
  169. if (o2)
  170. return new Promise(function(t3, n3) {
  171. o2(G, function(n4) {
  172. t3(new Uint8Array(n4));
  173. }, n3);
  174. });
  175. }
  176. return Promise.resolve().then(function() {
  177. return J(G);
  178. });
  179. }
  180. function Q() {
  181. var n3 = { a: ct };
  182. function e2(n4, e3) {
  183. var r3 = n4.exports;
  184. t2.asm = r3, j((y = t2.asm.g).buffer), x = t2.asm.m, q(t2.asm.h), z();
  185. }
  186. function i3(t3) {
  187. e2(t3.instance);
  188. }
  189. function o3(t3) {
  190. return K().then(function(t4) {
  191. return WebAssembly.instantiate(t4, n3);
  192. }).then(function(t4) {
  193. return t4;
  194. }).then(t3, function(t4) {
  195. g("failed to asynchronously prepare wasm: " + t4), L(t4);
  196. });
  197. }
  198. function u2() {
  199. return _ || "function" != typeof WebAssembly.instantiateStreaming || N(G) || Y(G) || h || "function" != typeof fetch ? o3(i3) : fetch(G, { credentials: "same-origin" }).then(function(t3) {
  200. return WebAssembly.instantiateStreaming(t3, n3).then(i3, function(t4) {
  201. return g("wasm streaming compile failed: " + t4), g("falling back to ArrayBuffer instantiation"), o3(i3);
  202. });
  203. });
  204. }
  205. if (k(), t2.instantiateWasm)
  206. try {
  207. return t2.instantiateWasm(n3, e2);
  208. } catch (s2) {
  209. return g("Module.instantiateWasm callback failed with error: " + s2), false;
  210. }
  211. return u2().catch(r2), {};
  212. }
  213. function V(n3) {
  214. for (; n3.length > 0; ) {
  215. var e2 = n3.shift();
  216. if ("function" != typeof e2) {
  217. var r3 = e2.func;
  218. "number" == typeof r3 ? void 0 === e2.arg ? $(r3)() : $(r3)(e2.arg) : r3(void 0 === e2.arg ? null : e2.arg);
  219. } else
  220. e2(t2);
  221. }
  222. }
  223. N(G = "lerc-wasm.wasm") || (G = m(G));
  224. var Z = [];
  225. function $(t3) {
  226. var n3 = Z[t3];
  227. return n3 || (t3 >= Z.length && (Z.length = t3 + 1), Z[t3] = n3 = x.get(t3)), n3;
  228. }
  229. function tt(t3, n3, e2, r3) {
  230. L("Assertion failed: " + I(t3) + ", at: " + [n3 ? I(n3) : "unknown filename", e2, r3 ? I(r3) : "unknown function"]);
  231. }
  232. function nt(t3) {
  233. return ft(t3 + 24) + 24;
  234. }
  235. function et(t3) {
  236. this.excPtr = t3, this.ptr = t3 - 24, this.set_type = function(t4) {
  237. R[this.ptr + 4 >> 2] = t4;
  238. }, this.get_type = function() {
  239. return R[this.ptr + 4 >> 2];
  240. }, this.set_destructor = function(t4) {
  241. R[this.ptr + 8 >> 2] = t4;
  242. }, this.get_destructor = function() {
  243. return R[this.ptr + 8 >> 2];
  244. }, this.set_refcount = function(t4) {
  245. A[this.ptr >> 2] = t4;
  246. }, this.set_caught = function(t4) {
  247. t4 = t4 ? 1 : 0, w[this.ptr + 12 >> 0] = t4;
  248. }, this.get_caught = function() {
  249. return 0 != w[this.ptr + 12 >> 0];
  250. }, this.set_rethrown = function(t4) {
  251. t4 = t4 ? 1 : 0, w[this.ptr + 13 >> 0] = t4;
  252. }, this.get_rethrown = function() {
  253. return 0 != w[this.ptr + 13 >> 0];
  254. }, this.init = function(t4, n3) {
  255. this.set_adjusted_ptr(0), this.set_type(t4), this.set_destructor(n3), this.set_refcount(0), this.set_caught(false), this.set_rethrown(false);
  256. }, this.add_ref = function() {
  257. var t4 = A[this.ptr >> 2];
  258. A[this.ptr >> 2] = t4 + 1;
  259. }, this.release_ref = function() {
  260. var t4 = A[this.ptr >> 2];
  261. return A[this.ptr >> 2] = t4 - 1, 1 === t4;
  262. }, this.set_adjusted_ptr = function(t4) {
  263. R[this.ptr + 16 >> 2] = t4;
  264. }, this.get_adjusted_ptr = function() {
  265. return R[this.ptr + 16 >> 2];
  266. }, this.get_exception_ptr = function() {
  267. if (lt(this.get_type()))
  268. return R[this.excPtr >> 2];
  269. var t4 = this.get_adjusted_ptr();
  270. return 0 !== t4 ? t4 : this.excPtr;
  271. };
  272. }
  273. function rt(t3, n3, e2) {
  274. throw new et(t3).init(n3, e2), t3;
  275. }
  276. function it() {
  277. L("");
  278. }
  279. function ot(t3, n3, e2) {
  280. b.copyWithin(t3, n3, n3 + e2);
  281. }
  282. function ut() {
  283. return 2147483648;
  284. }
  285. function st(t3) {
  286. try {
  287. return y.grow(t3 - v.byteLength + 65535 >>> 16), j(y.buffer), 1;
  288. } catch (n3) {
  289. }
  290. }
  291. function at(t3) {
  292. var n3 = b.length;
  293. t3 >>>= 0;
  294. var e2 = ut();
  295. if (t3 > e2)
  296. return false;
  297. let r3 = (t4, n4) => t4 + (n4 - t4 % n4) % n4;
  298. for (var i3 = 1; i3 <= 4; i3 *= 2) {
  299. var o3 = n3 * (1 + 0.2 / i3);
  300. if (o3 = Math.min(o3, t3 + 100663296), st(Math.min(e2, r3(Math.max(t3, o3), 65536))))
  301. return true;
  302. }
  303. return false;
  304. }
  305. var ct = { a: tt, c: nt, b: rt, d: it, f: ot, e: at };
  306. Q(), t2.___wasm_call_ctors = function() {
  307. return (t2.___wasm_call_ctors = t2.asm.h).apply(null, arguments);
  308. }, t2._lerc_getBlobInfo = function() {
  309. return (t2._lerc_getBlobInfo = t2.asm.i).apply(null, arguments);
  310. }, t2._lerc_getDataRanges = function() {
  311. return (t2._lerc_getDataRanges = t2.asm.j).apply(null, arguments);
  312. }, t2._lerc_decode = function() {
  313. return (t2._lerc_decode = t2.asm.k).apply(null, arguments);
  314. }, t2._lerc_decode_4D = function() {
  315. return (t2._lerc_decode_4D = t2.asm.l).apply(null, arguments);
  316. };
  317. var ft = t2._malloc = function() {
  318. return (ft = t2._malloc = t2.asm.n).apply(null, arguments);
  319. };
  320. t2._free = function() {
  321. return (t2._free = t2.asm.o).apply(null, arguments);
  322. };
  323. var pt, lt = t2.___cxa_is_pointer_type = function() {
  324. return (lt = t2.___cxa_is_pointer_type = t2.asm.p).apply(null, arguments);
  325. };
  326. function ht(t3) {
  327. this.name = "ExitStatus", this.message = "Program terminated with exit(" + t3 + ")", this.status = t3;
  328. }
  329. function dt(e2) {
  330. function r3() {
  331. pt || (pt = true, t2.calledRun = true, S || (O(), n2(t2), t2.onRuntimeInitialized && t2.onRuntimeInitialized(), W()));
  332. }
  333. F > 0 || (M(), F > 0 || (t2.setStatus ? (t2.setStatus("Running..."), setTimeout(function() {
  334. setTimeout(function() {
  335. t2.setStatus("");
  336. }, 1), r3();
  337. }, 1)) : r3()));
  338. }
  339. if (B = function t3() {
  340. pt || dt(), pt || (B = t3);
  341. }, t2.run = dt, t2.preInit)
  342. for ("function" == typeof t2.preInit && (t2.preInit = [t2.preInit]); t2.preInit.length > 0; )
  343. t2.preInit.pop()();
  344. return dt(), t2.ready;
  345. }, n.exports = r;
  346. var o = t({ __proto__: null, default: i.exports }, [i.exports]);
  347. export {
  348. o as l
  349. };
  350. //# sourceMappingURL=lerc-wasm-JMHVUN5O.js.map