"use client";
import { ark } from "../factory.js";
import { useDatePickerContext } from "./use-date-picker-context.js";
import { uniq } from "@zag-js/utils";
import { forwardRef, useMemo } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/date-picker/date-picker-range-text.tsx
var DatePickerRangeText = forwardRef((props, ref) => {
	const datePicker = useDatePickerContext();
	const mergedProps = mergeProps(datePicker.getRangeTextProps(), props);
	const visibleRangeText = useMemo(() => {
		const { start, end } = datePicker.visibleRangeText;
		return uniq([start, end]).filter(Boolean).join(" - ");
	}, [datePicker.visibleRangeText]);
	return /* @__PURE__ */ jsx(ark.div, {
		...mergedProps,
		ref,
		children: visibleRangeText
	});
});
DatePickerRangeText.displayName = "DatePickerRangeText";
//#endregion
export { DatePickerRangeText };
