{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"chart","title":"Baseline chart","description":"A metric against any day you choose. Click the line and that day becomes the level: above it prints blue, below it red, and the sentence reads again from there.","type":"registry:component","author":"Detent","dependencies":["motion"],"registryDependencies":["https://detentui.com/r/theme.json"],"files":[{"path":"components/detent/components/baseline/BaselineChart.tsx","target":"components/detent/components/baseline/BaselineChart.tsx","type":"registry:component","content":"'use client'\n\nimport { useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport type { KeyboardEvent, Ref } from 'react'\nimport { smooth } from '@/components/detent/components/charts/parts'\nimport { at as lerpAt, clamp, dragProps, useDetent } from '@/components/detent/lib/detent'\nimport { useSize } from '@/components/detent/lib/hooks'\nimport { INK, InkDefs } from '@/components/detent/ui/ink'\n\nexport type Reading = { label: string; value: number }\nexport type BaselineHandle = {\n  start(i: number): void\n  read(i: number | null): void\n}\n\nconst H = 280\nconst T = 16\nconst B = 28\nconst AXIS = 'fill-[var(--ink-3)] font-mono text-[10px] uppercase tracking-[0.06em]'\nconst INKS = '[--bl-up:#2f5fe0] [--bl-down:#d24a4a] [--bl-word-up:#2f5fe0] [--bl-word-down:#c43c3c] dark:[--bl-up:#7c9bf5] dark:[--bl-down:#ef8a8a] dark:[--bl-word-up:#7c9bf5] dark:[--bl-word-down:#ef8a8a]'\nconst GLIDE = { w: 13, z: 1 }\nconst FOLLOW = { w: 22, z: 1 }\n\nexport function BaselineChart({ data, start = 0, format = (n) => n.toLocaleString('en-US'), label = 'Metric', look = 'ink', onStart, ref }: {\n  data: Reading[]\n  start?: number\n  format?: (n: number) => string\n  label?: string\n  look?: 'ink' | 'plain'\n  onStart?: (i: number) => void\n  ref?: Ref<BaselineHandle>\n}) {\n  const id = useId().replace(/:/g, '')\n  const box = useRef<HTMLDivElement>(null)\n  const { w } = useSize(box)\n  const last = data.length - 1\n  const [from, setFrom] = useState(Math.min(start, last))\n  const [at, setAt] = useState<number | null>(null)\n  const stops = useRef<number[]>([])\n  if (stops.current.length !== last + 1) stops.current = data.map((_, i) => i)\n  const byHand = useRef(false)\n  const shapeEl = useRef<(SVGPathElement | null)[]>([])\n  const clips = useRef<(SVGRectElement | null)[]>([])\n  const levelLine = useRef<SVGLineElement>(null)\n  const post = useRef<SVGLineElement>(null)\n  const seatDot = useRef<SVGCircleElement>(null)\n  const readDot = useRef<SVGCircleElement>(null)\n  const paintSeat = () => {\n    const sx = X(seatI.get())\n    const lv = Y(seatV.get())\n    const d = `${line} L${w},${lv.toFixed(2)} L0,${lv.toFixed(2)} Z`\n    shapeEl.current.forEach((el) => el?.setAttribute('d', d))\n    clips.current.forEach((el, i) => {\n      if (!el) return\n      el.setAttribute('x', sx.toFixed(2))\n      if (i === 0) el.setAttribute('height', (lv + T).toFixed(2))\n      if (i === 1) el.setAttribute('y', lv.toFixed(2))\n    })\n    if (levelLine.current) {\n      levelLine.current.setAttribute('x1', sx.toFixed(2))\n      levelLine.current.setAttribute('y1', lv.toFixed(2))\n      levelLine.current.setAttribute('y2', lv.toFixed(2))\n    }\n    if (post.current) {\n      post.current.setAttribute('x1', sx.toFixed(2))\n      post.current.setAttribute('x2', sx.toFixed(2))\n      post.current.setAttribute('y1', lv.toFixed(2))\n    }\n    seatDot.current?.setAttribute('cx', sx.toFixed(2))\n    seatDot.current?.setAttribute('cy', lv.toFixed(2))\n  }\n  const seatI = useDetent({ value: from, muted: true, spring: GLIDE, onFrame: () => paintSeat() })\n  const seatV = useDetent({ value: data[from].value, muted: true, spring: GLIDE, onFrame: () => paintSeat() })\n  const paintRead = (x: number) => {\n    const el = readDot.current\n    if (!el) return\n    const u = clamp(x, 0, last)\n    el.setAttribute('cx', X(u).toFixed(2))\n    el.setAttribute('cy', Y(lerpAt(values, u)).toFixed(2))\n  }\n  const reading = useDetent({\n    value: last,\n    stops: stops.current,\n    magnet: 0.3,\n    reach: 0.8,\n    spring: FOLLOW,\n    muted: true,\n    onFrame: (x) => paintRead(x),\n    onStop: (i) => {\n      if (byHand.current) setAt(i)\n    },\n  })\n  const hiding = () => readDot.current?.style.visibility === 'hidden'\n  const point = (i: number | null, instant = false) => {\n    byHand.current = false\n    setAt(i)\n    if (i === null) return\n    if (hiding()) reading.set(i)\n    else reading.to(i, { spring: FOLLOW, instant })\n  }\n\n  useEffect(() => {\n    seatI.to(from, { spring: GLIDE })\n    seatV.to(data[from].value, { spring: GLIDE })\n  }, [from, data, seatI, seatV])\n\n  useImperativeHandle(ref, () => ({ start: (i) => setFrom(Math.max(0, Math.min(last, i))), read: point }), [last])\n\n  const choose = (i: number) => {\n    setFrom(i)\n    onStart?.(i)\n  }\n  const values = data.map((d) => d.value)\n  const top = Math.max(...values)\n  const low = Math.min(...values)\n  const pad = (top - low) * 0.12 || 1\n  const X = (i: number) => (i / (last || 1)) * w\n  const Y = (v: number) => T + (1 - (v - (low - pad)) / (top - low + pad * 2)) * (H - T - B)\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  const line = useMemo(() => (w ? smooth(data.map((_, i) => X(i)), values.map(Y)) : ''), [w, data])\n  const seatX = X(seatI.get())\n  const level = Y(seatV.get())\n  const shape = `${line} L${w},${level} L0,${level} Z`\n  const end = at !== null && at !== from ? at : last\n  const gain = data[end].value - data[from].value\n  const pct = Math.abs((gain / (data[from].value || 1)) * 100).toFixed(1)\n  const word = gain > 0 ? `up ${format(gain)}` : gain < 0 ? `down ${format(-gain)}` : 'flat'\n  const back = end < from\n  const than = gain < 0 ? `${format(-gain)} lower` : `${format(gain)} higher`\n  const said = back ? `${data[end].label} was ${than} than ${data[from].label}` : `Since ${data[from].label}, ${word} by ${data[end].label}`\n  const filter = (name: string) => (look === 'ink' ? `url(#${id}${name})` : undefined)\n  const room = Math.max(1, Math.ceil((last + 1) / (w / 92 || 1)))\n  const every = Math.ceil(room / 7) * 7\n  const latest = useRef({ last, choose, point })\n  useLayoutEffect(() => {\n    latest.current = { last, choose, point }\n  })\n  const toIndex = (f: number) => clamp(f, 0, 1) * latest.current.last\n  const [hand] = useState(() =>\n    dragProps(reading, () => ({\n      box: () => box.current,\n      units: latest.current.last,\n      absolute: (f) => {\n        const u = toIndex(f)\n        if (hiding()) reading.set(u)\n        return u\n      },\n      hover: true,\n      follow: true,\n      muted: true,\n      onGrab: () => (byHand.current = true),\n      onTap: (f) => {\n        const i = Math.round(toIndex(f))\n        latest.current.point(i)\n        latest.current.choose(i)\n      },\n      onLeave: () => latest.current.point(null),\n      release: () => ({ flick: false }),\n    })),\n  )\n  useLayoutEffect(() => {\n    paintSeat()\n    paintRead(reading.get())\n  })\n  const onKey = (e: KeyboardEvent) => {\n    const here = at ?? last\n    if (e.key === 'ArrowLeft') point(Math.max(0, here - 1), e.repeat)\n    else if (e.key === 'ArrowRight') point(Math.min(last, here + 1), e.repeat)\n    else if (e.key === 'Home') point(0)\n    else if (e.key === 'End') point(last)\n    else if (e.key === 'Escape') point(null)\n    else if (e.key === 'Enter' || e.key === ' ') choose(here)\n    else return\n    e.preventDefault()\n  }\n  return (\n    <div className={`@container ${INKS}`}>\n      <p aria-live=\"polite\" className=\"min-h-[2lh] text-[clamp(22px,4.6cqi,30px)] leading-[1.24] tracking-[-0.03em] text-ink @[560px]:min-h-0\">\n        <span key={`${back}|${data[from].label}|${data[end].label}|${pct}|${back ? than : word}`}>\n          {back ? `${data[end].label} was ` : `Since ${data[from].label}, `}\n          <span className={gain >= 0 ? 'text-[var(--bl-word-up)]' : 'text-[var(--bl-word-down)]'}>{back ? than : word}</span>\n          <span className=\"text-ink-3\">{back ? ` than ${data[from].label}` : ` by ${data[end].label}`}, or {pct}%.</span>\n        </span>\n      </p>\n      <div\n        ref={box}\n        role=\"slider\"\n        tabIndex={0}\n        aria-label={label}\n        aria-valuemin={0}\n        aria-valuemax={last}\n        aria-valuenow={end}\n        aria-valuetext={said}\n        className=\"ring-focus relative mt-6 cursor-crosshair touch-pan-y select-none rounded-[6px]\"\n        {...hand}\n        onKeyDown={onKey}\n      >\n        <svg width=\"100%\" height={H} className=\"block overflow-visible\" aria-hidden>\n          {w > 0 && (\n            <>\n              <defs>\n                <InkDefs id={id} />\n                <clipPath id={`${id}up`}>\n                  <rect ref={(el) => void (clips.current[0] = el)} x={seatX} y={-T} width={w} height={level + T} />\n                </clipPath>\n                <clipPath id={`${id}down`}>\n                  <rect ref={(el) => void (clips.current[1] = el)} x={seatX} y={level} width={w} height={H} />\n                </clipPath>\n                <clipPath id={`${id}since`}>\n                  <rect ref={(el) => void (clips.current[2] = el)} x={seatX} y={-T} width={w} height={H + T * 2} />\n                </clipPath>\n              </defs>\n              <g clipPath={`url(#${id}up)`}>\n                <path ref={(el) => void (shapeEl.current[0] = el)} d={shape} fill=\"var(--bl-up)\" opacity={look === 'ink' ? 0.6 : 0.16} filter={filter('grain')} className={INK} />\n              </g>\n              <g clipPath={`url(#${id}down)`}>\n                <path ref={(el) => void (shapeEl.current[1] = el)} d={shape} fill=\"var(--bl-down)\" opacity={look === 'ink' ? 0.6 : 0.16} filter={filter('grainB')} className={INK} />\n              </g>\n              <path d={line} fill=\"none\" stroke=\"var(--ink)\" strokeOpacity={0.2} strokeWidth={1.5} />\n              <path d={line} fill=\"none\" stroke=\"var(--ink)\" strokeWidth={1.75} clipPath={`url(#${id}since)`} />\n              <line ref={levelLine} x1={seatX} x2={w} y1={level} y2={level} stroke=\"var(--ink)\" strokeOpacity={0.45} strokeDasharray=\"2 3\" />\n              <line ref={post} x1={seatX} x2={seatX} y1={level} y2={H - B} stroke=\"var(--ink)\" strokeOpacity={0.25} />\n              <circle ref={seatDot} cx={seatX} cy={level} r={3.5} fill=\"var(--surface)\" stroke=\"var(--ink)\" strokeWidth={1.5} />\n              <circle ref={readDot} r={3.5} fill=\"var(--ink)\" style={{ visibility: at === null ? 'hidden' : undefined }} />\n              <line x1={0} x2={w} y1={H - B + 0.5} y2={H - B + 0.5} stroke=\"var(--line)\" />\n              {data.map((d, i) =>\n                i % every === 0 ? (\n                  <text key={d.label} x={X(i)} y={H - 4} textAnchor={i === 0 ? 'start' : i === last ? 'end' : 'middle'} className={AXIS}>\n                    {d.label}\n                  </text>\n                ) : null,\n              )}\n            </>\n          )}\n        </svg>\n      </div>\n    </div>\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/ui/ink.tsx","target":"components/detent/ui/ink.tsx","type":"registry:component","content":"export function InkDefs({ id }: { id: string }) {\n  return (\n    <>\n      {(\n        [\n          ['grain', 7],\n          ['grainB', 31],\n        ] as const\n      ).map(([name, seed]) => (\n        <filter key={name} id={`${id}${name}`} x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" colorInterpolationFilters=\"sRGB\">\n          <feTurbulence type=\"fractalNoise\" baseFrequency=\"0.62\" numOctaves=\"2\" seed={seed} stitchTiles=\"stitch\" result=\"noise\" />\n          <feColorMatrix in=\"noise\" type=\"matrix\" values=\"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.6 1.55\" result=\"mask\" />\n          <feComposite in=\"SourceGraphic\" in2=\"mask\" operator=\"in\" />\n        </filter>\n      ))}\n    </>\n  )\n}\n\nexport const INK = 'mix-blend-multiply dark:mix-blend-screen'\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/lib/hooks.ts","target":"components/detent/lib/hooks.ts","type":"registry:component","content":"'use client'\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react'\nimport type { RefObject } from 'react'\n\nexport function useFrame(cb: (dt: number, t: number) => void, active = true) {\n  const ref = useRef(cb)\n  useLayoutEffect(() => {\n    ref.current = cb\n  })\n  useEffect(() => {\n    if (!active) return\n    let raf = 0\n    let last = performance.now()\n    const loop = (t: number) => {\n      const dt = Math.min(48, t - last)\n      last = t\n      ref.current(dt, t)\n      raf = requestAnimationFrame(loop)\n    }\n    raf = requestAnimationFrame(loop)\n    return () => cancelAnimationFrame(raf)\n  }, [active])\n}\n\nexport function useSize(ref: RefObject<HTMLElement | null>) {\n  const [size, setSize] = useState({ w: 0, h: 0 })\n  useLayoutEffect(() => {\n    const el = ref.current\n    if (!el) return\n    const measure = () => setSize({ w: el.clientWidth, h: el.clientHeight })\n    measure()\n    const ro = new ResizeObserver(measure)\n    ro.observe(el)\n    return () => ro.disconnect()\n  }, [ref])\n  return size\n}\n\nconst stacked = new WeakMap<Element, number>()\nexport const stackTop = (el: Element) => stacked.get(el) ?? 0\nconst stacks = new WeakMap<Element, () => void>()\n\nexport function useStack(ref: RefObject<HTMLElement | null>, gap = 0, onPlace?: () => void) {\n  const follow = useRef(onPlace)\n  useLayoutEffect(() => {\n    follow.current = onPlace\n  })\n  const place = useCallback(() => {\n    const box = ref.current\n    if (!box) return\n    const cs = getComputedStyle(box)\n    if (cs.position === 'static') box.style.position = 'relative'\n    const [top, right, bottom, left] = ['top', 'right', 'bottom', 'left'].map((k) => parseFloat(cs.getPropertyValue(`padding-${k}`)))\n    const edges = top + bottom + parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth)\n    let y = 0\n    for (const el of Array.from(box.children) as HTMLElement[]) {\n      Object.assign(el.style, { position: 'absolute', top: `${top}px`, left: `${left}px`, right: `${right}px`, translate: `0 ${y}px` })\n      const s = getComputedStyle(el)\n      const mt = parseFloat(s.marginTop) || 0\n      stacked.set(el, top + y + mt)\n      y += mt + parseFloat(s.height) + (parseFloat(s.marginBottom) || 0) + gap\n    }\n    const was = box.style.height\n    box.style.height = `${Math.max(0, y - gap) + (cs.boxSizing === 'border-box' ? edges : 0)}px`\n    if (box.style.height === was) return\n    follow.current?.()\n    for (let el = box.parentElement; el; el = el.parentElement) {\n      const outer = stacks.get(el)\n      if (outer) return outer()\n    }\n  }, [ref, gap])\n  useLayoutEffect(place)\n  useLayoutEffect(() => {\n    const box = ref.current\n    if (!box) return\n    stacks.set(box, place)\n    const ro = new ResizeObserver(place)\n    const watch = () => {\n      ro.disconnect()\n      for (const el of Array.from(box.children)) ro.observe(el)\n    }\n    const mo = new MutationObserver(() => {\n      watch()\n      place()\n    })\n    watch()\n    mo.observe(box, { childList: true })\n    return () => {\n      stacks.delete(box)\n      ro.disconnect()\n      mo.disconnect()\n    }\n  }, [ref, place])\n}\n\nexport const layoutPx = (v: string) => Math.round(parseFloat(v) * 64) / 64\n\nexport function useRow(ref: RefObject<HTMLElement | null>, onPlace?: () => void) {\n  const follow = useRef(onPlace)\n  useLayoutEffect(() => {\n    follow.current = onPlace\n  })\n  const place = useCallback(() => {\n    const box = ref.current\n    if (!box) return\n    if (getComputedStyle(box).position === 'static') box.style.position = 'relative'\n    const kids = Array.from(box.children) as HTMLElement[]\n    for (const el of kids) Object.assign(el.style, { position: 'absolute', left: '0px', whiteSpace: 'nowrap' })\n    const sizes = kids.map((el) => {\n      const cs = getComputedStyle(el)\n      return { w: layoutPx(cs.width), h: layoutPx(cs.height), before: layoutPx(cs.marginLeft), after: layoutPx(cs.marginRight) }\n    })\n    const tall = Math.max(0, ...sizes.map((s) => s.h))\n    let x = 0\n    kids.forEach((el, i) => {\n      el.style.translate = `${x}px`\n      x += sizes[i].before + sizes[i].w + sizes[i].after\n    })\n    box.style.height = `${tall}px`\n    const was = box.style.width\n    box.style.width = `${x}px`\n    if (box.style.width !== was) follow.current?.()\n  }, [ref])\n  useLayoutEffect(place)\n  useLayoutEffect(() => {\n    const box = ref.current\n    if (!box) return\n    const ro = new ResizeObserver(place)\n    const watch = () => {\n      ro.disconnect()\n      for (const el of Array.from(box.children)) ro.observe(el)\n    }\n    const mo = new MutationObserver(() => {\n      watch()\n      place()\n    })\n    watch()\n    mo.observe(box, { childList: true })\n    return () => {\n      ro.disconnect()\n      mo.disconnect()\n    }\n  }, [ref, place])\n}\n\nconst readTheme = () => (document.documentElement.dataset.theme === 'dark' ? 'dark' : 'light')\nconst watchTheme = (on: () => void) => {\n  const mo = new MutationObserver(on)\n  mo.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] })\n  return () => mo.disconnect()\n}\nexport function useTheme() {\n  return useSyncExternalStore<'light' | 'dark'>(watchTheme, readTheme, () => 'light')\n}\n\nexport function fitCanvas(canvas: HTMLCanvasElement, w: number, h: number) {\n  const dpr = Math.min(2, window.devicePixelRatio || 1)\n  canvas.width = Math.round(w * dpr)\n  canvas.height = Math.round(h * dpr)\n  const ctx = canvas.getContext('2d')!\n  ctx.setTransform(dpr, 0, 0, dpr, 0, 0)\n  return ctx\n}\n\nexport const mod = (n: number, m: number) => ((n % m) + m) % m\nexport const clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v))\nexport const smoothstep = (a: number, b: number, x: number) => {\n  const t = clamp((x - a) / (b - a), 0, 1)\n  return t * t * (3 - 2 * t)\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"}]}