import { runAll } from "../src/core/base-runner.js";
import { ui } from "../src/core/ui.js";

const plugins = [
  // plugins...
];

new Promise(r => {
  if (document.readyState !== "loading") {
    r();
    return;
  }
  document.addEventListener("DOMContentLoaded", r);
}).then(async () => {
  try {
    await runAll(plugins);
  } catch (err) {
    console.error(err);
  } finally {
    ui.enable();
  }
});

// In case everything else fails, we want the error
window.addEventListener("error", ev => {
  console.error(ev.error, ev.message, ev);
});

ui.show();
