var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
import { jsx, jsxs } from "react/jsx-runtime";
import React from "react";
import styled, { css } from "styled-components";
import { string, node } from "prop-types";
import theme from "../../../Theme/helpers/themeReader";
import Text from "../../../Text";
import Content from "../Card/Content";
import Subtitle from "./Subtitle";
import Divider from "../../../Divider";
const Wrapper = styled(Content)`
  flex: 1;
`;
const Title = styled(Text.Body1)`
  ${(props) => {
  const {
    components: { card, cardweb },
    colors,
    radii
  } = theme(props);
  const { badgeColor } = props;
  const badgeStyle = badgeColor && css`
        ::before {
          position: absolute;
          left: 0;
          content: '';
          height: 24px;
          width: 4px;
          background-color: ${colors[badgeColor] || badgeColor};
          border-top-right-radius: ${radii.xsmall}px;
          border-bottom-right-radius: ${radii.xsmall}px;
        }
      `;
  return css`
      color: ${card.plan.title.color};
      margin-bottom: ${cardweb.plan.title.margin.bottom}px;
      line-height: ${cardweb.plan.title.lineHeight}px;
      ${badgeStyle}
    `;
}}
`;
const Description = styled(Text.Small)`
  height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  color: ${theme.components.card.plan.description.color};

  overflow: hidden;
  text-overflow: ellipsis;
  text-overflow: -o-ellipsis-lastline;
`;
const Price = styled.div`
  display: flex;

  ${(props) => {
  const {
    components: { cardweb }
  } = theme(props);
  return css`
      margin-bottom: ${cardweb.plan.price.margin.bottom}px;
    `;
}}
`;
const EnhancePrice = styled(Text.Medium)`
  align-self: center;
`;
const PlanCardContent = (_a) => {
  var _b = _a, {
    title,
    badgeColor = null,
    subtitle = null,
    description = null,
    currency = null,
    suffix = null,
    price = null,
    period = null,
    extra = null,
    children = null
  } = _b, rest = __objRest(_b, [
    "title",
    "badgeColor",
    "subtitle",
    "description",
    "currency",
    "suffix",
    "price",
    "period",
    "extra",
    "children"
  ]);
  return /* @__PURE__ */ jsxs(Wrapper, __spreadProps(__spreadValues({}, rest), { children: [
    subtitle && /* @__PURE__ */ jsx(Subtitle, { children: subtitle }),
    title && /* @__PURE__ */ jsx(Title, { bold: true, badgeColor, children: title }),
    description && /* @__PURE__ */ jsx(Description, { children: description }),
    !!price && /* @__PURE__ */ jsxs(Price, { children: [
      currency && /* @__PURE__ */ jsx(Text.H4, { as: "sup", children: currency }),
      price && /* @__PURE__ */ jsx(Text.H4, { as: "strong", children: price }),
      suffix && /* @__PURE__ */ jsx(Text.H4, { as: "sup", children: suffix }),
      period && /* @__PURE__ */ jsx(EnhancePrice, { as: "sub", children: period })
    ] }),
    extra,
    /* @__PURE__ */ jsx(Divider, {}),
    children
  ] }));
};
PlanCardContent.propTypes = {
  /** plan name */
  title: string.isRequired,
  /** currency of the current country */
  currency: string,
  /** suffix currency of the current country */
  suffix: string,
  price: string,
  /** period that this price will be charged  */
  period: string,
  description: string,
  subtitle: string,
  extra: node,
  children: node,
  /** color of the badge attached to the title  */
  badgeColor: string
};
PlanCardContent.displayName = "PlanCard.Content";
var Content_default = PlanCardContent;
export {
  Content_default as default
};
