import { g } from "./chunk-7C23ILQ4.js"; import { a } from "./chunk-YZVAB3DF.js"; import { n as n3, t as t2 } from "./chunk-ZAY3CMAZ.js"; import { j, n as n2 } from "./chunk-LBW34VZ2.js"; import { e, n5 as n, y3 as y } from "./chunk-2Z2TG5CU.js"; import { b } from "./chunk-SQOPWYIT.js"; import { t } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/core/support/OwningCollection.js var l = class extends a(j) { constructor(e2) { super(e2), this.handles.add([this.on("before-add", (e3) => { t(e3.item) && e3.preventDefault(); }), this.on("after-add", (e3) => this._own(e3.item)), this.on("after-remove", (e3) => this._release(e3.item))]); } get owner() { return this._get("owner"); } set owner(e2) { e2 !== this._get("owner") && (this._releaseAll(), this._set("owner", e2), this._ownAll()); } _ownAll() { for (const e2 of this.items) this._own(e2); } _releaseAll() { for (const e2 of this.items) this._release(e2); } _createNewInstance(e2) { return this.itemType ? new (j.ofType(this.itemType.Type))(e2) : new j(e2); } }; function a2(e2, t3) { return { type: e2, cast: t2, set(s) { const r = n3(s, this._get(t3), e2); r.owner = this, this._set(t3, r); } }; } e([y()], l.prototype, "owner", null), l = e([n("esri.core.support.OwningCollection")], l); // node_modules/@arcgis/core/support/GraphicsCollection.js var i = class extends l { _own(r) { r.layer && "remove" in r.layer && r.layer !== this.owner && r.layer.remove(r), r.layer = this.owner; } _release(r) { r.layer === this.owner && (r.layer = null); } }; e([n2({ Type: g, ensureType: b(g) })], i.prototype, "itemType", void 0), i = e([n("esri.support.GraphicsCollection")], i); export { l, a2 as a, i }; //# sourceMappingURL=chunk-BVA3U6FJ.js.map