const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_calendarI18n = require("../calendarI18n.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _ant_design_icons = require("@ant-design/icons");
//#region src/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarBlockPanel.tsx
const { RangePicker } = antd.DatePicker;
/**
* 内置锁台 / 屏蔽时间表单（宿主未传 `onBlockedTimePanelRequest` 时使用）。
*/
function BookingCalendarBlockPanel({ blockPanelRef, isLight, blockFormName, setBlockFormName, blockModalNote, setBlockModalNote, blockResourceId, setBlockResourceId, blockTimeRange, setBlockTimeRange, resolvedSlotMinutes, visibleCourts, blockSaving, onClose, onSave }) {
	return /* @__PURE__ */ react.default.createElement("div", { className: "fixed inset-0 z-50 bg-black/55 backdrop-blur-sm flex items-end md:items-center justify-center p-2 md:p-4" }, /* @__PURE__ */ react.default.createElement("div", {
		ref: blockPanelRef,
		className: `w-full max-w-[720px] max-h-[92vh] overflow-y-auto rounded-t-3xl md:rounded-3xl border p-4 md:p-6 shadow-2xl ${isLight ? "theme-panel theme-border soft-shadow" : "border-zinc-700 bg-[#121217]"}`
	}, /* @__PURE__ */ react.default.createElement("div", { className: "mb-4 flex items-center justify-between gap-3" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-xl font-semibold" }, require_calendarI18n.tCal("pisell2.recordBoard.calendar.block.panelTitle")), /* @__PURE__ */ react.default.createElement("button", {
		type: "button",
		"aria-label": require_calendarI18n.tCal("pisell2.recordBoard.calendar.block.closeAria"),
		onClick: onClose,
		className: `rounded-xl p-2 ${isLight ? "btn-neutral" : "border border-zinc-700 text-zinc-300"}`
	}, /* @__PURE__ */ react.default.createElement(_ant_design_icons.CloseOutlined, { style: { fontSize: 20 } }))), /* @__PURE__ */ react.default.createElement("div", { className: `space-y-4 rounded-2xl border p-4 ${isLight ? "theme-panel-alt theme-border" : "border-zinc-700 bg-[#171820]"}` }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, require_calendarI18n.tCal("pisell2.recordBoard.calendar.block.fieldTitle")), /* @__PURE__ */ react.default.createElement("input", {
		value: blockFormName,
		onChange: (e) => setBlockFormName(e.target.value),
		placeholder: require_calendarI18n.tCal("pisell2.recordBoard.calendar.block.placeholderTitle"),
		className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
	})), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, "备注"), /* @__PURE__ */ react.default.createElement("input", {
		value: blockModalNote,
		onChange: (e) => setBlockModalNote(e.target.value),
		placeholder: "选填",
		className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
	})), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, require_calendarI18n.tCal("pisell2.recordBoard.calendar.block.fieldResource")), /* @__PURE__ */ react.default.createElement("select", {
		value: blockResourceId,
		onChange: (e) => setBlockResourceId(e.target.value),
		className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
	}, /* @__PURE__ */ react.default.createElement("option", { value: "" }, require_calendarI18n.tCal("pisell2.recordBoard.calendar.block.noResource")), visibleCourts.map((c) => /* @__PURE__ */ react.default.createElement("option", {
		key: c.id,
		value: String(c.id)
	}, c.name)))), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, require_calendarI18n.tCal("pisell2.recordBoard.calendar.block.fieldTimeRange")), /* @__PURE__ */ react.default.createElement(RangePicker, {
		style: { width: "100%" },
		showTime: {
			format: "HH:mm",
			minuteStep: resolvedSlotMinutes >= 60 ? 60 : Math.max(1, resolvedSlotMinutes)
		},
		format: "YYYY-MM-DD HH:mm",
		value: blockTimeRange !== null && blockTimeRange !== void 0 ? blockTimeRange : void 0,
		onChange: (v) => {
			var _ref;
			return setBlockTimeRange((_ref = v) !== null && _ref !== void 0 ? _ref : null);
		}
	}))), /* @__PURE__ */ react.default.createElement("div", { className: "mt-6 flex flex-col-reverse sm:flex-row items-stretch sm:items-center justify-end gap-3" }, /* @__PURE__ */ react.default.createElement("button", {
		type: "button",
		disabled: blockSaving,
		onClick: onClose,
		className: `rounded-xl px-4 py-2 ${isLight ? "btn-neutral" : "border border-zinc-700 text-zinc-300"}`
	}, require_calendarI18n.tCal("pisell2.recordBoard.calendar.common.cancel")), /* @__PURE__ */ react.default.createElement("button", {
		type: "button",
		disabled: blockSaving,
		onClick: () => void onSave(),
		className: `rounded-xl px-5 py-3 text-sm font-semibold disabled:opacity-50 ${isLight ? "btn-brand" : "bg-violet-600 text-white"}`
	}, blockSaving ? require_calendarI18n.tCal("pisell2.recordBoard.calendar.common.saving") : require_calendarI18n.tCal("pisell2.recordBoard.calendar.common.save")))));
}
//#endregion
exports.BookingCalendarBlockPanel = BookingCalendarBlockPanel;
