const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../../locales/index.js");
const require_useOverflowActions = require("../hooks/useOverflowActions.js");
const require_classNames = require("../utils/classNames.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _ant_design_icons_UpOutlined = require("@ant-design/icons/UpOutlined");
_ant_design_icons_UpOutlined = require_runtime.__toESM(_ant_design_icons_UpOutlined);
//#region src/components/PisellProcedure/components/FooterActions.tsx
/**
* FooterActions 底部操作区组件
* @description 实现底部操作区的左右布局：左侧自定义内容 + 右侧操作按钮（支持溢出收纳）
* 收纳规则：从左到右依次收纳（优先级低的先收纳），保留右侧的主要操作按钮
* @author Pisell Team
*/
const FooterActions = ({ leftSlot, children, className, moreText, gap = 16 }) => {
	const { containerRef, measureRef, moreButtonRef, leftSlotRef, actionItems, visibleActions, hasOverflow, moreMenuItems } = require_useOverflowActions.useOverflowActions({
		children,
		gap,
		moreText
	});
	/** 容器类名 */
	const containerCls = require_classNames.mergeClassNames("pisell-procedure-footer__content", className);
	/** 是否有左侧内容 */
	const hasLeftSlot = leftSlot !== void 0 && leftSlot !== null;
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", {
		ref: measureRef,
		style: {
			position: "absolute",
			visibility: "hidden",
			pointerEvents: "none",
			display: "flex",
			gap,
			whiteSpace: "nowrap",
			left: -9999,
			top: -9999
		},
		"aria-hidden": "true"
	}, actionItems.map((item, index) => /* @__PURE__ */ react.default.createElement("div", {
		key: index,
		"data-measure-item": true,
		style: { flexShrink: 0 }
	}, item))), /* @__PURE__ */ react.default.createElement("div", {
		ref: moreButtonRef,
		style: {
			position: "absolute",
			visibility: "hidden",
			pointerEvents: "none",
			left: -9999,
			top: -9999
		},
		"aria-hidden": "true"
	}, /* @__PURE__ */ react.default.createElement(antd.Button, { icon: /* @__PURE__ */ react.default.createElement(_ant_design_icons_UpOutlined.default, null) }, moreText)), /* @__PURE__ */ react.default.createElement("div", {
		ref: containerRef,
		className: containerCls,
		style: { gap }
	}, hasLeftSlot && /* @__PURE__ */ react.default.createElement("div", {
		ref: leftSlotRef,
		className: "pisell-procedure-footer__left"
	}, leftSlot), /* @__PURE__ */ react.default.createElement("div", {
		className: "pisell-procedure-footer__actions",
		style: { gap }
	}, hasOverflow && /* @__PURE__ */ react.default.createElement(antd.Dropdown, { menu: { items: moreMenuItems } }, /* @__PURE__ */ react.default.createElement(antd.Button, { icon: /* @__PURE__ */ react.default.createElement(_ant_design_icons_UpOutlined.default, null) }, moreText || require_index.getText("pisell-procedure-footer-more"))), visibleActions)));
};
FooterActions.displayName = "FooterActions";
//#endregion
exports.default = FooterActions;
