const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
let decimal_js = require("decimal.js");
decimal_js = require_runtime.__toESM(decimal_js);
//#region src/plus/productSelect/ProductCard/utils.ts
const formatProductPrice = (item) => {
	const { price: _price, original_price: _original_price, is_bundle, minimum_markup_price } = item || {};
	let price = _price;
	let original_price = _original_price;
	if (is_bundle) {
		price = new decimal_js.default(price).plus(new decimal_js.default(minimum_markup_price)).toFixed(2);
		original_price = new decimal_js.default(original_price).plus(new decimal_js.default(minimum_markup_price)).toFixed(2);
	}
	return {
		price,
		original_price
	};
};
/**
* @description: 获取sku卡配置
* @param {ProductCardConfig} finalConfig
* @return {*}
*/
const getSkuCardConfig = (finalConfig) => {
	const { imgHeight, imgWidth, isOriginPrice, isPrice, isProductCover, isStock, isSubtitle, isTitle, radius, showZeroPrice, coverTextFontSize, skuCardPaddingX, skuCardPaddingY, layoutDirection = "row" } = finalConfig;
	return {
		skuCardConfig: {
			displayMode: "display_a9",
			paddingY: skuCardPaddingY,
			paddingX: skuCardPaddingX,
			isBorderVisible: false,
			layoutDirection
		},
		skuActionConfig: { isOpen: false },
		skuExtraConfig: { isOpen: false },
		skuTextConfig: {
			skuSubtitleConfig: { isOpen: isSubtitle },
			skuNameConfig: { isOpen: isTitle },
			skuPriceConfig: {
				isOpen: isPrice || isOriginPrice,
				isPrice,
				isShowZeroPrice: showZeroPrice,
				isOriginPrice
			},
			skuStockConfig: { isOpen: isStock }
		},
		skuImageConfig: {
			isCover: isProductCover,
			width: imgWidth,
			height: imgHeight,
			isTextFallback: true,
			radius,
			textFontSize: coverTextFontSize
		}
	};
};
//#endregion
exports.formatProductPrice = formatProductPrice;
exports.getSkuCardConfig = getSkuCardConfig;
