"use client";
import formatErrorMessage from "../../../../utils/esm/formatErrorMessage.js";
import * as React from "react";
const PopoverRootContext = /* @__PURE__ */ React.createContext(void 0);
if (process.env.NODE_ENV !== "production") PopoverRootContext.displayName = "PopoverRootContext";
function usePopoverRootContext(optional) {
  const context = React.useContext(PopoverRootContext);
  if (context === void 0 && !optional) {
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>." : formatErrorMessage(47));
  }
  return context;
}
export {
  PopoverRootContext,
  usePopoverRootContext
};
//# sourceMappingURL=PopoverRootContext.js.map
