import "core-js/modules/es.array.includes.js";
import "core-js/modules/es.string.includes.js";
import { stopImmediatePropagation } from "../../../helpers/dom/event.mjs";
export var command = {
  name: 'editorOpen',
  callback: function callback(hot, event, keys) {
    var editorManager = hot._getEditorManager();
    var _hot$getSelectedRange = hot.getSelectedRangeLast(),
      highlight = _hot$getSelectedRange.highlight;
    if (highlight.isHeader()) {
      return;
    }
    if (hot.getSettings().enterBeginsEditing) {
      if (editorManager.cellProperties.readOnly) {
        editorManager.moveSelectionAfterEnter();
      } else {
        editorManager.openEditor(null, event, true);
      }
    } else {
      editorManager.moveSelectionAfterEnter(keys.includes('shift'));
    }
    stopImmediatePropagation(event); // required by HandsontableEditor
  }
};