import { jsxs as n, jsx as r, Fragment as d } from "react/jsx-runtime";
import { Fragment as c } from "react";
import { cn as m } from "../../utils/cn/cn.es.js";
import { CtaFeaturedIn as u } from "./components/CtaFeaturedIn.es.js";
import e from "../../modules/FeaturedIn/featuredIn.module.css";
import { Typography as i } from "../../components/Typography/Typography.es.js";
import { InfiniteScroll as p } from "../../components/InfiniteScroll/InfiniteScroll.es.js";
function f({ media: l }) {
  return /* @__PURE__ */ r("div", { className: e.mediaFeaturedInBlock, children: l.filter((a) => !!a.logo).map(({ logo: a, url: o }, s) => /* @__PURE__ */ r(
    o ? "a" : "div",
    {
      href: o,
      target: "_blank",
      rel: "noopener noreferrer",
      className: e.mediaFeaturedInImageContainer,
      children: /* @__PURE__ */ r("div", { className: e.mediaFeaturedInImage, style: { backgroundImage: `url(${a})` } })
    },
    `${o}_${s}`
  )) });
}
function h({ quote: l, source: a }) {
  return /* @__PURE__ */ n("div", { className: e.quoteFeaturedInBlock, children: [
    /* @__PURE__ */ n(
      i,
      {
        as: "p",
        defaultVariant: "headingSm",
        mobileVariant: "headingXxs",
        className: e.quoteFeaturedInText,
        children: [
          "“",
          l,
          "”"
        ]
      }
    ),
    a && /* @__PURE__ */ n(i, { as: "p", defaultVariant: "labelXs", emphasis: !0, className: e.quoteFeaturedInSource, children: [
      "— ",
      a
    ] })
  ] });
}
function q({ label: l, title: a, content: o, colorScheme: s = "light" }) {
  return /* @__PURE__ */ n("section", { className: m(e.container, e[s]), children: [
    /* @__PURE__ */ r(i, { as: "p", defaultVariant: "labelMd", mobileVariant: "labelSm", emphasis: !0, className: e.label, children: l }),
    a && /* @__PURE__ */ n(d, { children: [
      /* @__PURE__ */ r("p", { className: m(e.title, e.customTitle), children: a }),
      /* @__PURE__ */ r(i, { as: "p", defaultVariant: "displayMd", className: m(e.title, e.defaultTitle), children: a })
    ] }),
    /* @__PURE__ */ r(
      p,
      {
        items: o,
        contentClassName: e.content,
        itemClassName: e.item,
        rootClassName: e.scrollRoot,
        renderItem: (t) => /* @__PURE__ */ n(c, { children: [
          t.type === "media" && /* @__PURE__ */ r(f, { media: t.media }),
          t.type === "quote" && /* @__PURE__ */ r(h, { quote: t.quote, source: t.source }),
          t.type === "cta" && /* @__PURE__ */ r(u, { buttonLabel: t.button_label, buttonLink: t.button_link })
        ] }, t.type)
      }
    )
  ] });
}
export {
  q as FeaturedIn
};
