chunk-DTSCAH2R.js 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975
  1. import {
  2. p
  3. } from "./chunk-B5WNDDCF.js";
  4. import {
  5. i as i3,
  6. m as m2,
  7. o as o2
  8. } from "./chunk-DXEPL3XQ.js";
  9. import {
  10. $ as $2,
  11. c as c4,
  12. d,
  13. g as g3,
  14. h as h2,
  15. p as p2,
  16. u as u4,
  17. w as w2,
  18. y as y3
  19. } from "./chunk-XYIYXU3I.js";
  20. import {
  21. r as r6
  22. } from "./chunk-ZLQP3WDC.js";
  23. import {
  24. E as E4,
  25. a as a2
  26. } from "./chunk-WBWQJQK4.js";
  27. import {
  28. r as r5
  29. } from "./chunk-A22ACVMF.js";
  30. import {
  31. c as c3,
  32. r as r4,
  33. v
  34. } from "./chunk-ZELEU5PN.js";
  35. import {
  36. b
  37. } from "./chunk-PHAKVYRM.js";
  38. import {
  39. E as E3,
  40. e as e3,
  41. l as l4,
  42. l2 as l5,
  43. x
  44. } from "./chunk-IDINBHDV.js";
  45. import {
  46. n as n3
  47. } from "./chunk-6LE4RPMZ.js";
  48. import {
  49. Q,
  50. V,
  51. ae as ae2,
  52. n as n2
  53. } from "./chunk-67RFR4NT.js";
  54. import {
  55. G,
  56. K,
  57. W,
  58. X,
  59. ae,
  60. ge,
  61. he,
  62. ie,
  63. se
  64. } from "./chunk-T2SKWJGU.js";
  65. import {
  66. U as U3
  67. } from "./chunk-XO5VJRK4.js";
  68. import {
  69. o
  70. } from "./chunk-ST53DRNI.js";
  71. import {
  72. U as U4
  73. } from "./chunk-3WXSWAUV.js";
  74. import {
  75. S
  76. } from "./chunk-EQNT4A7P.js";
  77. import {
  78. C as C2,
  79. E as E2,
  80. F,
  81. I,
  82. R as R2
  83. } from "./chunk-3OFVLRSL.js";
  84. import {
  85. f as f3,
  86. g as g2
  87. } from "./chunk-VEJPYAE4.js";
  88. import {
  89. O,
  90. U
  91. } from "./chunk-UMUHMVL4.js";
  92. import {
  93. l as l6
  94. } from "./chunk-YFDOPEEZ.js";
  95. import {
  96. e as e4
  97. } from "./chunk-IQBIGNPU.js";
  98. import {
  99. i as i2
  100. } from "./chunk-QU433TMZ.js";
  101. import {
  102. t as t3
  103. } from "./chunk-UDYHZLTE.js";
  104. import {
  105. M,
  106. f as f4,
  107. h,
  108. i,
  109. r as r3
  110. } from "./chunk-O3JQY77G.js";
  111. import {
  112. $,
  113. C,
  114. at,
  115. et,
  116. ht
  117. } from "./chunk-JKFWEHNK.js";
  118. import {
  119. U as U2
  120. } from "./chunk-WOXHUQGM.js";
  121. import {
  122. t as t2
  123. } from "./chunk-3IRT3YKJ.js";
  124. import {
  125. N,
  126. O as O2,
  127. j as j2
  128. } from "./chunk-JAUFBT5U.js";
  129. import {
  130. a
  131. } from "./chunk-YZVAB3DF.js";
  132. import {
  133. l
  134. } from "./chunk-TJV6ODRM.js";
  135. import {
  136. E,
  137. e as e2,
  138. l as l3,
  139. q,
  140. s as s3,
  141. u as u2
  142. } from "./chunk-2H5MD622.js";
  143. import {
  144. u as u3
  145. } from "./chunk-UVVU4UUO.js";
  146. import {
  147. s as s2
  148. } from "./chunk-3GZSQU56.js";
  149. import {
  150. c as c2,
  151. f as f2,
  152. l as l2,
  153. s,
  154. u,
  155. y as y2
  156. } from "./chunk-RMDDCMKS.js";
  157. import {
  158. c,
  159. g,
  160. r as r2
  161. } from "./chunk-VCH45Q2I.js";
  162. import {
  163. R,
  164. k2 as k
  165. } from "./chunk-PQFTYGF5.js";
  166. import {
  167. e,
  168. m,
  169. n5 as n,
  170. y3 as y
  171. } from "./chunk-2Z2TG5CU.js";
  172. import {
  173. f,
  174. j,
  175. w
  176. } from "./chunk-V6P2MAQQ.js";
  177. import {
  178. has
  179. } from "./chunk-SPWQ3AWG.js";
  180. import {
  181. r,
  182. t
  183. } from "./chunk-YXWMMD76.js";
  184. // node_modules/@arcgis/core/views/2d/engine/webgl/DirtyMap.js
  185. var t4 = -1;
  186. var e5 = class {
  187. constructor() {
  188. this._dirties = [{ vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }];
  189. }
  190. hasDirty() {
  191. return this._dirties.some((e11) => e11.indexCount !== t4 || e11.allDirty);
  192. }
  193. markAllClean() {
  194. for (const e11 of this._dirties)
  195. e11.indexFrom = t4, e11.indexCount = t4, e11.vertexFrom = t4, e11.vertexCount = t4, e11.allDirty = false;
  196. }
  197. markAllDirty() {
  198. for (const t11 of this._dirties)
  199. t11.allDirty = true;
  200. }
  201. forEach(e11) {
  202. for (let r10 = 0; r10 < this._dirties.length; ++r10) {
  203. const { indexCount: i5, indexFrom: o7, vertexCount: n7, vertexFrom: x4, allDirty: l8 } = this._dirties[r10], s7 = {};
  204. let d5, m3 = false;
  205. (l8 || x4 !== t4 && n7 > 0) && (s7.geometry = { count: n7, from: x4, allDirty: l8 }, m3 = true), (l8 || o7 !== t4 && i5 > 0) && (d5 = { count: i5, from: o7, allDirty: l8 }, m3 = true), m3 && e11({ indices: d5, vertices: s7 }, r10);
  206. }
  207. }
  208. markDirtyIndices(e11, r10, i5) {
  209. const o7 = this._dirties[e11], n7 = r10, x4 = i5;
  210. if (!o7.allDirty)
  211. if (o7.indexCount !== t4) {
  212. const t11 = Math.min(o7.indexFrom, n7), e12 = Math.max(o7.indexFrom + o7.indexCount, n7 + x4) - t11;
  213. o7.indexFrom = t11, o7.indexCount = e12;
  214. } else
  215. o7.indexFrom = n7, o7.indexCount = x4;
  216. }
  217. markDirtyVertices(e11, r10, i5, o7) {
  218. const n7 = this._dirties[e11], x4 = i5, l8 = o7;
  219. if (!n7.allDirty)
  220. if (n7.vertexCount !== t4) {
  221. const t11 = Math.min(n7.vertexFrom, x4), e12 = Math.max(n7.vertexFrom + n7.vertexCount, x4 + l8) - t11;
  222. n7.vertexFrom = t11, n7.vertexCount = e12;
  223. } else
  224. n7.vertexFrom = x4, n7.vertexCount = l8;
  225. }
  226. };
  227. // node_modules/@arcgis/core/views/2d/engine/webgl/FreeList.js
  228. var e6 = class {
  229. constructor(e11) {
  230. this._largestRange = null, this._parent = e11, this._updateLargestRange();
  231. }
  232. get largestRange() {
  233. return this._largestRange;
  234. }
  235. rangeCreated(e11) {
  236. (!this._largestRange || e11.count > this._largestRange.count) && (this._largestRange = e11);
  237. }
  238. rangeResized(e11, t11) {
  239. e11 === this._largestRange ? e11.count < t11 && this._updateLargestRange() : (!this._largestRange || e11.count > this._largestRange.count) && (this._largestRange = e11);
  240. }
  241. findBestRange(e11) {
  242. let t11 = this._parent._freeHead, n7 = null;
  243. for (; null !== t11; )
  244. t11.count >= e11 && (!n7 || t11.count - e11 < n7.count - e11) && (n7 = t11), t11 = t11.next;
  245. return n7;
  246. }
  247. findAdjacentRanges(e11, t11) {
  248. let n7 = true, r10 = false, s7 = null, o7 = this._parent._freeHead;
  249. for (; n7 && !r10; ) {
  250. const a4 = null !== s7 ? s7.from + s7.count : 0, l8 = null !== o7 ? o7.from : this._parent._size;
  251. e11 >= a4 && e11 + t11 <= l8 ? (n7 = false, r10 = true) : null !== o7 ? (s7 = o7, o7 = o7.next) : n7 = false;
  252. }
  253. return [s7, o7];
  254. }
  255. _updateLargestRange() {
  256. let e11 = null, t11 = this._parent._freeHead;
  257. for (; null !== t11; )
  258. (!e11 || t11.count > e11.count) && (e11 = t11), t11 = t11.next;
  259. this._largestRange = e11;
  260. }
  261. };
  262. var t5 = class {
  263. constructor(t11, n7) {
  264. this._allocated = 0, this._size = t11, this._freeHead = t11 > 0 ? { from: 0, count: t11, prev: null, next: null } : null, this._bookKeeper = n7 || new e6(this), this._freeHead && this._bookKeeper.rangeCreated(this._freeHead);
  265. }
  266. allocate(e11) {
  267. const n7 = this._bookKeeper.findBestRange(e11);
  268. if (null === n7)
  269. return -1;
  270. const r10 = n7.from, s7 = n7.count;
  271. if (n7.from += e11, n7.count -= e11, this._bookKeeper.rangeResized(n7, r10, s7), this._allocated += e11, 0 === n7.count) {
  272. const e12 = null !== n7.prev ? this._freeHead : n7.next;
  273. t5._removeRange(n7), this._freeHead = e12;
  274. }
  275. return r10;
  276. }
  277. free(e11, n7) {
  278. const [r10, s7] = this._bookKeeper.findAdjacentRanges(e11, n7), o7 = { from: e11, count: n7, prev: r10, next: s7 };
  279. if (null !== r10 && (r10.next = o7), null !== s7 && (s7.prev = o7), this._bookKeeper.rangeCreated(o7), this._allocated -= n7, null !== s7 && o7.from + o7.count === s7.from) {
  280. const e12 = o7.from, n8 = o7.count;
  281. t5._fuse(o7, s7), t5._removeRange(s7), this._bookKeeper.rangeResized(o7, e12, n8), this._bookKeeper.rangeResized(s7, void 0, 0);
  282. }
  283. if (null !== r10 && r10.from + r10.count === o7.from) {
  284. const e12 = r10.from, n8 = r10.count;
  285. t5._fuse(r10, o7), t5._removeRange(o7), this._bookKeeper.rangeResized(r10, e12, n8), this._bookKeeper.rangeResized(o7, void 0, 0);
  286. }
  287. this._freeHead = null !== o7.prev ? this._freeHead : o7;
  288. }
  289. get fragmentation() {
  290. const e11 = this._size - this._allocated;
  291. if (0 === e11)
  292. return 0;
  293. return 1 - this._bookKeeper.largestRange.count / e11;
  294. }
  295. static _removeRange(e11) {
  296. null !== e11.prev ? null !== e11.next ? (e11.prev.next = e11.next, e11.next.prev = e11.prev) : e11.prev.next = null : null !== e11.next && (e11.next.prev = null);
  297. }
  298. static _fuse(e11, t11) {
  299. e11.count += t11.count, e11.next = t11.next, t11.from += t11.count, t11.count = 0, null !== t11.next && (t11.next.prev = e11);
  300. }
  301. };
  302. // node_modules/@arcgis/core/views/2d/engine/webgl/DisplayRecordStore.js
  303. var s4 = ["FILL", "LINE", "MARKER", "TEXT", "LABEL"];
  304. function o3(e11) {
  305. const t11 = e11.getStrides(), r10 = {};
  306. for (let i5 = 0; i5 < t11.length; i5++)
  307. r10[s4[i5]] = t11[i5];
  308. return r10;
  309. }
  310. var n4 = 0.5;
  311. var d2 = class {
  312. constructor(r10, i5, s7, o7) {
  313. this._strides = r10, this._displayList = i5, this._freeListsAndStorage = {}, this._dirtyMap = null, this._dirtyMap = s7;
  314. for (const n7 in r10) {
  315. this._freeListsAndStorage[n7] = { vtxFreeList: o7 ? new t5(o7) : null, idxFreeList: o7 ? new t5(o7) : null, vertexBuffers: {}, indexBuffer: o7 ? new Uint32Array(o7) : null };
  316. for (const e11 in r10[n7])
  317. this._freeListsAndStorage[n7].vertexBuffers[e11] = { data: o7 ? K(o7, r10[n7][e11]) : null, stride: r10[n7][e11] };
  318. }
  319. }
  320. static fromTileData(t11, i5) {
  321. const n7 = o3(t11), a4 = [0, 0, 0, 0, 0], x4 = [0, 0, 0, 0, 0], u5 = t11.tileDisplayData.displayObjects;
  322. for (const e11 of u5)
  323. for (const t12 of e11.displayRecords)
  324. a4[t12.geometryType] = Math.max(a4[t12.geometryType], t12.vertexFrom + t12.vertexCount), x4[t12.geometryType] = Math.max(x4[t12.geometryType], t12.indexFrom + t12.indexCount);
  325. const f9 = new d2(n7, t11.tileDisplayData.displayList, i5, null);
  326. for (let o7 = 0; o7 < t11.tileBufferData.geometries.length; ++o7) {
  327. const i6 = a4[o7], n8 = x4[o7], d5 = t11.tileBufferData.geometries[o7], u6 = s4[o7], l8 = f9._storageFor(u6), c5 = t11.tileBufferData.geometries[o7].indexBuffer;
  328. let m3;
  329. l8.indexBuffer = c5, l8.idxFreeList = new t5(c5.length), l8.idxFreeList.allocate(n8);
  330. for (const e11 in d5.vertexBuffer) {
  331. const i7 = t11.tileBufferData.geometries[o7].vertexBuffer[e11];
  332. l8.vertexBuffers[e11].data = i7.data, l8.vertexBuffers[e11].stride = i7.stride;
  333. const s7 = X(i7.stride), n9 = i7.data.length * s7 / i7.stride;
  334. m3 || (m3 = n9);
  335. }
  336. l8.vtxFreeList = new t5(m3), l8.vtxFreeList.allocate(i6);
  337. }
  338. return f9;
  339. }
  340. delete(e11) {
  341. const t11 = s4[e11.geometryType];
  342. this._freeVertices(t11, e11.vertexFrom, e11.vertexCount), this._freeIndices(t11, e11.indexFrom, e11.indexCount), this._displayList.removeFromList(e11), e11.vertexFrom = void 0, e11.indexFrom = void 0;
  343. }
  344. setMeshData(e11, t11, r10, o7, n7) {
  345. const d5 = s4[e11.geometryType];
  346. let a4, x4;
  347. e11.meshData = null, void 0 === e11.vertexFrom ? (x4 = t11.vertexCount, a4 = this._allocateVertices(d5, x4)) : t11.vertexCount > e11.vertexCount ? (this._freeVertices(d5, e11.vertexFrom, e11.vertexCount), x4 = t11.vertexCount, a4 = this._allocateVertices(d5, x4)) : t11.vertexCount === e11.vertexCount ? (a4 = e11.vertexFrom, x4 = e11.vertexCount) : (this._freeVertices(d5, e11.vertexFrom + t11.vertexCount, e11.vertexCount - t11.vertexCount), a4 = e11.vertexFrom, x4 = t11.vertexCount);
  348. let u5, f9, l8, c5 = true;
  349. if (void 0 === e11.indexFrom ? (u5 = n7, l8 = t11.indexCount, f9 = this._allocateIndices(d5, l8)) : t11.indexCount > e11.indexCount ? (u5 = this._displayList.removeFromList(e11), this._freeIndices(d5, e11.indexFrom, e11.indexCount), l8 = t11.indexCount, f9 = this._allocateIndices(d5, l8)) : t11.indexCount === e11.indexCount ? (c5 = false, f9 = e11.indexFrom, l8 = e11.indexCount) : (u5 = this._displayList.removeFromList(e11), this._freeIndices(d5, e11.indexFrom + t11.indexCount, e11.indexCount - t11.indexCount), f9 = e11.indexFrom, l8 = t11.indexCount), -1 !== a4 && -1 !== f9) {
  350. const s7 = this._storageFor(d5);
  351. if (ae(a4, f9, s7.vertexBuffers, s7.indexBuffer, t11, r10, o7), e11.vertexFrom = a4, e11.indexFrom = f9, e11.vertexCount = t11.vertexCount, e11.indexCount = t11.indexCount, this._dirtyMap) {
  352. this._dirtyMap.markDirtyIndices(e11.geometryType, e11.indexFrom, e11.indexCount);
  353. for (const t12 in r10)
  354. this._dirtyMap.markDirtyVertices(e11.geometryType, t12, e11.vertexFrom, e11.vertexCount);
  355. }
  356. return c5 && this._displayList.addToList(e11, u5), true;
  357. }
  358. return -1 !== a4 && this._freeVertices(d5, a4, x4), -1 !== f9 && this._freeIndices(d5, f9, l8), e11.setMeshDataFromBuffers(t11, r10, o7), e11.vertexFrom = void 0, e11.vertexCount = 0, e11.indexFrom = void 0, e11.indexCount = 0, false;
  359. }
  360. tryAddMeshData(e11, t11) {
  361. const r10 = t11.vertexBuffer, o7 = t11.indexBuffer, n7 = s4[e11.geometryType], d5 = this._allocateVertices(n7, e11.vertexCount);
  362. if (-1 === d5)
  363. return this._freeVertices(n7, d5, e11.vertexCount), false;
  364. const a4 = this._allocateIndices(n7, e11.indexCount);
  365. if (-1 === a4)
  366. return this._freeVertices(n7, d5, e11.vertexCount), this._freeIndices(n7, a4, e11.indexCount), false;
  367. const x4 = this._storageFor(n7);
  368. if (ae(d5, a4, x4.vertexBuffers, x4.indexBuffer, e11, r10, o7), e11.vertexFrom = d5, e11.indexFrom = a4, this._dirtyMap) {
  369. this._dirtyMap.markDirtyIndices(e11.geometryType, e11.indexFrom, e11.indexCount);
  370. for (const t12 in r10)
  371. this._dirtyMap.markDirtyVertices(e11.geometryType, t12, d5, e11.vertexCount);
  372. }
  373. return this._displayList.addToList(e11), true;
  374. }
  375. _allocateVertices(e11, t11) {
  376. const r10 = this._storageFor(e11), i5 = r10.vtxFreeList.allocate(t11);
  377. if (-1 === i5)
  378. return -1;
  379. return r10.vtxFreeList.fragmentation > n4 ? -1 : i5;
  380. }
  381. _freeVertices(e11, t11, r10) {
  382. this._storageFor(e11).vtxFreeList.free(t11, r10);
  383. }
  384. _freeIndices(e11, t11, r10) {
  385. this._storageFor(e11).idxFreeList.free(t11, r10);
  386. }
  387. _allocateIndices(e11, t11) {
  388. const r10 = this._storageFor(e11), i5 = r10.idxFreeList.allocate(t11);
  389. if (-1 === i5)
  390. return -1;
  391. return r10.idxFreeList.fragmentation > n4 ? -1 : i5;
  392. }
  393. _storageFor(e11) {
  394. return this._freeListsAndStorage[e11];
  395. }
  396. _stridesFor(e11, t11) {
  397. return this._strides[e11][t11];
  398. }
  399. };
  400. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLBuffers.js
  401. var f5 = class {
  402. constructor(a4) {
  403. this.geometryMap = ie(() => ({ indexBuffer: E4.createIndex(a4, F.STATIC_DRAW), vao: null }), (e11, s7) => ({ vertexBuffer: E4.createVertex(a4, se[s7]) }));
  404. }
  405. dispose() {
  406. for (let e11 = 0; e11 < 5; e11++) {
  407. const t11 = this.geometryMap[e11];
  408. if (t11) {
  409. t11.data.vao && t11.data.vao.dispose(false), t11.data.indexBuffer && t11.data.indexBuffer.dispose();
  410. for (const e12 in t11.buffers)
  411. t11.buffers[e12] && t11.buffers[e12].data.vertexBuffer.dispose();
  412. }
  413. }
  414. }
  415. get(e11) {
  416. const t11 = this.geometryMap[e11];
  417. return { getVAO(e12, r10, s7) {
  418. if (!t11.data.vao) {
  419. const f9 = {};
  420. for (const e13 in t11.buffers)
  421. f9[e13] = t11.buffers[e13].data.vertexBuffer;
  422. t11.data.vao = new a2(e12, s7, r10, f9, t11.data.indexBuffer);
  423. }
  424. return t11.data.vao;
  425. } };
  426. }
  427. has(e11) {
  428. return null != this.geometryMap[e11];
  429. }
  430. upload(e11, t11) {
  431. t11.forEach((t12, r10) => {
  432. this._upload(t12, r10, e11);
  433. });
  434. }
  435. _upload(e11, t11, r10) {
  436. if (e11.indices && (e11.indices.allDirty ? this._uploadIndices(r10, t11) : null != e11.indices.from && null != e11.indices.count && this._uploadIndices(r10, t11, e11.indices.from, e11.indices.count)), e11.vertices) {
  437. const s7 = e11.vertices;
  438. for (const e12 in s7) {
  439. const a4 = s7[e12];
  440. a4.allDirty ? this._uploadVertices(r10, t11, e12) : null != a4.from && null != a4.count && this._uploadVertices(r10, t11, e12, a4.from, a4.count);
  441. }
  442. }
  443. }
  444. _uploadVertices(e11, t11, r10, s7, a4) {
  445. const f9 = this.geometryMap[t11];
  446. if (!f9)
  447. return;
  448. const o7 = e11.geometries[t11].vertexBuffer[r10];
  449. if (!o7)
  450. return;
  451. const { data: i5, stride: n7 } = o7;
  452. if (f9.buffers[r10] && i5.length > 0) {
  453. const e12 = n7 / i5.BYTES_PER_ELEMENT;
  454. null != s7 && null != a4 ? f9.buffers[r10].data.vertexBuffer.setSubData(i5, s7 * e12, s7 * e12, (s7 + a4) * e12) : f9.buffers[r10].data.vertexBuffer.setData(i5);
  455. }
  456. }
  457. _uploadIndices(e11, t11, r10, s7) {
  458. const a4 = this.geometryMap[t11];
  459. if (!a4)
  460. return;
  461. const f9 = e11.geometries[t11].indexBuffer;
  462. a4.data.indexBuffer && f9.length > 0 && (null != r10 && null != s7 ? a4.data.indexBuffer.setSubData(f9, r10, r10, r10 + s7) : a4.data.indexBuffer.setData(f9));
  463. }
  464. };
  465. // node_modules/@arcgis/core/views/2d/engine/webgl/GraphicTile.js
  466. var a3 = class extends m2 {
  467. constructor() {
  468. super(...arguments), this._data = null, this._displayList = null, this._lastCommitTime = 0, this._hasData = false, this._invalidated = false, this._wglBuffers = null, this._dirtyMap = new e5();
  469. }
  470. destroy() {
  471. super.destroy(), this.clear();
  472. }
  473. get hasData() {
  474. return !!this._hasData;
  475. }
  476. get displayObjects() {
  477. var _a2;
  478. return (_a2 = this._displayObjects) != null ? _a2 : [];
  479. }
  480. getGeometry(t11) {
  481. return this._wglBuffers && this._wglBuffers.has(t11) ? this._wglBuffers.get(t11) : null;
  482. }
  483. getDisplayList() {
  484. return this._displayList;
  485. }
  486. patch(e11) {
  487. if (true === e11.clear)
  488. return this.clear(), void (this._hasData = false);
  489. const i5 = e11.addOrUpdate, a4 = e11.remove;
  490. !this._data && i5 && i5.tileDisplayData.displayObjects.length ? (i5.tileDisplayData.computeDisplayList(), this._dirtyMap = new e5(), this._dispRecStore = d2.fromTileData(i5, this._dirtyMap), this._data = i5, this._dirtyMap.markAllDirty(), this._hasData = true, e11.end && this.ready()) : this._data && (i5 && i5.tileDisplayData.displayObjects.length || a4.length) ? this._doPatchData(e11) : e11.end && this.ready(), e11.end && !this._data && this.clear(), this.requestRender(), this.emit("change");
  491. }
  492. commit(t11) {
  493. t11.time && t11.time === this._lastCommitTime || (this._lastCommitTime = t11.time, this.visible && this._data && (this._wglBuffers || (this._wglBuffers = new f5(t11.context)), (this._dirtyMap.hasDirty() || this._invalidated) && (this._invalidated = false, this._wglBuffers.upload(this._data.tileBufferData, this._dirtyMap), this._displayList = this._data.tileDisplayData.displayList.clone(), this._displayObjects = this._data.tileDisplayData.displayObjects.slice(), this._dirtyMap.markAllClean())));
  494. }
  495. clear() {
  496. this._data = null, this._displayList = null, this._dispRecStore = null, this._wglBuffers && (this._wglBuffers.dispose(), this._wglBuffers = null);
  497. }
  498. _doPatchData(t11) {
  499. this._invalidated = true, this._patchData(t11) || (this._dirtyMap.markAllDirty(), this._data.reshuffle(), this._dispRecStore = d2.fromTileData(this._data, this._dirtyMap)), this.requestRender();
  500. }
  501. _patchData(t11) {
  502. let s7 = true;
  503. const e11 = t11.addOrUpdate && t11.addOrUpdate.tileDisplayData && t11.addOrUpdate.tileDisplayData.displayObjects || [], i5 = (t11.remove || []).slice();
  504. for (const l8 of e11)
  505. null != l8.insertAfter && i5.push(l8.id);
  506. let a4;
  507. i5.length > 0 && (a4 = new Set(i5));
  508. for (const l8 of i5) {
  509. const t12 = this._data.tileDisplayData.displayObjectRegistry.get(l8);
  510. if (t12) {
  511. this._data.tileDisplayData.displayList.removeFromList(t12.displayRecords);
  512. for (const s8 of t12.displayRecords)
  513. this._dispRecStore.delete(s8);
  514. this._data.tileDisplayData.displayObjectRegistry.delete(l8);
  515. }
  516. }
  517. a4 && a4.size && (this._data.tileDisplayData.displayObjects = this._data.tileDisplayData.displayObjects.filter((t12) => !a4.has(t12.id)));
  518. for (const l8 of e11) {
  519. let e12, i6 = this._data.tileDisplayData.displayObjectRegistry.get(l8.id);
  520. if (i6) {
  521. const t12 = i6.displayRecords;
  522. i6.set(l8), i6.displayRecords = t12;
  523. const s8 = i6.displayRecords.length;
  524. for (let e13 = 0; e13 < s8; ++e13) {
  525. const t13 = i6.displayRecords[e13], s9 = l8.displayRecords[e13];
  526. (e13 >= l8.displayRecords.length || t13.geometryType !== s9.geometryType || t13.symbolLevel !== s9.symbolLevel || t13.zOrder !== s9.zOrder || t13.materialKey !== s9.materialKey) && (this._dispRecStore.delete(i6.displayRecords[e13]), e13 < l8.displayRecords.length && (i6.displayRecords[e13] = void 0));
  527. }
  528. i6.displayRecords.length = l8.displayRecords.length;
  529. } else {
  530. let t12;
  531. i6 = l8.copy(), i6.displayRecords = [], this._data.tileDisplayData.displayObjectRegistry.set(l8.id, i6);
  532. const s8 = this._data.tileDisplayData.displayObjects;
  533. if (null != i6.insertAfter)
  534. if (e12 = {}, i6.insertAfter >= 0) {
  535. const e13 = this._data.tileDisplayData.displayObjectRegistry.get(i6.insertAfter);
  536. e13 ? (t12 = s8.indexOf(e13) + 1, t12 < s8.length ? s8.splice(t12, 0, i6) : (s8.push(i6), t12 = s8.length)) : (s8.push(i6), t12 = s8.length);
  537. } else
  538. s8.unshift(i6), t12 = 0;
  539. else
  540. s8.push(i6), t12 = s8.length;
  541. if (e12) {
  542. const i7 = l8.displayRecords.length > 0 ? 1 : 0;
  543. let a6 = 0;
  544. for (let l9 = t12 - 1; l9 >= 0 && a6 < i7; --l9)
  545. for (let t13 = s8[l9].displayRecords.length - 1; t13 >= 0 && a6 < i7; --t13) {
  546. const i8 = s8[l9].displayRecords[t13], d5 = this._data.tileDisplayData.displayList.getDPInfoType();
  547. e12[d5] || (e12[d5] = i8, ++a6);
  548. }
  549. }
  550. }
  551. const a5 = l8.displayRecords.length;
  552. for (let d5 = 0; d5 < a5; ++d5) {
  553. const a6 = l8.displayRecords[d5];
  554. let r10 = i6.displayRecords[d5];
  555. r10 ? (r10.meshData = a6.meshData, r10.materialKey = a6.materialKey) : (r10 = a6.copy(), r10.vertexFrom = void 0, r10.indexFrom = void 0, i6.displayRecords[d5] = r10);
  556. const h4 = a6.geometryType, p4 = this._data.tileDisplayData.displayList.getDPInfoType(), o7 = t11.addOrUpdate.tileBufferData.geometries[h4], y7 = o7.vertexBuffer, c5 = o7.indexBuffer;
  557. let n7;
  558. e12 && (n7 = e12[p4] ? this._data.tileDisplayData.displayList.splitAfter(e12[p4]) : -1), s7 = this._dispRecStore.setMeshData(r10, a6, y7, c5, n7) && s7, e12 && null != r10.indexFrom && null != r10.indexFrom && (e12[p4] = r10);
  559. }
  560. }
  561. return s7;
  562. }
  563. };
  564. // node_modules/@arcgis/core/views/2d/engine/webgl/MemoryRequirements.js
  565. var e7 = class {
  566. constructor() {
  567. this._byGeometryType = null;
  568. }
  569. get satisfied() {
  570. return !this._byGeometryType;
  571. }
  572. reset() {
  573. this._byGeometryType = null;
  574. }
  575. verticesFor(e11) {
  576. return this._byGeometryType ? this._byGeometryType[e11].vertices : 0;
  577. }
  578. indicesFor(e11) {
  579. return this._byGeometryType ? this._byGeometryType[e11].indices : 0;
  580. }
  581. needMore(e11, t11, i5) {
  582. if (!t11 && !i5)
  583. return;
  584. this._byGeometryType || (this._byGeometryType = [{ vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }]);
  585. const s7 = this._byGeometryType[e11];
  586. s7.vertices += t11, s7.indices += i5;
  587. }
  588. };
  589. // node_modules/@arcgis/core/views/2d/engine/webgl/TileBufferData.js
  590. var r7 = 5;
  591. var f6 = class {
  592. constructor() {
  593. this.geometries = [{ indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }];
  594. }
  595. clone() {
  596. const e11 = new f6();
  597. for (let r10 = 0; r10 < this.geometries.length; r10++) {
  598. const f9 = this.geometries[r10], t11 = e11.geometries[r10];
  599. t11.indexBuffer = f9.indexBuffer.slice(), t11.vertexBuffer = {};
  600. for (const e12 in f9.vertexBuffer) {
  601. const { data: r11, stride: i5 } = f9.vertexBuffer[e12];
  602. t11.vertexBuffer[e12] = { data: r11.slice(), stride: i5 };
  603. }
  604. }
  605. return e11;
  606. }
  607. static deserialize(t11) {
  608. const i5 = new f6();
  609. for (let f9 = 0; f9 < r7; ++f9) {
  610. i5.geometries[f9].indexBuffer = new Uint32Array(t11.geometries[f9].indexBuffer), i5.geometries[f9].vertexBuffer = {};
  611. for (const r10 in t11.geometries[f9].vertexBuffer)
  612. i5.geometries[f9].vertexBuffer[r10] = { data: W(t11.geometries[f9].vertexBuffer[r10].data, t11.geometries[f9].vertexBuffer[r10].stride), stride: t11.geometries[f9].vertexBuffer[r10].stride };
  613. }
  614. return i5;
  615. }
  616. serialize() {
  617. const e11 = { geometries: [{ indexBuffer: this.geometries[0].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[1].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[2].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[3].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[4].indexBuffer.buffer, vertexBuffer: {} }] };
  618. for (let f9 = 0; f9 < r7; ++f9)
  619. for (const r10 in this.geometries[f9].vertexBuffer)
  620. e11.geometries[f9].vertexBuffer[r10] = { data: this.geometries[f9].vertexBuffer[r10].data.buffer, stride: this.geometries[f9].vertexBuffer[r10].stride };
  621. return e11;
  622. }
  623. getBuffers() {
  624. const e11 = [];
  625. for (let f9 = 0; f9 < r7; ++f9) {
  626. e11.push(this.geometries[f9].indexBuffer.buffer);
  627. for (const r10 in this.geometries[f9].vertexBuffer)
  628. e11.push(this.geometries[f9].vertexBuffer[r10].data.buffer);
  629. }
  630. return e11;
  631. }
  632. };
  633. // node_modules/@arcgis/core/views/2d/engine/webgl/GraphicDisplayList.js
  634. function t6(e11, t11, n7, ...o7) {
  635. t11 < e11.length ? e11.splice(t11, n7, ...o7) : e11.push(...o7);
  636. }
  637. var n5 = class {
  638. constructor() {
  639. this.symbolLevels = [];
  640. }
  641. replay(t11, n7, o7) {
  642. for (const i5 of this.symbolLevels)
  643. for (const r10 of i5.zLevels) {
  644. const i6 = r10.geometryDPInfo.unified;
  645. if (i6)
  646. for (const r11 of i6) {
  647. const { geometryType: i7, materialKey: l8, indexFrom: s7, indexCount: m3 } = r11, y7 = U4.load(l8).symbologyType, d5 = t11.painter.getBrush(i7, y7), u5 = { geometryType: i7, materialKey: l8, indexFrom: s7, indexCount: m3, target: n7.getGeometry(i7) };
  648. d5.prepareState(t11), d5.drawGeometry(t11, n7, u5, o7);
  649. }
  650. }
  651. }
  652. get empty() {
  653. return !this.symbolLevels || 0 === this.symbolLevels.length;
  654. }
  655. clear() {
  656. this.symbolLevels.length = 0;
  657. }
  658. addToList(e11, t11) {
  659. if (Array.isArray(e11))
  660. for (const n7 of e11)
  661. this._addToList(n7, t11);
  662. else
  663. this._addToList(e11, t11);
  664. }
  665. removeFromList(e11) {
  666. Array.isArray(e11) || (e11 = [e11]);
  667. let t11 = null;
  668. for (const n7 of e11)
  669. t11 = this._removeFromList(n7);
  670. return t11;
  671. }
  672. clone() {
  673. const e11 = new n5();
  674. for (const t11 of this.symbolLevels)
  675. e11.symbolLevels.push(t11.clone());
  676. return e11;
  677. }
  678. splitAfter(e11) {
  679. const t11 = this._getDisplayList(e11.symbolLevel, e11.zOrder), n7 = t11.length, i5 = e11.indexFrom + e11.indexCount;
  680. for (let r10 = 0; r10 < n7; ++r10) {
  681. const n8 = t11[r10];
  682. if (n8.geometryType === e11.geometryType && i5 > n8.indexFrom && i5 <= n8.indexFrom + n8.indexCount) {
  683. if (i5 < n8.indexFrom + n8.indexCount) {
  684. const e12 = new o4();
  685. e12.geometryType = n8.geometryType, e12.materialKey = n8.materialKey, e12.indexFrom = i5, e12.indexCount = n8.indexFrom + n8.indexCount - i5, t11.splice(r10 + 1, 0, e12), n8.indexCount = i5 - n8.indexFrom;
  686. }
  687. return r10;
  688. }
  689. }
  690. }
  691. _addToList(e11, n7) {
  692. const i5 = e11.symbolLevel, r10 = e11.zOrder, l8 = this._getDisplayList(i5, r10), s7 = null != n7 ? n7 : l8.length - 1, m3 = s7 >= 0 && s7 < l8.length ? l8[s7] : null;
  693. if (null !== m3 && m3.materialKey === e11.materialKey && m3.indexFrom + m3.indexCount === e11.indexFrom && m3.geometryType === e11.geometryType)
  694. m3.indexCount += e11.indexCount;
  695. else {
  696. const n8 = new o4();
  697. n8.indexFrom = e11.indexFrom, n8.indexCount = e11.indexCount, n8.materialKey = e11.materialKey, n8.geometryType = e11.geometryType, t6(l8, s7 + 1, 0, n8);
  698. }
  699. }
  700. _removeFromList(e11) {
  701. const n7 = e11.symbolLevel, i5 = e11.zOrder, r10 = this._getDisplayList(n7, i5), l8 = r10.length;
  702. let s7;
  703. for (let t11 = 0; t11 < l8; ++t11) {
  704. const n8 = r10[t11];
  705. if (e11.indexFrom + e11.indexCount > n8.indexFrom && e11.indexFrom < n8.indexFrom + n8.indexCount && n8.geometryType === e11.geometryType) {
  706. s7 = t11;
  707. break;
  708. }
  709. }
  710. if (void 0 !== s7) {
  711. const n8 = r10[s7];
  712. if (e11.indexFrom === n8.indexFrom)
  713. return n8.indexCount -= e11.indexCount, n8.indexFrom += e11.indexCount, 0 === n8.indexCount && t6(r10, s7, 1), s7 - 1;
  714. if (e11.indexFrom + e11.indexCount === n8.indexFrom + n8.indexCount)
  715. return n8.indexCount -= e11.indexCount, 0 === n8.indexCount ? (t6(r10, s7, 1), s7 - 1) : s7;
  716. {
  717. const i6 = n8.indexFrom, l9 = e11.indexFrom - n8.indexFrom, m3 = e11.indexCount, y7 = n8.indexFrom + n8.indexCount - (e11.indexFrom + e11.indexCount);
  718. n8.indexCount = l9;
  719. const d5 = new o4();
  720. return d5.geometryType = n8.geometryType, d5.materialKey = n8.materialKey, d5.indexFrom = i6 + l9 + m3, d5.indexCount = y7, t6(r10, s7 + 1, 0, d5), s7;
  721. }
  722. }
  723. return null;
  724. }
  725. _getDisplayList(e11, t11) {
  726. let n7;
  727. const o7 = this.symbolLevels.length;
  728. for (let i5 = 0; i5 < o7; i5++)
  729. if (this.symbolLevels[i5].symbolLevel === e11) {
  730. n7 = this.symbolLevels[i5];
  731. break;
  732. }
  733. let s7;
  734. n7 || (n7 = new l7(), n7.symbolLevel = e11, this.symbolLevels.push(n7));
  735. const m3 = n7.zLevels.length;
  736. for (let i5 = 0; i5 < m3; i5++)
  737. if (n7.zLevels[i5].zLevel === t11) {
  738. s7 = n7.zLevels[i5];
  739. break;
  740. }
  741. return s7 || (s7 = new r8(), s7.geometryDPInfo = new i4(), s7.zLevel = t11, n7.zLevels.push(s7)), s7.geometryDPInfo.unified || (s7.geometryDPInfo.unified = []), s7.geometryDPInfo.unified;
  742. }
  743. getDPInfoType() {
  744. return "unified";
  745. }
  746. };
  747. var o4 = class {
  748. constructor() {
  749. this.materialKey = null, this.indexFrom = 0, this.indexCount = 0;
  750. }
  751. clone() {
  752. const e11 = new o4();
  753. return e11.geometryType = this.geometryType, e11.materialKey = this.materialKey, e11.indexFrom = this.indexFrom, e11.indexCount = this.indexCount, e11;
  754. }
  755. };
  756. var i4 = class {
  757. constructor() {
  758. this.fill = null, this.line = null, this.marker = null, this.text = null, this.label = null, this.unified = null;
  759. }
  760. clone() {
  761. const e11 = new i4();
  762. return e11.fill = this.fill && this.fill.map((e12) => e12.clone()), e11.line = this.line && this.line.map((e12) => e12.clone()), e11.marker = this.marker && this.marker.map((e12) => e12.clone()), e11.text = this.text && this.text.map((e12) => e12.clone()), e11.label = this.label && this.label.map((e12) => e12.clone()), e11.unified = this.unified && this.unified.map((e12) => e12.clone()), e11;
  763. }
  764. };
  765. var r8 = class {
  766. constructor() {
  767. this.geometryDPInfo = new i4();
  768. }
  769. clone() {
  770. const e11 = new r8();
  771. return e11.zLevel = this.zLevel, e11.geometryDPInfo = this.geometryDPInfo.clone(), e11;
  772. }
  773. };
  774. var l7 = class {
  775. constructor() {
  776. this.zLevels = [];
  777. }
  778. clone() {
  779. const e11 = new l7();
  780. e11.symbolLevel = this.symbolLevel;
  781. for (const t11 of this.zLevels)
  782. e11.zLevels.push(t11.clone());
  783. return e11;
  784. }
  785. };
  786. // node_modules/@arcgis/core/views/2d/engine/webgl/MeshData.js
  787. var t7 = class {
  788. constructor() {
  789. this.vertexData = /* @__PURE__ */ new Map(), this.vertexCount = 0, this.indexData = [];
  790. }
  791. clear() {
  792. this.vertexData.clear(), this.vertexCount = 0, this.indexData = [];
  793. }
  794. update(t11, e11, a4) {
  795. for (const s7 in t11)
  796. this.vertexData.set(s7, t11[s7]);
  797. for (const s7 in this.vertexData)
  798. null === t11[s7] && this.vertexData.delete(s7);
  799. this.vertexCount = e11, this.indexData = a4;
  800. }
  801. };
  802. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLDisplayRecord.js
  803. var s5 = class {
  804. constructor(t11, e11, s7, r10 = 0, i5 = 0) {
  805. this.id = t11, this.geometryType = e11, this.materialKey = s7, this.minZoom = r10, this.maxZoom = i5, this.meshData = null, this.symbolLevel = 0, this.zOrder = 0, this.vertexFrom = 0, this.vertexCount = 0, this.indexFrom = 0, this.indexCount = 0;
  806. }
  807. get sortKey() {
  808. return void 0 === this._sortKey && this._computeSortKey(), this._sortKey;
  809. }
  810. clone() {
  811. return this.copy();
  812. }
  813. copy() {
  814. const t11 = new s5(this.id, this.geometryType, this.materialKey);
  815. return t11.vertexFrom = this.vertexFrom, t11.vertexCount = this.vertexCount, t11.indexFrom = this.indexFrom, t11.indexCount = this.indexCount, t11.zOrder = this.zOrder, t11.symbolLevel = this.symbolLevel, t11.meshData = this.meshData, t11.minZoom = this.minZoom, t11.maxZoom = this.maxZoom, t11;
  816. }
  817. setMeshDataFromBuffers(s7, r10, i5) {
  818. const o7 = new t7();
  819. for (const t11 in r10) {
  820. const i6 = r10[t11].stride, a4 = r10[t11].data, h4 = [], n7 = X(i6);
  821. for (let t12 = 0; t12 < i6 * s7.vertexCount / n7; ++t12)
  822. h4[t12] = a4[t12 + i6 * s7.vertexFrom / n7];
  823. o7.vertexData.set(t11, h4);
  824. }
  825. o7.indexData.length = 0;
  826. for (let t11 = 0; t11 < s7.indexCount; ++t11)
  827. o7.indexData[t11] = i5[t11 + s7.indexFrom] - s7.vertexFrom;
  828. o7.vertexCount = s7.vertexCount, this.meshData = o7;
  829. }
  830. readMeshDataFromBuffers(s7, r10) {
  831. this.meshData ? this.meshData.clear() : this.meshData = new t7();
  832. for (const t11 in s7) {
  833. const r11 = s7[t11].stride, i5 = s7[t11].data, o7 = [], a4 = X(r11);
  834. for (let t12 = 0; t12 < r11 * this.vertexCount / a4; ++t12)
  835. o7[t12] = i5[t12 + r11 * this.vertexFrom / a4];
  836. this.meshData.vertexData.set(t11, o7);
  837. }
  838. this.meshData.indexData.length = 0;
  839. for (let t11 = 0; t11 < this.indexCount; ++t11)
  840. this.meshData.indexData[t11] = r10[t11 + this.indexFrom] - this.vertexFrom;
  841. this.meshData.vertexCount = this.vertexCount;
  842. }
  843. writeMeshDataToBuffers(t11, s7, r10, i5) {
  844. for (const o7 in s7) {
  845. const r11 = s7[o7].stride, i6 = this.meshData.vertexData.get(o7), a4 = s7[o7].data, h4 = X(r11);
  846. for (let e11 = 0; e11 < r11 * this.meshData.vertexCount / h4; ++e11)
  847. a4[e11 + r11 * t11 / h4] = i6[e11];
  848. }
  849. for (let e11 = 0; e11 < this.meshData.indexData.length; ++e11)
  850. i5[e11 + r10] = this.meshData.indexData[e11] + t11;
  851. this.vertexFrom = t11, this.vertexCount = this.meshData.vertexCount, this.indexFrom = r10, this.indexCount = this.meshData.indexData.length;
  852. }
  853. static writeAllMeshDataToBuffers(t11, e11, s7) {
  854. let r10 = 0, i5 = 0;
  855. for (const o7 of t11)
  856. o7.writeMeshDataToBuffers(r10, e11, i5, s7), r10 += o7.vertexCount, i5 += o7.indexCount;
  857. }
  858. _computeSortKey() {
  859. this._sortKey = (31 & this.symbolLevel) << 12 | (127 & this.zOrder) << 4 | 7 & this.geometryType;
  860. }
  861. serialize(t11) {
  862. return t11.push(this.geometryType), t11.push(this.materialKey), t11.push(this.vertexFrom), t11.push(this.vertexCount), t11.push(this.indexFrom), t11.push(this.indexCount), t11.push(this.minZoom), t11.push(this.maxZoom), t11;
  863. }
  864. static deserialize(t11, e11) {
  865. const r10 = t11.readInt32(), i5 = t11.readInt32(), o7 = new s5(e11.id, r10, i5);
  866. return o7.vertexFrom = t11.readInt32(), o7.vertexCount = t11.readInt32(), o7.indexFrom = t11.readInt32(), o7.indexCount = t11.readInt32(), o7.minZoom = t11.readInt32(), o7.maxZoom = t11.readInt32(), o7;
  867. }
  868. };
  869. // node_modules/@arcgis/core/views/2d/engine/webgl/util/serializationUtils.js
  870. function e8(e11, n7) {
  871. if (null !== n7) {
  872. e11.push(n7.length);
  873. for (const r10 of n7)
  874. r10.serialize(e11);
  875. return e11;
  876. }
  877. e11.push(0);
  878. }
  879. function n6(e11, n7, r10) {
  880. const t11 = e11.readInt32(), o7 = new Array(t11);
  881. for (let i5 = 0; i5 < o7.length; i5++)
  882. o7[i5] = n7.deserialize(e11, r10);
  883. return o7;
  884. }
  885. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLDisplayObject.js
  886. var e9 = class {
  887. constructor(s7) {
  888. this.insertAfter = null, this.id = s7, this.displayRecords = [];
  889. }
  890. copy() {
  891. const s7 = new e9(this.id);
  892. return s7.set(this), s7;
  893. }
  894. clone() {
  895. const s7 = new e9(this.id);
  896. return s7.displayRecords = this.displayRecords.map((s8) => s8.clone()), s7.insertAfter = this.insertAfter, s7;
  897. }
  898. set(s7) {
  899. this.id = s7.id, this.displayRecords = s7.displayRecords, this.insertAfter = s7.insertAfter;
  900. }
  901. serialize(s7) {
  902. return s7.push(this.id), e8(s7, this.displayRecords), s7;
  903. }
  904. static deserialize(i5) {
  905. const r10 = i5.readInt32(), d5 = new e9(r10), o7 = { id: r10 };
  906. return d5.displayRecords = n6(i5, s5, o7), d5;
  907. }
  908. };
  909. // node_modules/@arcgis/core/views/2d/engine/webgl/TileDisplayData.js
  910. var e10 = class {
  911. get displayObjectRegistry() {
  912. if (!this._displayObjectRegistry) {
  913. this._displayObjectRegistry = /* @__PURE__ */ new Map();
  914. for (const s7 of this.displayObjects)
  915. this._displayObjectRegistry.set(s7.id, s7);
  916. }
  917. return this._displayObjectRegistry;
  918. }
  919. get displayList() {
  920. return this._displayList;
  921. }
  922. computeDisplayList() {
  923. this._displayList = new n5();
  924. for (const s7 of this.displayObjects)
  925. for (const t11 of s7.displayRecords)
  926. this._displayList.addToList(t11);
  927. }
  928. clone() {
  929. const s7 = new e10();
  930. return this.displayObjects && (s7.displayObjects = this.displayObjects.map((s8) => s8.clone())), s7;
  931. }
  932. serialize(s7) {
  933. return e8(s7, this.displayObjects), s7;
  934. }
  935. _deserializeObjects(s7) {
  936. const i5 = s7.readInt32(), e11 = new Array(i5), a4 = /* @__PURE__ */ new Map();
  937. for (let l8 = 0; l8 < e11.length; ++l8) {
  938. const i6 = e9.deserialize(s7);
  939. e11[l8] = i6, a4.set(i6.id, i6);
  940. }
  941. this.displayObjects = e11, this._displayList = null, this._displayObjectRegistry = a4;
  942. }
  943. static deserialize(s7) {
  944. const t11 = new e10();
  945. return t11._deserializeObjects(s7), t11;
  946. }
  947. };
  948. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexBuffer.js
  949. var t8 = class {
  950. constructor(e11, t11) {
  951. this.data = e11, this.stride = t11;
  952. }
  953. static decode(r10) {
  954. const s7 = W(r10.data, r10.stride), n7 = r10.stride;
  955. return new t8(s7, n7);
  956. }
  957. static fromVertexVector(r10) {
  958. const s7 = W(r10.data.buffer(), r10.stride), n7 = r10.stride;
  959. return new t8(s7, n7);
  960. }
  961. };
  962. var r9 = class {
  963. constructor(e11, t11, r10) {
  964. this.geometryType = e11, this.indexBuffer = new Uint32Array(t11), this.namedBuffers = r10;
  965. }
  966. static decode(e11) {
  967. const s7 = e11.geometryType, n7 = e11.indexBuffer, o7 = {};
  968. for (const r10 in e11.namedBuffers)
  969. o7[r10] = t8.decode(e11.namedBuffers[r10]);
  970. return new r9(s7, n7, o7);
  971. }
  972. static fromVertexData(s7, n7) {
  973. const o7 = s7.indices, c5 = W(s7.vertices, s7.stride), i5 = s7.stride, d5 = { geometry: new t8(c5, i5) };
  974. return new r9(n7, o7, d5);
  975. }
  976. static fromVertexVectors(e11) {
  977. const s7 = e11.geometryType, n7 = e11.indexVector.buffer(), o7 = {};
  978. for (const r10 in e11.namedVectors)
  979. o7[r10] = t8.fromVertexVector(e11.namedVectors[r10]);
  980. return new r9(s7, n7, o7);
  981. }
  982. };
  983. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexVector.js
  984. var s6 = class {
  985. constructor(t11, e11) {
  986. this.data = t11, this.stride = e11;
  987. }
  988. get vertexCount() {
  989. const t11 = this.stride / 4, e11 = this.data.length / t11;
  990. return e11 !== (0 | e11) && console.debug("Corrupted stride"), e11;
  991. }
  992. transfer(t11, e11) {
  993. const r10 = this.data.buffer();
  994. t11.vertexCount = this.vertexCount, t11.data = r10, t11.stride = this.stride, e11.push(r10);
  995. }
  996. };
  997. var o5 = class {
  998. constructor(e11, o7, n7) {
  999. this.geometryType = e11, this.indexVector = new e3(Uint32Array, 6 * o7), this.namedVectors = {};
  1000. const i5 = G(e11, n7);
  1001. for (const t11 in i5) {
  1002. const e12 = i5[t11];
  1003. let n8;
  1004. switch (e12 % 4) {
  1005. case 0:
  1006. case 2:
  1007. n8 = new e3(Uint32Array, e12 * o7);
  1008. break;
  1009. case 1:
  1010. case 3:
  1011. n8 = new e3(Uint8Array, e12 * o7);
  1012. }
  1013. this.namedVectors[t11] = new s6(n8, e12);
  1014. }
  1015. }
  1016. get(t11) {
  1017. return this.namedVectors[t11].data;
  1018. }
  1019. getVector(t11) {
  1020. return this.namedVectors[t11];
  1021. }
  1022. transfer(t11, e11) {
  1023. const r10 = this.indexVector.buffer(), s7 = {};
  1024. e11.push(r10);
  1025. for (const o7 in this.namedVectors) {
  1026. const t12 = this.namedVectors[o7];
  1027. s7[o7] = {}, t12.transfer(s7[o7], e11);
  1028. }
  1029. t11.geometryType = this.geometryType, t11.indexBuffer = r10, t11.namedBuffers = s7, this.destroy();
  1030. }
  1031. intoBuffers() {
  1032. const t11 = r9.fromVertexVectors(this);
  1033. return this.destroy(), t11;
  1034. }
  1035. destroy() {
  1036. this.indexVector = null, this.namedVectors = null;
  1037. }
  1038. };
  1039. // node_modules/@arcgis/core/views/2d/engine/webgl/TileData.js
  1040. var D = new e7();
  1041. var d3 = new e7();
  1042. var p3 = 1.5;
  1043. var h3 = 5;
  1044. function x2(e11, t11) {
  1045. const r10 = {};
  1046. for (const s7 in e11) {
  1047. const i5 = { data: K(t11, e11[s7]), stride: e11[s7] };
  1048. r10[s7] = i5;
  1049. }
  1050. return r10;
  1051. }
  1052. function y4(e11) {
  1053. return [e11.fill || {}, e11.line || {}, e11.icon || {}, e11.text || {}, e11.label || {}];
  1054. }
  1055. function B(e11) {
  1056. const t11 = [[], [], [], [], []], r10 = e11;
  1057. for (const s7 of r10)
  1058. for (const e12 of s7.displayRecords)
  1059. t11[e12.geometryType].push(e12);
  1060. return t11;
  1061. }
  1062. var g4 = class {
  1063. constructor() {
  1064. this.tileDisplayData = null, this.tileBufferData = null;
  1065. }
  1066. reshuffle() {
  1067. D.reset();
  1068. const e11 = B(this.tileDisplayData.displayObjects);
  1069. for (const s7 of e11)
  1070. for (const e12 of s7)
  1071. e12 && D.needMore(e12.geometryType, e12.meshData ? e12.meshData.vertexCount : e12.vertexCount, e12.meshData ? e12.meshData.indexData.length : e12.indexCount);
  1072. const t11 = e11.length, r10 = new f6();
  1073. for (let s7 = 0; s7 < t11; ++s7) {
  1074. r10.geometries[s7].indexBuffer = new Uint32Array(Math.round(p3 * D.indicesFor(s7)));
  1075. const e12 = [];
  1076. for (const r11 in this.tileBufferData.geometries[s7].vertexBuffer)
  1077. e12.push(this.tileBufferData.geometries[s7].vertexBuffer[r11].stride);
  1078. const t12 = g4._computeVertexAlignment(e12), i5 = Math.round(p3 * D.verticesFor(s7)), a4 = g4._align(i5, t12);
  1079. for (const f9 in this.tileBufferData.geometries[s7].vertexBuffer) {
  1080. const e13 = this.tileBufferData.geometries[s7].vertexBuffer[f9].stride;
  1081. r10.geometries[s7].vertexBuffer[f9] = { stride: e13, data: K(a4, e13) };
  1082. }
  1083. }
  1084. d3.reset(), this.tileDisplayData.displayList.clear();
  1085. for (let s7 = 0; s7 < t11; ++s7) {
  1086. const t12 = e11[s7];
  1087. for (const e12 of t12) {
  1088. if (e12.meshData)
  1089. e12.writeMeshDataToBuffers(d3.verticesFor(s7), r10.geometries[s7].vertexBuffer, d3.indicesFor(s7), r10.geometries[s7].indexBuffer), e12.meshData = null;
  1090. else {
  1091. const t13 = this.tileBufferData.geometries[s7].vertexBuffer, i5 = this.tileBufferData.geometries[s7].indexBuffer, o7 = r10.geometries[s7].vertexBuffer, f9 = r10.geometries[s7].indexBuffer, n7 = d3.verticesFor(s7), l8 = d3.indicesFor(s7);
  1092. ae(n7, l8, o7, f9, e12, t13, i5), e12.vertexFrom = n7, e12.indexFrom = l8;
  1093. }
  1094. d3.needMore(s7, e12.vertexCount, e12.indexCount);
  1095. }
  1096. }
  1097. for (const s7 of this.tileDisplayData.displayObjects)
  1098. this.tileDisplayData.displayList.addToList(s7.displayRecords);
  1099. this.tileBufferData = r10;
  1100. }
  1101. getStrides() {
  1102. const e11 = [];
  1103. for (let t11 = 0; t11 < this.tileBufferData.geometries.length; ++t11) {
  1104. const r10 = this.tileBufferData.geometries[t11];
  1105. e11[t11] = {};
  1106. for (const s7 in r10.vertexBuffer)
  1107. e11[t11][s7] = r10.vertexBuffer[s7].stride;
  1108. }
  1109. return e11;
  1110. }
  1111. clone() {
  1112. const e11 = new g4();
  1113. return e11.tileBufferData = this.tileBufferData.clone(), e11.tileDisplayData = this.tileDisplayData.clone(), e11;
  1114. }
  1115. _guessSize() {
  1116. const { displayObjects: e11 } = this.tileDisplayData, t11 = Math.min(e11.length, 4), r10 = 12, s7 = 40;
  1117. let i5 = 0;
  1118. for (let o7 = 0; o7 < t11; o7++)
  1119. i5 = Math.max(i5, e11[o7].displayRecords.length);
  1120. return 2 * (e11.length * r10 + e11.length * i5 * s7);
  1121. }
  1122. serialize() {
  1123. const e11 = this.tileBufferData.serialize(), t11 = this.tileBufferData.getBuffers(), r10 = this.tileDisplayData.serialize(new e3(Int32Array, this._guessSize())).buffer();
  1124. return t11.push(r10), { result: { displayData: r10, bufferData: e11 }, transferList: t11 };
  1125. }
  1126. static fromVertexData(r10, s7) {
  1127. const i5 = {}, o7 = /* @__PURE__ */ new Map();
  1128. for (const e11 of s7)
  1129. o7.set(e11.id, e11);
  1130. return he((s8) => {
  1131. const a4 = r10.data[s8];
  1132. if (r(a4)) {
  1133. const e11 = i3.from(a4.records).getCursor();
  1134. for (; e11.next(); ) {
  1135. const t11 = e11.id, r11 = e11.materialKey, i6 = e11.indexFrom, a5 = e11.indexCount, f9 = e11.vertexFrom, l8 = e11.vertexCount, u5 = o7.get(t11), c5 = new s5(t11, s8, r11);
  1136. c5.indexFrom = i6, c5.indexCount = a5, c5.vertexFrom = f9, c5.vertexCount = l8, u5.displayRecords.push(c5);
  1137. }
  1138. i5[s8] = r9.fromVertexData(a4, s8);
  1139. } else
  1140. i5[s8] = new o5(s8, 0, S.DEFAULT).intoBuffers();
  1141. }), g4.fromMeshData({ displayObjects: s7, vertexBuffersMap: i5 });
  1142. }
  1143. static fromMeshData(e11) {
  1144. const t11 = new g4(), r10 = new e10(), o7 = new f6();
  1145. r10.displayObjects = e11.displayObjects;
  1146. for (const s7 in e11.vertexBuffersMap) {
  1147. const t12 = e11.vertexBuffersMap[s7];
  1148. o7.geometries[s7].indexBuffer = t12.indexBuffer, o7.geometries[s7].vertexBuffer = t12.namedBuffers;
  1149. }
  1150. return t11.tileDisplayData = r10, t11.tileBufferData = o7, t11;
  1151. }
  1152. static bind(e11, t11) {
  1153. const r10 = new g4();
  1154. return r10.tileDisplayData = e11, r10.tileBufferData = t11, r10;
  1155. }
  1156. static create(e11, t11) {
  1157. const r10 = new g4();
  1158. r10.tileDisplayData = new e10(), r10.tileDisplayData.displayObjects = e11;
  1159. const o7 = [0, 0, 0, 0, 0], a4 = [0, 0, 0, 0, 0], f9 = [[], [], [], [], []];
  1160. for (const s7 of e11)
  1161. for (const e12 of s7.displayRecords)
  1162. f9[e12.geometryType].push(e12), o7[e12.geometryType] += e12.meshData.vertexCount, a4[e12.geometryType] += e12.meshData.indexData.length;
  1163. const l8 = new f6(), u5 = y4(t11);
  1164. for (let s7 = 0; s7 < h3; s7++) {
  1165. const e12 = new Uint32Array(a4[s7]), t12 = x2(u5[s7], o7[s7]);
  1166. s5.writeAllMeshDataToBuffers(f9[s7], t12, e12), l8.geometries[s7] = { indexBuffer: e12, vertexBuffer: t12 };
  1167. }
  1168. return r10.tileBufferData = l8, r10;
  1169. }
  1170. static _align(e11, t11) {
  1171. const r10 = e11 % t11;
  1172. return 0 === r10 ? e11 : e11 + (t11 - r10);
  1173. }
  1174. static _computeVertexAlignment(e11) {
  1175. let t11 = false, r10 = false;
  1176. for (const s7 of e11)
  1177. s7 % 4 == 2 ? t11 = true : s7 % 4 != 0 && (r10 = true);
  1178. return r10 ? 4 : t11 ? 2 : 1;
  1179. }
  1180. };
  1181. // node_modules/@arcgis/core/views/2d/layers/features/support/GraphicsReader.js
  1182. var o6 = class extends c3 {
  1183. constructor(r10, t11, e11) {
  1184. super(r10, t11, null), this._transform = e11;
  1185. }
  1186. static from(s7, n7, i5) {
  1187. const c5 = b.createInstance(), u5 = [], a4 = s7.filter((r10) => !!r10.geometry);
  1188. for (const e11 of a4) {
  1189. const s8 = c2(e11.geometry);
  1190. et(u5, [e11], s8, false, false, n7);
  1191. }
  1192. return new o6(c5, u5, i5);
  1193. }
  1194. get geometryType() {
  1195. const r10 = this._current;
  1196. return r10 ? r10.geometryType : null;
  1197. }
  1198. get insertAfter() {
  1199. return this._current.insertAfter;
  1200. }
  1201. readGraphic() {
  1202. return this._current;
  1203. }
  1204. getCursor() {
  1205. return this.copy();
  1206. }
  1207. copy() {
  1208. const r10 = new o6(this.instance, this._features, this._transform);
  1209. return this.copyInto(r10), r10;
  1210. }
  1211. };
  1212. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicStoreItem.js
  1213. var y5 = new t2();
  1214. var g5 = new t2();
  1215. var f7 = "esriGeometryPolyline";
  1216. function d4(t11) {
  1217. t11.coords.length = 0, t11.lengths.length = 0;
  1218. }
  1219. var b2 = class {
  1220. constructor() {
  1221. this.bounds = u2(), this.graphic = null;
  1222. }
  1223. static acquire(t11 = null, e11, s7, r10, o7) {
  1224. let i5;
  1225. return 0 === b2._pool.length ? i5 = new b2() : (i5 = b2._pool.pop(), this._set.delete(i5)), i5.acquire(t11, e11, s7, r10, o7), i5;
  1226. }
  1227. static release(t11) {
  1228. t11 && !this._set.has(t11) && (t11.release(), this._pool.push(t11), this._set.add(t11));
  1229. }
  1230. static getCentroidQuantized(e11, s7) {
  1231. if (y2(e11.geometry)) {
  1232. const o7 = e11.symbol;
  1233. if (t(o7))
  1234. return null;
  1235. if ((o7 == null ? void 0 : o7.layers.length) > 0 && o7.layers.some((t11) => "text" === t11.type || "marker" === t11.type)) {
  1236. const t11 = r2(e11.geometry);
  1237. return null !== t11 ? O(s7, {}, { x: t11[0], y: t11[1] }, false, false) : null;
  1238. }
  1239. }
  1240. return null;
  1241. }
  1242. acquire(t11 = null, e11, s7, r10, o7) {
  1243. t11 && this.set(t11, e11, s7, r10, o7);
  1244. }
  1245. release() {
  1246. this.graphic = null, this.symbolResource = null, this.geometry = null;
  1247. }
  1248. get symbol() {
  1249. return this.symbolResource.symbol;
  1250. }
  1251. set(t11, e11, s7, r10, o7) {
  1252. this.graphic = t11, this.geometry = s7, this.symbolResource = e11, this.bounds = r10, o7 && (this.size = o7);
  1253. }
  1254. getGeometryQuantized(e11, r10, o7, n7) {
  1255. const c5 = this.geometry, b5 = c2(c5);
  1256. if (t(b5))
  1257. return null;
  1258. switch (b5) {
  1259. case "esriGeometryPolygon": {
  1260. const t11 = c5, { rings: s7 } = t11;
  1261. if (!s7 || 0 === s7.length)
  1262. return null;
  1263. let r11;
  1264. if (r11 = 1 === s7.length && 2 === s7[0].length ? U(e11, { paths: [[s7[0][0], s7[0][1]]] }) : U(e11, this.geometry), !r11) {
  1265. const t12 = { x: s7[0][0][0], y: s7[0][0][1] };
  1266. if (r11 = U(e11, t12), r11) {
  1267. const { x: t13, y: e12 } = r11;
  1268. return { rings: [[[t13 - 1, e12], [1, -1], [1, 1], [-1, 1], [-1, -1]]] };
  1269. }
  1270. }
  1271. return r11;
  1272. }
  1273. case "esriGeometryPolyline": {
  1274. const t11 = c5;
  1275. return d4(y5), d4(g5), C(y5, t11), ht(g5, y5, t11.hasZ, t11.hasM, f7, e11.scale[0]), at(y5, g5, t11.hasZ, t11.hasM, f7, e11), $(y5, t11.hasZ, t11.hasM);
  1276. }
  1277. case "esriGeometryMultipoint": {
  1278. const t11 = c5, i5 = 0.5 * n7 * Math.max(Math.abs(this.size[0]) + this.size[2] - this.size[0], Math.abs(this.size[1]) + this.size[3] - this.size[1]), h4 = R(o7);
  1279. let u5 = t11.points;
  1280. if (h4) {
  1281. const [t12, e12] = h4.valid, o8 = e12 - t12;
  1282. u5 = u5.filter((n8) => {
  1283. if (n8[0] + i5 > e12 || n8[0] - i5 < t12) {
  1284. const t13 = [...n8];
  1285. return n8[0] + i5 > e12 ? t13[0] -= o8 : t13[0] += o8, q(r10, n8, i5) || q(r10, t13, i5);
  1286. }
  1287. return q(r10, n8, i5);
  1288. });
  1289. }
  1290. return 0 === u5.length ? { points: u5 } : U(e11, { points: u5 });
  1291. }
  1292. }
  1293. return U(e11, this.geometry);
  1294. }
  1295. };
  1296. b2._pool = [], b2._set = /* @__PURE__ */ new Set();
  1297. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicStore.js
  1298. var g6 = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
  1299. var f8 = u2();
  1300. var _ = 1e-5;
  1301. function b3(e11, t11, r10, i5, s7) {
  1302. return g6.minX = t11, g6.minY = r10, g6.maxX = i5, g6.maxY = s7, e11.search(g6);
  1303. }
  1304. function y6(e11) {
  1305. return { minX: e11.bounds[0], minY: e11.bounds[1], maxX: e11.bounds[2], maxY: e11.bounds[3] };
  1306. }
  1307. var I2 = class {
  1308. constructor(e11, t11, r10, s7, o7, n7, h4) {
  1309. this._graphics = s7, this._onAdd = o7, this._onRemove = n7, this._hashToCIM = h4, this._index = i2(9, y6), this._itemByGraphic = /* @__PURE__ */ new Map(), this._inflatedSizeHelper = new ae2(), this._tileInfoView = e11, this._uidFieldName = r10;
  1310. const a4 = e11.getClosestInfoForScale(t11);
  1311. a4 && (this._resolution = this._tileInfoView.getTileResolution(a4.level));
  1312. }
  1313. setResourceManager(e11) {
  1314. this._cimResourceManager = e11, this._hittestDrawHelper = new V(e11);
  1315. }
  1316. hitTest(e11, t11, r10, i5, n7) {
  1317. e11 = U2(e11, this._tileInfoView.spatialReference);
  1318. const h4 = 0.5 * i5 * window.devicePixelRatio * r10;
  1319. f8[0] = e11 - h4, f8[1] = t11 - h4, f8[2] = e11 + h4, f8[3] = t11 + h4;
  1320. const u5 = 0.5 * i5 * (r10 + g3), l8 = b3(this._index, e11 - u5, t11 - u5, e11 + u5, t11 + u5);
  1321. if (!l8 || 0 === l8.length)
  1322. return [];
  1323. const c5 = [], d5 = u2(), p4 = u2();
  1324. for (const s7 of l8) {
  1325. const { geometry: e12, symbolResource: t12 } = s7;
  1326. this._getSymbolBounds(d5, t12, e12, p4, n7), p4[3] = p4[2] = p4[1] = p4[0] = 0, E(d5, f8) && s7.graphic.visible && c5.push(s7);
  1327. }
  1328. if (0 === c5.length)
  1329. return [];
  1330. const g8 = this._hittestDrawHelper, _2 = [];
  1331. for (const s7 of c5) {
  1332. const { geometry: e12, symbolResource: t12 } = s7, { hash: r11, textInfo: o7 } = t12, h5 = this._hashToCIM.get(r11);
  1333. h5 && (g8.hitTest(f8, h5.symbol, e12, o7, n7, i5) && _2.push(s7));
  1334. }
  1335. return _2.sort(z), _2.map((e12) => e12.graphic);
  1336. }
  1337. getGraphicsData(e11, t11, r10) {
  1338. const i5 = this._searchForItems(t11);
  1339. if (0 === i5.length || 0 === r10.length)
  1340. return [];
  1341. i5.sort((e12, t12) => e12.zorder - t12.zorder), i5[0].insertAfter = -1;
  1342. for (let l8 = 1; l8 < i5.length; l8++)
  1343. i5[l8].insertAfter = i5[l8 - 1].graphic.uid;
  1344. i5.sort((e12, t12) => e12.graphic.uid - t12.graphic.uid), r10.sort((e12, t12) => e12.uid - t12.uid);
  1345. let s7, o7 = 0, n7 = 0;
  1346. const h4 = t11.resolution, a4 = [], u5 = { originPosition: "upperLeft", scale: [h4, h4], translate: [t11.bounds[0], t11.bounds[3]] };
  1347. for (const l8 of r10) {
  1348. for (n7 = -2; o7 < i5.length; )
  1349. if (s7 = i5[o7], o7++, l8.uid === s7.graphic.uid) {
  1350. n7 = s7.insertAfter;
  1351. break;
  1352. }
  1353. if (!s7.geometry || -2 === n7)
  1354. continue;
  1355. const r11 = s7.getGeometryQuantized(u5, t11.bounds, this._tileInfoView.spatialReference, h4), c5 = { ...s7.graphic.attributes };
  1356. c5[this._uidFieldName] = l8.uid, null == s7.groupId && (s7.groupId = e11.createTemplateGroup(s7.symbol, null)), a4.push({ centroid: b2.getCentroidQuantized(s7, u5), geometry: r11, attributes: c5, symbol: s7.symbol, groupId: s7.groupId, insertAfter: n7, zorder: s7.zorder });
  1357. }
  1358. return a4.sort((e12, t12) => e12.zorder - t12.zorder), a4;
  1359. }
  1360. queryTileData(e11, t11) {
  1361. if (0 === this._graphics.length)
  1362. return [];
  1363. const { bounds: r10, resolution: i5 } = t11, s7 = this._searchForItems(t11), o7 = [];
  1364. return 0 === s7.length || this._createTileGraphics(o7, e11, s7, { originPosition: "upperLeft", scale: [i5, i5], translate: [r10[0], r10[3]] }, t11), o7;
  1365. }
  1366. has(e11) {
  1367. return this._itemByGraphic.has(e11);
  1368. }
  1369. getBounds(e11) {
  1370. const t11 = this._itemByGraphic.get(e11);
  1371. return t11 ? t11.bounds : null;
  1372. }
  1373. getAllBounds() {
  1374. return Array.from(this._itemByGraphic.values()).filter((e11) => e11.graphic.visible).map((e11) => e11.bounds);
  1375. }
  1376. addOrModify(r10, i5, s7) {
  1377. if (!r10 || t(i5))
  1378. return;
  1379. this.has(r10) && this.remove(r10), this._onAdd(r10);
  1380. const o7 = [0, 0, 0, 0], n7 = this._getSymbolBounds(null, i5, s7, o7, 0), h4 = b2.acquire(r10, i5, s7, r(n7) ? n7 : null, o7);
  1381. return this._itemByGraphic.set(r10, h4), s7 && this._index.insert(h4), h4.bounds;
  1382. }
  1383. remove(e11) {
  1384. if (!this._itemByGraphic.has(e11))
  1385. return;
  1386. this._onRemove(e11);
  1387. const t11 = this._itemByGraphic.get(e11);
  1388. t11.bounds && this._index.remove(t11), this._itemByGraphic.delete(e11);
  1389. }
  1390. updateZ() {
  1391. const e11 = this._graphics.items;
  1392. let t11, r10;
  1393. for (let i5 = 0; i5 < e11.length; i5++)
  1394. r10 = e11[i5], t11 = this._itemByGraphic.get(r10), t11 && (t11.zorder = i5);
  1395. }
  1396. update(e11, r10, i5) {
  1397. const s7 = this._itemByGraphic.get(e11);
  1398. s7.groupId = null;
  1399. const o7 = e2(s7.bounds);
  1400. this._index.remove(s7);
  1401. const h4 = this._getSymbolBounds(s7.bounds, r10, i5, s7.size, 0);
  1402. return r(h4) && s7.set(e11, r10, i5, h4, s7.size), i5 && this._index.insert(s7), { oldBounds: o7, newBounds: s7.bounds };
  1403. }
  1404. updateLevel(e11) {
  1405. if (this._resolution === e11)
  1406. return;
  1407. this._resolution = e11, this._index.clear();
  1408. const r10 = this._itemByGraphic, i5 = [];
  1409. for (const [s7, o7] of r10) {
  1410. const e12 = this._getSymbolBounds(o7.bounds, o7.symbolResource, o7.geometry, o7.size, 0);
  1411. o7.geometry && r(e12) && (o7.bounds = e12, i5.push(o7));
  1412. }
  1413. this._index.load(i5);
  1414. }
  1415. clear() {
  1416. this._itemByGraphic.clear(), this._index.clear();
  1417. }
  1418. _createTileGraphics(e11, t11, r10, i5, s7) {
  1419. const o7 = this._uidFieldName, n7 = this._tileInfoView.spatialReference, { bounds: h4, resolution: a4 } = s7;
  1420. let u5, l8, c5, m3;
  1421. r10.sort((e12, t12) => e12.zorder - t12.zorder);
  1422. for (let p4 = 0; p4 < r10.length; p4++) {
  1423. c5 = r10[p4], u5 = c5.graphic, l8 = c5.getGeometryQuantized(i5, h4, n7, a4), m3 = 0 === p4 ? -1 : r10[p4 - 1].graphic.uid;
  1424. const s8 = { ...c5.graphic.attributes };
  1425. s8[o7] = u5.uid, null == c5.groupId && (c5.groupId = t11.createTemplateGroup(c5.symbol, null)), e11.push({ centroid: b2.getCentroidQuantized(c5, i5), geometry: l8, attributes: s8, symbol: c5.symbol, groupId: c5.groupId, insertAfter: m3, zorder: c5.zorder });
  1426. }
  1427. }
  1428. _searchForItems(e11) {
  1429. const t11 = this._tileInfoView.spatialReference, r10 = e11.bounds;
  1430. if (t11.isWrappable) {
  1431. const [i5, o7] = R(t11).valid, n7 = Math.abs(r10[2] - o7) < _, h4 = Math.abs(r10[0] - i5) < _;
  1432. if ((!n7 || !h4) && (n7 || h4)) {
  1433. const t12 = e11.resolution;
  1434. let h5;
  1435. h5 = u2(n7 ? [i5, r10[1], i5 + t12 * g3, r10[3]] : [o7 - t12 * g3, r10[1], o7, r10[3]]);
  1436. const a4 = b3(this._index, r10[0], r10[1], r10[2], r10[3]), u5 = b3(this._index, h5[0], h5[1], h5[2], h5[3]);
  1437. return [.../* @__PURE__ */ new Set([...a4, ...u5])];
  1438. }
  1439. }
  1440. return b3(this._index, r10[0], r10[1], r10[2], r10[3]);
  1441. }
  1442. _getSymbolBounds(e11, t11, i5, o7, n7) {
  1443. if (!t11 || !t11.symbol || !i5)
  1444. return null;
  1445. if (e11 || (e11 = u2()), c(e11, i5), !o7 || 0 === o7[0] && 0 === o7[1] && 0 === o7[2] && 0 === o7[3]) {
  1446. const { hash: e12, textInfo: i6 } = t11, s7 = this._hashToCIM.get(e12);
  1447. if (!s7)
  1448. return null;
  1449. o7 || (o7 = [0, 0, 0, 0]);
  1450. const h4 = this._inflatedSizeHelper.getSymbolInflateSize(o7, s7.symbol, this._cimResourceManager, n7, i6);
  1451. o7[0] = u3(h4[0]), o7[1] = u3(h4[1]), o7[2] = u3(h4[2]), o7[3] = u3(h4[3]);
  1452. }
  1453. const a4 = this._resolution, u5 = ae2.safeSize(o7);
  1454. return e11[0] -= u5 * a4, e11[1] -= u5 * a4, e11[2] += u5 * a4, e11[3] += u5 * a4, e11;
  1455. }
  1456. };
  1457. var z = (e11, t11) => {
  1458. const r10 = y3(e11.graphic), i5 = y3(t11.graphic);
  1459. return r10 === i5 ? t11.zorder - e11.zorder : r10 - i5;
  1460. };
  1461. // node_modules/@arcgis/core/views/layers/GraphicsView.js
  1462. var t9 = (t11) => {
  1463. let p4 = class extends s2(t11) {
  1464. constructor() {
  1465. super(...arguments), this.graphics = null, this.renderer = null;
  1466. }
  1467. };
  1468. return e([y()], p4.prototype, "graphics", void 0), e([y()], p4.prototype, "renderer", void 0), e([y()], p4.prototype, "updating", void 0), e([y()], p4.prototype, "view", void 0), p4 = e([n("esri.views.layers.GraphicsView")], p4), p4;
  1469. };
  1470. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicsView2D.js
  1471. var se2 = has("esri-2d-graphic-debug");
  1472. function ie2(e11, t11, s7) {
  1473. if (s7.has(e11))
  1474. return s7.get(e11);
  1475. const i5 = { tile: t11, addedOrModified: [], removed: [] };
  1476. return s7.set(e11, i5), i5;
  1477. }
  1478. var re = class extends t9(a(m)) {
  1479. constructor(e11) {
  1480. super(e11), this._storage = new r4(), this._displayIds = /* @__PURE__ */ new Map(), this._controller = new AbortController(), this._tiles = /* @__PURE__ */ new Map(), this._graphicStoreUpdate = false, this._graphicsSet = /* @__PURE__ */ new Set(), this._matcher = Promise.resolve(null), this._tileUpdateSet = /* @__PURE__ */ new Set(), this._tilesToUpdate = /* @__PURE__ */ new Map(), this._graphicIdToAbortController = /* @__PURE__ */ new Map(), this._attached = false, this._updatingGraphicsTimer = null, this._hashToExpandedSymbol = /* @__PURE__ */ new Map(), this._hashToExpandedSymbolPromise = /* @__PURE__ */ new Map(), this._hashToCIMSymbolPromise = /* @__PURE__ */ new Map(), this._hashToCIM = /* @__PURE__ */ new Map(), this._processing = false, this._needsProcessing = false, this._pendingUpdate = { added: /* @__PURE__ */ new Set(), updated: /* @__PURE__ */ new Set(), removed: /* @__PURE__ */ new Set() }, this.lastUpdateId = -1, this.updateRequested = false, this.graphicUpdateHandler = this.graphicUpdateHandler.bind(this);
  1481. }
  1482. destroy() {
  1483. this._updatingGraphicsTimer && (clearTimeout(this._updatingGraphicsTimer), this._updatingGraphicsTimer = null, this.notifyChange("updating")), this._controller.abort(), this.container.destroy(), this._set("graphics", null), this._graphicStore.clear(), this._attributeStore = null, this._hashToExpandedSymbol.clear(), this.view = null, this.renderer = null, this._hashToCIM.clear(), this._hashToCIMSymbolPromise.clear(), this._hashToExpandedSymbolPromise.clear();
  1484. }
  1485. _createMatcher(e11, t11, s7) {
  1486. if (e11) {
  1487. const i5 = w2(e11), r10 = $2({ indexCount: 0, fields: {} }, "feature", e11, i5);
  1488. this._matcher = l5(r10, t11, null, s7);
  1489. }
  1490. }
  1491. _createDisplayId(e11) {
  1492. return this._displayIds.has(e11) || this._displayIds.set(e11, this._storage.createDisplayId()), this._displayIds.get(e11);
  1493. }
  1494. initialize() {
  1495. this._attributeStore = new v({ type: "local", initialize: (e12) => Promise.resolve(this.container.attributeView.initialize(e12)), update: (e12) => this.container.attributeView.requestUpdate(e12), render: () => this.container.requestRender() }, l6("2d"), () => this.notifyChange("updating")), this.container.hasHighlight = () => this._attributeStore.hasHighlight;
  1496. const e11 = (e12) => {
  1497. this._createDisplayId(e12.uid), this._setFilterState(e12.uid, e12.visible);
  1498. }, t11 = (e12) => {
  1499. const t12 = this._displayIds.get(e12.uid);
  1500. this._displayIds.delete(e12.uid), this._storage.releaseDisplayId(t12);
  1501. }, s7 = new x(this.container.getMaterialItems.bind(this.container), this.view.featuresTilingScheme.tileInfo);
  1502. this._graphicStore = new I2(this.view.featuresTilingScheme, this.view.state.scale, this.uid, this.graphics, e11, t11, this._hashToCIM), this._meshFactory = new l4(null, this.uid, s7), this._templateStore = s7, this.handles.add([l(() => this.renderer, (e12) => {
  1503. this._createMatcher(e12, s7, this.container.stage.resourceManager);
  1504. for (const t12 of this.graphics)
  1505. this._pendingUpdate.updated.add(t12);
  1506. this.requestUpdate();
  1507. }), this.view.graphicsTileStore.on("update", this._onTileUpdate.bind(this)), this.container.on("attach", () => {
  1508. se2 && this.container.enableRenderingBounds(() => this._graphicStore.getAllBounds()), this.graphics.items.length > 0 && this._graphicsChangeHandler({ target: this.graphics, added: this.graphics.items, removed: [], moved: [] }), this.handles.add(this.graphics.on("change", (e13) => this._graphicsChangeHandler(e13)), "graphics");
  1509. const e12 = this.container.stage.resourceManager;
  1510. this._createMatcher(this.renderer, s7, e12), this._graphicStore.setResourceManager(e12), this._attached = true, this.notifyChange("updating");
  1511. })]);
  1512. const i5 = this.view.graphicsTileStore.tiles;
  1513. this._onTileUpdate({ added: i5, removed: [] });
  1514. }
  1515. get updating() {
  1516. return !this._attached || null !== this._updatingGraphicsTimer || this._tileUpdateSet.size > 0 || this._tilesToUpdate.size > 0 || this._attributeStore.isUpdating();
  1517. }
  1518. hitTest(e11) {
  1519. if (!this.view || !this.view.position)
  1520. return [];
  1521. const { resolution: t11, rotation: s7 } = this.view.state;
  1522. return this._graphicStore.hitTest(e11.x, e11.y, 2, t11, s7);
  1523. }
  1524. update(e11) {
  1525. f(this._controller.signal);
  1526. const t11 = e11.state, { resolution: s7 } = t11;
  1527. if (this._graphicStore.updateLevel(s7), this._graphicStoreUpdate = true, this.updateRequested = false, this._pendingUpdate.updated.size > 0) {
  1528. if (!this._processing)
  1529. return void this._updateGraphics();
  1530. this._needsProcessing = true;
  1531. }
  1532. }
  1533. viewChange() {
  1534. this.requestUpdate();
  1535. }
  1536. requestUpdate() {
  1537. this.updateRequested || (this.updateRequested = true, this.requestUpdateCallback());
  1538. }
  1539. processUpdate(e11) {
  1540. this.updateRequested && (this.updateRequested = false, this.update(e11));
  1541. }
  1542. graphicUpdateHandler(e11) {
  1543. const { graphic: t11, property: s7 } = e11;
  1544. switch (s7) {
  1545. case "attributes":
  1546. case "geometry":
  1547. case "symbol":
  1548. this._pendingUpdate.updated.add(t11), this.requestUpdate();
  1549. break;
  1550. case "visible":
  1551. this._setFilterState(t11.uid, t11.visible), this._attributeStore.sendUpdates();
  1552. }
  1553. }
  1554. setHighlight(e11) {
  1555. const t11 = e11.map((e12) => this._displayIds.get(e12));
  1556. this._attributeStore.setHighlight(e11, t11);
  1557. }
  1558. _getIntersectingTiles(e11) {
  1559. const t11 = this._graphicStore.getBounds(e11);
  1560. if (!t11 || 0 === s3(t11) || 0 === l3(t11))
  1561. return [];
  1562. const s7 = p2(t11, this.view.spatialReference);
  1563. return r(s7) ? [.../* @__PURE__ */ new Set([...this.view.graphicsTileStore.boundsIntersections(s7[0]), ...this.view.graphicsTileStore.boundsIntersections(s7[1])])] : this.view.graphicsTileStore.boundsIntersections(t11);
  1564. }
  1565. async _updateTile(e11) {
  1566. f(this._controller.signal);
  1567. const t11 = e11.tile, s7 = this._getGraphicsData(this._templateStore, t11, e11.addedOrModified), i5 = await this._processGraphics(t11, s7);
  1568. return f(this._controller.signal), this._patchTile(t11.key, { type: "update", addOrUpdate: i5, remove: e11.removed, end: true, clear: false, sort: false }), i5;
  1569. }
  1570. _patchTile(e11, t11) {
  1571. if (!this._tiles.has(e11))
  1572. return;
  1573. const s7 = this._tiles.get(e11);
  1574. this.container.onTileData(s7, t11), this.container.requestRender();
  1575. }
  1576. _graphicsChangeHandler(e11) {
  1577. const t11 = this._pendingUpdate;
  1578. for (const s7 of e11.added)
  1579. t11.added.add(s7);
  1580. for (const s7 of e11.moved)
  1581. t11.updated.add(s7);
  1582. for (const s7 of e11.removed)
  1583. this._pendingUpdate.added.has(s7) ? t11.added.delete(s7) : t11.removed.add(s7);
  1584. this._processing ? this._needsProcessing = true : this._updateGraphics();
  1585. }
  1586. _getGraphicsToUpdate() {
  1587. const e11 = { added: [], removed: [], updated: [] };
  1588. if (!this.graphics)
  1589. return e11;
  1590. const t11 = this._pendingUpdate;
  1591. for (const s7 of this.graphics.items)
  1592. t11.added.has(s7) ? e11.added.push(s7) : t11.updated.has(s7) && e11.updated.push(s7);
  1593. for (const s7 of t11.removed)
  1594. this._graphicStore.has(s7) && e11.removed.push(s7);
  1595. return t11.added.clear(), t11.removed.clear(), t11.updated.clear(), e11;
  1596. }
  1597. async _updateGraphics() {
  1598. this._processing = true;
  1599. const { added: e11, removed: t11, updated: s7 } = this._getGraphicsToUpdate(), i5 = this._tilesToUpdate;
  1600. let r10;
  1601. try {
  1602. if (!this._graphicStoreUpdate) {
  1603. const e12 = this.view.state, { resolution: t12 } = e12;
  1604. this._graphicStore.updateLevel(t12);
  1605. }
  1606. const o7 = [], a4 = new Array(e11.length + t11.length);
  1607. for (let e12 = 0; e12 < s7.length; e12++) {
  1608. const t12 = s7[e12], h5 = this._getIntersectingTiles(t12);
  1609. for (const e13 of h5) {
  1610. r10 = e13.id;
  1611. ie2(r10, e13, i5).removed.push(this._displayIds.get(t12.uid));
  1612. }
  1613. o7.push(this._updateGraphic(t12, null)), a4[e12] = t12;
  1614. }
  1615. const h4 = s7.length;
  1616. for (let t12 = 0; t12 < e11.length; t12++) {
  1617. const s8 = e11[t12];
  1618. a4[h4 + t12] = s8, this._graphicsSet.add(s8), o7.push(this._addGraphic(s8));
  1619. }
  1620. for (const e12 of t11) {
  1621. this._abortProcessingGraphic(e12.uid);
  1622. const t12 = this._getIntersectingTiles(e12);
  1623. for (const s8 of t12) {
  1624. r10 = s8.id;
  1625. ie2(r10, s8, i5).removed.push(this._displayIds.get(e12.uid));
  1626. }
  1627. this._graphicsSet.delete(e12), this._graphicStore.remove(e12);
  1628. }
  1629. let n7;
  1630. this._flipUpdatingGraphics(), await Promise.all(o7);
  1631. for (let e12 = 0; e12 < a4.length; e12++) {
  1632. n7 = a4[e12];
  1633. const t12 = this._getIntersectingTiles(n7);
  1634. for (const e13 of t12) {
  1635. r10 = e13.id;
  1636. ie2(r10, e13, i5).addedOrModified.push(n7);
  1637. }
  1638. }
  1639. this._graphicStore.updateZ();
  1640. const l8 = [];
  1641. for (const [e12, t12] of i5)
  1642. l8.push(this._updateTile(t12));
  1643. await Promise.all(l8);
  1644. } catch (o7) {
  1645. j(o7), 0;
  1646. }
  1647. for (const a4 of t11)
  1648. try {
  1649. const e12 = await this._getSymbolForGraphic(a4, null);
  1650. if (e12) {
  1651. const t12 = e12.hash();
  1652. this._hashToExpandedSymbol.delete(t12);
  1653. }
  1654. } catch (o7) {
  1655. j(o7), 0;
  1656. }
  1657. i5.clear(), this.notifyChange("updating"), this._processing = false, this._needsProcessing && (this._needsProcessing = false, this._updateGraphics());
  1658. }
  1659. _getArcadeInfo(e11) {
  1660. const t11 = (e11.attributes ? Object.keys(e11.attributes) : []).map((t12) => ({ name: t12, alias: t12, type: "string" == typeof e11.attributes[t12] ? "esriFieldTypeString" : "esriFieldTypeDouble" }));
  1661. return t(e11.geometry) ? null : { geometryType: c2(e11.geometry), spatialReference: k.fromJSON(e11.geometry.spatialReference), fields: t11 };
  1662. }
  1663. _getSymbolForGraphic(e11, t11) {
  1664. return f(this._controller.signal), r(e11.symbol) ? Promise.resolve(e11.symbol) : r(this.renderer) ? this.renderer.getSymbolAsync(e11, { scale: this.view.scale, signal: r(t11) ? t11.signal : null }) : Promise.resolve(this._getNullSymbol(e11));
  1665. }
  1666. _getCIMSymbol(e11, t11, s7) {
  1667. let i5 = this._hashToCIM.get(t11);
  1668. if (i5)
  1669. return Promise.resolve(i5);
  1670. const o7 = Q(e11);
  1671. if (r(o7)) {
  1672. if ("CIMSymbolReference" === o7.type)
  1673. return i5 = o7, this._hashToCIM.set(t11, i5), Promise.resolve(i5);
  1674. let e12 = this._hashToCIMSymbolPromise.get(t11);
  1675. return e12 || (e12 = o7.fetchCIMSymbol(s7).then((e13) => (this._hashToCIM.set(t11, e13.data), this._hashToCIMSymbolPromise.delete(t11), e13)).catch((e13) => (this._hashToCIMSymbolPromise.delete(t11), w(e13), null)), this._hashToCIMSymbolPromise.set(t11, e12), e12);
  1676. }
  1677. return Promise.resolve(null);
  1678. }
  1679. _expandCIMSymbol(e11, t11, s7, i5) {
  1680. const r10 = this._hashToExpandedSymbol.get(s7);
  1681. if (r10)
  1682. return Promise.resolve(r10);
  1683. let o7 = this._hashToExpandedSymbolPromise.get(s7);
  1684. if (o7)
  1685. return o7;
  1686. const a4 = this.container.stage, h4 = this._getArcadeInfo(t11), n7 = w2(null), l8 = o(e11, n7);
  1687. return o7 = n3(l8, h4, a4.resourceManager, i5), this._hashToExpandedSymbolPromise.set(s7, o7), o7.then((e12) => (this._hashToExpandedSymbol.set(s7, e12), this._hashToExpandedSymbolPromise.delete(s7), e12)), o7;
  1688. }
  1689. async _getSymbolResources(e11, t11) {
  1690. f(this._controller.signal);
  1691. return this.container.stage ? this._getSymbolForGraphic(e11, t11).then((i5) => {
  1692. const r10 = i5.hash();
  1693. return this._getCIMSymbol(i5, r10, t11).then((i6) => t(i6) ? null : this._expandCIMSymbol(i6, e11, r10, t11).then((e12) => {
  1694. const t12 = e12.layers.filter((e13) => "text" === e13.type && "string" == typeof e13.text);
  1695. if (t12 && t12.length > 0) {
  1696. const i7 = new Array(t12.length);
  1697. for (let e13 = 0; e13 < t12.length; e13++) {
  1698. const r11 = t12[e13], o8 = [], [a4] = n2(r11.text);
  1699. r11.text = a4;
  1700. for (let e14 = 0; e14 < a4.length; e14++)
  1701. o8.push(a4.charCodeAt(e14));
  1702. i7[e13] = { symbol: r11, id: e13, glyphIds: o8 };
  1703. }
  1704. const o7 = /* @__PURE__ */ new Map();
  1705. return this.container.getMaterialItems(i7).then((s7) => {
  1706. for (let e13 = 0; e13 < t12.length; e13++) {
  1707. const i8 = t12[e13];
  1708. o7.set(i8.cim, { text: i8.text, mosaicItem: s7[e13].mosaicItem });
  1709. }
  1710. return { symbol: e12, textInfo: o7, hash: r10 };
  1711. });
  1712. }
  1713. return { symbol: e12, hash: r10 };
  1714. }));
  1715. }).catch((e12) => (w(e12), null)) : null;
  1716. }
  1717. async _projectAndNormalizeGeometry(e11, t11) {
  1718. if (f(this._controller.signal), t(e11.geometry) || "mesh" === e11.geometry.type)
  1719. return null;
  1720. let s7 = e11.geometry;
  1721. if (y2(s7)) {
  1722. const e12 = s7.rings;
  1723. s7.rings = e12;
  1724. } else if (f2(s7)) {
  1725. const e12 = s7.paths;
  1726. s7.paths = e12;
  1727. } else if (u(s7)) {
  1728. const i6 = await this._getSymbolForGraphic(e11, t11);
  1729. if (f(this._controller.signal), h2(i6.type) || u4(i6.type)) {
  1730. s7 = s7.center;
  1731. } else
  1732. s7 = d(s7);
  1733. }
  1734. await f3(s7.spatialReference, this.view.spatialReference);
  1735. const i5 = p(s7), r10 = g2(i5, s7.spatialReference, this.view.spatialReference);
  1736. return r10 && g(r10), r10;
  1737. }
  1738. _onTileUpdate(e11) {
  1739. const t11 = R(this.view.spatialReference);
  1740. if (e11.added && e11.added.length > 0)
  1741. for (const s7 of e11.added)
  1742. this._addNewTile(s7, t11);
  1743. if (e11.removed && e11.removed.length > 0)
  1744. for (const s7 of e11.removed)
  1745. this._removeTile(s7.key);
  1746. }
  1747. async _addGraphic(e11) {
  1748. this._abortProcessingGraphic(e11.uid), f(this._controller.signal);
  1749. const t11 = new AbortController();
  1750. this._graphicIdToAbortController.set(e11.uid, t11);
  1751. const s7 = { signal: t11.signal };
  1752. try {
  1753. await this._addOrUpdateGraphic(e11, s7), f(this._controller.signal), this._graphicIdToAbortController.delete(e11.uid);
  1754. } catch (i5) {
  1755. if (this._graphicIdToAbortController.delete(e11.uid), !j(i5))
  1756. throw i5;
  1757. }
  1758. }
  1759. _updateGraphic(e11, t11) {
  1760. f(this._controller.signal);
  1761. const s7 = this._projectAndNormalizeGeometry(e11, t11), i5 = this._getSymbolResources(e11, t11);
  1762. return Promise.all([s7, i5]).then(([t12, s8]) => {
  1763. f(this._controller.signal), this._graphicStore.addOrModify(e11, s8, t12);
  1764. });
  1765. }
  1766. _addOrUpdateGraphic(e11, t11) {
  1767. f(this._controller.signal);
  1768. const s7 = this._projectAndNormalizeGeometry(e11, t11), i5 = this._getSymbolResources(e11, t11);
  1769. return Promise.all([s7, i5]).then(([t12, s8]) => {
  1770. f(this._controller.signal), this._graphicsSet.has(e11) && this._graphicStore.addOrModify(e11, s8, t12);
  1771. });
  1772. }
  1773. _addTile(e11) {
  1774. const t11 = this.view.featuresTilingScheme.getTileBounds(u2(), e11), s7 = this.view.featuresTilingScheme.getTileResolution(e11.level), i5 = new a3(e11, s7, t11[0], t11[3]);
  1775. return this._tiles.set(e11, i5), this.container.addChild(i5), i5;
  1776. }
  1777. async _addNewTile(e11, t11) {
  1778. const s7 = this._addTile(e11.key), i5 = this._graphicStore.queryTileData(this._templateStore, e11);
  1779. if (0 === i5.length)
  1780. return;
  1781. if (t11) {
  1782. const s8 = Math.round((t11.valid[1] - t11.valid[0]) / e11.resolution);
  1783. for (const e12 of i5)
  1784. e12.geometry && (s(e12.geometry) || l2(e12.geometry)) && this._wrapPoints(e12, s8);
  1785. }
  1786. const r10 = e11.key;
  1787. this._tileUpdateSet.add(e11.key), this.notifyChange("updating");
  1788. try {
  1789. const t12 = { type: "update", clear: false, addOrUpdate: await this._processGraphics(e11, i5), remove: [], end: true, sort: false };
  1790. s7.patch(t12), this._tileUpdateSet.delete(r10), this.notifyChange("updating");
  1791. } catch (o7) {
  1792. if (this._tileUpdateSet.delete(r10), this.notifyChange("updating"), !j(o7))
  1793. throw o7;
  1794. }
  1795. }
  1796. _removeTile(e11) {
  1797. if (!this._tiles.has(e11))
  1798. return;
  1799. const t11 = this._tiles.get(e11);
  1800. this.container.removeChild(t11), t11.destroy(), this._tiles.delete(e11);
  1801. }
  1802. _setFilterState(e11, t11) {
  1803. const s7 = this._displayIds.get(e11), i5 = this._attributeStore.getHighlightFlag(e11);
  1804. this._attributeStore.setData(s7, 0, 0, i5 | (t11 ? U3 : 0));
  1805. }
  1806. _getGraphicsData(e11, t11, s7) {
  1807. const i5 = this.view, r10 = R(i5.spatialReference), o7 = this._graphicStore.getGraphicsData(e11, t11, s7);
  1808. if (r10) {
  1809. const e12 = Math.round((r10.valid[1] - r10.valid[0]) / t11.resolution);
  1810. for (const t12 of o7)
  1811. t12.geometry && (s(t12.geometry) || l2(t12.geometry)) && this._wrapPoints(t12, e12);
  1812. }
  1813. return o7;
  1814. }
  1815. _wrapPoints(e11, t11) {
  1816. const s7 = e11.geometry;
  1817. l2(s7) ? this._wrapMultipoint(s7, t11) : this._wrapPoint(e11, t11);
  1818. }
  1819. _wrapMultipoint(e11, t11) {
  1820. const s7 = e11.points, i5 = [];
  1821. let r10 = 0, o7 = 0;
  1822. for (const [a4, h4] of s7) {
  1823. if (i5.push([a4 + r10, h4]), r10 = 0, t11 === c4) {
  1824. const e12 = 5 * g3;
  1825. a4 + o7 < e12 ? (i5.push([t11, 0]), r10 = -t11) : a4 + o7 > c4 - e12 && (i5.push([-t11, 0]), r10 = t11);
  1826. } else
  1827. a4 + o7 < -g3 ? (i5.push([t11, 0]), r10 = -t11) : a4 + o7 > c4 + g3 && (i5.push([-t11, 0]), r10 = t11);
  1828. o7 += a4;
  1829. }
  1830. e11.points = i5;
  1831. }
  1832. _wrapPoint(e11, t11) {
  1833. const s7 = e11.geometry;
  1834. if (t11 === c4) {
  1835. const i5 = 5 * g3;
  1836. s7.x < i5 ? e11.geometry = { points: [[s7.x, s7.y], [t11, 0]] } : s7.x > c4 - i5 && (e11.geometry = { points: [[s7.x, s7.y], [-t11, 0]] });
  1837. } else
  1838. s7.x < -g3 ? e11.geometry = { points: [[s7.x, s7.y], [t11, 0]] } : s7.x > c4 + g3 && (e11.geometry = { points: [[s7.x, s7.y], [-t11, 0]] });
  1839. }
  1840. _processGraphics(e11, t11, s7) {
  1841. if (!(t11 && t11.length) || !this._meshFactory)
  1842. return null;
  1843. const i5 = o6.from(t11, this.uid, e11.transform), r10 = this._meshFactory;
  1844. return this._matcher.then((t12) => r10.analyzeGraphics(i5, this.container.stage.resourceManager, t12, null, null, s7).then(() => (this._attributeStore.sendUpdates(), this._processAnalyzedGraphics(e11, i5))));
  1845. }
  1846. _processAnalyzedGraphics(e11, t11) {
  1847. const s7 = this._meshFactory, i5 = t11.getSize(), r10 = t11.getCursor(), o7 = { features: i5, records: i5, metrics: 0 }, a4 = new E3(e11.key.id, o7, S.DEFAULT, false, false), h4 = [];
  1848. for (; r10.next(); ) {
  1849. const t12 = r10.readGraphic();
  1850. t12.insertAfter = -1 === t12.insertAfter ? -1 : this._displayIds.get(t12.insertAfter), t12.displayId = this._displayIds.get(t12.attributes[this.uid]);
  1851. const i6 = new e9(t12.displayId);
  1852. i6.insertAfter = t12.insertAfter, h4.push(i6), s7.writeGraphic(a4, r10, e11.level, this.container.stage.resourceManager);
  1853. }
  1854. const n7 = e11.tileInfoView.tileInfo.isWrappable, l8 = a4.serialize(n7);
  1855. if (1 !== l8.length)
  1856. return new g4();
  1857. const d5 = l8[0].message;
  1858. return g4.fromVertexData(d5, h4);
  1859. }
  1860. _abortProcessingGraphic(e11) {
  1861. if (this._graphicIdToAbortController.has(e11)) {
  1862. this._graphicIdToAbortController.get(e11).abort();
  1863. }
  1864. }
  1865. _getNullSymbol(e11) {
  1866. const t11 = e11.geometry;
  1867. return f2(t11) ? O2 : y2(t11) || u(t11) ? j2 : N;
  1868. }
  1869. _flipUpdatingGraphics() {
  1870. this._updatingGraphicsTimer && clearTimeout(this._updatingGraphicsTimer), this._updatingGraphicsTimer = setTimeout(() => {
  1871. this._updatingGraphicsTimer = null, this.notifyChange("updating");
  1872. }, 160), this.notifyChange("updating");
  1873. }
  1874. };
  1875. e([y({ constructOnly: true })], re.prototype, "requestUpdateCallback", void 0), e([y()], re.prototype, "container", void 0), e([y({ constructOnly: true })], re.prototype, "graphics", void 0), e([y()], re.prototype, "updating", null), e([y()], re.prototype, "view", void 0), e([y()], re.prototype, "updateRequested", void 0), re = e([n("esri.views.2d.layers.support.GraphicsView2D")], re);
  1876. var oe = re;
  1877. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicBoundsRenderer.js
  1878. var g7 = Math.PI / 180;
  1879. var v2 = 4;
  1880. var x3 = class extends r6 {
  1881. constructor(t11) {
  1882. super(), this._dvsMat3 = e4(), this._localOrigin = { x: 0, y: 0 }, this._getBounds = t11;
  1883. }
  1884. destroy() {
  1885. this._vao && (this._vao.dispose(true), this._vao = null, this._vertexBuffer = null, this._indexBuffer = null), this._program && (this._program.dispose(), this._program = null);
  1886. }
  1887. doRender(t11) {
  1888. const { context: e11 } = t11, s7 = this._getBounds();
  1889. if (s7.length < 1)
  1890. return;
  1891. this._createShaderProgram(e11), this._updateMatricesAndLocalOrigin(t11), this._updateBufferData(e11, s7), e11.setBlendingEnabled(true), e11.setDepthTestEnabled(false), e11.setStencilWriteMask(0), e11.setStencilTestEnabled(false), e11.setBlendFunction(R2.ONE, R2.ONE_MINUS_SRC_ALPHA), e11.setColorMask(true, true, true, true);
  1892. const r10 = this._program;
  1893. e11.bindVAO(this._vao), e11.useProgram(r10), r10.setUniformMatrix3fv("u_dvsMat3", this._dvsMat3), e11.gl.lineWidth(1), e11.drawElements(E2.LINES, 8 * s7.length, C2.UNSIGNED_INT, 0), e11.bindVAO();
  1894. }
  1895. _createTransforms() {
  1896. return { dvs: e4() };
  1897. }
  1898. _createShaderProgram(t11) {
  1899. if (this._program)
  1900. return;
  1901. const e11 = "precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }", s7 = "precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";
  1902. this._program = t11.programCache.acquire(e11, s7, b4().attributes);
  1903. }
  1904. _updateMatricesAndLocalOrigin(o7) {
  1905. const { state: l8 } = o7, { displayMat3: u5, size: c5, resolution: _2, pixelRatio: h4, rotation: m3, viewpoint: d5 } = l8, p4 = g7 * m3, { x: v3, y: x4 } = d5.targetGeometry, b5 = U2(v3, l8.spatialReference);
  1906. this._localOrigin.x = b5, this._localOrigin.y = x4;
  1907. const y7 = h4 * c5[0], B2 = h4 * c5[1], M2 = _2 * y7, A = _2 * B2, O3 = r3(this._dvsMat3);
  1908. i(O3, O3, u5), M(O3, O3, t3(y7 / 2, B2 / 2)), f4(O3, O3, r5(c5[0] / M2, -B2 / A, 1)), h(O3, O3, -p4);
  1909. }
  1910. _updateBufferData(t11, e11) {
  1911. const { x: s7, y: r10 } = this._localOrigin, i5 = 2 * v2 * e11.length, o7 = new Float32Array(i5), a4 = new Uint32Array(8 * e11.length);
  1912. let n7 = 0, f9 = 0;
  1913. for (const l8 of e11)
  1914. l8 && (o7[2 * n7 + 0] = l8[0] - s7, o7[2 * n7 + 1] = l8[1] - r10, o7[2 * n7 + 2] = l8[0] - s7, o7[2 * n7 + 3] = l8[3] - r10, o7[2 * n7 + 4] = l8[2] - s7, o7[2 * n7 + 5] = l8[3] - r10, o7[2 * n7 + 6] = l8[2] - s7, o7[2 * n7 + 7] = l8[1] - r10, a4[f9 + 0] = n7 + 0, a4[f9 + 1] = n7 + 3, a4[f9 + 2] = n7 + 3, a4[f9 + 3] = n7 + 2, a4[f9 + 4] = n7 + 2, a4[f9 + 5] = n7 + 1, a4[f9 + 6] = n7 + 1, a4[f9 + 7] = n7 + 0, n7 += 4, f9 += 8);
  1915. if (this._vertexBuffer ? this._vertexBuffer.setData(o7.buffer) : this._vertexBuffer = E4.createVertex(t11, F.DYNAMIC_DRAW, o7.buffer), this._indexBuffer ? this._indexBuffer.setData(a4) : this._indexBuffer = E4.createIndex(t11, F.DYNAMIC_DRAW, a4), !this._vao) {
  1916. const e12 = b4();
  1917. this._vao = new a2(t11, e12.attributes, e12.bufferLayouts, { geometry: this._vertexBuffer }, this._indexBuffer);
  1918. }
  1919. }
  1920. };
  1921. var b4 = () => ge("bounds", { geometry: [{ location: 0, name: "a_position", count: 2, type: C2.FLOAT }] });
  1922. // node_modules/@arcgis/core/views/2d/layers/graphics/BaseGraphicContainer.js
  1923. var t10 = class extends o2 {
  1924. constructor(e11) {
  1925. super(e11), this.hasHighlight = () => true;
  1926. }
  1927. destroy() {
  1928. super.destroy(), this._boundsRenderer && (this._boundsRenderer.destroy(), this._boundsRenderer = null);
  1929. }
  1930. enableRenderingBounds(e11) {
  1931. this._boundsRenderer = new x3(e11), this.requestRender();
  1932. }
  1933. get hasLabels() {
  1934. return false;
  1935. }
  1936. onTileData(e11, s7) {
  1937. e11.patch(s7), this.contains(e11) || this.addChild(e11), this.requestRender();
  1938. }
  1939. onTileError(e11) {
  1940. e11.clear(), this.contains(e11) || this.addChild(e11);
  1941. }
  1942. _renderChildren(e11, s7) {
  1943. for (const t11 of this.children)
  1944. t11.isReady && t11.hasData && (t11.commit(e11), e11.context.setStencilFunction(I.EQUAL, t11.stencilRef, 255), t11._displayList.replay(e11, t11, s7));
  1945. }
  1946. };
  1947. export {
  1948. oe,
  1949. t10 as t
  1950. };
  1951. //# sourceMappingURL=chunk-DTSCAH2R.js.map