define(["exports", "core/ui", "core/l10n"], function (exports, _ui, _l10n) {
  "use strict";

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.show = undefined;

  var _templateObject = _taggedTemplateLiteral(["\n  <p>\n    ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n  </p>\n  <p>\n    You can find more information in the <a href='https://w3.org/respec/'>documentation</a>.\n  </p>\n  <p>\n    Found a bug in ReSpec? <a href='https://github.com/w3c/respec/issues'>File it!</a>.\n  </p>\n  <table border=\"1\" width=\"100%\" hidden=\"", "\">\n    <caption>\n      Loaded plugins\n    </caption>\n    <thead>\n      <tr>\n        <th>\n          Plugin Name\n        </th>\n        <th>\n          Processing time\n        </th>\n      </tr>\n    </thead>\n    <tbody>", "</tbody>\n  </table>\n"], ["\n  <p>\n    ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n  </p>\n  <p>\n    You can find more information in the <a href='https://w3.org/respec/'>documentation</a>.\n  </p>\n  <p>\n    Found a bug in ReSpec? <a href='https://github.com/w3c/respec/issues'>File it!</a>.\n  </p>\n  <table border=\"1\" width=\"100%\" hidden=\"", "\">\n    <caption>\n      Loaded plugins\n    </caption>\n    <thead>\n      <tr>\n        <th>\n          Plugin Name\n        </th>\n        <th>\n          Processing time\n        </th>\n      </tr>\n    </thead>\n    <tbody>", "</tbody>\n  </table>\n"]),
      _templateObject2 = _taggedTemplateLiteral(["\n    <td>\n      <a href=\"", "\">\n        ", "\n      </a>\n    </td>\n    <td>\n      ", " \n    </td>\n  "], ["\n    <td>\n      <a href=\"", "\">\n        ", "\n      </a>\n    </td>\n    <td>\n      ", " \n    </td>\n  "]);

  function _taggedTemplateLiteral(strings, raw) {
    return Object.freeze(Object.defineProperties(strings, {
      raw: {
        value: Object.freeze(raw)
      }
    }));
  }

  // window.respecVersion is added at build time (see tools/builder.js)
  window.respecVersion = window.respecVersion || "Developer Edition";
  var div = document.createElement("div");
  var render = hyperHTML.bind(div);
  var button = _ui.ui.addCommand(_l10n.l10n[_l10n.lang].about_respec, "ui/about-respec", "Ctrl+Shift+Alt+A", "ℹ️");

  function show() {
    _ui.ui.freshModal(_l10n.l10n[_l10n.lang].about_respec + " - " + window.respecVersion, div, button);
    var entries = [];
    if ("getEntriesByType" in performance) {
      performance.getEntriesByType("measure").sort(function (a, b) {
        return b.duration - a.duration;
      }).map(function (_ref) {
        var name = _ref.name,
            duration = _ref.duration;

        var fixedSize = duration.toFixed(2);
        var humanDuration = fixedSize > 1000 ? Math.round(fixedSize / 1000.0) + " second(s)" : fixedSize + " milliseconds";
        return { name: name, duration: humanDuration };
      }).map(perfEntryToTR).reduce(function (collector, entry) {
        collector.push(entry);
        return collector;
      }, entries);
    }
    render(_templateObject, entries.length ? false : true, entries);
  }

  function perfEntryToTR(_ref2) {
    var name = _ref2.name,
        duration = _ref2.duration;

    var render = hyperHTML.bind(document.createElement("tr"));
    var moduleURL = "https://github.com/w3c/respec/tree/develop/src/" + name + ".js";
    return render(_templateObject2, moduleURL, name, duration);
  }

  exports.show = show;
});
//# sourceMappingURL=about-respec.js.map