import { extractEventInfo as i } from "../events/event-info.es.js";
import { Feature as m } from "../motion/features/Feature.es.js";
import { press as u } from "../../../../../../motion-dom@12.23.23/node_modules/motion-dom/dist/es/gestures/press/index.es.js";
import { frame as p } from "../../../../../../motion-dom@12.23.23/node_modules/motion-dom/dist/es/frameloop/frame.es.js";
function s(t, e, n) {
  const { props: r } = t;
  if (t.current instanceof HTMLButtonElement && t.current.disabled)
    return;
  t.animationState && r.whileTap && t.animationState.setActive("whileTap", n === "Start");
  const a = "onTap" + (n === "End" ? "" : n), o = r[a];
  o && p.postRender(() => o(e, i(e)));
}
class d extends m {
  mount() {
    const { current: e } = this.node;
    e && (this.unmount = u(e, (n, r) => (s(this.node, r, "Start"), (a, { success: o }) => s(this.node, a, o ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
  }
  unmount() {
  }
}
export {
  d as PressGesture
};
//# sourceMappingURL=press.es.js.map
