{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"voicenote","title":"Voice note","description":"A voice reply with a waveform of dots that inks in as it plays, a speed that steps to 2×, and a transcript that follows the voice word by word.","type":"registry:component","author":"Detent","dependencies":["motion"],"registryDependencies":["https://detentui.com/r/theme.json"],"files":[{"path":"components/detent/components/voicenote/VoiceNote.tsx","target":"components/detent/components/voicenote/VoiceNote.tsx","type":"registry:component","content":"'use client'\n\nimport { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\nimport type { PointerEvent, Ref } from 'react'\nimport { AnimatePresence, motion } from 'motion/react'\nimport { ChevronDown, Pause, Play } from '@/components/detent/icons'\nimport { tap } from '@/components/detent/lib/feel'\nimport { ease, press, spring } from '@/components/detent/lib/motion'\nimport { RollingText } from '@/components/detent/ui/RollingText'\n\nexport type SpokenWord = { word: string; at: number }\nexport type VoiceNoteHandle = { play(): void; pause(): void; seek(seconds: number): void; speed(rate: number): void; transcript(open: boolean): void }\n\nconst COLS = 38\nconst ROWS = 7\nconst RATES = [1, 1.5, 2]\nconst time = (s: number) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, '0')}`\n\nexport function VoiceNote({\n  words,\n  duration,\n  src,\n  peaks: given,\n  defaultTranscript = true,\n  ref,\n}: {\n  words: SpokenWord[]\n  duration: number\n  src?: string\n  peaks?: number[]\n  defaultTranscript?: boolean\n  ref?: Ref<VoiceNoteHandle>\n}) {\n  const [t, setT] = useState(0)\n  const head = useRef(0)\n  const [playing, setPlaying] = useState(false)\n  const [rate, setRate] = useState(1)\n  const [reading, setReading] = useState(defaultTranscript)\n  const audio = useRef<HTMLAudioElement | null>(null)\n  const wave = useRef<HTMLDivElement>(null)\n  const scrubbing = useRef(false)\n\n  const peaks = useMemo(() => {\n    if (given) return Array.from({ length: COLS }, (_, c) => given[Math.floor((c / COLS) * given.length)] ?? 0)\n    return Array.from({ length: COLS }, (_, c) => {\n      const at = ((c + 0.5) / COLS) * duration\n      const w = words.findLast((x) => x.at <= at)\n      const next = words.find((x) => x.at > at)\n      const gap = next && w ? next.at - w.at : 1\n      const into = w ? at - w.at : 9\n      const voiced = into < Math.min(0.42, gap * 0.85)\n      return voiced ? 0.2 + 0.8 * Math.abs(Math.sin(c * 2.3 + w!.word.length) * Math.cos(c * 0.7)) : 0.04\n    })\n  }, [given, duration, words])\n\n  useEffect(() => {\n    if (!src) return\n    const a = new Audio(src)\n    audio.current = a\n    a.onended = () => setPlaying(false)\n    return () => {\n      a.pause()\n      audio.current = null\n    }\n  }, [src])\n\n  useEffect(() => {\n    if (!playing) return\n    let raf = 0\n    let last = performance.now()\n    const frame = (now: number) => {\n      const dt = (now - last) / 1000\n      last = now\n      if (!scrubbing.current) {\n        const next = Math.min(duration, audio.current ? audio.current.currentTime : head.current + dt * rate)\n        head.current = next\n        setT(next)\n        if (next >= duration) setPlaying(false)\n      }\n      raf = requestAnimationFrame(frame)\n    }\n    raf = requestAnimationFrame(frame)\n    return () => cancelAnimationFrame(raf)\n  }, [playing, rate, duration])\n\n  useEffect(() => {\n    if (audio.current) audio.current.playbackRate = rate\n  }, [rate])\n\n  const play = () => {\n    const from = t >= duration ? 0 : t\n    head.current = from\n    setT(from)\n    if (audio.current) {\n      audio.current.currentTime = from\n      audio.current.play().catch(() => {})\n    }\n    setPlaying(true)\n  }\n  const pause = () => {\n    audio.current?.pause()\n    setPlaying(false)\n  }\n  const seek = (s: number) => {\n    const to = Math.max(0, Math.min(duration, s))\n    if (audio.current) audio.current.currentTime = to\n    head.current = to\n    setT(to)\n  }\n  const cycle = () => setRate((r) => RATES[(RATES.indexOf(r) + 1) % RATES.length])\n\n  useImperativeHandle(ref, () => ({ play, pause, seek, speed: setRate, transcript: setReading }))\n\n  const scrubTo = (e: PointerEvent) => {\n    const r = wave.current!.getBoundingClientRect()\n    seek(((e.clientX - r.left) / r.width) * duration)\n  }\n\n  const played = t / duration\n  const spoken = words.findLastIndex((w) => w.at <= t + 0.05)\n  return (\n    <div className=\"w-[384px] max-w-full rounded-[22px] bg-surface p-3 shadow-raised\">\n      <div className=\"flex items-center gap-3\">\n        <motion.button\n          type=\"button\"\n          aria-label={playing ? 'Pause' : 'Play'}\n          whileTap={press}\n          onPointerDown={tap}\n          onClick={playing ? pause : play}\n          className=\"ring-focus flex size-10 shrink-0 items-center justify-center rounded-full bg-ink text-surface\"\n        >\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            <motion.span key={playing ? 'pause' : 'play'} className=\"flex\" initial={{ opacity: 0, scale: 0.6 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.6 }} transition={spring.snappy}>\n              {playing ? <Pause size={15} /> : <Play size={15} className=\"translate-x-px\" />}\n            </motion.span>\n          </AnimatePresence>\n        </motion.button>\n\n        <div\n          ref={wave}\n          role=\"slider\"\n          tabIndex={0}\n          aria-label=\"Position\"\n          aria-valuemin={0}\n          aria-valuemax={Math.round(duration)}\n          aria-valuenow={Math.round(t)}\n          aria-valuetext={`${time(t)} of ${time(duration)}`}\n          onKeyDown={(e) => {\n            if (e.key === 'ArrowRight') seek(t + 2)\n            else if (e.key === 'ArrowLeft') seek(t - 2)\n            else return\n            e.preventDefault()\n          }}\n          onPointerDown={(e) => {\n            ;(e.currentTarget as HTMLElement).setPointerCapture(e.pointerId)\n            scrubbing.current = true\n            scrubTo(e)\n          }}\n          onPointerMove={(e) => scrubbing.current && scrubTo(e)}\n          onPointerUp={() => (scrubbing.current = false)}\n          onPointerCancel={() => (scrubbing.current = false)}\n          className=\"ring-focus grid h-9 min-w-0 flex-1 cursor-pointer touch-pan-y content-center items-center justify-between gap-y-[1.5px] rounded-[6px] outline-none\"\n          style={{ gridTemplateColumns: `repeat(${COLS}, 3px)`, gridTemplateRows: `repeat(${ROWS}, 3px)`, gridAutoFlow: 'column' }}\n        >\n          {peaks.flatMap((p, c) => {\n            const reach = p < 0.08 ? 0 : p < 0.35 ? 1 : p < 0.65 ? 2 : 3\n            const done = (c + 0.5) / COLS <= played\n            return Array.from({ length: ROWS }, (_, r) => {\n              const lit = Math.abs(r - 3) <= reach\n              return <span key={`${c}-${r}`} className=\"size-[3px] rounded-full bg-ink transition-opacity ease-detent duration-150\" style={{ opacity: lit ? (done ? 1 : 0.28) : 0.07 }} />\n            })\n          })}\n        </div>\n\n        <p className=\"tnum flex w-[74px] shrink-0 justify-end text-footnote\">\n          <RollingText text={time(t)} className=\"text-ink\" />\n          <span className=\"text-ink-3\">&nbsp;/ {time(duration)}</span>\n        </p>\n      </div>\n\n      <div className=\"mt-2 flex items-center gap-1 pl-[52px]\">\n        <motion.button type=\"button\" whileTap={press} onPointerDown={tap} onClick={cycle} aria-label={`Speed ${rate}×`} className=\"ring-focus relative flex h-6 items-center rounded-full bg-surface-2 px-2 pointer-coarse:before:absolute pointer-coarse:before:-inset-x-1 pointer-coarse:before:-inset-y-1.5 pointer-coarse:before:content-[''] text-caption font-medium text-ink transition-colors ease-detent hover:bg-surface-3\">\n          <RollingText text={`${rate}×`} />\n        </motion.button>\n        <button type=\"button\" onClick={() => setReading((o) => !o)} aria-expanded={reading} className=\"ring-focus relative flex h-6 items-center gap-1 rounded-full px-2 pointer-coarse:before:absolute pointer-coarse:before:-inset-x-1 pointer-coarse:before:-inset-y-1.5 pointer-coarse:before:content-[''] text-caption font-medium text-ink-2 transition-colors ease-detent hover:bg-surface-2 hover:text-ink\">\n          Transcript\n          <motion.span className=\"flex\" animate={{ rotate: reading ? 180 : 0 }} transition={spring.snappy}>\n            <ChevronDown size={12} />\n          </motion.span>\n        </button>\n      </div>\n\n      <AnimatePresence initial={false}>\n        {reading && (\n          <motion.div className=\"overflow-hidden\" initial={{ height: 0, opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} exit={{ height: 0, opacity: 0 }} transition={{ height: spring.smooth, opacity: { duration: 0.2, ease: ease.out } }}>\n            <p className=\"px-[52px] pb-1.5 pr-3 pt-2.5 text-callout leading-[22px]\">\n              {words.map((w, i) => (\n                <span key={i} className={`transition-colors ease-detent duration-200 ${i <= spoken ? 'text-ink' : 'text-ink-3'}`}>\n                  {i > 0 && ' '}\n                  {w.word}\n                </span>\n              ))}\n            </p>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  )\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/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/feel.ts","target":"components/detent/lib/feel.ts","type":"registry:component","content":"export const tap = () => {\n  if (typeof window !== 'undefined') window.dispatchEvent(new Event('detent:tap'))\n}\n\nlet keyed = true\nif (typeof window !== 'undefined') {\n  window.addEventListener('keydown', () => void (keyed = true), true)\n  window.addEventListener('pointerdown', () => void (keyed = false), true)\n}\nexport const byKey = () => keyed\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"}]}