chunk-LBW34VZ2.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. import {
  2. e as e3
  3. } from "./chunk-GSSTTHIT.js";
  4. import {
  5. n as n2
  6. } from "./chunk-IM3LVQXV.js";
  7. import {
  8. e,
  9. n5 as n,
  10. s2 as s,
  11. v,
  12. y3 as y2
  13. } from "./chunk-2Z2TG5CU.js";
  14. import {
  15. e as e2,
  16. t
  17. } from "./chunk-U2XHEJM7.js";
  18. import {
  19. S,
  20. b
  21. } from "./chunk-SQOPWYIT.js";
  22. import {
  23. y
  24. } from "./chunk-SPWQ3AWG.js";
  25. import {
  26. x
  27. } from "./chunk-YXWMMD76.js";
  28. // node_modules/@arcgis/core/core/ObservableChangesType.js
  29. var E;
  30. !function(E3) {
  31. E3[E3.ADD = 1] = "ADD", E3[E3.REMOVE = 2] = "REMOVE", E3[E3.MOVE = 4] = "MOVE";
  32. }(E || (E = {}));
  33. // node_modules/@arcgis/core/core/accessorSupport/decorators/shared.js
  34. function n3(n4) {
  35. return (r, t2) => {
  36. r[t2] = n4;
  37. };
  38. }
  39. // node_modules/@arcgis/core/core/Collection.js
  40. var g;
  41. var p = class {
  42. constructor() {
  43. this.target = null, this.cancellable = false, this.defaultPrevented = false, this.item = void 0, this.type = void 0;
  44. }
  45. preventDefault() {
  46. this.cancellable && (this.defaultPrevented = true);
  47. }
  48. reset(e4) {
  49. this.defaultPrevented = false, this.item = e4;
  50. }
  51. };
  52. var b2 = new e2(p, void 0, (e4) => {
  53. e4.item = null, e4.target = null, e4.defaultPrevented = false, e4.cancellable = false;
  54. });
  55. var d = () => {
  56. };
  57. function v2(e4) {
  58. return e4 ? e4 instanceof V ? e4.toArray() : e4.length ? Array.prototype.slice.apply(e4) : [] : [];
  59. }
  60. function E2(e4) {
  61. if (e4 && e4.length)
  62. return e4[0];
  63. }
  64. function y3(e4, t2, s2, i) {
  65. const r = Math.min(e4.length - s2, t2.length - i);
  66. let n4 = 0;
  67. for (; n4 < r && e4[s2 + n4] === t2[i + n4]; )
  68. n4++;
  69. return n4;
  70. }
  71. function C(e4, t2, s2, i) {
  72. t2 && t2.forEach((t3, r, n4) => {
  73. e4.push(t3), C(e4, s2.call(i, t3, r, n4), s2, i);
  74. });
  75. }
  76. var A = /* @__PURE__ */ new Set();
  77. var O = /* @__PURE__ */ new Set();
  78. var M = /* @__PURE__ */ new Set();
  79. var D = /* @__PURE__ */ new Map();
  80. var x2 = 0;
  81. var V = g = class extends n2.EventedAccessor {
  82. constructor(e4) {
  83. super(e4), this._chgListeners = [], this._notifications = null, this._timer = null, this._observable = new e3(), this.length = 0, this._items = [], Object.defineProperty(this, "uid", { value: x2++ });
  84. }
  85. static isCollection(e4) {
  86. return null != e4 && e4 instanceof g;
  87. }
  88. normalizeCtorArgs(e4) {
  89. return e4 ? Array.isArray(e4) || e4 instanceof g ? { items: e4 } : e4 : {};
  90. }
  91. destroy() {
  92. this.removeAll();
  93. }
  94. *[Symbol.iterator]() {
  95. yield* this.items;
  96. }
  97. get items() {
  98. return s(this._observable), this._items;
  99. }
  100. set items(e4) {
  101. this._emitBeforeChanges(E.ADD) || (this._splice(0, this.length, v2(e4)), this._emitAfterChanges(E.ADD));
  102. }
  103. hasEventListener(e4) {
  104. return "change" === e4 ? this._chgListeners.length > 0 : this._emitter.hasEventListener(e4);
  105. }
  106. on(e4, t2) {
  107. if ("change" === e4) {
  108. const e5 = this._chgListeners, s2 = { removed: false, callback: t2 };
  109. return e5.push(s2), this._notifications && this._notifications.push({ listeners: e5.slice(), items: this._items.slice(), changes: [] }), { remove() {
  110. this.remove = d, s2.removed = true, e5.splice(e5.indexOf(s2), 1);
  111. } };
  112. }
  113. return this._emitter.on(e4, t2);
  114. }
  115. once(e4, t2) {
  116. const s2 = this.on(e4, t2);
  117. return { remove() {
  118. s2.remove();
  119. } };
  120. }
  121. add(e4, t2) {
  122. if (s(this._observable), this._emitBeforeChanges(E.ADD))
  123. return this;
  124. const s2 = this.getNextIndex(t2 != null ? t2 : null);
  125. return this._splice(s2, 0, [e4]), this._emitAfterChanges(E.ADD), this;
  126. }
  127. addMany(e4, t2 = this._items.length) {
  128. if (s(this._observable), !e4 || !e4.length)
  129. return this;
  130. if (this._emitBeforeChanges(E.ADD))
  131. return this;
  132. const s2 = this.getNextIndex(t2);
  133. return this._splice(s2, 0, v2(e4)), this._emitAfterChanges(E.ADD), this;
  134. }
  135. at(e4) {
  136. if (s(this._observable), (e4 = Math.trunc(e4) || 0) < 0 && (e4 += this.length), !(e4 < 0 || e4 >= this.length))
  137. return this._items[e4];
  138. }
  139. removeAll() {
  140. if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
  141. return [];
  142. const e4 = this._splice(0, this.length) || [];
  143. return this._emitAfterChanges(E.REMOVE), e4;
  144. }
  145. clone() {
  146. return s(this._observable), this._createNewInstance({ items: this._items.map(y) });
  147. }
  148. concat(...e4) {
  149. s(this._observable);
  150. const t2 = e4.map(v2);
  151. return this._createNewInstance({ items: this._items.concat(...t2) });
  152. }
  153. drain(e4, t2) {
  154. if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
  155. return;
  156. const s2 = x(this._splice(0, this.length)), i = s2.length;
  157. for (let r = 0; r < i; r++)
  158. e4.call(t2, s2[r], r, s2);
  159. this._emitAfterChanges(E.REMOVE);
  160. }
  161. every(e4, t2) {
  162. return s(this._observable), this._items.every(e4, t2);
  163. }
  164. filter(e4, t2) {
  165. let s2;
  166. return s(this._observable), s2 = 2 === arguments.length ? this._items.filter(e4, t2) : this._items.filter(e4), this._createNewInstance({ items: s2 });
  167. }
  168. find(e4, t2) {
  169. return s(this._observable), this._items.find(e4, t2);
  170. }
  171. findIndex(e4, t2) {
  172. return s(this._observable), this._items.findIndex(e4, t2);
  173. }
  174. flatten(e4, t2) {
  175. s(this._observable);
  176. const s2 = [];
  177. return C(s2, this, e4, t2), new g(s2);
  178. }
  179. forEach(e4, t2) {
  180. return s(this._observable), this._items.forEach(e4, t2);
  181. }
  182. getItemAt(e4) {
  183. return s(this._observable), this._items[e4];
  184. }
  185. getNextIndex(e4) {
  186. s(this._observable);
  187. const t2 = this.length;
  188. return (e4 = e4 != null ? e4 : t2) < 0 ? e4 = 0 : e4 > t2 && (e4 = t2), e4;
  189. }
  190. includes(e4, t2 = 0) {
  191. return s(this._observable), this._items.includes(e4, t2);
  192. }
  193. indexOf(e4, t2 = 0) {
  194. return s(this._observable), this._items.indexOf(e4, t2);
  195. }
  196. join(e4 = ",") {
  197. return s(this._observable), this._items.join(e4);
  198. }
  199. lastIndexOf(e4, t2 = this.length - 1) {
  200. return s(this._observable), this._items.lastIndexOf(e4, t2);
  201. }
  202. map(e4, t2) {
  203. s(this._observable);
  204. const s2 = this._items.map(e4, t2);
  205. return new g({ items: s2 });
  206. }
  207. reorder(e4, t2 = this.length - 1) {
  208. s(this._observable);
  209. const s2 = this.indexOf(e4);
  210. if (-1 !== s2) {
  211. if (t2 < 0 ? t2 = 0 : t2 >= this.length && (t2 = this.length - 1), s2 !== t2) {
  212. if (this._emitBeforeChanges(E.MOVE))
  213. return e4;
  214. this._splice(s2, 1), this._splice(t2, 0, [e4]), this._emitAfterChanges(E.MOVE);
  215. }
  216. return e4;
  217. }
  218. }
  219. pop() {
  220. if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
  221. return;
  222. const e4 = E2(this._splice(this.length - 1, 1));
  223. return this._emitAfterChanges(E.REMOVE), e4;
  224. }
  225. push(...e4) {
  226. return s(this._observable), this._emitBeforeChanges(E.ADD) || (this._splice(this.length, 0, e4), this._emitAfterChanges(E.ADD)), this.length;
  227. }
  228. reduce(e4, t2) {
  229. s(this._observable);
  230. const s2 = this._items;
  231. return 2 === arguments.length ? s2.reduce(e4, t2) : s2.reduce(e4);
  232. }
  233. reduceRight(e4, t2) {
  234. s(this._observable);
  235. const s2 = this._items;
  236. return 2 === arguments.length ? s2.reduceRight(e4, t2) : s2.reduceRight(e4);
  237. }
  238. remove(e4) {
  239. return s(this._observable), this.removeAt(this.indexOf(e4));
  240. }
  241. removeAt(e4) {
  242. if (s(this._observable), e4 < 0 || e4 >= this.length || this._emitBeforeChanges(E.REMOVE))
  243. return;
  244. const t2 = E2(this._splice(e4, 1));
  245. return this._emitAfterChanges(E.REMOVE), t2;
  246. }
  247. removeMany(e4) {
  248. if (s(this._observable), !e4 || !e4.length || this._emitBeforeChanges(E.REMOVE))
  249. return [];
  250. const t2 = e4 instanceof g ? e4.toArray() : e4, s2 = this._items, i = [], r = t2.length;
  251. for (let n4 = 0; n4 < r; n4++) {
  252. const e5 = t2[n4], r2 = s2.indexOf(e5);
  253. if (r2 > -1) {
  254. const e6 = 1 + y3(t2, s2, n4 + 1, r2 + 1), h = this._splice(r2, e6);
  255. h && h.length > 0 && i.push.apply(i, h), n4 += e6 - 1;
  256. }
  257. }
  258. return this._emitAfterChanges(E.REMOVE), i;
  259. }
  260. reverse() {
  261. if (s(this._observable), this._emitBeforeChanges(E.MOVE))
  262. return this;
  263. const e4 = this._splice(0, this.length);
  264. return e4 && (e4.reverse(), this._splice(0, 0, e4)), this._emitAfterChanges(E.MOVE), this;
  265. }
  266. shift() {
  267. if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
  268. return;
  269. const e4 = E2(this._splice(0, 1));
  270. return this._emitAfterChanges(E.REMOVE), e4;
  271. }
  272. slice(e4 = 0, t2 = this.length) {
  273. return s(this._observable), this._createNewInstance({ items: this._items.slice(e4, t2) });
  274. }
  275. some(e4, t2) {
  276. return s(this._observable), this._items.some(e4, t2);
  277. }
  278. sort(e4) {
  279. if (s(this._observable), !this.length || this._emitBeforeChanges(E.MOVE))
  280. return this;
  281. const t2 = x(this._splice(0, this.length));
  282. return arguments.length ? t2.sort(e4) : t2.sort(), this._splice(0, 0, t2), this._emitAfterChanges(E.MOVE), this;
  283. }
  284. splice(e4, t2, ...s2) {
  285. s(this._observable);
  286. const i = (t2 ? E.REMOVE : 0) | (s2.length ? E.ADD : 0);
  287. if (this._emitBeforeChanges(i))
  288. return [];
  289. const r = this._splice(e4, t2, s2) || [];
  290. return this._emitAfterChanges(i), r;
  291. }
  292. toArray() {
  293. return s(this._observable), this._items.slice();
  294. }
  295. toJSON() {
  296. return s(this._observable), this.toArray();
  297. }
  298. toLocaleString() {
  299. return s(this._observable), this._items.toLocaleString();
  300. }
  301. toString() {
  302. return s(this._observable), this._items.toString();
  303. }
  304. unshift(...e4) {
  305. return s(this._observable), !e4.length || this._emitBeforeChanges(E.ADD) || (this._splice(0, 0, e4), this._emitAfterChanges(E.ADD)), this.length;
  306. }
  307. _createNewInstance(e4) {
  308. return new this.constructor(e4);
  309. }
  310. _splice(e4, t2, s2) {
  311. const i = this._items, r = this.itemType;
  312. let n4, h;
  313. if (!this._notifications && this.hasEventListener("change") && (this._notifications = [{ listeners: this._chgListeners.slice(), items: this._items.slice(), changes: [] }], this._timer && this._timer.remove(), this._timer = v(() => this._dispatchChange())), t2) {
  314. if (h = i.splice(e4, t2), this.hasEventListener("before-remove")) {
  315. const t3 = b2.acquire();
  316. t3.target = this, t3.cancellable = true;
  317. for (let s3 = 0, r2 = h.length; s3 < r2; s3++)
  318. n4 = h[s3], t3.reset(n4), this.emit("before-remove", t3), t3.defaultPrevented && (h.splice(s3, 1), i.splice(e4, 0, n4), e4 += 1, s3 -= 1, r2 -= 1);
  319. b2.release(t3);
  320. }
  321. if (this.length = this._items.length, this.hasEventListener("after-remove")) {
  322. const e5 = b2.acquire();
  323. e5.target = this, e5.cancellable = false;
  324. const t3 = h.length;
  325. for (let s3 = 0; s3 < t3; s3++)
  326. e5.reset(h[s3]), this.emit("after-remove", e5);
  327. b2.release(e5);
  328. }
  329. }
  330. if (s2 && s2.length) {
  331. if (r) {
  332. const e5 = [];
  333. for (const t4 of s2) {
  334. const s3 = r.ensureType(t4);
  335. null == s3 && null != t4 || e5.push(s3);
  336. }
  337. s2 = e5;
  338. }
  339. const t3 = this.hasEventListener("before-add"), n5 = this.hasEventListener("after-add"), h2 = e4 === this.length;
  340. if (t3 || n5) {
  341. const r2 = b2.acquire();
  342. r2.target = this, r2.cancellable = true;
  343. const o = b2.acquire();
  344. o.target = this, o.cancellable = false;
  345. for (const l of s2)
  346. t3 ? (r2.reset(l), this.emit("before-add", r2), r2.defaultPrevented || (h2 ? i.push(l) : i.splice(e4++, 0, l), this._set("length", i.length), n5 && (o.reset(l), this.emit("after-add", o)))) : (h2 ? i.push(l) : i.splice(e4++, 0, l), this._set("length", i.length), o.reset(l), this.emit("after-add", o));
  347. b2.release(o), b2.release(r2);
  348. } else {
  349. if (h2)
  350. for (const e5 of s2)
  351. i.push(e5);
  352. else
  353. i.splice(e4, 0, ...s2);
  354. this._set("length", i.length);
  355. }
  356. }
  357. return (s2 && s2.length || h && h.length) && this._notifyChangeEvent(s2, h), h;
  358. }
  359. _emitBeforeChanges(e4) {
  360. let t2 = false;
  361. if (this.hasEventListener("before-changes")) {
  362. const s2 = b2.acquire();
  363. s2.target = this, s2.cancellable = true, s2.type = e4, this.emit("before-changes", s2), t2 = s2.defaultPrevented, b2.release(s2);
  364. }
  365. return t2;
  366. }
  367. _emitAfterChanges(e4) {
  368. if (this.hasEventListener("after-changes")) {
  369. const t2 = b2.acquire();
  370. t2.target = this, t2.cancellable = false, t2.type = e4, this.emit("after-changes", t2), b2.release(t2);
  371. }
  372. this._observable.notify();
  373. }
  374. _notifyChangeEvent(e4, t2) {
  375. this.hasEventListener("change") && this._notifications && this._notifications[this._notifications.length - 1].changes.push({ added: e4, removed: t2 });
  376. }
  377. _dispatchChange() {
  378. if (this._timer && (this._timer.remove(), this._timer = null), !this._notifications)
  379. return;
  380. const e4 = this._notifications;
  381. this._notifications = null;
  382. for (const s2 of e4) {
  383. const e5 = s2.changes;
  384. A.clear(), O.clear(), M.clear();
  385. for (const { added: t2, removed: s3 } of e5) {
  386. if (t2)
  387. if (0 === M.size && 0 === O.size)
  388. for (const e6 of t2)
  389. A.add(e6);
  390. else
  391. for (const e6 of t2)
  392. O.has(e6) ? (M.add(e6), O.delete(e6)) : M.has(e6) || A.add(e6);
  393. if (s3)
  394. if (0 === M.size && 0 === A.size)
  395. for (const e6 of s3)
  396. O.add(e6);
  397. else
  398. for (const e6 of s3)
  399. A.has(e6) ? A.delete(e6) : (M.delete(e6), O.add(e6));
  400. }
  401. const i = t.acquire();
  402. A.forEach((e6) => {
  403. i.push(e6);
  404. });
  405. const r = t.acquire();
  406. O.forEach((e6) => {
  407. r.push(e6);
  408. });
  409. const n4 = this._items, h = s2.items, o = t.acquire();
  410. if (M.forEach((e6) => {
  411. h.indexOf(e6) !== n4.indexOf(e6) && o.push(e6);
  412. }), s2.listeners && (i.length || r.length || o.length)) {
  413. const e6 = { target: this, added: i, removed: r, moved: o }, t2 = s2.listeners.length;
  414. for (let i2 = 0; i2 < t2; i2++) {
  415. const t3 = s2.listeners[i2];
  416. t3.removed || t3.callback.call(this, e6);
  417. }
  418. }
  419. t.release(i), t.release(r), t.release(o);
  420. }
  421. A.clear(), O.clear(), M.clear();
  422. }
  423. };
  424. V.ofType = (t2) => {
  425. if (!t2)
  426. return g;
  427. if (D.has(t2))
  428. return D.get(t2);
  429. let s2 = null;
  430. if ("function" == typeof t2)
  431. s2 = t2.prototype.declaredClass;
  432. else if (t2.base)
  433. s2 = t2.base.prototype.declaredClass;
  434. else
  435. for (const e4 in t2.typeMap) {
  436. const i2 = t2.typeMap[e4].prototype.declaredClass;
  437. s2 ? s2 += ` | ${i2}` : s2 = i2;
  438. }
  439. let i = class extends g {
  440. };
  441. return e([n3({ Type: t2, ensureType: "function" == typeof t2 ? b(t2) : S(t2) })], i.prototype, "itemType", void 0), i = e([n(`esri.core.Collection<${s2}>`)], i), D.set(t2, i), i;
  442. }, e([y2()], V.prototype, "length", void 0), e([y2()], V.prototype, "items", null), V = g = e([n("esri.core.Collection")], V);
  443. var j = V;
  444. export {
  445. n3 as n,
  446. j
  447. };
  448. //# sourceMappingURL=chunk-LBW34VZ2.js.map