import { Injector } from "../../didi/dist/index.esm.mjs";
import CoreModule from "./core/index.mjs";
function bootstrap(modules) {
  var injector = new Injector(modules);
  injector.init();
  return injector;
}
function createInjector(options) {
  options = options || {};
  var configModule = {
    "config": ["value", options]
  };
  var modules = [configModule, CoreModule].concat(options.modules || []);
  return bootstrap(modules);
}
function Diagram(options, injector) {
  this.injector = injector = injector || createInjector(options);
  this.get = injector.get;
  this.invoke = injector.invoke;
  this.get("eventBus").fire("diagram.init");
}
Diagram.prototype.destroy = function() {
  this.get("eventBus").fire("diagram.destroy");
};
Diagram.prototype.clear = function() {
  this.get("eventBus").fire("diagram.clear");
};
export {
  Diagram as default
};
