"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const KeyboardUtil = require("./KeyboardUtil.js");
var c = 500;
function v(u, r) {
  var n = this;
  u.on("editorActions.init", c, function(t) {
    var e = t.editorActions;
    n.registerBindings(r, e);
  });
}
v.$inject = [
  "eventBus",
  "keyboard"
];
v.prototype.registerBindings = function(u, r) {
  function n(t, e) {
    r.isRegistered(t) && u.addListener(e);
  }
  n("undo", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isUndo(e))
      return r.trigger("undo"), true;
  }), n("redo", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isRedo(e))
      return r.trigger("redo"), true;
  }), n("copy", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isCopy(e))
      return r.trigger("copy"), true;
  }), n("paste", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isPaste(e))
      return r.trigger("paste"), true;
  }), n("stepZoom", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isKey(["+", "Add", "="], e) && KeyboardUtil.isCmd(e))
      return r.trigger("stepZoom", { value: 1 }), true;
  }), n("stepZoom", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isKey(["-", "Subtract"], e) && KeyboardUtil.isCmd(e))
      return r.trigger("stepZoom", { value: -1 }), true;
  }), n("zoom", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isKey("0", e) && KeyboardUtil.isCmd(e))
      return r.trigger("zoom", { value: 1 }), true;
  }), n("removeSelection", function(t) {
    var e = t.keyEvent;
    if (KeyboardUtil.isKey(["Backspace", "Delete", "Del"], e))
      return r.trigger("removeSelection"), true;
  });
};
exports.default = v;
