import { getType as e } from "../../util/Elements.mjs";
function m(t, a, c, o) {
  t.on("element.changed", function(e$1) {
    var n = e$1.element;
    (n.parent || n === a.getRootElement()) && (e$1.gfx = c.getGraphics(n)), e$1.gfx && t.fire(e(n) + ".changed", e$1);
  }), t.on("elements.changed", function(e2) {
    var n = e2.elements;
    n.forEach(function(f) {
      t.fire("element.changed", { element: f });
    }), o.updateContainments(n);
  }), t.on("shape.changed", function(e2) {
    o.update("shape", e2.element, e2.gfx);
  }), t.on("connection.changed", function(e2) {
    o.update("connection", e2.element, e2.gfx);
  });
}
m.$inject = [
  "eventBus",
  "canvas",
  "elementRegistry",
  "graphicsFactory"
];
export {
  m as default
};
