"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useMenuContext } from "./use-menu-context.js";
import { MenuItemProvider } from "./use-menu-item-context.js";
import { MenuItemPropsProvider } from "./use-menu-option-item-props-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/menu/menu-checkbox-item.tsx
var splitOptionItemProps = createSplitProps();
var MenuCheckboxItem = forwardRef((props, ref) => {
	const [partialOptionItemProps, localProps] = splitOptionItemProps(props, [
		"checked",
		"closeOnSelect",
		"disabled",
		"onCheckedChange",
		"value",
		"valueText"
	]);
	const optionItemProps = {
		...partialOptionItemProps,
		type: "checkbox"
	};
	const menu = useMenuContext();
	const mergedProps = mergeProps(menu.getOptionItemProps(optionItemProps), localProps);
	return /* @__PURE__ */ jsx(MenuItemPropsProvider, {
		value: optionItemProps,
		children: /* @__PURE__ */ jsx(MenuItemProvider, {
			value: menu.getOptionItemState(optionItemProps),
			children: /* @__PURE__ */ jsx(ark.div, {
				...mergedProps,
				ref
			})
		})
	});
});
MenuCheckboxItem.displayName = "MenuCheckboxItem";
//#endregion
export { MenuCheckboxItem };
