"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const echarts = require("./core/echarts.js");
const Component$1 = require("./view/Component.js");
const Chart = require("./view/Chart.js");
const Component = require("./model/Component.js");
const Series = require("./model/Series.js");
const util = require("../../../../zrender@5.4.4/node_modules/zrender/lib/core/util.js");
const impl = require("./core/impl.js");
const zrender = require("../../../../zrender@5.4.4/node_modules/zrender/lib/zrender.js");
var extensions = [];
var extensionRegisters = {
  registerPreprocessor: echarts.registerPreprocessor,
  registerProcessor: echarts.registerProcessor,
  registerPostInit: echarts.registerPostInit,
  registerPostUpdate: echarts.registerPostUpdate,
  registerUpdateLifecycle: echarts.registerUpdateLifecycle,
  registerAction: echarts.registerAction,
  registerCoordinateSystem: echarts.registerCoordinateSystem,
  registerLayout: echarts.registerLayout,
  registerVisual: echarts.registerVisual,
  registerTransform: echarts.registerTransform,
  registerLoading: echarts.registerLoading,
  registerMap: echarts.registerMap,
  registerImpl: impl.registerImpl,
  PRIORITY: echarts.PRIORITY,
  ComponentModel: Component.default,
  ComponentView: Component$1.default,
  SeriesModel: Series.default,
  ChartView: Chart.default,
  // TODO Use ComponentModel and SeriesModel instead of Constructor
  registerComponentModel: function(ComponentModelClass) {
    Component.default.registerClass(ComponentModelClass);
  },
  registerComponentView: function(ComponentViewClass) {
    Component$1.default.registerClass(ComponentViewClass);
  },
  registerSeriesModel: function(SeriesModelClass) {
    Series.default.registerClass(SeriesModelClass);
  },
  registerChartView: function(ChartViewClass) {
    Chart.default.registerClass(ChartViewClass);
  },
  registerSubTypeDefaulter: function(componentType, defaulter) {
    Component.default.registerSubTypeDefaulter(componentType, defaulter);
  },
  registerPainter: function(painterType, PainterCtor) {
    zrender.registerPainter(painterType, PainterCtor);
  }
};
function use(ext) {
  if (util.isArray(ext)) {
    util.each(ext, function(singleExt) {
      use(singleExt);
    });
    return;
  }
  if (util.indexOf(extensions, ext) >= 0) {
    return;
  }
  extensions.push(ext);
  if (util.isFunction(ext)) {
    ext = {
      install: ext
    };
  }
  ext.install(extensionRegisters);
}
exports.use = use;
