PointCloudWorker-Z76DJAJC.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. import {
  2. a2 as a,
  3. a3 as a2,
  4. d
  5. } from "./chunk-PFG2S2HL.js";
  6. import {
  7. n,
  8. r as r2
  9. } from "./chunk-T4GXZJ3D.js";
  10. import {
  11. O
  12. } from "./chunk-XXBIV3TZ.js";
  13. import {
  14. S as S2
  15. } from "./chunk-5W6F4NR5.js";
  16. import "./chunk-YZUP3MAF.js";
  17. import "./chunk-SCXOTZ6Q.js";
  18. import {
  19. Un
  20. } from "./chunk-DH2OBAUC.js";
  21. import "./chunk-TNLRDNTC.js";
  22. import "./chunk-MFUAILAT.js";
  23. import "./chunk-HZJYXMI6.js";
  24. import "./chunk-7XXXCK2A.js";
  25. import "./chunk-7ZIDBK7B.js";
  26. import "./chunk-TERAW6FT.js";
  27. import "./chunk-N2663GRX.js";
  28. import "./chunk-O4FY3ITT.js";
  29. import "./chunk-JXW4QTJA.js";
  30. import {
  31. S
  32. } from "./chunk-XNLG7T2T.js";
  33. import "./chunk-IR4PV7VK.js";
  34. import "./chunk-OWVBLVP3.js";
  35. import "./chunk-MXB2XLKV.js";
  36. import "./chunk-HNOZUNJ4.js";
  37. import "./chunk-VNFRAYHO.js";
  38. import "./chunk-R5IG2D6H.js";
  39. import "./chunk-VBRY5KJM.js";
  40. import "./chunk-PDKDCAAD.js";
  41. import "./chunk-ECW2QABR.js";
  42. import "./chunk-GCDJLKH4.js";
  43. import {
  44. k2 as k
  45. } from "./chunk-MRJEICT6.js";
  46. import "./chunk-Y3WMVFTW.js";
  47. import "./chunk-SAS7RONY.js";
  48. import "./chunk-WSRBH7BF.js";
  49. import "./chunk-IHXECKQQ.js";
  50. import "./chunk-ULGDPLM2.js";
  51. import {
  52. s,
  53. s3 as s2
  54. } from "./chunk-EMJ4ZSM2.js";
  55. import {
  56. m
  57. } from "./chunk-IKP3YN53.js";
  58. import {
  59. o2 as o,
  60. r,
  61. t
  62. } from "./chunk-GZT4BVFP.js";
  63. import "./chunk-A5ICIBVI.js";
  64. // node_modules/@arcgis/core/chunks/quatf32.js
  65. function e() {
  66. const e2 = new Float32Array(4);
  67. return e2[3] = 1, e2;
  68. }
  69. function r3(e2) {
  70. const r5 = new Float32Array(4);
  71. return r5[0] = e2[0], r5[1] = e2[1], r5[2] = e2[2], r5[3] = e2[3], r5;
  72. }
  73. function t2(e2, r5, t4, n4) {
  74. const o4 = new Float32Array(4);
  75. return o4[0] = e2, o4[1] = r5, o4[2] = t4, o4[3] = n4, o4;
  76. }
  77. function n2(e2, r5) {
  78. return new Float32Array(e2, r5, 4);
  79. }
  80. var o2 = Object.freeze(Object.defineProperty({ __proto__: null, create: e, clone: r3, fromValues: t2, createView: n2 }, Symbol.toStringTag, { value: "Module" }));
  81. // node_modules/@arcgis/core/views/3d/layers/i3s/LEPCC.js
  82. var t3 = true;
  83. var o3 = { identifierOffset: 0, identifierLength: 10, versionOffset: 10, checksumOffset: 12, byteCount: 16 };
  84. function r4(e2, r5, n4) {
  85. return { identifier: String.fromCharCode.apply(null, new Uint8Array(e2, n4 + o3.identifierOffset, o3.identifierLength)), version: r5.getUint16(n4 + o3.versionOffset, t3), checksum: r5.getUint32(n4 + o3.checksumOffset, t3) };
  86. }
  87. var n3 = { sizeLo: 0, sizeHi: 4, minX: 8, minY: 16, minZ: 24, maxX: 32, maxY: 40, maxZ: 48, errorX: 56, errorY: 64, errorZ: 72, count: 80, reserved: 84, byteCount: 88 };
  88. function i(e2, o4) {
  89. return { sizeLo: e2.getUint32(o4 + n3.sizeLo, t3), sizeHi: e2.getUint32(o4 + n3.sizeHi, t3), minX: e2.getFloat64(o4 + n3.minX, t3), minY: e2.getFloat64(o4 + n3.minY, t3), minZ: e2.getFloat64(o4 + n3.minZ, t3), maxX: e2.getFloat64(o4 + n3.maxX, t3), maxY: e2.getFloat64(o4 + n3.maxY, t3), maxZ: e2.getFloat64(o4 + n3.maxZ, t3), errorX: e2.getFloat64(o4 + n3.errorX, t3), errorY: e2.getFloat64(o4 + n3.errorY, t3), errorZ: e2.getFloat64(o4 + n3.errorZ, t3), count: e2.getUint32(o4 + n3.count, t3), reserved: e2.getUint32(o4 + n3.reserved, t3) };
  90. }
  91. function c(t4) {
  92. const c5 = new DataView(t4, 0);
  93. let d5 = 0;
  94. const { identifier: l3, version: a6 } = r4(t4, c5, d5);
  95. if (d5 += o3.byteCount, l3 !== "LEPCC ")
  96. throw new s2("lepcc-decode-error", "Bad identifier");
  97. if (a6 > 1)
  98. throw new s2("lepcc-decode-error", "Unknown version");
  99. const u3 = i(c5, d5);
  100. d5 += n3.byteCount;
  101. if (u3.sizeHi * 2 ** 32 + u3.sizeLo !== t4.byteLength)
  102. throw new s2("lepcc-decode-error", "Bad size");
  103. const f4 = new Float64Array(3 * u3.count), h4 = [], w2 = [], g2 = [], p3 = [];
  104. if (d5 = s3(t4, d5, h4), d5 = s3(t4, d5, w2), d5 = s3(t4, d5, g2), d5 = s3(t4, d5, p3), d5 !== t4.byteLength)
  105. throw new s2("lepcc-decode-error", "Bad length");
  106. let m4 = 0, U = 0;
  107. for (let e2 = 0; e2 < h4.length; e2++) {
  108. U += h4[e2];
  109. let t5 = 0;
  110. for (let o4 = 0; o4 < w2[e2]; o4++) {
  111. t5 += g2[m4];
  112. const e3 = p3[m4];
  113. f4[3 * m4] = Math.min(u3.maxX, u3.minX + 2 * u3.errorX * t5), f4[3 * m4 + 1] = Math.min(u3.maxY, u3.minY + 2 * u3.errorY * U), f4[3 * m4 + 2] = Math.min(u3.maxZ, u3.minZ + 2 * u3.errorZ * e3), m4++;
  114. }
  115. }
  116. return { errorX: u3.errorX, errorY: u3.errorY, errorZ: u3.errorZ, result: f4 };
  117. }
  118. function s3(e2, t4, o4) {
  119. const r5 = [];
  120. t4 = d2(e2, t4, r5);
  121. const n4 = [];
  122. for (let i2 = 0; i2 < r5.length; i2++) {
  123. n4.length = 0, t4 = d2(e2, t4, n4);
  124. for (let e3 = 0; e3 < n4.length; e3++)
  125. o4.push(n4[e3] + r5[i2]);
  126. }
  127. return t4;
  128. }
  129. function d2(o4, r5, n4) {
  130. const i2 = new DataView(o4, r5), c5 = i2.getUint8(0), s5 = 31 & c5, d5 = !!(32 & c5), l3 = (192 & c5) >> 6;
  131. let a6 = 0;
  132. if (l3 === 0)
  133. a6 = i2.getUint32(1, t3), r5 += 5;
  134. else if (l3 === 1)
  135. a6 = i2.getUint16(1, t3), r5 += 3;
  136. else {
  137. if (l3 !== 2)
  138. throw new s2("lepcc-decode-error", "Bad count type");
  139. a6 = i2.getUint8(1), r5 += 2;
  140. }
  141. if (d5)
  142. throw new s2("lepcc-decode-error", "LUT not implemented");
  143. const u3 = Math.ceil(a6 * s5 / 8), f4 = new Uint8Array(o4, r5, u3);
  144. let h4 = 0, w2 = 0, g2 = 0;
  145. const p3 = -1 >>> 32 - s5;
  146. for (let e2 = 0; e2 < a6; e2++) {
  147. for (; w2 < s5; )
  148. h4 |= f4[g2] << w2, w2 += 8, g2 += 1;
  149. n4[e2] = h4 & p3, h4 >>>= s5, w2 -= s5, w2 + s5 > 32 && (h4 |= f4[g2 - 1] >> 8 - w2);
  150. }
  151. return r5 + g2;
  152. }
  153. var l = { sizeLo: 0, sizeHi: 4, count: 8, colorMapCount: 12, lookupMethod: 14, compressionMethod: 15, byteCount: 16 };
  154. function a3(e2, o4) {
  155. return { sizeLo: e2.getUint32(o4 + l.sizeLo, t3), sizeHi: e2.getUint32(o4 + l.sizeHi, t3), count: e2.getUint32(o4 + l.count, t3), colorMapCount: e2.getUint16(o4 + l.colorMapCount, t3), lookupMethod: e2.getUint8(o4 + l.lookupMethod), compressionMethod: e2.getUint8(o4 + l.compressionMethod) };
  156. }
  157. function u(t4) {
  158. const n4 = new DataView(t4, 0);
  159. let i2 = 0;
  160. const { identifier: c5, version: s5 } = r4(t4, n4, i2);
  161. if (i2 += o3.byteCount, c5 !== "ClusterRGB")
  162. throw new s2("lepcc-decode-error", "Bad identifier");
  163. if (s5 > 1)
  164. throw new s2("lepcc-decode-error", "Unknown version");
  165. const d5 = a3(n4, i2);
  166. i2 += l.byteCount;
  167. if (d5.sizeHi * 2 ** 32 + d5.sizeLo !== t4.byteLength)
  168. throw new s2("lepcc-decode-error", "Bad size");
  169. if ((d5.lookupMethod === 2 || d5.lookupMethod === 1) && d5.compressionMethod === 0) {
  170. if (3 * d5.colorMapCount + d5.count + i2 !== t4.byteLength || d5.colorMapCount > 256)
  171. throw new s2("lepcc-decode-error", "Bad count");
  172. const o4 = new Uint8Array(t4, i2, 3 * d5.colorMapCount), r5 = new Uint8Array(t4, i2 + 3 * d5.colorMapCount, d5.count), n5 = new Uint8Array(3 * d5.count);
  173. for (let e2 = 0; e2 < d5.count; e2++) {
  174. const t5 = r5[e2];
  175. n5[3 * e2] = o4[3 * t5], n5[3 * e2 + 1] = o4[3 * t5 + 1], n5[3 * e2 + 2] = o4[3 * t5 + 2];
  176. }
  177. return n5;
  178. }
  179. if (d5.lookupMethod === 0 && d5.compressionMethod === 0) {
  180. if (3 * d5.count + i2 !== t4.byteLength || d5.colorMapCount !== 0)
  181. throw new s2("lepcc-decode-error", "Bad count");
  182. return new Uint8Array(t4, i2).slice();
  183. }
  184. if (d5.lookupMethod <= 2 && d5.compressionMethod === 1) {
  185. if (i2 + 3 !== t4.byteLength || d5.colorMapCount !== 1)
  186. throw new s2("lepcc-decode-error", "Bad count");
  187. const o4 = n4.getUint8(i2), r5 = n4.getUint8(i2 + 1), c6 = n4.getUint8(i2 + 2), s6 = new Uint8Array(3 * d5.count);
  188. for (let e2 = 0; e2 < d5.count; e2++)
  189. s6[3 * e2] = o4, s6[3 * e2 + 1] = r5, s6[3 * e2 + 2] = c6;
  190. return s6;
  191. }
  192. throw new s2("lepcc-decode-error", "Bad method " + d5.lookupMethod + "," + d5.compressionMethod);
  193. }
  194. var f = { sizeLo: 0, sizeHi: 4, count: 8, scaleFactor: 12, bitsPerPoint: 14, reserved: 15, byteCount: 16 };
  195. function h(e2, o4) {
  196. return { sizeLo: e2.getUint32(o4 + f.sizeLo, t3), sizeHi: e2.getUint32(o4 + f.sizeHi, t3), count: e2.getUint32(o4 + f.count, t3), scaleFactor: e2.getUint16(o4 + f.scaleFactor, t3), bitsPerPoint: e2.getUint8(o4 + f.bitsPerPoint), reserved: e2.getUint8(o4 + f.reserved) };
  197. }
  198. function w(t4) {
  199. const n4 = new DataView(t4, 0);
  200. let i2 = 0;
  201. const { identifier: c5, version: s5 } = r4(t4, n4, i2);
  202. if (i2 += o3.byteCount, c5 !== "Intensity ")
  203. throw new s2("lepcc-decode-error", "Bad identifier");
  204. if (s5 > 1)
  205. throw new s2("lepcc-decode-error", "Unknown version");
  206. const l3 = h(n4, i2);
  207. i2 += f.byteCount;
  208. if (l3.sizeHi * 2 ** 32 + l3.sizeLo !== t4.byteLength)
  209. throw new s2("lepcc-decode-error", "Bad size");
  210. const a6 = new Uint16Array(l3.count);
  211. if (l3.bitsPerPoint === 8) {
  212. if (l3.count + i2 !== t4.byteLength)
  213. throw new s2("lepcc-decode-error", "Bad size");
  214. const o4 = new Uint8Array(t4, i2, l3.count);
  215. for (let e2 = 0; e2 < l3.count; e2++)
  216. a6[e2] = o4[e2] * l3.scaleFactor;
  217. } else if (l3.bitsPerPoint === 16) {
  218. if (2 * l3.count + i2 !== t4.byteLength)
  219. throw new s2("lepcc-decode-error", "Bad size");
  220. const o4 = new Uint16Array(t4, i2, l3.count);
  221. for (let e2 = 0; e2 < l3.count; e2++)
  222. a6[e2] = o4[e2] * l3.scaleFactor;
  223. } else {
  224. const o4 = [];
  225. if (d2(t4, i2, o4) !== t4.byteLength)
  226. throw new s2("lepcc-decode-error", "Bad size");
  227. for (let e2 = 0; e2 < l3.count; e2++)
  228. a6[e2] = o4[e2] * l3.scaleFactor;
  229. }
  230. return a6;
  231. }
  232. // node_modules/@arcgis/core/views/3d/layers/i3s/I3SBinaryReader.js
  233. var u2 = s.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");
  234. function a4(t4, n4, r5) {
  235. let o4 = "", i2 = 0;
  236. for (; i2 < r5; ) {
  237. const u3 = t4[n4 + i2];
  238. if (u3 < 128)
  239. o4 += String.fromCharCode(u3), i2++;
  240. else if (u3 >= 192 && u3 < 224) {
  241. if (i2 + 1 >= r5)
  242. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Two byte character was truncated.");
  243. const a6 = (31 & u3) << 6 | 63 & t4[n4 + i2 + 1];
  244. o4 += String.fromCharCode(a6), i2 += 2;
  245. } else if (u3 >= 224 && u3 < 240) {
  246. if (i2 + 2 >= r5)
  247. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Multi byte character was truncated.");
  248. const a6 = (15 & u3) << 12 | (63 & t4[n4 + i2 + 1]) << 6 | 63 & t4[n4 + i2 + 2];
  249. o4 += String.fromCharCode(a6), i2 += 3;
  250. } else {
  251. if (!(u3 >= 240 && u3 < 248))
  252. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Invalid multi byte sequence.");
  253. {
  254. if (i2 + 3 >= r5)
  255. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Multi byte character was truncated.");
  256. const a6 = (7 & u3) << 18 | (63 & t4[n4 + i2 + 1]) << 12 | (63 & t4[n4 + i2 + 2]) << 6 | 63 & t4[n4 + i2 + 3];
  257. if (a6 >= 65536) {
  258. const e2 = 55296 + (a6 - 65536 >> 10), t5 = 56320 + (1023 & a6);
  259. o4 += String.fromCharCode(e2, t5);
  260. } else
  261. o4 += String.fromCharCode(a6);
  262. i2 += 4;
  263. }
  264. }
  265. }
  266. return o4;
  267. }
  268. function s4(e2, t4) {
  269. const n4 = { byteOffset: 0, byteCount: 0, fields: Object.create(null) };
  270. let r5 = 0;
  271. for (let o4 = 0; o4 < t4.length; o4++) {
  272. const i2 = t4[o4], u3 = i2.valueType || i2.type, a6 = h2[u3];
  273. n4.fields[i2.property] = a6(e2, r5), r5 += m2[u3].BYTES_PER_ELEMENT;
  274. }
  275. return n4.byteCount = r5, n4;
  276. }
  277. function c2(t4, n4, r5) {
  278. const o4 = [];
  279. let i2, u3, s5 = 0;
  280. for (u3 = 0; u3 < t4; u3 += 1) {
  281. if (i2 = n4[u3], i2 > 0) {
  282. if (o4.push(a4(r5, s5, i2 - 1)), r5[s5 + i2 - 1] !== 0)
  283. throw new s2("string-array-error", "Invalid string array: missing null termination.");
  284. } else
  285. o4.push(null);
  286. s5 += i2;
  287. }
  288. return o4;
  289. }
  290. function f2(e2, t4) {
  291. return new (0, m2[t4.valueType])(e2, t4.byteOffset, t4.count * t4.valuesPerElement);
  292. }
  293. function l2(e2, t4) {
  294. return new Uint8Array(e2, t4.byteOffset, t4.byteCount);
  295. }
  296. function b(n4, r5, o4) {
  297. const i2 = r5.header != null ? s4(n4, r5.header) : { byteOffset: 0, byteCount: 0, fields: { count: o4 } }, u3 = { header: i2, byteOffset: i2.byteCount, byteCount: 0, entries: Object.create(null) };
  298. let a6 = i2.byteCount;
  299. for (let s5 = 0; s5 < r5.ordering.length; s5++) {
  300. const n5 = r5.ordering[s5], o5 = m(r5[n5]);
  301. if (o5.count = i2.fields.count, o5.valueType === "String") {
  302. if (o5.byteOffset = a6, o5.byteCount = i2.fields[n5 + "ByteCount"], o5.encoding !== "UTF-8")
  303. throw new s2("unsupported-encoding", "Unsupported String encoding.", { encoding: o5.encoding });
  304. } else {
  305. if (!A(o5.valueType))
  306. throw new s2("unsupported-value-type", "Unsupported binary valueType", { valueType: o5.valueType });
  307. {
  308. const e2 = O2(o5.valueType);
  309. a6 += a6 % e2 != 0 ? e2 - a6 % e2 : 0, o5.byteOffset = a6, o5.byteCount = e2 * o5.valuesPerElement * o5.count;
  310. }
  311. }
  312. a6 += o5.byteCount, u3.entries[n5] = o5;
  313. }
  314. return u3.byteCount = a6 - u3.byteOffset, u3;
  315. }
  316. function d3(t4, n4, r5) {
  317. if (n4 !== t4 && u2.error(`Invalid ${r5} buffer size
  318. expected: ${t4}, actual: ${n4})`), n4 < t4)
  319. throw new s2("buffer-too-small", "Binary buffer is too small", { expectedSize: t4, actualSize: n4 });
  320. }
  321. function g(e2, t4) {
  322. const n4 = s4(e2, t4 && t4.header);
  323. let r5 = n4.byteCount;
  324. const o4 = { isDraco: false, header: n4, byteOffset: n4.byteCount, byteCount: 0, vertexAttributes: {} }, i2 = n4.fields, u3 = i2.vertexCount != null ? i2.vertexCount : i2.count;
  325. for (const s5 of t4.ordering) {
  326. if (!t4.vertexAttributes[s5])
  327. continue;
  328. const e3 = { ...t4.vertexAttributes[s5], byteOffset: r5, count: u3 }, n5 = C[s5] ? C[s5] : "_" + s5;
  329. o4.vertexAttributes[n5] = e3, r5 += O2(e3.valueType) * e3.valuesPerElement * u3;
  330. }
  331. const a6 = i2.faceCount;
  332. if (t4.faces && a6) {
  333. o4.faces = {};
  334. for (const e3 of t4.ordering) {
  335. if (!t4.faces[e3])
  336. continue;
  337. const n5 = { ...t4.faces[e3], byteOffset: r5, count: a6 };
  338. o4.faces[e3] = n5, r5 += O2(n5.valueType) * n5.valuesPerElement * a6;
  339. }
  340. }
  341. const c5 = i2.featureCount;
  342. if (t4.featureAttributes && t4.featureAttributeOrder && c5) {
  343. o4.featureAttributes = {};
  344. for (const e3 of t4.featureAttributeOrder) {
  345. if (!t4.featureAttributes[e3])
  346. continue;
  347. const n5 = { ...t4.featureAttributes[e3], byteOffset: r5, count: c5 };
  348. o4.featureAttributes[e3] = n5;
  349. r5 += (n5.valueType === "UInt64" ? 8 : O2(n5.valueType)) * n5.valuesPerElement * c5;
  350. }
  351. }
  352. return d3(r5, e2.byteLength, "geometry"), o4.byteCount = r5 - o4.byteOffset, o4;
  353. }
  354. var C = { position: O.POSITION, normal: O.NORMAL, color: O.COLOR, uv0: O.UV0, region: O.UVREGION };
  355. function I(t4, n4, i2) {
  356. if (t4.encoding === "lepcc-rgb")
  357. return u(n4);
  358. if (t4.encoding === "lepcc-intensity")
  359. return w(n4);
  360. if (t4.encoding != null && t4.encoding !== "")
  361. throw new s2("unknown-attribute-storage-info-encoding", "Unknown Attribute Storage Info Encoding");
  362. t4["attributeByteCounts "] && !t4.attributeByteCounts && (u2.warn("Warning: Trailing space in 'attributeByteCounts '."), t4.attributeByteCounts = t4["attributeByteCounts "]), t4.ordering[0] === "ObjectIds" && t4.hasOwnProperty("objectIds") && (u2.warn("Warning: Case error in objectIds"), t4.ordering[0] = "objectIds");
  363. const a6 = b(n4, t4, i2);
  364. d3(a6.byteOffset + a6.byteCount, n4.byteLength, "attribute");
  365. const s5 = a6.entries.attributeValues || a6.entries.objectIds;
  366. if (s5) {
  367. if (s5.valueType === "String") {
  368. const e2 = a6.entries.attributeByteCounts, t5 = f2(n4, e2), r5 = l2(n4, s5);
  369. return c2(e2.count, t5, r5);
  370. }
  371. return f2(n4, s5);
  372. }
  373. throw new s2("bad-attribute-storage-info", "Bad attributeStorageInfo specification.");
  374. }
  375. var m2 = { Float32: Float32Array, Float64: Float64Array, UInt8: Uint8Array, Int8: Int8Array, UInt16: Uint16Array, Int16: Int16Array, UInt32: Uint32Array, Int32: Int32Array };
  376. var h2 = { Float32: (e2, t4) => new DataView(e2, 0).getFloat32(t4, true), Float64: (e2, t4) => new DataView(e2, 0).getFloat64(t4, true), UInt8: (e2, t4) => new DataView(e2, 0).getUint8(t4), Int8: (e2, t4) => new DataView(e2, 0).getInt8(t4), UInt16: (e2, t4) => new DataView(e2, 0).getUint16(t4, true), Int16: (e2, t4) => new DataView(e2, 0).getInt16(t4, true), UInt32: (e2, t4) => new DataView(e2, 0).getUint32(t4, true), Int32: (e2, t4) => new DataView(e2, 0).getInt32(t4, true) };
  377. function A(e2) {
  378. return m2.hasOwnProperty(e2);
  379. }
  380. function O2(e2) {
  381. return A(e2) ? m2[e2].BYTES_PER_ELEMENT : 0;
  382. }
  383. // node_modules/@arcgis/core/views/3d/layers/i3s/PointCloudWorkerUtil.js
  384. function f3(e2, o4, n4, s5) {
  385. const { rendererJSON: i2, isRGBRenderer: u3 } = e2;
  386. let f4 = null, c5 = null;
  387. if (o4 && u3)
  388. f4 = o4;
  389. else if (o4 && i2.type === "pointCloudUniqueValueRenderer") {
  390. c5 = a2.fromJSON(i2);
  391. const e3 = c5.colorUniqueValueInfos;
  392. f4 = new Uint8Array(3 * s5);
  393. const r5 = p(c5.fieldTransformType);
  394. for (let t4 = 0; t4 < s5; t4++) {
  395. const l3 = (r5 ? r5(o4[t4]) : o4[t4]) + "";
  396. for (let o5 = 0; o5 < e3.length; o5++)
  397. if (e3[o5].values.includes(l3)) {
  398. f4[3 * t4] = e3[o5].color.r, f4[3 * t4 + 1] = e3[o5].color.g, f4[3 * t4 + 2] = e3[o5].color.b;
  399. break;
  400. }
  401. }
  402. } else if (o4 && i2.type === "pointCloudStretchRenderer") {
  403. c5 = a.fromJSON(i2);
  404. const e3 = c5.stops;
  405. f4 = new Uint8Array(3 * s5);
  406. const r5 = p(c5.fieldTransformType);
  407. for (let t4 = 0; t4 < s5; t4++) {
  408. const l3 = r5 ? r5(o4[t4]) : o4[t4], n5 = e3.length - 1;
  409. if (l3 < e3[0].value)
  410. f4[3 * t4] = e3[0].color.r, f4[3 * t4 + 1] = e3[0].color.g, f4[3 * t4 + 2] = e3[0].color.b;
  411. else if (l3 >= e3[n5].value)
  412. f4[3 * t4] = e3[n5].color.r, f4[3 * t4 + 1] = e3[n5].color.g, f4[3 * t4 + 2] = e3[n5].color.b;
  413. else
  414. for (let o5 = 1; o5 < e3.length; o5++)
  415. if (l3 < e3[o5].value) {
  416. const r6 = (l3 - e3[o5 - 1].value) / (e3[o5].value - e3[o5 - 1].value);
  417. f4[3 * t4] = e3[o5].color.r * r6 + e3[o5 - 1].color.r * (1 - r6), f4[3 * t4 + 1] = e3[o5].color.g * r6 + e3[o5 - 1].color.g * (1 - r6), f4[3 * t4 + 2] = e3[o5].color.b * r6 + e3[o5 - 1].color.b * (1 - r6);
  418. break;
  419. }
  420. }
  421. } else if (o4 && i2.type === "pointCloudClassBreaksRenderer") {
  422. c5 = d.fromJSON(i2);
  423. const e3 = c5.colorClassBreakInfos;
  424. f4 = new Uint8Array(3 * s5);
  425. const t4 = p(c5.fieldTransformType);
  426. for (let r5 = 0; r5 < s5; r5++) {
  427. const l3 = t4 ? t4(o4[r5]) : o4[r5];
  428. for (let o5 = 0; o5 < e3.length; o5++)
  429. if (l3 >= e3[o5].minValue && l3 <= e3[o5].maxValue) {
  430. f4[3 * r5] = e3[o5].color.r, f4[3 * r5 + 1] = e3[o5].color.g, f4[3 * r5 + 2] = e3[o5].color.b;
  431. break;
  432. }
  433. }
  434. } else {
  435. f4 = new Uint8Array(3 * s5);
  436. for (let e3 = 0; e3 < f4.length; e3++)
  437. f4[e3] = 255;
  438. }
  439. if (n4 && c5 && c5.colorModulation) {
  440. const e3 = c5.colorModulation.minValue, o5 = c5.colorModulation.maxValue, r5 = 0.3;
  441. for (let t4 = 0; t4 < s5; t4++) {
  442. const l3 = n4[t4], s6 = l3 >= o5 ? 1 : l3 <= e3 ? r5 : r5 + (1 - r5) * (l3 - e3) / (o5 - e3);
  443. f4[3 * t4] = s6 * f4[3 * t4], f4[3 * t4 + 1] = s6 * f4[3 * t4 + 1], f4[3 * t4 + 2] = s6 * f4[3 * t4 + 2];
  444. }
  445. }
  446. return f4;
  447. }
  448. function c3(o4, r5) {
  449. if (o4.encoding == null || o4.encoding === "") {
  450. const t4 = g(r5, o4);
  451. if (t(t4.vertexAttributes.position))
  452. return;
  453. const l3 = f2(r5, t4.vertexAttributes.position), i2 = t4.header.fields, u3 = [i2.offsetX, i2.offsetY, i2.offsetZ], f4 = [i2.scaleX, i2.scaleY, i2.scaleZ], c5 = l3.length / 3, a6 = new Float64Array(3 * c5);
  454. for (let e2 = 0; e2 < c5; e2++)
  455. a6[3 * e2] = l3[3 * e2] * f4[0] + u3[0], a6[3 * e2 + 1] = l3[3 * e2 + 1] * f4[1] + u3[1], a6[3 * e2 + 2] = l3[3 * e2 + 2] * f4[2] + u3[2];
  456. return a6;
  457. }
  458. if (o4.encoding === "lepcc-xyz")
  459. return c(r5).result;
  460. }
  461. function a5(e2, r5, t4) {
  462. return r(e2) && e2.attributeInfo.useElevation ? d4(r5, t4) : r(e2) ? I(e2.attributeInfo.storageInfo, e2.buffer, t4) : null;
  463. }
  464. function d4(e2, o4) {
  465. const r5 = new Float64Array(o4);
  466. for (let t4 = 0; t4 < o4; t4++)
  467. r5[t4] = e2[3 * t4 + 2];
  468. return r5;
  469. }
  470. function m3(e2, o4, r5, t4, l3) {
  471. const n4 = e2.length / 3;
  472. let s5 = 0;
  473. for (let i2 = 0; i2 < n4; i2++) {
  474. let n5 = true;
  475. for (let e3 = 0; e3 < t4.length && n5; e3++) {
  476. const { filterJSON: o5 } = t4[e3], r6 = l3[e3].values[i2];
  477. switch (o5.type) {
  478. case "pointCloudValueFilter": {
  479. const e4 = o5.mode === "exclude";
  480. o5.values.includes(r6) === e4 && (n5 = false);
  481. break;
  482. }
  483. case "pointCloudBitfieldFilter": {
  484. const e4 = b2(o5.requiredSetBits), t5 = b2(o5.requiredClearBits);
  485. (r6 & e4) === e4 && (r6 & t5) == 0 || (n5 = false);
  486. break;
  487. }
  488. case "pointCloudReturnFilter": {
  489. const e4 = 15 & r6, t5 = r6 >>> 4 & 15, l4 = t5 > 1, s6 = e4 === 1, i3 = e4 === t5;
  490. let u3 = false;
  491. for (const r7 of o5.includedReturns)
  492. if (r7 === "last" && i3 || r7 === "firstOfMany" && s6 && l4 || r7 === "lastOfMany" && i3 && l4 || r7 === "single" && !l4) {
  493. u3 = true;
  494. break;
  495. }
  496. u3 || (n5 = false);
  497. break;
  498. }
  499. }
  500. }
  501. n5 && (r5[s5] = i2, e2[3 * s5] = e2[3 * i2], e2[3 * s5 + 1] = e2[3 * i2 + 1], e2[3 * s5 + 2] = e2[3 * i2 + 2], o4[3 * s5] = o4[3 * i2], o4[3 * s5 + 1] = o4[3 * i2 + 1], o4[3 * s5 + 2] = o4[3 * i2 + 2], s5++);
  502. }
  503. return s5;
  504. }
  505. function p(e2) {
  506. return e2 == null || e2 === "none" ? null : e2 === "low-four-bit" ? (e3) => 15 & e3 : e2 === "high-four-bit" ? (e3) => (240 & e3) >> 4 : e2 === "absolute-value" ? (e3) => Math.abs(e3) : e2 === "modulo-ten" ? (e3) => e3 % 10 : null;
  507. }
  508. function b2(e2) {
  509. let o4 = 0;
  510. for (const r5 of e2 || [])
  511. o4 |= 1 << r5;
  512. return o4;
  513. }
  514. // node_modules/@arcgis/core/views/3d/layers/PointCloudWorker.js
  515. var c4 = class {
  516. transform(e2) {
  517. const a6 = this._transform(e2), o4 = [a6.points.buffer, a6.rgb.buffer];
  518. r(a6.pointIdFilterMap) && o4.push(a6.pointIdFilterMap.buffer);
  519. for (const t4 of a6.attributes)
  520. "buffer" in t4.values && o(t4.values.buffer) && t4.values.buffer !== a6.rgb.buffer && o4.push(t4.values.buffer);
  521. return Promise.resolve({ result: a6, transferList: o4 });
  522. }
  523. _transform(r5) {
  524. const e2 = c3(r5.schema, r5.geometryBuffer);
  525. let a6 = e2.length / 3, o4 = null;
  526. const f4 = [], s5 = a5(r5.primaryAttributeData, e2, a6);
  527. r(r5.primaryAttributeData) && s5 && f4.push({ attributeInfo: r5.primaryAttributeData.attributeInfo, values: s5 });
  528. const i2 = a5(r5.modulationAttributeData, e2, a6);
  529. r(r5.modulationAttributeData) && i2 && f4.push({ attributeInfo: r5.modulationAttributeData.attributeInfo, values: i2 });
  530. let c5 = f3(r5.rendererInfo, s5, i2, a6);
  531. if (r5.filterInfo && r5.filterInfo.length > 0 && r(r5.filterAttributesData)) {
  532. const t4 = r5.filterAttributesData.map((t5) => {
  533. const r6 = a5(t5, e2, a6), o5 = { attributeInfo: t5.attributeInfo, values: r6 };
  534. return f4.push(o5), o5;
  535. });
  536. o4 = new Uint32Array(a6), a6 = m3(e2, c5, o4, r5.filterInfo, t4);
  537. }
  538. for (const t4 of r5.userAttributesData) {
  539. const r6 = a5(t4, e2, a6);
  540. f4.push({ attributeInfo: t4.attributeInfo, values: r6 });
  541. }
  542. 3 * a6 < c5.length && (c5 = new Uint8Array(c5.buffer.slice(0, 3 * a6))), this._applyElevationOffsetInPlace(e2, a6, r5.elevationOffset);
  543. const p3 = this._transformCoordinates(e2, a6, r5.obb, k.fromJSON(r5.inSR), k.fromJSON(r5.outSR));
  544. return { obb: r5.obb, points: p3, rgb: c5, attributes: f4, pointIdFilterMap: o4 };
  545. }
  546. _transformCoordinates(t4, r5, a6, n4, u3) {
  547. if (!Un(t4, n4, 0, t4, u3, 0, r5))
  548. throw Error("Can't reproject");
  549. const l3 = r2(a6.center[0], a6.center[1], a6.center[2]), b3 = n(), m4 = n();
  550. S2(p2, a6.quaternion);
  551. const c5 = new Float32Array(3 * r5);
  552. for (let e2 = 0; e2 < r5; e2++)
  553. b3[0] = t4[3 * e2] - l3[0], b3[1] = t4[3 * e2 + 1] - l3[1], b3[2] = t4[3 * e2 + 2] - l3[2], S(m4, b3, p2), a6.halfSize[0] = Math.max(a6.halfSize[0], Math.abs(m4[0])), a6.halfSize[1] = Math.max(a6.halfSize[1], Math.abs(m4[1])), a6.halfSize[2] = Math.max(a6.halfSize[2], Math.abs(m4[2])), c5[3 * e2] = b3[0], c5[3 * e2 + 1] = b3[1], c5[3 * e2 + 2] = b3[2];
  554. return c5;
  555. }
  556. _applyElevationOffsetInPlace(t4, r5, e2) {
  557. if (e2 !== 0)
  558. for (let a6 = 0; a6 < r5; a6++)
  559. t4[3 * a6 + 2] += e2;
  560. }
  561. };
  562. var p2 = e();
  563. function h3() {
  564. return new c4();
  565. }
  566. export {
  567. h3 as default
  568. };
  569. //# sourceMappingURL=PointCloudWorker-Z76DJAJC.js.map