"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_date_picker_context = require("./use-date-picker-context.cjs");
const require_use_date_picker = require("./use-date-picker.cjs");
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/date-picker/date-picker-root.tsx
var splitRootProps = require_create_split_props.createSplitProps();
var DatePickerRoot = (0, react.forwardRef)((props, ref) => {
	const [presenceProps, datePickerProps] = require_split_presence_props.splitPresenceProps(props);
	const [useDatePickerProps, localProps] = splitRootProps(datePickerProps, [
		"closeOnSelect",
		"createCalendar",
		"defaultFocusedValue",
		"defaultOpen",
		"defaultValue",
		"defaultView",
		"disabled",
		"fixedWeeks",
		"focusedValue",
		"format",
		"id",
		"ids",
		"inline",
		"invalid",
		"isDateUnavailable",
		"locale",
		"max",
		"maxView",
		"min",
		"minView",
		"name",
		"numOfMonths",
		"onFocusChange",
		"onOpenChange",
		"onValueChange",
		"onViewChange",
		"onVisibleRangeChange",
		"open",
		"outsideDaySelectable",
		"parse",
		"placeholder",
		"positioning",
		"readOnly",
		"required",
		"selectionMode",
		"startOfWeek",
		"timeZone",
		"translations",
		"value",
		"view",
		"openOnClick",
		"showWeekNumbers",
		"maxSelectedDates"
	]);
	const datePicker = require_use_date_picker.useDatePicker(useDatePickerProps);
	const presence = require_use_presence.usePresence((0, _zag_js_react.mergeProps)({ present: datePicker.open }, presenceProps));
	const mergedProps = (0, _zag_js_react.mergeProps)(datePicker.getRootProps(), localProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_date_picker_context.DatePickerProvider, {
		value: datePicker,
		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
			})
		})
	});
});
DatePickerRoot.displayName = "DatePickerRoot";
//#endregion
exports.DatePickerRoot = DatePickerRoot;
