const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _ant_design_icons = require("@ant-design/icons");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
//#region src/components/pisellFloorMapLayout/components/FloorMapEditQuickActions.tsx
/**
* 编辑态选中图元旁的快捷操作：锁定 / 复制 / 删除（与侧栏同源逻辑）
*/
const PREFIX = "pisell-floor-map-layout";
function FloorMapEditQuickActions(props) {
	const { className, labels, isLocked, onToggleLock, onDuplicate, onDelete, viewportScale = 1 } = props;
	const stopBubble = (0, react.useCallback)((e) => {
		e.stopPropagation();
	}, []);
	const safeScale = Math.max(viewportScale, .01);
	const inv = 1 / safeScale;
	const gap = 10 / safeScale;
	return /* @__PURE__ */ react.default.createElement("div", {
		role: "toolbar",
		"aria-label": labels.ariaToolbar,
		className: (0, classnames.default)(`${PREFIX}-edit-quick-actions`, isLocked && `${PREFIX}-edit-quick-actions--locked`, className),
		style: {
			transform: `translate(-50%, ${gap}px) scale(${inv})`,
			transformOrigin: "top center"
		},
		onPointerDown: (e) => e.stopPropagation()
	}, /* @__PURE__ */ react.default.createElement(antd.Tooltip, { title: isLocked ? labels.unlock : labels.lock }, /* @__PURE__ */ react.default.createElement(antd.Button, {
		type: "text",
		size: "large",
		icon: isLocked ? /* @__PURE__ */ react.default.createElement(_ant_design_icons.LockOutlined, null) : /* @__PURE__ */ react.default.createElement(_ant_design_icons.UnlockOutlined, null),
		onClick: (e) => {
			stopBubble(e);
			onToggleLock();
		},
		"aria-pressed": isLocked
	})), /* @__PURE__ */ react.default.createElement(antd.Tooltip, { title: labels.duplicate }, /* @__PURE__ */ react.default.createElement(antd.Button, {
		type: "text",
		size: "large",
		icon: /* @__PURE__ */ react.default.createElement(_ant_design_icons.CopyOutlined, null),
		onClick: (e) => {
			stopBubble(e);
			onDuplicate();
		}
	})), /* @__PURE__ */ react.default.createElement(antd.Popconfirm, {
		title: labels.popTitle,
		description: labels.popDesc,
		onConfirm: () => onDelete(),
		okText: labels.okDelete,
		cancelText: labels.cancel,
		okButtonProps: { danger: true }
	}, /* @__PURE__ */ react.default.createElement(antd.Tooltip, { title: labels.delete }, /* @__PURE__ */ react.default.createElement(antd.Button, {
		type: "text",
		danger: true,
		size: "large",
		icon: /* @__PURE__ */ react.default.createElement(_ant_design_icons.DeleteOutlined, null),
		onClick: stopBubble
	}))));
}
//#endregion
exports.FloorMapEditQuickActions = FloorMapEditQuickActions;
