"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/ScoreCircle/ScoreCircle.tsx
var ScoreCircle_exports = {};
__export(ScoreCircle_exports, {
  default: () => ScoreCircle_default
});
module.exports = __toCommonJS(ScoreCircle_exports);

// src/utils/utils.ts
var import_clsx = require("clsx");
var import_tailwind_merge = require("tailwind-merge");
function cn(...inputs) {
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
}

// src/components/Text/Text.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Text = ({
  children,
  size = "md",
  weight = "normal",
  color = "text-text-950",
  as,
  className = "",
  ...props
}) => {
  let sizeClasses;
  let weightClasses;
  const sizeClassMap = {
    "2xs": "text-2xs",
    xs: "text-xs",
    sm: "text-sm",
    md: "text-md",
    lg: "text-lg",
    xl: "text-xl",
    "2xl": "text-2xl",
    "3xl": "text-3xl",
    "4xl": "text-4xl",
    "5xl": "text-5xl",
    "6xl": "text-6xl"
  };
  sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
  const weightClassMap = {
    hairline: "font-hairline",
    light: "font-light",
    normal: "font-normal",
    medium: "font-medium",
    semibold: "font-semibold",
    bold: "font-bold",
    extrabold: "font-extrabold",
    black: "font-black"
  };
  weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
  const baseClasses = "font-primary";
  const Component = as ?? "p";
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
    Component,
    {
      className: cn(baseClasses, sizeClasses, weightClasses, color, className),
      ...props,
      children
    }
  );
};
var Text_default = Text;

// src/components/ScoreCircle/ScoreCircle.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var VARIANT_CLASSES = {
  green: {
    track: "stroke-background-300",
    fill: "stroke-success-200",
    score: "text-success-300"
  },
  blue: {
    track: "stroke-primary-100",
    fill: "stroke-primary-700",
    score: "text-primary-700"
  },
  warning: {
    track: "stroke-background-300",
    fill: "stroke-warning-300",
    score: "text-warning-600"
  }
};
var ScoreCircle = ({
  value,
  max = 1e3,
  variant = "green",
  size = 180,
  strokeWidth = 10,
  label,
  labelIcon,
  className = ""
}) => {
  const clamped = Math.max(0, Math.min(value, max));
  const percentage = max === 0 ? 0 : clamped / max;
  const radius = size / 2 - strokeWidth;
  const center = size / 2;
  const circumference = 2 * Math.PI * radius;
  const strokeDashoffset = circumference - percentage * circumference;
  const styles = VARIANT_CLASSES[variant];
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
    "div",
    {
      className: `relative flex flex-col items-center justify-center ${className}`,
      style: { width: size, height: size },
      role: "img",
      "aria-label": label ? `${label}: ${value} de ${max}` : `${value} de ${max}`,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          "svg",
          {
            className: "absolute inset-0 -rotate-90",
            width: size,
            height: size,
            viewBox: `0 0 ${size} ${size}`,
            "aria-hidden": "true",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                "circle",
                {
                  cx: center,
                  cy: center,
                  r: radius,
                  fill: "none",
                  strokeWidth,
                  className: styles.track
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                "circle",
                {
                  cx: center,
                  cy: center,
                  r: radius,
                  fill: "none",
                  strokeWidth,
                  strokeLinecap: "round",
                  strokeDasharray: circumference,
                  strokeDashoffset,
                  className: `${styles.fill} transition-all duration-500 ease-out`
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "relative z-10 flex flex-col items-center gap-1", children: [
          (label || labelIcon) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-row items-center gap-1 text-text-700", children: [
            labelIcon,
            label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text_default, { size: "xs", className: "text-text-700", children: label })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
            Text_default,
            {
              size: "xl",
              weight: "bold",
              className: `${styles.score} leading-none text-4xl`,
              children: value
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text_default, { size: "xs", className: "text-text-700", children: [
            "de ",
            max
          ] })
        ] })
      ]
    }
  );
};
var ScoreCircle_default = ScoreCircle;
//# sourceMappingURL=index.js.map