import { n as n2 } from "./chunk-IM3LVQXV.js"; import { e, n5 as n } from "./chunk-2Z2TG5CU.js"; import { y } from "./chunk-SPWQ3AWG.js"; // node_modules/@arcgis/core/layers/mixins/EditBusLayer.js var d = new n2.EventEmitter(); var i = "esri.layers.mixins.EditBusLayer"; var l = Symbol(i); function o(e2) { return null != e2 && "object" == typeof e2 && l in e2; } var a = (t) => { var o2; let a2 = class extends t { constructor(...e2) { super(...e2), this[o2] = true, this.when().then(() => { this.own([d.on("edits", (e3) => { var _a, _b, _c; const t2 = "layer" in e3 ? e3.layer : null, r = "layer" in e3 ? (_a = e3.layer) == null ? void 0 : _a.url : e3.serviceUrl, d2 = "layer" in e3 ? (_b = e3.layer) == null ? void 0 : _b.layerId : e3.layerId, i2 = e3.event; if (t2 === this || r !== this.url) return; if (null != d2 && null != this.layerId && d2 === this.layerId) return void this.emit("edits", y(i2)); const l2 = (_c = i2.editedFeatures) == null ? void 0 : _c.find(({ layerId: e4 }) => e4 === this.layerId); if (l2) { const { adds: e4, updates: t3, deletes: r2 } = l2.editedFeatures, d3 = { edits: null, addedAttachments: [], deletedAttachments: [], updatedAttachments: [], addedFeatures: e4 ? e4.map(({ attributes: e5 }) => ({ objectId: this.objectIdField && e5[this.objectIdField], globalId: this.globalIdField && e5[this.globalIdField] })) : [], deletedFeatures: r2 ? r2.map(({ attributes: e5 }) => ({ objectId: this.objectIdField && e5[this.objectIdField], globalId: this.globalIdField && e5[this.globalIdField] })) : [], updatedFeatures: t3 ? t3.map(({ current: { attributes: e5 } }) => ({ objectId: this.objectIdField && e5[this.objectIdField], globalId: this.globalIdField && e5[this.globalIdField] })) : [], editedFeatures: y(i2.editedFeatures) }; this.emit("edits", d3); } })]); }, () => { }); } }; return o2 = l, a2 = e([n(i)], a2), a2; }; export { d, o, a }; //# sourceMappingURL=chunk-LC3GBQ56.js.map