{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-finance-personal",
  "type": "registry:component",
  "title": "Personal Finance Summary",
  "description": "A calm personal money overview on warm paper, with a month switcher that moves every number: net worth with its trend marker, a spending donut, budget envelopes that hatch when overspent, a bills calendar and savings goal rings. Also ships a dark appearance.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "dashboards",
    "dashboard",
    "finance",
    "budget",
    "personal",
    "light",
    "savings"
  ],
  "docs": "https://hyperblur.dev/effects/dashboard-finance-personal",
  "files": [
    {
      "path": "registry/hyperblur/dashboard-finance-personal.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/dashboard-finance-personal.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface FinanceCategory {\n  name: string;\n  budget: number;\n  color: string;\n}\n\nexport interface FinanceGoal {\n  name: string;\n  target: number;\n  saved: number;\n  color: string;\n}\n\nexport interface FinanceBill {\n  name: string;\n  day: number;\n  amount: number;\n  auto?: boolean;\n}\n\nexport interface DashboardFinancePersonalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n  user?: string;\n  appearance?: \"light\" | \"dark\";\n  accent?: string;\n  currency?: string;\n  months?: string[];\n  month?: number;\n  defaultMonth?: number;\n  onMonthChange?: (index: number) => void;\n  categories?: FinanceCategory[];\n  goals?: FinanceGoal[];\n  bills?: FinanceBill[];\n}\n\nfunction rnd(n: number) {\n  let x = (n ^ 0x7feb352d) >>> 0;\n  x = Math.imul(x ^ (x >>> 15), 0x846ca68b) >>> 0;\n  x = Math.imul(x ^ (x >>> 16), 0x2c1b3c6d) >>> 0;\n  return ((x ^ (x >>> 15)) >>> 0) / 4294967295;\n}\n\nconst defaultMonths = [\"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\"];\nconst monthLen: Record<string, number> = { Jan: 31, Feb: 28, Mar: 31, Apr: 30, May: 31, Jun: 30, Jul: 31, Aug: 31, Sep: 30, Oct: 31, Nov: 30, Dec: 31 };\nconst monthStart: Record<string, number> = { Jun: 1, Jul: 3, Aug: 6, Sep: 2, Oct: 4, Nov: 0, Dec: 2, Jan: 4, Feb: 0, Mar: 0, Apr: 3, May: 5 };\n\nconst defaultCategories: FinanceCategory[] = [\n  { name: \"Rent\", budget: 1650, color: \"#5b6cff\" },\n  { name: \"Groceries\", budget: 520, color: \"#22a37a\" },\n  { name: \"Dining out\", budget: 260, color: \"#f08a4b\" },\n  { name: \"Transport\", budget: 180, color: \"#d4a72c\" },\n  { name: \"Subscriptions\", budget: 75, color: \"#b26bd6\" },\n  { name: \"Fun\", budget: 200, color: \"#e2557a\" },\n];\n\nconst defaultGoals: FinanceGoal[] = [\n  { name: \"Emergency fund\", target: 12000, saved: 8450, color: \"#22a37a\" },\n  { name: \"Lisbon trip\", target: 3200, saved: 1980, color: \"#f08a4b\" },\n  { name: \"New laptop\", target: 2400, saved: 640, color: \"#5b6cff\" },\n];\n\nconst defaultBills: FinanceBill[] = [\n  { name: \"Rent\", day: 1, amount: 1650, auto: true },\n  { name: \"Phone\", day: 8, amount: 45, auto: true },\n  { name: \"Internet\", day: 12, amount: 60, auto: true },\n  { name: \"Gym\", day: 15, amount: 39 },\n  { name: \"Credit card\", day: 22, amount: 384 },\n  { name: \"Music\", day: 27, amount: 11, auto: true },\n];\n\nconst factor = [0.92, 1.04, 0.97, 1.08, 0.99, 0.88];\n\nconst css = `\n.hb-wi12 {\n  --hb-wi12-a: #5b6cff;\n  --hb-wi12-bg: #f7f5ef;\n  --hb-wi12-card: #ffffff;\n  --hb-wi12-line: #e8e4d8;\n  --hb-wi12-fg: #1b1b1f;\n  --hb-wi12-mute: #77746b;\n  --hb-wi12-soft: #f1eee5;\n  container-type: inline-size;\n  width: 100%;\n  box-sizing: border-box;\n  padding: 22px;\n  border-radius: 18px;\n  background: var(--hb-wi12-bg);\n  color: var(--hb-wi12-fg);\n  font-family: inherit;\n  font-size: 13px;\n}\n.hb-wi12[data-appearance=\"dark\"] {\n  --hb-wi12-bg: #0b0b0c;\n  --hb-wi12-card: #131315;\n  --hb-wi12-line: #242427;\n  --hb-wi12-fg: #ededed;\n  --hb-wi12-mute: #8f8f8f;\n  --hb-wi12-soft: #1b1b1e;\n  border: 1px solid #222;\n}\n.hb-wi12 *, .hb-wi12 *::before, .hb-wi12 *::after { box-sizing: border-box; }\n.hb-wi12 button { font-family: inherit; color: inherit; }\n.hb-wi12 button:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--hb-wi12-a) 60%, transparent); }\n.hb-wi12-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }\n.hb-wi12-hi b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }\n.hb-wi12-hi span { font-size: 12.5px; color: var(--hb-wi12-mute); }\n.hb-wi12-months { position: relative; margin-left: auto; display: grid; grid-template-columns: repeat(var(--hb-wi12-n, 6), 1fr); padding: 3px; border-radius: 11px; background: var(--hb-wi12-soft); border: 1px solid var(--hb-wi12-line); }\n.hb-wi12-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--hb-wi12-n, 6)); border-radius: 8px; background: var(--hb-wi12-card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 0 0 1px var(--hb-wi12-line); transform: translateX(calc(100% * var(--hb-wi12-i, 0))); transition: transform 0.4s cubic-bezier(0.34, 1.25, 0.64, 1); }\n.hb-wi12-months button { position: relative; height: 28px; min-width: 44px; padding: 0 10px; border: 0; background: transparent; font-size: 12px; font-weight: 500; color: var(--hb-wi12-mute); cursor: pointer; border-radius: 8px; transition: color 0.2s ease; }\n.hb-wi12-months button[aria-pressed=\"true\"] { color: var(--hb-wi12-fg); }\n.hb-wi12-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; }\n.hb-wi12-card { padding: 16px; border-radius: 15px; background: var(--hb-wi12-card); border: 1px solid var(--hb-wi12-line); box-shadow: 0 1px 2px rgba(30, 25, 10, 0.04), 0 8px 24px -16px rgba(30, 25, 10, 0.18); }\n.hb-wi12-ch { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }\n.hb-wi12-ch b { font-size: 13px; font-weight: 600; }\n.hb-wi12-ch span { font-size: 11.5px; color: var(--hb-wi12-mute); font-variant-numeric: tabular-nums; }\n.hb-wi12-nw strong { display: block; font-size: 32px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }\n.hb-wi12-chg { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }\n.hb-wi12-chg[data-up=\"true\"] { color: #178a5a; background: rgba(34, 163, 122, 0.12); }\n.hb-wi12-chg[data-up=\"false\"] { color: #c2410c; background: rgba(240, 138, 75, 0.14); }\n.hb-wi12[data-appearance=\"dark\"] .hb-wi12-chg[data-up=\"true\"] { color: #4ade80; }\n.hb-wi12[data-appearance=\"dark\"] .hb-wi12-chg[data-up=\"false\"] { color: #fb923c; }\n.hb-wi12-nwc { position: relative; height: 110px; margin-top: 14px; }\n.hb-wi12-nwc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }\n.hb-wi12-nwl { fill: none; stroke: var(--hb-wi12-a); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }\n.hb-wi12-mk { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--hb-wi12-card); border: 2.5px solid var(--hb-wi12-a); box-shadow: 0 0 0 5px color-mix(in srgb, var(--hb-wi12-a) 18%, transparent); transition: left 0.45s cubic-bezier(0.34, 1.25, 0.64, 1), top 0.45s cubic-bezier(0.34, 1.25, 0.64, 1); }\n.hb-wi12-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }\n.hb-wi12-split div { padding: 10px 12px; border-radius: 11px; background: var(--hb-wi12-soft); }\n.hb-wi12-split small { display: block; font-size: 11px; color: var(--hb-wi12-mute); }\n.hb-wi12-split b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-wi12-donut { display: flex; align-items: center; gap: 14px; }\n.hb-wi12-ring { position: relative; width: 132px; height: 132px; flex: none; }\n.hb-wi12-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }\n.hb-wi12-arc { fill: none; stroke-width: 16; transition: stroke-dasharray 0.6s cubic-bezier(0.65, 0, 0.25, 1), stroke-dashoffset 0.6s cubic-bezier(0.65, 0, 0.25, 1), stroke-width 0.25s ease, opacity 0.2s ease; cursor: pointer; }\n.hb-wi12-ring[data-hot=\"true\"] .hb-wi12-arc { opacity: 0.3; }\n.hb-wi12-ring[data-hot=\"true\"] .hb-wi12-arc[data-on=\"true\"] { opacity: 1; stroke-width: 20; }\n.hb-wi12-rc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }\n.hb-wi12-rc small { font-size: 10.5px; color: var(--hb-wi12-mute); }\n.hb-wi12-rc b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }\n.hb-wi12-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.hb-wi12-legend li { display: flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 7px; font-size: 12px; cursor: default; transition: background 0.2s ease; }\n.hb-wi12-legend li[data-on=\"true\"] { background: var(--hb-wi12-soft); }\n.hb-wi12-legend i { width: 8px; height: 8px; border-radius: 3px; flex: none; }\n.hb-wi12-legend span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-wi12-legend b { font-weight: 500; font-variant-numeric: tabular-nums; }\n.hb-wi12-env { display: flex; flex-direction: column; gap: 11px; margin: 0; padding: 0; list-style: none; }\n.hb-wi12-env li { display: flex; flex-direction: column; gap: 5px; }\n.hb-wi12-env p { display: flex; justify-content: space-between; margin: 0; font-size: 12px; }\n.hb-wi12-env p span { color: var(--hb-wi12-mute); font-variant-numeric: tabular-nums; }\n.hb-wi12-env p span b { color: var(--hb-wi12-fg); font-weight: 600; }\n.hb-wi12-env p span[data-over=\"true\"], .hb-wi12-env p span[data-over=\"true\"] b { color: #d9480f; }\n.hb-wi12-track { position: relative; height: 8px; border-radius: 4px; background: var(--hb-wi12-soft); overflow: hidden; }\n.hb-wi12-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }\n.hb-wi12-fill[data-over=\"true\"] { background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.35) 0 3px, transparent 3px 6px) !important; background-color: #e8590c !important; }\n.hb-wi12-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 12px; }\n.hb-wi12-cal span { display: grid; place-items: center; height: 24px; border-radius: 6px; font-size: 10.5px; color: var(--hb-wi12-mute); font-variant-numeric: tabular-nums; position: relative; }\n.hb-wi12-cal span[data-h=\"true\"] { font-size: 9.5px; height: 16px; text-transform: uppercase; letter-spacing: 0.04em; }\n.hb-wi12-cal span[data-bill=\"true\"] { color: var(--hb-wi12-fg); font-weight: 600; background: color-mix(in srgb, var(--hb-wi12-a) 12%, transparent); }\n.hb-wi12-cal span[data-bill=\"true\"]::after { content: \"\"; position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--hb-wi12-a); }\n.hb-wi12-cal span[data-today=\"true\"] { box-shadow: inset 0 0 0 1.5px var(--hb-wi12-fg); }\n.hb-wi12-bills { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }\n.hb-wi12-bills li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--hb-wi12-line); font-size: 12px; }\n.hb-wi12-bills li:first-child { border-top: 0; }\n.hb-wi12-bills time { width: 34px; font-size: 11px; color: var(--hb-wi12-mute); font-variant-numeric: tabular-nums; }\n.hb-wi12-bills span { flex: 1; }\n.hb-wi12-bills em { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--hb-wi12-soft); color: var(--hb-wi12-mute); }\n.hb-wi12-bills b { font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-wi12-bills li[data-paid=\"true\"] span, .hb-wi12-bills li[data-paid=\"true\"] b { color: var(--hb-wi12-mute); text-decoration: line-through; text-decoration-color: var(--hb-wi12-line); }\n.hb-wi12-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }\n.hb-wi12-goal { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }\n.hb-wi12-gr { position: relative; width: 74px; height: 74px; }\n.hb-wi12-gr svg { width: 100%; height: 100%; transform: rotate(-90deg); }\n.hb-wi12-gr circle:last-child { transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1); }\n.hb-wi12-gr b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-wi12-goal span { font-size: 12px; font-weight: 550; }\n.hb-wi12-goal small { font-size: 11px; color: var(--hb-wi12-mute); font-variant-numeric: tabular-nums; }\n.hb-wi12-wide { grid-column: span 2; }\n@container (max-width: 900px) {\n  .hb-wi12-grid { grid-template-columns: 1fr 1fr; }\n  .hb-wi12-wide { grid-column: span 2; }\n}\n@container (max-width: 600px) {\n  .hb-wi12 { padding: 14px; }\n  .hb-wi12-grid { grid-template-columns: 1fr; }\n  .hb-wi12-wide { grid-column: auto; }\n  .hb-wi12-months { margin-left: 0; width: 100%; }\n  .hb-wi12-months button { min-width: 0; padding: 0; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-wi12-pill, .hb-wi12-mk, .hb-wi12-arc, .hb-wi12-fill, .hb-wi12-gr circle:last-child { transition: none !important; }\n}\n`;\n\nexport function DashboardFinancePersonal({\n  user = \"Sofia Lind\",\n  appearance = \"light\",\n  accent = \"#5b6cff\",\n  currency = \"$\",\n  months = defaultMonths,\n  month,\n  defaultMonth,\n  onMonthChange,\n  categories = defaultCategories,\n  goals = defaultGoals,\n  bills = defaultBills,\n  className,\n  style,\n  ...rest\n}: DashboardFinancePersonalProps) {\n  const [mInner, setMInner] = React.useState(defaultMonth ?? months.length - 1);\n  const [hot, setHot] = React.useState<string | null>(null);\n  const [ready, setReady] = React.useState(false);\n  const mi = Math.min(months.length - 1, Math.max(0, month ?? mInner));\n  const uid = React.useId().replace(/:/g, \"\");\n\n  React.useEffect(() => {\n    const t = window.setTimeout(() => setReady(true), 80);\n    return () => window.clearTimeout(t);\n  }, []);\n\n  const money = (v: number, d = 0) => `${v < 0 ? \"−\" : \"\"}${currency}${Math.abs(v).toLocaleString(\"en-US\", { minimumFractionDigits: d, maximumFractionDigits: d })}`;\n\n  const spentFor = (m: number) =>\n    categories.map((c, ci) => {\n      const f = factor[m % factor.length];\n      const noise = c.name === \"Rent\" ? 1 : 0.7 + rnd(m * 53 + ci * 11) * 0.55 * f;\n      return Math.round(c.budget * noise);\n    });\n  const spent = spentFor(mi);\n  const totalSpent = spent.reduce((a, b) => a + b, 0);\n  const income = 5400 + (mi % 3 === 2 ? 650 : 0);\n  const worth = months.map((_, m) => Math.round(48200 + m * 1350 + (rnd(m * 7 + 3) - 0.4) * 2400));\n  const nw = worth[mi];\n  const prevNw = worth[Math.max(0, mi - 1)];\n  const delta = nw - prevNw;\n  const wMin = Math.min(...worth) * 0.985;\n  const wMax = Math.max(...worth) * 1.01;\n  const pts = worth.map((v, i) => [(i / Math.max(1, months.length - 1)) * 100, 100 - ((v - wMin) / (wMax - wMin)) * 100] as [number, number]);\n  const nwLine = pts.map((p, i) => `${i ? \"L\" : \"M\"}${p[0].toFixed(2)} ${p[1].toFixed(2)}`).join(\" \");\n  const monthName = months[mi];\n  const days = monthLen[monthName] ?? 30;\n  const start = monthStart[monthName] ?? 0;\n  const isLast = mi === months.length - 1;\n  const today = isLast ? 8 : days + 1;\n  const goalScale = 0.55 + (mi / Math.max(1, months.length - 1)) * 0.45;\n\n  const R = 56;\n  const C = 2 * Math.PI * R;\n  const arcs = categories.map((c, i) => {\n    const frac = spent[i] / Math.max(1, totalSpent);\n    const before = spent.slice(0, i).reduce((a, b) => a + b, 0) / Math.max(1, totalSpent);\n    const len = Math.max(0, frac * C - 2.5);\n    return { c, len, off: -before * C, value: spent[i] };\n  });\n  const hotArc = arcs.find((a) => a.c.name === hot);\n\n  const setMonth = (i: number) => {\n    if (month === undefined) setMInner(i);\n    onMonthChange?.(i);\n  };\n\n  return (\n    <div\n      {...rest}\n      className={[\"hb-wi12\", className].filter(Boolean).join(\" \")}\n      data-appearance={appearance}\n      style={{ ...style, [\"--hb-wi12-a\" as string]: accent, [\"--hb-wi12-n\" as string]: months.length, [\"--hb-wi12-i\" as string]: mi } as React.CSSProperties}\n    >\n      <style href=\"hb-dashboard-finance-personal\" precedence=\"default\">{css}</style>\n      <div className=\"hb-wi12-top\">\n        <div className=\"hb-wi12-hi\">\n          <b>Good morning, {user.split(\" \")[0]}</b>\n          <span>\n            {money(income - totalSpent)} left over in {monthName} after {money(totalSpent)} of spending\n          </span>\n        </div>\n        <div\n          className=\"hb-wi12-months\"\n          role=\"group\"\n          aria-label=\"Month\"\n          onKeyDown={(e) => {\n            if (e.key === \"ArrowRight\" || e.key === \"ArrowLeft\") {\n              e.preventDefault();\n              const next = Math.min(months.length - 1, Math.max(0, mi + (e.key === \"ArrowRight\" ? 1 : -1)));\n              setMonth(next);\n              (e.currentTarget.querySelectorAll(\"button\")[next] as HTMLButtonElement | undefined)?.focus();\n            }\n          }}\n        >\n          <span className=\"hb-wi12-pill\" aria-hidden=\"true\" />\n          {months.map((m, i) => (\n            <button key={m} type=\"button\" aria-pressed={i === mi} onClick={() => setMonth(i)}>\n              {m}\n            </button>\n          ))}\n        </div>\n      </div>\n      <div className=\"hb-wi12-grid\">\n        <section className=\"hb-wi12-card hb-wi12-nw\" aria-label=\"Net worth\">\n          <div className=\"hb-wi12-ch\">\n            <b>Net worth</b>\n            <span>End of {monthName}</span>\n          </div>\n          <strong>{money(nw)}</strong>\n          <span className=\"hb-wi12-chg\" data-up={delta >= 0}>\n            {delta >= 0 ? \"▲\" : \"▼\"} {money(Math.abs(delta))} vs {months[Math.max(0, mi - 1)]}\n          </span>\n          <div className=\"hb-wi12-nwc\">\n            <svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" role=\"img\" aria-labelledby={`${uid}-nw`}>\n              <title id={`${uid}-nw`}>{`Net worth from ${money(worth[0])} in ${months[0]} to ${money(worth[worth.length - 1])} in ${months[months.length - 1]}`}</title>\n              <defs>\n                <linearGradient id={`${uid}-ng`} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n                  <stop offset=\"0\" stopColor={accent} stopOpacity=\"0.22\" />\n                  <stop offset=\"1\" stopColor={accent} stopOpacity=\"0\" />\n                </linearGradient>\n              </defs>\n              <path d={`${nwLine} L100 100 L0 100 Z`} fill={`url(#${uid}-ng)`} />\n              <path className=\"hb-wi12-nwl\" d={nwLine} />\n            </svg>\n            <span className=\"hb-wi12-mk\" style={{ left: `${pts[mi][0].toFixed(2)}%`, top: `${pts[mi][1].toFixed(2)}%` }} />\n          </div>\n          <div className=\"hb-wi12-split\">\n            <div>\n              <small>Income</small>\n              <b>{money(income)}</b>\n            </div>\n            <div>\n              <small>Spent</small>\n              <b>{money(totalSpent)}</b>\n            </div>\n          </div>\n        </section>\n        <section className=\"hb-wi12-card\" aria-label=\"Spending by category\">\n          <div className=\"hb-wi12-ch\">\n            <b>Where it went</b>\n            <span>{monthName}</span>\n          </div>\n          <div className=\"hb-wi12-donut\">\n            <div className=\"hb-wi12-ring\" data-hot={hot !== null}>\n              <svg viewBox=\"0 0 140 140\" role=\"img\" aria-labelledby={`${uid}-sp`}>\n                <title id={`${uid}-sp`}>{`Spending ${money(totalSpent)}: ${arcs.map((a) => `${a.c.name} ${money(a.value)}`).join(\", \")}`}</title>\n                <circle cx=\"70\" cy=\"70\" r={R} fill=\"none\" stroke=\"var(--hb-wi12-soft)\" strokeWidth=\"16\" />\n                {arcs.map((a) => (\n                  <circle\n                    key={a.c.name}\n                    className=\"hb-wi12-arc\"\n                    cx=\"70\"\n                    cy=\"70\"\n                    r={R}\n                    stroke={a.c.color}\n                    data-on={hot === a.c.name}\n                    strokeDasharray={`${(ready ? a.len : 0).toFixed(2)} ${C.toFixed(2)}`}\n                    strokeDashoffset={a.off.toFixed(2)}\n                    onPointerEnter={() => setHot(a.c.name)}\n                    onPointerLeave={() => setHot(null)}\n                  />\n                ))}\n              </svg>\n              <div className=\"hb-wi12-rc\">\n                <small>{hotArc ? hotArc.c.name : \"Total\"}</small>\n                <b>{money(hotArc ? hotArc.value : totalSpent)}</b>\n                {hotArc ? <small>{Math.round((hotArc.value / totalSpent) * 100)}%</small> : null}\n              </div>\n            </div>\n            <ul className=\"hb-wi12-legend\">\n              {arcs.map((a) => (\n                <li key={a.c.name} data-on={hot === a.c.name} onPointerEnter={() => setHot(a.c.name)} onPointerLeave={() => setHot(null)}>\n                  <i style={{ background: a.c.color }} />\n                  <span>{a.c.name}</span>\n                  <b>{money(a.value)}</b>\n                </li>\n              ))}\n            </ul>\n          </div>\n        </section>\n        <section className=\"hb-wi12-card\" aria-label=\"Budgets\">\n          <div className=\"hb-wi12-ch\">\n            <b>Budgets</b>\n            <span>{categories.filter((c, i) => spent[i] > c.budget).length} over</span>\n          </div>\n          <ul className=\"hb-wi12-env\">\n            {categories.map((c, i) => {\n              const over = spent[i] > c.budget;\n              const pct = Math.min(100, (spent[i] / c.budget) * 100);\n              return (\n                <li key={c.name}>\n                  <p>\n                    {c.name}\n                    <span data-over={over}>\n                      <b>{money(spent[i])}</b> / {money(c.budget)}\n                    </span>\n                  </p>\n                  <div className=\"hb-wi12-track\" role=\"progressbar\" aria-label={`${c.name} budget`} aria-valuemin={0} aria-valuemax={c.budget} aria-valuenow={spent[i]}>\n                    <div className=\"hb-wi12-fill\" data-over={over} style={{ width: `${(ready ? pct : 0).toFixed(1)}%`, background: c.color }} />\n                  </div>\n                </li>\n              );\n            })}\n          </ul>\n        </section>\n        <section className=\"hb-wi12-card\" aria-label=\"Upcoming bills\">\n          <div className=\"hb-wi12-ch\">\n            <b>Bills</b>\n            <span>{money(bills.reduce((a, b) => a + b.amount, 0))} this month</span>\n          </div>\n          <div className=\"hb-wi12-cal\" aria-hidden=\"true\">\n            {[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"].map((d, i) => (\n              <span key={`h${i}`} data-h=\"true\">\n                {d}\n              </span>\n            ))}\n            {Array.from({ length: start }, (_, i) => (\n              <span key={`e${i}`} />\n            ))}\n            {Array.from({ length: days }, (_, i) => (\n              <span key={i} data-bill={bills.some((b) => b.day === i + 1)} data-today={isLast && i + 1 === today}>\n                {i + 1}\n              </span>\n            ))}\n          </div>\n          <ul className=\"hb-wi12-bills\">\n            {bills.slice(0, 4).map((b) => (\n              <li key={b.name} data-paid={b.day < today}>\n                <time>\n                  {monthName} {b.day}\n                </time>\n                <span>{b.name}</span>\n                {b.auto ? <em>Auto</em> : null}\n                <b>{money(b.amount)}</b>\n              </li>\n            ))}\n          </ul>\n        </section>\n        <section className=\"hb-wi12-card hb-wi12-wide\" aria-label=\"Savings goals\">\n          <div className=\"hb-wi12-ch\">\n            <b>Savings goals</b>\n            <span>{money(Math.round(goals.reduce((a, g) => a + g.saved * goalScale, 0)))} saved</span>\n          </div>\n          <div className=\"hb-wi12-goals\">\n            {goals.map((g) => {\n              const saved = Math.round(g.saved * goalScale);\n              const frac = Math.min(1, saved / g.target);\n              const r = 30;\n              const c = 2 * Math.PI * r;\n              return (\n                <div key={g.name} className=\"hb-wi12-goal\">\n                  <div className=\"hb-wi12-gr\" role=\"img\" aria-label={`${g.name}: ${money(saved)} of ${money(g.target)}`}>\n                    <svg viewBox=\"0 0 74 74\">\n                      <circle cx=\"37\" cy=\"37\" r={r} fill=\"none\" stroke=\"var(--hb-wi12-soft)\" strokeWidth=\"7\" />\n                      <circle cx=\"37\" cy=\"37\" r={r} fill=\"none\" stroke={g.color} strokeWidth=\"7\" strokeLinecap=\"round\" strokeDasharray={c.toFixed(2)} strokeDashoffset={(c * (1 - (ready ? frac : 0))).toFixed(2)} />\n                    </svg>\n                    <b>{Math.round(frac * 100)}%</b>\n                  </div>\n                  <span>{g.name}</span>\n                  <small>\n                    {money(saved)} of {money(g.target)}\n                  </small>\n                </div>\n              );\n            })}\n          </div>\n        </section>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}