"use client";
import { splitPresenceProps } from "../presence/split-presence-props.js";
import { usePresence } from "../presence/use-presence.js";
import { PresenceProvider } from "../presence/use-presence-context.js";
import { PopoverProvider } from "./use-popover-context.js";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/popover/popover-root-provider.tsx
var PopoverRootProvider = (props) => {
	const [presenceProps, { value: popover, children }] = splitPresenceProps(props);
	return /* @__PURE__ */ jsx(PopoverProvider, {
		value: popover,
		children: /* @__PURE__ */ jsx(PresenceProvider, {
			value: usePresence(mergeProps({ present: popover.open }, presenceProps)),
			children
		})
	});
};
//#endregion
export { PopoverRootProvider };
