import { unref as s } from "vue";
import { useEventListener as e } from "./useEventListener.js";
function p(u, r) {
  const o = {
    el: void 0,
    x: 0,
    y: 0
  }, n = (t) => ({
    x: t.x,
    y: t.y,
    dx: t.x - o.x,
    dy: t.y - o.y
  });
  e(document, "mousedown", (t) => {
    t.target === s(u) && (t.stopPropagation && t.stopPropagation(), t.preventDefault && t.preventDefault(), o.el = s(u), o.x = t.x, o.y = t.y);
  }), e(document, "mouseup", (t) => {
    o.el && (o.el = void 0, r(
      {
        ...n(t),
        stop: !0
      },
      o
    ));
  }), e(document, "mousemove", (t) => {
    o.el && r(n(t), o);
  });
}
export {
  p as useMouseCapture
};
//# sourceMappingURL=useMouseCapture.js.map
