import * as l from "react";
import { useTooltipRootContext as i } from "../root/TooltipRootContext.js";
import { TooltipPortalContext as s } from "./TooltipPortalContext.js";
import { FloatingPortalLite as p } from "../../utils/FloatingPortalLite.js";
import { jsx as t } from "react/jsx-runtime";
const a = /* @__PURE__ */ l.forwardRef(function(r, e) {
  const {
    keepMounted: o = !1,
    ...n
  } = r;
  return i().useState("mounted") || o ? /* @__PURE__ */ t(s.Provider, {
    value: o,
    children: /* @__PURE__ */ t(p, {
      ref: e,
      ...n
    })
  }) : null;
});
process.env.NODE_ENV !== "production" && (a.displayName = "TooltipPortal");
export {
  a as TooltipPortal
};
