chunk-YJKEIUMW.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. import {
  2. U
  3. } from "./chunk-ZIWBDWEW.js";
  4. import {
  5. a as a2
  6. } from "./chunk-Q4LKAPDF.js";
  7. import {
  8. E,
  9. S
  10. } from "./chunk-23ONSYIH.js";
  11. import {
  12. r as r2,
  13. s as s4
  14. } from "./chunk-WFSV2B2I.js";
  15. import {
  16. C
  17. } from "./chunk-MI7HWWFL.js";
  18. import {
  19. e as e3
  20. } from "./chunk-ZHRMTKME.js";
  21. import {
  22. s as s3
  23. } from "./chunk-XLV7RUSE.js";
  24. import {
  25. l
  26. } from "./chunk-7XXXCK2A.js";
  27. import {
  28. d as d2,
  29. e as e2,
  30. n as n3
  31. } from "./chunk-WJW5DUN6.js";
  32. import {
  33. u
  34. } from "./chunk-WEMIK25H.js";
  35. import {
  36. n as n2
  37. } from "./chunk-DT6EAZQ5.js";
  38. import {
  39. d,
  40. e,
  41. n2 as n,
  42. y3 as y
  43. } from "./chunk-Y3WMVFTW.js";
  44. import {
  45. D
  46. } from "./chunk-ULGDPLM2.js";
  47. import {
  48. s,
  49. s3 as s2
  50. } from "./chunk-EMJ4ZSM2.js";
  51. import {
  52. m
  53. } from "./chunk-IKP3YN53.js";
  54. import {
  55. a,
  56. r,
  57. t
  58. } from "./chunk-GZT4BVFP.js";
  59. // node_modules/@arcgis/core/layers/effects/EffectView.js
  60. var a3 = -1;
  61. var h = class extends y {
  62. constructor(t2) {
  63. super(t2), this._from = null, this._to = null, this._final = null, this._current = [], this._time = 0, this.duration = a("mapview-transitions-duration"), this.effects = [];
  64. }
  65. set effect(t2) {
  66. if (this._get("effect") !== (t2 = t2 || "")) {
  67. this._set("effect", t2);
  68. try {
  69. this._transitionTo(u2(t2));
  70. } catch (e5) {
  71. this._transitionTo([]), s.getLogger(this.declaredClass).warn("Invalid Effect", { effect: t2, error: e5 });
  72. }
  73. }
  74. }
  75. get hasEffects() {
  76. return this.transitioning || !!this.effects.length;
  77. }
  78. set scale(t2) {
  79. this._updateForScale(t2);
  80. }
  81. get transitioning() {
  82. return this._to !== null;
  83. }
  84. canTransitionTo(t2) {
  85. try {
  86. return this.scale > 0 && _(this._current, u2(t2), this.scale);
  87. } catch {
  88. return false;
  89. }
  90. }
  91. transitionStep(t2, e5) {
  92. this._applyTimeTransition(t2), this._updateForScale(e5);
  93. }
  94. end() {
  95. this._applyTimeTransition(this.duration);
  96. }
  97. _transitionTo(t2) {
  98. this.scale > 0 && _(this._current, t2, this.scale) ? (this._final = t2, this._to = m(t2), p(this._current, this._to, this.scale), this._from = m(this._current), this._time = 0) : (this._from = this._to = this._final = null, this._current = t2), this._set("effects", this._current[0] ? m(this._current[0].effects) : []);
  99. }
  100. _applyTimeTransition(t2) {
  101. if (!(this._to && this._from && this._current && this._final))
  102. return;
  103. this._time += t2;
  104. const e5 = Math.min(1, this._time / this.duration);
  105. for (let s7 = 0; s7 < this._current.length; s7++) {
  106. const t3 = this._current[s7], r4 = this._from[s7], i = this._to[s7];
  107. t3.scale = m2(r4.scale, i.scale, e5);
  108. for (let s8 = 0; s8 < t3.effects.length; s8++) {
  109. const n6 = t3.effects[s8], c2 = r4.effects[s8], o = i.effects[s8];
  110. n6.interpolate(c2, o, e5);
  111. }
  112. }
  113. e5 === 1 && (this._current = this._final, this._set("effects", this._current[0] ? m(this._current[0].effects) : []), this._from = this._to = this._final = null);
  114. }
  115. _updateForScale(t2) {
  116. if (this._set("scale", t2), this._current.length === 0)
  117. return;
  118. const e5 = this._current, s7 = this._current.length - 1;
  119. let r4, i, n6 = 1;
  120. if (e5.length === 1 || t2 >= e5[0].scale)
  121. i = r4 = e5[0].effects;
  122. else if (t2 <= e5[s7].scale)
  123. i = r4 = e5[s7].effects;
  124. else
  125. for (let c2 = 0; c2 < s7; c2++) {
  126. const s8 = e5[c2], o = e5[c2 + 1];
  127. if (s8.scale >= t2 && o.scale <= t2) {
  128. n6 = (t2 - s8.scale) / (o.scale - s8.scale), r4 = s8.effects, i = o.effects;
  129. break;
  130. }
  131. }
  132. for (let c2 = 0; c2 < this.effects.length; c2++) {
  133. this.effects[c2].interpolate(r4[c2], i[c2], n6);
  134. }
  135. }
  136. };
  137. function u2(t2) {
  138. const e5 = d2(t2) || [];
  139. return g(e5) ? [{ scale: a3, effects: e5 }] : e5;
  140. }
  141. function _(t2, e5, s7) {
  142. if (!t2[0]?.effects || !e5[0]?.effects)
  143. return true;
  144. return !((t2[0]?.scale === a3 || e5[0]?.scale === a3) && (t2.length > 1 || e5.length > 1) && s7 <= 0) && n3(t2[0].effects, e5[0].effects);
  145. }
  146. function p(t2, e5, s7) {
  147. const r4 = t2.length > e5.length ? t2 : e5, i = t2.length > e5.length ? e5 : t2, n6 = i[i.length - 1], c2 = n6?.scale ?? s7, o = n6?.effects ?? [];
  148. for (let f = i.length; f < r4.length; f++)
  149. i.push({ scale: c2, effects: [...o] });
  150. for (let f = 0; f < r4.length; f++)
  151. i[f].scale = i[f].scale === a3 ? s7 : i[f].scale, r4[f].scale = r4[f].scale === a3 ? s7 : r4[f].scale, e2(i[f].effects, r4[f].effects);
  152. }
  153. function m2(t2, e5, s7) {
  154. return t2 + (e5 - t2) * s7;
  155. }
  156. function g(t2) {
  157. const e5 = t2[0];
  158. return !!e5 && "type" in e5;
  159. }
  160. e([d()], h.prototype, "_to", void 0), e([d()], h.prototype, "duration", void 0), e([d({ value: "" })], h.prototype, "effect", null), e([d({ readOnly: true })], h.prototype, "effects", void 0), e([d({ readOnly: true })], h.prototype, "hasEffects", null), e([d({ value: 0 })], h.prototype, "scale", null), e([d({ readOnly: true })], h.prototype, "transitioning", null), h = e([n("esri.layers.effects.EffectView")], h);
  161. // node_modules/@arcgis/core/views/2d/engine/DisplayObject.js
  162. var r3 = 1 / a("mapview-transitions-duration");
  163. var a4 = class extends n2 {
  164. constructor() {
  165. super(...arguments), this._fadeOutResolver = null, this._fadeInResolver = null, this._clips = null, this.computedVisible = true, this.computedOpacity = 1, this.fadeTransitionEnabled = false, this.inFadeTransition = false, this._isReady = false, this._opacity = 1, this._stage = null, this._visible = true;
  166. }
  167. get clips() {
  168. return this._clips;
  169. }
  170. set clips(e5) {
  171. this._clips = e5, this.requestRender();
  172. }
  173. get isReady() {
  174. return this._isReady;
  175. }
  176. get opacity() {
  177. return this._opacity;
  178. }
  179. set opacity(e5) {
  180. this._opacity !== e5 && (this._opacity = Math.min(1, Math.max(e5, 0)), this.requestRender());
  181. }
  182. get stage() {
  183. return this._stage;
  184. }
  185. set stage(e5) {
  186. if (this._stage === e5)
  187. return;
  188. const t2 = this._stage;
  189. this._stage = e5, e5 ? this._stage.untrashDisplayObject(this) || (this.onAttach(), this.emit("attach")) : t2.trashDisplayObject(this);
  190. }
  191. get transforms() {
  192. return this._getTransforms();
  193. }
  194. _getTransforms() {
  195. return t(this._transforms) && (this._transforms = this._createTransforms()), this._transforms;
  196. }
  197. get visible() {
  198. return this._visible;
  199. }
  200. set visible(e5) {
  201. this._visible !== e5 && (this._visible = e5, this.requestRender());
  202. }
  203. fadeIn() {
  204. return this._fadeInResolver || (this._fadeOutResolver && (this._fadeOutResolver(), this._fadeOutResolver = null), this.computedOpacity = 0, this.fadeTransitionEnabled = true, this._fadeInResolver = D(), this.requestRender()), this._fadeInResolver.promise;
  205. }
  206. fadeOut() {
  207. return this._fadeOutResolver || (this._fadeInResolver && (this._fadeInResolver(), this._fadeInResolver = null), this.fadeTransitionEnabled = true, this._fadeOutResolver = D(), this.requestRender()), this._fadeOutResolver.promise;
  208. }
  209. beforeRender(e5) {
  210. this.updateTransitionProperties(e5.deltaTime, e5.state.scale);
  211. }
  212. afterRender(e5) {
  213. this._fadeInResolver && this.computedOpacity === this.opacity ? (this._fadeInResolver(), this._fadeInResolver = null) : this._fadeOutResolver && this.computedOpacity === 0 && (this._fadeOutResolver(), this._fadeOutResolver = null);
  214. }
  215. remove() {
  216. this.parent?.removeChild(this);
  217. }
  218. setTransform(e5) {
  219. }
  220. processRender(e5) {
  221. this.stage && this.computedVisible && this.doRender(e5);
  222. }
  223. requestRender() {
  224. this.stage && this.stage.requestRender();
  225. }
  226. processDetach() {
  227. this._fadeInResolver && (this._fadeInResolver(), this._fadeInResolver = null), this._fadeOutResolver && (this._fadeOutResolver(), this._fadeOutResolver = null), this.onDetach(), this.emit("detach");
  228. }
  229. updateTransitionProperties(e5, t2) {
  230. if (this.fadeTransitionEnabled) {
  231. const t3 = this._fadeOutResolver || !this.visible ? 0 : this.opacity, s7 = this.computedOpacity;
  232. if (s7 === t3)
  233. this.computedVisible = this.visible;
  234. else {
  235. const i = e5 * r3;
  236. this.computedOpacity = s7 > t3 ? Math.max(t3, s7 - i) : Math.min(t3, s7 + i), this.computedVisible = this.computedOpacity > 0;
  237. const a5 = t3 === this.computedOpacity;
  238. this.inFadeTransition = !a5, a5 || this.requestRender();
  239. }
  240. } else
  241. this.computedOpacity = this.opacity, this.computedVisible = this.visible;
  242. }
  243. onAttach() {
  244. }
  245. onDetach() {
  246. }
  247. doRender(e5) {
  248. }
  249. ready() {
  250. this._isReady || (this._isReady = true, this.emit("isReady"), this.requestRender());
  251. }
  252. };
  253. // node_modules/@arcgis/core/views/2d/engine/Container.js
  254. var s5 = class extends a4 {
  255. constructor() {
  256. super(...arguments), this._childrenSet = new Set(), this._needsSort = false, this.children = [], this._effectView = null;
  257. }
  258. get blendMode() {
  259. return this._blendMode;
  260. }
  261. set blendMode(e5) {
  262. this._blendMode = e5, this.requestRender();
  263. }
  264. get clips() {
  265. return this._clips;
  266. }
  267. set clips(e5) {
  268. this._clips = e5, this.children.forEach((t2) => t2.clips = e5);
  269. }
  270. get computedEffects() {
  271. return this._effectView?.effects ?? null;
  272. }
  273. get effect() {
  274. return this._effectView?.effect ?? "";
  275. }
  276. set effect(e5) {
  277. (this._effectView || e5) && (this._effectView || (this._effectView = new h()), this._effectView.effect = e5, this.requestRender());
  278. }
  279. updateTransitionProperties(e5, t2) {
  280. super.updateTransitionProperties(e5, t2), this._effectView && (this._effectView.transitionStep(e5, t2), this._effectView.transitioning && this.requestRender());
  281. }
  282. doRender(e5) {
  283. const t2 = this.createRenderParams(e5);
  284. this.renderChildren(t2);
  285. }
  286. addChild(e5) {
  287. return this.addChildAt(e5, this.children.length);
  288. }
  289. addChildAt(e5, t2 = this.children.length) {
  290. if (!e5)
  291. return e5;
  292. if (this.contains(e5))
  293. return e5;
  294. this._needsSort = true;
  295. const i = e5.parent;
  296. return i && i !== this && i.removeChild(e5), t2 >= this.children.length ? this.children.push(e5) : this.children.splice(t2, 0, e5), this._childrenSet.add(e5), e5.parent = this, e5.stage = this.stage, this !== this.stage && (e5.clips = this.clips), this.requestRender(), e5;
  297. }
  298. contains(e5) {
  299. return this._childrenSet.has(e5);
  300. }
  301. removeAllChildren() {
  302. this._childrenSet.clear(), this._needsSort = true;
  303. for (const e5 of this.children)
  304. this !== this.stage && (e5.clips = null), e5.stage = null, e5.parent = null;
  305. this.children.length = 0;
  306. }
  307. removeChild(e5) {
  308. return this.contains(e5) ? this.removeChildAt(this.children.indexOf(e5)) : e5;
  309. }
  310. removeChildAt(e5) {
  311. if (e5 < 0 || e5 >= this.children.length)
  312. return null;
  313. this._needsSort = true;
  314. const t2 = this.children.splice(e5, 1)[0];
  315. return this._childrenSet.delete(t2), this !== this.stage && (t2.clips = null), t2.stage = null, t2.parent = null, t2;
  316. }
  317. sortChildren(e5) {
  318. this._needsSort && (this.children.sort(e5), this._needsSort = false);
  319. }
  320. _createTransforms() {
  321. return { dvs: e3() };
  322. }
  323. onAttach() {
  324. super.onAttach();
  325. const e5 = this.stage;
  326. for (const t2 of this.children)
  327. t2.stage = e5;
  328. }
  329. onDetach() {
  330. super.onDetach();
  331. for (const e5 of this.children)
  332. e5.stage = null;
  333. }
  334. renderChildren(e5) {
  335. for (const t2 of this.children)
  336. t2.beforeRender(e5);
  337. for (const t2 of this.children)
  338. t2.processRender(e5);
  339. for (const t2 of this.children)
  340. t2.afterRender(e5);
  341. }
  342. createRenderParams(e5) {
  343. return { ...e5, blendMode: this.blendMode, effects: this.computedEffects, globalOpacity: e5.globalOpacity * this.computedOpacity, inFadeTransition: this.inFadeTransition };
  344. }
  345. };
  346. // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/Technique.js
  347. var e4 = class {
  348. static getStorageSpec(t2) {
  349. return null;
  350. }
  351. static createOrUpdateRendererSchema(e5, r4) {
  352. return r(e5) && e5.type === "default" ? e5 : { type: "default" };
  353. }
  354. static getVariation(t2) {
  355. return {};
  356. }
  357. static getVariationHash(t2) {
  358. return 0;
  359. }
  360. };
  361. e4.type = "default", e4.programSpec = null;
  362. // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js
  363. var n4 = class extends e4 {
  364. static getStorageSpec({ attributes: e5 }) {
  365. return { visualVariables: false, attributes: e5 ?? null };
  366. }
  367. static _createRendererSchema() {
  368. return { type: "dot-density", colors: new Float32Array(32), dotValue: -1, dotSize: -1, dotScale: -1, dotBlending: false, backgroundColor: new Float32Array(4), activeDots: new Float32Array(8), seed: -1 };
  369. }
  370. static createOrUpdateRendererSchema(r4, a5) {
  371. const { attributes: n6, dotValue: i, referenceScale: d3, dotSize: l3, dotBlendingEnabled: s7, seed: c2, backgroundColor: u3 } = a5, m3 = r(r4) && r4.type === "dot-density" ? r4 : this._createRendererSchema();
  372. m3.dotValue = i, m3.dotSize = l3, m3.dotScale = d3, m3.dotBlending = s7, m3.seed = c2;
  373. const { colors: g2, activeDots: p3, backgroundColor: y2 } = m3;
  374. for (let e5 = 0; e5 < r2; e5++) {
  375. const o = e5 >= n6.length ? null : n6[e5].color;
  376. a2(g2, o, 4 * e5);
  377. }
  378. for (let e5 = 0; e5 < 8; e5++)
  379. p3[e5] = e5 < a5.attributes.length ? 1 : 0;
  380. return a2(y2, u3), m3;
  381. }
  382. static getVariation(e5) {
  383. return { ddDotBlending: e5.dotBlending };
  384. }
  385. static getVariationHash(e5) {
  386. return e5.dotBlending ? 1 : 0;
  387. }
  388. };
  389. n4.type = "dot-density", n4.programSpec = { shader: "materials/fill", vertexLayout: { geometry: [{ location: 0, name: "a_pos", count: 2, type: C.SHORT }, { location: 1, name: "a_id", count: 3, type: C.UNSIGNED_BYTE }, { location: 2, name: "a_bitset", count: 1, type: C.UNSIGNED_BYTE }, { location: 3, name: "a_inverseArea", count: 1, type: C.FLOAT }] } };
  390. // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/heatmap/TechniqueHeatmap.js
  391. var n5 = class extends e4 {
  392. static getStorageSpec({ field: e5, valueExpression: t2 }) {
  393. return { visualVariables: false, attributes: e5 || t2 ? [{ field: e5, valueExpression: t2 }] : null };
  394. }
  395. static _createRendererSchema() {
  396. return { type: "heatmap", radius: -1, referenceScale: -1, isFieldActive: 0, minDensity: -1, densityRange: -1, kernel: null, gradient: null, gradientHash: "invalid" };
  397. }
  398. static createOrUpdateRendererSchema(a5, i) {
  399. const { radius: n6, minDensity: s7, maxDensity: o, referenceScale: c2, field: l3, valueExpression: m3, colorStops: p3 } = i, d3 = o - s7, u3 = l3 || m3 ? 1 : 0, y2 = p3.map(({ color: e5, ratio: t2 }) => `${t2}:${e5.toString()}`).join();
  400. let h2, S2 = true;
  401. return r(a5) && a5.type === "heatmap" ? (h2 = a5, S2 = y2 !== a5.gradientHash) : h2 = this._createRendererSchema(), h2.radius = u(n6), h2.minDensity = s7, h2.densityRange = d3, h2.referenceScale = c2, h2.isFieldActive = u3, S2 && (h2.gradient = s3(p3), h2.gradientHash = y2), h2;
  402. }
  403. };
  404. n5.type = "heatmap", n5.programSpec = { shader: "materials/icon/heatmapAccumulate", vertexLayout: { geometry: [{ location: 0, name: "a_pos", count: 2, type: C.SHORT }, { location: 1, name: "a_vertexOffset", count: 2, type: C.SHORT }, { location: 4, name: "a_id", count: 4, type: C.UNSIGNED_BYTE }] } };
  405. // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/pieChart/TechniquePieChart.js
  406. var l2 = class extends e4 {
  407. static getStorageSpec({ attributes: e5 }) {
  408. return { visualVariables: true, attributes: e5 ?? null };
  409. }
  410. static _createRendererSchema() {
  411. return { type: "pie-chart", colors: new Float32Array(4 * s4), defaultColor: new Float32Array(4), othersColor: new Float32Array(4), outlineColor: new Float32Array(4), holePercentage: 0, sectorThreshold: 0, outlineWidth: 1, numberOfFields: 10 };
  412. }
  413. static createOrUpdateRendererSchema(n6, i) {
  414. const { attributes: l3, defaultColor: s7, holePercentage: c2, othersCategory: m3, outline: u3 } = i, d3 = r(n6) && n6.type === "pie-chart" ? n6 : this._createRendererSchema();
  415. for (let t2 = 0; t2 < s4; t2++) {
  416. const o = t2 >= l3.length ? new l([0, 0, 0, 0]) : l3[t2].color;
  417. a2(d3.colors, o, 4 * t2);
  418. }
  419. return a2(d3.defaultColor, s7), a2(d3.othersColor, m3?.color), a2(d3.outlineColor, u3?.color), d3.outlineWidth = u(u3?.width || 0), d3.holePercentage = c2, d3.sectorThreshold = m3?.threshold || 0, d3.numberOfFields = l3.length, d3;
  420. }
  421. static getVariation(e5) {
  422. return { numberOfFields: e5.numberOfFields };
  423. }
  424. static getVariationHash(e5) {
  425. return e5.numberOfFields;
  426. }
  427. };
  428. l2.type = "pie-chart", l2.programSpec = { shader: "materials/pie", vertexLayout: { geometry: [{ location: 0, name: "a_pos", count: 2, type: C.SHORT }, { location: 1, name: "a_vertexOffset", count: 2, type: C.SHORT }, { location: 2, name: "a_texCoords", count: 2, type: C.UNSIGNED_SHORT }, { location: 3, name: "a_bitSetAndDistRatio", count: 2, type: C.UNSIGNED_SHORT }, { location: 4, name: "a_id", count: 4, type: C.UNSIGNED_BYTE }, { location: 5, name: "a_color", count: 4, type: C.UNSIGNED_BYTE, normalized: true }, { location: 6, name: "a_outlineColor", count: 4, type: C.UNSIGNED_BYTE, normalized: true }, { location: 7, name: "a_sizeAndOutlineWidth", count: 4, type: C.UNSIGNED_BYTE }, { location: 8, name: "a_zoomRange", count: 2, type: C.UNSIGNED_SHORT }] }, hittestAttributes: ["a_vertexOffset", "a_texCoords"] };
  429. // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/utils.js
  430. function s6(r4, t2) {
  431. if (r4.type !== t2)
  432. throw new s2("material-view-model:unexpected-renderer-schema", `expected to find renderer schema of type "${t2}" but found type "${r4.type}"`);
  433. }
  434. function c(e5) {
  435. switch (e5.type) {
  436. case "dot-density":
  437. return n4;
  438. case "heatmap":
  439. return n5;
  440. case "pie-chart":
  441. return l2;
  442. default:
  443. return e4;
  444. }
  445. }
  446. function p2(e5) {
  447. const { geometryType: s7, symbologyType: c2 } = U.load(e5);
  448. switch (s7) {
  449. case E.FILL:
  450. if (c2 === S.DOT_DENSITY)
  451. return n4;
  452. break;
  453. case E.MARKER:
  454. switch (c2) {
  455. case S.HEATMAP:
  456. return n5;
  457. case S.PIE_CHART:
  458. return l2;
  459. }
  460. }
  461. return e4;
  462. }
  463. export {
  464. h,
  465. a4 as a,
  466. s5 as s,
  467. e4 as e,
  468. s6 as s2,
  469. c,
  470. p2 as p
  471. };
  472. //# sourceMappingURL=chunk-YJKEIUMW.js.map