/**
 * It returns a function that takes a KeyboardEvent and dispatches a click event on the currentTarget if the key is Enter.
 *
 * @returns {(e: KeyboardEvent) => void } A function that takes a KeyboardEvent and dispatches a click event on the currentTarget.
 */
export function createEnterKeyHandlerToTriggerClick() {
  return function (e) {
    var _a;
    if (e.key === 'Enter') {
      (_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }));
    }
  };
}
