meshFeatureSet-4HLNQKAX.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  1. import {
  2. x as x3
  3. } from "./chunk-UWKVAZQ6.js";
  4. import {
  5. g as g5,
  6. p as p3
  7. } from "./chunk-SFI4OJO6.js";
  8. import "./chunk-UE4KC4K5.js";
  9. import {
  10. n as n3
  11. } from "./chunk-7LRVL5YB.js";
  12. import {
  13. L as L2,
  14. L2 as L3,
  15. M,
  16. O as O3,
  17. _ as _2,
  18. a as a2,
  19. b,
  20. g as g3,
  21. h as h2,
  22. j,
  23. k,
  24. k2,
  25. r as r3,
  26. v as v2,
  27. x,
  28. x2
  29. } from "./chunk-BXBBOCLV.js";
  30. import "./chunk-IRQMHCT3.js";
  31. import "./chunk-W3XAGTM6.js";
  32. import {
  33. e as e4
  34. } from "./chunk-44FMXGSC.js";
  35. import "./chunk-XFDO4CMR.js";
  36. import {
  37. e as e3
  38. } from "./chunk-GHN7C53L.js";
  39. import "./chunk-HIELTLML.js";
  40. import {
  41. x as x4
  42. } from "./chunk-NLLFSKB2.js";
  43. import "./chunk-6FXLJAMI.js";
  44. import {
  45. a
  46. } from "./chunk-O3JQY77G.js";
  47. import "./chunk-E3G7BRZB.js";
  48. import {
  49. Zn,
  50. gn
  51. } from "./chunk-P24XEEHY.js";
  52. import "./chunk-SAJAEMIJ.js";
  53. import {
  54. g as g4
  55. } from "./chunk-7C23ILQ4.js";
  56. import "./chunk-P6VVVEX6.js";
  57. import "./chunk-3Z755LKF.js";
  58. import "./chunk-LTZ5XXDV.js";
  59. import "./chunk-DLMAGHHC.js";
  60. import "./chunk-JOYXMSKE.js";
  61. import {
  62. a as a3
  63. } from "./chunk-YZVAB3DF.js";
  64. import "./chunk-ECY35CJI.js";
  65. import "./chunk-JGBXYDGB.js";
  66. import "./chunk-QEWF7QPH.js";
  67. import "./chunk-MCWCB5IY.js";
  68. import "./chunk-TV3CFJQR.js";
  69. import {
  70. l
  71. } from "./chunk-TJV6ODRM.js";
  72. import "./chunk-4ONPMX2F.js";
  73. import "./chunk-CRGY2SDS.js";
  74. import "./chunk-4T5ZGMEN.js";
  75. import {
  76. g as g2
  77. } from "./chunk-VGWC3IKZ.js";
  78. import "./chunk-2H5MD622.js";
  79. import {
  80. O
  81. } from "./chunk-3RSFVUKZ.js";
  82. import "./chunk-UVVU4UUO.js";
  83. import "./chunk-X4SA4ELJ.js";
  84. import "./chunk-5N7JLUJJ.js";
  85. import "./chunk-ZAY3CMAZ.js";
  86. import "./chunk-P3XKUGLS.js";
  87. import "./chunk-LU5IJZB4.js";
  88. import "./chunk-7IBV2TRE.js";
  89. import "./chunk-ZLNEXZAN.js";
  90. import "./chunk-5UVJ64RB.js";
  91. import "./chunk-SFEFRQCL.js";
  92. import "./chunk-3GZSQU56.js";
  93. import "./chunk-ZYRIJWLX.js";
  94. import "./chunk-RYY6632W.js";
  95. import {
  96. O as O2,
  97. S,
  98. e as e2,
  99. g,
  100. o,
  101. u,
  102. z
  103. } from "./chunk-DW42UVIT.js";
  104. import "./chunk-YAEIHDJH.js";
  105. import {
  106. f as f2,
  107. n as n2,
  108. r as r2
  109. } from "./chunk-TJNOJH33.js";
  110. import "./chunk-OSHI574D.js";
  111. import "./chunk-ETGAZ7LF.js";
  112. import "./chunk-75U5LM2V.js";
  113. import "./chunk-RMDDCMKS.js";
  114. import {
  115. h,
  116. v2 as v
  117. } from "./chunk-VCH45Q2I.js";
  118. import "./chunk-LBW34VZ2.js";
  119. import "./chunk-GSSTTHIT.js";
  120. import {
  121. m as m2
  122. } from "./chunk-YFSLJIO4.js";
  123. import "./chunk-IM3LVQXV.js";
  124. import {
  125. m
  126. } from "./chunk-55RWC67C.js";
  127. import "./chunk-HZRKBTHJ.js";
  128. import "./chunk-DVUG3KID.js";
  129. import "./chunk-FWSQEIAR.js";
  130. import {
  131. Ot,
  132. _
  133. } from "./chunk-VEGAOVMY.js";
  134. import {
  135. p as p2,
  136. w,
  137. w2
  138. } from "./chunk-6T6G6LCQ.js";
  139. import "./chunk-YEJL5NEF.js";
  140. import "./chunk-PQFTYGF5.js";
  141. import {
  142. e,
  143. n5 as n,
  144. y3 as y2
  145. } from "./chunk-2Z2TG5CU.js";
  146. import "./chunk-6KZ2LTDA.js";
  147. import "./chunk-U2XHEJM7.js";
  148. import "./chunk-SQOPWYIT.js";
  149. import {
  150. L,
  151. f,
  152. p,
  153. y
  154. } from "./chunk-V6P2MAQQ.js";
  155. import {
  156. s2 as s,
  157. s3 as s2
  158. } from "./chunk-E5O6P5I2.js";
  159. import "./chunk-SPWQ3AWG.js";
  160. import "./chunk-2TIUKVZN.js";
  161. import {
  162. r,
  163. t
  164. } from "./chunk-YXWMMD76.js";
  165. import "./chunk-S5KM4IGW.js";
  166. // node_modules/@arcgis/core/geometry/support/triangulationUtils.js
  167. function o2(t2) {
  168. const o3 = l2(t2.rings, t2.hasZ, c.CCW_IS_HOLE), s4 = new Array();
  169. let i2 = 0, h5 = 0;
  170. for (const e5 of o3.polygons) {
  171. const t3 = e5.count, r5 = e5.index, l6 = new Float64Array(o3.position.buffer, 3 * r5 * o3.position.BYTES_PER_ELEMENT, 3 * t3), c5 = e5.holeIndices.map((n4) => n4 - r5), f8 = new Uint32Array(x3(l6, c5, 3));
  172. s4.push({ position: l6, faces: f8 }), i2 += l6.length, h5 += f8.length;
  173. }
  174. const f7 = r4(s4, i2, h5), a5 = n3(f7.position.buffer, 6, { originalIndices: f7.faces });
  175. return f7.position = new Float64Array(a5.buffer), f7.faces = a5.indices, f7;
  176. }
  177. function r4(n4, t2, e5) {
  178. if (1 === n4.length)
  179. return n4[0];
  180. const o3 = new Float64Array(t2), r5 = new Uint32Array(e5);
  181. let l6 = 0, s4 = 0, i2 = 0;
  182. for (const c5 of n4) {
  183. for (let n5 = 0; n5 < c5.position.length; n5++)
  184. o3[l6++] = c5.position[n5];
  185. for (let n5 = 0; n5 < c5.faces.length; n5++)
  186. r5[s4++] = c5.faces[n5] + i2;
  187. i2 = l6 / 3;
  188. }
  189. return { position: o3, faces: r5 };
  190. }
  191. function l2(n4, t2, e5) {
  192. const o3 = n4.length, r5 = new Array(o3), l6 = new Array(o3), h5 = new Array(o3);
  193. let f7 = 0, a5 = 0, g9 = 0, u4 = 0;
  194. for (let s4 = 0; s4 < o3; ++s4)
  195. u4 += n4[s4].length;
  196. const p8 = new Float64Array(3 * u4);
  197. let y7 = 0;
  198. for (let d4 = o3 - 1; d4 >= 0; d4--) {
  199. const u5 = n4[d4], w7 = e5 === c.CCW_IS_HOLE && i(u5);
  200. if (w7 && 1 !== o3)
  201. r5[f7++] = u5;
  202. else {
  203. let n5 = u5.length;
  204. for (let t3 = 0; t3 < f7; ++t3)
  205. n5 += r5[t3].length;
  206. const e6 = { index: y7, pathLengths: new Array(f7 + 1), count: n5, holeIndices: new Array(f7) };
  207. e6.pathLengths[0] = u5.length, u5.length > 0 && (h5[g9++] = { index: y7, count: u5.length }), y7 = w7 ? s3(u5, u5.length - 1, -1, p8, y7, u5.length, t2) : s3(u5, 0, 1, p8, y7, u5.length, t2);
  208. for (let o4 = 0; o4 < f7; ++o4) {
  209. const n6 = r5[o4];
  210. e6.holeIndices[o4] = y7, e6.pathLengths[o4 + 1] = n6.length, n6.length > 0 && (h5[g9++] = { index: y7, count: n6.length }), y7 = s3(n6, 0, 1, p8, y7, n6.length, t2);
  211. }
  212. f7 = 0, e6.count > 0 && (l6[a5++] = e6);
  213. }
  214. }
  215. for (let i2 = 0; i2 < f7; ++i2) {
  216. const n5 = r5[i2];
  217. n5.length > 0 && (h5[g9++] = { index: y7, count: n5.length }), y7 = s3(n5, 0, 1, p8, y7, n5.length, t2);
  218. }
  219. return l6.length = a5, h5.length = g9, { position: p8, polygons: l6, outlines: h5 };
  220. }
  221. function s3(n4, t2, e5, o3, r5, l6, s4) {
  222. r5 *= 3;
  223. for (let i2 = 0; i2 < l6; ++i2) {
  224. const l7 = n4[t2];
  225. o3[r5++] = l7[0], o3[r5++] = l7[1], o3[r5++] = s4 ? l7[2] : 0, t2 += e5;
  226. }
  227. return r5 / 3;
  228. }
  229. function i(n4) {
  230. return !h(n4, false, false);
  231. }
  232. var c;
  233. !function(n4) {
  234. n4[n4.NONE = 0] = "NONE", n4[n4.CCW_IS_HOLE = 1] = "CCW_IS_HOLE";
  235. }(c || (c = {}));
  236. // node_modules/@arcgis/core/geometry/support/meshUtils/centerAt.js
  237. var a4 = s.getLogger("esri.geometry.support.meshUtils.centerAt");
  238. function c2(e5, r5, i2) {
  239. var _a;
  240. if (!e5.vertexAttributes || !e5.vertexAttributes.position)
  241. return;
  242. const n4 = (_a = i2 == null ? void 0 : i2.origin) != null ? _a : e5.origin;
  243. if (r(e5.transform))
  244. null != (i2 == null ? void 0 : i2.geographic) && i2.geographic !== e5.transform.geographic && a4.warn(`Specifying the 'geographic' parameter (${i2.geographic}) different from the Mesh transform setting (${e5.transform.geographic}) is not supported`), f3(e5.transform, r5, n4);
  245. else {
  246. r3(e5.spatialReference, i2) ? p4(e5, r5, n4) : g6(e5, r5, n4);
  247. }
  248. }
  249. function f3(e5, t2, r5) {
  250. const i2 = t2.x - r5.x, o3 = t2.y - r5.y, n4 = t2.hasZ && r5.hasZ ? t2.z - r5.z : 0, s4 = e5.origin;
  251. e5.origin = [s4[0] + i2, s4[1] + o3, s4[2] + n4];
  252. }
  253. function p4(e5, t2, r5) {
  254. const i2 = b(e5.vertexAttributes, r5, { geographic: true }), { position: o3, normal: a5, tangent: c5 } = x2(i2, t2, { geographic: true });
  255. e5.vertexAttributes.position = o3, e5.vertexAttributes.normal = a5, e5.vertexAttributes.tangent = c5, e5.vertexAttributesChanged();
  256. }
  257. function g6(e5, t2, r5) {
  258. const o3 = h3, n4 = l3;
  259. if (gn(t2, n4, e5.spatialReference)) {
  260. if (!gn(r5, o3, e5.spatialReference)) {
  261. const t3 = e5.origin;
  262. o3[0] = t3.x, o3[1] = t3.y, o3[2] = t3.z, a4.error(`Failed to project specified origin (wkid:${r5.spatialReference.wkid}) to mesh spatial reference (wkid:${e5.spatialReference.wkid}).`);
  263. }
  264. m3(e5.vertexAttributes.position, n4, o3), e5.vertexAttributesChanged();
  265. } else
  266. a4.error(`Failed to project centerAt location (wkid:${t2.spatialReference.wkid}) to mesh spatial reference (wkid:${e5.spatialReference.wkid})`);
  267. }
  268. function m3(e5, t2, r5) {
  269. if (e5)
  270. for (let i2 = 0; i2 < e5.length; i2 += 3)
  271. for (let o3 = 0; o3 < 3; o3++)
  272. e5[i2 + o3] += t2[o3] - r5[o3];
  273. }
  274. var l3 = n2();
  275. var h3 = n2();
  276. // node_modules/@arcgis/core/geometry/support/meshUtils/loadExternal.js
  277. async function u2(e5, s4, o3) {
  278. const { loadGLTFMesh: n4 } = await y(import("./loadGLTFMesh-WBYY2AJJ.js"), o3), a5 = await m4(s4, o3), i2 = n4(new w({ x: 0, y: 0, z: 0, spatialReference: e5.spatialReference }), a5.url, { resolveFile: f4(a5), useTransform: true, signal: r(o3) ? o3.signal : null });
  279. i2.then(() => a5.dispose(), () => a5.dispose());
  280. const { vertexAttributes: l6, components: u4 } = await i2;
  281. e5.vertexAttributes = l6, e5.components = u4;
  282. }
  283. function f4(e5) {
  284. const t2 = Ot(e5.url);
  285. return (s4) => {
  286. var _a;
  287. const r5 = _(s4, t2, t2), o3 = r5 ? r5.replace(/^ *\.\//, "") : null;
  288. return (_a = o3 ? e5.files.get(o3) : null) != null ? _a : s4;
  289. };
  290. }
  291. async function m4(e5, t2) {
  292. return e5 instanceof Blob ? y3.fromBlob(e5) : "string" == typeof e5 ? new y3(e5) : Array.isArray(e5) ? p5(e5, t2) : w3(e5, t2);
  293. }
  294. async function p5(t2, r5) {
  295. const i2 = /* @__PURE__ */ new Map();
  296. let l6 = null;
  297. const c5 = await L(t2.map(async (e5) => ({ name: e5.name, source: await m4(e5 instanceof Blob ? e5 : e5.source, r5) }))), u4 = [];
  298. for (const e5 of c5)
  299. e5 && (p(r5) ? e5.source.dispose() : u4.push(e5));
  300. f(r5);
  301. for (const { name: e5, source: o3 } of u4)
  302. (t(l6) || /\.(gltf|glb)/i.test(e5)) && (l6 = o3.url), i2.set(e5, o3.url), o3.files && o3.files.forEach((e6, t3) => i2.set(t3, e6));
  303. if (t(l6))
  304. throw new s2("mesh-load-external:missing-files", "Missing files to load external mesh source");
  305. return new y3(l6, () => u4.forEach(({ source: e5 }) => e5.dispose()), i2);
  306. }
  307. async function w3(e5, t2) {
  308. const { default: s4 } = await y(import("./request-TKJSZZ4X.js"), t2), o3 = "string" == typeof e5.multipart[0] ? await Promise.all(e5.multipart.map(async (e6) => (await s4(e6, { responseType: "array-buffer" })).data)) : e5.multipart;
  309. return y3.fromBlob(new Blob(o3));
  310. }
  311. var y3 = class {
  312. constructor(e5, t2 = () => {
  313. }, s4 = /* @__PURE__ */ new Map()) {
  314. this.url = e5, this.dispose = t2, this.files = s4;
  315. }
  316. static fromBlob(e5) {
  317. const t2 = URL.createObjectURL(e5);
  318. return new y3(t2, () => URL.revokeObjectURL(t2));
  319. }
  320. };
  321. // node_modules/@arcgis/core/geometry/support/meshUtils/offset.js
  322. function x5(e5, o3, i2) {
  323. if (e5.vertexAttributes && e5.vertexAttributes.position)
  324. if (r(e5.transform))
  325. null != (i2 == null ? void 0 : i2.geographic) && i2.geographic !== e5.transform.geographic && s.getLogger("esri.geometry.support.meshUtils.offset").warn(`Specifying the 'geographic' parameter (${i2.geographic}) different from the Mesh transform setting (${e5.transform.geographic}) is not supported`), A(e5.transform, o3);
  326. else {
  327. r3(e5.spatialReference, i2) ? v3(e5, o3) : b2(e5, o3);
  328. }
  329. }
  330. function A(t2, r5) {
  331. const e5 = t2.origin;
  332. t2.origin = u(n2(), e5, r5);
  333. }
  334. function v3(t2, o3) {
  335. const i2 = t2.spatialReference, n4 = t2.vertexAttributes.position, a5 = t2.vertexAttributes.normal, c5 = t2.vertexAttributes.tangent, x8 = new Float64Array(n4.length), A4 = r(a5) ? new Float32Array(a5.length) : null, v6 = r(c5) ? new Float32Array(c5.length) : null, b4 = t2.extent.center, F2 = d;
  336. Zn(i2, [b4.x, b4.y, b4.z], k3, O(i2)), a(w4, k3), S(F2, o3, w4), M(n4, i2, x8), r(a5) && r(A4) && j(a5, n4, x8, i2, A4), r(c5) && r(v6) && k2(c5, n4, x8, i2, v6), y4(x8, F2), O3(x8, n4, i2), r(a5) && r(A4) && h2(A4, n4, x8, i2, a5), r(c5) && r(v6) && L3(v6, n4, x8, i2, c5), t2.vertexAttributesChanged();
  337. }
  338. function b2(t2, r5) {
  339. y4(t2.vertexAttributes.position, r5), t2.vertexAttributesChanged();
  340. }
  341. function y4(t2, r5) {
  342. if (t2)
  343. for (let e5 = 0; e5 < t2.length; e5 += 3)
  344. for (let o3 = 0; o3 < 3; o3++)
  345. t2[e5 + o3] += r5[o3];
  346. }
  347. var d = n2();
  348. var k3 = e4();
  349. var w4 = e3();
  350. // node_modules/@arcgis/core/geometry/support/meshUtils/primitives.js
  351. function c3() {
  352. const { faceDescriptions: t2, faceVertexOffsets: e5, uvScales: n4 } = d2, r5 = 4 * t2.length, o3 = new Float64Array(3 * r5), s4 = new Float32Array(3 * r5), a5 = new Float32Array(2 * r5), i2 = new Uint32Array(2 * t2.length * 3);
  353. let c5 = 0, l6 = 0, f7 = 0, u4 = 0;
  354. for (let h5 = 0; h5 < t2.length; h5++) {
  355. const r6 = t2[h5], p8 = c5 / 3;
  356. for (const t3 of e5)
  357. i2[u4++] = p8 + t3;
  358. const m7 = r6.corners;
  359. for (let t3 = 0; t3 < 4; t3++) {
  360. const e6 = m7[t3];
  361. let i3 = 0;
  362. a5[f7++] = 0.25 * n4[t3][0] + r6.uvOrigin[0], a5[f7++] = r6.uvOrigin[1] - 0.25 * n4[t3][1];
  363. for (let t4 = 0; t4 < 3; t4++)
  364. 0 !== r6.axis[t4] ? (o3[c5++] = 0.5 * r6.axis[t4], s4[l6++] = r6.axis[t4]) : (o3[c5++] = 0.5 * e6[i3++], s4[l6++] = 0);
  365. }
  366. }
  367. return { position: o3, normal: s4, uv: a5, faces: i2 };
  368. }
  369. function l4(e5, n4) {
  370. const r5 = e5.components[0], o3 = r5.faces, a5 = M2[n4], i2 = 6 * a5, c5 = new Array(6), l6 = new Array(o3.length - 6);
  371. let f7 = 0, u4 = 0;
  372. for (let t2 = 0; t2 < o3.length; t2++)
  373. t2 >= i2 && t2 < i2 + 6 ? c5[f7++] = o3[t2] : l6[u4++] = o3[t2];
  374. if (r(e5.vertexAttributes.uv)) {
  375. const t2 = new Float32Array(e5.vertexAttributes.uv), n5 = 4 * a5 * 2, r6 = [0, 1, 1, 1, 1, 0, 0, 0];
  376. for (let e6 = 0; e6 < r6.length; e6++)
  377. t2[n5 + e6] = r6[e6];
  378. e5.vertexAttributes.uv = t2;
  379. }
  380. return e5.components = [new g5({ faces: c5, material: r5.material }), new g5({ faces: l6 })], e5;
  381. }
  382. function f5(t2 = 0) {
  383. const e5 = Math.round(8 * 2 ** t2), n4 = 2 * e5, r5 = (e5 - 1) * (n4 + 1) + 2 * n4, o3 = new Float64Array(3 * r5), s4 = new Float32Array(3 * r5), a5 = new Float32Array(2 * r5), i2 = new Uint32Array(3 * ((e5 - 1) * n4 * 2));
  384. let c5 = 0, l6 = 0, f7 = 0, u4 = 0;
  385. for (let h5 = 0; h5 <= e5; h5++) {
  386. const t3 = h5 / e5 * Math.PI + 0.5 * Math.PI, r6 = Math.cos(t3), p8 = Math.sin(t3);
  387. F[2] = p8;
  388. const m7 = 0 === h5 || h5 === e5, w7 = m7 ? n4 - 1 : n4;
  389. for (let v6 = 0; v6 <= w7; v6++) {
  390. const t4 = v6 / w7 * 2 * Math.PI;
  391. F[0] = -Math.sin(t4) * r6, F[1] = Math.cos(t4) * r6;
  392. for (let e6 = 0; e6 < 3; e6++)
  393. o3[c5] = 0.5 * F[e6], s4[c5] = F[e6], ++c5;
  394. a5[l6++] = (v6 + (m7 ? 0.5 : 0)) / n4, a5[l6++] = h5 / e5, 0 !== h5 && v6 !== n4 && (h5 !== e5 && (i2[f7++] = u4, i2[f7++] = u4 + 1, i2[f7++] = u4 - n4), 1 !== h5 && (i2[f7++] = u4, i2[f7++] = u4 - n4, i2[f7++] = u4 - n4 - 1)), u4++;
  395. }
  396. }
  397. return { position: o3, normal: s4, uv: a5, faces: i2 };
  398. }
  399. function u3(t2 = 0) {
  400. const e5 = 5, n4 = Math.round(16 * 2 ** t2), r5 = (e5 - 1) * (n4 + 1) + 2 * n4, o3 = new Float64Array(3 * r5), s4 = new Float32Array(3 * r5), a5 = new Float32Array(2 * r5), i2 = new Uint32Array(3 * (4 * n4));
  401. let c5 = 0, l6 = 0, f7 = 0, u4 = 0, h5 = 0;
  402. for (let p8 = 0; p8 <= e5; p8++) {
  403. const t3 = 0 === p8 || p8 === e5, r6 = p8 <= 1 || p8 >= e5 - 1, m7 = 2 === p8 || 4 === p8, w7 = t3 ? n4 - 1 : n4;
  404. for (let v6 = 0; v6 <= w7; v6++) {
  405. const g9 = v6 / w7 * 2 * Math.PI, A4 = t3 ? 0 : 0.5;
  406. F[0] = A4 * Math.sin(g9), F[1] = A4 * -Math.cos(g9), F[2] = p8 <= 2 ? 0.5 : -0.5;
  407. for (let t4 = 0; t4 < 3; t4++)
  408. o3[c5++] = F[t4], s4[l6++] = r6 ? 2 === t4 ? p8 <= 1 ? 1 : -1 : 0 : 2 === t4 ? 0 : F[t4] / A4;
  409. a5[f7++] = (v6 + (t3 ? 0.5 : 0)) / n4, a5[f7++] = p8 <= 1 ? 1 * p8 / 3 : p8 <= 3 ? 1 * (p8 - 2) / 3 + 1 / 3 : 1 * (p8 - 4) / 3 + 2 / 3, m7 || 0 === p8 || v6 === n4 || (p8 !== e5 && (i2[u4++] = h5, i2[u4++] = h5 + 1, i2[u4++] = h5 - n4), 1 !== p8 && (i2[u4++] = h5, i2[u4++] = h5 - n4, i2[u4++] = h5 - n4 - 1)), h5++;
  410. }
  411. }
  412. return { position: o3, normal: s4, uv: a5, faces: i2 };
  413. }
  414. function h4(t2, e5) {
  415. const n4 = "number" == typeof e5 ? e5 : null != e5 ? e5.width : 1, r5 = "number" == typeof e5 ? e5 : null != e5 ? e5.height : 1;
  416. switch (t2) {
  417. case "up":
  418. case "down":
  419. return { width: n4, depth: r5 };
  420. case "north":
  421. case "south":
  422. return { width: n4, height: r5 };
  423. case "east":
  424. case "west":
  425. return { depth: n4, height: r5 };
  426. }
  427. }
  428. function p6(t2) {
  429. const e5 = g7.facingAxisOrderSwap[t2], n4 = g7.position, r5 = g7.normal, o3 = new Float64Array(n4.length), s4 = new Float32Array(r5.length);
  430. let a5 = 0;
  431. for (let i2 = 0; i2 < 4; i2++) {
  432. const t3 = a5;
  433. for (let i3 = 0; i3 < 3; i3++) {
  434. const c5 = e5[i3], l6 = Math.abs(c5) - 1, f7 = c5 >= 0 ? 1 : -1;
  435. o3[a5] = n4[t3 + l6] * f7, s4[a5] = r5[t3 + l6] * f7, a5++;
  436. }
  437. }
  438. return { position: o3, normal: s4, uv: new Float32Array(g7.uv), faces: new Uint32Array(g7.faces), isPlane: true };
  439. }
  440. var m5 = 1;
  441. var w5 = 2;
  442. var v4 = 3;
  443. var g7 = { position: [-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0], normal: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], uv: [0, 1, 1, 1, 1, 0, 0, 0], faces: [0, 1, 2, 0, 2, 3], facingAxisOrderSwap: { east: [v4, m5, w5], west: [-v4, -m5, w5], north: [-m5, v4, w5], south: [m5, -v4, w5], up: [m5, w5, v4], down: [m5, -w5, -v4] } };
  444. function A2(t2, e5, n4) {
  445. t2.isPlane || y5(t2), x6(t2, n4 == null ? void 0 : n4.size);
  446. const { vertexAttributes: r5, transform: o3 } = _2(t2, e5, n4);
  447. return { vertexAttributes: new p3({ ...r5, uv: t2.uv }), transform: o3, components: [new g5({ faces: t2.faces, material: n4 && n4.material || null })], spatialReference: e5.spatialReference };
  448. }
  449. function y5(t2) {
  450. for (let e5 = 0; e5 < t2.position.length; e5 += 3)
  451. t2.position[e5 + 2] += 0.5;
  452. }
  453. function x6(t2, e5) {
  454. if (null == e5)
  455. return;
  456. const o3 = "number" == typeof e5 ? [e5, e5, e5] : [null != e5.width ? e5.width : 1, null != e5.depth ? e5.depth : 1, null != e5.height ? e5.height : 1];
  457. O4[0] = o3[0], O4[4] = o3[1], O4[8] = o3[2];
  458. for (let r5 = 0; r5 < t2.position.length; r5 += 3) {
  459. for (let e6 = 0; e6 < 3; e6++)
  460. F[e6] = t2.position[r5 + e6];
  461. S(F, F, O4);
  462. for (let e6 = 0; e6 < 3; e6++)
  463. t2.position[r5 + e6] = F[e6];
  464. }
  465. if (o3[0] !== o3[1] || o3[1] !== o3[2]) {
  466. O4[0] = 1 / o3[0], O4[4] = 1 / o3[1], O4[8] = 1 / o3[2];
  467. for (let e6 = 0; e6 < t2.normal.length; e6 += 3) {
  468. for (let n4 = 0; n4 < 3; n4++)
  469. F[n4] = t2.normal[e6 + n4];
  470. S(F, F, O4), z(F, F);
  471. for (let n4 = 0; n4 < 3; n4++)
  472. t2.normal[e6 + n4] = F[n4];
  473. }
  474. }
  475. }
  476. var d2 = { faceDescriptions: [{ axis: [0, -1, 0], uvOrigin: [0, 0.625], corners: [[-1, -1], [1, -1], [1, 1], [-1, 1]] }, { axis: [1, 0, 0], uvOrigin: [0.25, 0.625], corners: [[-1, -1], [1, -1], [1, 1], [-1, 1]] }, { axis: [0, 1, 0], uvOrigin: [0.5, 0.625], corners: [[1, -1], [-1, -1], [-1, 1], [1, 1]] }, { axis: [-1, 0, 0], uvOrigin: [0.75, 0.625], corners: [[1, -1], [-1, -1], [-1, 1], [1, 1]] }, { axis: [0, 0, 1], uvOrigin: [0, 0.375], corners: [[-1, -1], [1, -1], [1, 1], [-1, 1]] }, { axis: [0, 0, -1], uvOrigin: [0, 0.875], corners: [[-1, 1], [1, 1], [1, -1], [-1, -1]] }], uvScales: [[0, 0], [1, 0], [1, 1], [0, 1]], faceVertexOffsets: [0, 1, 2, 0, 2, 3] };
  477. var M2 = { south: 0, east: 1, north: 2, west: 3, up: 4, down: 5 };
  478. var F = n2();
  479. var O4 = e3();
  480. // node_modules/@arcgis/core/geometry/support/meshUtils/rotate.js
  481. var $ = s.getLogger("esri.geometry.support.meshUtils.rotate");
  482. function z2(t2, r5, o3) {
  483. var _a, _b;
  484. if (!t2.vertexAttributes || !t2.vertexAttributes.position || 0 === r5[3])
  485. return;
  486. const i2 = t2.spatialReference;
  487. if (r(t2.transform)) {
  488. null != (o3 == null ? void 0 : o3.geographic) && o3.geographic !== t2.transform.geographic && $.warn(`Specifying the 'geographic' parameter (${o3.geographic}) different from the Mesh transform setting (${t2.transform.geographic}) is not supported`);
  489. const e5 = (_a = o3 == null ? void 0 : o3.origin) != null ? _a : t2.transform.getOriginPoint(i2);
  490. C(t2.transform, r5, e5);
  491. } else {
  492. const e5 = (_b = o3 == null ? void 0 : o3.origin) != null ? _b : t2.origin;
  493. r3(t2.spatialReference, o3) ? I(t2, r5, e5) : U(t2, r5, e5);
  494. }
  495. }
  496. function C(t2, e5, r5) {
  497. const o3 = o(E, r5.x, r5.y, r5.z), i2 = e2(E, o3, t2.origin);
  498. t2.applyLocalInverse(i2, M3), t2.rotation = v2(t2.rotation, e5, a2()), t2.applyLocalInverse(i2, i2), e2(i2, i2, M3), t2.translation = u(n2(), t2.translation, i2);
  499. }
  500. function I(t2, r5, i2) {
  501. const n4 = t2.spatialReference, s4 = O(n4), a5 = Z;
  502. gn(i2, a5, s4) || gn(t2.origin, a5, s4);
  503. const c5 = t2.vertexAttributes.position, f7 = t2.vertexAttributes.normal, m7 = t2.vertexAttributes.tangent, g9 = new Float64Array(c5.length), l6 = r(f7) ? new Float32Array(f7.length) : null, v6 = r(m7) ? new Float32Array(m7.length) : null;
  504. Zn(s4, a5, P, s4), a(S2, P);
  505. const x8 = O5;
  506. S(g3(O5), g3(r5), S2), x8[3] = r5[3], M(c5, n4, g9), r(f7) && r(l6) && j(f7, c5, g9, n4, l6), r(m7) && r(v6) && k2(m7, c5, g9, n4, v6), D(g9, x8, 3, a5), O3(g9, c5, n4), r(f7) && r(l6) && (D(l6, x8, 3), h2(l6, c5, g9, n4, f7)), r(m7) && r(v6) && (D(v6, x8, 4), L3(v6, c5, g9, n4, m7)), t2.vertexAttributesChanged();
  507. }
  508. function U(t2, e5, r5) {
  509. const o3 = Z;
  510. if (!gn(r5, o3, t2.spatialReference)) {
  511. const e6 = t2.origin;
  512. o3[0] = e6.x, o3[1] = e6.y, o3[2] = e6.z, $.error(`Failed to project specified origin (wkid:${r5.spatialReference.wkid}) to mesh spatial reference (wkid:${t2.spatialReference.wkid}).`);
  513. }
  514. D(t2.vertexAttributes.position, e5, 3, o3), D(t2.vertexAttributes.normal, e5, 3), D(t2.vertexAttributes.tangent, e5, 4), t2.vertexAttributesChanged();
  515. }
  516. function D(t2, e5, o3, i2 = f2) {
  517. if (!t(t2)) {
  518. g2(P, x(e5), g3(e5));
  519. for (let e6 = 0; e6 < t2.length; e6 += o3) {
  520. for (let r5 = 0; r5 < 3; r5++)
  521. E[r5] = t2[e6 + r5] - i2[r5];
  522. O2(E, E, P);
  523. for (let r5 = 0; r5 < 3; r5++)
  524. t2[e6 + r5] = E[r5] + i2[r5];
  525. }
  526. }
  527. }
  528. var E = n2();
  529. var M3 = n2();
  530. var O5 = a2();
  531. var P = e4();
  532. var S2 = e3();
  533. var Z = n2();
  534. // node_modules/@arcgis/core/geometry/support/meshUtils/scale.js
  535. var v5 = s.getLogger("esri.geometry.support.meshUtils.scale");
  536. function d3(e5, r5, o3) {
  537. var _a;
  538. if (!e5.vertexAttributes || !e5.vertexAttributes.position)
  539. return;
  540. const i2 = e5.spatialReference;
  541. if (r(e5.transform)) {
  542. null != (o3 == null ? void 0 : o3.geographic) && o3.geographic !== e5.transform.geographic && v5.warn(`Specifying the 'geographic' parameter (${o3.geographic}) different from the Mesh transform setting (${e5.transform.geographic}) is not supported`);
  543. const t2 = (_a = o3 == null ? void 0 : o3.origin) != null ? _a : e5.transform.getOriginPoint(i2);
  544. x7(e5.transform, r5, t2);
  545. } else {
  546. const t2 = r3(e5.spatialReference, o3), i3 = o3 && o3.origin || e5.origin;
  547. t2 ? A3(e5, r5, i3) : b3(e5, r5, i3);
  548. }
  549. }
  550. function x7(e5, t2, a5) {
  551. const c5 = o(w6, a5.x, a5.y, a5.z), p8 = e2(w6, c5, e5.origin);
  552. e5.applyLocalInverse(p8, k4);
  553. const f7 = g(n2(), e5.scale, t2);
  554. e5.scale = f7, e5.applyLocalInverse(p8, p8), e2(p8, p8, k4), e5.translation = u(n2(), e5.translation, p8);
  555. }
  556. function A3(e5, r5, o3) {
  557. const i2 = e5.spatialReference, n4 = O(i2), s4 = R;
  558. gn(o3, s4, n4) || gn(e5.origin, s4, n4);
  559. const a5 = e5.vertexAttributes.position, f7 = e5.vertexAttributes.normal, v6 = e5.vertexAttributes.tangent, d4 = new Float64Array(a5.length), x8 = r(f7) ? new Float32Array(f7.length) : null, A4 = r(v6) ? new Float32Array(v6.length) : null;
  560. M(a5, i2, d4), r(f7) && r(x8) && j(f7, a5, d4, i2, x8), r(v6) && r(A4) && k2(v6, a5, d4, i2, A4), y6(d4, r5, s4), O3(d4, a5, i2), r(f7) && r(x8) && h2(x8, a5, d4, i2, f7), r(v6) && r(A4) && L3(A4, a5, d4, i2, v6), e5.vertexAttributesChanged();
  561. }
  562. function b3(e5, t2, r5) {
  563. const o3 = R;
  564. if (!gn(r5, o3, e5.spatialReference)) {
  565. const t3 = e5.origin;
  566. o3[0] = t3.x, o3[1] = t3.y, o3[2] = t3.z, v5.error(`Failed to project specified origin (wkid:${r5.spatialReference.wkid}) to mesh spatial reference (wkid:${e5.spatialReference.wkid}).`);
  567. }
  568. y6(e5.vertexAttributes.position, t2, o3), e5.vertexAttributesChanged();
  569. }
  570. function y6(e5, t2, r5 = f2) {
  571. if (e5)
  572. for (let o3 = 0; o3 < e5.length; o3 += 3) {
  573. for (let t3 = 0; t3 < 3; t3++)
  574. w6[t3] = e5[o3 + t3] - r5[t3];
  575. g(w6, w6, t2);
  576. for (let t3 = 0; t3 < 3; t3++)
  577. e5[o3 + t3] = w6[t3] + r5[t3];
  578. }
  579. }
  580. var w6 = n2();
  581. var k4 = n2();
  582. var R = n2();
  583. // node_modules/@arcgis/core/geometry/Mesh.js
  584. var G;
  585. var I2 = "esri.geometry.Mesh";
  586. var B = G = class extends a3(m2.LoadableMixin(m(p2))) {
  587. constructor(e5) {
  588. super(e5), this.components = null, this.transform = null, this.external = null, this.hasZ = true, this.hasM = false, this.vertexAttributes = new p3(), this.type = "mesh";
  589. }
  590. initialize() {
  591. (t(this.external) || this.vertexAttributes.position.length) && (this.loadStatus = "loaded"), this.when(() => {
  592. this.handles.add(l(() => {
  593. var _a;
  594. return { vertexAttributes: this.vertexAttributes, components: (_a = this.components) == null ? void 0 : _a.map((e5) => e5.clone()) };
  595. }, () => this._set("external", null), { once: true, sync: true }));
  596. });
  597. }
  598. get hasExtent() {
  599. return !this.loaded && r(this.external) && r(this.external.extent) || this.loaded && this.vertexAttributes.position.length > 0 && (!this.components || this.components.length > 0);
  600. }
  601. get _boundingInfo() {
  602. const e5 = this.vertexAttributes.position, t2 = this.spatialReference;
  603. if (0 === e5.length || this.components && 0 === this.components.length)
  604. return { extent: new w2({ xmin: 0, ymin: 0, zmin: 0, xmax: 0, ymax: 0, zmax: 0, spatialReference: t2 }), center: new w({ x: 0, y: 0, z: 0, spatialReference: t2 }) };
  605. const r5 = r(this.transform) ? this.transform.project(e5, t2) : e5;
  606. let o3 = 1 / 0, n4 = 1 / 0, s4 = 1 / 0, a5 = -1 / 0, l6 = -1 / 0, c5 = -1 / 0, p8 = 0, m7 = 0, h5 = 0;
  607. const f7 = r5.length, d4 = 1 / (f7 / 3);
  608. let x8 = 0;
  609. for (; x8 < f7; ) {
  610. const e6 = r5[x8++], t3 = r5[x8++], i2 = r5[x8++];
  611. o3 = Math.min(o3, e6), n4 = Math.min(n4, t3), s4 = Math.min(s4, i2), a5 = Math.max(a5, e6), l6 = Math.max(l6, t3), c5 = Math.max(c5, i2), p8 += d4 * e6, m7 += d4 * t3, h5 += d4 * i2;
  612. }
  613. return { extent: new w2({ xmin: o3, ymin: n4, zmin: s4, xmax: a5, ymax: l6, zmax: c5, spatialReference: t2 }), center: new w({ x: p8, y: m7, z: h5, spatialReference: t2 }) };
  614. }
  615. get anchor() {
  616. if (r(this.transform))
  617. return this.transform.getOriginPoint(this.spatialReference);
  618. const e5 = this._boundingInfo;
  619. return new w({ x: e5.center.x, y: e5.center.y, z: e5.extent.zmin, spatialReference: this.spatialReference });
  620. }
  621. get origin() {
  622. return r(this.transform) ? this.transform.getOriginPoint(this.spatialReference) : this._boundingInfo.center;
  623. }
  624. get extent() {
  625. return !this.loaded && r(this.external) && r(this.external.extent) ? this.external.extent.clone() : this._boundingInfo.extent;
  626. }
  627. addComponent(e5) {
  628. this.loaded ? (this.components || (this.components = []), this.components.push(g5.from(e5)), this.notifyChange("components")) : s.getLogger(this.declaredClass).error("addComponent()", "Mesh must be loaded before applying operations");
  629. }
  630. removeComponent(e5) {
  631. if (this.loaded) {
  632. if (this.components) {
  633. const t2 = this.components.indexOf(e5);
  634. if (-1 !== t2)
  635. return this.components.splice(t2, 1), void this.notifyChange("components");
  636. }
  637. s.getLogger(this.declaredClass).error("removeComponent()", "Provided component is not part of the list of components");
  638. } else
  639. s.getLogger(this.declaredClass).error("removeComponent()", "Mesh must be loaded before applying operations");
  640. }
  641. rotate(e5, t2, r5, o3) {
  642. return k(k5.x, e5, D2), k(k5.y, t2, W), k(k5.z, r5, Z2), v2(D2, W, D2), v2(D2, Z2, D2), z2(this, D2, o3), this;
  643. }
  644. offset(e5, t2, r5, o3) {
  645. return this.loaded ? (H[0] = e5, H[1] = t2, H[2] = r5, x5(this, H, o3), this) : (s.getLogger(this.declaredClass).error("offset()", "Mesh must be loaded before applying operations"), this);
  646. }
  647. scale(e5, t2) {
  648. return this.loaded ? (d3(this, e5, t2), this) : (s.getLogger(this.declaredClass).error("scale()", "Mesh must be loaded before applying operations"), this);
  649. }
  650. centerAt(e5, t2) {
  651. return this.loaded ? (c2(this, e5, t2), this) : (s.getLogger(this.declaredClass).error("centerAt()", "Mesh must be loaded before applying operations"), this);
  652. }
  653. load(e5) {
  654. return r(this.external) && this.addResolvingPromise(u2(this, this.external.source, e5)), Promise.resolve(this);
  655. }
  656. updateExternalSource(e5) {
  657. this._set("external", e5);
  658. }
  659. clone() {
  660. let e5 = null;
  661. if (this.components) {
  662. const t3 = /* @__PURE__ */ new Map(), r5 = /* @__PURE__ */ new Map();
  663. e5 = this.components.map((e6) => e6.cloneWithDeduplication(t3, r5));
  664. }
  665. const t2 = { components: e5, spatialReference: this.spatialReference, vertexAttributes: this.vertexAttributes.clone(), transform: r(this.transform) ? this.transform.clone() : null, external: r(this.external) ? { source: this.external.source, extent: r(this.external.extent) ? this.external.extent.clone() : null } : null };
  666. return new G(t2);
  667. }
  668. vertexAttributesChanged() {
  669. this.notifyChange("vertexAttributes");
  670. }
  671. async toBinaryGLTF(e5) {
  672. const t2 = import("./gltfexport-YWNKMN7W.js"), r5 = this.load(), o3 = await Promise.all([t2, r5]), { toBinaryGLTF: n4 } = o3[0];
  673. return n4(this, e5);
  674. }
  675. static createBox(e5, t2) {
  676. if (!(e5 instanceof w))
  677. return s.getLogger(I2).error(".createBox()", "expected location to be a Point instance"), null;
  678. const r5 = new G(A2(c3(), e5, t2));
  679. return t2 && t2.imageFace && "all" !== t2.imageFace ? l4(r5, t2.imageFace) : r5;
  680. }
  681. static createSphere(e5, t2) {
  682. return e5 instanceof w ? new G(A2(f5(t2 && t2.densificationFactor || 0), e5, t2)) : (s.getLogger(I2).error(".createSphere()", "expected location to be a Point instance"), null);
  683. }
  684. static createCylinder(e5, t2) {
  685. return e5 instanceof w ? new G(A2(u3(t2 && t2.densificationFactor || 0), e5, t2)) : (s.getLogger(I2).error(".createCylinder()", "expected location to be a Point instance"), null);
  686. }
  687. static createPlane(e5, t2) {
  688. var _a;
  689. if (!(e5 instanceof w))
  690. return s.getLogger(I2).error(".createPlane()", "expected location to be a Point instance"), null;
  691. const r5 = (_a = t2 == null ? void 0 : t2.facing) != null ? _a : "up", o3 = h4(r5, t2 == null ? void 0 : t2.size);
  692. return new G(A2(p6(r5), e5, { ...t2, size: o3 }));
  693. }
  694. static createFromPolygon(e5, t2) {
  695. var _a;
  696. if (!(e5 instanceof v))
  697. return s.getLogger(I2).error(".createFromPolygon()", "expected polygon to be a Polygon instance"), null;
  698. const r5 = o2(e5);
  699. return new G({ vertexAttributes: new p3({ position: r5.position }), components: [new g5({ faces: r5.faces, shading: "flat", material: (_a = t2 == null ? void 0 : t2.material) != null ? _a : null })], spatialReference: e5.spatialReference });
  700. }
  701. static async createFromGLTF(e5, r5, o3) {
  702. if (!(e5 instanceof w))
  703. throw s.getLogger(I2).error(".createfromGLTF()", "expected location to be a Point instance"), new s2("invalid-input", "Expected location to be a Point instance");
  704. const { loadGLTFMesh: s4 } = await y(import("./loadGLTFMesh-WBYY2AJJ.js"), o3);
  705. return new G(await s4(e5, r5, o3));
  706. }
  707. static createWithExternalSource(e5, t2, r5) {
  708. var _a, _b, _c, _d;
  709. const o3 = (_a = r5 == null ? void 0 : r5.extent) != null ? _a : null, n4 = (_c = (_b = r5 == null ? void 0 : r5.transform) == null ? void 0 : _b.clone()) != null ? _c : new L2();
  710. n4.origin = [e5.x, e5.y, (_d = e5.z) != null ? _d : 0];
  711. const s4 = e5.spatialReference;
  712. return new G({ external: { source: t2, extent: o3 }, transform: n4, spatialReference: s4 });
  713. }
  714. static createIncomplete(e5, r5) {
  715. var _a, _b, _c;
  716. const o3 = (_b = (_a = r5 == null ? void 0 : r5.transform) == null ? void 0 : _a.clone()) != null ? _b : new L2();
  717. o3.origin = [e5.x, e5.y, (_c = e5.z) != null ? _c : 0];
  718. const n4 = e5.spatialReference, s4 = new G({ transform: o3, spatialReference: n4 });
  719. return s4.addResolvingPromise(Promise.reject(new s2("mesh-incomplete", "Mesh resources are not complete"))), s4;
  720. }
  721. };
  722. e([y2({ type: [g5], json: { write: true } })], B.prototype, "components", void 0), e([y2({ type: L2, json: { write: true } })], B.prototype, "transform", void 0), e([y2({ constructOnly: true })], B.prototype, "external", void 0), e([y2({ readOnly: true })], B.prototype, "hasExtent", null), e([y2({ readOnly: true })], B.prototype, "_boundingInfo", null), e([y2({ readOnly: true })], B.prototype, "anchor", null), e([y2({ readOnly: true })], B.prototype, "origin", null), e([y2({ readOnly: true, json: { read: false } })], B.prototype, "extent", null), e([y2({ readOnly: true, json: { read: false, write: true, default: true } })], B.prototype, "hasZ", void 0), e([y2({ readOnly: true, json: { read: false, write: true, default: false } })], B.prototype, "hasM", void 0), e([y2({ type: p3, nonNullable: true, json: { write: true } })], B.prototype, "vertexAttributes", void 0), B = G = e([n(I2)], B);
  723. var k5 = { x: r2(1, 0, 0), y: r2(0, 1, 0), z: r2(0, 0, 1) };
  724. var D2 = a2();
  725. var W = a2();
  726. var Z2 = a2();
  727. var H = n2();
  728. var N = B;
  729. // node_modules/@arcgis/core/rest/support/meshFeatureSet.js
  730. function l5(o3, s4, n4) {
  731. const a5 = n4.features;
  732. n4.features = [], delete n4.geometryType;
  733. const i2 = x4.fromJSON(n4);
  734. if (i2.geometryType = "mesh", !n4.assetMaps)
  735. return i2;
  736. const l6 = E2(s4, n4.assetMaps), m7 = i2.spatialReference, p8 = n4.globalIdFieldName, g9 = t(o3.outFields) || !o3.outFields.length ? () => ({}) : c4(o3.outFields.includes("*") ? null : new Set(o3.outFields));
  737. for (const e5 of a5) {
  738. const o4 = f6(e5, p8, m7, s4, l6);
  739. r(o4) && i2.features.push(new g4({ geometry: o4, attributes: g9(e5) }));
  740. }
  741. return i2;
  742. }
  743. function c4(t2) {
  744. return ({ attributes: e5 }) => {
  745. if (!e5)
  746. return {};
  747. if (!t2)
  748. return e5;
  749. for (const r5 in e5)
  750. t2.has(r5) || delete e5[r5];
  751. return e5;
  752. };
  753. }
  754. function f6(t2, e5, r5, n4, a5) {
  755. const i2 = t2.attributes[e5], u4 = a5.get(i2);
  756. if (null == u4 || u4.status === g8.FAILED || null == u4.url)
  757. return null;
  758. const l6 = m6(t2, r5, n4), c5 = w2.fromJSON(t2.geometry);
  759. c5.spatialReference = r5;
  760. const f7 = p7(t2.attributes, n4, u4.geographic);
  761. return u4.status === g8.PENDING ? N.createIncomplete(l6, { extent: c5, transform: f7 }) : N.createWithExternalSource(l6, [{ name: u4.name, source: u4.url }], { extent: c5, transform: f7 });
  762. }
  763. function m6({ attributes: t2 }, e5, { transformFieldRoles: r5 }) {
  764. return new w({ x: t2[r5.originX], y: t2[r5.originY], z: t2[r5.originZ], spatialReference: e5 });
  765. }
  766. function p7(t2, { transformFieldRoles: e5 }, r5) {
  767. return new L2({ translation: [t2[e5.translationX], t2[e5.translationY], t2[e5.translationZ]], rotation: k([t2[e5.rotationX], t2[e5.rotationY], t2[e5.rotationZ]], t2[e5.rotationDeg]), scale: [t2[e5.scaleX], t2[e5.scaleY], t2[e5.scaleZ]], geographic: r5 });
  768. }
  769. var g8;
  770. function E2(t2, e5) {
  771. const r5 = /* @__PURE__ */ new Map();
  772. for (const o3 of e5) {
  773. const t3 = o3.parentGlobalId;
  774. if (null == t3)
  775. continue;
  776. const e6 = o3.assetName, s4 = o3.assetURL, n4 = o3.conversionStatus;
  777. let a5 = r5.get(t3);
  778. if (null != a5)
  779. throw new Error("multiple asset parts not expected.");
  780. switch (a5 = { name: e6, status: g8.FAILED, url: s4, geographic: D3(o3.flags).projectVertices }, r5.set(t3, a5), n4) {
  781. case "COMPLETED":
  782. case "SUBMITTED":
  783. a5.status = g8.COMPLETED;
  784. break;
  785. case "INPROGRESS":
  786. a5.status = g8.PENDING;
  787. break;
  788. default:
  789. a5.status = g8.FAILED;
  790. }
  791. }
  792. return r5;
  793. }
  794. function D3(t2) {
  795. return { projectVertices: t2.includes("PROJECT_VERTICES") };
  796. }
  797. !function(t2) {
  798. t2[t2.FAILED = 0] = "FAILED", t2[t2.PENDING = 1] = "PENDING", t2[t2.COMPLETED = 2] = "COMPLETED";
  799. }(g8 || (g8 = {}));
  800. export {
  801. l5 as meshFeatureSetFromJSON
  802. };
  803. //# sourceMappingURL=meshFeatureSet-4HLNQKAX.js.map