import { ref as u, computed as h, unref as s } from "vue";
import { useElementPosition as x } from "../../composition/usePosition.js";
function d(r, n) {
  const e = u();
  return x(r, (t) => {
    e.value = t;
  }), h(() => {
    const t = s(e), p = s(n), o = p.position ?? "top", f = p.gap ?? 8;
    if (!t)
      return "";
    const i = t.offsetY + Math.floor(t.height / 2), l = t.offsetX + Math.floor(t.width / 2);
    return o === "top-left" ? `left: ${t.offsetX}px; top: ${t.offsetY - f}px;` : o === "top" ? `left: ${l}px; top: ${t.offsetY - f}px;` : o === "right" ? `left: ${t.offsetX + t.width + f}px; top: ${i}px;` : o === "left" ? `right: ${t.scrollWidth - t.x + f}px; top: ${i}px;` : o === "southwest" ? `left: ${t.offsetX + t.width}px; top: ${t.offsetY + t.height + f}px;` : "";
  });
}
export {
  d as useTooltipPosition
};
//# sourceMappingURL=useTooltipPosition.js.map
