import { focusWithoutScrolling as f } from "./focusWithoutScrolling.js";
import { isFirefox as p, isWebKit as K, isMac as l, isIPad as $ } from "./platform.js";
import "react";
function o(e, c, d = !0) {
  var t, a;
  let { metaKey: i, ctrlKey: n, altKey: s, shiftKey: r } = c;
  p() && (!((a = window.event) === null || a === void 0 || (t = a.type) === null || t === void 0) && t.startsWith("key")) && e.target === "_blank" && (l() ? i = !0 : n = !0);
  let y = K() && l() && !$() && process.env.NODE_ENV !== "test" ? new KeyboardEvent("keydown", {
    keyIdentifier: "Enter",
    metaKey: i,
    ctrlKey: n,
    altKey: s,
    shiftKey: r
  }) : new MouseEvent("click", {
    metaKey: i,
    ctrlKey: n,
    altKey: s,
    shiftKey: r,
    detail: 1,
    bubbles: !0,
    cancelable: !0
  });
  o.isOpening = d, f(e), e.dispatchEvent(y), o.isOpening = !1;
}
o.isOpening = !1;
export {
  o as openLink
};
