{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "wireframe-to-final",
  "title": "Wireframe to Final",
  "description": "A gray wireframe dashboard resolves into the finished product UI.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "files": [
    {
      "path": "registry/remocn/wireframe-to-final/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/IBMPlexMono\";\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport { useId } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  Img,\n  interpolate,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: mono } = loadFont(\"normal\", {\n  weights: [\"400\", \"500\"],\n  subsets: [\"latin\"],\n});\nconst manrope = loadManrope(\"normal\", {\n  weights: [\"500\", \"600\"],\n  subsets: [\"latin\"],\n});\n\n/** The remocn.dev \"R\" mark (viewBox 124.06 × 134.26). */\nconst REMOCN_R_PATH =\n  \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\nconst R_ASPECT = 124.06 / 134.26;\n\n/**\n * gradients.sh \"pixel-glass\" palette: bg #f4f3f1, [#7a3cff, #ff4fb8, #3d6bff].\n * It fills the chart series and blooms softly behind the finished screen.\n */\nconst GLASS = [\"#3d6bff\", \"#7a3cff\", \"#ff4fb8\"] as const;\n\nexport interface WireframeToFinalProps {\n  /** Final screenshot. Without it a built-in abstract product pane is used. */\n  src?: string;\n  /** Blueprint stage. Off-white by default. */\n  theme?: \"light\" | \"dark\";\n  accent?: string;\n  speed?: number;\n  /** Small caption under the screen, before and after the fill. Empty strings hide it. */\n  captions?: [string, string];\n  /** Numbers on the measurement lines: [width, height, sidebar]. */\n  measurements?: [string, string, string];\n}\n\n/* ------------------------------------------------------------------ */\n/* Abstract product pane geometry (1600 x 1000 design units).           */\n/* ------------------------------------------------------------------ */\n\nconst VW = 1600;\nconst VH = 1000;\n\ntype Tone =\n  | \"side\"\n  | \"card\"\n  | \"block\"\n  | \"strong\"\n  | \"sel\"\n  | \"accent\"\n  | \"accentSoft\";\n\ntype El =\n  | {\n      t: \"r\";\n      x: number;\n      y: number;\n      w: number;\n      h: number;\n      r?: number;\n      f?: Tone;\n      s?: boolean | \"accent\";\n    }\n  | { t: \"c\"; x: number; y: number; r: number; f?: Tone }\n  | { t: \"l\"; x: number; y: number; x2: number; y2: number }\n  | { t: \"p\"; pts: [number, number][] }\n  /** The remocn.dev logo: R mark + \"emocn\", `size` is the font size, (x, y) the baseline start. */\n  | { t: \"logo\"; x: number; y: number; size: number };\n\nfunction chrome(els: El[], active: number) {\n  els.push({ t: \"r\", x: 0, y: 72, w: 288, h: VH - 72, f: \"side\" });\n  els.push({ t: \"l\", x: 0, y: 72, x2: VW, y2: 72 });\n  els.push({ t: \"l\", x: 288, y: 72, x2: 288, y2: VH });\n  els.push({ t: \"logo\", x: 28, y: 46, size: 28 });\n  els.push({ t: \"r\", x: 620, y: 20, w: 360, h: 32, r: 16, f: \"block\" });\n  els.push({ t: \"c\", x: 1552, y: 36, r: 15, f: \"block\" });\n  [118, 92, 136, 104, 84, 124, 98].forEach((w, i) => {\n    const y = 112 + i * 50 + (i > 3 ? 36 : 0);\n    const on = i === active;\n    if (on)\n      els.push({ t: \"r\", x: 16, y: y - 12, w: 256, h: 44, r: 10, f: \"sel\" });\n    els.push({\n      t: \"r\",\n      x: 36,\n      y,\n      w: 20,\n      h: 20,\n      r: 6,\n      f: on ? \"strong\" : \"block\",\n    });\n    els.push({\n      t: \"r\",\n      x: 70,\n      y: y + 4,\n      w,\n      h: 12,\n      r: 6,\n      f: on ? \"strong\" : \"block\",\n    });\n  });\n  els.push({ t: \"r\", x: 24, y: 920, w: 240, h: 52, r: 12, f: \"card\", s: true });\n  els.push({ t: \"c\", x: 52, y: 946, r: 12, f: \"block\" });\n  els.push({ t: \"r\", x: 76, y: 940, w: 110, h: 12, r: 6, f: \"block\" });\n}\n\nfunction header(els: El[], w: number) {\n  els.push({ t: \"r\", x: 336, y: 116, w, h: 28, r: 8, f: \"strong\" });\n  els.push({ t: \"r\", x: 336, y: 158, w: 200, h: 12, r: 6, f: \"block\" });\n  els.push({ t: \"r\", x: 1300, y: 116, w: 116, h: 40, r: 10, s: true });\n  els.push({ t: \"r\", x: 1432, y: 116, w: 120, h: 40, r: 10, f: \"strong\" });\n}\n\nconst CHART: [number, number][] = [\n  [0, 0.2],\n  [0.1, 0.3],\n  [0.2, 0.25],\n  [0.3, 0.42],\n  [0.4, 0.37],\n  [0.5, 0.54],\n  [0.6, 0.49],\n  [0.7, 0.66],\n  [0.8, 0.6],\n  [0.9, 0.8],\n  [1, 0.86],\n];\n\nfunction dashboard(): El[] {\n  const els: El[] = [];\n  chrome(els, 0);\n  header(els, 300);\n  const cw = (1216 - 48) / 3;\n  [150, 118, 172].forEach((vw, i) => {\n    const x = 336 + i * (cw + 24);\n    els.push({ t: \"r\", x, y: 204, w: cw, h: 148, r: 16, f: \"card\", s: true });\n    els.push({ t: \"r\", x: x + 24, y: 230, w: 96, h: 12, r: 6, f: \"block\" });\n    els.push({ t: \"r\", x: x + 24, y: 262, w: vw, h: 34, r: 8, f: \"strong\" });\n    els.push({ t: \"r\", x: x + 24, y: 316, w: 72, h: 12, r: 6, f: \"block\" });\n  });\n  els.push({\n    t: \"r\",\n    x: 336,\n    y: 376,\n    w: 800,\n    h: 300,\n    r: 16,\n    f: \"card\",\n    s: true,\n  });\n  els.push({ t: \"r\", x: 360, y: 402, w: 140, h: 12, r: 6, f: \"block\" });\n  for (let k = 0; k < 4; k++)\n    els.push({ t: \"l\", x: 360, y: 466 + k * 56, x2: 1112, y2: 466 + k * 56 });\n  els.push({\n    t: \"p\",\n    pts: CHART.map(([px, py]) => [360 + px * 752, 634 - py * 168]),\n  });\n  els.push({\n    t: \"r\",\n    x: 1160,\n    y: 376,\n    w: 392,\n    h: 300,\n    r: 16,\n    f: \"card\",\n    s: true,\n  });\n  [170, 130, 190, 150, 120].forEach((w, k) => {\n    const y = 404 + k * 52;\n    els.push({ t: \"c\", x: 1196, y: y + 14, r: 13, f: \"block\" });\n    els.push({ t: \"r\", x: 1222, y: y + 8, w, h: 12, r: 6, f: \"block\" });\n    els.push({ t: \"r\", x: 1476, y: y + 8, w: 52, h: 12, r: 6, f: \"strong\" });\n  });\n  els.push({\n    t: \"r\",\n    x: 336,\n    y: 700,\n    w: 1216,\n    h: 252,\n    r: 16,\n    f: \"card\",\n    s: true,\n  });\n  els.push({ t: \"l\", x: 336, y: 748, x2: 1552, y2: 748 });\n  [360, 680, 980, 1300].forEach((x) => {\n    els.push({ t: \"r\", x, y: 718, w: 80, h: 10, r: 5, f: \"block\" });\n  });\n  for (let k = 0; k < 3; k++) {\n    const y = 748 + k * 68;\n    els.push({\n      t: \"r\",\n      x: 360,\n      y: y + 28,\n      w: [200, 160, 220][k],\n      h: 12,\n      r: 6,\n      f: \"strong\",\n    });\n    els.push({ t: \"r\", x: 680, y: y + 28, w: 140, h: 12, r: 6, f: \"block\" });\n    els.push({ t: \"r\", x: 980, y: y + 22, w: 84, h: 24, r: 12, f: \"block\" });\n    els.push({\n      t: \"r\",\n      x: 1300,\n      y: y + 28,\n      w: [90, 110, 70][k],\n      h: 12,\n      r: 6,\n      f: \"block\",\n    });\n    if (k < 2) els.push({ t: \"l\", x: 336, y: y + 68, x2: 1552, y2: y + 68 });\n  }\n  return els;\n}\n\nfunction smooth(pts: [number, number][]) {\n  let d = `M ${pts[0][0]} ${pts[0][1]}`;\n  for (let i = 0; i < pts.length - 1; i++) {\n    const p0 = pts[Math.max(0, i - 1)];\n    const p1 = pts[i];\n    const p2 = pts[i + 1];\n    const p3 = pts[Math.min(pts.length - 1, i + 2)];\n    const c1 = [p1[0] + (p2[0] - p0[0]) / 6, p1[1] + (p2[1] - p0[1]) / 6];\n    const c2 = [p2[0] - (p3[0] - p1[0]) / 6, p2[1] - (p3[1] - p1[1]) / 6];\n    d += ` C ${c1[0]} ${c1[1]} ${c2[0]} ${c2[1]} ${p2[0]} ${p2[1]}`;\n  }\n  return d;\n}\n\nconst PALETTE = {\n  light: {\n    stage: \"#F5F4F0\",\n    grid: \"rgba(20,20,24,0.045)\",\n    gridMajor: \"rgba(20,20,24,0.075)\",\n    ink: \"rgba(20,20,24,0.5)\",\n    pane: \"#FCFCFB\",\n    side: \"#F6F6F4\",\n    card: \"#FFFFFF\",\n    block: \"rgba(20,20,24,0.06)\",\n    strong: \"rgba(20,20,24,0.19)\",\n    sel: \"rgba(20,20,24,0.045)\",\n    hair: \"rgba(20,20,24,0.09)\",\n    logo: \"#141418\",\n  },\n  dark: {\n    stage: \"#0A0A0B\",\n    grid: \"rgba(255,255,255,0.035)\",\n    gridMajor: \"rgba(255,255,255,0.065)\",\n    ink: \"rgba(255,255,255,0.5)\",\n    pane: \"#18181B\",\n    side: \"#151517\",\n    card: \"#1E1E22\",\n    block: \"rgba(255,255,255,0.075)\",\n    strong: \"rgba(255,255,255,0.2)\",\n    sel: \"rgba(255,255,255,0.06)\",\n    hair: \"rgba(255,255,255,0.09)\",\n    logo: \"#F3F2EF\",\n  },\n};\n\nfunction mixHex(a: string, b: string, t: number) {\n  const parse = (h: string) => {\n    const m = /^#?([0-9a-f]{6})$/i.exec(h.trim());\n    if (!m) return null;\n    const n = Number.parseInt(m[1], 16);\n    return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\n  };\n  const pa = parse(a);\n  const pb = parse(b);\n  if (!pa || !pb) return a;\n  const c = pa.map((v, i) => Math.round(v + (pb[i] - v) * t));\n  return `rgb(${c[0]}, ${c[1]}, ${c[2]})`;\n}\n\nconst INOUT = Easing.bezier(0.65, 0, 0.35, 1);\nconst OUT = Easing.bezier(0.22, 1, 0.36, 1);\n\n// Timeline (frames at speed 1).\nconst FRAME_DRAW = [2, 28];\nconst DIM_DRAW = [12, 36];\nconst STRUCT_DRAW = 22;\nconst BOX_DRAW = [30, 62];\nconst CONTENT_DRAW = [42, 90];\nconst SWEEP = [104, 152];\nconst EDGE = 0.045;\n\ntype Drawn = El & {\n  kind: \"struct\" | \"box\" | \"content\" | \"bg\";\n  start: number;\n  dur: number;\n  /** Position along the sweep axis, 0..1. */\n  at: number;\n};\n\n/** Center of an element along the \"to bottom right\" axis, 0..1. */\nfunction diag(e: El) {\n  let cx: number;\n  let cy: number;\n  if (e.t === \"r\") {\n    cx = e.x + e.w / 2;\n    cy = e.y + e.h / 2;\n  } else if (e.t === \"c\") {\n    cx = e.x;\n    cy = e.y;\n  } else if (e.t === \"l\") {\n    cx = (e.x + e.x2) / 2;\n    cy = (e.y + e.y2) / 2;\n  } else if (e.t === \"logo\") {\n    cx = e.x + e.size * 1.9;\n    cy = e.y - e.size * 0.38;\n  } else {\n    cx = e.pts[Math.floor(e.pts.length / 2)][0];\n    cy = e.pts[Math.floor(e.pts.length / 2)][1];\n  }\n  return (cx / VW + cy / VH) / 2;\n}\n\nfunction choreograph(): Drawn[] {\n  return dashboard().map((e) => {\n    const at = diag(e);\n    const long =\n      e.t === \"l\" && Math.abs(e.x2 - e.x) + Math.abs(e.y2 - e.y) > 600;\n    if (e.t === \"r\" && e.f === \"side\")\n      return { ...e, kind: \"bg\", start: 0, dur: 1, at };\n    if (long) return { ...e, kind: \"struct\", start: STRUCT_DRAW, dur: 18, at };\n    if (e.t === \"r\" && e.f === \"card\")\n      return {\n        ...e,\n        kind: \"box\",\n        start: BOX_DRAW[0] + at * (BOX_DRAW[1] - BOX_DRAW[0] - 16),\n        dur: 16,\n        at,\n      };\n    return {\n      ...e,\n      kind: \"content\",\n      start: CONTENT_DRAW[0] + at * (CONTENT_DRAW[1] - CONTENT_DRAW[0] - 10),\n      dur: e.t === \"p\" ? 22 : 10,\n      at,\n    };\n  });\n}\n\nconst ELS = choreograph();\n\nexport function WireframeToFinal({\n  src,\n  theme = \"light\",\n  accent = \"#3B5BFD\",\n  speed = 1,\n  captions = [\"Idea\", \"Product\"],\n  measurements = [\"1440\", \"900\", \"288\"],\n}: WireframeToFinalProps) {\n  const frame = useCurrentFrame() * speed;\n  const { width, height } = useVideoConfig();\n  const uid = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n  const P = PALETTE[theme];\n  const dark = theme === \"dark\";\n  const k = width / 1280;\n  const W = Math.round(width * 0.64);\n  const H = Math.round(W * (VH / VW));\n  const left = (width - W) / 2;\n  const top = (height - H) / 2 - 10 * k;\n  const s = W / VW;\n  const line = dark ? mixHex(accent, \"#FFFFFF\", 0.3) : accent;\n  const clamp = {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n  } as const;\n\n  const draw = (start: number, dur: number) =>\n    interpolate(frame, [start, start + dur], [0, 1], { ...clamp, easing: OUT });\n\n  // Fill sweep front along the \"to bottom right\" axis.\n  const front = interpolate(frame, SWEEP, [-0.02, 1 + EDGE + 0.02], {\n    ...clamp,\n    easing: INOUT,\n  });\n  const sweepLife = interpolate(\n    frame,\n    [SWEEP[0], SWEEP[0] + 6, SWEEP[1] - 6, SWEEP[1]],\n    [0, 1, 1, 0],\n    clamp,\n  );\n  const after = interpolate(frame, [SWEEP[1] - 14, SWEEP[1] + 16], [0, 1], {\n    ...clamp,\n    easing: INOUT,\n  });\n  const push = interpolate(frame, [96, 230], [1, 1.05], {\n    ...clamp,\n    easing: INOUT,\n  });\n  const gridIn = interpolate(frame, [0, 14], [0.55, 1], clamp);\n  const drift = interpolate(frame, [SWEEP[0], 230], [0, 1], clamp);\n  const gridOp = gridIn * (1 - after * 0.55);\n  const guides = 1 - after;\n\n  const cropIn = interpolate(frame, [0, 14], [0.45, 1], {\n    ...clamp,\n    easing: OUT,\n  });\n  const filled = (t: number) => Math.min(1, Math.max(0, (front - t) / EDGE));\n  const frameDraw = draw(FRAME_DRAW[0], FRAME_DRAW[1] - FRAME_DRAW[0]);\n  const dimDraw = draw(DIM_DRAW[0], DIM_DRAW[1] - DIM_DRAW[0]);\n  const labelIn = interpolate(\n    frame,\n    [DIM_DRAW[0] + 12, DIM_DRAW[1] + 4],\n    [0, 1],\n    clamp,\n  );\n\n  const maskStop = (front - EDGE) * 100;\n  const mask = `linear-gradient(to bottom right, #000 ${maskStop}%, transparent ${front * 100}%)`;\n  const gid = `${uid}-area`;\n  const clipId = `${uid}-clip`;\n  const radius = 28 * s;\n  const tone = (f?: Tone) =>\n    f === \"accent\" || f === \"accentSoft\" ? accent : f ? P[f] : \"none\";\n\n  // Sweep front: the line x/W + y/H = 2 * (front - EDGE / 2).\n  const fl = 2 * (front - EDGE / 2);\n  const fx1 = fl * W + W;\n  const fy1 = -H;\n  const fx2 = fl * W - 2 * W;\n  const fy2 = 2 * H;\n\n  const capSwap = interpolate(frame, [SWEEP[0] + 18, SWEEP[0] + 34], [0, 1], {\n    ...clamp,\n    easing: INOUT,\n  });\n  const capIn = interpolate(frame, [26, 40], [0, 1], clamp);\n\n  const tick = 6 * k;\n  const gap = 26 * k;\n  const label = {\n    fontFamily: mono,\n    fontSize: 11 * k,\n    fill: line,\n    letterSpacing: \"0.04em\",\n  } as const;\n\n  return (\n    <AbsoluteFill style={{ background: P.stage, overflow: \"hidden\" }}>\n      <Grid\n        width={width}\n        height={height}\n        k={k}\n        P={P}\n        uid={uid}\n        opacity={gridOp}\n      />\n      <AbsoluteFill\n        style={{ transform: `scale(${push})`, transformOrigin: \"50% 48%\" }}\n      >\n        {/* pixel-glass underglow: the finished screen sits on a band of colour */}\n        <div\n          style={{\n            position: \"absolute\",\n            left: left + W * 0.06,\n            top: top + H * 0.18,\n            width: W * 0.88,\n            height: H * 0.8,\n            borderRadius: radius * 3,\n            background: `linear-gradient(${100 + drift * 14}deg, ${GLASS[0]} 0%, ${GLASS[1]} 50%, ${GLASS[2]} 100%)`,\n            filter: `blur(${70 * k}px)`,\n            opacity: after * (dark ? 0.5 : 0.42),\n            transform: `translateY(${(30 + 10 * after) * k}px)`,\n          }}\n        />\n        {/* contact shadow, grows in once the screen is real */}\n        <div\n          style={{\n            position: \"absolute\",\n            left,\n            top,\n            width: W,\n            height: H,\n            borderRadius: radius,\n            opacity: after,\n            boxShadow: dark\n              ? `0 0 0 1px rgba(255,255,255,0.09), 0 ${40 * k}px ${90 * k}px -${20 * k}px rgba(0,0,0,0.8)`\n              : `0 0 0 1px rgba(20,20,24,0.07), 0 ${36 * k}px ${80 * k}px -${24 * k}px rgba(60,45,20,0.24), 0 ${4 * k}px ${12 * k}px -${4 * k}px rgba(60,45,20,0.08)`,\n          }}\n        />\n        {/* final render, revealed by the diagonal sweep */}\n        <div\n          style={{\n            position: \"absolute\",\n            left,\n            top,\n            width: W,\n            height: H,\n            borderRadius: radius,\n            overflow: \"hidden\",\n            WebkitMaskImage: mask,\n            maskImage: mask,\n            background: P.pane,\n          }}\n        >\n          {src ? (\n            <Img\n              src={src}\n              style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n            />\n          ) : null}\n        </div>\n        <svg\n          width={W}\n          height={H}\n          style={{ position: \"absolute\", left, top, overflow: \"visible\" }}\n        >\n          <title>Wireframe</title>\n          <defs>\n            <linearGradient id={gid} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n              {GLASS.map((c, i) => (\n                <stop key={c} offset={i / (GLASS.length - 1)} stopColor={c} />\n              ))}\n            </linearGradient>\n            <linearGradient id={`${gid}-fade`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n              <stop offset=\"0\" stopColor=\"#FFFFFF\" stopOpacity={0.3} />\n              <stop offset=\"1\" stopColor=\"#FFFFFF\" stopOpacity={0} />\n            </linearGradient>\n            <mask id={`${gid}-mask`} maskContentUnits=\"objectBoundingBox\">\n              <rect width={1} height={1} fill={`url(#${gid}-fade)`} />\n            </mask>\n            <clipPath id={clipId}>\n              <rect width={W} height={H} rx={radius} />\n            </clipPath>\n          </defs>\n\n          {/* final fills, region by region */}\n          {src ? null : (\n            <g clipPath={`url(#${clipId})`}>\n              {ELS.map((e, i) => {\n                const op = filled(e.at);\n                if (op <= 0) return null;\n                const key = `f${i}`;\n                if (e.t === \"l\")\n                  return (\n                    <line\n                      key={key}\n                      x1={e.x * s}\n                      y1={e.y * s}\n                      x2={e.x2 * s}\n                      y2={e.y2 * s}\n                      stroke={P.hair}\n                      opacity={op}\n                    />\n                  );\n                if (e.t === \"c\")\n                  return (\n                    <circle\n                      key={key}\n                      cx={e.x * s}\n                      cy={e.y * s}\n                      r={e.r * s}\n                      fill={tone(e.f)}\n                      opacity={op}\n                    />\n                  );\n                if (e.t === \"logo\") {\n                  const rh = e.size * 0.76 * s;\n                  return (\n                    <g key={key} opacity={op}>\n                      <path\n                        d={REMOCN_R_PATH}\n                        fill={P.logo}\n                        transform={`translate(${e.x * s} ${e.y * s - rh}) scale(${rh / 134.26})`}\n                      />\n                      <text\n                        x={e.x * s + rh * R_ASPECT + e.size * 0.04 * s}\n                        y={e.y * s}\n                        fill={P.logo}\n                        style={{\n                          fontFamily: manrope.fontFamily,\n                          fontWeight: 600,\n                          fontSize: e.size * s,\n                          letterSpacing: \"-0.025em\",\n                        }}\n                      >\n                        emocn\n                      </text>\n                    </g>\n                  );\n                }\n                if (e.t === \"p\") {\n                  const pts = e.pts.map(\n                    ([x, y]) => [x * s, y * s] as [number, number],\n                  );\n                  const d = smooth(pts);\n                  const base = 650 * s;\n                  return (\n                    <g key={key} opacity={op}>\n                      <path\n                        d={`${d} L ${pts[pts.length - 1][0]} ${base} L ${pts[0][0]} ${base} Z`}\n                        fill={`url(#${gid})`}\n                        mask={`url(#${gid}-mask)`}\n                      />\n                      <path\n                        d={d}\n                        fill=\"none\"\n                        stroke={`url(#${gid})`}\n                        strokeWidth={Math.max(1.5, 3.4 * s)}\n                        strokeLinecap=\"round\"\n                      />\n                    </g>\n                  );\n                }\n                return (\n                  <rect\n                    key={key}\n                    x={e.x * s}\n                    y={e.y * s}\n                    width={e.w * s}\n                    height={e.h * s}\n                    rx={(e.r ?? 0) * s}\n                    fill={tone(e.f)}\n                    fillOpacity={e.f === \"accentSoft\" ? 0.16 : 1}\n                    stroke={e.s ? P.hair : \"none\"}\n                    opacity={op}\n                  />\n                );\n              })}\n            </g>\n          )}\n\n          {/* blueprint linework */}\n          <g fill=\"none\" stroke={line} strokeWidth={1}>\n            <rect\n              x={0.5}\n              y={0.5}\n              width={W - 1}\n              height={H - 1}\n              rx={radius}\n              pathLength={1}\n              strokeDasharray=\"1 1\"\n              strokeDashoffset={1 - frameDraw}\n              opacity={0.9 * (1 - after)}\n            />\n            {ELS.map((e, i) => {\n              if (e.kind === \"bg\") return null;\n              const p = draw(e.start, e.dur);\n              if (p <= 0) return null;\n              const op =\n                (e.kind === \"content\" ? 0.75 : 0.9) *\n                (1 - Math.min(1, Math.max(0, (front - e.at) / (EDGE * 1.6))));\n              if (op <= 0.01) return null;\n              const key = `b${i}`;\n              const common = {\n                pathLength: 1,\n                strokeDasharray: \"1 1\",\n                strokeDashoffset: 1 - p,\n                opacity: op,\n              };\n              if (e.t === \"l\")\n                return (\n                  <line\n                    {...common}\n                    x1={e.x * s}\n                    y1={e.y * s}\n                    x2={e.x2 * s}\n                    y2={e.y2 * s}\n                  />\n                );\n              if (e.t === \"c\")\n                return (\n                  <circle\n                    key={key}\n                    {...common}\n                    cx={e.x * s}\n                    cy={e.y * s}\n                    r={e.r * s}\n                  />\n                );\n              if (e.t === \"logo\") {\n                const rh = e.size * 0.76 * s;\n                const xh = e.size * 0.555 * s;\n                const tx = e.x * s + rh * R_ASPECT + e.size * 0.06 * s;\n                return (\n                  <g key={key}>\n                    <path\n                      {...common}\n                      d={REMOCN_R_PATH}\n                      vectorEffect=\"non-scaling-stroke\"\n                      transform={`translate(${e.x * s} ${e.y * s - rh}) scale(${rh / 134.26})`}\n                    />\n                    <rect\n                      {...common}\n                      x={tx}\n                      y={e.y * s - xh}\n                      width={e.size * 3.02 * s}\n                      height={xh}\n                      rx={xh / 2}\n                    />\n                  </g>\n                );\n              }\n              if (e.t === \"p\")\n                return (\n                  <path\n                    {...common}\n                    d={smooth(\n                      e.pts.map(([x, y]) => [x * s, y * s] as [number, number]),\n                    )}\n                  />\n                );\n              return (\n                <rect\n                  key={key}\n                  {...common}\n                  x={e.x * s + 0.5}\n                  y={e.y * s + 0.5}\n                  width={Math.max(0, e.w * s - 1)}\n                  height={Math.max(0, e.h * s - 1)}\n                  rx={(e.r ?? 0) * s}\n                />\n              );\n            })}\n          </g>\n\n          {/* sweep front */}\n          <g clipPath={`url(#${clipId})`} opacity={sweepLife}>\n            <line\n              x1={fx1}\n              y1={fy1}\n              x2={fx2}\n              y2={fy2}\n              stroke={line}\n              strokeWidth={1.25}\n            />\n          </g>\n\n          {/* measurements, crop marks and column ticks */}\n          <g opacity={guides} stroke={line} strokeWidth={1} fill=\"none\">\n            {[\n              [0, 0, -1, -1],\n              [W, 0, 1, -1],\n              [0, H, -1, 1],\n              [W, H, 1, 1],\n            ].map(([x, y, dx, dy]) => {\n              const o = 10 * k;\n              const L = 16 * k * cropIn;\n              return (\n                <path\n                  key={`crop-${x}-${y}`}\n                  d={`M ${x + dx * o} ${y + dy * (o + L)} L ${x + dx * o} ${y + dy * o} L ${x + dx * (o + L)} ${y + dy * o}`}\n                  opacity={0.7}\n                />\n              );\n            })}\n            <g opacity={0.85}>\n              <line x1={0} y1={-gap} x2={W * dimDraw} y2={-gap} />\n              <line x1={0} y1={-gap - tick} x2={0} y2={-gap + tick} />\n              <line\n                x1={W}\n                y1={-gap - tick}\n                x2={W}\n                y2={-gap + tick}\n                opacity={dimDraw >= 0.99 ? 1 : 0}\n              />\n              <line x1={-gap} y1={0} x2={-gap} y2={H * dimDraw} />\n              <line x1={-gap - tick} y1={0} x2={-gap + tick} y2={0} />\n              <line\n                x1={-gap - tick}\n                y1={H}\n                x2={-gap + tick}\n                y2={H}\n                opacity={dimDraw >= 0.99 ? 1 : 0}\n              />\n              <line x1={0} y1={H + gap} x2={288 * s * dimDraw} y2={H + gap} />\n              <line x1={0} y1={H + gap - tick} x2={0} y2={H + gap + tick} />\n              <line\n                x1={288 * s}\n                y1={H + gap - tick}\n                x2={288 * s}\n                y2={H + gap + tick}\n                opacity={dimDraw >= 0.99 ? 1 : 0}\n              />\n            </g>\n            {Array.from({ length: 13 }, (_, c) => {\n              const x = (288 + (c * (VW - 288)) / 12) * s;\n              const on = draw(DIM_DRAW[0] + 4 + c * 1.2, 8);\n              return (\n                <line\n                  key={`col-${c}`}\n                  x1={x}\n                  y1={-4 * k}\n                  x2={x}\n                  y2={-4 * k - 5 * k * on}\n                  opacity={0.55 * on}\n                />\n              );\n            })}\n          </g>\n          <g opacity={guides * labelIn} style={label} stroke=\"none\">\n            <rect\n              x={W / 2 - 24 * k}\n              y={-gap - 8 * k}\n              width={48 * k}\n              height={16 * k}\n              fill={P.stage}\n            />\n            <text x={W / 2} y={-gap + 4 * k} textAnchor=\"middle\" fill={line}>\n              {measurements[0]}\n            </text>\n            <rect\n              x={-gap - 8 * k}\n              y={H / 2 - 20 * k}\n              width={16 * k}\n              height={40 * k}\n              fill={P.stage}\n            />\n            <text\n              x={-gap + 4 * k}\n              y={H / 2}\n              textAnchor=\"middle\"\n              fill={line}\n              transform={`rotate(-90 ${-gap + 4 * k} ${H / 2})`}\n            >\n              {measurements[1]}\n            </text>\n            <rect\n              x={144 * s - 18 * k}\n              y={H + gap - 8 * k}\n              width={36 * k}\n              height={16 * k}\n              fill={P.stage}\n            />\n            <text\n              x={144 * s}\n              y={H + gap + 4 * k}\n              textAnchor=\"middle\"\n              fill={line}\n            >\n              {measurements[2]}\n            </text>\n          </g>\n        </svg>\n      </AbsoluteFill>\n      <Caption\n        captions={captions}\n        swap={capSwap}\n        opacity={capIn}\n        x={left + W}\n        y={top + H + 18 * k}\n        k={k}\n        ink={P.ink}\n        accent={line}\n      />\n    </AbsoluteFill>\n  );\n}\n\nfunction Caption({\n  captions,\n  swap,\n  opacity,\n  x,\n  y,\n  k,\n  ink,\n  accent,\n}: {\n  captions: [string, string];\n  swap: number;\n  opacity: number;\n  x: number;\n  y: number;\n  k: number;\n  ink: string;\n  accent: string;\n}) {\n  if (!captions[0] && !captions[1]) return null;\n  const row = (n: number, text: string, p: number) => (\n    <div\n      style={{\n        position: \"absolute\",\n        right: 0,\n        top: 0,\n        display: \"flex\",\n        gap: 10 * k,\n        whiteSpace: \"nowrap\",\n        opacity: p,\n        transform: `translateY(${(1 - p) * (n === 1 ? -8 : 8) * k}px)`,\n      }}\n    >\n      <span style={{ color: accent }}>{`0${n + 1}`}</span>\n      <span>{text}</span>\n    </div>\n  );\n  return (\n    <div\n      style={{\n        position: \"absolute\",\n        left: x - 300 * k,\n        top: y,\n        width: 300 * k,\n        height: 16 * k,\n        fontFamily: mono,\n        fontSize: 11 * k,\n        letterSpacing: \"0.08em\",\n        textTransform: \"uppercase\",\n        color: ink,\n        opacity,\n      }}\n    >\n      {row(0, captions[0], 1 - swap)}\n      {row(1, captions[1], swap)}\n    </div>\n  );\n}\n\nfunction Grid({\n  width,\n  height,\n  k,\n  P,\n  uid,\n  opacity,\n}: {\n  width: number;\n  height: number;\n  k: number;\n  P: (typeof PALETTE)[\"light\"];\n  uid: string;\n  opacity: number;\n}) {\n  const minor = 24 * k;\n  const major = minor * 5;\n  const id = `${uid}-grid`;\n  const idM = `${uid}-gridm`;\n  const fade = `${uid}-fade`;\n  return (\n    <svg\n      width={width}\n      height={height}\n      style={{ position: \"absolute\", inset: 0, opacity }}\n    >\n      <title>Grid</title>\n      <defs>\n        <pattern\n          id={id}\n          width={minor}\n          height={minor}\n          patternUnits=\"userSpaceOnUse\"\n          x={width / 2}\n          y={height / 2}\n        >\n          <path\n            d={`M ${minor} 0 L 0 0 0 ${minor}`}\n            fill=\"none\"\n            stroke={P.grid}\n            strokeWidth={1}\n          />\n        </pattern>\n        <pattern\n          id={idM}\n          width={major}\n          height={major}\n          patternUnits=\"userSpaceOnUse\"\n          x={width / 2}\n          y={height / 2}\n        >\n          <path\n            d={`M ${major} 0 L 0 0 0 ${major}`}\n            fill=\"none\"\n            stroke={P.gridMajor}\n            strokeWidth={1}\n          />\n        </pattern>\n        <radialGradient id={fade} cx=\"50%\" cy=\"50%\" r=\"65%\">\n          <stop offset=\"0.55\" stopColor={P.stage} stopOpacity={0} />\n          <stop offset=\"1\" stopColor={P.stage} stopOpacity={1} />\n        </radialGradient>\n      </defs>\n      <rect width={width} height={height} fill={`url(#${id})`} />\n      <rect width={width} height={height} fill={`url(#${idM})`} />\n      <rect width={width} height={height} fill={`url(#${fade})`} />\n    </svg>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/wireframe-to-final.tsx"
    }
  ],
  "type": "registry:component"
}
