const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _ant_design_icons = require("@ant-design/icons");
//#region src/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarGroupRowHeader.tsx
/**
* 日视图 / 周视图共用的分组头左侧 sticky 单元（折叠箭头 + 分组名 + 数量角标）。
* 样式单点维护，与 {@link buildGroupedCourtRows} 的 group 行对应。
*/
/** 左侧分组列：周与日共用同一套 gradient / 字号 / 角标，避免分叉维护 */
const STICKY_GROUP_SHELL = "sticky left-0 z-30 flex h-full min-h-0 w-[132px] min-w-[132px] max-w-[132px] items-center border-b px-2 py-1 shadow-[8px_0_16px_rgba(0,0,0,0.08)]";
const STICKY_GROUP_LIGHT = "border-slate-200 bg-gradient-to-b from-slate-100 to-slate-50";
const STICKY_GROUP_DARK = "border-zinc-800/80 bg-gradient-to-b from-[#252038] to-[#1a1628]";
function BookingCalendarGroupRowHeader(props) {
	const { isLight, view, row, renderResourceCell, setCollapsedGroups, style } = props;
	return /* @__PURE__ */ react.default.createElement("div", {
		className: `${STICKY_GROUP_SHELL} ${isLight ? STICKY_GROUP_LIGHT : STICKY_GROUP_DARK}`,
		style
	}, renderResourceCell ? renderResourceCell({
		view,
		row: {
			kind: "group",
			id: row.id,
			label: row.label,
			count: row.count,
			collapsed: row.collapsed
		},
		isLight,
		onToggleGroup: (label) => setCollapsedGroups((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), {}, { [label]: !prev[label] }))
	}) : /* @__PURE__ */ react.default.createElement("button", {
		type: "button",
		"aria-expanded": !row.collapsed,
		onClick: () => setCollapsedGroups((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), {}, { [row.label]: !prev[row.label] })),
		className: `flex w-full min-h-0 items-center gap-2 rounded-lg px-1 py-0.5 text-left transition-colors ${isLight ? "" : "active:bg-white/[0.07]"}`
	}, /* @__PURE__ */ react.default.createElement(_ant_design_icons.DownOutlined, {
		style: { fontSize: 14 },
		className: `shrink-0 self-center transition-transform duration-200 ${isLight ? "text-slate-500" : "text-zinc-500"} ${row.collapsed ? "-rotate-90" : "rotate-0"}`,
		"aria-hidden": true
	}), /* @__PURE__ */ react.default.createElement("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-1.5" }, /* @__PURE__ */ react.default.createElement("span", { className: `pisell-rb-cal-week-resource-name min-w-0 flex-1 truncate text-[13px] font-semibold leading-snug ${isLight ? "text-slate-800" : "text-zinc-100"}` }, row.label), /* @__PURE__ */ react.default.createElement("span", { className: `shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${isLight ? "bg-violet-100 text-violet-800" : "bg-zinc-800/90 text-zinc-300 ring-1 ring-zinc-600/40"}` }, row.count))));
}
//#endregion
exports.BookingCalendarGroupRowHeader = BookingCalendarGroupRowHeader;
