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