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