import { onScopeDispose } from "vue";
import { convertToUnit } from "@veno-ui/utils";
function pointerPositionStrategy(data, props, contentStyles, _anchorClasses) {
  const updatePosition = (e) => {
    const box = { left: e.clientX, top: e.clientY };
    Object.assign(contentStyles.value, {
      position: "fixed",
      left: convertToUnit(box.left + +(props.offset ?? 0)),
      top: convertToUnit(box.top + +(props.offset ?? 0))
    });
  };
  document.addEventListener("mousemove", updatePosition);
  onScopeDispose(() => {
    document.removeEventListener("mousemove", updatePosition);
  });
  return {
    updatePosition: void 0
  };
}
export {
  pointerPositionStrategy
};
//# sourceMappingURL=pointer.mjs.map
