import { __require as requireUserAgent } from '../../../../fbjs@2.0.0/node_modules/fbjs/lib/UserAgent.js';
import { __require as requireIsSoftNewlineEvent } from './isSoftNewlineEvent.js';

/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @format
 * 
 * @emails oncall+draft_js
 */

var KeyBindingUtil_1;
var hasRequiredKeyBindingUtil;

function requireKeyBindingUtil () {
	if (hasRequiredKeyBindingUtil) return KeyBindingUtil_1;
	hasRequiredKeyBindingUtil = 1;

	var UserAgent = requireUserAgent();

	var isSoftNewlineEvent = requireIsSoftNewlineEvent();

	var isOSX = UserAgent.isPlatform('Mac OS X');
	var KeyBindingUtil = {
	  /**
	   * Check whether the ctrlKey modifier is *not* being used in conjunction with
	   * the altKey modifier. If they are combined, the result is an `altGraph`
	   * key modifier, which should not be handled by this set of key bindings.
	   */
	  isCtrlKeyCommand: function isCtrlKeyCommand(e) {
	    return !!e.ctrlKey && !e.altKey;
	  },
	  isOptionKeyCommand: function isOptionKeyCommand(e) {
	    return isOSX && e.altKey;
	  },
	  usesMacOSHeuristics: function usesMacOSHeuristics() {
	    return isOSX;
	  },
	  hasCommandModifier: function hasCommandModifier(e) {
	    return isOSX ? !!e.metaKey && !e.altKey : KeyBindingUtil.isCtrlKeyCommand(e);
	  },
	  isSoftNewlineEvent: isSoftNewlineEvent
	};
	KeyBindingUtil_1 = KeyBindingUtil;
	return KeyBindingUtil_1;
}

export { requireKeyBindingUtil as __require };
//# sourceMappingURL=KeyBindingUtil.js.map
