function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import { EditorState } from 'prosemirror-state';
import { Transform } from 'prosemirror-transform';
import { EditorView } from 'prosemirror-view';
import * as EditorCommands from './EditorCommands.js';
import * as EditorKeyMap from './EditorKeyMap.js';
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
var KEY_BACK_DELETE = EditorKeyMap.KEY_BACK_DELETE,
  KEY_FORWARD_DELETE = EditorKeyMap.KEY_FORWARD_DELETE,
  KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = EditorKeyMap.KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
  KEY_REDO = EditorKeyMap.KEY_REDO,
  KEY_SPLIT_LIST_ITEM = EditorKeyMap.KEY_SPLIT_LIST_ITEM,
  KEY_TAB_SHIFT = EditorKeyMap.KEY_TAB_SHIFT,
  KEY_TAB = EditorKeyMap.KEY_TAB,
  KEY_TOGGLE_BOLD = EditorKeyMap.KEY_TOGGLE_BOLD,
  KEY_TOGGLE_ITALIC = EditorKeyMap.KEY_TOGGLE_ITALIC,
  KEY_TOGGLE_UNDERLINE = EditorKeyMap.KEY_TOGGLE_UNDERLINE,
  KEY_UNDO = EditorKeyMap.KEY_UNDO;
var BLOCKQUOTE_INSERT_NEW_LINE = EditorCommands.BLOCKQUOTE_INSERT_NEW_LINE,
  EM = EditorCommands.EM,
  HISTORY_REDO = EditorCommands.HISTORY_REDO,
  HISTORY_UNDO = EditorCommands.HISTORY_UNDO,
  INDENT_LESS = EditorCommands.INDENT_LESS,
  INDENT_MORE = EditorCommands.INDENT_MORE,
  LIST_ITEM_MERGE_DOWN = EditorCommands.LIST_ITEM_MERGE_DOWN,
  LIST_ITEM_MERGE_UP = EditorCommands.LIST_ITEM_MERGE_UP,
  LIST_SPLIT = EditorCommands.LIST_SPLIT,
  TABLE_MOVE_TO_NEXT_CELL = EditorCommands.TABLE_MOVE_TO_NEXT_CELL,
  TABLE_MOVE_TO_PREV_CELL = EditorCommands.TABLE_MOVE_TO_PREV_CELL,
  TEXT_INSERT_TAB_SPACE = EditorCommands.TEXT_INSERT_TAB_SPACE,
  STRONG = EditorCommands.STRONG,
  UNDERLINE = EditorCommands.UNDERLINE;
function bindCommands() {
  for (var _len = arguments.length, commands = new Array(_len), _key = 0; _key < _len; _key++) {
    commands[_key] = arguments[_key];
  }
  return function (state, dispatch, view) {
    return commands.some(function (cmd) {
      if (cmd.isEnabled(state, view, '')) {
        cmd.execute(state, dispatch, view);
        return true;
      }
      return false;
    });
  };
}
export default function createEditorKeyMap() {
  var _result;
  var result = (_result = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_result, KEY_BACK_DELETE.common, LIST_ITEM_MERGE_UP.execute), KEY_FORWARD_DELETE.common, LIST_ITEM_MERGE_DOWN.execute), KEY_REDO.common, HISTORY_REDO.execute), KEY_SPLIT_LIST_ITEM.common, LIST_SPLIT.execute), KEY_TAB.common, bindCommands(TABLE_MOVE_TO_NEXT_CELL, TEXT_INSERT_TAB_SPACE, INDENT_MORE)), KEY_TAB_SHIFT.common, bindCommands(TABLE_MOVE_TO_PREV_CELL, TEXT_INSERT_TAB_SPACE, INDENT_LESS)), KEY_TOGGLE_BOLD.common, STRONG.execute), KEY_TOGGLE_ITALIC.common, EM.execute), KEY_TOGGLE_UNDERLINE.common, UNDERLINE.execute), KEY_UNDO.common, HISTORY_UNDO.execute), _defineProperty(_result, KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE.common, BLOCKQUOTE_INSERT_NEW_LINE.execute));
  return result;
}