"use client";
'use strict';

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

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;
}
var defaultSteps = [
  {
    icon: "lucide/search",
    title: "Research & Discovery",
    description: "We dive deep into understanding your business, market, and users to identify opportunities and challenges."
  },
  {
    icon: "lucide/lightbulb",
    title: "Ideation & Strategy",
    description: "Based on our research, we develop creative solutions and strategic approaches tailored to your needs."
  },
  {
    icon: "lucide/pencil-ruler",
    title: "Design & Prototype",
    description: "Our design team creates intuitive interfaces and interactive prototypes for validation and feedback."
  },
  {
    icon: "lucide/code-2",
    title: "Development",
    description: "We build robust, scalable solutions using modern technologies and best practices in software engineering."
  },
  {
    icon: "lucide/test-tube-2",
    title: "Testing & QA",
    description: "Rigorous testing ensures your product meets the highest standards of quality and reliability."
  },
  {
    icon: "lucide/rocket",
    title: "Launch & Support",
    description: "We handle deployment and provide ongoing support to ensure your product's continued success."
  }
];
var defaultProps = {
  title: "Our Process",
  description: "A systematic approach to delivering exceptional results through careful planning and execution.",
  steps: defaultSteps
};
function ProcessStepsGrid({
  className,
  title = defaultProps.title,
  description = defaultProps.description,
  steps = defaultProps.steps
}) {
  return /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn("py-32", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container", children: [
    /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-16 text-center", children: [
      /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "mb-4 text-4xl font-semibold tracking-tight lg:text-5xl", children: title }),
      /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mx-auto max-w-2xl text-lg text-foreground/50", children: description })
    ] }),
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-3", children: steps?.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(
      "div",
      {
        className: "group relative overflow-hidden rounded-lg border bg-card p-8 transition-all hover:border-primary/50 hover:shadow-lg",
        children: [
          /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -right-4 -top-4 text-[120px] font-bold leading-none text-muted/20 transition-colors group-hover:text-primary/10", children: String(index + 1).padStart(2, "0") }),
          /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative z-10", children: [
            step.icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6 flex size-14 items-center justify-center rounded-lg bg-primary/10 text-primary transition-colors group-hover:bg-primary group-hover:text-primary-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: step.icon, size: 28 }) }),
            /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-3 text-xl font-semibold tracking-tight", children: step.title }),
            /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground/50 leading-relaxed", children: step.description })
          ] })
        ]
      },
      index
    )) })
  ] }) });
}

exports.ProcessStepsGrid = ProcessStepsGrid;
//# sourceMappingURL=process-steps-grid.cjs.map
//# sourceMappingURL=process-steps-grid.cjs.map