{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"ui-callout","type":"registry:component","title":"UI Callout","description":"Callout cards route to targets on a product screen with connecting leader lines.","dependencies":["remotion","@remotion/google-fonts"],"docs":"Needs a Remotion project. If a frame renders black, the component is drawing on a transparent layer: put a background behind it, e.g. <AbsoluteFill style={{ background: \"#faf9f6\" }}><Component /></AbsoluteFill>.","registryDependencies":["https://kuchi.kalarislabs.com/r/gradient-ground.json"],"files":[{"path":"components/kuchi/ui-callout.tsx","type":"registry:component","target":"components/kuchi/ui-callout.tsx","content":"/*! Portions Copyright (c) 2026 Remocn. MIT License. See THIRD_PARTY_LICENSES. */\n\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/InstrumentSans\";\nimport type React from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  Img,\n  interpolate,\n  spring,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/kuchi/gsh/gradient-engine\";\nimport { GshGround } from \"@/lib/kuchi/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/kuchi/gsh/presets\";\n\nconst { fontFamily } = loadFont(\"normal\", {\n  weights: [\"400\"],\n  subsets: [\"latin\"],\n});\n\nexport type CalloutSide = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface Callout {\n  x: number;\n  y: number;\n  title: string;\n  body?: string;\n  side?: CalloutSide;\n  delay?: number;\n}\n\nexport interface UiCalloutProps {\n  callouts?: Callout[];\n  variant?: \"tooltip\" | \"pill\";\n  src?: string;\n  children?: React.ReactNode;\n  screenshotWidth?: number;\n  screenshotHeight?: number;\n  stagger?: number;\n  /** Button label on every card but the last. */\n  nextLabel?: string;\n  /** Button label on the last card. */\n  doneLabel?: string;\n  theme?: \"light\" | \"dark\";\n  accent?: string;\n  /** Text color of the callout titles; overrides the theme. */\n  ink?: string;\n  /** Solid fill in place of the gradient ground; \"transparent\" drops it. */\n  background?: string;\n  /** Typeface for the callouts. Load it yourself; Instrument Sans by default. */\n  fontFamily?: string;\n  /** Replaces the acme mark in the built-in mock's workspace switcher. */\n  logo?: React.ReactNode;\n  /** Size of the foreground around the frame's center. */\n  scale?: number;\n  /** Frames to hold the first frame before anything moves. */\n  delay?: number;\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n  speed?: number;\n}\n\nconst DEFAULT_CALLOUTS: Callout[] = [\n  {\n    x: 358,\n    y: 113,\n    title: \"Status at a glance\",\n    body: \"Every issue carries its state, from Backlog to Done.\",\n    side: \"bottom\",\n  },\n  {\n    x: 1333,\n    y: 153,\n    title: \"Owners and due dates\",\n    body: \"A name and a date on every row, so nothing slips.\",\n    side: \"bottom\",\n  },\n  {\n    x: 40,\n    y: 342,\n    title: \"Ship in cycles\",\n    body: \"Unfinished work rolls into the next cycle on its own.\",\n    side: \"bottom\",\n  },\n];\n\n\nconst INTRO = 14;\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst CAMERA = Easing.bezier(0.87, 0, 0.13, 1);\nconst HEAVY = { mass: 1, damping: 26, stiffness: 120 };\nconst CARD = { mass: 0.8, damping: 18, stiffness: 160 };\nconst CHIP = { mass: 0.5, damping: 12, stiffness: 200 };\nconst MORPH = { damping: 200 };\nconst clamp = (v: number, lo: number, hi: number) =>\n  Math.min(hi, Math.max(lo, v));\n\nfunction withAlpha(color: string, alpha: number) {\n  const hex = color.replace(\"#\", \"\");\n  const full = hex.length === 3 ? hex.replace(/(.)/g, \"$1$1\") : hex;\n  if (!/^[0-9a-fA-F]{6}$/.test(full)) return color;\n  const n = Number.parseInt(full, 16);\n  return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`;\n}\n\ninterface Pt {\n  x: number;\n  y: number;\n}\ninterface Box {\n  x: number;\n  y: number;\n  w: number;\n  h: number;\n}\ninterface Route {\n  start: Pt;\n  elbow: Pt;\n  end: Pt;\n  card: Box;\n  attach: \"left\" | \"right\" | \"top\" | \"bottom\";\n}\n\nconst DIRS: Record<CalloutSide, Pt> = {\n  top: { x: 0, y: -1 },\n  bottom: { x: 0, y: 1 },\n  left: { x: -1, y: 0 },\n  right: { x: 1, y: 0 },\n};\n\nfunction buildRoute(\n  t: Pt,\n  side: CalloutSide,\n  l1: number,\n  turn: 1 | -1,\n  size: { w: number; h: number },\n  u: number,\n): Route {\n  const d = DIRS[side];\n  const start = { x: t.x + d.x * 17 * u, y: t.y + d.y * 17 * u };\n  const elbow = { x: start.x + d.x * l1, y: start.y + d.y * l1 };\n  const vertical = side === \"top\" || side === \"bottom\";\n  const l2 = (vertical ? 36 : 30) * u;\n  const end = vertical\n    ? { x: elbow.x + turn * l2, y: elbow.y }\n    : { x: elbow.x, y: elbow.y + turn * l2 };\n  if (vertical) {\n    const x = turn === 1 ? end.x : end.x - size.w;\n    return {\n      start,\n      elbow,\n      end,\n      card: { x, y: end.y - size.h / 2, ...size },\n      attach: turn === 1 ? \"left\" : \"right\",\n    };\n  }\n  const x = d.x === 1 ? end.x - 26 * u : end.x - size.w + 26 * u;\n  const y = turn === 1 ? end.y : end.y - size.h;\n  return {\n    start,\n    elbow,\n    end,\n    card: { x, y, ...size },\n    attach: turn === 1 ? \"top\" : \"bottom\",\n  };\n}\n\nconst overlaps = (a: Box, b: Box, m: number) =>\n  a.x < b.x + b.w + m &&\n  b.x < a.x + a.w + m &&\n  a.y < b.y + b.h + m &&\n  b.y < a.y + a.h + m;\n\nfunction routeAll(\n  targets: Pt[],\n  callouts: Callout[],\n  sizes: { w: number; h: number }[],\n  W: number,\n  H: number,\n  u: number,\n): Route[] {\n  const placed: Route[] = [];\n  targets.forEach((t, i) => {\n    const towardCenter: 1 | -1 = t.x < W / 2 ? 1 : -1;\n    const sides: CalloutSide[] = callouts[i].side\n      ? [callouts[i].side as CalloutSide]\n      : t.y < H / 2\n        ? [\"bottom\", \"top\", \"right\", \"left\"]\n        : [\"top\", \"bottom\", \"right\", \"left\"];\n    const turns: (1 | -1)[] = [towardCenter, towardCenter === 1 ? -1 : 1];\n    let best: Route | null = null;\n    search: for (const side of sides) {\n      for (const turn of turns) {\n        for (const l1 of [56, 96, 136, 176]) {\n          const r = buildRoute(\n            t,\n            side,\n            l1 * u,\n            side === \"left\" || side === \"right\" ? 1 : turn,\n            sizes[i],\n            u,\n          );\n          const c = r.card;\n          const m = 16 * u;\n          if (c.x < m || c.y < m || c.x + c.w > W - m || c.y + c.h > H - m)\n            continue;\n          if (placed.some((p) => overlaps(p.card, c, 12 * u))) continue;\n          if (\n            targets.some((p) =>\n              overlaps(\n                { x: p.x - 20 * u, y: p.y - 20 * u, w: 40 * u, h: 40 * u },\n                c,\n                0,\n              ),\n            )\n          )\n            continue;\n          best = r;\n          break search;\n        }\n      }\n    }\n    placed.push(\n      best ?? buildRoute(t, sides[0], 56 * u, towardCenter, sizes[i], u),\n    );\n  });\n  return placed;\n}\n\nfunction routeTall(\n  targets: Pt[],\n  sizes: { w: number; h: number }[],\n  slotTop: number,\n  stack: boolean,\n  W: number,\n  u: number,\n): Route[] {\n  let y = slotTop;\n  return targets.map((t, i) => {\n    const size = sizes[i];\n    const turn: 1 | -1 = t.x < W / 2 ? 1 : -1;\n    const start = { x: t.x, y: t.y + 17 * u };\n    const cy = y + size.h / 2;\n    if (stack) y += size.h + 14 * u;\n    const elbow = { x: t.x, y: cy };\n    const end = { x: t.x + turn * 30 * u, y: cy };\n    const m = 40 * u;\n    const x =\n      turn === 1\n        ? Math.min(end.x, W - m - size.w)\n        : Math.max(m, end.x - size.w);\n    return {\n      start,\n      elbow,\n      end,\n      card: { x, y: cy - size.h / 2, ...size },\n      attach: turn === 1 ? \"left\" : \"right\",\n    };\n  });\n}\n\nconst disc = { position: \"absolute\", inset: 0, borderRadius: 999 } as const;\n\nfunction Ring({\n  local,\n  accent,\n  dark,\n  u,\n  fps,\n  rest = 0,\n}: {\n  local: number;\n  accent: string;\n  dark: boolean;\n  u: number;\n  fps: number;\n  rest?: number;\n}) {\n  const pop = spring({ frame: local, fps, config: CHIP });\n  const phase = ((((local - 8) % 48) + 48) % 48) / 48;\n  const size = 24 * u;\n  return (\n    <div\n      style={{\n        position: \"absolute\",\n        left: -size / 2,\n        top: -size / 2,\n        width: size,\n        height: size,\n        opacity: 1 - 0.45 * rest,\n        transform: `scale(${1 - 0.25 * rest})`,\n      }}\n    >\n      {local > 8 && rest < 1 && (\n        <div\n          style={{\n            ...disc,\n            background: withAlpha(accent, 0.3),\n            transform: `scale(${1 + ENTER(phase) * 1.1})`,\n            opacity: (1 - phase) * (1 - rest),\n          }}\n        />\n      )}\n      <div\n        style={{\n          ...disc,\n          background: withAlpha(accent, 0.16),\n          boxShadow: `inset 0 0 0 ${1.5 * u}px ${withAlpha(accent, 0.55)}`,\n          transform: `scale(${interpolate(pop, [0, 1], [0.4, 1])})`,\n          opacity: clamp(pop * 2, 0, 1),\n          ...center,\n        }}\n      >\n        <div\n          style={{\n            width: 10 * u,\n            height: 10 * u,\n            borderRadius: 999,\n            background: accent,\n            boxShadow: `0 0 0 ${2 * u}px ${dark ? \"#161618\" : \"#FFFFFF\"}`,\n          }}\n        />\n      </div>\n    </div>\n  );\n}\n\nfunction wipeClip(attach: Route[\"attach\"], p: number, r: number) {\n  const hidden = `calc(${(1 - p) * 100}% - ${p * 48}px)`;\n  const out = \"-48px\";\n  if (attach === \"left\")\n    return `inset(${out} ${hidden} ${out} ${out} round ${r}px)`;\n  if (attach === \"right\")\n    return `inset(${out} ${out} ${out} ${hidden} round ${r}px)`;\n  if (attach === \"top\")\n    return `inset(${out} ${out} ${hidden} ${out} round ${r}px)`;\n  return `inset(${hidden} ${out} ${out} ${out} round ${r}px)`;\n}\n\n/** The foreground at `scale`, around the frame's center; nothing extra at 1. */\nfunction ScaleLayer({\n  scale,\n  children,\n}: {\n  scale: number;\n  children: React.ReactNode;\n}) {\n  if (scale === 1) return children;\n  return (\n    <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n      {children}\n    </AbsoluteFill>\n  );\n}\n\nexport function UiCallout({\n  callouts = DEFAULT_CALLOUTS,\n  variant = \"tooltip\",\n  src,\n  children,\n  screenshotWidth = MOCK_W,\n  screenshotHeight = MOCK_H,\n  stagger = 30,\n  nextLabel = \"Next\",\n  doneLabel = \"Got it\",\n  theme = \"light\",\n  accent = \"#3B5BFD\",\n  ink,\n  background,\n  fontFamily: font = fontFamily,\n  logo,\n  scale = 1,\n  delay = 0,\n  ground,\n  groundParams,\n  speed = 1,\n}: UiCalloutProps) {\n  const frame = Math.max(0, useCurrentFrame() - delay) * speed;\n  const { width: W, height: H, fps } = useVideoConfig();\n  const tall = H > W;\n  const u = tall ? W / 660 : Math.min(W / 1280, H / 720);\n  const dark = theme === \"dark\";\n  const pill = variant === \"pill\";\n  const sw = screenshotWidth;\n  const sh = screenshotHeight;\n  const resolvedGround: GshPresetId | undefined =\n    ground ??\n    (groundParams ? undefined : dark ? \"cobalt-rise\" : \"paper-crease\");\n\n  const cardW = 330 * u;\n  const sizes = callouts.map((c) => {\n    if (pill) return { w: (c.title.length * 9.2 + 56) * u, h: 44 * u };\n    const lines = c.body ? Math.ceil(c.body.length / 34) : 0;\n    return { w: cardW, h: (118 + lines * 23) * u };\n  });\n  const maxCard = Math.max(...sizes.map((z) => z.h));\n  const stackH = pill\n    ? sizes.reduce((a, z) => a + z.h + 14 * u, -14 * u)\n    : maxCard;\n\n  const s = ((tall ? 0.92 : 0.74) * W) / sw;\n  const left = (W - sw * s) / 2;\n  const winH = sh * s;\n  const gapBelow = 56 * u;\n  const top = tall ? (H - (winH + gapBelow + stackH)) / 2 : (H - winH) / 2;\n  const radius = 12 / s;\n  const enter = spring({ frame: frame + 2, fps, config: HEAVY });\n\n  const targets = callouts.map((c) => ({\n    x: left + c.x * s,\n    y: top + c.y * s,\n  }));\n  const routes = tall\n    ? routeTall(targets, sizes, top + winH + gapBelow, pill, W, u)\n    : routeAll(targets, callouts, sizes, W, H, u);\n  const starts = callouts.map((c, i) => c.delay ?? INTRO + i * stagger);\n  const foldAt = (i: number) =>\n    starts[i + 1] === undefined\n      ? 0\n      : spring({\n          frame: frame - starts[i + 1] - 16,\n          fps,\n          config: MORPH,\n        });\n  const drift =\n    1 + 0.03 * CAMERA(clamp(frame / (starts[starts.length - 1] + 70), 0, 1));\n\n  const content = src ? (\n    <Img\n      src={src}\n      style={{ width: sw, height: sh, objectFit: \"cover\", display: \"block\" }}\n    />\n  ) : (\n    (children ?? (\n      <IssuesMock\n        theme={theme}\n        accent={accent}\n        width={sw}\n        height={sh}\n        logo={logo}\n      />\n    ))\n  );\n\n  const card = dark\n    ? {\n        bg: \"#1C1D21\",\n        depth: `0 0 0 1px rgba(255,255,255,0.1), 0 ${18 * u}px ${44 * u}px -${10 * u}px rgba(0,0,0,0.7)`,\n        title: \"#F3F3F5\",\n        body: \"rgba(243,243,245,0.62)\",\n        dotOff: \"rgba(255,255,255,0.18)\",\n        btnBg: \"#F3F3F5\",\n        btnInk: \"#121316\",\n      }\n    : {\n        bg: \"#FFFFFF\",\n        depth: `0 0 0 1px rgba(16,24,40,0.07), 0 ${2 * u}px ${4 * u}px rgba(16,24,40,0.05), 0 ${18 * u}px ${44 * u}px -${10 * u}px rgba(16,24,40,0.22)`,\n        title: \"#141518\",\n        body: \"rgba(20,21,24,0.62)\",\n        dotOff: \"rgba(20,21,24,0.16)\",\n        btnBg: \"#141518\",\n        btnInk: \"#FFFFFF\",\n      };\n  const cardR = 14 * u;\n\n  const pillEl = (c: Callout, attach: Route[\"attach\"]) => (\n    <div\n      style={{\n        height: 44 * u,\n        boxSizing: \"border-box\",\n        ...row,\n        gap: 10 * u,\n        padding: `0 ${18 * u}px 0 ${15 * u}px`,\n        borderRadius: 999,\n        background: dark ? \"#F4F4F6\" : \"#16171B\",\n        color: ink ?? (dark ? \"#121316\" : \"#F7F7F8\"),\n        fontSize: 18 * u,\n        fontWeight: 400,\n        letterSpacing: \"-0.01em\",\n        whiteSpace: \"nowrap\",\n        width: \"fit-content\",\n        marginLeft: attach === \"right\" ? \"auto\" : undefined,\n        boxShadow: dark\n          ? `0 ${10 * u}px ${28 * u}px -${6 * u}px rgba(0,0,0,0.55)`\n          : `0 ${2 * u}px ${4 * u}px rgba(16,24,40,0.12), 0 ${10 * u}px ${24 * u}px -${6 * u}px rgba(16,24,40,0.28)`,\n      }}\n    >\n      <span\n        style={{\n          width: 8 * u,\n          height: 8 * u,\n          borderRadius: 9,\n          background: accent,\n          flexShrink: 0,\n        }}\n      />\n      {c.title}\n    </div>\n  );\n\n  const cardEl = (c: Callout, i: number, textOp: number) => (\n    <div\n      style={{\n        background: card.bg,\n        borderRadius: cardR,\n        padding: `${18 * u}px ${18 * u}px ${16 * u}px`,\n        boxShadow: card.depth,\n      }}\n    >\n      <div\n        style={{\n          opacity: textOp,\n          transform: `translateY(${(1 - textOp) * 6 * u}px)`,\n        }}\n      >\n        <div\n          style={{\n            fontSize: 21 * u,\n            lineHeight: 1.25,\n            fontWeight: 400,\n            color: ink ?? card.title,\n            letterSpacing: \"-0.02em\",\n          }}\n        >\n          {c.title}\n        </div>\n        {c.body && (\n          <div\n            style={{\n              marginTop: 6 * u,\n              fontSize: 16.5 * u,\n              lineHeight: 1.42,\n              color: card.body,\n              textWrap: \"pretty\",\n            }}\n          >\n            {c.body}\n          </div>\n        )}\n        <div\n          style={{\n            marginTop: 16 * u,\n            ...row,\n            justifyContent: \"space-between\",\n          }}\n        >\n          <div style={{ ...row, gap: 6 * u }}>\n            {callouts.map((d, j) => (\n              <span\n                key={`${d.title}-dot`}\n                style={{\n                  width: j === i ? 18 * u : 6 * u,\n                  height: 6 * u,\n                  borderRadius: 6 * u,\n                  background: j === i ? accent : card.dotOff,\n                }}\n              />\n            ))}\n          </div>\n          <span\n            style={{\n              height: 34 * u,\n              padding: `0 ${14 * u}px`,\n              borderRadius: cardR - 6 * u,\n              background: card.btnBg,\n              color: card.btnInk,\n              fontSize: 16 * u,\n              fontWeight: 400,\n              ...row,\n            }}\n          >\n            {i === callouts.length - 1 ? doneLabel : nextLabel}\n          </span>\n        </div>\n      </div>\n    </div>\n  );\n\n  return (\n    <AbsoluteFill\n      style={{\n        fontFamily: font,\n        overflow: \"hidden\",\n        WebkitFontSmoothing: \"antialiased\",\n        background: background ?? (dark ? \"#02040A\" : \"#EEECE8\"),\n      }}\n    >\n      {background === undefined ? (\n        <GshGround\n          preset={resolvedGround}\n          params={groundParams}\n          timeOffset={dark ? 3 : 6}\n          timeScale={0.4}\n        />\n      ) : null}\n      <ScaleLayer scale={scale}>\n        <AbsoluteFill style={{ transform: `scale(${drift})` }}>\n          <div\n            style={{\n              position: \"absolute\",\n              left,\n              top,\n              width: sw,\n              height: sh,\n              transformOrigin: \"0 0\",\n              transform: `translateY(${(1 - enter) * 40 * u}px) scale(${s})`,\n              opacity: clamp(enter * 2, 0, 1),\n              borderRadius: radius,\n              overflow: \"hidden\",\n              boxShadow: dark\n                ? `0 0 0 ${1 / s}px rgba(255,255,255,0.1), 0 ${30 / s}px ${70 / s}px -${14 / s}px rgba(0,0,0,0.7)`\n                : `0 0 0 ${1 / s}px rgba(16,24,40,0.08), 0 ${2 / s}px ${4 / s}px rgba(16,24,40,0.05), 0 ${30 / s}px ${70 / s}px -${14 / s}px rgba(16,24,40,0.24)`,\n            }}\n          >\n            {content}\n          </div>\n          <svg\n            width={W}\n            height={H}\n            style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n            aria-hidden\n          >\n            {routes.map((r, i) => {\n              const p =\n                MOVE(clamp((frame - starts[i] - 6) / 11, 0, 1)) *\n                (pill ? 1 : 1 - foldAt(i));\n              if (p <= 0) return null;\n              const k = 10 * u;\n              const a = {\n                x: r.elbow.x - Math.sign(r.elbow.x - r.start.x) * k,\n                y: r.elbow.y - Math.sign(r.elbow.y - r.start.y) * k,\n              };\n              const b = {\n                x: r.elbow.x + Math.sign(r.end.x - r.elbow.x) * k,\n                y: r.elbow.y + Math.sign(r.end.y - r.elbow.y) * k,\n              };\n              return (\n                <path\n                  key={`line-${callouts[i].title}`}\n                  d={`M ${r.start.x} ${r.start.y} L ${a.x} ${a.y} Q ${r.elbow.x} ${r.elbow.y} ${b.x} ${b.y} L ${r.end.x} ${r.end.y}`}\n                  pathLength={1}\n                  strokeDasharray=\"1 1\"\n                  strokeDashoffset={1 - p}\n                  stroke={accent}\n                  strokeWidth={1.75 * u}\n                  strokeLinecap=\"round\"\n                  fill=\"none\"\n                />\n              );\n            })}\n          </svg>\n          {routes.map((r, i) => {\n            const c = callouts[i];\n            const local = frame - starts[i];\n            if (local < 0) return null;\n            const wipe = spring({ frame: local - 15, fps, config: CARD });\n            const textIn = interpolate(local, [19, 31], [0, 1], {\n              extrapolateLeft: \"clamp\",\n              extrapolateRight: \"clamp\",\n              easing: ENTER,\n            });\n            const fold = pill ? 0 : foldAt(i);\n            const side = r.attach === \"left\" || r.attach === \"right\";\n            const origin = {\n              left: \"0% 50%\",\n              right: \"100% 50%\",\n              top: \"50% 0%\",\n              bottom: \"50% 100%\",\n            }[r.attach];\n            const slide =\n              (1 - textIn) * 6 * u * (r.attach === \"right\" ? -1 : 1);\n            return (\n              <div key={`${c.title}-${c.x}-${c.y}`}>\n                <div\n                  style={{\n                    position: \"absolute\",\n                    left: targets[i].x,\n                    top: targets[i].y,\n                  }}\n                >\n                  <Ring\n                    local={local}\n                    accent={accent}\n                    dark={dark}\n                    u={u}\n                    fps={fps}\n                    rest={fold}\n                  />\n                </div>\n                {wipe > 0.001 && fold < 0.999 && (\n                  <div\n                    style={{\n                      position: \"absolute\",\n                      left: r.card.x,\n                      top: side ? r.end.y : r.card.y,\n                      width: r.card.w,\n                      transform: side ? \"translateY(-50%)\" : undefined,\n                      clipPath: wipeClip(\n                        r.attach,\n                        Math.min(1, wipe),\n                        pill ? 22 * u : cardR,\n                      ),\n                    }}\n                  >\n                    <div\n                      style={{\n                        opacity:\n                          (pill ? textIn : 1) * (1 - clamp(fold * 3, 0, 1)),\n                        transformOrigin: origin,\n                        transform: `translateX(${slide}px) scale(${1 - 0.08 * fold})`,\n                      }}\n                    >\n                      {pill ? pillEl(c, r.attach) : cardEl(c, i, textIn)}\n                    </div>\n                  </div>\n                )}\n              </div>\n            );\n          })}\n        </AbsoluteFill>\n      </ScaleLayer>\n    </AbsoluteFill>\n  );\n}\n\ntype MockTheme = \"light\" | \"dark\";\ntype Status = \"progress\" | \"todo\" | \"backlog\" | \"done\";\nconst MOCK_W = 1440;\nconst MOCK_H = 900;\nconst SB = 232;\n\nconst PAL_KEYS = [\n  \"app\",\n  \"panel\",\n  \"border\",\n  \"hair\",\n  \"group\",\n  \"text\",\n  \"sub\",\n  \"faint\",\n  \"active\",\n  \"chip\",\n] as const;\ntype Pal = Record<(typeof PAL_KEYS)[number], string>;\nconst pal = (hexes: string) =>\n  Object.fromEntries(hexes.split(\" \").map((h, i) => [PAL_KEYS[i], h])) as Pal;\nconst MOCK_COLORS: Record<MockTheme, Pal> = {\n  light: pal(\n    \"#F4F4F5 #FFFFFF #E5E5E8 #F1F1F3 #F7F7F8 #1B1C1F #62656D #A1A4AB #E7E7EA #E3E3E6\",\n  ),\n  dark: pal(\n    \"#0E0E10 #161618 #252528 #1E1E21 #1C1C1F #E6E6E8 #8D9098 #5F626A #222226 #2C2C30\",\n  ),\n};\nconst row = { display: \"flex\", alignItems: \"center\" } as const;\nconst center = { ...row, justifyContent: \"center\" } as const;\n\nconst GLYPHS: Record<string, string> = {\n  inbox: \"M2.5 9.5h3l1 1.5h3l1-1.5h3M4 3.5h8l1.5 6V13h-11V9.5z\",\n  user: \"M8 8.5a2.75 2.75 0 1 0 0-5.5 2.75 2.75 0 0 0 0 5.5zM3 13.5c.9-2.2 2.8-3.2 5-3.2s4.1 1 5 3.2\",\n  cube: \"M8 1.8l5.5 3v6.4L8 14.2l-5.5-3V4.8zM2.5 4.8L8 7.8l5.5-3M8 7.8v6.4\",\n  layers: \"M8 2l6 3-6 3-6-3zM2 8.2l6 3 6-3M2 11.2l6 3 6-3\",\n  more: \"M3.5 8h.01M8 8h.01M12.5 8h.01\",\n  issues: \"M8 2.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11zM5.6 8l1.7 1.7 3.1-3.3\",\n  cycle: \"M13 8a5 5 0 1 1-1.6-3.7M13.2 2.6v2.6h-2.6\",\n  download: \"M8 2.5v7.5M5 7l3 3 3-3M3 12.5h10\",\n  invite:\n    \"M6 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM1.5 13.5c.6-2 2.3-3 4.5-3s3.9 1 4.5 3M12.5 5v4M10.5 7h4\",\n  link: \"M6.8 9.2l2.4-2.4M7.2 4.6l1-1a2.6 2.6 0 0 1 3.7 3.7l-1 1M8.8 11.4l-1 1a2.6 2.6 0 0 1-3.7-3.7l1-1\",\n  search: \"M7 11.5a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9zM10.4 10.4L14 14\",\n  compose: \"M7.5 2.5H3.5v10h10v-4M12.2 2.3l1.5 1.5-5.6 5.6-2 .5.5-2z\",\n  filter: \"M2.5 4.5h11M4.5 8h7M6.5 11.5h3\",\n  display: \"M2.5 5h6M11.5 5h2M2.5 11h2M7.5 11h6M10 3.5v3M6 9.5v3\",\n  chevron: \"M5 6.5l3 3 3-3\",\n  plus: \"M8 3.5v9M3.5 8h9\",\n  sun: \"M8 10.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 1.5V3M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1\",\n  moon: \"M13.2 9.6A5.5 5.5 0 0 1 6.4 2.8a5.5 5.5 0 1 0 6.8 6.8z\",\n};\n\nfunction Glyph({\n  name,\n  size = 16,\n  color,\n}: {\n  name: string;\n  size?: number;\n  color: string;\n}) {\n  return (\n    <svg\n      width={size}\n      height={size}\n      viewBox=\"0 0 16 16\"\n      fill=\"none\"\n      style={{ flexShrink: 0 }}\n    >\n      <path\n        d={GLYPHS[name]}\n        stroke={color}\n        strokeWidth={1.4}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n\nfunction StatusIcon({\n  status,\n  accent,\n  c,\n}: {\n  status: Status;\n  accent: string;\n  c: Pal;\n}) {\n  const col = {\n    progress: \"#E8B100\",\n    todo: c.faint,\n    backlog: c.faint,\n    done: accent,\n  }[status];\n  const done = status === \"done\";\n  return (\n    <svg width={14} height={14} viewBox=\"0 0 14 14\" style={{ flexShrink: 0 }}>\n      <circle\n        cx={7}\n        cy={7}\n        r={done ? 6.5 : 5.8}\n        fill={done ? col : \"none\"}\n        stroke={done ? \"none\" : col}\n        strokeWidth={1.5}\n        strokeDasharray={status === \"backlog\" ? \"1.4 1.6\" : undefined}\n      />\n      {done && (\n        <path\n          d=\"M4.3 7.2l1.8 1.8 3.6-3.8\"\n          stroke=\"#fff\"\n          strokeWidth={1.5}\n          fill=\"none\"\n        />\n      )}\n      {status === \"progress\" && (\n        <path d=\"M7 3.6A3.4 3.4 0 0 1 7 10.4Z\" fill={col} />\n      )}\n    </svg>\n  );\n}\n\nfunction PriorityIcon({ p, c }: { p: number; c: Pal }) {\n  return (\n    <svg width={14} height={14} viewBox=\"0 0 14 14\" style={{ flexShrink: 0 }}>\n      {p === 4 && (\n        <rect x={0.5} y={0.5} width={13} height={13} rx={3} fill=\"#F2683C\" />\n      )}\n      {p === 4 && (\n        <path\n          d=\"M7 3.5v4.2M7 10.2v.1\"\n          stroke=\"#fff\"\n          strokeWidth={1.8}\n          strokeLinecap=\"round\"\n        />\n      )}\n      {p === 0 &&\n        [2.5, 7, 11.5].map((x) => (\n          <circle key={x} cx={x} cy={7} r={1.1} fill={c.faint} />\n        ))}\n      {p > 0 &&\n        p < 4 &&\n        [0, 1, 2].map((i) => (\n          <rect\n            key={i}\n            x={1.5 + i * 4}\n            y={9 - i * 3}\n            width={3}\n            height={4 + i * 3}\n            rx={0.8}\n            fill={i < p ? c.sub : c.chip}\n          />\n        ))}\n    </svg>\n  );\n}\n\nconst TINTS = [\n  \"#E0795B\",\n  \"#5B8DEF\",\n  \"#9B6BDF\",\n  \"#3FA47A\",\n  \"#D9A23B\",\n  \"#D9608F\",\n];\n\nfunction Avatar({ name, size = 20 }: { name?: string; size?: number }) {\n  const tint = name\n    ? TINTS[(name.charCodeAt(0) + name.length) % TINTS.length]\n    : \"\";\n  return (\n    <div\n      style={{\n        ...center,\n        width: size,\n        height: size,\n        flexShrink: 0,\n        boxSizing: \"border-box\",\n        borderRadius: size,\n        border: name ? undefined : \"1.3px dashed #9A9DA4\",\n        background: name\n          ? `linear-gradient(140deg, ${tint}, ${tint}B0)`\n          : undefined,\n        color: \"#fff\",\n        fontSize: size * 0.42,\n        fontWeight: 400,\n      }}\n    >\n      {name?.split(\" \").map((w) => w[0])}\n    </div>\n  );\n}\n\nconst LABEL_COLORS: Record<string, string> = Object.fromEntries(\n  \"Feature:#8B5CF6 Bug:#EF4444 Motion:#0EA5E9 Docs:#3B82F6 Infra:#F97316 Captions:#EC4899 Marketing:#22C55E Research:#A1A1AA\"\n    .split(\" \")\n    .map((kv) => kv.split(\":\")),\n);\n\nconst ISSUE_DATA = `\n#progress|In Progress|4\nACM-142|4|Spring presets for page transitions|Feature,Motion|v1.4 Launch|Maya Chen|Oct 28\nACM-139|3|Fix flicker in zoom-blur at 60fps|Bug|Transitions|Leo Park|Oct 26\nACM-137|2|Docs: theme-flip props and examples|Docs|v1.4 Launch|Priya Raman|Oct 30\nACM-131|1|Render queue retries for long templates|Infra||Jonah Reyes|Nov 2\n#todo|Todo|5\nACM-148|3|Caption timing editor in Studio|Feature,Captions|Captions|Maya Chen|Nov 4\nACM-146|1|Add Lumen and Fernway to the logo wall|Marketing||Ava Kim|Nov 5\nACM-145|2|Export presets for 9:16 and 1:1|Feature|v1.4 Launch|Leo Park|Nov 6\nACM-144|2|Audit spring damping across primitives|Motion||Priya Raman|Nov 8\n#backlog|Backlog|3\nACM-151|0|Lottie import for the icon set|Research|||\nACM-150|1|Keyboard shortcuts cheat sheet|Docs||Ava Kim|\nACM-149|0|Audio-reactive backgrounds|Research,Motion|||\n#done|Done|17\nACM-128|3|Ship captions tab with 31 styles|Feature,Captions|Captions|Maya Chen|Oct 21\nACM-127|2|Build registry artifacts in CI|Infra||Jonah Reyes|Oct 20\nACM-125|1|Sponsors page with tiers|Marketing||Ava Kim|Oct 18\nACM-121|2|Zoom blur transition|Motion|Transitions|Leo Park|Oct 15\nACM-119|3|Agent-readable docs for every component|Docs||Priya Raman|Oct 12\nACM-117|2|Remotion Studio integration|Feature||Leo Park|Oct 9`;\n\nconst MOCK_GROUPS = ISSUE_DATA.trim()\n  .split(\"#\")\n  .filter(Boolean)\n  .map((block) => {\n    const [head, ...lines] = block.trim().split(\"\\n\");\n    const [status, name, count] = head.split(\"|\");\n    const issues = lines.map((l) => {\n      const [id, p, title, labels, project, who, date] = l.split(\"|\");\n      return {\n        id,\n        p: Number(p),\n        title,\n        labels: labels ? labels.split(\",\") : [],\n        project,\n        who,\n        date,\n      };\n    });\n    return { status: status as Status, name, count, issues };\n  });\n\nconst NAV =\n  \"inbox:Inbox:3|user:My issues|-Workspace|cube:Projects|layers:Views|more:More|-Your teams|=Engineering|>*issues:Issues|>cycle:Cycles|>cube:Projects|>layers:Views|-Try|download:Import issues|invite:Invite people|link:Connect GitHub\";\n\nfunction NavItem({ spec, c }: { spec: string; c: Pal }) {\n  if (spec.startsWith(\"-\"))\n    return (\n      <div\n        style={{\n          ...row,\n          height: 24,\n          marginTop: 16,\n          padding: \"0 16px\",\n          gap: 4,\n          color: c.faint,\n          fontSize: 12,\n        }}\n      >\n        {spec.slice(1)}\n        <Glyph name=\"chevron\" size={12} color={c.faint} />\n      </div>\n    );\n  const team = spec.startsWith(\"=\");\n  const nested = spec.startsWith(\">\");\n  const active = spec.includes(\"*\");\n  const [icon, label, badge] = spec.replace(/^[=>]?\\*?/, \"\").split(\":\");\n  return (\n    <div\n      style={{\n        ...row,\n        height: 28,\n        margin: \"0 8px\",\n        padding: `0 8px 0 ${nested ? 24 : 8}px`,\n        gap: 9,\n        borderRadius: 6,\n        background: active ? c.active : \"transparent\",\n        color: active || team ? c.text : c.sub,\n        fontSize: 13,\n        fontWeight: 400,\n      }}\n    >\n      {team ? (\n        <div\n          style={{\n            ...center,\n            width: 15,\n            height: 15,\n            borderRadius: 4,\n            background: \"#1FA463\",\n            color: \"#fff\",\n            fontSize: 9,\n          }}\n        >\n          E\n        </div>\n      ) : (\n        <Glyph name={icon} size={15} color={active ? c.text : c.sub} />\n      )}\n      <span style={{ flex: team ? undefined : 1 }}>{team ? icon : label}</span>\n      {team && <Glyph name=\"chevron\" size={12} color={c.faint} />}\n      {badge && <span style={{ fontSize: 11.5, color: c.faint }}>{badge}</span>}\n    </div>\n  );\n}\n\ntype MockIssue = (typeof MOCK_GROUPS)[number][\"issues\"][number];\n\nfunction IssueRow({\n  issue,\n  status,\n  accent,\n  c,\n}: {\n  issue: MockIssue;\n  status: Status;\n  accent: string;\n  c: Pal;\n}) {\n  const chip = {\n    ...row,\n    height: 22,\n    padding: \"0 9px\",\n    gap: 6,\n    borderRadius: 11,\n    border: `1px solid ${c.chip}`,\n    fontSize: 12,\n  };\n  return (\n    <div\n      style={{\n        ...row,\n        height: 40,\n        boxSizing: \"border-box\",\n        padding: \"0 20px\",\n        borderBottom: `1px solid ${c.hair}`,\n      }}\n    >\n      <PriorityIcon p={issue.p} c={c} />\n      <span style={{ width: 70, marginLeft: 14, color: c.sub, fontSize: 13 }}>\n        {issue.id}\n      </span>\n      <StatusIcon status={status} accent={accent} c={c} />\n      <span\n        style={{\n          marginLeft: 10,\n          flex: 1,\n          fontSize: 13,\n          fontWeight: 400,\n          whiteSpace: \"nowrap\",\n        }}\n      >\n        {issue.title}\n      </span>\n      <div style={{ ...row, gap: 6, color: c.sub }}>\n        {issue.labels.map((l) => (\n          <span key={l} style={chip}>\n            <span\n              style={{\n                width: 7,\n                height: 7,\n                borderRadius: 4,\n                background: LABEL_COLORS[l],\n              }}\n            />\n            {l}\n          </span>\n        ))}\n        {issue.project && (\n          <span style={chip}>\n            <Glyph name=\"cube\" size={12} color={c.sub} />\n            {issue.project}\n          </span>\n        )}\n      </div>\n      <div style={{ width: 20, marginLeft: 12 }}>\n        <Avatar name={issue.who || undefined} />\n      </div>\n      <span\n        style={{\n          width: 56,\n          marginLeft: 12,\n          textAlign: \"right\",\n          color: c.sub,\n          fontSize: 12.5,\n        }}\n      >\n        {issue.date}\n      </span>\n    </div>\n  );\n}\n\ninterface IssuesMockProps {\n  theme?: MockTheme;\n  accent?: string;\n  width?: number;\n  height?: number;\n  headerExtra?: React.ReactNode;\n  logo?: React.ReactNode;\n}\n\nfunction IssuesMock({\n  theme = \"light\",\n  accent = \"#3B5BFD\",\n  width = MOCK_W,\n  height = MOCK_H,\n  headerExtra,\n  logo,\n}: IssuesMockProps) {\n  const c = MOCK_COLORS[theme];\n  const box = (size: number) => ({\n    ...center,\n    width: size,\n    height: size,\n    borderRadius: 7,\n    border: `1px solid ${c.border}`,\n  });\n  return (\n    <div\n      style={{\n        width,\n        height,\n        background: c.app,\n        display: \"flex\",\n        fontFamily,\n        color: c.text,\n        position: \"relative\",\n        overflow: \"hidden\",\n      }}\n    >\n      <div\n        style={{\n          width: SB,\n          flexShrink: 0,\n          display: \"flex\",\n          flexDirection: \"column\",\n        }}\n      >\n        <div\n          style={{\n            ...row,\n            height: 44,\n            marginTop: 4,\n            marginBottom: 4,\n            padding: \"0 12px 0 16px\",\n            gap: 8,\n          }}\n        >\n          <div\n            style={{\n              ...center,\n              width: 20,\n              height: 20,\n              borderRadius: 5,\n              background: accent,\n            }}\n          >\n            {logo ?? (\n              <svg viewBox=\"0 0 124.06 134.26\" height={10} aria-hidden>\n                <circle cx=\"62.03\" cy=\"67.13\" r=\"56\" fill=\"#FFFFFF\" />\n              </svg>\n            )}\n          </div>\n          <span style={{ fontSize: 13.5, fontWeight: 400 }}>acme</span>\n          <Glyph name=\"chevron\" size={12} color={c.sub} />\n          <div style={{ flex: 1 }} />\n          <Glyph name=\"search\" size={15} color={c.sub} />\n          <div style={{ ...box(28), background: c.panel }}>\n            <Glyph name=\"compose\" size={15} color={c.text} />\n          </div>\n        </div>\n        {NAV.split(\"|\").map((spec) => (\n          <NavItem key={spec} spec={spec} c={c} />\n        ))}\n        <div style={{ flex: 1 }} />\n        <div\n          style={{\n            margin: 10,\n            padding: \"10px 12px\",\n            borderRadius: 8,\n            border: `1px solid ${c.border}`,\n            background: c.panel,\n          }}\n        >\n          <div style={{ fontSize: 11.5, color: c.sub }}>What’s new</div>\n          <div style={{ fontSize: 12.5, fontWeight: 400, marginTop: 3 }}>\n            Captions in Studio\n          </div>\n        </div>\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          inset: `8px 8px 8px ${SB}px`,\n          background: c.panel,\n          border: `1px solid ${c.border}`,\n          borderRadius: 10,\n          overflow: \"hidden\",\n        }}\n      >\n        <div\n          style={{\n            ...row,\n            height: 48,\n            boxSizing: \"border-box\",\n            padding: \"0 12px 0 14px\",\n            gap: 4,\n            borderBottom: `1px solid ${c.hair}`,\n          }}\n        >\n          {[\"All issues\", \"Active\", \"Backlog\"].map((t, i) => (\n            <span\n              key={t}\n              style={{\n                ...row,\n                height: 26,\n                padding: \"0 10px\",\n                borderRadius: 6,\n                fontSize: 12.5,\n                fontWeight: 400,\n                color: i === 0 ? c.text : c.sub,\n                background: i === 0 ? c.active : \"transparent\",\n              }}\n            >\n              {t}\n            </span>\n          ))}\n          <div style={{ flex: 1 }} />\n          {headerExtra}\n          {[\"filter\", \"display\"].map((g) => (\n            <div key={g} style={{ ...box(28), marginLeft: 4, borderRadius: 6 }}>\n              <Glyph name={g} size={15} color={c.sub} />\n            </div>\n          ))}\n        </div>\n        {MOCK_GROUPS.map((g) => (\n          <div key={g.name}>\n            <div\n              style={{\n                ...row,\n                height: 36,\n                boxSizing: \"border-box\",\n                padding: \"0 20px\",\n                gap: 10,\n                background: c.group,\n                fontSize: 13,\n              }}\n            >\n              <Glyph name=\"chevron\" size={12} color={c.faint} />\n              <StatusIcon status={g.status} accent={accent} c={c} />\n              <span>{g.name}</span>\n              <span style={{ color: c.faint, flex: 1 }}>{g.count}</span>\n              <Glyph name=\"plus\" size={15} color={c.faint} />\n            </div>\n            {g.issues.map((issue) => (\n              <IssueRow\n                key={issue.id}\n                issue={issue}\n                status={g.status}\n                accent={accent}\n                c={c}\n              />\n            ))}\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n"}]}