import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { Typography as l } from "../Typography/Typography.es.js";
import a from "../../components/PriceDisplay/priceDisplay.module.css";
import { cn as c } from "../../utils/cn/cn.es.js";
import { shortPeriod as d } from "../../utils/periodView.es.js";
const f = ({ items: s }) => {
  if (!s || s.length === 0)
    return null;
  const n = s.length > 1 ? "double" : "single";
  return /* @__PURE__ */ r("div", { className: a.root, children: s.map((e) => /* @__PURE__ */ i(
    "div",
    {
      className: c(a.container, n === "double" ? a.double : a.single),
      children: [
        /* @__PURE__ */ r(l, { as: "p", defaultVariant: "bodySm", className: a.description, children: e.description }),
        /* @__PURE__ */ i("div", { className: a.priceWrapper, children: [
          e.initialPrice && /* @__PURE__ */ i(l, { as: "p", defaultVariant: "labelSm", className: a.initialPrice, children: [
            "$",
            (e.initialPrice / 100).toFixed(0)
          ] }),
          /* @__PURE__ */ i("div", { className: a.priceColumn, children: [
            e.prefix ? /* @__PURE__ */ r(l, { as: "p", defaultVariant: "bodyXs", className: a.prefix, children: e.prefix }) : e.label ? /* @__PURE__ */ r(l, { as: "p", defaultVariant: "labelXs", emphasis: !0, className: a.label, children: e.label }) : null,
            /* @__PURE__ */ i("div", { className: a.priceAmount, children: [
              /* @__PURE__ */ r(l, { as: "p", defaultVariant: "bodySm", className: a.currency, children: "$" }),
              /* @__PURE__ */ r(l, { as: "p", defaultVariant: "headingLg", className: a.price, children: (e.price / 100).toFixed(0) }),
              /* @__PURE__ */ i("div", { className: a.periodWrapper, children: [
                e.prefix && e.label && /* @__PURE__ */ r(l, { as: "p", defaultVariant: "labelXs", emphasis: !0, className: a.label, children: e.label }),
                e.period !== "none" && /* @__PURE__ */ i(l, { as: "p", defaultVariant: "labelSm", className: a.period, children: [
                  "/",
                  d(e.period)
                ] })
              ] })
            ] })
          ] })
        ] })
      ]
    },
    e.description
  )) });
};
export {
  f as PriceDisplay
};
