import { a as e, r as t, t as n } from "./dist-DCjaNViz.js";
import { o as r, t as i } from "./dist-D-6_qntS.js";
import { t as a } from "./dist-BSqU5QJM.js";
import { t as o } from "./utils-CHlhTiFC.js";
import { r as s, t as c } from "./dist-CniKe8MM.js";
import { a as l, i as u, n as d, r as f, t as p } from "./dist-CCgkh91X.js";
import * as m from "react";
import h from "react";
import { jsx as g } from "react/jsx-runtime";
//#region node_modules/@radix-ui/react-hover-card/dist/index.mjs
var _, v = "HoverCard", [y, b] = e(v, [l]), x = l(), [S, C] = y(v), w = (e) => {
	let { __scopeHoverCard: t, children: r, open: i, defaultOpen: a, onOpenChange: o, openDelay: s = 700, closeDelay: c = 300 } = e, l = x(t), d = m.useRef(0), f = m.useRef(0), p = m.useRef(!1), h = m.useRef(!1), [_, y] = n({
		prop: i,
		defaultProp: a ?? !1,
		onChange: o,
		caller: v
	}), b = m.useCallback(() => {
		clearTimeout(f.current), d.current = window.setTimeout(() => y(!0), s);
	}, [s, y]), C = m.useCallback(() => {
		clearTimeout(d.current), !p.current && !h.current && (f.current = window.setTimeout(() => y(!1), c));
	}, [c, y]), w = m.useCallback(() => y(!1), [y]);
	return m.useEffect(() => () => {
		clearTimeout(d.current), clearTimeout(f.current);
	}, []), /* @__PURE__ */ g(S, {
		scope: t,
		open: _,
		onOpenChange: y,
		onOpen: b,
		onClose: C,
		onDismiss: w,
		hasSelectionRef: p,
		isPointerDownOnContentRef: h,
		children: /* @__PURE__ */ g(u, {
			...l,
			children: r
		})
	});
};
w.displayName = v;
var T = "HoverCardTrigger", E = m.forwardRef((e, n) => {
	let { __scopeHoverCard: r, ...a } = e, o = C(T, r);
	return /* @__PURE__ */ g(p, {
		asChild: !0,
		...x(r),
		children: /* @__PURE__ */ g(i.a, {
			"data-state": o.open ? "open" : "closed",
			...a,
			ref: n,
			onPointerEnter: t(e.onPointerEnter, I(o.onOpen)),
			onPointerLeave: t(e.onPointerLeave, I(o.onClose)),
			onFocus: t(e.onFocus, o.onOpen),
			onBlur: t(e.onBlur, o.onClose),
			onTouchStart: t(e.onTouchStart, (e) => e.preventDefault())
		})
	});
});
E.displayName = T;
var D = "HoverCardPortal", [O, k] = y(D, { forceMount: void 0 }), A = (e) => {
	let { __scopeHoverCard: t, forceMount: n, children: r, container: i } = e, o = C(D, t);
	return /* @__PURE__ */ g(O, {
		scope: t,
		forceMount: n,
		children: /* @__PURE__ */ g(a, {
			present: n || o.open,
			children: /* @__PURE__ */ g(c, {
				asChild: !0,
				container: i,
				children: r
			})
		})
	});
};
A.displayName = D;
var j = "HoverCardContent", M = m.forwardRef((e, n) => {
	let r = k(j, e.__scopeHoverCard), { forceMount: i = r.forceMount, ...o } = e, s = C(j, e.__scopeHoverCard);
	return /* @__PURE__ */ g(a, {
		present: i || s.open,
		children: /* @__PURE__ */ g(N, {
			"data-state": s.open ? "open" : "closed",
			...o,
			onPointerEnter: t(e.onPointerEnter, I(s.onOpen)),
			onPointerLeave: t(e.onPointerLeave, I(s.onClose)),
			ref: n
		})
	});
});
M.displayName = j;
var N = m.forwardRef((e, n) => {
	let { __scopeHoverCard: i, onEscapeKeyDown: a, onPointerDownOutside: o, onFocusOutside: c, onInteractOutside: l, ...u } = e, d = C(j, i), p = x(i), h = m.useRef(null), v = r(n, h), [y, b] = m.useState(!1);
	return m.useEffect(() => {
		if (y) {
			let e = document.body;
			return _ = e.style.userSelect || e.style.webkitUserSelect, e.style.userSelect = "none", e.style.webkitUserSelect = "none", () => {
				e.style.userSelect = _, e.style.webkitUserSelect = _;
			};
		}
	}, [y]), m.useEffect(() => {
		if (h.current) {
			let e = () => {
				b(!1), d.isPointerDownOnContentRef.current = !1, setTimeout(() => {
					document.getSelection()?.toString() !== "" && (d.hasSelectionRef.current = !0);
				});
			};
			return document.addEventListener("pointerup", e), () => {
				document.removeEventListener("pointerup", e), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !1;
			};
		}
	}, [d.isPointerDownOnContentRef, d.hasSelectionRef]), m.useEffect(() => {
		h.current && L(h.current).forEach((e) => e.setAttribute("tabindex", "-1"));
	}), /* @__PURE__ */ g(s, {
		asChild: !0,
		disableOutsidePointerEvents: !1,
		onInteractOutside: l,
		onEscapeKeyDown: a,
		onPointerDownOutside: o,
		onFocusOutside: t(c, (e) => {
			e.preventDefault();
		}),
		onDismiss: d.onDismiss,
		children: /* @__PURE__ */ g(f, {
			...p,
			...u,
			onPointerDown: t(u.onPointerDown, (e) => {
				e.currentTarget.contains(e.target) && b(!0), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !0;
			}),
			ref: v,
			style: {
				...u.style,
				userSelect: y ? "text" : void 0,
				WebkitUserSelect: y ? "text" : void 0,
				"--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)",
				"--radix-hover-card-content-available-width": "var(--radix-popper-available-width)",
				"--radix-hover-card-content-available-height": "var(--radix-popper-available-height)",
				"--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)",
				"--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)"
			}
		})
	});
}), P = "HoverCardArrow", F = m.forwardRef((e, t) => {
	let { __scopeHoverCard: n, ...r } = e;
	return /* @__PURE__ */ g(d, {
		...x(n),
		...r,
		ref: t
	});
});
F.displayName = P;
function I(e) {
	return (t) => t.pointerType === "touch" ? void 0 : e();
}
function L(e) {
	let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP });
	for (; n.nextNode();) t.push(n.currentNode);
	return t;
}
var R = w, z = E, B = M, V = R, H = h.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ g(z, {
	...n,
	ref: r,
	className: o("cursor-pointer dark:text-primary-white text-primary-black", e),
	children: t
}));
H.displayName = "HoverCardTrigger";
var U = h.forwardRef(({ className: e, align: t = "center", sideOffset: n = 4, ...r }, i) => /* @__PURE__ */ g(B, {
	...r,
	ref: i,
	align: t,
	sideOffset: n,
	className: o("z-50 w-64 border border-primary-gray-300 dark:border-primary-gray-600 text-sm bg-primary-gray-100 dark:bg-primary-gray-650 p-2 text-primary-black dark:text-primary-white outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", e)
}));
U.displayName = B.displayName;
//#endregion
export { U as n, H as r, V as t };

//# sourceMappingURL=hover-card-CvE-cGuW.js.map