/**
 * Shadow-DOM-safe `event.target`.
 *
 * `event.target` is re-targeted at shadow-root boundaries, so a listener on
 * a shadow host sees the host as the target rather than the actual
 * originating node. `composedPath()[0]` returns the true origin. Older
 * browsers without shadow DOM fall back to `event.target`.
 */
export function getTarget(event) {
  if ("composedPath" in event) {
    const path = event.composedPath();
    return path[0] ?? event.target;
  }
  return event.target;
}
//# sourceMappingURL=get-target.jsx.map
