SymbolTileRenderer-4VQTMK6G.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. import {
  2. a as a2,
  3. e as e2,
  4. i as i2
  5. } from "./chunk-267VUXDM.js";
  6. import {
  7. i as i3,
  8. m,
  9. o as o2
  10. } from "./chunk-DXEPL3XQ.js";
  11. import {
  12. o as o3
  13. } from "./chunk-IZWQMKDT.js";
  14. import "./chunk-E5TKVDJT.js";
  15. import {
  16. n as n4
  17. } from "./chunk-WOGDHLUJ.js";
  18. import {
  19. n3
  20. } from "./chunk-264YGWEE.js";
  21. import "./chunk-ZLQP3WDC.js";
  22. import "./chunk-JBMHQ5RK.js";
  23. import {
  24. E as E2,
  25. a
  26. } from "./chunk-WBWQJQK4.js";
  27. import "./chunk-TDS6IBMU.js";
  28. import "./chunk-DBT4KOKX.js";
  29. import "./chunk-2GP5D74I.js";
  30. import {
  31. f as f2
  32. } from "./chunk-O7E4VYJT.js";
  33. import "./chunk-AIG57VB7.js";
  34. import {
  35. s as s2
  36. } from "./chunk-22KBQSDB.js";
  37. import "./chunk-EPMXCACW.js";
  38. import "./chunk-UWKVAZQ6.js";
  39. import "./chunk-XBFCIW4K.js";
  40. import {
  41. he
  42. } from "./chunk-T2SKWJGU.js";
  43. import "./chunk-UO3LS2M5.js";
  44. import "./chunk-H2VOWDMO.js";
  45. import "./chunk-QISOH77W.js";
  46. import "./chunk-XO5VJRK4.js";
  47. import "./chunk-3WXSWAUV.js";
  48. import "./chunk-27YO3FKC.js";
  49. import {
  50. E,
  51. I
  52. } from "./chunk-EQNT4A7P.js";
  53. import "./chunk-4OM3EX6P.js";
  54. import {
  55. F
  56. } from "./chunk-3OFVLRSL.js";
  57. import "./chunk-YFDOPEEZ.js";
  58. import "./chunk-IQBIGNPU.js";
  59. import "./chunk-K7B6OWCU.js";
  60. import {
  61. n as n2
  62. } from "./chunk-JEA4MMTV.js";
  63. import "./chunk-RG3AHHRL.js";
  64. import "./chunk-UDYHZLTE.js";
  65. import "./chunk-RWQH5X3O.js";
  66. import "./chunk-6334AFGG.js";
  67. import "./chunk-TFHLTN6F.js";
  68. import "./chunk-O3JQY77G.js";
  69. import "./chunk-E3G7BRZB.js";
  70. import "./chunk-JKFWEHNK.js";
  71. import "./chunk-EDHROVWI.js";
  72. import "./chunk-3IRT3YKJ.js";
  73. import "./chunk-YZVAB3DF.js";
  74. import "./chunk-PJNBFKPF.js";
  75. import "./chunk-C7742RNZ.js";
  76. import "./chunk-TJV6ODRM.js";
  77. import "./chunk-3LVSQLWJ.js";
  78. import "./chunk-3WQOA5CB.js";
  79. import "./chunk-FZQZIM7U.js";
  80. import "./chunk-CZBRZ6SU.js";
  81. import "./chunk-VGWC3IKZ.js";
  82. import {
  83. u
  84. } from "./chunk-2H5MD622.js";
  85. import "./chunk-3RSFVUKZ.js";
  86. import "./chunk-UVVU4UUO.js";
  87. import "./chunk-X4SA4ELJ.js";
  88. import "./chunk-ZYRIJWLX.js";
  89. import "./chunk-RYY6632W.js";
  90. import "./chunk-DW42UVIT.js";
  91. import "./chunk-YAEIHDJH.js";
  92. import "./chunk-TJNOJH33.js";
  93. import "./chunk-OSHI574D.js";
  94. import "./chunk-RMDDCMKS.js";
  95. import "./chunk-VCH45Q2I.js";
  96. import "./chunk-IM3LVQXV.js";
  97. import "./chunk-HZRKBTHJ.js";
  98. import "./chunk-6T6G6LCQ.js";
  99. import "./chunk-YEJL5NEF.js";
  100. import "./chunk-PQFTYGF5.js";
  101. import {
  102. e,
  103. n5 as n
  104. } from "./chunk-2Z2TG5CU.js";
  105. import "./chunk-6KZ2LTDA.js";
  106. import "./chunk-U2XHEJM7.js";
  107. import "./chunk-SQOPWYIT.js";
  108. import {
  109. D,
  110. j
  111. } from "./chunk-V6P2MAQQ.js";
  112. import "./chunk-E5O6P5I2.js";
  113. import {
  114. has
  115. } from "./chunk-SPWQ3AWG.js";
  116. import "./chunk-2TIUKVZN.js";
  117. import {
  118. f,
  119. i,
  120. o,
  121. r,
  122. s,
  123. t
  124. } from "./chunk-YXWMMD76.js";
  125. import "./chunk-S5KM4IGW.js";
  126. // node_modules/@arcgis/core/views/2d/engine/webgl/collisions/MetricReader.js
  127. var e3 = 6;
  128. var r2 = 4294967296;
  129. var o4 = class {
  130. constructor(t2) {
  131. this._savedCursor = null, this._savedOffset = null, this._head = t2, this._cursor = t2;
  132. }
  133. static from(t2) {
  134. const s3 = i4.from(new Float32Array(t2));
  135. return new o4(s3);
  136. }
  137. get id() {
  138. return this._cursor.id;
  139. }
  140. get baseZoom() {
  141. return this._cursor.baseZoom;
  142. }
  143. get anchorX() {
  144. return this._cursor.anchorX;
  145. }
  146. get anchorY() {
  147. return this._cursor.anchorY;
  148. }
  149. get directionX() {
  150. return this._cursor.directionX;
  151. }
  152. get directionY() {
  153. return this._cursor.directionY;
  154. }
  155. get size() {
  156. return this._cursor.size;
  157. }
  158. get materialKey() {
  159. return this._cursor.materialKey;
  160. }
  161. get boundsCount() {
  162. return this._cursor.boundsCount;
  163. }
  164. computedMinZoom() {
  165. return this._cursor.computedMinZoom();
  166. }
  167. setComputedMinZoom(t2) {
  168. return this._cursor.setComputedMinZoom(t2);
  169. }
  170. boundsComputedAnchorX(t2) {
  171. return this._cursor.boundsComputedAnchorX(t2);
  172. }
  173. boundsComputedAnchorY(t2) {
  174. return this._cursor.boundsComputedAnchorY(t2);
  175. }
  176. setBoundsComputedAnchorX(t2, s3) {
  177. return this._cursor.setBoundsComputedAnchorX(t2, s3);
  178. }
  179. setBoundsComputedAnchorY(t2, s3) {
  180. return this._cursor.setBoundsComputedAnchorY(t2, s3);
  181. }
  182. boundsX(t2) {
  183. return this._cursor.boundsX(t2);
  184. }
  185. boundsY(t2) {
  186. return this._cursor.boundsY(t2);
  187. }
  188. boundsWidth(t2) {
  189. return this._cursor.boundsWidth(t2);
  190. }
  191. boundsHeight(t2) {
  192. return this._cursor.boundsHeight(t2);
  193. }
  194. link(s3) {
  195. if (r(s3._head))
  196. return this._cursor.link(s3._head);
  197. }
  198. getCursor() {
  199. return this.copy();
  200. }
  201. copy() {
  202. var _a;
  203. const t2 = new o4((_a = this._head) == null ? void 0 : _a.copy());
  204. if (!t2._head)
  205. return t2;
  206. let s3 = t2._head, e4 = t2._head._link;
  207. for (; e4; )
  208. s3._link = e4.copy(), s3 = e4, e4 = s3._link;
  209. return t2;
  210. }
  211. peekId() {
  212. var _a;
  213. return (_a = this._cursor.peekId()) != null ? _a : this._cursor._link.peekId();
  214. }
  215. nextId() {
  216. const t2 = this.id;
  217. for (; t2 === this.id; )
  218. if (!this.next())
  219. return false;
  220. return true;
  221. }
  222. save() {
  223. this._savedCursor = this._cursor, this._savedOffset = this._cursor._offset;
  224. }
  225. restore() {
  226. this._savedCursor && (this._cursor = this._savedCursor), null != this._savedOffset && (this._cursor._offset = this._savedOffset);
  227. }
  228. next() {
  229. if (!this._cursor)
  230. return false;
  231. if (!this._cursor.next()) {
  232. if (!this._cursor._link)
  233. return false;
  234. this._cursor = this._cursor._link, this._cursor._offset = 0;
  235. }
  236. return true;
  237. }
  238. lookup(t2) {
  239. for (this._cursor = this._head; this._cursor && !this._cursor.lookup(t2); ) {
  240. if (!this._cursor._link)
  241. return false;
  242. this._cursor = this._cursor._link;
  243. }
  244. return !!this._cursor;
  245. }
  246. delete(s3) {
  247. let e4 = this._head, r4 = null;
  248. for (; e4; ) {
  249. if (e4.delete(s3))
  250. return e4.isEmpty() && r(r4) && (r4._link = e4._link), true;
  251. r4 = e4, e4 = e4._link;
  252. }
  253. return false;
  254. }
  255. };
  256. var i4 = class {
  257. constructor(t2) {
  258. this._offset = -1, this._link = null, this._count = 0, this._deletedCount = 0, this._offsets = { instance: null }, this._buffer = t2;
  259. }
  260. static from(t2) {
  261. return new i4(new Float32Array(t2));
  262. }
  263. isEmpty() {
  264. return this._deletedCount === this.count;
  265. }
  266. get count() {
  267. return this._count || (this._count = this._computeCount()), this._count;
  268. }
  269. get id() {
  270. return this._buffer[this._offset + 0];
  271. }
  272. set id(t2) {
  273. this._buffer[this._offset + 0] = t2;
  274. }
  275. get baseZoom() {
  276. return this._buffer[this._offset + 1];
  277. }
  278. get anchorX() {
  279. return this._buffer[this._offset + 2];
  280. }
  281. get anchorY() {
  282. return this._buffer[this._offset + 3];
  283. }
  284. get directionX() {
  285. return this._buffer[this._offset + 4];
  286. }
  287. get directionY() {
  288. return this._buffer[this._offset + 5];
  289. }
  290. get size() {
  291. return this._buffer[this._offset + 6];
  292. }
  293. get materialKey() {
  294. return this._buffer[this._offset + 7];
  295. }
  296. computedMinZoom() {
  297. return this._buffer[this._offset + 8];
  298. }
  299. setComputedMinZoom(t2) {
  300. this._buffer[this._offset + 8] = t2;
  301. }
  302. get boundsCount() {
  303. return this._buffer[this._offset + 9];
  304. }
  305. boundsComputedAnchorX(t2) {
  306. return this._buffer[this._offset + 10 + t2 * e3 + 0];
  307. }
  308. boundsComputedAnchorY(t2) {
  309. return this._buffer[this._offset + 10 + t2 * e3 + 1];
  310. }
  311. setBoundsComputedAnchorX(t2, s3) {
  312. this._buffer[this._offset + 10 + t2 * e3 + 0] = s3;
  313. }
  314. setBoundsComputedAnchorY(t2, s3) {
  315. this._buffer[this._offset + 10 + t2 * e3 + 1] = s3;
  316. }
  317. boundsX(t2) {
  318. return this._buffer[this._offset + 10 + t2 * e3 + 2];
  319. }
  320. boundsY(t2) {
  321. return this._buffer[this._offset + 10 + t2 * e3 + 3];
  322. }
  323. boundsWidth(t2) {
  324. return this._buffer[this._offset + 10 + t2 * e3 + 4];
  325. }
  326. boundsHeight(t2) {
  327. return this._buffer[this._offset + 10 + t2 * e3 + 5];
  328. }
  329. link(t2) {
  330. let s3 = this;
  331. for (; s3._link; )
  332. s3 = s3._link;
  333. s3._link = t2;
  334. }
  335. getCursor() {
  336. return this.copy();
  337. }
  338. copy() {
  339. const t2 = new i4(this._buffer);
  340. return t2._link = this._link, t2._offset = this._offset, t2._deletedCount = this._deletedCount, t2._offsets = this._offsets, t2._count = this._count, t2;
  341. }
  342. peekId() {
  343. const t2 = this._offset + 10 + this.boundsCount * e3 + 0;
  344. return t2 >= this._buffer.length ? 0 : this._buffer[t2];
  345. }
  346. next() {
  347. let t2 = 0;
  348. for (; this._offset < this._buffer.length && t2++ < 100 && (-1 === this._offset ? this._offset = 0 : this._offset += 10 + this.boundsCount * e3, this.id === r2); )
  349. ;
  350. return this.id !== r2 && this._offset < this._buffer.length;
  351. }
  352. delete(t2) {
  353. const s3 = this._offset, e4 = this.lookup(t2);
  354. if (e4)
  355. for (this.id = 4294967295, ++this._deletedCount; this.next() && this.id === t2; )
  356. this.id = 4294967295, ++this._deletedCount;
  357. return this._offset = s3, e4;
  358. }
  359. lookup(t2) {
  360. const e4 = this._offset;
  361. if (t(this._offsets.instance)) {
  362. this._offsets.instance = /* @__PURE__ */ new Map();
  363. const t3 = this.copy();
  364. t3._offset = -1;
  365. let s3 = 0;
  366. for (; t3.next(); )
  367. t3.id !== s3 && (this._offsets.instance.set(t3.id, t3._offset), s3 = t3.id);
  368. }
  369. return !!this._offsets.instance.has(t2) && (this._offset = this._offsets.instance.get(t2), this.id !== r2 || (this._offset = e4, false));
  370. }
  371. _computeCount() {
  372. const t2 = this._offset;
  373. let s3 = 0;
  374. for (this._offset = -1; this.next(); )
  375. s3++;
  376. return this._offset = t2, s3;
  377. }
  378. };
  379. // node_modules/@arcgis/core/views/2d/engine/webgl/FeatureDisplayList.js
  380. var n5 = class {
  381. constructor(t2, e4, i5, n6, a6) {
  382. this.target = t2, this.geometryType = e4, this.materialKey = i5, this.indexFrom = n6, this.indexCount = a6;
  383. }
  384. get indexEnd() {
  385. return this.indexFrom + this.indexCount;
  386. }
  387. extend(t2) {
  388. this.indexCount += t2;
  389. }
  390. };
  391. var a3 = class {
  392. constructor(t2, e4) {
  393. this.geometryType = 0, this._target = t2, this.geometryType = e4;
  394. }
  395. static from(e4, i5, n6, d2) {
  396. const r4 = new a3(e4, i5);
  397. if (r(d2))
  398. for (const t2 of d2)
  399. n6.seekIndex(t2), r4.addRecord(n6);
  400. else
  401. for (; n6.next(); )
  402. r4.addRecord(n6);
  403. return r4;
  404. }
  405. addRecord(t2) {
  406. const a6 = this._target, d2 = this.geometryType, r4 = t2.materialKey;
  407. let s3 = t2.indexFrom, o5 = t2.indexCount;
  408. const h2 = t2.vertexFrom, x = t2.vertexCount;
  409. if (o5 || (s3 = h2, o5 = x), t(this._head)) {
  410. const t3 = new n5(a6, d2, r4, s3, o5);
  411. return void (this._head = new a2(t3));
  412. }
  413. let m2 = null, c3 = this._head;
  414. for (; c3; ) {
  415. if (s3 < c3.data.indexFrom)
  416. return this._insert(r4, s3, o5, m2, c3);
  417. m2 = c3, c3 = c3.next;
  418. }
  419. this._insert(r4, s3, o5, m2, null);
  420. }
  421. forEach(e4) {
  422. r(this._head) && this._head.forEach(e4);
  423. }
  424. *infos() {
  425. if (r(this._head))
  426. for (const t2 of this._head.values())
  427. yield t2;
  428. }
  429. _insert(a6, d2, r4, s3, o5) {
  430. if (t(s3) && t(o5)) {
  431. const t2 = new n5(this._target, this.geometryType, a6, d2, r4);
  432. this._head = new a2(t2);
  433. }
  434. return t(s3) && r(o5) ? this._insertAtHead(a6, d2, r4, o5) : r(s3) && t(o5) ? this._insertAtEnd(a6, d2, r4, s3) : r(s3) && r(o5) ? this._insertAtMiddle(a6, d2, r4, s3, o5) : void 0;
  435. }
  436. _insertAtHead(t2, e4, a6, d2) {
  437. const r4 = e4 + a6;
  438. if (t2 === d2.data.materialKey && r4 === d2.data.indexFrom)
  439. d2.data.indexFrom = e4, d2.data.indexCount += a6;
  440. else {
  441. const r5 = new n5(this._target, this.geometryType, t2, e4, a6);
  442. this._head = new a2(r5), this._head.next = d2;
  443. }
  444. }
  445. _insertAtEnd(t2, e4, a6, d2) {
  446. if (d2.data.materialKey === t2 && d2.data.indexEnd === e4)
  447. d2.data.indexCount += a6;
  448. else {
  449. const r4 = new n5(this._target, this.geometryType, t2, e4, a6), s3 = new a2(r4);
  450. d2.next = s3;
  451. }
  452. }
  453. _insertAtMiddle(t2, e4, a6, d2, r4) {
  454. const s3 = e4 + a6;
  455. if (d2.data.materialKey === t2 && d2.data.indexEnd === e4)
  456. d2.data.indexCount += a6, d2.data.materialKey === r4.data.materialKey && d2.data.indexEnd === r4.data.indexFrom && (d2.data.indexCount += r4.data.indexCount, d2.next = r4.next);
  457. else if (t2 === r4.data.materialKey && s3 === r4.data.indexFrom)
  458. r4.data.indexFrom = e4, r4.data.indexCount += a6;
  459. else {
  460. const s4 = new n5(this._target, this.geometryType, t2, e4, a6), o5 = new a2(s4);
  461. d2.next = o5, o5.next = r4;
  462. }
  463. }
  464. };
  465. // node_modules/@arcgis/core/views/2d/engine/webgl/cpuMapped/Buffer.js
  466. var a4 = 1.25;
  467. var u2 = 32767;
  468. var d = u2 << 16 | u2;
  469. var f3 = class {
  470. constructor(t2, i5, e4, s3) {
  471. const h2 = i2.create(i5 * e4 * Uint32Array.BYTES_PER_ELEMENT, s3);
  472. this.size = i5, this.strideInt = e4, this.bufferType = t2, this.dirty = { start: 1 / 0, end: 0 }, this._gpu = null, this._cpu = h2, this.clear();
  473. }
  474. get elementSize() {
  475. return this._cpu.length / this.strideInt;
  476. }
  477. get invalidated() {
  478. return this.bufferSize && !this._gpu;
  479. }
  480. get invalidatedComputeBuffer() {
  481. return this.bufferSize && !this._gpuComputeTriangles;
  482. }
  483. invalidate() {
  484. this._invalidateTriangleBuffer(), o(this._gpu, (t2) => t2.dispose()), this._gpu = null;
  485. }
  486. _invalidateTriangleBuffer() {
  487. o(this._gpuComputeTriangles, (t2) => t2.dispose()), this._gpuComputeTriangles = null;
  488. }
  489. destroy() {
  490. o(this._gpu, (t2) => t2.dispose()), o(this._gpuComputeTriangles, (t2) => t2.dispose()), o(this._cpu, (t2) => t2.destroy()), o(this._cpu2, (t2) => t2.destroy());
  491. }
  492. clear() {
  493. this.dirty.start = 1 / 0, this.dirty.end = 0, this.freeList = new e2({ start: 0, end: this._cpu.length / this.strideInt }), this.fillPointer = 0;
  494. }
  495. ensure(t2) {
  496. if (this.maxAvailableSpace() >= t2)
  497. return;
  498. if (t2 * this.strideInt > this._cpu.length - this.fillPointer) {
  499. this.invalidate();
  500. const i5 = this._cpu.length / this.strideInt, e4 = Math.round((i5 + t2) * a4), r4 = e4 * this.strideInt;
  501. this._cpu.expand(r4 * Uint32Array.BYTES_PER_ELEMENT), this.freeList.free(i5, e4 - i5);
  502. }
  503. }
  504. set(t2, i5) {
  505. this._cpu.array[t2] !== i5 && (this._cpu.array[t2] = i5, this.dirty.start = Math.min(t2, this.dirty.start), this.dirty.end = Math.max(t2, this.dirty.end));
  506. }
  507. getGPUBuffer(t2, e4 = false) {
  508. if (!this.bufferSize)
  509. return null;
  510. if (e4) {
  511. if ("index" !== this.bufferType)
  512. throw new Error("Tired to get triangle buffer, but target is not an index buffer");
  513. return t(this._gpuComputeTriangles) && (this._gpuComputeTriangles = this._createComputeBuffer(t2)), this._gpuComputeTriangles;
  514. }
  515. return t(this._gpu) && (this._gpu = this._createBuffer(t2)), this._gpu;
  516. }
  517. getCPUBuffer() {
  518. if (!this._cpu2) {
  519. const t2 = this._cpu.slice();
  520. this._cpu2 = t2;
  521. }
  522. return this._cpu2.length !== this._cpu.length && this._cpu2.expand(this._cpu.length * this._cpu.array.BYTES_PER_ELEMENT), this._cpu2.set(this._cpu), this._cpu2;
  523. }
  524. get bufferSize() {
  525. return this._cpu.length / this.strideInt;
  526. }
  527. maxAvailableSpace() {
  528. return this.freeList.maxAvailableSpace();
  529. }
  530. insert(t2, i5, r4, s3) {
  531. const h2 = r4 * this.strideInt;
  532. if (!h2)
  533. return 0;
  534. const n6 = i5 * this.strideInt * Uint32Array.BYTES_PER_ELEMENT, a6 = new Uint32Array(t2, n6, h2), u6 = f(this.freeList.firstFit(r4), "First fit region must be defined") * this.strideInt, d2 = h2, f4 = u6 / this.strideInt - i5;
  535. if (0 !== s3)
  536. for (let e4 = 0; e4 < a6.length; e4++)
  537. a6[e4] += s3;
  538. return this._cpu.array.set(a6, u6), this.dirty.start = Math.min(this.dirty.start, u6), this.dirty.end = Math.max(this.dirty.end, u6 + d2), this.fillPointer = Math.max(this.fillPointer, u6 + d2), f4;
  539. }
  540. free(t2, i5, e4) {
  541. const r4 = t2 * this.strideInt, s3 = (t2 + i5) * this.strideInt;
  542. if (true === e4)
  543. for (let h2 = t2; h2 !== t2 + i5; h2++)
  544. this._cpu.array[h2 * this.strideInt] = d;
  545. this.dirty.start = Math.min(this.dirty.start, r4), this.dirty.end = Math.max(this.dirty.end, s3), this.freeList.free(t2, i5);
  546. }
  547. upload() {
  548. if (this.dirty.end) {
  549. if (this._invalidateTriangleBuffer(), t(this._gpu))
  550. return this.dirty.start = 1 / 0, void (this.dirty.end = 0);
  551. this._gpu.setSubData(this._cpu.array, this.dirty.start, this.dirty.start, this.dirty.end), this.dirty.start = 1 / 0, this.dirty.end = 0;
  552. }
  553. }
  554. _createBuffer(t2) {
  555. const i5 = F.DYNAMIC_DRAW;
  556. return "index" === this.bufferType ? E2.createIndex(t2, i5, this._cpu.array) : E2.createVertex(t2, i5, this._cpu.array);
  557. }
  558. _createComputeBuffer(t2) {
  559. const i5 = F.DYNAMIC_DRAW, e4 = new Uint32Array(this.fillPointer / 3);
  560. for (let r4 = 0; r4 < this.fillPointer; r4 += 3)
  561. e4[r4 / 3] = this._cpu.array[r4];
  562. return E2.createIndex(t2, i5, e4);
  563. }
  564. };
  565. // node_modules/@arcgis/core/views/2d/engine/webgl/cpuMapped/Geometry.js
  566. var h = 0;
  567. var u3 = 1;
  568. var c = class {
  569. constructor(e4, t2) {
  570. this._vaos = /* @__PURE__ */ new Map(), this._indicesInvalid = false, this.geometryType = e4, this._stage = t2;
  571. }
  572. destroy() {
  573. for (const [t2, r4] of this._vaos)
  574. r(r4) && r4.dispose(false);
  575. this._indexBuffer = s(this._indexBuffer), this._vertexBuffer = s(this._vertexBuffer);
  576. }
  577. insert(e4, t2, i5) {
  578. if (!e4.records.byteLength)
  579. return;
  580. const s3 = e4.stride;
  581. if (this._vertexBuffer && this._indexBuffer) {
  582. const i6 = e4.indices.byteLength / 4, f4 = e4.vertices.byteLength / s3;
  583. this._indexBuffer.ensure(i6), this._vertexBuffer.ensure(f4);
  584. const { vertices: n6, indices: d2 } = e4, h2 = i3.from(e4.records), u6 = this._vertexBuffer.insert(n6, 0, n6.byteLength / s3, 0), c3 = this._indexBuffer.insert(d2, 0, d2.byteLength / 4, u6);
  585. if (h2.forEach((e5) => {
  586. e5.indexFrom += c3, e5.vertexFrom += u6;
  587. }), f(this._records, "Expected records to be defined").link(h2), t2)
  588. this._indicesInvalid = true;
  589. else if (this._displayList) {
  590. const e5 = h2.getCursor();
  591. for (; e5.next(); )
  592. this._displayList.addRecord(e5);
  593. }
  594. } else {
  595. const r4 = e4.indices.byteLength / 4, i6 = e4.vertices.byteLength / s3, f4 = s3 / Uint32Array.BYTES_PER_ELEMENT, d2 = this._stage.bufferPool;
  596. this._records = i3.from(e4.records), this._indexBuffer = new f3("index", r4, 1, d2), this._vertexBuffer = new f3("vertex", i6, f4, d2), this._indexBuffer.insert(e4.indices, 0, e4.indices.byteLength / 4, 0), this._vertexBuffer.insert(e4.vertices, 0, e4.vertices.byteLength / s3, 0), t2 && (this._indicesInvalid = true);
  597. }
  598. }
  599. remove(e4) {
  600. if (!t(this._records))
  601. for (const t2 of e4) {
  602. const e5 = this._records.getCursor();
  603. if (!e5.lookup(t2))
  604. continue;
  605. const r4 = e5.indexFrom, i5 = e5.vertexFrom;
  606. let s3 = e5.indexCount, f4 = e5.vertexCount;
  607. for (; e5.next() && e5.id === t2; )
  608. s3 += e5.indexCount, f4 += e5.vertexCount;
  609. this._indexBuffer.free(r4, s3), this._vertexBuffer.free(i5, f4, true), this._records.delete(t2);
  610. }
  611. }
  612. getVAO(e4, t2, r4, f4) {
  613. if (!this._vertexBuffer || !this._indexBuffer || t(this._records) || !this._vertexBuffer.bufferSize)
  614. return null;
  615. const n6 = f4 ? u3 : h;
  616. let o5 = this._vaos.get(n6);
  617. (this._vertexBuffer.invalidated || this._indexBuffer.invalidated || f4 && this._indexBuffer.invalidatedComputeBuffer) && (o(o5, (e5) => e5.dispose(false)), o5 = null), this._vertexBuffer.upload(), this._indexBuffer.upload();
  618. const c3 = this._indexBuffer.getGPUBuffer(e4, 1 === n6), _2 = this._vertexBuffer.getGPUBuffer(e4);
  619. return o5 || (o5 = new a(e4, r4, t2, { geometry: _2 }, c3), this._vaos.set(n6, o5)), o5;
  620. }
  621. forEachCommand(e4) {
  622. if (!t(this._records)) {
  623. if (this._sortIndices(this._records), !this._displayList) {
  624. const e5 = this._cursorIndexOrder;
  625. this._displayList = a3.from(this, this.geometryType, this._records.getCursor(), e5);
  626. }
  627. this._displayList.forEach(e4);
  628. }
  629. }
  630. _sortIndices(e4) {
  631. const t2 = !!this._indexBuffer.bufferSize;
  632. if (!this._indicesInvalid)
  633. return;
  634. this._indicesInvalid = false;
  635. let r4 = 0;
  636. const i5 = e4.getCursor(), s3 = [], f4 = [], n6 = [];
  637. for (; i5.next(); )
  638. f4.push(i5.index), n6.push(i5.sortKey), s3.push(i5.id);
  639. f4.sort((e5, t3) => {
  640. const r5 = n6[t3], i6 = n6[e5];
  641. return i6 === r5 ? s3[t3] - s3[e5] : r5 - i6;
  642. });
  643. const o5 = e4.getCursor(), d2 = t2 ? this._indexBuffer.getCPUBuffer() : this._vertexBuffer.getCPUBuffer();
  644. for (const h2 of f4) {
  645. if (!o5.seekIndex(h2))
  646. throw new Error("Expected to find index");
  647. if (t2) {
  648. const { indexFrom: e5, indexCount: t3 } = o5;
  649. o5.indexFrom = r4;
  650. for (let i6 = 0; i6 < t3; i6++)
  651. this._indexBuffer.set(r4++, d2.array[e5 + i6]);
  652. } else {
  653. const { vertexFrom: e5, vertexCount: t3 } = o5, i6 = this._vertexBuffer.strideInt, s4 = e5 * i6, f5 = s4 + t3 * i6;
  654. o5.vertexFrom = r4 / i6;
  655. for (let n7 = s4; n7 < f5; n7++)
  656. this._vertexBuffer.set(r4++, d2.array[n7]);
  657. }
  658. }
  659. this._cursorIndexOrder = f4, this._displayList = null;
  660. }
  661. };
  662. // node_modules/@arcgis/core/views/2d/engine/webgl/FeatureTile.js
  663. var c2 = 50;
  664. var u4 = 4;
  665. var _ = 100;
  666. var p = 0;
  667. var l = class extends m {
  668. constructor(t2, r4, s3, a6, n6, h2) {
  669. super(t2, r4, s3, a6), this.instanceId = p++, this.patchCount = 0, this._renderState = { current: { geometry: /* @__PURE__ */ new Map(), metrics: null }, next: null, swap: false, swapFrames: 0, locked: false }, this._patches = new s2(_), this._bufferPatches = new s2(_), this._lastCommitTime = 0, this.transforms.labelMat2d = n2(), this._store = n6, this._requestLabelUpdate = h2;
  670. }
  671. destroy() {
  672. super.destroy(), this._renderState.current.geometry.forEach((e4) => e4.destroy()), r(this._renderState.next) && this._renderState.next.geometry.forEach((e4) => e4.destroy()), this._renderState.current = null, this._renderState.next = null;
  673. }
  674. get labelMetrics() {
  675. return this._renderState.current.metrics;
  676. }
  677. get hasData() {
  678. return !!this._renderState.current.geometry.size;
  679. }
  680. getGeometry(e4) {
  681. return this._renderState.current.geometry.get(e4);
  682. }
  683. patch(e4, t2) {
  684. this.patchCount++, e4.clear && this._patches.size >= c2 && this._dropPatches();
  685. const r4 = e4, s3 = r4.addOrUpdate && this.key.id !== r4.addOrUpdate.tileKeyOrigin;
  686. t2 && s3 ? this._bufferPatches.enqueue(r4) : (r4.sort = r4.sort && !t2, this._patches.enqueue(r4)), this.requestRender();
  687. }
  688. commit(e4) {
  689. if (this._lastCommitTime !== e4.time) {
  690. this._lastCommitTime = e4.time;
  691. for (let e5 = 0; e5 < u4; e5++)
  692. this._updateMesh(), this.isReady && this._updateBufferMesh();
  693. this._renderState.swap && (this._swapRenderStates(), this.requestRender());
  694. }
  695. }
  696. lock() {
  697. this._renderState.locked = true;
  698. }
  699. unlock() {
  700. this._renderState.locked = false, this._flushUpdates(), this._swap();
  701. }
  702. _swapRenderStates() {
  703. if (this._renderState.next) {
  704. if (this._renderState.locked)
  705. return this._renderState.swap = true, void this.requestRender();
  706. this._renderState.swap = true, this._swap();
  707. }
  708. }
  709. _swap() {
  710. this._renderState.swap && (this._renderState.swap = false, r(this._renderState.next) && (this._renderState.current.geometry.forEach((e4) => e4.destroy()), this._renderState.current = this._renderState.next, this._renderState.next = null, this._requestLabelUpdate()));
  711. }
  712. _flushUpdates() {
  713. let e4 = this._patches.maxSize;
  714. for (; this._patches.size && e4--; )
  715. this._updateMesh(), this._swap();
  716. }
  717. _updateBufferMesh() {
  718. const e4 = this._bufferPatches.peek();
  719. if (!r(e4) || !e4.clear || null === this._renderState.next)
  720. for (; this._bufferPatches.size; ) {
  721. const e5 = this._bufferPatches.dequeue();
  722. r(e5) && this._patchBuffer(e5);
  723. }
  724. }
  725. _updateMesh() {
  726. var _a, _b, _c, _d;
  727. const e4 = this._patches.dequeue();
  728. if (r(e4)) {
  729. if (has("esri-2d-update-debug")) {
  730. const t2 = e4, r4 = (_a = t2.addOrUpdate) == null ? void 0 : _a.tileKeyOrigin, s3 = this.key.id === r4 ? "SELF" : r4;
  731. let i5 = "";
  732. for (let e5 = 0; e5 < 5; e5++)
  733. i5 += ((_d = (_c = (_b = t2.addOrUpdate) == null ? void 0 : _b.data[e5]) == null ? void 0 : _c.records) == null ? void 0 : _d.byteLength) ? 1 : 0;
  734. console.debug(this.key.id, "FeatureTile:patch", `[clear: ${t2.clear} origin: ${s3}, end:${t2.end} data:${i5}]`);
  735. }
  736. true === e4.clear && (r(this._renderState.next) && (this._renderState.next.geometry.forEach((e5) => e5.destroy()), this._renderState.next = null), this._renderState.next = { geometry: /* @__PURE__ */ new Map(), metrics: null }, has("esri-2d-update-debug") && console.debug(this.key.id, "FeatureTile:_updateMesh - Creating new renderState")), this.requestRender(), this._patch(e4), e4.end && (has("esri-2d-update-debug") && console.debug(this.key.id, "FeatureTile:_updateMesh - Encountered end message"), this.ready(), this._swapRenderStates());
  737. }
  738. }
  739. _patch(e4) {
  740. he((t2) => {
  741. this._remove(t2, e4.remove), this._insert(t2, e4, false);
  742. });
  743. }
  744. _patchBuffer(e4) {
  745. he((t2) => {
  746. this._insert(t2, e4, true);
  747. });
  748. }
  749. _insert(e4, t2, i5) {
  750. var _a;
  751. try {
  752. const n6 = i(this._renderState.next, this._renderState.current), h2 = (_a = t2.addOrUpdate) == null ? void 0 : _a.data[e4], d2 = n6.geometry;
  753. if (t(h2))
  754. return;
  755. d2.has(e4) || (has("esri-2d-update-debug") && console.debug(this.key.id, `FeatureTile:_insert - Creating geometry buffer ${e4}`), d2.set(e4, new c(e4, this.stage))), has("esri-2d-update-debug") && console.debug(this.key.id, `FeatureTile:_insert - Inserting into ${e4}, version=${t2.addOrUpdate.version} stride=${h2.stride}`), d2.get(e4).insert(h2, t2.sort, i5), e4 === E.LABEL && this._insertLabelMetrics(t2.type, h2.metrics, t2.clear);
  756. } catch (n6) {
  757. }
  758. }
  759. _insertLabelMetrics(e4, t2, i5) {
  760. const a6 = i(this._renderState.next, this._renderState.current);
  761. if (t(t2))
  762. return;
  763. const n6 = o4.from(t2);
  764. if (t(a6.metrics))
  765. a6.metrics = n6;
  766. else {
  767. if ("update" === e4) {
  768. const e5 = n6.getCursor();
  769. for (; e5.next(); )
  770. a6.metrics.delete(e5.id);
  771. }
  772. a6.metrics.link(n6);
  773. }
  774. }
  775. _remove(e4, t2) {
  776. const s3 = i(this._renderState.next, this._renderState.current).geometry.get(e4);
  777. t2 && t2.length && s3 && (s3.remove(t2), this._removeLabelMetrics(t2));
  778. }
  779. _removeLabelMetrics(e4) {
  780. const { metrics: t2 } = i(this._renderState.next, this._renderState.current);
  781. if (!t(t2) && e4.length)
  782. for (const r4 of e4)
  783. for (; t2.delete(r4); )
  784. ;
  785. }
  786. _dropPatches() {
  787. const e4 = new Array();
  788. let t2 = false;
  789. for (; this._patches.size; ) {
  790. const r4 = this._patches.dequeue();
  791. if (t(r4))
  792. break;
  793. if (r4.clear) {
  794. if (t2)
  795. break;
  796. t2 = true;
  797. }
  798. e4.push(r4);
  799. }
  800. this._patches.clear(), e4.forEach((e5) => this._patches.enqueue(e5));
  801. }
  802. };
  803. // node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js
  804. var r3 = has("featurelayer-order-by-server-enabled");
  805. var a5 = class extends o2 {
  806. constructor(e4, t2, s3, i5) {
  807. super(e4), this._hitTestsRequests = [], this._layer = s3, this._layerView = t2, this._onUpdate = i5;
  808. }
  809. renderChildren(e4) {
  810. if (this.attributeView.update(), this.hasAnimation) {
  811. e4.painter.effects.integrate.draw(e4, e4.attributeView);
  812. }
  813. super.renderChildren(e4);
  814. }
  815. hasEmptyAttributeView() {
  816. return this.attributeView.isEmpty();
  817. }
  818. isUpdating() {
  819. return this.attributeView.isUpdating();
  820. }
  821. hitTest(t2) {
  822. let s3 = this._hitTestsRequests.find(({ x: e4, y: s4 }) => e4 === t2.x && s4 === t2.y);
  823. const i5 = D();
  824. return s3 ? s3.resolvers.push(i5) : (s3 = { x: t2.x, y: t2.y, resolvers: [i5] }, this._hitTestsRequests.push(s3)), this.requestRender(), i5.promise;
  825. }
  826. onTileData(e4, t2) {
  827. const s3 = r3 && "orderBy" in this._layer && this._layer.orderBy, i5 = (s3 == null ? void 0 : s3.length) && !s3[0].valueExpression && s3[0].field, a6 = s3 && this._layerView.orderByFields === i5;
  828. e4.patch(t2, a6), this.contains(e4) || this.addChild(e4), this.requestRender();
  829. }
  830. onTileError(e4) {
  831. this.contains(e4) || this.addChild(e4);
  832. }
  833. updateTransitionProperties(e4, t2) {
  834. super.updateTransitionProperties(e4, t2), this._layerView.featureEffectView.transitionStep(e4, t2), this._layerView.featureEffectView.transitioning && this.requestRender();
  835. }
  836. doRender(e4) {
  837. const { minScale: t2, maxScale: s3 } = this._layer, i5 = e4.state.scale;
  838. i5 <= (t2 || 1 / 0) && i5 >= s3 && super.doRender(e4);
  839. }
  840. afterRender(e4) {
  841. super.afterRender(e4), this._hitTestsRequests.length && this.requestRender();
  842. }
  843. onAttributeStoreUpdate() {
  844. this.hasLabels && this._layerView.view.labelManager.requestUpdate(), this._onUpdate();
  845. }
  846. get hasAnimation() {
  847. return this.hasLabels;
  848. }
  849. setStencilReference(e4) {
  850. const { rendererSchema: t2 } = e4.rendererInfo;
  851. if ("dot-density" === (t2 == null ? void 0 : t2.type) && (t2 == null ? void 0 : t2.dotSize) > 1 || "heatmap" === (t2 == null ? void 0 : t2.type)) {
  852. const e5 = 1;
  853. for (const t3 of this.children)
  854. t3.stencilRef = t3.key.level + e5;
  855. } else
  856. super.setStencilReference(e4);
  857. }
  858. get hasLabels() {
  859. if ("sublayers" in this._layer)
  860. return this._layer.sublayers.some((e5) => e5.labelingInfo && e5.labelingInfo.length && e5.labelsVisible);
  861. const e4 = this._layer.featureReduction, t2 = e4 && "labelingInfo" in e4 && e4.labelsVisible && e4.labelingInfo && e4.labelingInfo.length;
  862. return this._layer.labelingInfo && this._layer.labelingInfo.length && this._layer.labelsVisible || !!t2;
  863. }
  864. prepareRenderPasses(e4) {
  865. const s3 = e4.registerRenderPass({ name: "label", brushes: [n3.label], target: () => this.hasLabels ? this.children : null, drawPhase: I.LABEL | I.LABEL_ALPHA }), r4 = e4.registerRenderPass({ name: "geometry", brushes: [n3.fill, n3.dotDensity, n3.line, n3.marker, n3.heatmap, n3.pieChart, n3.text], target: () => this.children, enableDefaultDraw: () => !this._layerView.featureEffectView.hasEffects, effects: [{ apply: e4.effects.outsideEffect, enable: () => this._layerView.featureEffectView.hasEffects, args: () => this._layerView.featureEffectView.excludedEffects }, { apply: e4.effects.insideEffect, enable: () => this._layerView.featureEffectView.hasEffects, args: () => this._layerView.featureEffectView.includedEffects }, { apply: e4.effects.hittest, enable: () => !!this._hitTestsRequests.length, args: () => this._hitTestsRequests }] }), a6 = e4.registerRenderPass({ name: "highlight", brushes: [n3.fill, n3.dotDensity, n3.line, n3.marker, n3.pieChart, n3.text], target: () => this.children, drawPhase: I.HIGHLIGHT, enableDefaultDraw: () => false, effects: [{ apply: e4.effects.highlight, enable: () => !!this._layerView.hasHighlight() }] });
  866. return [...super.prepareRenderPasses(e4), r4, a6, s3];
  867. }
  868. };
  869. // node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js
  870. var u5 = class extends o3 {
  871. constructor() {
  872. super(...arguments), this.type = "symbol";
  873. }
  874. install(e4) {
  875. const t2 = () => this.notifyChange("updating"), i5 = new a5(this.tileInfoView, this.layerView, this.layer, t2);
  876. this.featuresView = i5, e4.addChild(i5);
  877. }
  878. uninstall(e4) {
  879. e4.removeChild(this.featuresView), this.featuresView.destroy(), this.featuresView = null;
  880. }
  881. fetchResource(e4, i5) {
  882. const { url: s3 } = e4, r4 = this.featuresView.stage;
  883. try {
  884. return r4.resourceManager.fetchResource(s3, { signal: i5.signal });
  885. } catch (a6) {
  886. return j(a6) ? Promise.resolve({ width: 0, height: 0 }) : Promise.reject(a6);
  887. }
  888. }
  889. isUpdating() {
  890. var _a;
  891. const e4 = super.isUpdating(), t2 = !this.featuresView || this.featuresView.isUpdating(), i5 = (_a = this.featuresView) == null ? void 0 : _a.hasEmptyAttributeView(), s3 = e4 || t2 || e4 && i5;
  892. return has("esri-2d-log-updating") && console.log(`Updating SymbolTileRenderer ${s3}
  893. -> updatingTiles ${e4}
  894. -> hasFeaturesView ${!!this.featuresView}
  895. -> updatingFeaturesView ${t2}`), s3;
  896. }
  897. hitTest(e4) {
  898. return this.featuresView.hitTest(e4);
  899. }
  900. supportsRenderer(e4) {
  901. return null != e4 && ["simple", "class-breaks", "unique-value", "dot-density", "dictionary", "heatmap", "pie-chart"].includes(e4.type);
  902. }
  903. onConfigUpdate(e4) {
  904. let t2 = null;
  905. if (e4 && "visualVariables" in e4) {
  906. const i5 = (n4(e4).visualVariables || []).map((e5) => {
  907. const t3 = e5.clone();
  908. return "normalizationField" in e5 && (t3.normalizationField = null), e5.valueExpression && "$view.scale" !== e5.valueExpression && (t3.valueExpression = null, t3.field = "nop"), t3;
  909. });
  910. t2 = f2(i5);
  911. }
  912. this.featuresView.setRendererInfo(e4, t2, this.layerView.featureEffect);
  913. }
  914. onTileData(e4) {
  915. const t2 = this.tiles.get(e4.tileKey);
  916. t2 && e4.data && this.featuresView.onTileData(t2, e4.data), this.layerView.view.labelManager.requestUpdate();
  917. }
  918. onTileError(e4) {
  919. const t2 = this.tiles.get(e4.tileKey);
  920. t2 && this.featuresView.onTileError(t2);
  921. }
  922. forceAttributeTextureUpload() {
  923. this.featuresView.attributeView.forceTextureUpload();
  924. }
  925. lockGPUUploads() {
  926. this.featuresView.attributeView.lockTextureUpload(), this.tiles.forEach((e4) => e4.lock());
  927. }
  928. unlockGPUUploads() {
  929. this.featuresView.attributeView.unlockTextureUpload(), this.tiles.forEach((e4) => e4.unlock());
  930. }
  931. async getMaterialItems(e4) {
  932. return this.featuresView.getMaterialItems(e4);
  933. }
  934. invalidateLabels() {
  935. this.featuresView.hasLabels && this.layerView.view.labelManager.requestUpdate();
  936. }
  937. createTile(e4) {
  938. const t2 = this.tileInfoView.getTileBounds(u(), e4), i5 = () => this.layerView.view.labelManager.requestUpdate(), a6 = this.tileInfoView.getTileResolution(e4.level), o5 = this.featuresView.attributeView;
  939. return new l(e4, a6, t2[0], t2[3], o5, i5);
  940. }
  941. disposeTile(e4) {
  942. this.featuresView.removeChild(e4), e4.destroy(), this.layerView.view.labelManager.requestUpdate();
  943. }
  944. };
  945. u5 = e([n("esri.views.2d.layers.features.tileRenderers.SymbolTileRenderer")], u5);
  946. var p2 = u5;
  947. export {
  948. p2 as default
  949. };
  950. //# sourceMappingURL=SymbolTileRenderer-4VQTMK6G.js.map