Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_chunk = require("../chunk-BN4qSVkS.cjs");
const require_styles_common = require("../styles/common.cjs");
const require_styles_z_index = require("../styles/z-index.cjs");
let react = require("react");
react = require_chunk.__toESM(react);
let _emotion_react = require("@emotion/react");
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
let _emotion_css = require("@emotion/css");
let react_dom = require("react-dom");
react_dom = require_chunk.__toESM(react_dom);
let react_tooltip = require("react-tooltip");
//#region src/components/Tooltip.tsx
function Tooltip(props) {
	const maxWidth = props.maxWidth || 260;
	const nodeRef = (0, react.useRef)(null);
	const [nodeReady, setNodeReady] = react.default.useState(false);
	(0, react.useEffect)(() => {
		if (!nodeRef.current) {
			nodeRef.current = document.createElement("div");
			document.body.appendChild(nodeRef.current);
		}
		setNodeReady(true);
		return () => {
			if (nodeRef.current) {
				document.body.removeChild(nodeRef.current);
				nodeRef.current = null;
			}
		};
	}, []);
	const theme = (0, _emotion_react.useTheme)();
	return nodeReady && nodeRef.current ? react_dom.default.createPortal(/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_tooltip.Tooltip, {
		...props,
		id: props.id || "",
		content: props.content || "",
		noArrow: true,
		border: "0.05rem solid rgba(0, 0, 0, 0.1)",
		className: styles({
			theme,
			maxWidth
		}),
		variant: "light",
		clickable: Boolean(props.interactive)
	}), nodeRef.current) : null;
}
const styles = ({ theme, maxWidth }) => _emotion_css.css`
  font-size: "10px";
  color: ${theme.c8Neutral} !important;
  border-radius: 8px !important;
  padding: 16px !important;
  z-index: ${require_styles_z_index.z.tooltip};
  ${require_styles_common.overlaySurface({
	theme,
	important: true
})};

  max-width: ${maxWidth}px;
  word-break: break-word;
  box-shadow:
    0px 1px 4px 0px rgba(0, 0, 0, 0.1),
    0px 4px 8px 0px rgba(0, 0, 0, 0.08) !important;
`;
//#endregion
exports.Tooltip = Tooltip;
