import { init, material } from '@alilc/lowcode-engine';
import initPlugins from './preset';
export * from '@alilc/lowcode-engine';
var isNewEngineVersion = !!material;
var initConfig = {
  enableCondition: true,
  enableCanvasLock: true
};
var preference = new Map();
preference.set('alilcDataSourcePlugin', {
  importPlugins: [],
  dataSourceTypes: [{
    type: 'fetch'
  }, {
    type: 'jsonp'
  }]
});

if (isNewEngineVersion) {
  initConfig.simulatorUrl = ['https://unpkg.com/@alilc/lowcode-react-simulator-renderer@beta/dist/css/react-simulator-renderer.css', 'https://unpkg.com/@alilc/lowcode-react-simulator-renderer@beta/dist/js/react-simulator-renderer.js'];
}

export default function (customInit, customPlugins, rootElement, options) {
  initPlugins(customInit, customPlugins, options);

  if (isNewEngineVersion) {
    init(rootElement, initConfig, preference);
  } else {
    init(rootElement, initConfig);
  }
}