"use client";
import * as React from "react";
import { useNavigationMenuRootContext } from "../root/NavigationMenuRootContext.js";
import { NavigationMenuPortalContext } from "./NavigationMenuPortalContext.js";
import { jsx } from "react/jsx-runtime";
import { FloatingPortal } from "../../floating-ui-react/components/FloatingPortal.js";
const NavigationMenuPortal = /* @__PURE__ */ React.forwardRef(function NavigationMenuPortal2(props, forwardedRef) {
  const {
    keepMounted = false,
    ...portalProps
  } = props;
  const {
    mounted
  } = useNavigationMenuRootContext();
  const shouldRender = mounted || keepMounted;
  if (!shouldRender) {
    return null;
  }
  return /* @__PURE__ */ jsx(NavigationMenuPortalContext.Provider, {
    value: keepMounted,
    children: /* @__PURE__ */ jsx(FloatingPortal, {
      ref: forwardedRef,
      ...portalProps
    })
  });
});
if (process.env.NODE_ENV !== "production") NavigationMenuPortal.displayName = "NavigationMenuPortal";
export {
  NavigationMenuPortal
};
//# sourceMappingURL=NavigationMenuPortal.js.map
