import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsx, jsxs } from 'react/jsx-runtime';

// src/lib/utils.ts
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function CommerceProductFeatures({
  features,
  eyebrow,
  title,
  description,
  variant = "alternating",
  className
}) {
  const hasHeading = Boolean(eyebrow || title || description);
  const heading = hasHeading ? /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-2xl flex-col items-center gap-3 text-center", children: [
    eyebrow ? /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-wide text-primary", children: eyebrow }) : null,
    title ? /* @__PURE__ */ jsx("h2", { className: "text-balance text-3xl font-semibold tracking-tight text-foreground sm:text-4xl", children: title }) : null,
    description ? /* @__PURE__ */ jsx("p", { className: "text-pretty text-lg text-muted-foreground", children: description }) : null
  ] }) : null;
  if (variant === "grid") {
    return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-24 sm:py-32", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-7xl px-6 lg:px-8", children: [
      heading,
      /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-1 gap-x-8 gap-y-12 sm:grid-cols-2 lg:grid-cols-3", hasHeading && "mt-16"), children: features.map((feature, index) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-3", children: [
        feature.icon ? /* @__PURE__ */ jsx("div", { className: "flex size-10 items-center justify-center rounded-lg bg-primary text-primary-foreground [&_svg]:size-5", children: feature.icon }) : null,
        /* @__PURE__ */ jsx("h3", { className: "text-base font-semibold text-foreground", children: feature.title }),
        feature.description ? /* @__PURE__ */ jsx("p", { className: "text-pretty text-sm text-muted-foreground", children: feature.description }) : null
      ] }, index)) })
    ] }) });
  }
  return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-24 sm:py-32", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-7xl px-6 lg:px-8", children: [
    heading,
    /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-16", hasHeading && "mt-16"), children: features.map((feature, index) => {
      const flip = index % 2 === 1;
      return /* @__PURE__ */ jsxs(
        "div",
        {
          className: cn(
            "grid items-center gap-10 lg:grid-cols-2 lg:gap-16"
          ),
          children: [
            /* @__PURE__ */ jsxs(
              "div",
              {
                className: cn(
                  "flex flex-col gap-4",
                  flip && "lg:order-2"
                ),
                children: [
                  /* @__PURE__ */ jsx("h3", { className: "text-balance text-2xl font-semibold tracking-tight text-foreground", children: feature.title }),
                  feature.description ? /* @__PURE__ */ jsx("p", { className: "text-pretty text-base text-muted-foreground", children: feature.description }) : null
                ]
              }
            ),
            feature.media ? /* @__PURE__ */ jsx(
              "div",
              {
                className: cn(
                  "overflow-hidden rounded-2xl bg-muted [&_img]:size-full [&_img]:object-cover",
                  flip && "lg:order-1"
                ),
                children: feature.media
              }
            ) : null
          ]
        },
        index
      );
    }) })
  ] }) });
}

export { CommerceProductFeatures };
//# sourceMappingURL=commerce-product-features.js.map
//# sourceMappingURL=commerce-product-features.js.map