import { jsx as r, jsxs as c, Fragment as I } from "react/jsx-runtime";
import { forwardRef as T } from "react";
import { C as o } from "./card-DiMVw06l.mjs";
import { a as s } from "./paragraph-DNtj7OLr.mjs";
import { c as l } from "./bind-CU-R61T-.mjs";
import { a as rr } from "./color-dot-6Mxngvce.mjs";
import { b as tr, A as C } from "./alert-badge-u7qAhYbR.mjs";
import { i as ar } from "./arrow-right.es-C7SkjAB6.mjs";
import { b as or } from "./icon-DNHpBTHs-JfI8WyiR.mjs";
const cr = {
  "purpur-colors": "_purpur-colors_1190y_1"
}, dr = l.bind(cr), er = "purpur-colors", B = ({
  ["aria-label"]: t,
  ["data-testid"]: a = "purpur-colors",
  colors: d,
  colorDotAriaLabels: e
}) => !!d?.length && /* @__PURE__ */ r("ul", { className: dr(er), "data-testid": a, "aria-label": t, children: d.map((p, g) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
  rr,
  {
    "data-testid": `${a}-color-dot`,
    withBorder: !0,
    color: p,
    size: "xs",
    "aria-label": e && e[g]
  }
) }, p)) }), pr = {
  "purpur-price": "_purpur-price_1lcgf_1",
  "purpur-price__price-container": "_purpur-price__price-container_1lcgf_7",
  "purpur-price__price-text--discount": "_purpur-price__price-text--discount_1lcgf_12"
}, f = l.bind(pr), $ = "purpur-price", K = ({
  ["data-testid"]: t = "purpur-price",
  regularPriceText: a,
  priceDescription: d,
  priceText: e,
  pricePrefix: p
}) => !a && !e && !p && !d ? null : /* @__PURE__ */ c("div", { className: f($), "data-testid": t, children: [
  a && /* @__PURE__ */ r(s, { "data-testid": `${t}-regular`, variant: "additional-100", children: a }),
  /* @__PURE__ */ c("div", { className: f(`${$}__price-container`), children: [
    p && /* @__PURE__ */ r(s, { "data-testid": `${t}-from`, variant: "paragraph-200", children: p }),
    e && /* @__PURE__ */ r(
      s,
      {
        className: f(`${$}__price-text`, {
          [`${$}__price-text--discount`]: !!a
        }),
        "data-testid": `${t}-actual`,
        variant: "paragraph-100-bold",
        children: e
      }
    )
  ] }),
  d && /* @__PURE__ */ r(s, { "data-testid": `${t}-description`, variant: "additional-100", children: d })
] }), ir = {
  "purpur-product-card__content-container": "_purpur-product-card__content-container_71zwa_1",
  "purpur-product-card__product-image": "_purpur-product-card__product-image_71zwa_9",
  "purpur-product-card__product-image--md": "_purpur-product-card__product-image--md_71zwa_17",
  "purpur-product-card__product-image--lg": "_purpur-product-card__product-image--lg_71zwa_20",
  "purpur-product-card__body": "_purpur-product-card__body_71zwa_24",
  "purpur-product-card__footer": "_purpur-product-card__footer_71zwa_29",
  "purpur-product-card-with-cta-text": "_purpur-product-card-with-cta-text_71zwa_34",
  "purpur-product-card__cta-button": "_purpur-product-card__cta-button_71zwa_39"
}, ur = {
  "purpur-product-header": "_purpur-product-header_1athi_1",
  "purpur-product-header__product-image": "_purpur-product-header__product-image_1athi_7",
  "purpur-product-header__product-information": "_purpur-product-header__product-information_1athi_21"
}, w = l.bind(ur), b = "purpur-product-header", k = ({
  ["data-testid"]: t = "purpur-product-header",
  children: a
}) => a.productImage ? /* @__PURE__ */ c("div", { className: w(b), "data-testid": t, children: [
  /* @__PURE__ */ r("div", { className: w(`${b}__product-image`), children: a.productImage }),
  /* @__PURE__ */ r("div", { className: w(`${b}__product-information`), children: /* @__PURE__ */ r(o.Content, { children: a.productInformation }) })
] }) : a.productInformation, nr = {
  "purpur-stock-status": "_purpur-stock-status_dslay_1"
}, sr = l.bind(nr), S = {
  IN_STOCK: "in-stock",
  BACK_IN_STOCK: "back-in-stock",
  NOT_IN_STOCK: "not-in-stock"
}, _r = {
  [S.IN_STOCK]: C.SUCCESS,
  [S.BACK_IN_STOCK]: C.WARNING,
  [S.NOT_IN_STOCK]: C.ERROR
}, lr = "purpur-stock-status", x = ({
  ["data-testid"]: t = "purpur-stock-status",
  stockStatus: a,
  stockStatusText: d
}) => a && d && /* @__PURE__ */ c("div", { className: sr(lr), "data-testid": t, children: [
  /* @__PURE__ */ r(tr, { variant: _r[a] }),
  /* @__PURE__ */ r(s, { variant: "paragraph-100-medium", children: d })
] }), mr = {
  name: "cart",
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M1.6 3a.9.9 0 0 1 .9-.9H5a.9.9 0 0 1 .88.713L8.275 14.1h10.54l2-7.2H10a.9.9 0 0 1 0-1.8h12a.9.9 0 0 1 .867 1.14l-2.5 9a.9.9 0 0 1-.867.66H8.656l.263 1.236a2.403 2.403 0 0 1 1.806 1.464h5.55a2.4 2.4 0 1 1 0 1.8h-5.55a2.4 2.4 0 1 1-3.567-2.89L4.27 3.9H2.5a.9.9 0 0 1-.9-.9Zm6.9 15.9a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Zm10 0a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Z" clip-rule="evenodd"/></svg>',
  keywords: ["cart"],
  category: "other"
}, H = (t) => /* @__PURE__ */ r(or, { ...t, svg: mr });
H.displayName = "IconCart";
const n = l.bind(ir), i = "purpur-product-card", m = T(
  ({
    ["data-testid"]: t = "purpur-product-card",
    badgeText: a,
    badgeVariant: d,
    bodyText: e,
    children: p,
    className: g,
    colorVariants: R,
    colorNames: P,
    colorListAriaLabel: E,
    ctaText: h,
    disabled: N,
    fullHeight: y = !0,
    footerContent: z,
    headingTag: L = "h2",
    href: u,
    onClick: _,
    linkElement: F,
    listItems: A,
    loading: Z = !1,
    overline: j,
    priceText: G,
    priceDescription: M,
    pricePrefix: U,
    image: O,
    imageSize: V = "sm",
    title: W,
    regularPriceText: q,
    stockStatus: D,
    stockStatusText: J,
    ...Q
  }, X) => {
    const Y = n(g, i), v = {
      title: W,
      titleTag: L,
      variant: "title-200",
      "data-testid": `${t}-product-name`
    };
    return /* @__PURE__ */ c(
      o,
      {
        className: Y,
        "data-testid": t,
        fullHeight: y,
        ref: X,
        ...Q,
        children: [
          /* @__PURE__ */ r(o.Badge, { text: a, variant: d, "data-testid": `${t}-badge` }),
          /* @__PURE__ */ c(
            o.ContentContainer,
            {
              gapSize: "lg",
              className: n(`${i}__content-container`),
              fullHeight: y,
              children: [
                /* @__PURE__ */ c(o.Content, { children: [
                  /* @__PURE__ */ r(k, { "data-testid": `${t}-product-header`, children: {
                    productImage: O ? /* @__PURE__ */ r(
                      "div",
                      {
                        className: n(
                          `${i}__product-image`,
                          `${i}__product-image--${V}`
                        ),
                        "data-testid": `${t}-product-image`,
                        children: O
                      }
                    ) : null,
                    productInformation: /* @__PURE__ */ c(I, { children: [
                      /* @__PURE__ */ c("div", { children: [
                        /* @__PURE__ */ r(o.Overline, { "data-testid": `${t}-overline`, overline: j }),
                        u && /* @__PURE__ */ r(
                          o.Heading,
                          {
                            href: u,
                            linkElement: F,
                            disabled: N,
                            onClick: _,
                            ...v
                          }
                        ),
                        _ && !u && /* @__PURE__ */ r(o.Heading, { disabled: N, onClick: _, ...v }),
                        !u && !_ && /* @__PURE__ */ r(o.Heading, { ...v })
                      ] }),
                      /* @__PURE__ */ r(
                        B,
                        {
                          colors: R,
                          colorDotAriaLabels: P,
                          "aria-label": E,
                          "data-testid": `${t}-colors`
                        }
                      )
                    ] })
                  } }),
                  (e || !!A?.length) && /* @__PURE__ */ c("div", { className: n(`${i}__body`), children: [
                    e && /* @__PURE__ */ r(s, { "data-testid": `${t}-body-text`, children: e }),
                    /* @__PURE__ */ r(
                      o.FeatureList,
                      {
                        "data-testid": `${t}-feature-list`,
                        listItems: A
                      }
                    )
                  ] })
                ] }),
                p && /* @__PURE__ */ r(
                  o.Content,
                  {
                    className: `${i}__children`,
                    "data-testid": `${t}-default-content`,
                    children: p
                  }
                )
              ]
            }
          ),
          /* @__PURE__ */ c("div", { children: [
            /* @__PURE__ */ c(o.ContentContainer, { isFooter: !0, children: [
              /* @__PURE__ */ r(o.Content, { children: /* @__PURE__ */ c(
                "div",
                {
                  className: n(`${i}__footer`, {
                    [`${i}-with-cta-text`]: h
                  }),
                  children: [
                    /* @__PURE__ */ r(
                      K,
                      {
                        "data-testid": `${t}-price`,
                        pricePrefix: U,
                        regularPriceText: q,
                        priceDescription: M,
                        priceText: G
                      }
                    ),
                    (u || _) && /* @__PURE__ */ r(
                      o.Cta,
                      {
                        className: n(`${i}__cta-button`),
                        "data-testid": `${t}-cta-button`,
                        disabled: N,
                        iconPosition: h ? u ? "right" : "left" : void 0,
                        loading: Z,
                        text: h,
                        linkStyling: !!(u && !h),
                        children: u ? /* @__PURE__ */ r(ar, { size: "sm" }) : /* @__PURE__ */ r(H, { size: "sm" })
                      }
                    )
                  ]
                }
              ) }),
              z && /* @__PURE__ */ r(o.Content, { "data-testid": `${t}-footer-content`, children: z })
            ] }),
            /* @__PURE__ */ r(
              x,
              {
                "data-testid": `${t}-stock-status`,
                stockStatus: D,
                stockStatusText: J
              }
            )
          ] })
        ]
      }
    );
  }
);
m.Colors = B;
m.Price = K;
m.ProductHeader = k;
m.StockStatus = x;
m.displayName = "ProductCard";
export {
  m as P
};
//# sourceMappingURL=product-card-rfpJbzzV.mjs.map
