VoxelLayer-UZ3WZOBC.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. import {
  2. g
  3. } from "./chunk-IN44RUPP.js";
  4. import {
  5. N
  6. } from "./chunk-DRPR56GA.js";
  7. import "./chunk-LX2NI53X.js";
  8. import "./chunk-IZUZZJS7.js";
  9. import {
  10. v,
  11. y as y3
  12. } from "./chunk-W3XAGTM6.js";
  13. import {
  14. e as e4
  15. } from "./chunk-XFDO4CMR.js";
  16. import "./chunk-GHN7C53L.js";
  17. import "./chunk-56OWH4DC.js";
  18. import {
  19. s as s4
  20. } from "./chunk-AJFR3FGC.js";
  21. import "./chunk-7B57NUGF.js";
  22. import "./chunk-I4RYNNL6.js";
  23. import {
  24. i as i3
  25. } from "./chunk-WWXZOC2Y.js";
  26. import {
  27. p as p2
  28. } from "./chunk-ZOKNWEG3.js";
  29. import {
  30. i as i2
  31. } from "./chunk-JOYXMSKE.js";
  32. import {
  33. S
  34. } from "./chunk-SZFMKPVM.js";
  35. import {
  36. v as v2
  37. } from "./chunk-JUWKPBLS.js";
  38. import {
  39. c as c3
  40. } from "./chunk-WLSB4F4I.js";
  41. import {
  42. c as c2,
  43. f,
  44. p as p3
  45. } from "./chunk-GLSWDDR3.js";
  46. import {
  47. O
  48. } from "./chunk-MIQGEDET.js";
  49. import "./chunk-DUEMJ5XS.js";
  50. import "./chunk-VRLXUHP2.js";
  51. import "./chunk-3LVSQLWJ.js";
  52. import {
  53. p
  54. } from "./chunk-4ONPMX2F.js";
  55. import "./chunk-CRGY2SDS.js";
  56. import "./chunk-4T5ZGMEN.js";
  57. import {
  58. t
  59. } from "./chunk-PLWDAYK7.js";
  60. import "./chunk-3RSFVUKZ.js";
  61. import {
  62. l as l2
  63. } from "./chunk-X4SA4ELJ.js";
  64. import {
  65. n as n2
  66. } from "./chunk-ZAY3CMAZ.js";
  67. import "./chunk-P3XKUGLS.js";
  68. import "./chunk-2ZSOO377.js";
  69. import "./chunk-YUA3AHKR.js";
  70. import "./chunk-LU5IJZB4.js";
  71. import "./chunk-7IBV2TRE.js";
  72. import "./chunk-ZLNEXZAN.js";
  73. import "./chunk-5UVJ64RB.js";
  74. import "./chunk-SFEFRQCL.js";
  75. import {
  76. b
  77. } from "./chunk-DXVOOCG4.js";
  78. import "./chunk-3GZSQU56.js";
  79. import "./chunk-ZYRIJWLX.js";
  80. import {
  81. a as a2,
  82. h
  83. } from "./chunk-RYY6632W.js";
  84. import {
  85. E as E2,
  86. c,
  87. e as e3,
  88. i,
  89. r as r4,
  90. u as u2,
  91. z
  92. } from "./chunk-DW42UVIT.js";
  93. import "./chunk-YAEIHDJH.js";
  94. import {
  95. e as e2,
  96. n as n3,
  97. r as r2
  98. } from "./chunk-TJNOJH33.js";
  99. import {
  100. r as r3,
  101. u
  102. } from "./chunk-OSHI574D.js";
  103. import "./chunk-ETGAZ7LF.js";
  104. import "./chunk-75U5LM2V.js";
  105. import "./chunk-RMDDCMKS.js";
  106. import "./chunk-VCH45Q2I.js";
  107. import {
  108. j
  109. } from "./chunk-LBW34VZ2.js";
  110. import "./chunk-GSSTTHIT.js";
  111. import "./chunk-YFSLJIO4.js";
  112. import "./chunk-IM3LVQXV.js";
  113. import "./chunk-55RWC67C.js";
  114. import "./chunk-HZRKBTHJ.js";
  115. import "./chunk-DVUG3KID.js";
  116. import "./chunk-FWSQEIAR.js";
  117. import "./chunk-VEGAOVMY.js";
  118. import {
  119. o,
  120. w as w2,
  121. w2 as w3
  122. } from "./chunk-6T6G6LCQ.js";
  123. import {
  124. s as s3
  125. } from "./chunk-YEJL5NEF.js";
  126. import {
  127. E,
  128. k2 as k
  129. } from "./chunk-PQFTYGF5.js";
  130. import {
  131. e,
  132. l3 as l,
  133. n5 as n,
  134. y3 as y2
  135. } from "./chunk-2Z2TG5CU.js";
  136. import "./chunk-6KZ2LTDA.js";
  137. import "./chunk-U2XHEJM7.js";
  138. import {
  139. T,
  140. a
  141. } from "./chunk-SQOPWYIT.js";
  142. import {
  143. w
  144. } from "./chunk-V6P2MAQQ.js";
  145. import {
  146. s2 as s,
  147. s3 as s2
  148. } from "./chunk-E5O6P5I2.js";
  149. import {
  150. y
  151. } from "./chunk-SPWQ3AWG.js";
  152. import "./chunk-2TIUKVZN.js";
  153. import {
  154. r
  155. } from "./chunk-YXWMMD76.js";
  156. import "./chunk-S5KM4IGW.js";
  157. // node_modules/@arcgis/core/layers/voxel/voxelPlaneUtils.js
  158. var f2 = n3();
  159. var e5 = e4();
  160. var h2 = e4();
  161. var i4 = e4();
  162. var p4 = new Float64Array([0, 0, 1]);
  163. var j2 = new Float64Array([0, 1, 0]);
  164. var k2 = new Float64Array([1, 0, 0]);
  165. function l3(s7) {
  166. r4(f2, s7), z(f2, f2);
  167. const n4 = Math.atan2(f2[1], f2[0]), r5 = v(e4(), p4, -n4);
  168. E2(f2, f2, r5);
  169. const e6 = -1 * Math.atan2(f2[2], f2[0]);
  170. return [u(n4) + 270, u(e6) + 90];
  171. }
  172. function q(t6, n4) {
  173. return v(h2, p4, r3(t6 - 270)), v(i4, j2, r3(n4 - 90)), y3(e5, h2, i4), r4(f2, k2), E2(f2, f2, e5), z(f2, f2), [f2[0], f2[1], f2[2]];
  174. }
  175. // node_modules/@arcgis/core/layers/voxel/VoxelSlice.js
  176. var m = class extends i2(l) {
  177. constructor(t6) {
  178. super(t6), this.enabled = true, this.label = "", this.normal = null, this.point = null;
  179. }
  180. get orientation() {
  181. if (!Array.isArray(this.normal) || 3 !== this.normal.length)
  182. return 0;
  183. const [t6, o2] = l3(this.normal);
  184. return s4.normalize(a(t6), 0, true);
  185. }
  186. set orientation(t6) {
  187. const o2 = q(t6, this.tilt);
  188. this._set("normal", o2), this._set("orientation", t6);
  189. }
  190. get tilt() {
  191. if (!Array.isArray(this.normal) || 3 !== this.normal.length)
  192. return 0;
  193. const [t6, o2] = l3(this.normal);
  194. return s4.normalize(a(o2), 0, true);
  195. }
  196. set tilt(t6) {
  197. const o2 = q(this.orientation, t6);
  198. this._set("normal", o2), this._set("tilt", t6);
  199. }
  200. };
  201. e([y2({ type: Boolean, json: { write: true } })], m.prototype, "enabled", void 0), e([y2({ type: String, json: { write: true } })], m.prototype, "label", void 0), e([y2({ type: Number, json: { read: false }, clonable: false, range: { min: 0, max: 360 } }), s3((t6) => s4.normalize(a(t6), 0, true))], m.prototype, "orientation", null), e([y2({ type: Number, json: { read: false }, clonable: false, range: { min: 0, max: 360 } }), s3((t6) => s4.normalize(a(t6), 0, true))], m.prototype, "tilt", null), e([y2({ type: [Number], json: { write: true } })], m.prototype, "normal", void 0), e([y2({ type: [Number], json: { write: true } })], m.prototype, "point", void 0), m = e([n("esri.layers.voxel.VoxelSlice")], m);
  202. var c4 = m;
  203. // node_modules/@arcgis/core/layers/voxel/VoxelSection.js
  204. var d = class extends i2(l) {
  205. constructor() {
  206. super(...arguments), this.enabled = true, this.href = null, this.id = null, this.label = "", this.normal = null, this.point = null, this.sizeInPixel = null, this.slices = null, this.timeId = 0, this.variableId = null;
  207. }
  208. get orientation() {
  209. if (!Array.isArray(this.normal) || 3 !== this.normal.length)
  210. return 0;
  211. const [e6, r5] = l3(this.normal);
  212. return s4.normalize(a(e6), 0, true);
  213. }
  214. get tilt() {
  215. if (!Array.isArray(this.normal) || 3 !== this.normal.length)
  216. return 0;
  217. const [e6, r5] = l3(this.normal);
  218. return s4.normalize(a(r5), 0, true);
  219. }
  220. };
  221. e([y2({ type: Boolean, json: { default: true, write: true } })], d.prototype, "enabled", void 0), e([y2({ type: String, json: { origins: { service: { read: p } }, write: { enabled: true, isRequired: true } } }), g({ origins: ["web-scene"], type: "resource", prefix: "sections", compress: true })], d.prototype, "href", void 0), e([y2({ type: T, json: { write: { enabled: true, isRequired: true } } })], d.prototype, "id", void 0), e([y2({ type: String, json: { write: true } })], d.prototype, "label", void 0), e([y2({ type: Number, clonable: false, readOnly: true, range: { min: 0, max: 360 } })], d.prototype, "orientation", null), e([y2({ type: Number, clonable: false, readOnly: true, range: { min: 0, max: 360 } })], d.prototype, "tilt", null), e([y2({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], d.prototype, "normal", void 0), e([y2({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], d.prototype, "point", void 0), e([y2({ type: [T], json: { write: { enabled: true, isRequired: true } } })], d.prototype, "sizeInPixel", void 0), e([y2({ type: [c4], json: { write: true } })], d.prototype, "slices", void 0), e([y2({ type: T, json: { default: 0, write: true } })], d.prototype, "timeId", void 0), e([y2({ type: T, json: { write: { enabled: true, isRequired: true } } })], d.prototype, "variableId", void 0), d = e([n("esri.layers.voxel.VoxelSection")], d);
  222. var u3 = d;
  223. // node_modules/@arcgis/core/layers/voxel/VoxelSimpleShading.js
  224. var t2 = class extends l {
  225. constructor() {
  226. super(...arguments), this.diffuseFactor = 0.5, this.specularFactor = 0.5;
  227. }
  228. };
  229. e([y2({ type: Number, range: { min: 0, max: 1 }, json: { default: 0.5, write: true } })], t2.prototype, "diffuseFactor", void 0), e([y2({ type: Number, range: { min: 0, max: 1 }, json: { default: 0.5, write: true } })], t2.prototype, "specularFactor", void 0), t2 = e([n("esri.layers.voxel.VoxelSimpleShading")], t2);
  230. var p5 = t2;
  231. // node_modules/@arcgis/core/layers/voxel/VoxelFormat.js
  232. var s5 = class extends l {
  233. constructor() {
  234. super(...arguments), this.continuity = null, this.hasNoData = false, this.noData = 0, this.offset = 0, this.scale = 1, this.type = null;
  235. }
  236. };
  237. e([y2({ type: ["discrete", "continuous"], json: { write: true } })], s5.prototype, "continuity", void 0), e([y2({ type: Boolean, json: { write: true } })], s5.prototype, "hasNoData", void 0), e([y2({ type: Number, json: { write: true } })], s5.prototype, "noData", void 0), e([y2({ type: Number, json: { write: true } })], s5.prototype, "offset", void 0), e([y2({ type: Number, json: { write: true } })], s5.prototype, "scale", void 0), e([y2({ type: String, json: { write: { enabled: true, isRequired: true } } })], s5.prototype, "type", void 0), s5 = e([n("esri.layers.voxel.VoxelFormat")], s5);
  238. var p6 = s5;
  239. // node_modules/@arcgis/core/layers/voxel/VoxelVariable.js
  240. var i5 = class extends l {
  241. constructor() {
  242. super(...arguments), this.id = null, this.description = "", this.name = null, this.originalFormat = null, this.renderingFormat = null, this.unit = "", this.volumeId = 0, this.type = null;
  243. }
  244. };
  245. e([y2({ type: Number, json: { write: { enabled: true, isRequired: true } } })], i5.prototype, "id", void 0), e([y2({ type: String, json: { write: true } })], i5.prototype, "description", void 0), e([y2({ type: String, json: { write: { enabled: true, isRequired: true } } })], i5.prototype, "name", void 0), e([y2({ type: p6, json: { write: true } })], i5.prototype, "originalFormat", void 0), e([y2({ type: p6, json: { write: { enabled: true, isRequired: true } } })], i5.prototype, "renderingFormat", void 0), e([y2({ type: String, json: { write: true } })], i5.prototype, "unit", void 0), e([y2({ type: Number, json: { write: true } })], i5.prototype, "volumeId", void 0), e([y2({ type: ["stc-hot-spot-results", "stc-cluster-outlier-results", "stc-estimated-bin", "generic-nearest-interpolated"], json: { write: true } })], i5.prototype, "type", void 0), i5 = e([n("esri.layers.voxel.VoxelVariable")], i5);
  246. var p7 = i5;
  247. // node_modules/@arcgis/core/layers/voxel/VoxelIsosurface.js
  248. var l4 = class extends i2(l) {
  249. constructor() {
  250. super(...arguments), this.color = l2.fromArray([0, 0, 0, 0]), this.value = 0, this.enabled = true, this.label = "", this.colorLocked = true;
  251. }
  252. };
  253. e([y2({ type: l2, json: { type: [T], write: { enabled: true, isRequired: true } } })], l4.prototype, "color", void 0), e([y2({ type: Number, json: { write: { enabled: true, isRequired: true } } })], l4.prototype, "value", void 0), e([y2({ type: Boolean, json: { default: true, write: true } })], l4.prototype, "enabled", void 0), e([y2({ type: String, json: { write: true } })], l4.prototype, "label", void 0), e([y2({ type: Boolean, json: { default: false } })], l4.prototype, "colorLocked", void 0), l4 = e([n("esri.layers.voxel.VoxelIsosurface")], l4);
  254. var a3 = l4;
  255. // node_modules/@arcgis/core/layers/voxel/VoxelColorStop.js
  256. var c5 = class extends i2(l) {
  257. constructor() {
  258. super(...arguments), this.color = null, this.position = 0;
  259. }
  260. };
  261. e([y2({ type: l2, json: { type: [T], write: { enabled: true, isRequired: true } } })], c5.prototype, "color", void 0), e([y2({ type: Number, json: { write: { enabled: true, isRequired: true } } })], c5.prototype, "position", void 0), c5 = e([n("esri.layers.voxel.VoxelColorStop")], c5);
  262. var l5 = c5;
  263. // node_modules/@arcgis/core/layers/voxel/VoxelOpacityStop.js
  264. var p8 = class extends i2(l) {
  265. constructor() {
  266. super(...arguments), this.opacity = 1, this.position = 0;
  267. }
  268. };
  269. e([y2({ type: Number, json: { name: "alpha", write: { enabled: true, isRequired: true } } })], p8.prototype, "opacity", void 0), e([y2({ type: Number, json: { write: { enabled: true, isRequired: true } } })], p8.prototype, "position", void 0), p8 = e([n("esri.layers.voxel.VoxelOpacityStop")], p8);
  270. var i6 = p8;
  271. // node_modules/@arcgis/core/layers/voxel/VoxelRangeFilter.js
  272. var p9 = class extends i2(l) {
  273. constructor() {
  274. super(...arguments), this.enabled = false, this.range = null;
  275. }
  276. };
  277. e([y2({ type: Boolean, json: { default: false, write: true } })], p9.prototype, "enabled", void 0), e([y2({ type: [Number], json: { write: true } })], p9.prototype, "range", void 0), p9 = e([n("esri.layers.voxel.VoxelRangeFilter")], p9);
  278. var a4 = p9;
  279. // node_modules/@arcgis/core/layers/voxel/VoxelTransferFunctionStyle.js
  280. var u4;
  281. !function(o2) {
  282. o2[o2.Color = 1] = "Color", o2[o2.Alpha = 2] = "Alpha", o2[o2.Both = 3] = "Both";
  283. }(u4 || (u4 = {}));
  284. var y4 = class extends i2(l) {
  285. constructor(o2) {
  286. super(o2), this.interpolation = null, this.stretchRange = null, this.rangeFilter = null, this._colorMapSize = 256, this.colorStops = new (j.ofType(l5))(), this.opacityStops = new (j.ofType(i6))();
  287. }
  288. set colorStops(o2) {
  289. this._set("colorStops", n2(o2, this._get("colorStops"), j.ofType(l5)));
  290. }
  291. set opacityStops(o2) {
  292. this._set("opacityStops", n2(o2, this._get("opacityStops"), j.ofType(i6)));
  293. }
  294. getPreviousNext(o2, t6, r5) {
  295. let e6 = o2;
  296. for (; --e6 > 0 && t6[e6].type !== r5 && t6[e6].type !== u4.Both; )
  297. ;
  298. let s7 = o2;
  299. const i7 = t6.length;
  300. for (; ++s7 < i7 && t6[s7].type !== r5 && t6[s7].type !== u4.Both; )
  301. ;
  302. return [e6, s7];
  303. }
  304. get rasterizedTransferFunction() {
  305. const o2 = [];
  306. if (this.colorStops.length < 2)
  307. return o2;
  308. const r5 = [], e6 = [], s7 = 1e-5;
  309. for (const t6 of this.colorStops) {
  310. if (!t6.color)
  311. return o2;
  312. e6.push({ color: { r: t6.color.r, g: t6.color.g, b: t6.color.b, a: Math.round(255 * (1 - t6.color.a)) }, position: t6.position, type: u4.Color });
  313. }
  314. if (0 === this.opacityStops.length)
  315. for (const t6 of e6)
  316. r5.push({ color: t6.color, position: t6.position });
  317. else {
  318. for (const t6 of this.opacityStops) {
  319. const o4 = a2(t6.position, 0, 1), r6 = Math.round(255 * a2(1 - t6.opacity, 0, 1));
  320. let i8 = false;
  321. for (const t7 of e6)
  322. if (t7.type === u4.Color && Math.abs(t7.position - o4) < s7) {
  323. t7.color.a = r6, t7.type = u4.Both, i8 = true;
  324. break;
  325. }
  326. i8 || e6.push({ color: { r: 0, g: 0, b: 0, a: r6 }, position: t6.position, type: u4.Alpha });
  327. }
  328. e6.sort((o4, t6) => o4.position < t6.position ? -1 : 1);
  329. const o3 = e6.length;
  330. for (let t6 = 0; t6 < o3; ++t6) {
  331. const r6 = e6[t6];
  332. if (r6.type !== u4.Both)
  333. if (r6.type === u4.Color) {
  334. const [s8, i8] = this.getPreviousNext(t6, e6, u4.Alpha);
  335. if (-1 !== s8 && i8 !== o3) {
  336. const o4 = (r6.position - e6[s8].position) / (e6[i8].position - e6[s8].position);
  337. r6.color.a = Math.round(h(e6[s8].color.a, e6[i8].color.a, o4));
  338. } else
  339. r6.color.a = -1 !== s8 ? e6[s8].color.a : e6[i8].color.a;
  340. } else {
  341. const [s8, i8] = this.getPreviousNext(t6, e6, u4.Color);
  342. if (-1 !== s8 && i8 !== o3) {
  343. const o4 = (r6.position - e6[s8].position) / (e6[i8].position - e6[s8].position), t7 = e6[s8].color, p16 = e6[i8].color;
  344. ["r", "g", "b"].forEach((e7) => {
  345. r6.color[e7] = Math.round(h(t7[e7], p16[e7], o4));
  346. });
  347. } else
  348. ["r", "g", "b"].forEach(-1 !== s8 ? (o4) => {
  349. r6.color[o4] = e6[s8][o4];
  350. } : (o4) => {
  351. r6.color[o4] = e6[i8][o4];
  352. });
  353. }
  354. }
  355. for (const t6 of e6)
  356. r5.push({ color: t6.color, position: t6.position });
  357. }
  358. r5[0].position = 0, r5[r5.length - 1].position = 1;
  359. let i7 = 0, l7 = 1;
  360. for (let c8 = 0; c8 < this._colorMapSize; ++c8) {
  361. const e7 = c8 / this._colorMapSize;
  362. for (; e7 > r5[l7].position; )
  363. i7 = l7++;
  364. const s8 = (e7 - r5[i7].position) / (r5[l7].position - r5[i7].position), a7 = r5[i7].color, h3 = r5[l7].color, f5 = new l2();
  365. ["r", "g", "b"].forEach((o3) => {
  366. f5[o3] = Math.round(h(a7[o3], h3[o3], s8));
  367. }), f5.a = a2(1 - h(a7.a, h3.a, s8) / 255, 0, 1), o2.push(f5);
  368. }
  369. return o2;
  370. }
  371. getColorForContinuousDataValue(o2, t6) {
  372. const r5 = this.rasterizedTransferFunction;
  373. if (this.colorStops.length < 2 || !Array.isArray(this.stretchRange) || this.stretchRange.length < 2 || r5.length < 256)
  374. return null;
  375. let e6 = this.stretchRange[0], s7 = this.stretchRange[1];
  376. if (e6 > s7) {
  377. const o3 = e6;
  378. e6 = s7, s7 = o3;
  379. }
  380. o2 = a2(o2, e6, s7);
  381. const i7 = r5[Math.round((o2 - e6) / (s7 - e6) * (this._colorMapSize - 1))].clone();
  382. return t6 || (i7.a = 1), i7;
  383. }
  384. };
  385. e([y2({ type: ["linear", "nearest"], json: { write: true } })], y4.prototype, "interpolation", void 0), e([y2({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], y4.prototype, "stretchRange", void 0), e([y2({ type: j.ofType(l5), json: { write: { enabled: true, overridePolicy() {
  386. return { enabled: !!this.colorStops && this.colorStops.length > 0 };
  387. } } } })], y4.prototype, "colorStops", null), e([y2({ type: j.ofType(i6), json: { read: { source: "alphaStops" }, write: { enabled: true, target: "alphaStops", overridePolicy() {
  388. return { enabled: !!this.opacityStops && this.opacityStops.length > 0 };
  389. } } } })], y4.prototype, "opacityStops", null), e([y2({ type: a4, json: { write: true } })], y4.prototype, "rangeFilter", void 0), e([y2({ type: [l2], clonable: false, json: { read: false } })], y4.prototype, "rasterizedTransferFunction", null), y4 = e([n("esri.layers.voxel.VoxelTransferFunctionStyle")], y4);
  390. var g2 = y4;
  391. // node_modules/@arcgis/core/layers/voxel/VoxelUniqueValue.js
  392. var l6 = class extends i2(l) {
  393. constructor() {
  394. super(...arguments), this.color = l2.fromArray([0, 0, 0, 0]), this.value = 0, this.enabled = true, this.label = "";
  395. }
  396. };
  397. e([y2({ type: l2, json: { type: [T], write: { enabled: true, isRequired: true } } })], l6.prototype, "color", void 0), e([y2({ type: T, json: { write: { enabled: true, isRequired: true } } })], l6.prototype, "value", void 0), e([y2({ type: Boolean, json: { default: true, write: true } })], l6.prototype, "enabled", void 0), e([y2({ type: String, json: { write: true } })], l6.prototype, "label", void 0), l6 = e([n("esri.layers.voxel.VoxelUniqueValue")], l6);
  398. var a5 = l6;
  399. // node_modules/@arcgis/core/layers/voxel/VoxelVariableStyle.js
  400. var p10;
  401. var c6 = p10 = class extends l {
  402. constructor(e6) {
  403. super(e6), this.variableId = 0, this.label = "", this.transferFunction = null, this.uniqueValues = null, this.isosurfaces = null, this.uniqueValues = new (j.ofType(a5))(), this.isosurfaces = new (j.ofType(a3))();
  404. }
  405. clone() {
  406. return new p10({ variableId: this.variableId, label: this.label, transferFunction: y(this.transferFunction), uniqueValues: y(this.uniqueValues), isosurfaces: y(this.isosurfaces) });
  407. }
  408. };
  409. e([y2({ type: T, json: { write: { enabled: true, isRequired: true } } })], c6.prototype, "variableId", void 0), e([y2({ type: String, json: { write: true } })], c6.prototype, "label", void 0), e([y2({ type: g2, json: { write: { enabled: true, overridePolicy() {
  410. return { enabled: !this.uniqueValues || this.uniqueValues.length < 1 };
  411. } } } })], c6.prototype, "transferFunction", void 0), e([y2({ type: j.ofType(a5), json: { write: { enabled: true, overridePolicy() {
  412. return { enabled: !!this.uniqueValues && this.uniqueValues.length > 0 };
  413. } } } })], c6.prototype, "uniqueValues", void 0), e([y2({ type: j.ofType(a3), json: { write: { enabled: true, overridePolicy() {
  414. const e6 = !this.uniqueValues || this.uniqueValues.length < 1, s7 = !!this.isosurfaces && this.isosurfaces.length > 0;
  415. return { enabled: e6 && s7 };
  416. } } } })], c6.prototype, "isosurfaces", void 0), c6 = p10 = e([n("esri.layers.voxel.VoxelVariableStyle")], c6);
  417. var f3 = c6;
  418. // node_modules/@arcgis/core/layers/voxel/VoxelIrregularSpacing.js
  419. var t3 = class extends l {
  420. constructor() {
  421. super(...arguments), this.values = null;
  422. }
  423. };
  424. e([y2({ type: [Number], json: { write: true } })], t3.prototype, "values", void 0), t3 = e([n("esri.layers.voxel.VoxelIrregularSpacing")], t3);
  425. var p11 = t3;
  426. // node_modules/@arcgis/core/layers/voxel/VoxelRegularSpacing.js
  427. var t4 = class extends l {
  428. constructor() {
  429. super(...arguments), this.scale = 1, this.offset = 0;
  430. }
  431. };
  432. e([y2({ type: Number, json: { write: true } })], t4.prototype, "scale", void 0), e([y2({ type: Number, json: { write: true } })], t4.prototype, "offset", void 0), t4 = e([n("esri.layers.voxel.VoxelRegularSpacing")], t4);
  433. var p12 = t4;
  434. // node_modules/@arcgis/core/layers/voxel/VoxelDimension.js
  435. var p13 = class extends l {
  436. constructor() {
  437. super(...arguments), this.irregularSpacing = null, this.isPositiveUp = true, this.isWrappedDateLine = false, this.label = null, this.name = null, this.quantity = null, this.regularSpacing = null, this.size = 0, this.unit = null;
  438. }
  439. get isRegular() {
  440. return (null == this.irregularSpacing || void 0 === this.irregularSpacing) && null !== this.regularSpacing;
  441. }
  442. getRange() {
  443. var _a;
  444. return this.isRegular ? [this.regularSpacing.offset, this.regularSpacing.offset + this.regularSpacing.scale * (this.size - 1)] : Array.isArray((_a = this.irregularSpacing) == null ? void 0 : _a.values) && this.irregularSpacing.values.length > 1 ? [this.irregularSpacing.values[0], this.irregularSpacing.values[this.irregularSpacing.values.length - 1]] : [0, 0];
  445. }
  446. };
  447. e([y2({ type: p11, json: { write: true } })], p13.prototype, "irregularSpacing", void 0), e([y2({ type: Boolean, json: { write: true } })], p13.prototype, "isPositiveUp", void 0), e([y2({ type: Boolean, json: { write: true } })], p13.prototype, "isWrappedDateLine", void 0), e([y2({ type: String, json: { write: true } })], p13.prototype, "label", void 0), e([y2({ type: String, json: { write: true } })], p13.prototype, "name", void 0), e([y2({ type: String, json: { write: true } })], p13.prototype, "quantity", void 0), e([y2({ type: p12, json: { write: true } })], p13.prototype, "regularSpacing", void 0), e([y2({ type: Number, json: { write: true } })], p13.prototype, "size", void 0), e([y2({ type: String, json: { write: true } })], p13.prototype, "unit", void 0), e([y2({ type: Boolean, json: { read: false } })], p13.prototype, "isRegular", null), p13 = e([n("esri.layers.voxel.VoxelDimension")], p13);
  448. var a6 = p13;
  449. // node_modules/@arcgis/core/layers/voxel/VoxelVolume.js
  450. var d2 = "esri.layers.voxel.VoxelVolume";
  451. var y5 = s.getLogger(d2);
  452. var f4 = class extends l {
  453. constructor(e6) {
  454. super(e6), this.id = 0, this.dimensions = null, this.spatialReference = k.WGS84;
  455. }
  456. get zDimension() {
  457. if (!this.dimensions)
  458. return -1;
  459. if (!Array.isArray(this.dimensions))
  460. return -1;
  461. if (4 !== this.dimensions.length)
  462. return -1;
  463. for (let e6 = 2; e6 < 4; ++e6)
  464. if (this.dimensions[e6].size > 0)
  465. return e6;
  466. return -1;
  467. }
  468. get isValid() {
  469. return !!this.dimensions && (!!Array.isArray(this.dimensions) && (4 === this.dimensions.length && (!(this.dimensions[0].size < 1 || this.dimensions[1].size < 1) && !(-1 === this.zDimension || this.dimensions[this.zDimension].size < 1))));
  470. }
  471. get originInLayerSpace3D() {
  472. if (!this.isValid || "xyt" === this.volumeType)
  473. return [0, 0, 0];
  474. const e6 = this.dimensions[0].getRange(), i7 = this.dimensions[1].getRange(), s7 = this.dimensions[2], r5 = s7.isRegular ? s7.getRange() : [0, s7.size];
  475. return [e6[0], i7[0], r5[0]];
  476. }
  477. get voxelSizeInLayerSpaceSigned() {
  478. if (!this.isValid || "xyt" === this.volumeType)
  479. return [0, 0, 0];
  480. const e6 = this.dimensions[0].getRange(), i7 = this.dimensions[1].getRange(), s7 = this.dimensions[2], r5 = s7.isRegular ? s7.getRange() : [0, s7.size], t6 = [this.sizeInVoxels[0], this.sizeInVoxels[1], this.sizeInVoxels[2]];
  481. for (let n4 = 0; n4 < 3; ++n4)
  482. t6[n4] < 2 ? t6[n4] = 1 : t6[n4] -= 1;
  483. return s7.isRegular && !s7.isPositiveUp && (t6[2] *= -1), [(e6[1] - e6[0]) / t6[0], (i7[1] - i7[0]) / t6[1], (r5[1] - r5[0]) / t6[2]];
  484. }
  485. get volumeType() {
  486. if (this.isValid) {
  487. const e6 = this.dimensions[2].size > 0, i7 = this.dimensions[3].size > 0;
  488. if (!e6 && i7)
  489. return "xyt";
  490. if (e6 && i7)
  491. return "xyzt";
  492. }
  493. return "xyz";
  494. }
  495. get sizeInVoxels() {
  496. if (!this.isValid)
  497. return [0, 0, 0];
  498. const e6 = this.zDimension;
  499. return [this.dimensions[0].size, this.dimensions[1].size, this.dimensions[e6].size];
  500. }
  501. computeVoxelSpaceLocation(e6) {
  502. var _a, _b, _c;
  503. if (!this.isValid)
  504. return [0, 0, 0];
  505. if ("xyt" === this.volumeType)
  506. return y5.error("computeVoxelSpacePosition cannot be used with XYT volumes."), [0, 0, 0];
  507. if (!E(this.spatialReference, e6.spatialReference))
  508. return y5.error("pos argument should have the same spatial reference as the VoxelLayer."), [0, 0, 0];
  509. const i7 = r2(e6.x, e6.y, (_a = e6.z) != null ? _a : 0);
  510. e3(i7, i7, this.originInLayerSpace3D), i(i7, i7, this.voxelSizeInLayerSpaceSigned);
  511. const s7 = this.dimensions[this.zDimension];
  512. if (!s7.isRegular && Array.isArray((_b = s7.irregularSpacing) == null ? void 0 : _b.values) && s7.irregularSpacing.values.length > 1) {
  513. const r5 = (_c = e6.z) != null ? _c : 0, t6 = s7.irregularSpacing.values, n4 = s7.isPositiveUp ? 1 : -1, o2 = t6.reduce((e7, i8) => Math.abs(n4 * i8 - r5) < Math.abs(n4 * e7 - r5) ? i8 : e7);
  514. for (let e7 = 0; e7 < t6.length; ++e7)
  515. if (t6[e7] === o2) {
  516. i7[2] = e7;
  517. break;
  518. }
  519. }
  520. return [i7[0], i7[1], i7[2]];
  521. }
  522. computeLayerSpaceLocation(e6) {
  523. var _a;
  524. if (!this.isValid)
  525. return new w2({ x: 0, y: 0, spatialReference: this.spatialReference });
  526. const i7 = e2(e6);
  527. if (c(i7, i7, this.voxelSizeInLayerSpaceSigned), u2(i7, i7, this.originInLayerSpace3D), "xyt" === this.volumeType)
  528. return new w2({ x: i7[0], y: i7[1], spatialReference: this.spatialReference });
  529. const s7 = this.dimensions[this.zDimension];
  530. return s7.isRegular || Array.isArray((_a = s7.irregularSpacing) == null ? void 0 : _a.values) && (e6[2] < 0 ? i7[2] = s7.irregularSpacing.values[0] : e6[2] < s7.irregularSpacing.values.length ? i7[2] = s7.irregularSpacing.values[e6[2]] : i7[2] = s7.irregularSpacing.values[s7.irregularSpacing.values.length - 1], s7.isPositiveUp || (i7[2] *= -1)), new w2({ x: i7[0], y: i7[1], z: i7[2], spatialReference: this.spatialReference });
  531. }
  532. };
  533. e([y2({ type: Number, json: { write: { enabled: true, isRequired: true } } })], f4.prototype, "id", void 0), e([y2({ type: [a6], json: { write: { enabled: true, isRequired: true } } })], f4.prototype, "dimensions", void 0), e([y2({ type: k, json: { read: { enabled: false } } })], f4.prototype, "spatialReference", void 0), e([y2({ type: Number, json: { read: false } })], f4.prototype, "zDimension", null), e([y2({ type: [Boolean], json: { read: false } })], f4.prototype, "isValid", null), e([y2({ type: [Number], json: { read: false } })], f4.prototype, "originInLayerSpace3D", null), e([y2({ type: [Number], json: { read: false } })], f4.prototype, "voxelSizeInLayerSpaceSigned", null), e([y2({ type: ["xyz", "xyzt", "xyt"], json: { read: { enabled: false } } })], f4.prototype, "volumeType", null), e([y2({ type: [Number], json: { read: false } })], f4.prototype, "sizeInVoxels", null), f4 = e([n(d2)], f4);
  534. var S2 = f4;
  535. // node_modules/@arcgis/core/layers/voxel/VoxelVolumeIndex.js
  536. var t5;
  537. var s6 = t5 = class extends l {
  538. constructor() {
  539. super(...arguments), this.apronWidth = 1, this.brickSize = [32, 32, 32], this.maxLodLevel = 0, this.nodeSize = [4, 4, 4];
  540. }
  541. isValid() {
  542. const e6 = new t5();
  543. return e6.apronWidth === this.apronWidth && e6.maxLodLevel === this.maxLodLevel && (!!this.brickSize && (!!this.nodeSize && (!(!Array.isArray(this.brickSize) || !Array.isArray(this.nodeSize)) && (3 === this.brickSize.length && 3 === this.nodeSize.length && (32 === this.brickSize[0] && 32 === this.brickSize[1] && 32 === this.brickSize[2] && (4 === this.nodeSize[0] && 4 === this.nodeSize[1] && 4 === this.nodeSize[2]))))));
  544. }
  545. };
  546. e([y2({ type: Number, json: { write: { enabled: true, isRequired: true } } })], s6.prototype, "apronWidth", void 0), e([y2({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], s6.prototype, "brickSize", void 0), e([y2({ type: Number, json: { write: { enabled: true, isRequired: true } } })], s6.prototype, "maxLodLevel", void 0), e([y2({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], s6.prototype, "nodeSize", void 0), s6 = t5 = e([n("esri.layers.voxel.VoxelVolumeIndex")], s6);
  547. var p14 = s6;
  548. // node_modules/@arcgis/core/layers/voxel/VoxelDynamicSection.js
  549. var m2 = class extends i2(l) {
  550. constructor(t6) {
  551. super(t6), this.enabled = true, this.label = "", this.normal = null, this.point = null;
  552. }
  553. get orientation() {
  554. if (!Array.isArray(this.normal) || 3 !== this.normal.length)
  555. return 0;
  556. const [t6, o2] = l3(this.normal);
  557. return s4.normalize(a(t6), 0, true);
  558. }
  559. set orientation(t6) {
  560. const o2 = q(t6, this.tilt);
  561. this._set("normal", o2), this._set("orientation", t6);
  562. }
  563. get tilt() {
  564. if (!Array.isArray(this.normal) || 3 !== this.normal.length)
  565. return 0;
  566. const [t6, o2] = l3(this.normal);
  567. return s4.normalize(a(o2), 0, true);
  568. }
  569. set tilt(t6) {
  570. const o2 = q(this.orientation, t6);
  571. this._set("normal", o2), this._set("tilt", t6);
  572. }
  573. };
  574. e([y2({ type: Boolean, json: { default: true, write: true } })], m2.prototype, "enabled", void 0), e([y2({ type: String, json: { write: true } })], m2.prototype, "label", void 0), e([y2({ type: Number, json: { read: false }, clonable: false, range: { min: 0, max: 360 } }), s3((t6) => s4.normalize(a(t6), 0, true))], m2.prototype, "orientation", null), e([y2({ type: Number, json: { read: false }, clonable: false, range: { min: 0, max: 360 } }), s3((t6) => s4.normalize(a(t6), 0, true))], m2.prototype, "tilt", null), e([y2({ type: [Number], json: { write: true } })], m2.prototype, "normal", void 0), e([y2({ type: [Number], json: { write: true } })], m2.prototype, "point", void 0), m2 = e([n("esri.layers.voxel.VoxelDynamicSection")], m2);
  575. var c7 = m2;
  576. // node_modules/@arcgis/core/layers/voxel/VoxelVolumeStyle.js
  577. var p15;
  578. var m3 = p15 = class extends l {
  579. constructor(e6) {
  580. super(e6), this.volumeId = 0, this.verticalExaggeration = 1, this.exaggerationMode = "scale-height", this.verticalOffset = 0, this.slices = new (j.ofType(c4))(), this.dynamicSections = new (j.ofType(c7))();
  581. }
  582. set slices(e6) {
  583. this._set("slices", n2(e6, this._get("slices"), j.ofType(c4)));
  584. }
  585. set dynamicSections(e6) {
  586. this._set("dynamicSections", n2(e6, this._get("dynamicSections"), j.ofType(c7)));
  587. }
  588. clone() {
  589. return new p15({ volumeId: this.volumeId, verticalExaggeration: this.verticalExaggeration, exaggerationMode: this.exaggerationMode, verticalOffset: this.verticalOffset, slices: y(this.slices), dynamicSections: y(this.dynamicSections) });
  590. }
  591. };
  592. e([y2({ type: T, json: { write: { enabled: true, isRequired: true } } })], m3.prototype, "volumeId", void 0), e([y2({ type: Number, json: { default: 1, write: true } })], m3.prototype, "verticalExaggeration", void 0), e([y2({ type: ["scale-position", "scale-height"], json: { default: "scale-height", write: true } })], m3.prototype, "exaggerationMode", void 0), e([y2({ type: Number, json: { default: 0, write: true } })], m3.prototype, "verticalOffset", void 0), e([y2({ type: j.ofType(c4), json: { write: { enabled: true, overridePolicy() {
  593. return { enabled: !!this.slices && this.slices.length > 0 };
  594. } } } })], m3.prototype, "slices", null), e([y2({ type: j.ofType(c7), json: { write: { enabled: true, overridePolicy() {
  595. return { enabled: !!this.dynamicSections && this.dynamicSections.length > 0 };
  596. } } } })], m3.prototype, "dynamicSections", null), m3 = p15 = e([n("esri.layers.voxel.VoxelVolumeStyle")], m3);
  597. var d3 = m3;
  598. // node_modules/@arcgis/core/layers/VoxelLayer.js
  599. var E3 = "esri.layers.VoxelLayer";
  600. var R = s.getLogger(E3);
  601. var M = class extends N(p2(c3(v2(t(O(i3(b))))))) {
  602. constructor(e6) {
  603. super(e6), this.serviceRoot = "", this.popupEnabled = true, this.operationalLayerType = "Voxel", this.legendEnabled = true, this.title = null, this.sections = null, this.currentVariableId = 0, this.volumeStyles = null, this.renderMode = "volume", this.variableStyles = null, this.enableSlices = true, this.enableSections = true, this.enableDynamicSections = true, this.enableIsosurfaces = true, this.shading = new p5(), this.opacity = 1, this.variables = new j(), this.volumes = new j(), this.index = null, this.minScale = 0, this.maxScale = 0, this.type = "voxel", this.version = { major: Number.NaN, minor: Number.NaN, versionString: "" }, this.fullExtent = null, this.volumeStyles = new (j.ofType(d3))(), this.variableStyles = new (j.ofType(f3))(), this.sections = new (j.ofType(u3))();
  604. }
  605. set url(e6) {
  606. this._set("url", S(e6, R));
  607. }
  608. load(e6) {
  609. const r5 = r(e6) ? e6.signal : null, i7 = this.loadFromPortal({ supportedTypes: ["Scene Service"] }, e6).catch(w).then(() => this._fetchService(r5)).then(() => this.serviceRoot = this.url);
  610. return this.addResolvingPromise(i7), Promise.resolve(this);
  611. }
  612. read(e6, r5) {
  613. super.read(e6, r5);
  614. for (const i7 of this.volumes)
  615. i7.spatialReference = this.spatialReference;
  616. }
  617. readVersion(e6, r5) {
  618. return super.parseVersionString(e6);
  619. }
  620. validateLayer(e6) {
  621. if (e6.layerType && e6.layerType !== this.operationalLayerType)
  622. throw new s2("voxel-layer:layer-type-not-supported", "VoxelLayer does not support this layer type", { layerType: e6.layerType });
  623. if (isNaN(this.version.major) || isNaN(this.version.minor) || this.version.major < 3)
  624. throw new s2("layer:service-version-not-supported", "Service version is not supported.", { serviceVersion: this.version.versionString, supportedVersions: "3.x" });
  625. if (this.version.major > 3)
  626. throw new s2("layer:service-version-too-new", "Service version is too new.", { serviceVersion: this.version.versionString, supportedVersions: "3.x" });
  627. }
  628. readFullExtent(e6, r5, i7) {
  629. if (null != e6 && "object" == typeof e6) {
  630. const o2 = w3.fromJSON(e6, i7);
  631. if (0 === o2.zmin && 0 === o2.zmax && Array.isArray(r5.volumes)) {
  632. const e7 = S2.fromJSON(r5.volumes[0]);
  633. if (e7.isValid && "xyt" !== e7.volumeType) {
  634. const r6 = e7.dimensions[2];
  635. if (r6.isRegular) {
  636. let e8 = r6.regularSpacing.offset, i8 = r6.regularSpacing.offset + r6.regularSpacing.scale * (r6.size - 1);
  637. if (e8 > i8) {
  638. const r7 = e8;
  639. e8 = i8, i8 = r7;
  640. }
  641. o2.zmin = e8, o2.zmax = i8;
  642. }
  643. }
  644. }
  645. return o2;
  646. }
  647. return null;
  648. }
  649. getConfiguration() {
  650. const e6 = { layerType: this.operationalLayerType, version: this.version.versionString, name: this.title, spatialReference: this.spatialReference, fullExtent: this.fullExtent, volumes: this.volumes.toJSON(), variables: this.variables.toJSON(), index: this.index.toJSON(), sections: this.getSections(), style: { volumeStyles: this.getVolumeStyles(), currentVariableId: this.currentVariableId, renderMode: this.renderMode, variableStyles: this.getVariableStyles(), enableSections: this.enableSections, enableDynamicSections: this.enableDynamicSections, enableIsosurfaces: this.enableIsosurfaces, enableSlices: this.enableSlices, shading: this.shading } };
  651. return e6.index && this.index.isValid() ? JSON.stringify(e6) : "";
  652. }
  653. getVariableStyle(e6) {
  654. let r5 = -1;
  655. r5 = r(e6) ? e6 : this.currentVariableId;
  656. if (!this.variableStyles || -1 === r5)
  657. return null;
  658. const i7 = this.variableStyles.findIndex((e7) => e7.variableId === r5);
  659. return i7 < 0 ? null : this.variableStyles.getItemAt(i7);
  660. }
  661. getVariable(e6) {
  662. let r5 = -1;
  663. if (r5 = r(e6) ? e6 : this.currentVariableId, !this.variables || -1 === r5)
  664. return null;
  665. const i7 = this.variables.findIndex((e7) => e7.id === r5);
  666. return i7 < 0 ? null : this.variables.getItemAt(i7);
  667. }
  668. getVolume(e6) {
  669. const r5 = this.getVariable(e6);
  670. return r(r5) ? this.volumes.find(({ id: e7 }) => e7 === r5.volumeId) : null;
  671. }
  672. getVolumeStyle(e6) {
  673. const r5 = this.getVariable(e6);
  674. return r(r5) ? this.volumeStyles.find(({ volumeId: e7 }) => e7 === r5.volumeId) : null;
  675. }
  676. getColorForContinuousDataValue(e6, r5, i7) {
  677. const o2 = this.getVariable(e6);
  678. if (!r(o2) || "continuous" !== o2.renderingFormat.continuity)
  679. return null;
  680. if (!this.variableStyles)
  681. return null;
  682. const s7 = this.variableStyles.findIndex((r6) => r6.variableId === e6);
  683. if (s7 < 0)
  684. return null;
  685. const n4 = this.variableStyles.getItemAt(s7);
  686. return n4.transferFunction ? n4.transferFunction.getColorForContinuousDataValue(r5, i7) : null;
  687. }
  688. getSections() {
  689. const e6 = [];
  690. for (const r5 of this.sections)
  691. e6.push(new u3({ enabled: r5.enabled, href: r5.href, id: r5.id, label: r5.label, normal: r5.normal, point: r5.point, sizeInPixel: r5.sizeInPixel, slices: r5.slices, timeId: r5.timeId, variableId: r5.variableId }));
  692. return e6;
  693. }
  694. getVariableStyles() {
  695. const e6 = [];
  696. for (const r5 of this.variableStyles) {
  697. const i7 = this._getVariable(r5);
  698. if (r(i7)) {
  699. const o2 = r5.clone();
  700. o2.isosurfaces.length > 4 && (o2.isosurfaces = o2.isosurfaces.slice(0, 3), R.error("A maximum of 4 isosurfaces are supported for Voxel Layers."));
  701. for (const e7 of o2.isosurfaces)
  702. if (e7.colorLocked) {
  703. const r6 = this.getColorForContinuousDataValue(o2.variableId, e7.value, false);
  704. null === r6 || r6.equals(e7.color) || (e7.color = r6);
  705. }
  706. if ("continuous" === i7.renderingFormat.continuity)
  707. (null === o2.transferFunction || o2.transferFunction.colorStops.length < 2) && R.error(`VoxelVariableStyle for variable ${i7.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`), null !== o2.transferFunction && (Array.isArray(o2.transferFunction.stretchRange) && 2 === o2.transferFunction.stretchRange.length || (R.error(`VoxelVariableStyle for variable ${i7.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`), o2.transferFunction.stretchRange = [0, 1], o2.transferFunction.colorStops.removeAll()));
  708. else if ("discrete" === i7.renderingFormat.continuity)
  709. if (0 === r5.uniqueValues.length)
  710. R.error(`VoxelVariableStyle for variable ${i7.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);
  711. else
  712. for (const e7 of r5.uniqueValues)
  713. null !== e7.label && void 0 !== e7.label || null === e7.value || void 0 === e7.value || (e7.label = e7.value.toString());
  714. e6.push(o2);
  715. } else
  716. R.error(`VoxelVariable ID=${r5.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`);
  717. }
  718. return e6;
  719. }
  720. getVolumeStyles() {
  721. const e6 = [];
  722. for (const r5 of this.volumeStyles) {
  723. const i7 = this._getVolumeFromVolumeId(r5.volumeId);
  724. if (r(i7)) {
  725. const o2 = r5.clone();
  726. for (const e7 of o2.slices)
  727. this._isPlaneValid(e7, [0, 1, i7.zDimension], i7.dimensions) || (e7.enabled = false, e7.label = "invalid");
  728. for (const e7 of o2.dynamicSections)
  729. this._isPlaneValid(e7, [0, 1, i7.zDimension], i7.dimensions) || (e7.enabled = false, e7.label = "invalid");
  730. e6.push(o2);
  731. } else
  732. R.error(`VoxelVolume ID=${r5.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`);
  733. }
  734. return e6;
  735. }
  736. _getVariable(e6) {
  737. const r5 = e6.variableId;
  738. for (const i7 of this.variables)
  739. if (i7.id === r5)
  740. return i7;
  741. return null;
  742. }
  743. _getVolumeFromVolumeId(e6) {
  744. for (const r5 of this.volumes)
  745. if (r5.id === e6)
  746. return r5;
  747. return null;
  748. }
  749. _isPlaneValid(e6, r5, i7) {
  750. if (!e6.point)
  751. return false;
  752. if (!Array.isArray(e6.point) || 3 !== e6.point.length)
  753. return false;
  754. if (!e6.normal)
  755. return false;
  756. if (!Array.isArray(e6.normal) || 3 !== e6.normal.length)
  757. return false;
  758. for (let s7 = 0; s7 < 3; ++s7) {
  759. const o3 = e6.point[s7];
  760. if (o3 < 0 || o3 >= i7[r5[s7]].size)
  761. return false;
  762. }
  763. const o2 = r2(e6.normal[0], e6.normal[1], e6.normal[2]);
  764. z(o2, o2);
  765. const t6 = 1e-6;
  766. return !(Math.abs(o2[0]) + Math.abs(o2[1]) + Math.abs(o2[2]) < t6) && (e6.normal[0] = o2[0], e6.normal[1] = o2[1], e6.normal[2] = o2[2], true);
  767. }
  768. };
  769. e([y2(p3)], M.prototype, "popupEnabled", void 0), e([y2({ type: ["Voxel"] })], M.prototype, "operationalLayerType", void 0), e([y2(c2)], M.prototype, "legendEnabled", void 0), e([y2({ json: { write: true } })], M.prototype, "title", void 0), e([y2(f)], M.prototype, "url", null), e([y2({ type: j.ofType(u3), json: { origins: { "web-scene": { name: "layerDefinition.sections", write: true } } } })], M.prototype, "sections", void 0), e([y2({ type: T, json: { origins: { "web-scene": { name: "layerDefinition.style.currentVariableId", write: { enabled: true, isRequired: true, ignoreOrigin: true } }, service: { name: "style.currentVariableId" } } } })], M.prototype, "currentVariableId", void 0), e([y2({ type: j.ofType(d3), json: { origins: { "web-scene": { name: "layerDefinition.style.volumeStyles", write: true }, service: { name: "style.volumeStyles" } } } })], M.prototype, "volumeStyles", void 0), e([y2({ type: ["volume", "surfaces"], json: { origins: { "web-scene": { name: "layerDefinition.style.renderMode", write: true }, service: { name: "style.renderMode" } } } })], M.prototype, "renderMode", void 0), e([y2({ type: j.ofType(f3), json: { origins: { "web-scene": { name: "layerDefinition.style.variableStyles", write: true }, service: { name: "style.variableStyles" } } } })], M.prototype, "variableStyles", void 0), e([y2({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableSlices", write: true }, service: { name: "style.enableSlices" } } } })], M.prototype, "enableSlices", void 0), e([y2({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableSections", write: true }, service: { name: "style.enableSections" } } } })], M.prototype, "enableSections", void 0), e([y2({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableDynamicSections", write: true }, service: { name: "style.enableDynamicSections" } } } })], M.prototype, "enableDynamicSections", void 0), e([y2({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableIsosurfaces", write: true }, service: { name: "style.enableIsosurfaces" } } } })], M.prototype, "enableIsosurfaces", void 0), e([y2({ type: p5, json: { origins: { "web-scene": { name: "layerDefinition.style.shading", write: true }, service: { name: "style.shading" } } } })], M.prototype, "shading", void 0), e([y2({ type: ["show", "hide"] })], M.prototype, "listMode", void 0), e([y2({ type: Number, range: { min: 0, max: 1 }, nonNullable: true, json: { read: false, write: false, origins: { "web-scene": { read: false, write: false }, "portal-item": { read: false, write: false } } } })], M.prototype, "opacity", void 0), e([y2({ type: j.ofType(p7) })], M.prototype, "variables", void 0), e([y2({ type: j.ofType(S2) })], M.prototype, "volumes", void 0), e([y2({ type: p14 })], M.prototype, "index", void 0), e([y2({ type: Number, json: { name: "layerDefinition.minScale", read: false, write: false, origins: { service: { read: false, write: false } } } })], M.prototype, "minScale", void 0), e([y2({ type: Number, json: { name: "layerDefinition.maxScale", read: false, write: false, origins: { service: { read: false, write: false } } } })], M.prototype, "maxScale", void 0), e([y2({ json: { read: false }, readOnly: true })], M.prototype, "type", void 0), e([y2({ readOnly: true, json: { name: "serviceVersion" } })], M.prototype, "version", void 0), e([o("service", "version")], M.prototype, "readVersion", null), e([y2({ type: w3 })], M.prototype, "fullExtent", void 0), e([o("service", "fullExtent", ["fullExtent"])], M.prototype, "readFullExtent", null), M = e([n(E3)], M);
  770. var O2 = M;
  771. export {
  772. O2 as default
  773. };
  774. //# sourceMappingURL=VoxelLayer-UZ3WZOBC.js.map