{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radar-compare",
  "title": "Radar Compare",
  "description": "A radar polygon for Remocn grows over a competitor outline next to the name and tagline.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "files": [
    {
      "path": "registry/remocn/radar-compare/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/InstrumentSans\";\nimport { loadFont as loadSerif } from \"@remotion/google-fonts/InstrumentSerif\";\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport { useId } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  interpolateColors,\n  spring,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: sans } = loadSans(\"normal\", {\n  weights: [\"400\", \"500\"],\n  subsets: [\"latin\"],\n});\nconst { fontFamily: serif } = loadSerif(\"italic\", {\n  weights: [\"400\"],\n  subsets: [\"latin\"],\n});\nconst manrope = loadManrope(\"normal\", {\n  weights: [\"600\"],\n  subsets: [\"latin\"],\n});\n\nconst REMOCN_R_PATH =\n  \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\n\n/** Full logo as on remocn.dev: R mark (0.76em, on the baseline) + \"emocn\" in Manrope 600. */\nfunction RemocnLogo({ fontSize, color }: { fontSize: number; color: string }) {\n  return (\n    <div\n      style={{\n        display: \"flex\",\n        alignItems: \"baseline\",\n        color,\n        fontFamily: manrope.fontFamily,\n        fontWeight: 600,\n        fontSize,\n        letterSpacing: \"-0.025em\",\n        lineHeight: 1,\n      }}\n    >\n      <svg\n        viewBox=\"0 0 124.06 134.26\"\n        style={{ height: \"0.76em\", width: \"auto\" }}\n        aria-hidden\n      >\n        <path fill=\"currentColor\" d={REMOCN_R_PATH} />\n      </svg>\n      <span style={{ marginLeft: \"0.04em\" }}>emocn</span>\n    </div>\n  );\n}\n\n// gradients.sh \"mesh\" palette, used only inside the brand polygon.\nconst MESH = [\"#ecdcf2\", \"#8796ee\", \"#2e45b7\", \"#0e1645\"] as const;\nconst BLOBS: [number, number][] = [\n  [16, 20],\n  [84, 26],\n  [72, 86],\n  [22, 80],\n  [52, 48],\n  [92, 62],\n];\n\nexport interface RadarCompareProps {\n  axes?: string[];\n  competitor?: number[];\n  brand?: number[];\n  brandLabel?: string;\n  competitorLabel?: string;\n  caption?: string;\n  accent?: string;\n  theme?: \"dark\" | \"light\";\n  speed?: number;\n}\n\nconst DEFAULT_AXES = [\n  \"Speed\",\n  \"Quality\",\n  \"Price\",\n  \"Support\",\n  \"Integrations\",\n  \"Docs\",\n];\nconst DEFAULT_COMPETITOR = [0.58, 0.66, 0.82, 0.5, 0.62, 0.46];\nconst DEFAULT_BRAND = [0.94, 0.88, 0.7, 0.86, 0.9, 0.96];\n\nconst EASE_IO = Easing.bezier(0.65, 0, 0.35, 1);\nconst EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\nconst TAU = Math.PI * 2;\nconst RINGS = [0.25, 0.5, 0.75, 1];\n\nconst THEMES = {\n  dark: {\n    bg: \"#0A0A0B\",\n    fg: \"#F3F2EF\",\n    muted: \"#8B8A90\",\n    hair: \"rgba(255,255,255,0.13)\",\n    hairStrong: \"rgba(255,255,255,0.26)\",\n    comp: \"#8E8D93\",\n    compOver: \"rgba(236,234,242,0.78)\",\n    compFill: \"rgba(200,199,205,0.10)\",\n    meshBase: MESH[3],\n    mesh: [MESH[0], MESH[1], MESH[2], MESH[3]],\n    meshAlpha: [0.42, 1, 1, 0.9],\n    brandFill: 0.82,\n    brandStroke: \"#9AA8F5\",\n    grain: 0.06,\n  },\n  light: {\n    bg: \"#F5F4F0\",\n    fg: \"#121214\",\n    muted: \"#6E6C67\",\n    hair: \"rgba(18,18,20,0.12)\",\n    hairStrong: \"rgba(18,18,20,0.26)\",\n    comp: \"#85837E\",\n    compOver: \"rgba(18,18,20,0.55)\",\n    compFill: \"rgba(18,18,20,0.07)\",\n    meshBase: \"#E4E6F8\",\n    mesh: [MESH[0], MESH[1], \"#B3BEF6\", MESH[0]],\n    meshAlpha: [0.95, 0.75, 0.8, 0.7],\n    brandFill: 0.9,\n    brandStroke: \"accent\",\n    grain: 0.045,\n  },\n} as const;\n\nfunction Grain({ opacity }: { opacity: number }) {\n  const id = `g${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  return (\n    <svg\n      width=\"100%\"\n      height=\"100%\"\n      style={{ position: \"absolute\", inset: 0, opacity }}\n      aria-hidden\n    >\n      <filter id={id}>\n        <feTurbulence\n          type=\"fractalNoise\"\n          baseFrequency=\"0.9\"\n          numOctaves={2}\n          seed={17}\n          stitchTiles=\"stitch\"\n        />\n        <feColorMatrix values=\"0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.9 0\" />\n      </filter>\n      <rect width=\"100%\" height=\"100%\" filter={`url(#${id})`} />\n    </svg>\n  );\n}\n\nfunction clamp01(v: number) {\n  return Math.min(1, Math.max(0, v));\n}\n\nexport function RadarCompare({\n  axes = DEFAULT_AXES,\n  competitor = DEFAULT_COMPETITOR,\n  brand = DEFAULT_BRAND,\n  brandLabel = \"remocn\",\n  competitorLabel = \"Kitebase\",\n  caption,\n  accent = \"#3B5BFD\",\n  theme = \"dark\",\n  speed = 1,\n}: RadarCompareProps) {\n  const t = useCurrentFrame() * speed;\n  const { width, height, fps } = useVideoConfig();\n  const gid = `rc${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  const u = Math.min(width / 1280, height / 720);\n  const p = THEMES[theme];\n  const list = axes.slice(0, 8);\n  const n = Math.max(3, list.length);\n  const comp = Array.from({ length: n }, (_, i) => clamp01(competitor[i] ?? 0));\n  const mine = Array.from({ length: n }, (_, i) => clamp01(brand[i] ?? 0));\n  const wins = mine.filter((v, i) => v > comp[i]).length;\n  const stroke = p.brandStroke === \"accent\" ? accent : p.brandStroke;\n  const isRemocn = brandLabel.trim().toLowerCase() === \"remocn\";\n\n  const R = height * 0.28;\n  const cy = height * 0.5;\n  const move = interpolate(t, [86, 118], [0, 1], { ...CLAMP, easing: EASE_IO });\n  const cx = interpolate(move, [0, 1], [width * 0.5, width * 0.335]);\n\n  const ang = (i: number) => (i / n) * TAU;\n  const pt = (r: number, a: number) => ({\n    x: cx + r * Math.sin(a),\n    y: cy - r * Math.cos(a),\n  });\n  const poly = (rs: number[]) =>\n    `${rs\n      .map((r, i) => {\n        const q = pt(r, ang(i));\n        return `${i === 0 ? \"M\" : \"L\"} ${q.x.toFixed(2)} ${q.y.toFixed(2)}`;\n      })\n      .join(\" \")} Z`;\n\n  const stage = interpolate(t, [0, 8], [0, 1], CLAMP);\n  const push = interpolate(t, [0, 150], [0, 1], { ...CLAMP, easing: EASE_IO });\n  const scale = 0.965 + 0.035 * push;\n\n  const compPts = comp.map((v) => v * R);\n  let perim = 0;\n  const cum: number[] = [];\n  for (let i = 0; i < n; i++) {\n    cum.push(perim);\n    const a = pt(compPts[i], ang(i));\n    const b = pt(compPts[(i + 1) % n], ang(i + 1));\n    perim += Math.hypot(b.x - a.x, b.y - a.y);\n  }\n  const compDraw = interpolate(t, [22, 52], [0, 1], {\n    ...CLAMP,\n    easing: EASE_IO,\n  });\n  const compFill = interpolate(t, [42, 60], [0, 1], {\n    ...CLAMP,\n    easing: EASE_OUT,\n  });\n  const settle = interpolate(t, [80, 100], [0, 1], {\n    ...CLAMP,\n    easing: EASE_IO,\n  });\n\n  const grow = mine.map((_, i) =>\n    spring({\n      frame: t - 58 - i * 1.8,\n      fps,\n      config: { damping: 17, stiffness: 110, mass: 0.9 },\n    }),\n  );\n  const brandOn = interpolate(t, [56, 62], [0, 1], CLAMP);\n  const brandPts = mine.map((v, i) => v * R * (0.06 + 0.94 * grow[i]));\n\n  const hero = interpolate(t, [98, 120], [0, 1], {\n    ...CLAMP,\n    easing: EASE_OUT,\n  });\n  const line2 = interpolate(t, [106, 126], [0, 1], {\n    ...CLAMP,\n    easing: EASE_OUT,\n  });\n  const line3 = interpolate(t, [112, 132], [0, 1], {\n    ...CLAMP,\n    easing: EASE_OUT,\n  });\n  const textLeft = width * 0.6;\n  const hw = Math.max(1, u);\n\n  return (\n    <AbsoluteFill style={{ background: p.bg, overflow: \"hidden\" }}>\n      <AbsoluteFill\n        style={{ transform: `scale(${scale})`, transformOrigin: \"50% 50%\" }}\n      >\n        <svg\n          width={width}\n          height={height}\n          style={{ position: \"absolute\", inset: 0, opacity: stage }}\n          aria-hidden\n        >\n          {list.map((ax, i) => {\n            const k = interpolate(t, [2 + i * 2, 22 + i * 2], [0, 1], {\n              ...CLAMP,\n              easing: EASE_OUT,\n            });\n            const q = pt(R * k, ang(i));\n            return (\n              <line\n                key={`s${ax}`}\n                x1={cx}\n                y1={cy}\n                x2={q.x}\n                y2={q.y}\n                stroke={p.hair}\n                strokeWidth={hw}\n              />\n            );\n          })}\n          {RINGS.map((r, j) => {\n            const k = interpolate(t, [6 + j * 3, 26 + j * 3], [0, 1], {\n              ...CLAMP,\n              easing: EASE_OUT,\n            });\n            return (\n              <path\n                key={`r${r}`}\n                d={poly(\n                  Array.from({ length: n }, () => r * R * (0.9 + 0.1 * k)),\n                )}\n                fill=\"none\"\n                stroke={j === RINGS.length - 1 ? p.hairStrong : p.hair}\n                strokeWidth={hw}\n                strokeLinejoin=\"round\"\n                opacity={k}\n              />\n            );\n          })}\n\n          <defs>\n            <clipPath id={`${gid}c`}>\n              <path d={poly(brandPts)} />\n            </clipPath>\n            {p.mesh.map((col, i) => {\n              const [bx, by] = BLOBS[i];\n              const dx = Math.sin(t / 45 + i * 1.7) * 4;\n              const dy = Math.cos(t / 52 + i * 2.3) * 4;\n              return (\n                <radialGradient\n                  key={`m${col}${bx}`}\n                  id={`${gid}m${i}`}\n                  cx={(50 + (bx - 50) * 0.72 + dx) / 100}\n                  cy={(50 + (by - 50) * 0.72 + dy) / 100}\n                  r={0.58}\n                >\n                  <stop\n                    offset={0}\n                    stopColor={col}\n                    stopOpacity={p.meshAlpha[i]}\n                  />\n                  <stop offset={0.68} stopColor={col} stopOpacity={0} />\n                </radialGradient>\n              );\n            })}\n          </defs>\n          {brandOn > 0 ? (\n            <g\n              clipPath={`url(#${gid}c)`}\n              opacity={p.brandFill * brandOn * (0.55 + 0.45 * settle)}\n            >\n              <rect\n                x={cx - R}\n                y={cy - R}\n                width={2 * R}\n                height={2 * R}\n                fill={p.meshBase}\n              />\n              {p.mesh.map((col, i) => (\n                <rect\n                  key={`mr${col}${BLOBS[i][0]}`}\n                  x={cx - R}\n                  y={cy - R}\n                  width={2 * R}\n                  height={2 * R}\n                  fill={`url(#${gid}m${i})`}\n                />\n              ))}\n            </g>\n          ) : null}\n          <path\n            d={poly(compPts)}\n            fill={p.compFill}\n            fillOpacity={compFill * (1 - 0.4 * settle)}\n            stroke={interpolateColors(settle, [0, 1], [p.comp, p.compOver])}\n            strokeWidth={1.75 * u}\n            strokeLinejoin=\"round\"\n            strokeDasharray={`${perim * compDraw} ${perim}`}\n            opacity={compDraw > 0 ? 1 - 0.3 * settle : 0}\n          />\n          {compPts.map((r, i) => {\n            const q = pt(r, ang(i));\n            const f0 = perim > 0 ? cum[i] / perim : 0;\n            const k = interpolate(\n              compDraw * 1.04 + (compDraw > 0 ? 0.02 : 0),\n              [f0, f0 + 0.05],\n              [0, 1],\n              CLAMP,\n            );\n            return (\n              <circle\n                key={`cd${list[i] ?? i}`}\n                cx={q.x}\n                cy={q.y}\n                r={3 * u}\n                fill={interpolateColors(settle, [0, 1], [p.comp, p.compOver])}\n                opacity={k * (1 - 0.3 * settle)}\n              />\n            );\n          })}\n\n          {brandOn > 0 ? (\n            <path\n              d={poly(brandPts)}\n              fill=\"none\"\n              stroke={stroke}\n              strokeWidth={2.5 * u}\n              strokeLinejoin=\"round\"\n              opacity={brandOn}\n            />\n          ) : null}\n          {brandPts.map((r, i) => {\n            const q = pt(r, ang(i));\n            return (\n              <circle\n                key={`bd${list[i] ?? i}`}\n                cx={q.x}\n                cy={q.y}\n                r={4.5 * u}\n                fill={stroke}\n                stroke={p.bg}\n                strokeWidth={2 * u}\n                opacity={brandOn}\n              />\n            );\n          })}\n        </svg>\n\n        {list.map((ax, i) => {\n          const a = ang(i);\n          const k = interpolate(t, [10 + i * 2, 30 + i * 2], [0, 1], {\n            ...CLAMP,\n            easing: EASE_OUT,\n          });\n          const q = pt(R + (22 + 6 * (1 - k)) * u, a);\n          const sx = Math.sin(a);\n          const sy = -Math.cos(a);\n          const won = mine[i] > comp[i];\n          return (\n            <div\n              key={`l${ax}`}\n              style={{\n                position: \"absolute\",\n                left: q.x,\n                top: q.y,\n                transform: `translate(${-50 + sx * 50}%, ${-50 + sy * 50}%)`,\n                fontFamily: sans,\n                fontWeight: 500,\n                fontSize: 17 * u,\n                letterSpacing: \"-0.005em\",\n                color: won\n                  ? interpolateColors(settle, [0, 1], [p.muted, p.fg])\n                  : p.muted,\n                whiteSpace: \"nowrap\",\n                opacity: k * stage,\n              }}\n            >\n              {ax}\n            </div>\n          );\n        })}\n\n        <div\n          style={{\n            position: \"absolute\",\n            left: textLeft,\n            top: cy,\n            transform: \"translateY(-50%)\",\n            display: \"flex\",\n            flexDirection: \"column\",\n            alignItems: \"flex-start\",\n          }}\n        >\n          <div\n            style={{\n              opacity: hero,\n              filter: hero < 0.99 ? `blur(${(1 - hero) * 8 * u}px)` : undefined,\n              transform: `translateX(${(1 - hero) * 26 * u}px)`,\n            }}\n          >\n            {isRemocn ? (\n              <RemocnLogo fontSize={104 * u} color={p.fg} />\n            ) : (\n              <div\n                style={{\n                  fontFamily: sans,\n                  fontWeight: 500,\n                  fontSize: 108 * u,\n                  lineHeight: 0.9,\n                  letterSpacing: \"-0.04em\",\n                  color: p.fg,\n                  whiteSpace: \"nowrap\",\n                }}\n              >\n                {brandLabel}\n              </div>\n            )}\n          </div>\n          <div\n            style={{\n              marginTop: 24 * u,\n              fontFamily: sans,\n              fontWeight: 400,\n              fontSize: 28 * u,\n              lineHeight: 1.25,\n              letterSpacing: \"-0.015em\",\n              color: p.fg,\n              maxWidth: width * 0.34,\n              textWrap: \"balance\",\n              opacity: line2,\n              transform: `translateY(${(1 - line2) * 10 * u}px)`,\n            }}\n          >\n            {caption ?? (\n              <>\n                Ahead of {competitorLabel} on{\" \"}\n                <span\n                  style={{\n                    fontFamily: serif,\n                    fontStyle: \"italic\",\n                    fontWeight: 400,\n                    fontSize: \"1.18em\",\n                    letterSpacing: \"-0.01em\",\n                  }}\n                >\n                  {wins} of {n}\n                </span>\n                .\n              </>\n            )}\n          </div>\n          <div\n            style={{\n              marginTop: 26 * u,\n              display: \"flex\",\n              alignItems: \"center\",\n              gap: 26 * u,\n              fontFamily: sans,\n              fontWeight: 400,\n              fontSize: 17 * u,\n              color: p.muted,\n              whiteSpace: \"nowrap\",\n              opacity: line3,\n              transform: `translateY(${(1 - line3) * 8 * u}px)`,\n            }}\n          >\n            {[\n              { name: brandLabel, color: stroke, w: 2.5 },\n              { name: competitorLabel, color: p.comp, w: 1.75 },\n            ].map((it) => (\n              <div\n                key={it.name}\n                style={{ display: \"flex\", alignItems: \"center\", gap: 10 * u }}\n              >\n                <span\n                  style={{\n                    width: 18 * u,\n                    height: it.w * u,\n                    borderRadius: it.w * u,\n                    background: it.color,\n                  }}\n                />\n                {it.name}\n              </div>\n            ))}\n          </div>\n        </div>\n      </AbsoluteFill>\n\n      <AbsoluteFill\n        style={{\n          background: `radial-gradient(ellipse 80% 80% at 50% 50%, transparent 62%, ${p.bg} 100%)`,\n          opacity: 0.6,\n        }}\n      />\n      <Grain opacity={p.grain} />\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/radar-compare.tsx"
    }
  ],
  "type": "registry:component"
}
