{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"faq","title":"FAQ","description":"Searchable FAQ Section Block for React. The questions people ask before they start: search as you type with matches marked in place, topics, answers that open without moving the page, and a person to ask when it isn’t there.","type":"registry:block","author":"Detent","dependencies":["motion"],"registryDependencies":["https://detentui.com/r/theme.json"],"files":[{"path":"components/detent/blocks/faq/FAQ.tsx","target":"components/detent/blocks/faq/FAQ.tsx","type":"registry:block","content":"'use client'\n\nimport { useId, useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport type { KeyboardEvent, ReactNode } from 'react'\nimport { AnimatePresence, motion } from 'motion/react'\nimport { ease, press, spring } from '@/components/detent/lib/motion'\nimport { tap } from '@/components/detent/lib/feel'\nimport { useStack } from '@/components/detent/lib/hooks'\nimport { Orb } from '@/components/detent/ui/Orb'\nimport { Close, Plus, Search } from '@/components/detent/blocks/kit/icons'\nimport { btn } from '@/components/detent/blocks/kit/primitives'\nimport { useDirector } from '@/components/detent/blocks/kit/director'\nimport { Segmented } from '@/components/detent/blocks/kit/Segmented'\nimport { accentVars } from '@/components/detent/blocks/kit/props'\nimport type { BlockProps } from '@/components/detent/blocks/kit/props'\nimport { QUESTIONS } from '@/components/detent/blocks/faq/content'\nimport type { Question } from '@/components/detent/blocks/faq/content'\n\nexport type FAQProps = BlockProps & {\n  product?: string\n  eyebrow?: string\n  title?: [string, string]\n  subline?: string\n  questions?: Question[]\n  multiple?: boolean\n  contact?: { title: string; line: string; action: string; name?: string } | false\n  onAsk?: (query: string) => void\n  onContact?: () => void\n  onFeedback?: (id: string, helpful: boolean) => void\n}\n\nexport function FAQ({\n  autoplay = false,\n  accent,\n  product = 'Detent',\n  eyebrow = 'Questions',\n  title = ['Everything you’d ask', 'before you start.'],\n  subline = 'Search, or browse by topic. If it isn’t here, ask the team.',\n  questions: given,\n  multiple = false,\n  contact = { title: 'Still stuck?', line: 'Ask the team and a person will answer.', action: 'Talk to a person' },\n  onAsk,\n  onContact,\n  onFeedback,\n  className = '',\n}: FAQProps) {\n  const questions = useMemo(() => given ?? QUESTIONS.map((x) => ({ ...x, q: x.q.replaceAll('Detent', product), a: x.a.replaceAll('Detent', product) })), [given, product])\n  const calls = useRef({ onAsk, onContact, onFeedback })\n  useLayoutEffect(() => {\n    calls.current = { onAsk, onContact, onFeedback }\n  })\n  const handed = useRef(!autoplay)\n  const topics = ['All', ...questions.map((x) => x.topic).filter((t, i, all) => all.indexOf(t) === i)]\n  const [topic, setTopic] = useState(0)\n  const [query, setQuery] = useState('')\n  const [open, setOpen] = useState<string[]>([])\n  const [helped, setHelped] = useState<Record<string, boolean>>({})\n\n  const words = query.toLowerCase().split(/\\s+/).filter(Boolean)\n  const shown = questions.filter((x) => (topic === 0 || x.topic === topics[topic]) && words.every((w) => `${x.q} ${x.a}`.toLowerCase().includes(w)))\n  const toggle = (id: string) => setOpen((o) => (o.includes(id) ? o.filter((x) => x !== id) : multiple ? [...o, id] : [id]))\n\n  const director = useDirector(\n    async (wait) => {\n      const type = async (text: string) => {\n        for (const ch of text) {\n          setQuery((q) => q + ch)\n          await wait(80)\n        }\n      }\n      const erase = async (n: number) => {\n        for (let i = 0; i < n; i++) {\n          setQuery((q) => q.slice(0, -1))\n          await wait(35)\n        }\n      }\n      await wait(1300)\n      setOpen([questions[0].id])\n      await wait(2800)\n      setOpen([])\n      await wait(600)\n      await type('approve')\n      await wait(1600)\n      const hit = questions.find((x) => x.q.toLowerCase().includes('approve'))\n      if (hit) {\n        setOpen([hit.id])\n        await wait(3000)\n        setOpen([])\n      }\n      await wait(500)\n      await erase(7)\n      await wait(900)\n      setTopic(topics.length - 1)\n      await wait(1300)\n      const first = questions.find((x) => x.topic === topics[topics.length - 1])\n      if (first) {\n        setOpen([first.id])\n        await wait(3000)\n        setOpen([])\n      }\n      await wait(600)\n      setTopic(0)\n      await wait(1800)\n    },\n    autoplay,\n    () => (handed.current = true),\n  )\n\n  return (\n    <div className={`pro-app @container h-full w-full overflow-y-auto overflow-x-hidden bg-surface text-ink [scrollbar-width:thin] ${className}`} style={accentVars(accent)} onPointerDownCapture={director.onPointerDownCapture} onPointerUpCapture={director.onPointerUpCapture} onKeyDownCapture={director.onKeyDownCapture}>\n      <section className=\"mx-auto grid max-w-[1120px] gap-10 px-5 py-14 @3xl:px-8 @3xl:py-20 @4xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)] @4xl:gap-16\">\n        <div className=\"@4xl:sticky @4xl:top-12 @4xl:self-start\">\n          <p className=\"text-footnote font-medium text-[var(--dt-accent-ink)]\">{eyebrow}</p>\n          <h2 className=\"mt-3 text-[clamp(28px,4cqi,40px)] font-normal leading-[1.08] tracking-[-0.04em] text-ink\">\n            {title[0]}\n            <span className=\"block text-[color-mix(in_oklch,var(--ink)_42%,transparent)]\">{title[1]}</span>\n          </h2>\n          <p className=\"mt-4 text-[15px] leading-[23px] text-ink-2\">{subline}</p>\n\n          <label className=\"mt-7 flex h-11 items-center gap-2.5 rounded-full bg-surface pl-4 pr-1.5 shadow-raised transition-shadow ease-detent focus-within:shadow-[var(--elev-raised),0_0_0_3px_color-mix(in_oklch,var(--dt-accent)_22%,transparent)]\">\n            <Search size={16} className=\"shrink-0 text-ink-3\" />\n            <input value={query} onChange={(e) => setQuery(e.target.value)} onKeyDown={(e) => e.key === 'Escape' && setQuery('')} placeholder=\"Search questions\" aria-label=\"Search questions\" className=\"h-full min-w-0 flex-1 bg-transparent text-callout text-ink outline-none placeholder:text-ink-3\" />\n            <button\n              type=\"button\"\n              aria-label=\"Clear search\"\n              tabIndex={query ? 0 : -1}\n              onClick={() => setQuery('')}\n              className={`ring-focus grid size-8 shrink-0 place-items-center rounded-full text-ink-3 transition-opacity ease-detent hover:bg-surface-2 hover:text-ink ${query ? '' : 'pointer-events-none opacity-0'}`}\n            >\n              <Close size={14} />\n            </button>\n          </label>\n          <p aria-live=\"polite\" className=\"mt-2.5 h-5 px-4 text-caption text-ink-3\">\n            {words.length ? (shown.length ? `${shown.length} ${shown.length === 1 ? 'answer' : 'answers'} for “${query.trim()}”` : `Nothing for “${query.trim()}” yet`) : `${questions.length} questions`}\n          </p>\n\n          {contact && (\n            <div className=\"mt-8 flex items-start gap-3 rounded-[16px] bg-[var(--dt-card)] p-4 shadow-[0_0_0_1px_var(--line)]\">\n              <Orb seed={contact.name ?? product} hue={150} size={32} />\n              <div className=\"min-w-0 flex-1\">\n                <p className=\"text-callout font-medium text-ink\">{contact.title}</p>\n                <p className=\"mt-0.5 text-footnote text-ink-2\">{contact.line}</p>\n                <motion.button type=\"button\" whileTap={press} onClick={() => (tap(), calls.current.onContact?.())} className={`${btn.secondary} mt-3`}>\n                  {contact.action}\n                </motion.button>\n              </div>\n            </div>\n          )}\n        </div>\n\n        <div className=\"min-w-0\">\n          <Segmented label=\"Topic\" options={topics.map((t) => ({ id: t, label: t }))} at={topic} onPick={setTopic} />\n          <List\n            all={questions}\n            multiple={multiple}\n            items={shown}\n            words={words}\n            open={open}\n            onToggle={toggle}\n            helped={helped}\n            onHelped={(id, v) => {\n              setHelped((h) => ({ ...h, [id]: v }))\n              if (handed.current) calls.current.onFeedback?.(id, v)\n            }}\n            query={query.trim()}\n            onAsk={() => calls.current.onAsk?.(query.trim())}\n          />\n        </div>\n      </section>\n    </div>\n  )\n}\n\nfunction marked(text: string, words: string[]): ReactNode {\n  if (!words.length) return text\n  const re = new RegExp(`(${words.map((w) => w.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|')})`, 'gi')\n  return (\n    <span key={words.join(' ')}>\n      {text.split(re).map((part, i) =>\n        i % 2 ? (\n          <mark key={i} className=\"-mx-[2px] rounded-[3px] bg-[color-mix(in_oklch,var(--dt-accent)_20%,transparent)] px-[2px] text-inherit\">\n            {part}\n          </mark>\n        ) : (\n          part\n        ),\n      )}\n    </span>\n  )\n}\n\nfunction snippet(answer: string, words: string[]) {\n  const low = answer.toLowerCase()\n  const at = Math.min(...words.map((w) => low.indexOf(w)).filter((i) => i >= 0))\n  if (!Number.isFinite(at)) return null\n  const sentence = Math.max(answer.lastIndexOf('. ', at), answer.lastIndexOf('? ', at))\n  let start = sentence >= 0 && at - sentence < 64 ? sentence + 2 : Math.max(0, at - 34)\n  if (start > 0 && start !== sentence + 2) start = answer.indexOf(' ', start) + 1\n  let end = Math.min(answer.length, at + 70)\n  if (end < answer.length) end = answer.lastIndexOf(' ', end)\n  return `${start > 0 ? '…' : ''}${answer.slice(start, end)}${end < answer.length ? '…' : ''}`\n}\n\nfunction List({\n  all,\n  multiple,\n  items,\n  words,\n  open,\n  onToggle,\n  helped,\n  onHelped,\n  query,\n  onAsk,\n}: {\n  all: Question[]\n  multiple: boolean\n  items: Question[]\n  words: string[]\n  open: string[]\n  onToggle: (id: string) => void\n  helped: Record<string, boolean>\n  onHelped: (id: string, v: boolean) => void\n  query: string\n  onAsk: () => void\n}) {\n  const id = useId()\n  const stack = useRef<HTMLDivElement>(null)\n  const holder = useRef<HTMLDivElement>(null)\n  useStack(stack, 0, () => {\n    if (holder.current && stack.current) holder.current.style.minHeight = `${stack.current.offsetHeight}px`\n  })\n  const longest = all.reduce((a, b) => (b.a.length > a.a.length ? b : a), all[0])\n  const nav = (e: KeyboardEvent) => {\n    const all = Array.from(stack.current?.querySelectorAll<HTMLButtonElement>('[data-q]') ?? [])\n    const i = all.indexOf(e.target as HTMLButtonElement)\n    if (i < 0) return\n    const to = {\n      ArrowDown: i + 1,\n      ArrowUp: i - 1,\n      Home: 0,\n      End: all.length - 1,\n    }[e.key]\n    if (to === undefined) return\n    e.preventDefault()\n    all[(to + all.length) % all.length]?.focus()\n  }\n  return (\n    <div ref={holder} className=\"relative mt-6\">\n      {!multiple && (\n        <div aria-hidden inert className=\"invisible\">\n          {all.map((x) => (\n            <Sizer key={x.id} q={x.q} a={x.id === longest?.id ? x.a : null} />\n          ))}\n        </div>\n      )}\n      <div ref={stack} className={`shadow-[inset_0_1px_0_var(--line)] ${multiple ? '' : 'absolute inset-x-0 top-0'}`} onKeyDown={nav}>\n        <AnimatePresence initial={false}>\n          {items.map((x) => {\n            const on = open.includes(x.id)\n            const inQuestion = words.every((w) => x.q.toLowerCase().includes(w))\n            const line = words.length && !inQuestion ? snippet(x.a, words) : null\n            return (\n              <motion.div key={x.id} className=\"overflow-hidden\" initial={{ height: 0, opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} exit={{ height: 0, opacity: 0 }} transition={{ duration: 0.32, ease: ease.out }}>\n                <div className=\"shadow-[inset_0_-1px_0_var(--line)]\">\n                  <h3>\n                    <button type=\"button\" data-q id={`${id}-q-${x.id}`} aria-expanded={on} aria-controls={`${id}-a-${x.id}`} onClick={() => (tap(), onToggle(x.id))} className=\"ring-focus group flex w-full items-start gap-4 rounded-[6px] py-5 text-left\">\n                      <span className=\"min-w-0 flex-1\">\n                        <span className=\"block text-[15px] font-medium leading-[22px] tracking-[-0.01em] text-ink\">{marked(x.q, words)}</span>\n                        <AnimatePresence initial={false}>\n                          {line && !on && (\n                            <motion.span key=\"line\" className=\"block overflow-hidden\" initial={{ height: 0, opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} exit={{ height: 0, opacity: 0 }} transition={{ duration: 0.24, ease: ease.out }}>\n                              <span className=\"block pt-1 text-footnote leading-[19px] text-ink-3\">{marked(line, words)}</span>\n                            </motion.span>\n                          )}\n                        </AnimatePresence>\n                      </span>\n                      <motion.span\n                        className=\"mt-px grid size-6 shrink-0 place-items-center rounded-full bg-[color-mix(in_oklch,var(--ink)_5%,transparent)] text-ink-2 transition-colors ease-detent group-hover:bg-[color-mix(in_oklch,var(--ink)_9%,transparent)] group-hover:text-ink\"\n                        initial={false}\n                        animate={{ rotate: on ? 45 : 0 }}\n                        transition={spring.snappy}\n                      >\n                        <Plus size={14} />\n                      </motion.span>\n                    </button>\n                  </h3>\n                  <AnimatePresence initial={false}>\n                    {on && (\n                      <motion.div\n                        key=\"a\"\n                        id={`${id}-a-${x.id}`}\n                        role=\"region\"\n                        aria-labelledby={`${id}-q-${x.id}`}\n                        className=\"overflow-hidden\"\n                        initial={{ height: 0, opacity: 0 }}\n                        animate={{ height: 'auto', opacity: 1 }}\n                        exit={{ height: 0, opacity: 0 }}\n                        transition={{ duration: 0.34, ease: ease.out }}\n                      >\n                        <div className=\"pb-5 pr-10\">\n                          <p className=\"max-w-[62ch] text-callout leading-[23px] text-ink-2\">{marked(x.a, words)}</p>\n                          <Helpful value={helped[x.id]} onPick={(v) => onHelped(x.id, v)} />\n                        </div>\n                      </motion.div>\n                    )}\n                  </AnimatePresence>\n                </div>\n              </motion.div>\n            )\n          })}\n          {!items.length && (\n            <motion.div key=\"none\" className=\"overflow-hidden\" initial={{ height: 0, opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} exit={{ height: 0, opacity: 0 }} transition={{ duration: 0.32, ease: ease.out }}>\n              <div className=\"flex flex-col items-start gap-3 py-8\">\n                <p className=\"text-callout text-ink-2\">{query ? `Nothing about “${query}” yet. The team can answer it directly.` : 'Nothing in this topic yet.'}</p>\n                {query && (\n                  <motion.button type=\"button\" whileTap={press} onClick={() => (tap(), onAsk())} className={btn.primary}>\n                    Ask the team\n                  </motion.button>\n                )}\n              </div>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </div>\n  )\n}\n\nfunction Sizer({ q, a }: { q: string; a: string | null }) {\n  return (\n    <div className=\"shadow-[inset_0_-1px_0_var(--line)]\">\n      <div className=\"flex items-start gap-4 py-5\">\n        <span className=\"min-w-0 flex-1 text-[15px] font-medium leading-[22px] tracking-[-0.01em]\">{q}</span>\n        <span className=\"mt-px size-6 shrink-0\" />\n      </div>\n      {a && (\n        <div className=\"pb-5 pr-10\">\n          <p className=\"max-w-[62ch] text-callout leading-[23px]\">{a}</p>\n          <div className=\"mt-4 h-7\" />\n        </div>\n      )}\n    </div>\n  )\n}\n\nfunction Helpful({ value, onPick }: { value: boolean | undefined; onPick: (v: boolean) => void }) {\n  const done = value !== undefined\n  return (\n    <div className=\"mt-4 grid h-7 text-footnote\">\n      <span className={`col-start-1 row-start-1 flex items-center gap-1 transition-opacity ease-detent duration-200 ${done ? 'pointer-events-none opacity-0' : ''}`}>\n        <span className=\"mr-1.5 text-ink-3\">Did this help?</span>\n        {[true, false].map((v) => (\n          <button key={String(v)} type=\"button\" tabIndex={done ? -1 : 0} onClick={() => (tap(), onPick(v))} className={`${btn.ghost} h-7 px-2`}>\n            {v ? 'Yes' : 'No'}\n          </button>\n        ))}\n      </span>\n      <span className={`pointer-events-none col-start-1 row-start-1 flex items-center text-ink-3 transition-opacity ease-detent duration-200 ${done ? '' : 'opacity-0'}`}>{value ? 'Glad it did. Thanks for saying.' : 'Thanks. We’ll make this one clearer.'}</span>\n    </div>\n  )\n}\n"},{"path":"components/detent/blocks/faq/content.ts","target":"components/detent/blocks/faq/content.ts","type":"registry:block","content":"export type Question = { id: string; topic: string; q: string; a: string }\n\nexport const QUESTIONS: Question[] = [\n  {\n    id: 'does',\n    topic: 'Product',\n    q: 'What does Detent actually do on its own?',\n    a: 'It answers from your help center and past tickets, and it can take the actions you allow, like refunds, replacements or trial extensions. Anything that moves money or changes an account waits for a person to approve it.',\n  },\n  {\n    id: 'setup',\n    topic: 'Product',\n    q: 'How long does setup take?',\n    a: 'Most teams are live in an afternoon. Connect your help desk, point it at your help center, then run it over a day of past tickets to see what it would have said before it talks to anyone.',\n  },\n  {\n    id: 'unsure',\n    topic: 'Product',\n    q: 'What happens when it doesn’t know?',\n    a: 'It says so, and hands the conversation to a person with a summary of what the customer needs and what’s been tried. It never guesses at policy.',\n  },\n  {\n    id: 'languages',\n    topic: 'Product',\n    q: 'Which languages does it speak?',\n    a: 'More than 40. It replies in the language the customer wrote in, in the tone you’ve set, with nothing to set up per language.',\n  },\n  {\n    id: 'conversation',\n    topic: 'Pricing',\n    q: 'What counts as a conversation?',\n    a: 'One customer thread, however many messages it takes. Follow-ups on the same issue within 24 hours are part of the same conversation.',\n  },\n  {\n    id: 'cap',\n    topic: 'Pricing',\n    q: 'Can I set a spending cap?',\n    a: 'Yes. Set a monthly cap and Detent hands everything to your team once it’s reached, so a busy month never surprises you.',\n  },\n  {\n    id: 'free',\n    topic: 'Pricing',\n    q: 'Is there a free plan?',\n    a: 'Starter is free for 500 conversations a month, with everything except custom actions. No card needed.',\n  },\n  {\n    id: 'training',\n    topic: 'Security',\n    q: 'Do you train on our data?',\n    a: 'No. Your tickets and docs are used to answer your customers and nothing else. They’re never used to train models, ours or anyone’s.',\n  },\n  {\n    id: 'where',\n    topic: 'Security',\n    q: 'Where is our data stored?',\n    a: 'In the US or the EU, your choice, encrypted at rest and in transit. Enterprise plans can keep it in a dedicated region.',\n  },\n  {\n    id: 'approvers',\n    topic: 'Security',\n    q: 'Who can approve actions?',\n    a: 'Anyone you give the Approver role. Every approval is logged with who, what and when, and you can require two people for amounts over a limit.',\n  },\n]\n"},{"path":"components/detent/blocks/kit/Segmented.tsx","target":"components/detent/blocks/kit/Segmented.tsx","type":"registry:block","content":"'use client'\n\nimport { useId, useRef } from 'react'\nimport type { ReactNode } from 'react'\nimport { motion } from 'motion/react'\nimport { spring } from '@/components/detent/lib/motion'\nimport { tap } from '@/components/detent/lib/feel'\nimport type { pressed } from '@/components/detent/lib/hand'\n\nexport function Segmented({ label, options, at, onPick, handlers }: {\n  label: string\n  options: { id: string; label: ReactNode; name?: string }[]\n  at: number\n  onPick: (i: number) => void\n  handlers?: Pick<ReturnType<typeof pressed>, 'onPointerDownCapture' | 'onPointerUpCapture'> & { onKeyDownCapture: () => void }\n}) {\n  const plate = useId()\n  const refs = useRef<(HTMLButtonElement | null)[]>([])\n  return (\n    <div\n      role=\"radiogroup\"\n      aria-label={label}\n      className=\"flex w-fit rounded-full bg-[color-mix(in_oklch,var(--ink)_5%,transparent)] p-0.5\"\n      {...handlers}\n      onKeyDown={(e) => {\n        const d = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? 1 : e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? -1 : 0\n        if (!d) return\n        e.preventDefault()\n        const i = (at + d + options.length) % options.length\n        onPick(i)\n        refs.current[i]?.focus()\n      }}\n    >\n      {options.map((o, i) => (\n        <button\n          key={o.id}\n          ref={(el) => {\n            refs.current[i] = el\n          }}\n          type=\"button\"\n          role=\"radio\"\n          aria-checked={i === at}\n          aria-label={o.name}\n          tabIndex={i === at ? 0 : -1}\n          onClick={() => (tap(), onPick(i))}\n          className=\"ring-focus relative h-7 min-w-9 pointer-coarse:h-9 shrink-0 whitespace-nowrap rounded-full px-2.5 text-caption font-medium\"\n        >\n          {i === at && <motion.span layoutId={plate} transition={spring.move} className=\"absolute inset-0 rounded-full bg-surface shadow-raised\" />}\n          <span className={`relative z-[1] transition-colors ease-detent ${i === at ? 'text-ink' : 'text-ink-3 hover:text-ink-2'}`}>{o.label}</span>\n        </button>\n      ))}\n    </div>\n  )\n}\n"},{"path":"components/detent/lib/hooks.ts","target":"components/detent/lib/hooks.ts","type":"registry:block","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/blocks/kit/props.tsx","target":"components/detent/blocks/kit/props.tsx","type":"registry:block","content":"'use client'\n\nimport { createContext, useContext } from 'react'\nimport type { CSSProperties } from 'react'\n\nexport type BlockProps = {\n  autoplay?: boolean\n  accent?: string\n  className?: string\n}\n\nexport const Names = createContext({ assistant: 'Detent', product: 'Detent' })\nexport const useNames = () => useContext(Names)\n\nexport const handle = (s: string) => s.toLowerCase().replace(/[^a-z0-9]+/g, '-')\n\nexport function accentVars(accent?: string): CSSProperties | undefined {\n  if (!accent) return undefined\n  return {\n    ['--dt-accent' as string]: accent,\n    ['--dt-accent-ink' as string]: `light-dark(color-mix(in oklch, ${accent} 82%, black), color-mix(in oklch, ${accent} 60%, white))`,\n  }\n}\n"},{"path":"components/detent/lib/motion.ts","target":"components/detent/lib/motion.ts","type":"registry:block","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"},{"path":"components/detent/lib/feel.ts","target":"components/detent/lib/feel.ts","type":"registry:block","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/ui/Orb.tsx","target":"components/detent/ui/Orb.tsx","type":"registry:block","content":"import type { CSSProperties } from 'react'\n\nfunction hash(s: string) {\n  let h = 2166136261\n  for (let i = 0; i < s.length; i++) h = Math.imul(h ^ s.charCodeAt(i), 16777619)\n  return h >>> 0\n}\n\nconst at = (r: number, deg: number) => {\n  const a = (deg * Math.PI) / 180\n  return `${(50 + r * Math.cos(a)).toFixed(1)}% ${(50 + r * Math.sin(a)).toFixed(1)}%`\n}\n\nexport function Orb({ seed, hue, size = 32, quiet = false, className = '', style }: { seed: string; hue?: number; size?: number; quiet?: boolean; className?: string; style?: CSSProperties }) {\n  const n = hash(seed)\n  const h = hue ?? n % 360\n  const turn = n % 360\n  const comp = (h + 160 + (n % 40)) % 360\n  const warm = (h + 30 + ((n >> 6) % 30)) % 360\n  const glint = (h + 190 + ((n >> 11) % 40)) % 360\n  const c = (v: number) => (quiet ? v * 0.32 : v).toFixed(3)\n  return (\n    <span aria-hidden className={`relative block shrink-0 overflow-hidden rounded-full ${className}`} style={{ width: size, height: size, ...style }}>\n      <span\n        className=\"absolute -inset-[18%] block\"\n        style={{\n          background: [\n            `radial-gradient(circle at 46% 42%, oklch(0.84 ${c(0.15)} ${h}) 0%, transparent 60%)`,\n            `radial-gradient(circle at ${at(50, turn + 165)}, oklch(0.84 ${c(0.15)} ${comp}) 0%, transparent 40%)`,\n            `radial-gradient(circle at ${at(50, turn + 45)}, oklch(${quiet ? 0.66 : 0.7} ${c(0.19)} ${warm}) 0%, transparent 42%)`,\n            `radial-gradient(circle at ${at(52, turn - 65)}, oklch(0.88 ${c(0.1)} ${glint}) 0%, transparent 28%)`,\n            `oklch(${quiet ? 0.72 : 0.78} ${c(0.15)} ${h})`,\n          ].join(', '),\n          filter: `blur(${Math.max(1.5, size * 0.1)}px)`,\n        }}\n      />\n      <span\n        className=\"absolute inset-0 block rounded-full\"\n        style={{\n          background: 'radial-gradient(circle at 34% 26%, rgb(255 255 255 / 0.42) 0%, rgb(255 255 255 / 0.12) 26%, transparent 46%)',\n          boxShadow: `inset 0 ${-size * 0.1}px ${size * 0.22}px oklch(0.4 0.12 ${h} / 0.2), inset 0 0 0 0.5px rgb(0 0 0 / 0.07)`,\n        }}\n      />\n    </span>\n  )\n}\n"},{"path":"components/detent/blocks/kit/icons.tsx","target":"components/detent/blocks/kit/icons.tsx","type":"registry:block","content":"import { useId } from 'react'\nimport type { SVGProps } from 'react'\n\ntype P = SVGProps<SVGSVGElement> & { size?: number }\n\nfunction Svg({ size = 18, children, ...rest }: P) {\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden {...rest}>\n      {children}\n    </svg>\n  )\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 ChevronDown = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M6.5 9.5 12 15l5.5-5.5\" />\n  </Svg>\n)\n\nexport const ChevronRight = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M9.5 6.5 15 12l-5.5 5.5\" />\n  </Svg>\n)\n\nexport const ChevronLeft = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M14.5 6.5 9 12l5.5 5.5\" />\n  </Svg>\n)\n\nexport const Reset = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4.5 12a7.5 7.5 0 1 0 2.2-5.3\" />\n    <path d=\"M4.5 4.5v4h4\" />\n  </Svg>\n)\n\nexport const Close = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M6.5 6.5l11 11M17.5 6.5l-11 11\" />\n  </Svg>\n)\n\nexport const Plus = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 5.5v13M5.5 12h13\" />\n  </Svg>\n)\n\nexport const Search = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"11\" cy=\"11\" r=\"6.25\" />\n    <path d=\"m15.75 15.75 3.75 3.75\" />\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=\"1.9\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Refresh = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M19.5 12a7.5 7.5 0 1 1-2.2-5.3\" />\n    <path d=\"M19.5 4.5v4h-4\" />\n  </Svg>\n)\n\nexport const Note = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"5\" y=\"3.5\" width=\"14\" height=\"17\" rx=\"2.5\" />\n    <path d=\"M8.75 8.5h6.5M8.75 12h6.5M8.75 15.5h3.5\" />\n  </Svg>\n)\n\nexport const FilePage = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M13.5 3.5H8A2.5 2.5 0 0 0 5.5 6v12A2.5 2.5 0 0 0 8 20.5h8a2.5 2.5 0 0 0 2.5-2.5V8.5Z\" />\n    <path d=\"M13.5 3.5v5h5\" />\n  </Svg>\n)\n\nexport const Copy = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"8.5\" y=\"8.5\" width=\"11\" height=\"11\" rx=\"2.5\" />\n    <path d=\"M15.5 8.5v-2a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h2\" />\n  </Svg>\n)\n\nexport const ArrowUp = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 19V5.5M6.5 11 12 5.5l5.5 5.5\" />\n  </Svg>\n)\n\nexport const ArrowRight = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 12h13.5M13 6.5l5.5 5.5-5.5 5.5\" />\n  </Svg>\n)\n\nexport const ArrowLeft = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M19 12H5.5M11 6.5 5.5 12l5.5 5.5\" />\n  </Svg>\n)\n\nexport const Return = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M18.5 5.5V11a3 3 0 0 1-3 3H5.5M10 9.5 5.5 14l4.5 4.5\" />\n  </Svg>\n)\n\nexport const ArrowUpRight = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M7.5 16.5l9-9M9 7.5h7.5V15\" />\n  </Svg>\n)\n\nexport const Pencil = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M11.5 4.5H7A2.5 2.5 0 0 0 4.5 7v10A2.5 2.5 0 0 0 7 19.5h10a2.5 2.5 0 0 0 2.5-2.5v-4.5\" />\n    <path d=\"M17.6 3.9a1.9 1.9 0 0 1 2.7 2.7l-7.8 7.8-3.5.8.8-3.5Z\" />\n  </Svg>\n)\n\nexport const Folder = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M3.5 7.5A2.5 2.5 0 0 1 6 5h3.4c.6 0 1.1.2 1.5.6l1.2 1.2c.4.4.9.6 1.5.6H18a2.5 2.5 0 0 1 2.5 2.5v6.6A2.5 2.5 0 0 1 18 19H6a2.5 2.5 0 0 1-2.5-2.5Z\" />\n  </Svg>\n)\n\nexport const Code = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M8.5 7.5 4 12l4.5 4.5M15.5 7.5 20 12l-4.5 4.5\" />\n  </Svg>\n)\n\nexport const Download = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 4.5v11M7.5 11l4.5 4.5 4.5-4.5M5 19.5h14\" />\n  </Svg>\n)\n\nexport const Upload = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 15.5v-11M7.5 9 12 4.5 16.5 9M5 19.5h14\" />\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=\"M7.5 10.5 11 4a1.8 1.8 0 0 1 3.3 1.3l-.8 3.7h4.9a2 2 0 0 1 2 2.4l-1.2 6.4a2 2 0 0 1-2 1.7H7.5Z\" />\n    <path d=\"M4.5 10.5h3v9h-3a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1Z\" />\n  </Svg>\n)\n\nexport const Sun = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"4\" />\n    <path d=\"M12 3v1.5M12 19.5V21M3 12h1.5M19.5 12H21M5.6 5.6l1.1 1.1M17.3 17.3l1.1 1.1M5.6 18.4l1.1-1.1M17.3 6.7l1.1-1.1\" />\n  </Svg>\n)\n\nexport const Moon = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M19.5 14.5A7.5 7.5 0 0 1 9.5 4.5a7.5 7.5 0 1 0 10 10Z\" />\n  </Svg>\n)\n\nexport const Stop = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2.25\" fill=\"currentColor\" stroke=\"none\" />\n  </Svg>\n)\n\nexport const Pause = (p: P) => (\n  <Svg {...p} strokeWidth={p.strokeWidth ?? 2}>\n    <path d=\"M9 7v10M15 7v10\" />\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=\"2.5\" />\n    <path d=\"m4.5 7.5 7.5 5.25 7.5-5.25\" />\n  </Svg>\n)\n\nexport const Expand = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M14.5 4.5h5v5M9.5 19.5h-5v-5M19.5 4.5l-6 6M4.5 19.5l6-6\" />\n  </Svg>\n)\n\nexport const Card = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"13\" rx=\"2.5\" />\n    <path d=\"M3.5 10h17M7 15h3\" />\n  </Svg>\n)\n\nexport const Bolt = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M13 3.5 5.5 13.5h6l-1 7 7.5-10h-6Z\" />\n  </Svg>\n)\n\nexport const People = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"9\" cy=\"8.5\" r=\"3\" />\n    <path d=\"M3.5 19a5.5 5.5 0 0 1 11 0\" />\n    <path d=\"M15.5 5.6a3 3 0 0 1 0 5.8M17.5 14.3a5.5 5.5 0 0 1 3 4.7\" />\n  </Svg>\n)\n\nexport const Person = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"8\" r=\"3.5\" />\n    <path d=\"M5 19.5a7 7 0 0 1 14 0\" />\n  </Svg>\n)\n\nexport const Sliders = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4.5 7.5h8.5M17 7.5h2.5M4.5 16.5H7M11 16.5h8.5\" />\n    <circle cx=\"15\" cy=\"7.5\" r=\"2\" />\n    <circle cx=\"9\" cy=\"16.5\" r=\"2\" />\n  </Svg>\n)\n\nexport const Key = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"8\" cy=\"15.5\" r=\"3.75\" />\n    <path d=\"M10.7 12.8 19 4.5M16 7.5l2.5 2.5M13.75 9.75l2 2\" />\n  </Svg>\n)\n\nexport const Shield = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 3.5 5 6.5v5c0 4.3 3 7.6 7 9 4-1.4 7-4.7 7-9v-5Z\" />\n    <path d=\"m9.25 12 2 2 3.5-3.75\" />\n  </Svg>\n)\n\nexport const Lock = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"5.5\" y=\"10.5\" width=\"13\" height=\"9.5\" rx=\"2.5\" />\n    <path d=\"M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5\" />\n  </Svg>\n)\n\nexport const Sidebar = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"3\" />\n    <path d=\"M9.5 4.5v15\" />\n  </Svg>\n)\n\nexport const PullRequest = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"6.5\" cy=\"6\" r=\"2\" />\n    <circle cx=\"6.5\" cy=\"18\" r=\"2\" />\n    <circle cx=\"17.5\" cy=\"18\" r=\"2\" />\n    <path d=\"M6.5 8v8M17.5 16v-6.5a3 3 0 0 0-3-3H11\" />\n    <path d=\"m13 4.5-2 2 2 2\" />\n  </Svg>\n)\n\nexport const Clock = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"8\" />\n    <path d=\"M12 7.5V12l3 2\" />\n  </Svg>\n)\n\nexport const Terminal = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"3\" />\n    <path d=\"m7.5 9.5 2.5 2.5-2.5 2.5M12.5 14.5h4\" />\n  </Svg>\n)\n\nexport const Filter = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4.5 7h15M7.5 12h9M10.5 17h3\" />\n  </Svg>\n)\n\nexport const Mic = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"9\" y=\"3.5\" width=\"6\" height=\"11\" rx=\"3\" />\n    <path d=\"M5.5 11.5a6.5 6.5 0 0 0 13 0M12 18v2.5\" />\n  </Svg>\n)\n\nexport const MicOff = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M15 9.5V6.5a3 3 0 0 0-5.6-1.5M9 9v2.5a3 3 0 0 0 4.9 2.3\" />\n    <path d=\"M5.5 11.5a6.5 6.5 0 0 0 10.6 5M18.4 13a6.5 6.5 0 0 0 .1-1.5M12 18v2.5M4 4l16 16\" />\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\" />\n    <path d=\"M7.5 13.5h5M14.5 13.5h2M7.5 10.5h2M11.5 10.5h5\" />\n  </Svg>\n)\n\nfunction Solid({ size = 22, children, ...rest }: P) {\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden {...rest}>\n      {children}\n    </svg>\n  )\n}\n\nconst HANDSET = 'M2.75 12.9C2.75 9.55 6.9 7.6 12 7.6S21.25 9.55 21.25 12.9v1.55c0 .95-.8 1.65-1.75 1.5l-2.6-.4a1.6 1.6 0 0 1-1.35-1.58v-1.4A12.6 12.6 0 0 0 12 11.9c-1.25 0-2.4.18-3.55.67v1.4a1.6 1.6 0 0 1-1.35 1.58l-2.6.4c-.95.15-1.75-.55-1.75-1.5Z'\n\nexport const MicSolid = (p: P) => (\n  <Solid {...p}>\n    <rect x=\"8.25\" y=\"2.5\" width=\"7.5\" height=\"12.5\" rx=\"3.75\" />\n    <path d=\"M5.25 11.25a6.75 6.75 0 0 0 13.5 0M12 18v3.25\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.9} strokeLinecap=\"round\" />\n  </Solid>\n)\n\nexport function MicOffSolid(p: P) {\n  const id = useId()\n  return (\n    <Solid {...p}>\n      <mask id={id}>\n        <rect width=\"24\" height=\"24\" fill=\"#fff\" />\n        <path d=\"M4.5 3.5 19.5 20.5\" stroke=\"#000\" strokeWidth={5} strokeLinecap=\"round\" />\n      </mask>\n      <g mask={`url(#${id})`}>\n        <rect x=\"8.25\" y=\"2.5\" width=\"7.5\" height=\"12.5\" rx=\"3.75\" />\n        <path d=\"M5.25 11.25a6.75 6.75 0 0 0 13.5 0M12 18v3.25\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.9} strokeLinecap=\"round\" />\n      </g>\n      <path d=\"M4.5 3.5 19.5 20.5\" stroke=\"currentColor\" strokeWidth={1.9} strokeLinecap=\"round\" />\n    </Solid>\n  )\n}\n\nexport const Handset = (p: P) => (\n  <Solid {...p}>\n    <path d={HANDSET} />\n  </Solid>\n)\n\nexport function CaptionsSolid(p: P) {\n  const id = useId()\n  return (\n    <Solid {...p}>\n      <mask id={id}>\n        <rect width=\"24\" height=\"24\" fill=\"#fff\" />\n        <path d=\"M6.75 10.25h3.5M12.25 10.25h5M6.75 13.75h7.5M16.25 13.75h1\" stroke=\"#000\" strokeWidth={1.9} strokeLinecap=\"round\" />\n      </mask>\n      <rect x=\"3\" y=\"5.5\" width=\"18\" height=\"13\" rx=\"3.75\" mask={`url(#${id})`} />\n    </Solid>\n  )\n}\n\nexport const Calendar = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"4\" y=\"5.5\" width=\"16\" height=\"14.5\" rx=\"3\" />\n    <path d=\"M4 10h16M8.5 3.5v4M15.5 3.5v4\" />\n  </Svg>\n)\n\nexport const Undo = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M9 14 4.5 9.5 9 5\" />\n    <path d=\"M4.5 9.5H14a5.5 5.5 0 0 1 0 11h-3\" />\n  </Svg>\n)\n\nexport const Chart = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M5 19.5v-7M10 19.5v-15M15 19.5v-9M20 19.5v-12\" />\n  </Svg>\n)\n\nexport const Chats = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M7.5 4.5h9A2.5 2.5 0 0 1 19 7v6.5a2.5 2.5 0 0 1-2.5 2.5H10.5L6.5 19.5V16A2.5 2.5 0 0 1 5 13.5V7a2.5 2.5 0 0 1 2.5-2.5Z\" />\n  </Svg>\n)\n\nexport const Share = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M12 14V3.5M8.25 7.25 12 3.5l3.75 3.75\" />\n    <path d=\"M8.5 10.5h-1A2.5 2.5 0 0 0 5 13v4.5A2.5 2.5 0 0 0 7.5 20h9a2.5 2.5 0 0 0 2.5-2.5V13a2.5 2.5 0 0 0-2.5-2.5h-1\" />\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-1 1\" />\n    <path d=\"M13.5 10.5a3.5 3.5 0 0 0-5 0l-3 3a3.5 3.5 0 0 0 5 5l1-1\" />\n  </Svg>\n)\n\nexport const Trash = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M4.5 7h15M9.5 7V5.5a1.5 1.5 0 0 1 1.5-1.5h2a1.5 1.5 0 0 1 1.5 1.5V7M6.5 7l.8 11a2 2 0 0 0 2 1.9h5.4a2 2 0 0 0 2-1.9l.8-11\" />\n  </Svg>\n)\n\nexport const LogOut = (p: P) => (\n  <Svg {...p}>\n    <path d=\"M14 4.5H7A2.5 2.5 0 0 0 4.5 7v10A2.5 2.5 0 0 0 7 19.5h7M10.5 12h9M16.5 8.5 20 12l-3.5 3.5\" />\n  </Svg>\n)\n\nexport const Help = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"8\" />\n    <path d=\"M9.75 9.75a2.25 2.25 0 1 1 3.1 2.08c-.5.2-.85.68-.85 1.22v.45\" />\n    <path d=\"M12 16.5h.01\" strokeWidth={2.2} />\n  </Svg>\n)\n\nexport const Grid = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"4.5\" y=\"4.5\" width=\"6\" height=\"6\" rx=\"1.75\" />\n    <rect x=\"13.5\" y=\"4.5\" width=\"6\" height=\"6\" rx=\"1.75\" />\n    <rect x=\"4.5\" y=\"13.5\" width=\"6\" height=\"6\" rx=\"1.75\" />\n    <rect x=\"13.5\" y=\"13.5\" width=\"6\" height=\"6\" rx=\"1.75\" />\n  </Svg>\n)\n\nexport const Paperclip = (p: P) => (\n  <Svg {...p}>\n    <path d=\"m19 11.5-7.1 7.1a4.5 4.5 0 0 1-6.4-6.4l7.6-7.6a3 3 0 0 1 4.25 4.25l-7.4 7.4a1.5 1.5 0 0 1-2.1-2.1l6.7-6.7\" />\n  </Svg>\n)\n\nexport const Photo = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"3\" />\n    <circle cx=\"9\" cy=\"10\" r=\"1.5\" />\n    <path d=\"m20 15.5-4.2-4.2a1.5 1.5 0 0 0-2.1 0L6 19\" />\n  </Svg>\n)\n\nexport const Plan = (p: P) => (\n  <Svg {...p}>\n    <path d=\"m4.5 7 1.5 1.5L8.75 5.75M4.5 15l1.5 1.5 2.75-2.75M11.5 7.5h8M11.5 15.5h8\" />\n  </Svg>\n)\n\nexport const At = (p: P) => (\n  <Svg {...p}>\n    <circle cx=\"12\" cy=\"12\" r=\"3.25\" />\n    <path d=\"M15.25 12v1.5a2.25 2.25 0 0 0 4.5 0V12a7.75 7.75 0 1 0-3.1 6.2\" />\n  </Svg>\n)\n\nexport const Slash = (p: P) => (\n  <Svg {...p}>\n    <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"4.5\" />\n    <path d=\"m14 8-4 8\" />\n  </Svg>\n)\n"},{"path":"components/detent/blocks/kit/primitives.tsx","target":"components/detent/blocks/kit/primitives.tsx","type":"registry:block","content":"'use client'\n\nimport { useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { motion, useReducedMotion } from 'motion/react'\nimport type { Tone } from '@/components/detent/ui/Intelligence'\nimport { ease, press, spring } from '@/components/detent/lib/motion'\n\nexport { Hover } from '@/components/detent/ui/Hover'\n\nexport const wash = (hue: number) => ({\n  background: `light-dark(oklch(0.94 0.04 ${hue}), oklch(0.26 0.065 ${hue}))`,\n  color: `light-dark(oklch(0.47 0.13 ${hue}), oklch(0.86 0.08 ${hue}))`,\n  boxShadow: `inset 0 0 0 1px light-dark(transparent, oklch(0.75 0.12 ${hue} / 0.38))`,\n})\n\nexport function Name({ title, tone = 'loud' }: { title: string | null; tone?: Tone }) {\n  const [born] = useState(title)\n  const reduce = useReducedMotion()\n  if (!title) return <span className=\"text-ink-3\">New chat</span>\n  if (born !== null || reduce) return <>{title}</>\n  const letters = [...title]\n  const settle = 0.25 + letters.length * 0.022\n  return (\n    <span className=\"relative inline-block max-w-full truncate align-bottom\">\n      <span className=\"sr-only\">{title}</span>\n      <motion.span aria-hidden className=\"block truncate\" initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: settle, duration: 0.7, ease: ease.out }}>\n        {title}\n      </motion.span>\n      <motion.span aria-hidden className={`absolute inset-0 block truncate ${tone === 'loud' ? 'ai-text' : 'text-ink-3'}`} initial={{ opacity: 1 }} animate={{ opacity: 0 }} transition={{ delay: settle, duration: 0.7, ease: ease.out }}>\n        {letters.map((c, i) => (\n          <motion.span key={i} initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: i * 0.022, duration: 0.18, ease: ease.out }}>\n            {c}\n          </motion.span>\n        ))}\n      </motion.span>\n    </span>\n  )\n}\n\nexport function Caret({ tone, small = false }: { tone: Tone; small?: boolean }) {\n  return (\n    <span\n      aria-hidden\n      className={`ml-[3px] inline-block w-[2px] translate-y-[3px] rounded-full motion-safe:animate-[caret_1.05s_infinite] ${small ? 'h-[15px]' : 'h-[17px]'} ${tone === 'loud' ? 'bg-[linear-gradient(to_bottom,var(--ai-ink-1),var(--ai-ink-3))] shadow-[0_0_10px_var(--ai-2)]' : 'bg-ink-2'}`}\n    />\n  )\n}\n\nexport function LiveDot({ tone, label }: { tone: Tone; label?: string }) {\n  return <span aria-label={label} className={`size-1.5 shrink-0 rounded-full motion-safe:animate-pulse ${tone === 'loud' ? 'bg-[linear-gradient(135deg,var(--ai-1),var(--ai-3))] shadow-[0_0_8px_var(--ai-2)]' : 'bg-ink-3'}`} />\n}\n\nexport function Bars({ hue, level = 2, small = true }: { hue: number; level?: number; small?: boolean }) {\n  const h = small ? [4, 6, 8, 10] : [7, 11, 15, 19]\n  return (\n    <span aria-hidden className={`flex items-end ${small ? 'h-2.5 gap-[1.5px]' : 'h-[19px] gap-[3px]'}`}>\n      {h.map((px, i) => (\n        <span key={i} className={`rounded-full ${small ? 'w-[2.5px]' : 'w-[5px]'}`} style={{ height: px, background: i <= level ? `light-dark(oklch(0.56 0.16 ${hue}), oklch(0.76 0.12 ${hue}))` : 'var(--surface-3)' }} />\n      ))}\n    </span>\n  )\n}\n\nexport type MenuItem = { id: string; label: string; note?: string; icon?: ReactNode; trail?: ReactNode }\n\nexport function Menu({ items, active, onActive, onPick, title, className = '', plate }: { items: MenuItem[]; active: number; onActive: (i: number) => void; onPick: (i: number) => void; title?: string; className?: string; plate: string }) {\n  const [via, setVia] = useState<'pointer' | 'keys'>('keys')\n  useEffect(() => {\n    const keys = () => setVia('keys')\n    window.addEventListener('keydown', keys, true)\n    return () => window.removeEventListener('keydown', keys, true)\n  }, [])\n  return (\n    <motion.div\n      role=\"listbox\"\n      className={`absolute z-30 origin-bottom-left rounded-[11px] bg-surface p-1.5 shadow-modal ${className}`}\n      initial={{ opacity: 0, y: 6, scale: 0.98 }}\n      animate={{ opacity: 1, y: 0, scale: 1 }}\n      exit={{ opacity: 0, y: 4, scale: 0.98, transition: { duration: 0.12, ease: ease.out } }}\n      transition={spring.snappy}\n      onPointerDown={(e) => e.preventDefault()}\n    >\n      {title && <p className=\"px-2.5 pb-1 pt-1.5 text-caption text-ink-3\">{title}</p>}\n      {items.length === 0 && <p className=\"px-2.5 py-2 text-footnote text-ink-3\">Nothing matches</p>}\n      {items.map((it, i) => (\n        <button key={it.id} type=\"button\" role=\"option\" aria-selected={i === active} onPointerEnter={() => (setVia('pointer'), onActive(i))} onClick={() => onPick(i)} className=\"relative flex w-full items-center gap-2.5 rounded-[7px] px-2.5 py-2 text-left\">\n          {i === active && <motion.span layoutId={plate} className=\"absolute inset-0 rounded-[7px] bg-surface-2\" transition={via === 'pointer' ? spring.snappy : { duration: 0 }} />}\n          {it.icon && <span className=\"relative flex shrink-0\">{it.icon}</span>}\n          <span className=\"relative min-w-0 flex-1\">\n            <span className=\"block truncate text-callout text-ink\">{it.label}</span>\n            {it.note && <span className=\"block truncate text-caption text-ink-3\">{it.note}</span>}\n          </span>\n          {it.trail && <span className=\"relative shrink-0\">{it.trail}</span>}\n        </button>\n      ))}\n    </motion.div>\n  )\n}\n\nexport function Popover({ onClose, children }: { onClose: () => void; children: ReactNode }) {\n  const box = useRef<HTMLDivElement>(null)\n  useEffect(() => {\n    const down = (e: PointerEvent) => !box.current?.parentElement?.contains(e.target as Node) && onClose()\n    const key = (e: KeyboardEvent) => e.key === 'Escape' && onClose()\n    window.addEventListener('pointerdown', down)\n    window.addEventListener('keydown', key)\n    return () => {\n      window.removeEventListener('pointerdown', down)\n      window.removeEventListener('keydown', key)\n    }\n  }, [onClose])\n  return <div ref={box}>{children}</div>\n}\n\nexport function Act({ label, on, onClick, children, className = '' }: { label: string; on?: boolean; onClick: () => void; children: ReactNode; className?: string }) {\n  return (\n    <motion.button type=\"button\" whileTap={press} aria-label={label} aria-pressed={on} title={label} onClick={onClick} className={`ring-focus flex size-8 items-center justify-center rounded-full transition-colors ease-detent duration-150 hover:bg-surface-2 hover:text-ink ${on ? 'text-ink' : ''} ${className}`}>\n      {children}\n    </motion.button>\n  )\n}\n\nexport function Status({ tone, children, live }: { tone: 'ok' | 'warn' | 'danger' | 'ink' | 'ai'; children: ReactNode; live?: Tone }) {\n  const c = tone === 'ok' ? 'var(--ok)' : tone === 'warn' ? 'var(--warn-ink)' : tone === 'danger' ? 'var(--danger)' : 'var(--ink-2)'\n  const bg = tone === 'ok' ? 'var(--ok)' : tone === 'warn' ? 'var(--warn)' : tone === 'danger' ? 'var(--danger)' : 'var(--ink)'\n  return (\n    <span className={`chip inline-flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 text-caption font-medium ${tone === 'ai' ? 'chip-plain' : ''}`} style={{ color: tone === 'ai' ? 'var(--ink-2)' : c, ['--chip' as string]: bg }}>\n      {tone === 'ai' ? <LiveDot tone={live ?? 'quiet'} /> : <span className=\"size-1.5 rounded-full\" style={{ background: bg }} />}\n      {children}\n    </span>\n  )\n}\n\nexport function useLatest<T>(v: T) {\n  const r = useRef(v)\n  useLayoutEffect(() => {\n    r.current = v\n  })\n  return r\n}\n\nexport const btn = {\n  primary: 'ring-focus inline-flex h-8 pointer-coarse:h-9 items-center justify-center gap-1.5 rounded-[7px] bg-ink px-3 text-footnote font-medium text-surface shadow-[inset_0_1px_0_rgb(255_255_255/0.14),0_1px_2px_rgb(0_0_0/0.18)] transition-opacity ease-detent hover:opacity-90 disabled:opacity-40',\n  secondary: 'lit ring-focus inline-flex h-8 pointer-coarse:h-9 items-center justify-center gap-1.5 rounded-[7px] bg-[color-mix(in_oklch,var(--ink)_5.5%,transparent)] px-3 text-footnote font-medium text-ink transition-colors ease-detent hover:bg-[color-mix(in_oklch,var(--ink)_9%,transparent)] disabled:text-ink-3',\n  ghost: 'ring-focus inline-flex h-8 pointer-coarse:h-9 items-center justify-center gap-1.5 rounded-[7px] px-2.5 text-footnote font-medium text-ink-2 transition-colors ease-detent hover:bg-surface-2 hover:text-ink',\n}\n\nexport const selectedRow = 'lit bg-[color-mix(in_oklch,var(--dt-accent)_11%,transparent)]'\nexport const selectedText = 'text-[var(--dt-accent-ink)]'\n"},{"path":"components/detent/blocks/kit/director.ts","target":"components/detent/blocks/kit/director.ts","type":"registry:block","content":"'use client'\n\nimport { createContext, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport type { PointerEvent } from 'react'\nimport { pressed } from '@/components/detent/lib/hand'\n\nexport const STOP = Symbol('stop')\nexport type Wait = (ms: number) => Promise<void>\n\nexport const InPlay = createContext(true)\n\nexport function useDirector(script: (wait: Wait, pass: number) => Promise<void>, autoplay = true, onTakeOver?: () => void) {\n  const play = useContext(InPlay)\n  const touched = useRef(!autoplay)\n  const latest = useRef(script)\n  useLayoutEffect(() => {\n    latest.current = script\n  })\n  const [begun, setBegun] = useState(play)\n  if (play && !begun) setBegun(true)\n  const gate = useRef(play)\n  const held = useRef<(() => void)[]>([])\n  useLayoutEffect(() => {\n    gate.current = play\n    if (!play) return\n    const resume = held.current\n    held.current = []\n    resume.forEach((go) => go())\n  }, [play])\n  useEffect(() => {\n    if (!autoplay || !begun) return\n    let on = true\n    const wait: Wait = (ms) =>\n      new Promise((r, x) => {\n        const go = () => (!on || touched.current ? x(STOP) : gate.current ? r() : held.current.push(go))\n        setTimeout(go, ms)\n      })\n    ;(async () => {\n      for (let pass = 0; ; pass++) await latest.current(wait, pass)\n    })().catch(() => {})\n    return () => {\n      on = false\n    }\n  }, [autoplay, begun])\n  const takeOver = () => {\n    if (!touched.current) onTakeOver?.()\n    touched.current = true\n  }\n  // Build the press handlers per event so takeOver is only handed over outside render.\n  const onPointerDownCapture = (e?: PointerEvent) => pressed(takeOver).onPointerDownCapture(e)\n  const onPointerUpCapture = (e?: PointerEvent) => pressed(takeOver).onPointerUpCapture(e)\n  return { onPointerDownCapture, onPointerUpCapture, onKeyDownCapture: takeOver, touched }\n}\n\nexport const sleeper = (ok: () => boolean) => (ms: number) => new Promise<void>((r, x) => setTimeout(() => (ok() ? r() : x(STOP)), ms))\n"},{"path":"components/detent/lib/hand.ts","target":"components/detent/lib/hand.ts","type":"registry:block","content":"import type { PointerEvent, RefObject } from 'react'\n\nconst HOLD = 3000\nconst CONTROL = 'button,a,input,textarea,select,label,[role=\"button\"],[role=\"tab\"],[role=\"option\"],[role=\"slider\"],[role=\"switch\"],[contenteditable],[draggable]'\nconst timers = new WeakMap<object, ReturnType<typeof setTimeout>>()\nlet downAt: [number, number] | null = null\n\nexport const hover = (held: RefObject<boolean>) => ({\n  onPointerEnter: (e: PointerEvent) => {\n    if (e.pointerType === 'touch') return\n    held.current = true\n    clearTimeout(timers.get(held))\n    timers.set(held, setTimeout(() => (held.current = false), HOLD))\n  },\n  onPointerLeave: () => {\n    clearTimeout(timers.get(held))\n    held.current = false\n  },\n})\n\nexport const pressed = (take: () => void) => ({\n  onPointerDownCapture: (e?: PointerEvent) => {\n    if (e?.pointerType === 'touch') downAt = [e.clientX, e.clientY]\n    else take()\n  },\n  onPointerUpCapture: (e?: PointerEvent) => {\n    if (e?.pointerType !== 'touch' || !downAt) return\n    const moved = Math.hypot(e.clientX - downAt[0], e.clientY - downAt[1]) > 10\n    downAt = null\n    if (moved || (e.target as Element).closest?.(CONTROL)) take()\n  },\n})\n"},{"path":"components/detent/ui/Intelligence.tsx","target":"components/detent/ui/Intelligence.tsx","type":"registry:block","content":"'use client'\n\nimport { useLayoutEffect, useRef, useState } from 'react'\nimport { AnimatePresence, motion } from 'motion/react'\nimport type { MotionStyle } from 'motion/react'\nimport { ease } from '@/components/detent/lib/motion'\n\nexport type Tone = 'loud' | 'quiet'\n\nconst ended = new Map<string, number>()\n\nexport function useTone(on: boolean, surface: string, rest = 120_000): Tone {\n  const [tone, setTone] = useState<Tone>('loud')\n  const was = useRef(false)\n  useLayoutEffect(() => {\n    if (on && !was.current) {\n      const last = ended.get(surface)\n      setTone(last === undefined || performance.now() - last > rest ? 'loud' : 'quiet')\n    }\n    if (!on && was.current) ended.set(surface, performance.now())\n    was.current = on\n    return () => {\n      if (was.current) ended.set(surface, performance.now())\n    }\n  }, [on, surface, rest])\n  return tone\n}\n\nexport function Glow({\n  on,\n  layer,\n  radius,\n  style,\n  className = '',\n  tone = 'loud',\n}: {\n  on: boolean\n  layer: 'halo' | 'ring'\n  radius: number | string\n  style?: MotionStyle\n  className?: string\n  tone?: Tone\n}) {\n  return (\n    <AnimatePresence>\n      {on && !(layer === 'halo' && tone === 'quiet') && (\n        <motion.span\n          aria-hidden\n          className={`${layer === 'halo' ? 'ai-halo' : 'ai-ring'} ${tone === 'quiet' ? 'ai-quiet' : ''} ${className}`}\n          style={{ borderRadius: radius, ...style }}\n          initial={{ opacity: 0 }}\n          animate={{ opacity: 1, transition: { duration: 0.5, ease: ease.out } }}\n          exit={{ opacity: 0, transition: { duration: 0.9, ease: [0.4, 0, 0.2, 1] } }}\n        />\n      )}\n    </AnimatePresence>\n  )\n}\n\nconst INKS = ['var(--ai-ink-1)', 'var(--ai-ink-2)', 'var(--ai-ink-3)', 'var(--ai-ink-4)']\n\nexport const aiInk = (t: number) => {\n  const x = Math.min(0.9999, Math.max(0, t)) * (INKS.length - 1)\n  const k = Math.floor(x)\n  const f = Math.round((x - k) * 100)\n  return `color-mix(in oklch, ${INKS[k]} ${100 - f}%, ${INKS[k + 1]})`\n}\n\nexport const aiWord = (n: number) => INKS[n % INKS.length]\n\nexport const aiText = (tone: Tone) => (tone === 'loud' ? 'ai-text' : 'ai-text ai-quiet')\nexport const aiWords = (tone: Tone) => (tone === 'loud' ? 'word-in ai-warm' : 'word-in')\n"},{"path":"components/detent/ui/Hover.tsx","target":"components/detent/ui/Hover.tsx","type":"registry:block","content":"'use client'\n\nimport { useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { motion } from 'motion/react'\nimport { ease } from '@/components/detent/lib/motion'\n\nexport function Hover({ children, className = '', radius = 7, as: Tag = 'div', label }: { children: ReactNode; className?: string; radius?: number; as?: 'div' | 'nav' | 'ul'; label?: string }) {\n  const box = useRef<HTMLElement>(null)\n  const [at, setAt] = useState<{ x: number; y: number; w: number; h: number; jump: boolean } | null>(null)\n  const move = (e: React.PointerEvent) => {\n    const el = box.current\n    const row = (e.target as HTMLElement).closest('[data-row]') as HTMLElement | null\n    if (!el || !row || !el.contains(row)) return\n    const b = el.getBoundingClientRect()\n    const r = row.getBoundingClientRect()\n    const s = b.width / (el.offsetWidth || b.width || 1)\n    const next = { x: (r.left - b.left) / s + el.scrollLeft, y: (r.top - b.top) / s + el.scrollTop, w: r.width / s, h: r.height / s }\n    setAt((a) => (a && a.x === next.x && a.y === next.y && a.w === next.w && a.h === next.h ? a : { ...next, jump: !a }))\n  }\n  const leave = () => setAt(null)\n  const instant = !at || at.jump\n  return (\n    <Tag ref={box as never} aria-label={label} className={`relative ${className}`} onPointerMove={move} onPointerLeave={leave}>\n      <motion.span\n        aria-hidden\n        className=\"pointer-events-none absolute left-0 top-0 bg-[color-mix(in_oklch,var(--ink)_5%,transparent)]\"\n        style={{ borderRadius: radius }}\n        initial={false}\n        animate={at ? { x: at.x, y: at.y, width: at.w, height: at.h, opacity: 1 } : { opacity: 0 }}\n        transition={instant ? { duration: 0, opacity: { duration: 0.12, ease: ease.out } } : { type: 'spring', stiffness: 620, damping: 46, opacity: { duration: 0.12, ease: ease.out } }}\n      />\n      {children}\n    </Tag>\n  )\n}\n"}],"docs":"Usage, props and when to use it: https://detentui.com/blocks/faq.md . Wrap your root layout once in <MotionConfig reducedMotion=\"user\"> from motion/react so the motion respects reduced-motion settings.","meta":{"tier":"free","docs":"https://detentui.com/blocks/faq.md"}}