var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.tsx
var MemberPrice_exports = {};
__export(MemberPrice_exports, {
  default: () => MemberPrice_default
});
module.exports = __toCommonJS(MemberPrice_exports);
var import_react = __toESM(require("react"));
var import_utils = require("@pisell/utils");
var import_materials = require("@pisell/materials");
var import_pisellPriceText = __toESM(require("../../../../components/pisellPriceText"));
var import_status = require("../../status");
var import_index = require("./index.less");
var MemberPrice = ({ props }) => {
  const { dataSource, skuTextConfig } = props;
  const {
    isOpen,
    isMemberPrice,
    isIndicator,
    isIndicatorBorder,
    indicatorBackground,
    indicatorPaddingY,
    indicatorPaddingX,
    indicatorMarginX,
    indicatorRadius,
    indicatorBorderWidth,
    indicatorBorderColor,
    indicatorFontSize,
    indicatorFontWeight,
    indicatorColor,
    fontSize,
    fontWeight,
    color,
    indicatorIcon,
    customText
  } = (skuTextConfig == null ? void 0 : skuTextConfig.skuMemberPriceConfig) || {};
  if (!isOpen) return null;
  if (customText) return customText;
  const memberPriceStyle = (0, import_react.useMemo)(() => {
    return {
      fontSize,
      fontWeight,
      color
    };
  }, [fontSize, fontWeight, color]);
  const indicatorStyle = (0, import_react.useMemo)(() => {
    return {
      backgroundColor: indicatorBackground,
      padding: `${indicatorPaddingY}px ${indicatorPaddingX}px`,
      margin: `0 ${indicatorMarginX}px`,
      border: isIndicatorBorder ? `${indicatorBorderWidth}px solid ${indicatorBorderColor}` : "none",
      borderRadius: indicatorRadius,
      fontSize: indicatorFontSize,
      fontWeight: indicatorFontWeight,
      color: indicatorColor
    };
  }, [
    indicatorBackground,
    indicatorPaddingY,
    indicatorPaddingX,
    indicatorMarginX,
    indicatorRadius,
    indicatorBorderWidth,
    indicatorBorderColor,
    indicatorFontSize,
    indicatorFontWeight,
    indicatorColor,
    isIndicatorBorder
  ]);
  return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import_status.PREFIX}__card-member-price` }, isMemberPrice ? /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      className: `${import_status.PREFIX}__card-member-price-text`,
      style: memberPriceStyle
    },
    /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { value: (dataSource == null ? void 0 : dataSource.member_price) || 0 })
  ) : null, isIndicator ? /* @__PURE__ */ import_react.default.createElement(import_materials.PisellTags, { type: "pill_color", style: indicatorStyle }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${import_status.PREFIX}__card-member-price-tag` }, indicatorIcon ? indicatorIcon : /* @__PURE__ */ import_react.default.createElement(
    import_materials.Icon,
    {
      type: "pisell2-check-verified-02",
      size: 12,
      rotate: 0,
      spin: false,
      color: "#CA8504"
    }
  ), /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.sku-card.member-price")))) : null);
};
var MemberPrice_default = MemberPrice;
