"use client";
const require_create_split_props = require("../../utils/create-split-props.cjs");
const require_factory = require("../factory.cjs");
const require_split_presence_props = require("../presence/split-presence-props.cjs");
const require_use_presence = require("../presence/use-presence.cjs");
const require_use_presence_context = require("../presence/use-presence-context.cjs");
const require_use_select_context = require("./use-select-context.cjs");
const require_use_select = require("./use-select.cjs");
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/select/select-root.tsx
var SelectImpl = (props, ref) => {
	const [presenceProps, selectProps] = require_split_presence_props.splitPresenceProps(props);
	const [useSelectProps, localProps] = require_create_split_props.createSplitProps()(selectProps, [
		"closeOnSelect",
		"collection",
		"composite",
		"defaultHighlightedValue",
		"defaultOpen",
		"defaultValue",
		"deselectable",
		"disabled",
		"form",
		"highlightedValue",
		"id",
		"ids",
		"invalid",
		"loopFocus",
		"multiple",
		"name",
		"onFocusOutside",
		"onHighlightChange",
		"onInteractOutside",
		"onOpenChange",
		"onPointerDownOutside",
		"onSelect",
		"onValueChange",
		"open",
		"positioning",
		"readOnly",
		"required",
		"scrollToIndexFn",
		"translations",
		"autoComplete",
		"value"
	]);
	const select = require_use_select.useSelect(useSelectProps);
	const presence = require_use_presence.usePresence((0, _zag_js_react.mergeProps)({ present: select.open }, presenceProps));
	const mergedProps = (0, _zag_js_react.mergeProps)(select.getRootProps(), localProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_select_context.SelectProvider, {
		value: select,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_presence_context.PresenceProvider, {
			value: presence,
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
				...mergedProps,
				ref
			})
		})
	});
};
var SelectRoot = (0, react.forwardRef)(SelectImpl);
//#endregion
exports.SelectRoot = SelectRoot;
