"use client";
'use strict';

var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var React = require('react');
var jsxRuntime = require('react/jsx-runtime');
var img = require('@page-speed/img');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);

// lib/utils.ts
function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
var svgCache = /* @__PURE__ */ new Map();
function DynamicIcon({
  name,
  size = 28,
  color,
  className,
  alt
}) {
  const [svgContent, setSvgContent] = React__namespace.useState(null);
  const [isLoading, setIsLoading] = React__namespace.useState(true);
  const [error, setError] = React__namespace.useState(null);
  const { url, iconName } = React__namespace.useMemo(() => {
    const separator = name.includes("/") ? "/" : ":";
    const [prefix, iconName2] = name.split(separator);
    const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
    return {
      url: baseUrl,
      iconName: iconName2
    };
  }, [name, size]);
  React__namespace.useEffect(() => {
    let isMounted = true;
    const fetchSvg = async () => {
      const cached = svgCache.get(url);
      if (cached) {
        if (isMounted) {
          setSvgContent(cached);
          setIsLoading(false);
        }
        return;
      }
      try {
        setIsLoading(true);
        setError(null);
        const response = await fetch(url);
        if (!response.ok) {
          throw new Error(`Failed to fetch icon: ${response.status}`);
        }
        let svg = await response.text();
        svg = processSvgForCurrentColor(svg);
        svgCache.set(url, svg);
        if (isMounted) {
          setSvgContent(svg);
          setIsLoading(false);
        }
      } catch (err) {
        if (isMounted) {
          setError(err instanceof Error ? err.message : "Failed to load icon");
          setIsLoading(false);
        }
      }
    };
    fetchSvg();
    return () => {
      isMounted = false;
    };
  }, [url]);
  if (isLoading) {
    return /* @__PURE__ */ jsxRuntime.jsx(
      "span",
      {
        className: cn("inline-block", className),
        style: { width: size, height: size },
        "aria-hidden": "true"
      }
    );
  }
  if (error || !svgContent) {
    return /* @__PURE__ */ jsxRuntime.jsx(
      "span",
      {
        className: cn("inline-block", className),
        style: { width: size, height: size },
        role: "img",
        "aria-label": alt || iconName
      }
    );
  }
  return /* @__PURE__ */ jsxRuntime.jsx(
    "span",
    {
      className: cn("inline-flex items-center justify-center", className),
      style: {
        width: size,
        height: size,
        color: color || "inherit"
      },
      role: "img",
      "aria-label": alt || iconName,
      dangerouslySetInnerHTML: { __html: svgContent }
    }
  );
}
function processSvgForCurrentColor(svg) {
  let processed = svg;
  processed = processed.replace(
    /stroke=["'](#000000|#000|black)["']/gi,
    'stroke="currentColor"'
  );
  processed = processed.replace(
    /fill=["'](#000000|#000|black)["']/gi,
    'fill="currentColor"'
  );
  return processed;
}

// lib/blockBrandedIconsAndPlaceholders.ts
var blockBrandedIconsAndPlaceholders = {
  placeholder1: "https://cdn.ing/assets/files/record/286200/io0rg4wv8jd2o792q4uouxg4d5k8",
  placeholderDark1: "https://cdn.ing/assets/files/record/286201/l8f27khqrs9eumdi9r0ihvbe886u"};
function FeatureNumberedCards({
  features = [
    {
      title: "Secure Payments",
      description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Pariatur modi et recusandae ducimus eligendi eveniet soluta reprehenderit nostrum expedita omnis.",
      image: blockBrandedIconsAndPlaceholders.placeholder1,
      checklistItems: [
        "Secure payment gateway integration with Stripe",
        "SSL encryption for secure transactions"
      ]
    },
    {
      title: "Automated Invoicing",
      description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Pariatur modi et recusandae ducimus eligendi eveniet soluta reprehenderit nostrum expedita omnis.",
      image: blockBrandedIconsAndPlaceholders.placeholderDark1,
      checklistItems: ["Automated invoicing for easy billing"]
    }
  ],
  className,
  optixFlowConfig
}) {
  return /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn("py-32", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-10 rounded-lg border py-10 md:px-4", children: features.map((feature, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid rounded-lg border md:grid-cols-2", children: [
    /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col px-6 py-8 lg:px-8 lg:py-12 xl:px-12 xl:py-20", children: [
      /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-3 text-2xl font-medium sm:mb-5 md:text-3xl lg:text-4xl", children: feature.title }),
      /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-8 text-sm text-muted-foreground sm:mb-10 md:text-base", children: feature.description }),
      feature.checklistItems && feature.checklistItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mt-auto space-y-2 sm:space-y-3", children: feature.checklistItems.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex gap-x-3", children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          DynamicIcon,
          {
            name: "lucide/check-circle",
            size: 16,
            className: "mt-0.5 shrink-0 sm:mt-1"
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm md:text-base", children: item })
      ] }, itemIndex)) })
    ] }),
    /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative order-first max-h-80 md:order-last md:max-h-[500px]", children: [
      /* @__PURE__ */ jsxRuntime.jsx(
        img.Img,
        {
          src: feature.image,
          alt: feature.title,
          className: "h-full w-full object-cover",
          loading: "lazy",
          optixFlowConfig
        }
      ),
      /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-5 left-5 flex size-6 items-center justify-center rounded-sm bg-primary font-mono text-xs text-primary-foreground md:top-10 md:left-10", children: String(index + 1).padStart(2, "0") })
    ] })
  ] }, index)) }) }) });
}

exports.FeatureNumberedCards = FeatureNumberedCards;
//# sourceMappingURL=feature-numbered-cards.cjs.map
//# sourceMappingURL=feature-numbered-cards.cjs.map