/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
let _ariakit_react = require("@ariakit/react");
//#region src/components/client/Select/SelectValue.tsx
function normalizeSelectValue(value) {
	if (typeof value === "string") return value;
	return value.join(", ");
}
function SelectValue({ fallback, children, ...props }) {
	const select = (0, _ariakit_react.useSelectContext)();
	const storeValue = (0, _ariakit_react.useStoreState)(select, "value");
	const items = (0, _ariakit_react.useStoreState)(select, "items");
	const hasValue = storeValue != null && storeValue !== "";
	if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.SelectValue, {
		fallback,
		...props,
		children: (value) => children(normalizeSelectValue(value))
	});
	if (!hasValue) return fallback ?? null;
	return (items?.find((item) => item.value === storeValue))?.element?.textContent ?? storeValue;
}
SelectValue.displayName = "SelectValue";
//#endregion
exports.SelectValue = SelectValue;
