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