{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"rings","title":"Goal numerals","description":"Each goal as a soft bar with its percentage set large on top. Flick through the month and every bar and number moves as one. At 100% a bar holds under your hand, then breaks through amber.","type":"registry:component","author":"Detent","dependencies":["motion"],"registryDependencies":["https://detentui.com/r/theme.json"],"files":[{"path":"components/detent/components/charts/GoalNumerals.tsx","target":"components/detent/components/charts/GoalNumerals.tsx","type":"registry:component","content":"'use client'\n\nimport { useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport type { KeyboardEvent, ReactNode, Ref } from 'react'\nimport { useReducedMotion } from 'motion/react'\nimport { at, clamp, createRoller, dragProps, feedback, springStep, stepKey, useDetent } from '@/components/detent/lib/detent'\nimport type { Body } from '@/components/detent/lib/detent'\nimport { RollingText } from '@/components/detent/ui/RollingText'\nimport { compact } from '@/components/detent/components/charts/parts'\n\nexport { ChartCard } from '@/components/detent/components/charts/ChartCard'\nexport { compact } from '@/components/detent/components/charts/parts'\n\nexport type Goal = { id: string; label: string; goal: number; series: number[]; format?: (n: number) => string }\nexport type GoalsHandle = {\n  point(id: string | null): void\n  scrub(day: number | null): void\n  sweep(day: number, ms: number): void\n}\n\nconst Note = ({ className = '', children }: { className?: string; children: ReactNode }) => (\n  <span className={`${className} @max-[300px]:block`}>\n    <span className=\"@max-[300px]:hidden\"> · </span>\n    {children}\n  </span>\n)\n\nconst FILL = 'bg-[color-mix(in_oklch,var(--dt-accent)_15%,transparent)] dark:bg-[color-mix(in_oklch,var(--dt-accent)_30%,transparent)]'\nconst FILL_OVER = 'bg-[color-mix(in_oklch,var(--warn)_24%,transparent)] dark:bg-[color-mix(in_oklch,var(--warn)_20%,transparent)]'\n\nconst GIVE = 0.022\nconst HOLDING = { w: 46, z: 1 }\nconst SNAPPING = { w: 30, z: 0.34 }\nconst FLOOD = { w: 15, z: 1 }\nconst CATCH_UP = { w: 22, z: 1 }\nconst RISE = { w: 8.5, z: 1 }\n\ntype Row = { through: boolean; held: Body; strain: Body; flood: Body; last: number; pct: number; wall: number }\ntype Parts = { track: HTMLElement | null; fill: HTMLElement | null; over: HTMLElement | null; number: ((v: number, speed: number) => void) | null }\n\nconst wallOf = (g: Goal) => {\n  const i = g.series.findIndex((v) => v >= g.goal)\n  const daily = i > 0 ? g.series[i] - g.series[i - 1] : 0\n  return Math.max(0.018, (daily / g.goal) * 1.5)\n}\nconst blank = (): Row => ({ through: false, held: { x: 0, v: 0 }, strain: { x: 0, v: 0 }, flood: { x: 0, v: 0 }, last: 0, pct: 0, wall: 0.02 })\n\nexport function GoalNumerals({\n  goals,\n  days,\n  today,\n  dayLabel = (d) => `Day ${d + 1}`,\n  onDayChange,\n  onOver,\n  muted,\n  ref,\n}: {\n  goals: Goal[]\n  days: number\n  today: number\n  dayLabel?: (day: number) => string\n  onDayChange?: (day: number | null) => void\n  onOver?: (ids: string[]) => void\n  muted?: boolean\n  ref?: Ref<GoalsHandle>\n}) {\n  const reduce = useReducedMotion()\n  const [hovered, setAt] = useState<string | null>(null)\n  const [day, setDayState] = useState<number | null>(null)\n  const [broken, setBroken] = useState<Record<string, boolean>>({})\n  const setDay = (d: number | null) => {\n    setDayState(d)\n    onDayChange?.(d)\n  }\n  const mark = (id: string, on: boolean) => {\n    setBroken((b) => ({ ...b, [id]: on }))\n    latest.current.onOver?.(Object.entries(rows.current).flatMap(([k, r]) => (r.through ? [k] : [])))\n  }\n\n  const stops = useMemo(() => Array.from({ length: today + 1 }, (_, i) => i), [today])\n  const walls = useMemo(() => Object.fromEntries(goals.map((g) => [g.id, wallOf(g)])), [goals])\n  const parts = useRef<Record<string, Parts>>({})\n  const rows = useRef<Record<string, Row>>({})\n  const rise = useRef<Body>({ x: reduce ? 1 : 0, v: 0 })\n  const thumb = useRef<HTMLSpanElement>(null)\n  const line = useRef<HTMLSpanElement>(null)\n  const byHand = useRef(false)\n  const latest = useRef({ goals, today, days, muted, setDay, walls, onOver })\n  useLayoutEffect(() => {\n    latest.current = { goals, today, days, muted, setDay, walls, onOver }\n  })\n\n  const paint = (x: number, v: number, dt: number) => {\n    const { goals, today, days, muted, walls } = latest.current\n    const reading = clamp(x, 0, today)\n    const e = rise.current\n    if (reduce) e.x = 1\n    let more = false\n    if (dt > 0 && e.x < 1) {\n      springStep(e, 1, RISE, dt)\n      if (1 - e.x < 0.002) {\n        e.x = 1\n        e.v = 0\n      }\n    }\n    if (e.x < 1) more = true\n    for (const g of goals) {\n      const row = (rows.current[g.id] ??= blank())\n      const el = parts.current[g.id]\n      if (!el) continue\n      const p = (at(g.series, Math.min(reading, g.series.length - 1)) / g.goal) * e.x\n      const pressing = dt > 0 && v > 0.04\n      const wall = walls[g.id] ?? 0.02\n      if (p <= 1 && row.through) {\n        row.through = false\n        mark(g.id, false)\n      } else if (p > 1 && !row.through && (p > 1 + wall || !pressing)) {\n        row.through = true\n        row.held.x = 1 - p\n        row.held.v = 0\n        mark(g.id, true)\n        if (byHand.current && !muted) feedback.tick(true, Math.abs(v) / 8)\n      }\n      const push = !row.through && p > 1 ? (p - 1) / wall : 0\n      const give = push > 0 ? GIVE * (1 - 1 / (1 + push * 2.2)) * 1.45 : 0\n      if (reduce) {\n        row.strain.x = row.strain.v = row.held.x = row.held.v = 0\n        row.flood.x = row.through ? 1 : 0\n      } else if (dt > 0) {\n        springStep(row.strain, give, row.through ? SNAPPING : HOLDING, dt)\n        springStep(row.flood, row.through ? 1 : 0, FLOOD, dt)\n        if (row.held.x || row.held.v) springStep(row.held, 0, CATCH_UP, dt)\n      }\n      const q = row.through ? p + row.held.x : Math.min(p, 1)\n      const flood = clamp(row.flood.x, 0, 1)\n      const speed = dt > 0 ? (q * 100 - row.pct) / dt : 0\n      row.pct = q * 100\n      if (el.track) el.track.style.transform = `scaleX(${1 + Math.max(-0.006, row.strain.x)})`\n      if (el.fill) {\n        el.fill.style.transform = `translate3d(${(Math.min(1, q) - 1) * 100}%,0,0)`\n        el.fill.style.opacity = String(1 - flood)\n      }\n      if (el.over) el.over.style.transform = `translate3d(${(1 - flood) * 100}%,0,0)`\n      el.number?.(Math.max(0, Math.min(999, q * 100)), speed)\n      if (Math.abs(row.strain.x) + Math.abs(row.strain.v) > 1e-4 || Math.abs(row.held.x) + Math.abs(row.held.v) > 1e-3 || Math.abs(row.flood.x - (row.through ? 1 : 0)) > 1e-3) more = true\n    }\n    const span = Math.max(1, days - 1)\n    if (thumb.current) thumb.current.style.transform = `translate3d(${(x / span) * 100}%,0,0)`\n    if (line.current) line.current.style.transform = `translate3d(${(x / span - 1) * 100}%,0,0)`\n    return more\n  }\n\n  const dial = useDetent({\n    value: today,\n    stops,\n    min: 0,\n    reach: 1.1,\n    throw: 0.2,\n    spring: { w: 12.5, z: 1 },\n    catch: { w: 26, z: 1 },\n    muted: true,\n    onFrame: (x, v, { dt }) => paint(x, v, dt),\n    onStop: (i) => latest.current.setDay(i),\n    onRest: (_, i) => {\n      byHand.current = false\n      if (i === latest.current.today) latest.current.setDay(null)\n    },\n  })\n  useImperativeHandle(ref, () => ({\n    point: setAt,\n    scrub: (d) => void (dial.mode() !== 'held' && dial.to(d === null ? today : clamp(d, 0, today), { spring: { w: 22, z: 1 } })),\n    sweep: (d, ms) => void (dial.mode() !== 'held' && dial.sweep(clamp(d, 0, today), ms)),\n  }))\n\n  useLayoutEffect(() => {\n    paint(dial.get(), 0, 0)\n    dial.wake()\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [dial])\n\n  const d = day ?? today\n  const pace = (d + 1) / days\n\n  const root = useRef<HTMLDivElement>(null)\n  const touched = hovered !== null || day !== null\n  useEffect(() => {\n    if (!touched) return\n    const away = (e: globalThis.PointerEvent) => {\n      if (e.pointerType !== 'touch' || root.current?.contains(e.target as Node)) return\n      setAt(null)\n      dial.to(today)\n    }\n    document.addEventListener('pointerdown', away)\n    return () => document.removeEventListener('pointerdown', away)\n  }, [touched, dial, today])\n\n  return (\n    <div ref={root} className=\"@container\" onPointerLeave={(e) => e.pointerType !== 'touch' && setAt(null)}>\n      <ul className=\"flex flex-col gap-2\">\n        {goals.map((g) => {\n          const f = g.format ?? compact\n          const v = g.series[Math.min(d, g.series.length - 1)] ?? 0\n          const p = v / g.goal\n          const pct = Math.min(999, Math.round(p * 100))\n          const over = !!broken[g.id]\n          const ahead = !over && p > pace + 0.04\n          const even = !over && !ahead && p > pace - 0.04\n          const el = (parts.current[g.id] ??= { track: null, fill: null, over: null, number: null })\n          return (\n            <li key={g.id}>\n              <button\n                type=\"button\"\n                onPointerEnter={() => setAt(g.id)}\n                onFocus={() => setAt(g.id)}\n                onBlur={() => setAt(null)}\n                aria-label={`${g.label}: ${f(v)} of ${f(g.goal)}, ${pct}%${p > 1 ? `, ${pct - 100}% over` : ahead ? ', ahead of pace' : ''}`}\n                className={`ring-focus relative flex w-full items-center gap-3 rounded-[16px] px-4 py-3 text-left transition-opacity ease-detent duration-150 ${hovered && hovered !== g.id ? 'opacity-45' : ''}`}\n              >\n                <span\n                  aria-hidden\n                  ref={(n) => {\n                    el.track = n\n                  }}\n                  className=\"absolute inset-0 origin-left overflow-hidden rounded-[16px] bg-[color-mix(in_oklch,var(--ink)_4%,transparent)] will-change-transform\"\n                >\n                  <span\n                    ref={(n) => {\n                      el.fill = n\n                    }}\n                    className={`absolute inset-0 rounded-[16px] ${FILL}`}\n                    style={{ transform: 'translate3d(-100%,0,0)' }}\n                  />\n                  <span\n                    ref={(n) => {\n                      el.over = n\n                    }}\n                    className={`absolute inset-0 rounded-[16px] ${FILL_OVER}`}\n                    style={{ transform: 'translate3d(100%,0,0)' }}\n                  />\n                </span>\n                <span className=\"relative min-w-0 flex-1\">\n                  <span className=\"block truncate text-callout text-ink\">{g.label}</span>\n                  <span className=\"tnum mt-0.5 block truncate text-footnote text-ink-2 @max-[300px]:min-h-[2lh] @max-[300px]:whitespace-normal\">\n                    {f(v)} of {f(g.goal)}\n                    {over ? <Note className=\"text-warn-ink\">{Math.max(0, pct - 100)}% over</Note> : ahead ? <Note>ahead of pace</Note> : even ? <Note>on pace</Note> : null}\n                  </span>\n                </span>\n                <span className={`relative flex items-center text-[38px] leading-[44px] tracking-[-0.035em] transition-colors ease-detent duration-200 @max-[300px]:text-[30px] ${over ? 'text-warn-ink' : 'text-ink'}`}>\n                  <span className=\"sr-only\">{pct}</span>\n                  <Wheels onReady={(set) => (el.number = set)} />\n                  <span aria-hidden className=\"ml-1 self-start pt-[5px] text-[17px] leading-[20px] tracking-normal opacity-55 @max-[300px]:text-[14px]\">\n                    %\n                  </span>\n                </span>\n              </button>\n            </li>\n          )\n        })}\n      </ul>\n      <DayScrubber goals={goals} days={days} today={today} day={day} label={dayLabel} dial={dial} thumb={thumb} line={line} byHand={byHand} muted={muted} />\n    </div>\n  )\n}\n\nconst whole = (n: number) => String(Math.round(n))\n\nfunction Wheels({ onReady }: { onReady: (set: (v: number, speed: number) => void) => void }) {\n  const el = useRef<HTMLSpanElement>(null)\n  useLayoutEffect(() => {\n    const set = createRoller(el.current!, whole, 3)\n    set(0, 0)\n    onReady(set)\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [])\n  return <span ref={el} aria-hidden className=\"tnum inline-flex\" style={{ lineHeight: '1.25em', height: '1.25em', minWidth: '3ch', justifyContent: 'flex-end' }} />\n}\n\nfunction DayScrubber({ goals, days, today, day, label, dial, thumb, line, byHand, muted }: { goals: Goal[]; days: number; today: number; day: number | null; label: (d: number) => string; dial: ReturnType<typeof useDetent>; thumb: Ref<HTMLSpanElement>; line: Ref<HTMLSpanElement>; byHand: { current: boolean }; muted?: boolean }) {\n  const track = useRef<HTMLDivElement>(null)\n  const d = day ?? today\n  const crossed = [...new Set(goals.map((g) => g.series.findIndex((v) => v >= g.goal)).filter((i) => i >= 0))]\n  const x = (i: number) => `${(i / Math.max(1, days - 1)) * 100}%`\n  const span = useRef(days - 1)\n  const end = useRef(today)\n  const quiet = useRef(muted)\n  useLayoutEffect(() => {\n    span.current = days - 1\n    end.current = today\n    quiet.current = muted\n  })\n  const [drag] = useState(() =>\n    dragProps(dial, () => ({\n      box: () => track.current,\n      units: span.current,\n      absolute: (f) => f * span.current,\n      hover: true,\n      muted: quiet.current,\n      onGrab: () => (byHand.current = true),\n      onTap: (f) => dial.to(Math.round(clamp(f * span.current, 0, end.current)), { spring: { w: 22, z: 1 } }),\n      onLeave: () => dial.to(end.current),\n    })),\n  )\n  const key = (e: KeyboardEvent) => {\n    if (stepKey(dial, e)) return\n    if (e.key === 'Home') dial.to(0)\n    else if (e.key === 'End' || e.key === 'Escape') dial.to(today)\n    else return\n    e.preventDefault()\n  }\n\n  return (\n    <div className=\"mt-3 flex items-center gap-4\">\n      <p className=\"tnum flex w-[92px] shrink-0 items-center text-footnote\">\n        <RollingText text={label(d)} className=\"text-ink\" proportional still={day !== null} />\n        {day === null && <span className=\"text-ink-3\">&nbsp;· today</span>}\n      </p>\n      <div\n        ref={track}\n        role=\"slider\"\n        tabIndex={0}\n        aria-label=\"Read the goals on a day\"\n        aria-valuemin={1}\n        aria-valuemax={today + 1}\n        aria-valuenow={d + 1}\n        aria-valuetext={label(d)}\n        onKeyDown={key}\n        {...drag}\n        className=\"ring-focus relative flex h-8 flex-1 cursor-ew-resize touch-pan-y select-none items-center rounded-full pointer-coarse:h-10\"\n      >\n        <span className=\"absolute inset-x-0 h-1.5 rounded-full bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]\" />\n        <span className=\"absolute left-0 h-1.5 rounded-full bg-[color-mix(in_oklch,var(--ink)_8%,transparent)]\" style={{ width: x(today) }} />\n        <span className=\"absolute inset-x-0 h-1.5 overflow-hidden rounded-full\">\n          <span ref={line} className=\"absolute inset-0 rounded-full bg-dt-accent\" style={{ transform: `translate3d(${(today / Math.max(1, days - 1) - 1) * 100}%,0,0)` }} />\n        </span>\n        {crossed.map((i) => (\n          <span key={i} className={`absolute size-[6px] -translate-x-1/2 rounded-full bg-warn shadow-[0_0_0_2px_var(--surface)] transition-opacity ease-detent duration-150 ${i > d ? 'opacity-55' : ''}`} style={{ left: x(i) }} />\n        ))}\n        <span ref={thumb} aria-hidden className=\"pointer-events-none absolute inset-x-0 h-[18px]\" style={{ transform: `translate3d(${(today / Math.max(1, days - 1)) * 100}%,0,0)` }}>\n          <span className=\"absolute left-0 top-0 size-[18px] -translate-x-1/2 rounded-full bg-white shadow-[0_0_0_0.5px_rgb(0_0_0/0.14),0_1px_4px_rgb(0_0_0/0.2)]\" />\n        </span>\n      </div>\n    </div>\n  )\n}\n"},{"path":"components/detent/lib/detent.ts","target":"components/detent/lib/detent.ts","type":"registry:component","content":"import { useLayoutEffect, useRef, useState } from 'react'\nimport type { KeyboardEvent, PointerEvent as ReactPointerEvent } from 'react'\nimport { useReducedMotion } from 'motion/react'\n\nexport const clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\nexport const lerp = (a: number, b: number, t: number) => a + (b - a) * t\nexport const glide = (a: number, b: number, t: number) => (a > 0 && b > 0 ? a * Math.pow(b / a, t) : lerp(a, b, t))\n\nexport const notched = (x: number, centres: number[], reach: number, hold = 0.7) => {\n  for (const c of centres) {\n    const d = (x - c) / reach\n    if (Math.abs(d) < 1) return x - ((hold * reach) / Math.PI) * Math.sin(Math.PI * d) * ((1 + Math.cos(Math.PI * d)) / 2)\n  }\n  return x\n}\n\nexport const at = (list: number[], i: number, mix = lerp) => {\n  const a = clamp(Math.floor(i), 0, list.length - 1)\n  return mix(list[a], list[Math.min(list.length - 1, a + 1)], clamp(i - a, 0, 1))\n}\n\nexport type Spring = { w: number; z: number }\nexport type Body = { x: number; v: number }\n\nexport function springStep(b: Body, target: number, { w, z }: Spring, dt: number) {\n  const a = b.x - target\n  if (z >= 1) {\n    const e = Math.exp(-w * dt)\n    const k = b.v + w * a\n    b.x = target + (a + k * dt) * e\n    b.v = (b.v - k * w * dt) * e\n    return b\n  }\n  const wd = w * Math.sqrt(1 - z * z)\n  const e = Math.exp(-z * w * dt)\n  const c = Math.cos(wd * dt)\n  const s = Math.sin(wd * dt)\n  const B = (b.v + z * w * a) / wd\n  b.x = target + e * (a * c + B * s)\n  b.v = e * ((B * wd - z * w * a) * c - (a * wd + z * w * B) * s)\n  return b\n}\n\nconst still = (b: Body, target: number, eps: number) => Math.abs(b.x - target) < eps && Math.abs(b.v) < eps * 12\n\nconst rubber = (d: number, reach: number, s: number) => reach * (1 - 1 / (1 + (s * d) / reach))\n\nfunction tracker(window = 90) {\n  const samples: [number, number][] = []\n  return {\n    clear: () => (samples.length = 0),\n    add(t: number, x: number) {\n      samples.push([t, x])\n      while (samples.length > 2 && t - samples[0][0] > window) samples.shift()\n    },\n    read(now: number) {\n      const n = samples.length\n      if (n < 2 || now - samples[n - 1][0] > 60) return 0\n      const mt = samples.reduce((s, p) => s + p[0], 0) / n\n      const mx = samples.reduce((s, p) => s + p[1], 0) / n\n      const num = samples.reduce((s, p) => s + (p[0] - mt) * (p[1] - mx), 0)\n      const den = samples.reduce((s, p) => s + (p[0] - mt) ** 2, 0)\n      return den > 0 ? (num / den) * 1000 : 0\n    },\n  }\n}\n\nexport const feedback = (() => {\n  let audio: AudioContext | null = null\n  let last = 0\n  let asked = false\n  let on = true\n  let cancel: (() => void) | null = null\n  let holding = false\n  const open = () => {\n    cancel = null\n    audio ??= new AudioContext()\n    if (asked && audio.state === 'suspended') void audio.resume()\n  }\n  const warm = () => {\n    if (!on || audio || cancel || holding || typeof AudioContext === 'undefined') return\n    if (typeof requestIdleCallback === 'function') {\n      const id = requestIdleCallback(open, { timeout: 300 })\n      cancel = () => cancelIdleCallback(id)\n    } else {\n      const id = setTimeout(open, 60)\n      cancel = () => clearTimeout(id)\n    }\n  }\n  const letGo = () => {\n    holding = false\n    removeEventListener('pointerup', letGo)\n    removeEventListener('pointercancel', letGo)\n    warm()\n  }\n  const play = (heavy: boolean, loud: number) => {\n    if (!audio) return\n    const t = audio.currentTime\n    const tone = audio.createOscillator()\n    const gain = audio.createGain()\n    tone.frequency.setValueAtTime(heavy ? 900 : 1500, t)\n    tone.frequency.exponentialRampToValueAtTime(heavy ? 240 : 420, t + 0.014)\n    gain.gain.setValueAtTime((heavy ? 0.034 : 0.02) * loud, t)\n    gain.gain.exponentialRampToValueAtTime(0.0001, t + (heavy ? 0.03 : 0.016))\n    tone.connect(gain).connect(audio.destination)\n    tone.start(t)\n    tone.stop(t + 0.034)\n  }\n  return {\n    set(next: boolean) {\n      on = next\n      if (on) return\n      cancel?.()\n      cancel = null\n      void audio?.suspend()\n    },\n    warm,\n    wake(grab = false) {\n      if (!on) return\n      asked = true\n      if (audio) {\n        if (audio.state === 'suspended') void audio.resume()\n      } else if (!grab) warm()\n      else if (!holding && typeof AudioContext !== 'undefined') {\n        cancel?.()\n        cancel = null\n        holding = true\n        addEventListener('pointerup', letGo)\n        addEventListener('pointercancel', letGo)\n      }\n    },\n    tick(heavy = false, speed = 1) {\n      if (!on || !asked) return\n      const now = performance.now()\n      if (now - last < 34) return\n      last = now\n      if (typeof navigator !== 'undefined' && 'vibrate' in navigator) navigator.vibrate(heavy ? 10 : 4)\n      if (!audio) return\n      const loud = 0.45 + 0.55 * clamp(speed, 0, 1)\n      if (audio.state === 'running') play(heavy, loud)\n      else void audio.resume().then(() => on && play(heavy, loud))\n    },\n  }\n})()\n\nexport type FrameInfo = {\n  dt: number\n  mode: Mode\n  live: boolean\n}\nexport type Mode = 'rest' | 'held' | 'coast' | 'settle' | 'sweep'\n\nexport type DetentOptions = {\n  value: number\n  stops?: number[]\n  min?: number\n  max?: number\n  magnet?: number\n  reach?: number\n  throw?: number\n  spring?: Spring\n  catch?: Spring\n  muted?: boolean\n  reduce?: boolean\n  onFrame: (x: number, v: number, info: FrameInfo) => boolean | void\n  onStop?: (i: number) => void\n  onRest?: (x: number, i: number) => void\n}\n\nexport type Detent = ReturnType<typeof createDetent>\n\nconst SPRING: Spring = { w: 17, z: 0.92 }\nconst CATCH: Spring = { w: 24, z: 1 }\nconst MOMENTUM = 1\nconst SWIFT = 8\n\nexport function createDetent(read: () => DetentOptions) {\n  const init = read()\n  const body: Body = { x: init.value, v: 0 }\n  const residual: Body = { x: 0, v: 0 }\n  const track = tracker()\n  let mode: Mode = 'rest'\n  let hand = init.value\n  let target = init.value\n  let spring = SPRING\n  let friction = 4\n  let frame = 0\n  let then = 0\n  let feel = false\n  let stop = -1\n  let shown = init.value\n  let sweep = { from: 0, to: 0, t: 0, T: 1 }\n  let keyAt = 0\n\n  const span = () => {\n    const o = read()\n    const s = o.stops\n    return { o, s, lo: o.min ?? s?.[0] ?? -Infinity, hi: o.max ?? s?.[s.length - 1] ?? Infinity, m: o.reduce ? 0 : o.magnet ?? 0, reach: o.reach ?? ((s && s.length > 1 ? s[1] - s[0] : 1) * 0.5) }\n  }\n\n  const out = (u: number) => {\n    const { s, lo, hi, m, reach } = span()\n    if (u < lo) return lo - rubber(lo - u, reach, 1 - m)\n    if (u > hi) return hi + rubber(u - hi, reach, 1 - m)\n    if (!s || s.length < 2 || !m) return u\n    let i = 0\n    while (i < s.length - 2 && u > s[i + 1]) i++\n    const t = (u - s[i]) / (s[i + 1] - s[i])\n    return s[i] + (s[i + 1] - s[i]) * (t - (m * Math.sin(2 * Math.PI * t)) / (2 * Math.PI))\n  }\n  const slope = (u: number) => {\n    const e = 1e-4\n    return (out(u + e) - out(u - e)) / (2 * e)\n  }\n  const nearest = (x: number) => {\n    const { s, lo, hi } = span()\n    if (!s?.length) return { i: -1, value: clamp(x, lo, hi) }\n    let i = 0\n    for (let k = 1; k < s.length; k++) if (Math.abs(s[k] - x) < Math.abs(s[i] - x)) i = k\n    return { i, value: s[i] }\n  }\n\n  const start = () => {\n    if (frame || typeof requestAnimationFrame === 'undefined') return\n    then = performance.now()\n    frame = requestAnimationFrame(loop)\n  }\n\n  const land = () => {\n    mode = 'rest'\n    body.x = target\n    body.v = 0\n    feel = false\n  }\n\n  const emit = (dt: number) => {\n    const { o } = span()\n    const x = out(body.x)\n    const v = slope(body.x) * body.v\n    shown = x\n    const n = nearest(x).i\n    if (n !== stop) {\n      if (stop >= 0) {\n        o.onStop?.(n)\n        if (feel && !o.muted) feedback.tick(false, Math.abs(v) / (gap() * SWIFT))\n      }\n      stop = n\n    }\n    return o.onFrame(x, v, { dt, mode, live: mode === 'held' || mode === 'coast' })\n  }\n\n  function advance(dt: number, now: number) {\n    const { o } = span()\n    if (mode === 'held' || mode === 'sweep') {\n      if (mode === 'sweep') {\n        sweep.t = Math.min(sweep.T, sweep.t + dt)\n        const p = sweep.t / sweep.T\n        const next = lerp(sweep.from, sweep.to, p * p * p * (p * (6 * p - 15) + 10))\n        body.v = dt > 0 ? (next - hand) / dt + residual.v : body.v\n        hand = next\n      }\n      springStep(residual, 0, o.catch ?? CATCH, dt)\n      body.x = hand + residual.x\n      if (mode === 'held') body.v = track.read(now) + residual.v\n      if (mode === 'sweep' && sweep.t >= sweep.T && still(residual, 0, 1e-3)) {\n        target = sweep.to\n        land()\n        return true\n      }\n      return false\n    }\n    if (mode === 'coast') {\n      const e = Math.exp(-friction * dt)\n      body.x += (body.v / friction) * (1 - e)\n      body.v *= e\n      const left = Math.abs(target - body.x)\n      if (left < coastEnd() || Math.abs(body.v) < 0.5 * coastEnd() || Math.sign(target - body.x) !== Math.sign(body.v)) mode = 'settle'\n      return false\n    }\n    if (mode === 'settle') {\n      springStep(body, target, spring, dt)\n      if (still(body, target, settleEps())) {\n        land()\n        return true\n      }\n    }\n    return false\n  }\n  const gap = () => {\n    const { s } = span()\n    return s && s.length > 1 ? (s[s.length - 1] - s[0]) / (s.length - 1) : 1\n  }\n  const landing = (s: Spring, v: number): Spring => (Math.abs(v) > gap() * MOMENTUM ? s : { ...s, z: 1 })\n  const coastEnd = () => gap() * 0.7\n  const settleEps = () => gap() * 0.0015\n\n  function loop(now: number) {\n    frame = 0\n    const dt = clamp((now - then) / 1000, 1 / 240, 0.05)\n    then = now\n    const was = mode\n    const landed = was !== 'rest' && advance(dt, now)\n    const more = emit(dt)\n    if (landed) {\n      const { o } = span()\n      o.onRest?.(out(body.x), nearest(out(body.x)).i)\n    }\n    if (mode !== 'rest' || more) frame = requestAnimationFrame(loop)\n  }\n\n  const launch = () => {\n    const away = target - body.x\n    if (Math.abs(away) > gap() * 1.6 && Math.sign(away) === Math.sign(body.v)) {\n      friction = clamp(Math.abs(body.v / away), 2.5, 9)\n      mode = 'coast'\n    } else mode = 'settle'\n    start()\n  }\n\n  const to = (value: number, opts: { spring?: Spring; instant?: boolean; velocity?: number; feel?: boolean } = {}) => {\n    const { o, lo, hi } = span()\n    target = clamp(value, lo, hi)\n    if (opts.velocity !== undefined) body.v = opts.velocity\n    feel = !!opts.feel\n    if (opts.instant || o.reduce) {\n      land()\n      emit(0)\n      o.onRest?.(target, nearest(target).i)\n      return\n    }\n    if (mode === 'held') {\n      body.x = hand + residual.x\n      residual.x = residual.v = 0\n    }\n    spring = opts.spring ?? landing(o.spring ?? SPRING, opts.velocity ?? 0)\n    mode = 'settle'\n    start()\n  }\n\n  const api = {\n    get: () => shown,\n    place: () => body.x + (mode === 'rest' ? 0 : body.v / (span().o.catch ?? CATCH).w),\n    velocity: () => slope(body.x) * body.v,\n    mode: () => mode,\n    target: () => target,\n    nearest,\n\n    set(value: number) {\n      body.x = target = hand = value\n      body.v = residual.x = residual.v = 0\n      mode = 'rest'\n      feel = false\n      stop = -1\n      emit(0)\n      stop = nearest(shown).i\n    },\n    to,\n\n    grab(place: number, { feel: touching = true }: { feel?: boolean } = {}) {\n      const { o } = span()\n      residual.x = o.reduce ? 0 : body.x - place\n      residual.v = o.reduce ? 0 : body.v\n      hand = place\n      track.clear()\n      track.add(performance.now(), place)\n      feel = touching\n      mode = 'held'\n      start()\n    },\n    drag(place: number) {\n      if (mode !== 'held') return\n      hand = place\n      track.add(performance.now(), place)\n    },\n    release({ flick = true, home }: { flick?: boolean; home?: number } = {}) {\n      if (mode !== 'held') return\n      const { o, lo, hi } = span()\n      const flung = flick ? track.read(performance.now()) : 0\n      body.x = hand + residual.x\n      body.v = flung + residual.v\n      residual.x = residual.v = 0\n      const rest = home ?? nearest(clamp(body.x + flung * (o.throw ?? 0.16), lo, hi)).value\n      target = rest\n      spring = landing(o.spring ?? SPRING, body.v)\n      if (o.reduce) {\n        to(rest)\n        return\n      }\n      launch()\n    },\n    fling(velocity: number) {\n      const { o, lo, hi } = span()\n      const rest = nearest(clamp(body.x + velocity * (o.throw ?? 0.16), lo, hi)).value\n      if (o.reduce) return to(rest)\n      residual.x = residual.v = 0\n      body.v = velocity\n      feel = false\n      target = rest\n      spring = o.spring ?? SPRING\n      launch()\n    },\n    sweep(value: number, ms: number) {\n      const { o } = span()\n      if (o.reduce) return to(value)\n      residual.x = 0\n      residual.v = body.v\n      hand = body.x\n      sweep = { from: body.x, to: value, t: 0, T: Math.max(0.05, ms / 1000) }\n      feel = false\n      mode = 'sweep'\n      start()\n    },\n    step(by: number, repeat = false) {\n      const { o, s, lo, hi } = span()\n      const now = performance.now()\n      const quick = repeat || now - keyAt < 110\n      keyAt = now\n      if (!o.muted) feedback.wake()\n      const from = mode === 'rest' ? body.x : target\n      const next = s ? s[clamp(nearest(from).i + by, 0, s.length - 1)] : clamp(from + by, lo, hi)\n      to(next, { instant: quick, feel: !quick })\n      return next\n    },\n    wake: start,\n    dispose() {\n      cancelAnimationFrame(frame)\n      frame = 0\n    },\n  }\n  return api\n}\n\nexport function useDetent(options: Omit<DetentOptions, 'reduce'>) {\n  const reduce = !!useReducedMotion()\n  const latest = useRef<DetentOptions>({ ...options, reduce })\n  useLayoutEffect(() => {\n    latest.current = { ...options, reduce }\n  })\n  const [d] = useState(() => createDetent(() => latest.current))\n  useLayoutEffect(() => () => d.dispose(), [d])\n  return d\n}\n\nexport type DragConfig = {\n  axis?: 'x' | 'y'\n  box: () => HTMLElement | null\n  units: number\n  absolute?: (fraction: number) => number\n  hover?: boolean\n  follow?: boolean\n  onTap?: (fraction: number) => void\n  onLeave?: () => void\n  onGrab?: () => void\n  release?: () => { flick?: boolean; home?: number }\n  muted?: boolean\n}\n\nconst SLOP = { mouse: 5, touch: 10 }\n\nexport function dragProps(d: Detent, read: () => DragConfig) {\n  let press: { id: number; px: number; py: number; from: number; moved: boolean; held: boolean; caught: boolean } | null = null\n  const place = (e: ReactPointerEvent) => {\n    const c = read()\n    const r = c.box()?.getBoundingClientRect()\n    if (!r) return null\n    const horizontal = (c.axis ?? 'x') === 'x'\n    const size = (horizontal ? r.width : r.height) || 1\n    const px = horizontal ? e.clientX : e.clientY\n    return { fraction: (px - (horizontal ? r.left : r.top)) / size, px, unit: size / c.units, c }\n  }\n  const hand = (e: ReactPointerEvent) => {\n    const p = place(e)\n    if (!p || !press) return null\n    return p.c.absolute && !press.caught ? p.c.absolute(p.fraction) : press.from + (p.px - ((p.c.axis ?? 'x') === 'x' ? press.px : press.py)) / p.unit\n  }\n  const take = (e: ReactPointerEvent) => {\n    if (!press) return\n    const at = hand(e)\n    if (at === null) return\n    press.held = true\n    read().onGrab?.()\n    d.grab(at)\n  }\n  const inFlight = () => d.mode() !== 'rest' && d.mode() !== 'held' && d.mode() !== 'sweep'\n  return {\n    onPointerDown(e: ReactPointerEvent) {\n      if (e.button) return\n      const c = read()\n      if (!c.muted) feedback.wake(true)\n      e.currentTarget.setPointerCapture?.(e.pointerId)\n      press = { id: e.pointerId, px: e.clientX, py: e.clientY, from: d.place(), moved: false, held: false, caught: inFlight() && !c.follow }\n      if (e.pointerType !== 'touch' || press.caught || !c.absolute) take(e)\n    },\n    onPointerMove(e: ReactPointerEvent) {\n      const c = read()\n      if (!c.muted && e.pointerType === 'mouse') feedback.warm()\n      if (press) {\n        if (e.pointerId !== press.id) return\n        if (!press.moved && Math.hypot(e.clientX - press.px, e.clientY - press.py) > (e.pointerType === 'touch' ? SLOP.touch : SLOP.mouse)) press.moved = true\n        if (!press.held && press.moved) take(e)\n        const at = hand(e)\n        if (at !== null && press.held) d.drag(at)\n        return\n      }\n      if (!c.hover || e.pointerType !== 'mouse' || (inFlight() && !c.follow)) return\n      const p = place(e)\n      if (!p || !c.absolute) return\n      const at = c.absolute(p.fraction)\n      if (d.mode() === 'held') d.drag(at)\n      else {\n        c.onGrab?.()\n        d.grab(at, { feel: false })\n      }\n    },\n    onPointerUp(e: ReactPointerEvent) {\n      if (!press || e.pointerId !== press.id) return\n      const { moved, held } = press\n      const p = place(e)\n      const c = read()\n      press = null\n      if (!moved && c.onTap && p) {\n        if (held) d.release({ flick: false, home: d.get() })\n        c.onTap(p.fraction)\n      } else if (held) d.release(c.release?.())\n    },\n    onPointerCancel(e: ReactPointerEvent) {\n      if (!press || e.pointerId !== press.id) return\n      const { held } = press\n      press = null\n      if (held) d.release({ flick: false })\n      read().onLeave?.()\n    },\n    onPointerLeave(e: ReactPointerEvent) {\n      if (press || e.pointerType !== 'mouse') return\n      const c = read()\n      if (!c.hover) return\n      if (d.mode() === 'held') d.release({ flick: false, home: d.get() })\n      c.onLeave?.()\n    },\n  }\n}\n\nexport const stepKey = (d: Detent, e: KeyboardEvent, keys: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 }) => {\n  const by = keys[e.key]\n  if (!by) return false\n  e.preventDefault()\n  d.step(by, e.repeat)\n  return true\n}\n\nconst COLUMN = 'display:inline-block;height:1.25em;overflow:hidden;vertical-align:top'\nconst STRIP = '0123456789'\n\nexport function createRoller(el: HTMLElement, format: (n: number) => string, pad = 0, built?: (columns: HTMLElement[]) => void) {\n  let shape = ''\n  let wheels: { strip: HTMLElement; col: HTMLElement }[] = []\n  let scale = 1\n\n  const build = (s: string, digits: number) => {\n    el.textContent = ''\n    wheels = []\n    const col = () => {\n      const c = document.createElement('span')\n      c.style.cssText = COLUMN\n      const strip = document.createElement('span')\n      strip.style.cssText = 'display:block;will-change:transform'\n      strip.innerHTML = [...STRIP, '0'].map((n) => `<span style=\"display:block;height:1.25em\">${n}</span>`).join('')\n      c.append(strip)\n      el.append(c)\n      wheels.push({ strip, col: c })\n    }\n    let padded = Math.max(0, pad - digits)\n    let leading = true\n    for (const ch of s) {\n      if (/\\d/.test(ch)) {\n        if (leading) for (; padded > 0; padded--) col()\n        leading = false\n        col()\n      } else {\n        const c = document.createElement('span')\n        c.textContent = ch\n        c.style.whiteSpace = 'pre'\n        el.append(c)\n      }\n    }\n    built?.([...el.children] as HTMLElement[])\n  }\n\n  return (value: number, speed = 0) => {\n    const s = format(value)\n    const digits = s.replace(/\\D/g, '')\n    const next = s.replace(/\\d/g, '0')\n    if (next !== shape) {\n      shape = next\n      build(s, digits.length)\n    }\n    const numeric = s.replace(/[^\\d.]/g, '').replace(/\\.$/, '')\n    const shownNumber = parseFloat(numeric)\n    const decimals = numeric.includes('.') ? numeric.length - numeric.indexOf('.') - 1 : 0\n    if (shownNumber > 0) scale = Math.abs(value) / shownNumber\n    const place = Math.pow(10, -decimals) * (scale || 1)\n    const q = Math.abs(value) / place\n    const free = clamp(Math.abs(speed) / (place * 6), 0, 1)\n    const count = wheels.length\n    const whole = digits.padStart(count, '0')\n    for (let k = 0; k < count; k++) {\n      const { strip, col } = wheels[count - 1 - k]\n      const unit = Math.pow(10, k)\n      const lower = q % unit\n      const carry = k === 0 ? q - Math.floor(q) : clamp(lower - (unit - 1), 0, 1)\n      const running = (Math.floor(q / unit) % 10) + carry\n      const digit = +whole[count - 1 - k]\n      const off = ((digit - running + 15) % 10) - 5\n      const pos = (running + off * (1 - free) + 10) % 10\n      strip.style.transform = `translateY(${(-pos * 100) / 11}%)`\n      if (pad) {\n        const higher = Math.floor(q / unit)\n        const fade = k === 0 ? 1 : higher > 0 ? 1 : clamp(lower - (unit - 1), 0, 1)\n        col.style.opacity = String(fade)\n      }\n    }\n  }\n}\n\nexport const write = (el: HTMLElement | null | undefined, text: string) => {\n  if (el && el.textContent !== text) el.textContent = text\n}\n"},{"path":"components/detent/ui/RollingText.tsx","target":"components/detent/ui/RollingText.tsx","type":"registry:component","content":"'use client'\n\nimport { useLayoutEffect, useRef, useState } from 'react'\nimport { animate, motion, useMotionValue } from 'motion/react'\n\nconst roll = { type: 'spring', stiffness: 380, damping: 34, mass: 0.8 } as const\n\nexport function RollingText({ text, className = '', proportional = false, still = false }: { text: string; className?: string; proportional?: boolean; still?: boolean }) {\n  const chars = [...text]\n  const probe = useRef<HTMLSpanElement>(null)\n  const [widths, setWidths] = useState<number[] | null>(null)\n\n  useLayoutEffect(() => {\n    if (!proportional || !probe.current) return\n    const read = () => {\n      const box = probe.current!\n      const z = box.offsetWidth ? box.getBoundingClientRect().width / box.offsetWidth : 1\n      const em = parseFloat(getComputedStyle(box).fontSize) || 16\n      setWidths([...box.children].map((c) => (c as HTMLElement).getBoundingClientRect().width / z / em))\n    }\n    read()\n    document.fonts?.ready.then(read)\n  }, [proportional])\n\n  return (\n    <span className={`relative inline-flex ${proportional ? '' : 'tnum'} ${className}`} style={{ lineHeight: '1.25em', height: '1.25em' }}>\n      <span className=\"sr-only\">{text}</span>\n      {proportional && (\n        <span aria-hidden className=\"pointer-events-none absolute left-0 top-0 size-0 overflow-hidden\">\n          <span ref={probe} className=\"invisible flex w-max whitespace-pre\">\n            {Array.from({ length: 10 }, (_, n) => (\n              <span key={n}>{n}</span>\n            ))}\n          </span>\n        </span>\n      )}\n      {chars.map((c, i) => {\n        const key = chars.length - i\n        return /\\d/.test(c) ? (\n          <Digit key={key} d={+c} width={proportional && widths ? widths[+c] : undefined} still={still} />\n        ) : (\n          <span key={`${key}${c}`} aria-hidden className=\"whitespace-pre\">\n            {c}\n          </span>\n        )\n      })}\n    </span>\n  )\n}\n\nfunction Digit({ d, width, still }: { d: number; width?: number; still: boolean }) {\n  const w = useMotionValue<string>(width === undefined ? '1ch' : `${width}em`)\n  const had = useRef(width !== undefined)\n  useLayoutEffect(() => {\n    if (width === undefined) return\n    if (!had.current) {\n      had.current = true\n      w.set(`${width}em`)\n      return\n    }\n    const ctl = animate(w, `${width}em`, roll)\n    return () => ctl.stop()\n  }, [width, w])\n\n  return (\n    <motion.span aria-hidden className=\"relative inline-block overflow-hidden\" style={{ height: '1.25em', width: w }}>\n      <motion.span className=\"absolute inset-x-0 top-0 flex flex-col items-center\" initial={false} animate={{ y: `${-d * 10}%` }} transition={still ? { duration: 0 } : roll}>\n        {Array.from({ length: 10 }, (_, n) => (\n          <span key={n} className=\"block\" style={{ height: '1.25em' }}>\n            {n}\n          </span>\n        ))}\n      </motion.span>\n    </motion.span>\n  )\n}\n"},{"path":"components/detent/components/charts/parts.tsx","target":"components/detent/components/charts/parts.tsx","type":"registry:component","content":"'use client'\n\nimport { useEffect, useRef } from 'react'\nimport { animate, motion, useMotionValue, useReducedMotion, useTransform } from 'motion/react'\nimport type { MotionValue } from 'motion/react'\nimport { ArrowUp } from '@/components/detent/icons'\nimport { ease, spring } from '@/components/detent/lib/motion'\n\nexport const SERIES = ['light-dark(#135fc8, #498beb)', 'light-dark(#127541, #29ac68)', 'light-dark(#5b4fe0, #8470e5)', 'light-dark(#a8530b, #d67523)'] as const\nexport const GHOST = 'color-mix(in oklch, var(--ink) 26%, transparent)'\n\nexport const compact = (n: number) => {\n  const a = Math.abs(n)\n  if (a >= 1e6) return `${(n / 1e6).toFixed(a >= 1e7 ? 0 : 1).replace(/\\.0$/, '')}M`\n  if (a >= 1e4) return `${(n / 1e3).toFixed(a >= 1e5 ? 0 : 1).replace(/\\.0$/, '')}K`\n  return Math.round(n).toLocaleString('en-US')\n}\n\nexport const detent = { type: 'spring', stiffness: 900, damping: 52, mass: 0.6 } as const\nexport const morph = spring.data\nexport const sweep = { type: 'spring', stiffness: 60, damping: 18, mass: 1 } as const\n\nconst lerp = (a: number[], b: number[], t: number) => (a.length === b.length ? b.map((y, i) => a[i] + (y - a[i]) * t) : b)\n\nexport function useMorph(target: number[], still = false) {\n  const key = target.join(',')\n  const t = useMotionValue(1)\n  const a = useRef(target)\n  const b = useRef(target)\n  const reduce = useReducedMotion()\n  useEffect(() => {\n    const next = key ? key.split(',').map(Number) : []\n    if (next.join(',') === b.current.join(',')) return\n    a.current = lerp(a.current, b.current, t.get())\n    b.current = next\n    if (still || reduce) {\n      a.current = next\n      t.jump(1)\n      return\n    }\n    t.jump(0)\n    const run = animate(t, 1, morph)\n    return () => run.stop()\n  }, [key, t, reduce, still])\n  return useTransform(t, (v) => lerp(a.current, b.current, v))\n}\n\nexport function scale(max: number, steps = 4) {\n  const raw = Math.max(max, 1e-9) / steps\n  const p = 10 ** Math.floor(Math.log10(raw))\n  const step = ([1, 2, 2.5, 5, 10].find((m) => m * p >= raw) ?? 10) * p\n  const top = Math.max(step, Math.ceil(max / step) * step)\n  return { top, ticks: Array.from({ length: Math.round(top / step) + 1 }, (_, i) => i * step) }\n}\n\nexport function smooth(xs: number[], ys: number[]) {\n  const n = xs.length\n  if (n < 2) return n ? `M${xs[0]},${ys[0]}` : ''\n  const d: number[] = []\n  for (let i = 0; i < n - 1; i++) d.push((ys[i + 1] - ys[i]) / (xs[i + 1] - xs[i] || 1))\n  const m = [d[0], ...d.slice(1).map((s, i) => (s * d[i] <= 0 ? 0 : (s + d[i]) / 2)), d[n - 2]]\n  let p = `M${xs[0]},${ys[0]}`\n  for (let i = 0; i < n - 1; i++) {\n    const h = (xs[i + 1] - xs[i]) / 3\n    p += `C${xs[i] + h},${ys[i] + m[i] * h} ${xs[i + 1] - h},${ys[i + 1] - m[i + 1] * h} ${xs[i + 1]},${ys[i + 1]}`\n  }\n  return p\n}\n\nexport const Key = ({ color, area = false }: { color: string; area?: boolean }) =>\n  area ? <span className=\"size-2.5 shrink-0 rounded-[3px]\" style={{ background: color }} /> : <span className=\"h-[3px] w-3 shrink-0 rounded-full\" style={{ background: color }} />\n\nexport function Change({ value, good = 'up' }: { value: number; good?: 'up' | 'down' }) {\n  const up = value >= 0\n  const happy = up === (good === 'up')\n  const tone = happy ? 'var(--ok)' : 'var(--danger)'\n  return (\n    <span className=\"inline-flex shrink-0 items-center gap-0.5 rounded-full px-1.5 py-px text-caption font-medium tabular-nums\" style={{ color: tone, background: `color-mix(in oklch, ${tone} 13%, transparent)` }}>\n      <ArrowUp size={11} strokeWidth={2.6} style={{ transform: up ? undefined : 'rotate(180deg)' }} />\n      {Math.abs(value * 100).toFixed(1)}%\n    </span>\n  )\n}\n\nexport function Drawn({ d, still, color, width = 2 }: { d: MotionValue<string>; still: string; color: string; width?: number }) {\n  const reduce = useReducedMotion()\n  return <motion.path d={reduce ? still : d} fill=\"none\" stroke={color} strokeWidth={width} strokeLinecap=\"round\" strokeLinejoin=\"round\" initial={reduce ? false : { pathLength: 0 }} animate={{ pathLength: 1 }} transition={{ duration: 1.1, ease: ease.out }} />\n}\n\nexport function Pulse({ cx, cy, color }: { cx: number | MotionValue<number>; cy: MotionValue<number>; color: string }) {\n  const reduce = useReducedMotion()\n  return (\n    <>\n      {!reduce && <motion.circle cx={cx} cy={cy} r={4.5} fill={color} initial={{ opacity: 0.4, scale: 1 }} animate={{ opacity: 0, scale: 3.2 }} transition={{ duration: 2.4, repeat: Infinity, ease: 'easeOut' }} style={{ transformBox: 'fill-box', transformOrigin: 'center' }} />}\n      <motion.circle cx={cx} cy={cy} r={4.5} fill={color} stroke=\"var(--surface)\" strokeWidth={2} />\n    </>\n  )\n}\n"},{"path":"components/detent/components/charts/ChartCard.tsx","target":"components/detent/components/charts/ChartCard.tsx","type":"registry:component","content":"'use client'\n\nimport { useEffect, useId, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { AnimatePresence, motion } from 'motion/react'\nimport { spring, ease } from '@/components/detent/lib/motion'\n\nexport type Table = { head: string[]; rows: (string | number)[][] }\n\nexport function ChartCard({ title, headline, actions, table, className = '', children }: { title: string; headline?: ReactNode; actions?: ReactNode; table?: Table; className?: string; children: ReactNode }) {\n  const [view, setView] = useState<'chart' | 'table'>('chart')\n  const body = useRef<HTMLDivElement>(null)\n  const [h, setH] = useState(0)\n  const plate = useId()\n  useEffect(() => {\n    const el = body.current\n    if (!el) return\n    const ro = new ResizeObserver(() => view === 'chart' && setH(el.offsetHeight))\n    ro.observe(el)\n    return () => ro.disconnect()\n  }, [view])\n  return (\n    <section className={`lit @container flex min-w-0 flex-col rounded-[20px] bg-surface p-5 ring-1 ring-[color-mix(in_oklch,var(--ink)_7%,transparent)] ${className}`}>\n      <header className=\"flex flex-col gap-3 @min-[440px]:flex-row @min-[440px]:items-start @min-[440px]:justify-between @min-[440px]:gap-4\">\n        <div className=\"min-w-0\">\n          <h3 className=\"text-footnote font-medium text-ink-2\">{title}</h3>\n          {headline && <div className=\"mt-1.5\">{headline}</div>}\n        </div>\n        <div className=\"flex shrink-0 items-center gap-2\">\n          {actions}\n          {table && (\n            <div role=\"radiogroup\" aria-label=\"Show as\" className=\"flex rounded-full bg-[color-mix(in_oklch,var(--ink)_5%,transparent)] p-0.5\">\n              {(['chart', 'table'] as const).map((v) => (\n                <button key={v} type=\"button\" role=\"radio\" aria-checked={view === v} onClick={() => setView(v)} className=\"ring-focus relative h-6 rounded-full px-2.5 text-[11px] font-medium capitalize\">\n                  {view === v && <motion.span layoutId={plate} transition={spring.move} className=\"absolute inset-0 rounded-full bg-surface shadow-raised\" />}\n                  <span className={`relative z-[1] ${view === v ? 'text-ink' : 'text-ink-3'}`}>{v}</span>\n                </button>\n              ))}\n            </div>\n          )}\n        </div>\n      </header>\n      <div className=\"relative mt-4 flex flex-1 flex-col\">\n        <AnimatePresence mode=\"popLayout\" initial={false}>\n          {view === 'chart' ? (\n            <motion.div key=\"chart\" ref={body} className=\"flex flex-1 flex-col\" initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} transition={{ duration: 0.18, ease: ease.out }}>\n              {children}\n            </motion.div>\n          ) : (\n            <motion.div key=\"table\" className=\"overflow-auto overscroll-contain\" style={{ height: h || undefined }} initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} transition={{ duration: 0.18, ease: ease.out }}>\n              {table && (\n                <table className=\"w-full border-collapse text-left text-footnote\">\n                  <thead className=\"sticky top-0 bg-surface\">\n                    <tr>\n                      {table.head.map((c, i) => (\n                        <th key={c} className={`pb-2 font-medium text-ink-3 ${i ? 'text-right' : ''}`}>\n                          {c}\n                        </th>\n                      ))}\n                    </tr>\n                  </thead>\n                  <tbody>\n                    {table.rows.map((r, i) => (\n                      <tr key={i} className=\"shadow-[inset_0_1px_0_var(--line)]\">\n                        {r.map((c, k) => (\n                          <td key={k} className={`py-1.5 ${k ? 'text-right font-mono text-[12px] tabular-nums text-ink' : 'text-ink-2'}`}>\n                            {c}\n                          </td>\n                        ))}\n                      </tr>\n                    ))}\n                  </tbody>\n                </table>\n              )}\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </section>\n  )\n}\n"},{"path":"components/detent/icons/index.tsx","target":"components/detent/icons/index.tsx","type":"registry:component","content":"import type { SVGProps } from 'react'\n\ntype P = SVGProps<SVGSVGElement> & { size?: number }\n\nfunction Svg({ size = 20, children, ...rest }: P) {\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden {...rest}>\n      {children}\n    </svg>\n  )\n}\n\nexport const Close = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M7 7l10 10M17 7 7 17\" />\n  </Svg>\n)\n\nexport const Check = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 12.5l4.5 4.5L19 7.5\" />\n  </Svg>\n)\n\nexport const Plus = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 5v14M5 12h14\" />\n  </Svg>\n)\n\nexport const Bin = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"4\" y=\"4.5\" width=\"16\" height=\"3.6\" rx=\"1.8\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M9.5 4.5V3.8a1.3 1.3 0 0 1 1.3-1.3h2.4a1.3 1.3 0 0 1 1.3 1.3v.7\" />\n    <path d=\"M6 10.5l.8 8.4A2.2 2.2 0 0 0 9 21h6a2.2 2.2 0 0 0 2.2-2.1l.8-8.4\" />\n    <path d=\"M10.3 13v4.5M13.7 13v4.5\" />\n  </Svg>\n)\n\nexport const Undo = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M9 9h6.5a4.5 4.5 0 0 1 0 9H10\" />\n    <path d=\"M9.6 4.6 4.6 9l5 4.4z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Pause = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n    <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Upload = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4 14.5v2.3A3.2 3.2 0 0 0 7.2 20h9.6a3.2 3.2 0 0 0 3.2-3.2v-2.3\" />\n    <path d=\"M12 15V7\" />\n    <path d=\"M12 3.2 7.6 8.2h8.8z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const FilePage = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M13.5 3H8a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V8.5\" />\n    <path d=\"M13.5 3v3.5a2 2 0 0 0 2 2H19z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Picture = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"4\" />\n    <path d=\"M3.8 16.5 9 11.6a1.5 1.5 0 0 1 2.1 0l3.2 3 1.6-1.5a1.5 1.5 0 0 1 2.1 0l2.2 2.1V16a3.5 3.5 0 0 1-3.5 3.5H8A4 4 0 0 1 3.8 16.5z\" fill=\"currentColor\" stroke=\"none\" />\n    <circle cx=\"15.5\" cy=\"8.8\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Film = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"4\" />\n    <path d=\"M10.2 9.2v5.6a.7.7 0 0 0 1 .6l4.4-2.8a.7.7 0 0 0 0-1.2l-4.4-2.8a.7.7 0 0 0-1 .6z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Bubble = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 4c4.7 0 8.5 3.1 8.5 7s-3.8 7-8.5 7c-1 0-2-.1-2.9-.4L5 19.5l1.1-3.6C4.6 14.6 3.5 12.9 3.5 11c0-3.9 3.8-7 8.5-7z\" />\n    <circle cx=\"8.6\" cy=\"11\" r=\"1.15\" fill=\"currentColor\" stroke=\"none\" />\n    <circle cx=\"12\" cy=\"11\" r=\"1.15\" fill=\"currentColor\" stroke=\"none\" />\n    <circle cx=\"15.4\" cy=\"11\" r=\"1.15\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Card = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3\" y=\"5.5\" width=\"18\" height=\"13\" rx=\"3.5\" />\n    <rect x=\"3\" y=\"8.6\" width=\"18\" height=\"3\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M7 15h3\" />\n  </Svg>\n)\n\nexport const Bell = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M6 15.5V11a6 6 0 1 1 12 0v4.5l1.5 2H4.5z\" />\n    <path d=\"M9.6 19.5a2.6 2.6 0 0 0 4.8 0z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Ship = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 20h14\" />\n    <path d=\"M12 16V9\" />\n    <path d=\"M12 3.5 7 9.2h10z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Mention = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"3.4\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M15.4 12v1.4a2.6 2.6 0 0 0 5.1.7A8.5 8.5 0 1 0 16 19.5\" />\n  </Svg>\n)\n\nexport const Calendar = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"5\" width=\"17\" height=\"15.5\" rx=\"4\" />\n    <path d=\"M3.5 9A4 4 0 0 1 7.5 5h9a4 4 0 0 1 4 4v1H3.5z\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M8 3v3M16 3v3\" />\n  </Svg>\n)\n\nexport const ChevronDown = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M6.5 9.5 12 15l5.5-5.5\" />\n  </Svg>\n)\n\nexport const ArrowUpRight = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M8 16 16 8\" />\n    <path d=\"M9.5 6.8h7.7v7.7z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Sun = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"4.2\" fill=\"currentColor\" stroke=\"none\" />\n    {[0, 45, 90, 135, 180, 225, 270, 315].map((a) => {\n      const r = (a * Math.PI) / 180\n      return <circle key={a} cx={12 + Math.cos(r) * 8.4} cy={12 + Math.sin(r) * 8.4} r=\"1.1\" fill=\"currentColor\" stroke=\"none\" />\n    })}\n  </Svg>\n)\n\nexport const Moon = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M19.5 14.6A8 8 0 0 1 9.4 4.5a8 8 0 1 0 10.1 10.1z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Expand = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M14 4h6v6M10 20H4v-6\" />\n    <path d=\"M20 4l-6 6M4 20l6-6\" />\n  </Svg>\n)\n\nexport const Inspect = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4 9V6.5A2.5 2.5 0 0 1 6.5 4H9M15 4h2.5A2.5 2.5 0 0 1 20 6.5V9M4 15v2.5A2.5 2.5 0 0 0 6.5 20H9\" />\n    <path d=\"M13.2 13.2l7.3 2.5-3.1 1.3-1.3 3.1z\" fill=\"currentColor\" strokeWidth={1.5} />\n  </Svg>\n)\n\nexport const Folder = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M3.5 9.5V17a3 3 0 0 0 3 3h11a3 3 0 0 0 3-3v-6.5a3 3 0 0 0-3-3h-6\" />\n    <path d=\"M3.5 7A2.5 2.5 0 0 1 6 4.5h3.2a2 2 0 0 1 1.6.8l1.5 2.2H3.5z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Copy = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"4\" y=\"4\" width=\"11\" height=\"11\" rx=\"3\" fill=\"currentColor\" stroke=\"none\" />\n    <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"3\" fill=\"var(--icon-cutout, white)\" />\n  </Svg>\n)\n\nexport const Cookie = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M20.6 12.6a8.6 8.6 0 1 1-9.2-9.2 3 3 0 0 0 3.6 3.6 3 3 0 0 0 5.6 5.6z\" />\n    <circle cx=\"9.2\" cy=\"10.4\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n    <circle cx=\"14.5\" cy=\"15.3\" r=\"1.1\" fill=\"currentColor\" stroke=\"none\" />\n    <circle cx=\"8.8\" cy=\"15.6\" r=\"0.9\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Clock = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"8.5\" />\n    <path d=\"M12 7.2v5.2l3.4 2.1\" strokeWidth={2.4} />\n  </Svg>\n)\n\nexport const ArrowLeft = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M19 12H7\" />\n    <path d=\"M10.5 6.5 4.5 12l6 5.5z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Mail = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"13\" rx=\"3.5\" />\n    <path d=\"M4.4 7.6A3.5 3.5 0 0 1 7 5.5h10a3.5 3.5 0 0 1 2.6 2.1L12 13z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const ArrowUp = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 20v-9\" />\n    <path d=\"M12 3.8 6.6 10.2h10.8z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Stop = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"6.5\" y=\"6.5\" width=\"11\" height=\"11\" rx=\"3\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Bolt = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M13.2 3.2 5.8 13h5.6l-.6 7.8 7.4-9.8h-5.6z\" fill=\"currentColor\" strokeWidth={1.6} />\n  </Svg>\n)\n\nexport const Orbit = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M18.06 8.5A7 7 0 1 1 15.5 5.94\" />\n    <circle cx=\"16.95\" cy=\"7.05\" r=\"2.1\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Search = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"10.5\" cy=\"10.5\" r=\"6.2\" />\n    <path d=\"M14.9 17.1a1.55 1.55 0 0 1 2.2-2.2l3 3a1.55 1.55 0 0 1-2.2 2.2z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Minus = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 12h14\" />\n  </Svg>\n)\n\nexport const Chevrons = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M8 9.5 12 5.5l4 4M8 14.5l4 4 4-4\" />\n  </Svg>\n)\n\nexport const Pencil = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M14.5 5.5 18.5 9.5 9 19H5v-4z\" />\n    <path d=\"M16.2 3.8a2 2 0 0 1 2.8 0l1.2 1.2a2 2 0 0 1 0 2.8l-1.4 1.4-4-4z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const ArrowRight = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 12h12\" />\n    <path d=\"M13.5 6.5 19.5 12l-6 5.5z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Cup = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 8h11v6a5 5 0 0 1-5 5h-1a5 5 0 0 1-5-5z\" />\n    <path d=\"M16 10h1.5a2.5 2.5 0 0 1 0 5H16\" />\n    <path d=\"M5 8h11v3H5z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Bag = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5.5 8h13l-1 11.2a2 2 0 0 1-2 1.8h-7a2 2 0 0 1-2-1.8z\" />\n    <path d=\"M9 11V7a3 3 0 0 1 6 0v4\" />\n    <path d=\"M5.6 8h12.8l-.25 3H5.85z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Note = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"3\" />\n    <circle cx=\"12\" cy=\"12\" r=\"2.6\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Plane = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M20.5 3.5 3.5 10.6l6.3 2.9 2.9 6.3z\" />\n    <path d=\"M20.5 3.5 9.8 13.5l2.9 6.3z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Building = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 21V6a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v15M16 10h2a2 2 0 0 1 2 2v9M3 21h18\" />\n    <rect x=\"8.5\" y=\"15.5\" width=\"4\" height=\"5.5\" rx=\"1\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const FolderOpen = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M3.5 16.5V7A2.5 2.5 0 0 1 6 4.5h3.2a2 2 0 0 1 1.6.8l1.5 2.2H17a2.5 2.5 0 0 1 2.5 2.5v1\" />\n    <path d=\"M3.5 7A2.5 2.5 0 0 1 6 4.5h3.2a2 2 0 0 1 1.6.8l1.5 2.2H3.5z\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M5.6 11.5h15a1 1 0 0 1 .96 1.27l-1.55 5.6A2.2 2.2 0 0 1 17.9 20H6.1a2.6 2.6 0 0 1-2.6-2.6v-3.8a2.1 2.1 0 0 1 2.1-2.1z\" />\n  </Svg>\n)\n\nexport const Code = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M8 7.5 3.5 12 8 16.5M16 7.5l4.5 4.5-4.5 4.5\" />\n    <path d=\"M13.2 4.6a1 1 0 0 1 1.9.6l-4.3 14.2a1 1 0 0 1-1.9-.6z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Wrench = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M15.4 3.6a4.6 4.6 0 0 0-4.3 6.1l-6.6 6.6a2.2 2.2 0 1 0 3.1 3.1l6.6-6.6a4.6 4.6 0 0 0 6.1-4.3l-2.9 2.9-2.6-.6-.6-2.6z\" />\n    <circle cx=\"6\" cy=\"17.9\" r=\"1.1\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Prompt = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 7.5 9.5 12 5 16.5\" />\n    <rect x=\"11.5\" y=\"15\" width=\"8\" height=\"2.4\" rx=\"1.2\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Node = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"8\" />\n    <circle cx=\"12\" cy=\"12\" r=\"3.2\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Refresh = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M19.2 13.2A7.4 7.4 0 1 1 16.8 6\" />\n    <path d=\"M19.6 3.4v6.2h-6.2z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Thumb = ({ down, ...p }: P & { down?: boolean }) => (\n  <Svg {...p} style={{ transform: down ? 'scale(1, -1)' : undefined, ...p.style }}>\n    <path d=\"M8 10.5 11.5 4a1.7 1.7 0 0 1 3.1 1.2l-.7 4h5a2 2 0 0 1 2 2.4l-1.2 6.3A2 2 0 0 1 17.7 19.5H8\" />\n    <rect x=\"3\" y=\"10.5\" width=\"5\" height=\"9\" rx=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Chart = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M3.5 17.5 8.5 12l3.5 3.5 5-6\" />\n    <circle cx=\"19.2\" cy=\"7\" r=\"2.6\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M3.5 20.5h17\" />\n  </Svg>\n)\n\nexport const Table = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"3.5\" />\n    <path d=\"M3.5 8a3.5 3.5 0 0 1 3.5-3.5h10A3.5 3.5 0 0 1 20.5 8v1.5h-17z\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M10 9.5v10M3.5 14.5h17\" />\n  </Svg>\n)\n\nexport const Play = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M8 5.8v12.4l9.6-6.2z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Grip = (p: P) => (\n  <Svg {...p} strokeWidth={3.2}>\n    <path d=\"M9 6.5h.01M15 6.5h.01M9 12h.01M15 12h.01M9 17.5h.01M15 17.5h.01\" />\n  </Svg>\n)\n\nexport const Mic = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"9\" y=\"3\" width=\"6\" height=\"11.5\" rx=\"3\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M5.5 11.5a6.5 6.5 0 0 0 13 0M12 18v3\" />\n  </Svg>\n)\n\nexport const Speaker = ({ muted, ...p }: P & { muted?: boolean }) => (\n  <Svg {...p}>\n    <path d=\"M4 9.5h3.2L12 5.5v13l-4.8-4H4z\" fill=\"currentColor\" />\n    {muted ? <path d=\"M16 9.5l4.5 5M20.5 9.5l-4.5 5\" /> : <path d=\"M15.5 9a4.2 4.2 0 0 1 0 6M18.2 6.5a8 8 0 0 1 0 11\" />}\n  </Svg>\n)\n\nexport const ChevronRight = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M10 6.5l5.5 5.5-5.5 5.5\" />\n  </Svg>\n)\n\nexport const Layers = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M8 4.5h9.5A2.5 2.5 0 0 1 20 7v9.5\" />\n    <rect x=\"4\" y=\"8\" width=\"12\" height=\"12\" rx=\"2.5\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Link = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M10.5 13.5a3.5 3.5 0 0 0 5 0l3-3a3.5 3.5 0 0 0-5-5l-.8.8\" />\n    <path d=\"M13.5 10.5a3.5 3.5 0 0 0-5 0l-3 3a3.5 3.5 0 0 0 5 5l.8-.8\" />\n    <circle cx=\"12\" cy=\"12\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const More = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"6\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n    <circle cx=\"12\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n    <circle cx=\"18\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Eye = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z\" />\n    <circle cx=\"12\" cy=\"12\" r=\"3\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const EyeOff = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M6.6 7.2C4 8.9 2.5 12 2.5 12S6 18.5 12 18.5c1.9 0 3.5-.6 4.9-1.5M10 5.7c.6-.1 1.3-.2 2-.2 6 0 9.5 6.5 9.5 6.5s-.8 1.5-2.3 3.1\" />\n    <path d=\"M4 4l16 16\" strokeWidth={2.4} />\n  </Svg>\n)\n\nexport const Alert = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"9\" />\n    <path d=\"M12 7.5v5.5\" />\n    <circle cx=\"12\" cy=\"16.4\" r=\"1.25\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Spark = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"9\" />\n    <path d=\"M12.8 6.5 8.6 12.6h3.1l-.6 4.9 4.3-6.2h-3.1z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Cube = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 3.2 19.6 7.4v9.2L12 20.8l-7.6-4.2V7.4z\" />\n    <path d=\"M12 3.2 19.6 7.4 12 11.6 4.4 7.4z\" fill=\"currentColor\" stroke=\"none\" />\n    <path d=\"M12 11.6v9.2\" />\n  </Svg>\n)\n\nexport const Plug = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M6.5 9.5h11v2.5a5.5 5.5 0 0 1-11 0z\" />\n    <path d=\"M12 17.5V21\" />\n    <rect x=\"8.2\" y=\"3\" width=\"2.2\" height=\"6\" rx=\"1.1\" fill=\"currentColor\" stroke=\"none\" />\n    <rect x=\"13.6\" y=\"3\" width=\"2.2\" height=\"6\" rx=\"1.1\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Fork = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4 12h6\" />\n    <path d=\"M10 12c3 0 4-5.5 8.5-5.5M10 12c3 0 4 5.5 8.5 5.5\" />\n    <path d=\"M16.5 4.5l2.2 2-2.2 2M16.5 15.5l2.2 2-2.2 2\" />\n    <circle cx=\"10\" cy=\"12\" r=\"2.2\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Shield = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 3 19 5.8v5.4c0 4.4-3 7.9-7 9.8-4-1.9-7-5.4-7-9.8V5.8z\" />\n    <path d=\"m8.6 11.8 2.4 2.4 4.6-4.8\" strokeWidth={2.4} />\n  </Svg>\n)\n\nexport const Send = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M20.5 3.5 3.5 10.3l6.6 2.9 2.9 6.6z\" />\n    <path d=\"M20.5 3.5 10.1 13.2l2.9 6.6z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Redo = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M15 9H8.5a4.5 4.5 0 0 0 0 9H14\" />\n    <path d=\"M14.4 4.6 19.4 9l-5 4.4z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const Captions = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"13\" rx=\"3.5\" />\n    <path d=\"M7.6 11.2h4.2a1.2 1.2 0 0 1 0 2.4H7.6a1.2 1.2 0 0 1 0-2.4zM7.6 14.6h8.8a1.2 1.2 0 0 1 0 2.4H7.6a1.2 1.2 0 0 1 0-2.4z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Sliders = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4 8h16M4 16h16\" />\n    <path d=\"M9 5.2a2.8 2.8 0 1 1 0 5.6 2.8 2.8 0 0 1 0-5.6zM15 13.2a2.8 2.8 0 1 1 0 5.6 2.8 2.8 0 0 1 0-5.6z\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Pip = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"13\" rx=\"3.5\" />\n    <rect x=\"11.5\" y=\"11\" width=\"6.5\" height=\"5\" rx=\"1.4\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Shrink = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M10 4v6H4M14 20v-6h6\" />\n    <path d=\"M4 4l6 6M20 20l-6-6\" />\n  </Svg>\n)\n\nexport const RotateLeft = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"9\" y=\"9.5\" width=\"11\" height=\"10.5\" rx=\"2.4\" />\n    <path d=\"M12.5 5.5H9a5 5 0 0 0-5 5v2\" />\n    <path d=\"M12.2 2.6 15.6 5.5l-3.4 2.9z\" fill=\"currentColor\" />\n  </Svg>\n)\n\nexport const FlipH = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 3.5v17\" strokeDasharray=\"2 2.6\" />\n    <path d=\"M9 7.5 3.5 17H9z\" />\n    <path d=\"M15 7.5 20.5 17H15z\" fill=\"currentColor\" />\n  </Svg>\n)\n"},{"path":"components/detent/lib/motion.ts","target":"components/detent/lib/motion.ts","type":"registry:component","content":"export const ease = {\n  out: [0.2, 0.9, 0.25, 1] as const,\n  inOut: [0.6, 0, 0.3, 1] as const,\n}\n\nexport const dur = {\n  exit: 0.12,\n  hover: 0.15,\n  enter: 0.2,\n  swap: 0.24,\n  panel: 0.34,\n}\n\nexport const spring = {\n  snappy: { type: 'spring', stiffness: 560, damping: 42, mass: 0.6 } as const,\n  smooth: { type: 'spring', bounce: 0, duration: 0.36 } as const,\n  soft: { type: 'spring', bounce: 0.12, duration: 0.5 } as const,\n  release: { type: 'spring', stiffness: 320, damping: 32 } as const,\n  move: { type: 'spring', stiffness: 420, damping: 38 } as const,\n  data: { type: 'spring', stiffness: 170, damping: 26 } as const,\n  pop: { type: 'spring', bounce: 0.3, duration: 0.4 } as const,\n}\n\nexport const appear = {\n  initial: { opacity: 0, scale: 0.96 },\n  animate: { opacity: 1, scale: 1, transition: { duration: dur.swap, ease: ease.out } },\n  exit: { opacity: 0, scale: 0.97, transition: { duration: dur.exit, ease: ease.out } },\n}\n\nexport const slide = {\n  enter: (dir: number) => ({ x: dir * 24, opacity: 0 }),\n  center: { x: 0, opacity: 1 },\n  exit: (dir: number) => ({ x: dir * -24, opacity: 0 }),\n}\n\nexport const press = { scale: 0.97 }\n\nexport const staggerFor = (count: number) => Math.min(0.04, 0.2 / Math.max(1, count))\n"}]}