chunk-LE3RIDC7.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import {
  2. g
  3. } from "./chunk-RZFGRBD7.js";
  4. import {
  5. a
  6. } from "./chunk-RMX2AZ4P.js";
  7. import {
  8. n as n3,
  9. t as t2
  10. } from "./chunk-AFZ7XSEW.js";
  11. import {
  12. j,
  13. n as n2
  14. } from "./chunk-ALDCDSPV.js";
  15. import {
  16. d,
  17. e,
  18. n2 as n
  19. } from "./chunk-Y3WMVFTW.js";
  20. import {
  21. b
  22. } from "./chunk-IHXECKQQ.js";
  23. import {
  24. s
  25. } from "./chunk-EMJ4ZSM2.js";
  26. import {
  27. t
  28. } from "./chunk-GZT4BVFP.js";
  29. // node_modules/@arcgis/core/core/support/OwningCollection.js
  30. s.getLogger("esri.core.support.OwningCollection");
  31. var m = class extends a(j) {
  32. constructor(e2) {
  33. super(e2), this.handles.add([this.on("before-add", (e3) => {
  34. t(e3.item) && e3.preventDefault();
  35. }), this.on("after-add", (e3) => this._own(e3.item)), this.on("after-remove", (e3) => this._release(e3.item))]);
  36. }
  37. get owner() {
  38. return this._get("owner");
  39. }
  40. set owner(e2) {
  41. e2 !== this._get("owner") && (this._releaseAll(), this._set("owner", e2), this._ownAll());
  42. }
  43. _ownAll() {
  44. for (const e2 of this.items)
  45. this._own(e2);
  46. }
  47. _releaseAll() {
  48. for (const e2 of this.items)
  49. this._release(e2);
  50. }
  51. _createNewInstance(e2) {
  52. return this.itemType ? new (j.ofType(this.itemType.Type))(e2) : new j(e2);
  53. }
  54. };
  55. function a2(e2, t3) {
  56. return { type: e2, cast: t2, set(s2) {
  57. const r = n3(s2, this._get(t3), e2);
  58. r.owner = this, this._set(t3, r);
  59. } };
  60. }
  61. e([d()], m.prototype, "owner", null), m = e([n("esri.core.support.OwningCollection")], m);
  62. // node_modules/@arcgis/core/support/GraphicsCollection.js
  63. var c = class extends m {
  64. _own(r) {
  65. r.layer && "remove" in r.layer && r.layer !== this.owner && r.layer.remove(r), r.layer = this.owner;
  66. }
  67. _release(r) {
  68. r.layer === this.owner && (r.layer = null);
  69. }
  70. };
  71. e([n2({ Type: g, ensureType: b(g) })], c.prototype, "itemType", void 0), c = e([n("esri.support.GraphicsCollection")], c);
  72. export {
  73. m,
  74. a2 as a,
  75. c
  76. };
  77. //# sourceMappingURL=chunk-LE3RIDC7.js.map