import { genStyleHooks } from "../../theme/genStyleUtils.js";
import { mergeToken } from "@antdv-next/cssinjs/cssinjs-utils";
import { FastColor } from "@ant-design/fast-color";
//#region components/attachments/style/index.ts
var anyBoxSizing = { "&, *": { boxSizing: "border-box" } };
var genAttachmentsStyle = (token) => {
	const { componentCls, calc, antCls } = token;
	const dropAreaCls = `${componentCls}-drop-area`;
	const placeholderCls = `${componentCls}-placeholder`;
	return { [componentCls]: {
		position: "relative",
		width: "100%",
		...anyBoxSizing,
		"&-rtl": { direction: "rtl" },
		[dropAreaCls]: {
			position: "absolute",
			inset: 0,
			zIndex: token.zIndexPopupBase,
			...anyBoxSizing,
			"&-on-body": {
				position: "fixed",
				inset: 0
			},
			[placeholderCls]: { padding: 0 }
		},
		[placeholderCls]: {
			width: "100%",
			height: "100%",
			borderRadius: token.borderRadius,
			borderWidth: token.lineWidthBold,
			borderStyle: "dashed",
			borderColor: "transparent",
			padding: token.padding,
			position: "relative",
			backdropFilter: "blur(10px)",
			background: token.colorBgPlaceholderHover,
			...anyBoxSizing,
			[`${antCls}-upload-wrapper ${antCls}-upload${antCls}-upload-btn`]: { padding: 0 },
			[`&${placeholderCls}-drag-in`]: { borderColor: token.colorPrimaryHover },
			[`&${placeholderCls}-disabled`]: {
				opacity: .25,
				pointerEvents: "none"
			},
			[`${placeholderCls}-inner`]: {
				display: "flex",
				flexDirection: "column",
				alignItems: "center",
				justifyContent: "center",
				gap: calc(token.paddingXXS).div(2).equal()
			},
			[`${placeholderCls}-icon`]: {
				fontSize: token.fontSizeHeading2,
				lineHeight: 1
			},
			[`${placeholderCls}-title`]: {
				margin: 0,
				fontSize: token.fontSize,
				lineHeight: token.lineHeight
			},
			[`${placeholderCls}-description`]: {
				color: token.colorTextDescription,
				fontSize: token.fontSizeSM
			}
		}
	} };
};
var genFileListStyle = (token) => {
	const { componentCls, calc, antCls } = token;
	const fileListCls = `${componentCls}-list`;
	const cardCls = `${componentCls}-list-card`;
	const cardHeight = calc(token.fontSize).mul(token.lineHeight).mul(2).add(token.paddingSM).add(token.paddingSM).equal();
	return { [componentCls]: { [fileListCls]: {
		boxSizing: "content-box",
		"&-upload-btn": {
			width: cardHeight,
			height: cardHeight,
			fontSize: token.fontSizeHeading2,
			color: "#999"
		},
		[`${cardCls}-status-error`]: {
			borderColor: token.colorError,
			borderWidth: token.lineWidth,
			borderStyle: token.lineType,
			[`${cardCls}-desc`]: { color: token.colorError }
		},
		[`${cardCls}-status-uploading, ${cardCls}-status-error`]: { [`${antCls}-image-cover`]: { opacity: 1 } },
		[`${cardCls}-file-img-mask`]: {
			display: "flex",
			justifyContent: "center",
			alignItems: "center",
			width: "100%",
			height: "100%"
		},
		[`${cardCls}-desc`]: {
			display: "flex",
			flexWrap: "nowrap",
			maxWidth: "100%"
		},
		[`${cardCls}-ellipsis`]: {
			maxWidth: 58,
			overflow: "hidden",
			textOverflow: "ellipsis",
			whiteSpace: "nowrap"
		}
	} } };
};
var prepareComponentToken = (token) => {
	return { colorBgPlaceholderHover: new FastColor(token.colorBgContainer).setA(.85).toRgbString() };
};
var style_default = genStyleHooks("Attachments", (token) => {
	const compToken = mergeToken(token, {});
	return [genAttachmentsStyle(compToken), genFileListStyle(compToken)];
}, prepareComponentToken);
//#endregion
export { style_default as default, prepareComponentToken };
