{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-lesson",
  "type": "registry:block",
  "title": "Lesson",
  "description": "A course lesson on a raised page: the video with its chapters, the course outline with progress, and a short quiz at the end that completes the lesson.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/app-shell.json",
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/breadcrumbs.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/file-item.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/inline-alert.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/progress-bar.json",
    "https://wideset.co/r/radio-button.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/tabs.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/lesson/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/brand-mark.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nconst TILE =\n  'M0 16C0 8.45753 0 4.68629 2.34315 2.34315C4.68629 0 8.45753 0 16 0C23.5425 0 27.3137 0 29.6569 2.34315C32 4.68629 32 8.45753 32 16C32 23.5425 32 27.3137 29.6569 29.6569C27.3137 32 23.5425 32 16 32C8.45753 32 4.68629 32 2.34315 29.6569C0 27.3137 0 23.5425 0 16Z';\n\n/**\n * Orbit's mark: a planet and its ring on the inverse tile, so it inverts in dark mode. It takes\n * the size of its place (32px in a sidebar, 36px in a larger switcher). Decorative beside the\n * product's name; give it a `label` when it stands alone.\n */\nexport function BrandMark({ className, label }: { className?: string; label?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 32 32\"\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('size-ws-14 shrink-0', className)}\n    >\n      <path d={TILE} className=\"fill-(--ws-static-fill-inverse-background)\" />\n      <ellipse\n        cx=\"16\"\n        cy=\"16\"\n        rx=\"10.5\"\n        ry=\"4\"\n        transform=\"rotate(-28 16 16)\"\n        strokeWidth=\"1.75\"\n        className=\"fill-none stroke-(--ws-static-text-inverse-strong)\"\n      />\n      <circle cx=\"16\" cy=\"16\" r=\"4.75\" className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/course-outline.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/course-outline.tsx",
      "content": "'use client';\n\n// TODO(custom): course outline (modules, lesson rows with their state and length, the open lesson selected); Wideset has no outline or tree list.\nimport {\n  type RemixiconComponentType,\n  RiCheckboxBlankCircleLine,\n  RiCheckboxCircleFill,\n  RiLockLine,\n  RiPlayCircleFill,\n} from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { ProgressBar } from '@/components/ui/wideset/progress-bar/ProgressBar';\nimport { useId } from 'react';\n\nimport type { CourseModule, LessonState, OutlineLesson } from './data';\nimport { formatMinutes } from './format';\n\n/** Each state's mark and the words a screen reader hears for it. */\nconst STATE: Record<LessonState, { icon: RemixiconComponentType; label: string }> = {\n  done: { icon: RiCheckboxCircleFill, label: 'Done' },\n  current: { icon: RiPlayCircleFill, label: 'In progress' },\n  'not-started': { icon: RiCheckboxBlankCircleLine, label: 'Not started' },\n  locked: { icon: RiLockLine, label: 'Locked' },\n};\n\nconst ROW =\n  'gap-ws-5 px-ws-5 py-ws-4 rounded-ws-control-lg typography-label-sm flex w-full items-center';\n\n/**\n * One lesson: its state, its title and its length. A finished lesson carries the positive\n * (green) mark; the open lesson takes the selected treatment (the brand tint, its mark in the\n * brand colour); a locked one is plain text, since there is nowhere to go yet.\n */\nfunction LessonRow({\n  lesson,\n  state,\n  open,\n}: {\n  lesson: OutlineLesson;\n  state: LessonState;\n  open: boolean;\n}) {\n  const { icon: Icon, label } = STATE[state];\n  const content = (\n    <>\n      <Icon\n        aria-hidden=\"true\"\n        className={cn(\n          'size-ws-9 shrink-0',\n          state === 'done'\n            ? 'text-ws-semantic-positive'\n            : open\n              ? 'text-ws-dynamic-primary-default'\n              : 'text-ws-static-subtle',\n        )}\n      />\n      <span className=\"sr-only\">{label}: </span>\n      <span\n        className={cn(\n          'min-w-0 flex-1 truncate',\n          state === 'locked' ? 'text-ws-static-subtle' : 'text-ws-static-strong',\n          open && 'typography-label-strong-sm',\n        )}\n      >\n        {lesson.title}\n      </span>\n      <span className=\"text-ws-static-subtle shrink-0 tabular-nums\">\n        {formatMinutes(lesson.minutes)}\n      </span>\n    </>\n  );\n\n  if (state === 'locked') return <div className={ROW}>{content}</div>;\n\n  return (\n    <a\n      href={`#${lesson.id}`}\n      aria-current={open ? 'page' : undefined}\n      className={cn(\n        ROW,\n        'hover:bg-ws-dynamic-tertiary-alpha-strong-default aria-[current=page]:bg-ws-dynamic-primary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default',\n      )}\n    >\n      {content}\n    </a>\n  );\n}\n\ntype CourseOutlineProps = {\n  title: string;\n  modules: CourseModule[];\n  /** The lesson on the page. */\n  openId: string;\n  /** Whether the open lesson has been completed on this page. */\n  openDone: boolean;\n};\n\n/**\n * The course beside the lesson: how far the learner is, as one bar and \"4 of 12 lessons\", then\n * every module with its lessons, so they see where this lesson sits and what comes next.\n */\nexport function CourseOutline({ title, modules, openId, openDone }: CourseOutlineProps) {\n  const titleId = useId();\n  const stateOf = (lesson: OutlineLesson): LessonState =>\n    lesson.id === openId && openDone ? 'done' : lesson.state;\n  const lessons = modules.flatMap((module) => module.lessons);\n  const done = lessons.filter((lesson) => stateOf(lesson) === 'done').length;\n\n  return (\n    <nav aria-labelledby={titleId} className=\"gap-ws-12 flex flex-col\">\n      <div className=\"gap-ws-7 flex flex-col\">\n        <div className=\"gap-ws-9 flex items-baseline justify-between\">\n          <h2 id={titleId} className=\"typography-label-strong-md text-ws-static-strong\">\n            {title}\n          </h2>\n          <p className=\"typography-label-sm text-ws-static-subtle tabular-nums\">\n            {done} of {lessons.length} lessons\n          </p>\n        </div>\n        <ProgressBar\n          value={done}\n          max={lessons.length}\n          aria-label=\"Course progress\"\n          aria-valuetext={`${done} of ${lessons.length} lessons done`}\n        />\n      </div>\n\n      {modules.map((module, index) => (\n        <section key={module.id} aria-label={module.title} className=\"gap-ws-2 flex flex-col\">\n          <h3 className=\"typography-caption-strong-md text-ws-static-subtle px-ws-5 py-ws-3\">\n            Module {index + 1} · {module.title}\n          </h3>\n          <ol className=\"flex flex-col\">\n            {module.lessons.map((lesson) => (\n              <li key={lesson.id}>\n                <LessonRow lesson={lesson} state={stateOf(lesson)} open={lesson.id === openId} />\n              </li>\n            ))}\n          </ol>\n        </section>\n      ))}\n    </nav>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiContactsBook3Line,\n  RiGraduationCapFill,\n  RiGraduationCapLine,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInbox2Line,\n  RiKey2Line,\n  RiLineChartLine,\n  RiPieChart2Line,\n  RiPlugLine,\n  RiQuestionLine,\n  RiSettings3Line,\n  RiTeamLine,\n} from '@remixicon/react';\n\n/*\n  One lesson of Lumen Studio's onboarding course for new sales people, taught in Orbit's Academy:\n  \"Preparing for a discovery call\", the first lesson of the Discovery module. Four lessons of the\n  twelve are done; the video stands at 3:12 of 9:40, paused, where the learner left it.\n*/\n\n/** The product is Orbit; the workspace using it is Lumen Studio. */\nexport const product = { name: 'Orbit' };\nexport const workspace = { name: 'Lumen Studio', initials: 'LS' };\nexport const account = { name: 'Maya Okafor', email: 'maya@lumenstudio.co', initials: 'MO' };\n\nexport type NavLink = {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  /** The icon while the page is open (a line icon swaps for its fill). */\n  activeIcon?: RemixiconComponentType;\n};\n\nexport const mainLinks: NavLink[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInbox2Line },\n  { id: 'customers', label: 'Customers', icon: RiContactsBook3Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiPieChart2Line },\n  { id: 'academy', label: 'Academy', icon: RiGraduationCapLine, activeIcon: RiGraduationCapFill },\n];\n\nexport const settingsLinks: NavLink[] = [\n  { id: 'general', label: 'General', icon: RiSettings3Line },\n  { id: 'members', label: 'Members', icon: RiTeamLine },\n  { id: 'billing', label: 'Billing', icon: RiBankCardLine },\n  { id: 'integrations', label: 'Integrations', icon: RiPlugLine },\n  { id: 'api-keys', label: 'API keys', icon: RiKey2Line },\n];\n\nexport const helpLink: NavLink = { id: 'help', label: 'Help and support', icon: RiQuestionLine };\n\n/** Where a lesson stands for the learner. */\nexport type LessonState = 'done' | 'current' | 'not-started' | 'locked';\n\nexport type OutlineLesson = {\n  id: string;\n  title: string;\n  minutes: number;\n  state: LessonState;\n};\n\nexport type CourseModule = { id: string; title: string; lessons: OutlineLesson[] };\n\nconst modules: CourseModule[] = [\n  {\n    id: 'welcome',\n    title: 'Welcome',\n    lessons: [\n      { id: 'welcome-to-the-team', title: 'Welcome to the team', minutes: 3, state: 'done' },\n      { id: 'how-we-sell', title: 'How we sell', minutes: 8, state: 'done' },\n      { id: 'our-customers', title: 'Our customers', minutes: 6, state: 'done' },\n      { id: 'working-in-orbit', title: 'Working in Orbit', minutes: 7, state: 'done' },\n    ],\n  },\n  {\n    id: 'discovery',\n    title: 'Discovery',\n    lessons: [\n      {\n        id: 'preparing-for-a-discovery-call',\n        title: 'Preparing for a discovery call',\n        minutes: 10,\n        state: 'current',\n      },\n      {\n        id: 'asking-good-questions',\n        title: 'Asking good questions',\n        minutes: 11,\n        state: 'not-started',\n      },\n      { id: 'qualifying-a-deal', title: 'Qualifying a deal', minutes: 8, state: 'not-started' },\n      {\n        id: 'writing-the-call-summary',\n        title: 'Writing the call summary',\n        minutes: 5,\n        state: 'not-started',\n      },\n    ],\n  },\n  {\n    id: 'closing',\n    title: 'Closing',\n    lessons: [\n      { id: 'pricing-and-plans', title: 'Pricing and plans', minutes: 7, state: 'locked' },\n      { id: 'handling-objections', title: 'Handling objections', minutes: 10, state: 'locked' },\n      {\n        id: 'proposals-and-contracts',\n        title: 'Proposals and contracts',\n        minutes: 9,\n        state: 'locked',\n      },\n      {\n        id: 'handing-over-to-success',\n        title: 'Handing over to success',\n        minutes: 6,\n        state: 'locked',\n      },\n    ],\n  },\n];\n\nexport const course = { title: 'Sales onboarding', modules };\n\nexport const allLessons = modules.flatMap((module) => module.lessons);\n\n/** The lesson after this one, which \"Next lesson\" opens. */\nexport const nextLesson = allLessons[allLessons.findIndex((item) => item.state === 'current') + 1];\n\n/** A part of the video, marked on the scrubber. `start` in seconds. */\nexport type Chapter = { start: number; title: string };\n\n/** A line of what is said, from `at` seconds: the captions and the transcript. */\nexport type TranscriptLine = { at: number; text: string };\n\nexport type Resource = { id: string; name: string; size: string };\n\nexport const lesson = {\n  id: 'preparing-for-a-discovery-call',\n  title: 'Preparing for a discovery call',\n  summary: 'What to learn before the call, who will be on it, and how to open it.',\n  /** Seconds. */\n  duration: 580,\n  /** Where the learner left off. */\n  resumeAt: 192,\n  chapters: [\n    { start: 0, title: 'Why preparation matters' },\n    { start: 85, title: 'Research the company' },\n    { start: 230, title: 'Map the people' },\n    { start: 340, title: 'Plan the agenda' },\n    { start: 475, title: 'Open the call' },\n  ] satisfies Chapter[],\n  outcomes: [\n    'Find what matters about a company in fifteen minutes.',\n    'Know who will be on the call and what each of them is measured on.',\n    'Send an agenda the buyer can add to.',\n    'Open the call so the buyer does most of the talking.',\n  ],\n  transcript: [\n    {\n      at: 0,\n      text: 'A discovery call is the first real conversation with a buyer. Most of what makes it go well happens before you join.',\n    },\n    {\n      at: 24,\n      text: 'In this lesson we prepare for one together, step by step, with the notes you would take.',\n    },\n    {\n      at: 48,\n      text: 'Preparation is not about knowing everything. It is about joining with three good questions.',\n    },\n    {\n      at: 85,\n      text: 'Start with the company. Spend fifteen minutes, not an hour: what they make, how they sell and what changed this year.',\n    },\n    {\n      at: 120,\n      text: 'Their website, their last two press releases and their job listings tell you more than any report.',\n    },\n    {\n      at: 170,\n      text: 'Write down one thing that surprised you. It often becomes your best opening question.',\n    },\n    {\n      at: 230,\n      text: 'Next, the people. Look up everyone on the invite and note what each of them is measured on.',\n    },\n    {\n      at: 280,\n      text: 'An operations lead cares about time saved. A finance lead cares about cost and risk. Plan a question for each.',\n    },\n    {\n      at: 340,\n      text: 'Now the agenda. Send it the day before, in three lines, and ask the buyer to add to it.',\n    },\n    {\n      at: 400,\n      text: 'A shared agenda turns the call into a working session, and tells you what they care about before you start.',\n    },\n    {\n      at: 475,\n      text: 'Finally, the first ten minutes. Thank them, confirm the time and the agenda, then ask your first question.',\n    },\n    {\n      at: 530,\n      text: 'From here the buyer should talk most of the time. Listen, take notes and ask the next good question.',\n    },\n  ] satisfies TranscriptLine[],\n  resources: [\n    { id: 'checklist', name: 'Discovery call checklist.pdf', size: '214 KB' },\n    { id: 'agenda', name: 'Call agenda template.docx', size: '36 KB' },\n  ] satisfies Resource[],\n};\n\nexport type Question = {\n  id: string;\n  text: string;\n  options: { value: string; label: string }[];\n  /** The value of the right option. */\n  answer: string;\n  /** Why the right answer is right, shown after Check either way. */\n  explanation: string;\n};\n\n/** Right answers needed to complete the lesson. */\nexport const PASS_MARK = 2;\n\nexport const quiz: Question[] = [\n  {\n    id: 'research',\n    text: 'How long should you spend researching a company before a discovery call?',\n    options: [\n      { value: 'five', label: 'Five minutes' },\n      { value: 'fifteen', label: 'About fifteen minutes' },\n      { value: 'hour', label: 'An hour or more' },\n    ],\n    answer: 'fifteen',\n    explanation:\n      'Fifteen minutes covers what they make, how they sell and what changed this year. More rarely changes the call.',\n  },\n  {\n    id: 'agenda',\n    text: 'When should the agenda reach the buyer?',\n    options: [\n      { value: 'day-before', label: 'The day before, from you' },\n      { value: 'on-the-call', label: 'At the start of the call' },\n      { value: 'none', label: 'Never, discovery calls are informal' },\n    ],\n    answer: 'day-before',\n    explanation:\n      'Sent the day before, the agenda gives the buyer time to add what matters to them, and shows you prepared.',\n  },\n  {\n    id: 'talking',\n    text: 'After the first ten minutes, who should do most of the talking?',\n    options: [\n      { value: 'you', label: 'You, to present the product' },\n      { value: 'buyer', label: 'The buyer' },\n      { value: 'both', label: 'Both of you, equally' },\n    ],\n    answer: 'buyer',\n    explanation:\n      'Discovery is for learning about the buyer. Listen, take notes and save the product for the demo.',\n  },\n];\n"
    },
    {
      "path": "src/blocks/lesson/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/format.ts",
      "content": "// One locale for the whole screen; swap it for the user's.\nconst LOCALE = 'en-US';\n\nconst twoDigits = new Intl.NumberFormat(LOCALE, { minimumIntegerDigits: 2 });\n\n/** A player's clock: \"3:12\", \"12:05\". */\nexport function formatClock(seconds: number) {\n  const whole = Math.floor(seconds);\n  return `${Math.floor(whole / 60)}:${twoDigits.format(whole % 60)}`;\n}\n\n/** The same moment read aloud, for a scrubber's `aria-valuetext`: \"3 min 12 s\". */\nexport function formatSpoken(seconds: number) {\n  const whole = Math.floor(seconds);\n  const minutes = Math.floor(whole / 60);\n  return minutes ? `${minutes} min ${whole % 60} s` : `${whole % 60} s`;\n}\n\n/** A lesson's length in the outline: \"9 min\". */\nexport const formatMinutes = (minutes: number) => `${minutes} min`;\n"
    },
    {
      "path": "src/blocks/lesson/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiArrowRightLine, RiSideBarLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { useEffect, useId, useState } from 'react';\n\nimport { CourseOutline } from './course-outline';\nimport { allLessons, course, lesson, nextLesson, quiz } from './data';\nimport { LessonHeader } from './lesson-header';\nimport { LessonQuiz } from './lesson-quiz';\nimport { LessonTabs } from './lesson-tabs';\nimport { LessonSidebar } from './sidebar';\nimport { usePlayback } from './use-playback';\nimport { VideoPlayer } from './video-player';\n\n/** One column of the page: the header and the body share its edges. */\nconst COLUMN = 'px-ws-14 mx-auto w-full max-w-[80rem]';\n\n/**\n * Lesson (Inset direction): one lesson of a course on the raised page beside the workspace\n * sidebar. The video is the page's one object and the heaviest thing on it; the title, the tabs\n * and the course outline beside it serve it. When the video ends, or from \"Take the quiz\", a short\n * quiz takes the video's place; passing it completes the lesson, which ticks it off in the\n * outline and moves the course on. One filled button at a time: Check in the quiz, then\n * \"Complete lesson\", then \"Next lesson\".\n */\nexport default function Lesson() {\n  const sidebarId = useId();\n  const [collapsed, setCollapsed] = useState(false);\n  const playback = usePlayback(lesson.duration, lesson.resumeAt);\n  const [stage, setStage] = useState<'video' | 'quiz'>('video');\n  const [completed, setCompleted] = useState(false);\n\n  // The quiz follows the video, the way a course does.\n  const { ended } = playback;\n  useEffect(() => {\n    if (ended && !completed) setStage('quiz');\n  }, [ended, completed]);\n\n  const done = allLessons.filter((item) => item.state === 'done').length + (completed ? 1 : 0);\n  const watch = () => setStage('video');\n\n  /** A transcript line plays from its moment. Play goes first: from the end it rewinds to 0. */\n  const playFrom = (time: number) => {\n    watch();\n    playback.play();\n    playback.seek(time);\n  };\n\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"inset\">\n      <LessonSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n      <AppShell.Main>\n        <div className=\"h-ws-18 border-ws-static-base flex shrink-0 items-center border-b\">\n          {/* The bar belongs to the surround: it runs edge to edge. The sidebar's toggle is pulled\n              left so its glyph, not its box, sits 20px from the edge; the crumbs follow it. */}\n          <div className=\"gap-ws-5 px-ws-11 flex w-full items-center\">\n            <IconButton\n              icon={RiSideBarLine}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              iconClassName=\"text-ws-static-subtle size-ws-9\"\n              aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n              aria-expanded={!collapsed}\n              aria-controls={sidebarId}\n              onClick={() => setCollapsed(!collapsed)}\n              className=\"-ml-ws-5\"\n            />\n            <Breadcrumbs separator=\"arrow\">\n              <Breadcrumbs.Item asChild>\n                <a href=\"#academy\">Academy</a>\n              </Breadcrumbs.Item>\n              <Breadcrumbs.Item asChild>\n                <a href=\"#sales-onboarding\">{course.title}</a>\n              </Breadcrumbs.Item>\n              <Breadcrumbs.Item>{lesson.title}</Breadcrumbs.Item>\n            </Breadcrumbs>\n          </div>\n        </div>\n\n        {/* The page scrolls inside the card, so the card's corners stay put. */}\n        <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n          <div\n            className={cn(\n              COLUMN,\n              'gap-ws-16 pt-ws-14 pb-ws-16 grid grid-cols-1 items-start lg:grid-cols-[minmax(0,1fr)_20rem]',\n            )}\n          >\n            <div className=\"gap-ws-12 flex min-w-0 flex-col\">\n              {stage === 'video' ? (\n                <VideoPlayer\n                  title={lesson.title}\n                  playback={playback}\n                  chapters={lesson.chapters}\n                  captions={lesson.transcript}\n                />\n              ) : (\n                <LessonQuiz\n                  questions={quiz}\n                  completed={completed}\n                  next={nextLesson}\n                  progress={`${done} of ${allLessons.length} lessons done`}\n                  onComplete={() => setCompleted(true)}\n                  onWatch={watch}\n                />\n              )}\n\n              <LessonHeader\n                title={lesson.title}\n                summary={lesson.summary}\n                action={\n                  stage === 'quiz' ? undefined : completed ? (\n                    <Button size=\"sm\" asChild>\n                      <a href={`#${nextLesson.id}`}>\n                        Next lesson\n                        <Button.Icon icon={RiArrowRightLine} />\n                      </a>\n                    </Button>\n                  ) : (\n                    <Button\n                      size=\"sm\"\n                      variant=\"secondary\"\n                      preset=\"border\"\n                      onClick={() => {\n                        playback.pause();\n                        setStage('quiz');\n                      }}\n                    >\n                      Take the quiz\n                    </Button>\n                  )\n                }\n              />\n\n              <LessonTabs\n                outcomes={lesson.outcomes}\n                transcript={lesson.transcript}\n                resources={lesson.resources}\n                onSeek={playFrom}\n              />\n            </div>\n\n            <CourseOutline\n              title={course.title}\n              modules={course.modules}\n              openId={lesson.id}\n              openDone={completed}\n            />\n          </div>\n        </div>\n      </AppShell.Main>\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/lesson-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/lesson-header.tsx",
      "content": "'use client';\n\n// TODO(custom): page header (title, a line of description, the action on the right); no PageHeader in Wideset.\nimport type { ReactNode } from 'react';\n\ntype LessonHeaderProps = {\n  title: string;\n  summary: string;\n  /** The one action the lesson offers now, or nothing while the quiz holds it. */\n  action?: ReactNode;\n};\n\n/**\n * The lesson's title under its video, with one line saying what it teaches and, on the right,\n * what to do next. It sits under the video because the video is what the page opens on.\n */\nexport function LessonHeader({ title, summary, action }: LessonHeaderProps) {\n  return (\n    <header className=\"gap-ws-12 flex flex-wrap items-center justify-between\">\n      <div className=\"gap-ws-2 flex min-w-0 flex-col\">\n        <h1 className=\"typography-title-md text-ws-static-strong\">{title}</h1>\n        <p className=\"typography-body-md text-ws-static-subtle\">{summary}</p>\n      </div>\n      {action}\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/lesson-quiz.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/lesson-quiz.tsx",
      "content": "'use client';\n\nimport { RiArrowLeftLine, RiArrowRightLine } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { InlineAlert } from '@/components/ui/wideset/inline-alert/InlineAlert';\nimport { RadioButton } from '@/components/ui/wideset/radio-button/RadioButton';\nimport { RadioButtonGroup } from '@/components/ui/wideset/radio-button/RadioButtonGroup';\nimport { type ReactNode, useId, useState } from 'react';\n\nimport { type OutlineLesson, PASS_MARK, type Question } from './data';\nimport { formatMinutes } from './format';\n\ntype LessonQuizProps = {\n  questions: Question[];\n  completed: boolean;\n  next: OutlineLesson;\n  /** Lessons done in the course, this one included once it is completed. */\n  progress: string;\n  onComplete: () => void;\n  /** Back to the video, from any step. */\n  onWatch: () => void;\n};\n\n/**\n * The quiz in place of the video, framed like a card on the white page and as tall as the video\n * it replaces, so the page under it does not jump. Its column sits in the middle of the frame.\n */\nfunction Frame({ children }: { children: ReactNode }) {\n  return (\n    <section\n      aria-label=\"Lesson quiz\"\n      className=\"border-ws-static-base rounded-ws-container-md grid border before:col-start-1 before:row-start-1 before:aspect-video before:content-['']\"\n    >\n      <div className=\"gap-ws-12 p-ws-14 col-start-1 row-start-1 mx-auto flex w-full max-w-[38rem] flex-col justify-center\">\n        {children}\n      </div>\n    </section>\n  );\n}\n\n/**\n * The lesson's quiz: one question at a time. Check locks the answer and says, in place, whether\n * it was right (positive) or wrong (negative), with the explanation either way; Next moves on.\n * The result offers \"Complete lesson\" at the pass mark and a retake below it. Each step has one\n * filled button, so the screen never has two.\n */\nexport function LessonQuiz({\n  questions,\n  completed,\n  next,\n  progress,\n  onComplete,\n  onWatch,\n}: LessonQuizProps) {\n  const questionId = useId();\n  const [step, setStep] = useState(0);\n  const [answers, setAnswers] = useState<Record<string, string>>({});\n  const [checked, setChecked] = useState(false);\n  const [missing, setMissing] = useState(false);\n\n  const retake = () => {\n    setStep(0);\n    setAnswers({});\n    setChecked(false);\n  };\n\n  if (completed) {\n    return (\n      <Frame>\n        <div className=\"gap-ws-3 flex flex-col\">\n          <h2 className=\"typography-subtitle-xs text-ws-static-strong\">Lesson complete</h2>\n          <p className=\"typography-body-md text-ws-static-subtle\">\n            {progress}. Next up: {next.title}, {formatMinutes(next.minutes)}.\n          </p>\n        </div>\n        <div className=\"gap-ws-5 flex\">\n          <Button size=\"sm\" asChild>\n            <a href={`#${next.id}`}>\n              Next lesson\n              <Button.Icon icon={RiArrowRightLine} />\n            </a>\n          </Button>\n          <Button size=\"sm\" variant=\"secondary\" preset=\"ghost\" onClick={onWatch}>\n            Watch again\n          </Button>\n        </div>\n      </Frame>\n    );\n  }\n\n  const question = questions[step];\n\n  if (!question) {\n    const score = questions.filter((item) => answers[item.id] === item.answer).length;\n    const passed = score >= PASS_MARK;\n    return (\n      <Frame>\n        <div className=\"gap-ws-3 flex flex-col\">\n          <p className=\"typography-label-sm text-ws-static-subtle\">Quiz result</p>\n          <h2 className=\"typography-title-sm text-ws-static-strong tabular-nums\">\n            {score} of {questions.length} right\n          </h2>\n          <p className=\"typography-body-md text-ws-static-subtle\">\n            {passed\n              ? 'You passed. Complete the lesson to tick it off and open the next one.'\n              : `You need ${PASS_MARK} of ${questions.length} to pass. Watch the chapters again, then retake the quiz.`}\n          </p>\n        </div>\n        <div className=\"gap-ws-5 flex\">\n          {passed ? (\n            <>\n              <Button size=\"sm\" onClick={onComplete}>\n                Complete lesson\n              </Button>\n              <Button size=\"sm\" variant=\"secondary\" preset=\"ghost\" onClick={retake}>\n                Retake quiz\n              </Button>\n            </>\n          ) : (\n            <>\n              <Button size=\"sm\" onClick={retake}>\n                Retake quiz\n              </Button>\n              <Button size=\"sm\" variant=\"secondary\" preset=\"ghost\" onClick={onWatch}>\n                Back to video\n              </Button>\n            </>\n          )}\n        </div>\n      </Frame>\n    );\n  }\n\n  const answer = answers[question.id];\n  const right = answer === question.answer;\n  const last = step === questions.length - 1;\n\n  const onPrimary = () => {\n    if (!checked) {\n      if (!answer) return setMissing(true);\n      setChecked(true);\n      return;\n    }\n    setChecked(false);\n    setStep(step + 1);\n  };\n\n  return (\n    <Frame>\n      <div className=\"gap-ws-5 flex items-center justify-between\">\n        <p className=\"typography-label-sm text-ws-static-subtle tabular-nums\">\n          Question {step + 1} of {questions.length}\n        </p>\n        <Button size=\"xs\" variant=\"secondary\" preset=\"ghost\" onClick={onWatch}>\n          <Button.Icon icon={RiArrowLeftLine} />\n          Back to video\n        </Button>\n      </div>\n\n      <div className=\"gap-ws-9 flex flex-col\">\n        <h2 id={questionId} className=\"typography-subtitle-xs text-ws-static-strong\">\n          {question.text}\n        </h2>\n        {/* After Check the answer is locked: the feedback is about the one chosen. */}\n        <RadioButtonGroup\n          key={question.id}\n          aria-labelledby={questionId}\n          value={answer ?? ''}\n          onValueChange={(value) => {\n            setAnswers({ ...answers, [question.id]: value });\n            setMissing(false);\n          }}\n          disabled={checked}\n        >\n          {question.options.map((option) => (\n            <RadioButton key={option.value} value={option.value} label={option.label} />\n          ))}\n        </RadioButtonGroup>\n        {checked && (\n          <InlineAlert\n            persistent\n            orientation=\"vertical\"\n            status={right ? 'success' : 'error'}\n            title={right ? 'Right' : 'Not quite'}\n            message={question.explanation}\n          />\n        )}\n        {missing && (\n          <p role=\"alert\" className=\"typography-label-sm text-ws-dynamic-danger-default\">\n            Choose an answer to check it.\n          </p>\n        )}\n      </div>\n\n      <div>\n        <Button size=\"sm\" onClick={onPrimary}>\n          {!checked ? 'Check' : last ? 'See result' : 'Next question'}\n        </Button>\n      </div>\n    </Frame>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/lesson-tabs.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/lesson-tabs.tsx",
      "content": "'use client';\n\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\n\nimport type { Resource, TranscriptLine } from './data';\nimport { LessonTranscript } from './lesson-transcript';\nimport { ResourceFile } from './resource-file';\n\ntype LessonTabsProps = {\n  outcomes: string[];\n  transcript: TranscriptLine[];\n  resources: Resource[];\n  onSeek: (time: number) => void;\n};\n\n/**\n * What goes with the video, in three tabs without counts: what the lesson teaches, what is said\n * in it (a line plays from its moment) and the files to take away.\n */\nexport function LessonTabs({ outcomes, transcript, resources, onSeek }: LessonTabsProps) {\n  return (\n    <Tabs defaultValue=\"overview\">\n      <Tabs.List aria-label=\"About the lesson\" className=\"w-full\">\n        <Tabs.Item value=\"overview\">\n          <Tabs.Label>Overview</Tabs.Label>\n        </Tabs.Item>\n        <Tabs.Item value=\"transcript\">\n          <Tabs.Label>Transcript</Tabs.Label>\n        </Tabs.Item>\n        <Tabs.Item value=\"resources\">\n          <Tabs.Label>Resources</Tabs.Label>\n        </Tabs.Item>\n      </Tabs.List>\n\n      <Tabs.Content value=\"overview\" className=\"gap-ws-7 mt-ws-12 flex max-w-[40rem] flex-col\">\n        <h2 className=\"typography-label-strong-md text-ws-static-strong\">What you will learn</h2>\n        <p className=\"typography-body-md text-ws-static-base\">\n          A good discovery call is mostly prepared before it starts. This lesson walks through the\n          half hour before one: the research worth doing, the people worth knowing and the agenda\n          worth sending. By the end you will be able to:\n        </p>\n        <ul className=\"typography-body-md text-ws-static-base pl-ws-11 gap-ws-3 flex list-disc flex-col\">\n          {outcomes.map((outcome) => (\n            <li key={outcome}>{outcome}</li>\n          ))}\n        </ul>\n      </Tabs.Content>\n\n      <Tabs.Content value=\"transcript\" className=\"mt-ws-9 max-w-[48rem]\">\n        <LessonTranscript lines={transcript} onSeek={onSeek} />\n      </Tabs.Content>\n\n      <Tabs.Content value=\"resources\" className=\"gap-ws-7 mt-ws-12 grid sm:grid-cols-2\">\n        {resources.map((file) => (\n          <ResourceFile key={file.id} file={file} />\n        ))}\n      </Tabs.Content>\n    </Tabs>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/lesson-transcript.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/lesson-transcript.tsx",
      "content": "'use client';\n\n// TODO(custom): transcript rows (time, text, the row seeks the video); Wideset has no transcript or timed list.\nimport type { TranscriptLine } from './data';\nimport { formatClock } from './format';\n\ntype LessonTranscriptProps = {\n  lines: TranscriptLine[];\n  onSeek: (time: number) => void;\n};\n\n/**\n * What is said in the video, a line per paragraph with the time it starts. A line is one target\n * across its width: it moves the video to that moment.\n */\nexport function LessonTranscript({ lines, onSeek }: LessonTranscriptProps) {\n  return (\n    <ol aria-label=\"Transcript\" className=\"-mx-ws-5 flex flex-col\">\n      {lines.map((line) => (\n        <li key={line.at}>\n          <button\n            type=\"button\"\n            onClick={() => onSeek(line.at)}\n            aria-label={`Play from ${formatClock(line.at)}: ${line.text}`}\n            className=\"gap-ws-9 px-ws-5 py-ws-4 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full cursor-pointer items-baseline text-left\"\n          >\n            <span className=\"typography-label-sm text-ws-static-subtle w-ws-16 shrink-0 tabular-nums\">\n              {formatClock(line.at)}\n            </span>\n            <span className=\"typography-body-md text-ws-static-base\">{line.text}</span>\n          </button>\n        </li>\n      ))}\n    </ol>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/people.assets.ts",
      "content": "// Portraits of the sample people as small JPEG data URLs (a block ships only .ts and .tsx).\n// Exported from the Wideset Core Figma file by people.cjs: do not edit by hand.\n\n/** A person’s photo by name. People who are not here show their initials. */\nexport const PHOTOS: Record<string, string | undefined> = {\n  'Maya Okafor':\n    'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAA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tTB8KnAHzELaQ5jP80oTltQUPeiktlh1SPDvFGnuowmPIjqrppadUuLlMuKgXFf7nWk5Ss+akeP3GDVbS+id8TJQf8FKbTxuS4U59iKvTOPPNe7RYP7iKRr6fQrHiYYPpH7fU7igOFWyPWUOr4fZ90dQqZNjQmU+DSS4r27h75qxNJ9NrBoZClwGC7NcG1cp47nFDyz4D0GKmaipYwSTRak/UPSrULGjQOUG/nK3GoV7gYdtvIbRKIyFHcoZJNKEMJSg4AAr2PqA8AK6+5sVHb/5F01E4ln2pp9gpWgHcOePCqlvlt/Spqmx/lq5TVzSXgqYIoOCEb1HyA/9NVxrVjfHafA+rG/2JoVZAVmto141vcKM+FtjP//Z',\n};\n"
    },
    {
      "path": "src/blocks/lesson/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/person-avatar.tsx",
      "content": "'use client';\n\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { type AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'color' | 'className' | 'style' | 'title' | 'aria-hidden'\n> & {\n  name: string;\n  initials: string;\n  /** The photo's text: empty beside the person's name, their name where the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when `people.assets.ts` has one, with the initials as its\n * fallback, otherwise the initials on their colour. Every place that draws a person uses it, so\n * someone has the same face across the screen and photos mix with initials as in a real product.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...props }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...props} />\n  ) : (\n    <Avatar initials={initials} color={color} {...props} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/resource-file.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/resource-file.tsx",
      "content": "'use client';\n\n// TODO(custom): a file to download, with its download; FileItem is an upload row (a grey fill or no frame, a remove button, no slot for another action).\nimport { RiDownloadLine } from '@remixicon/react';\nimport { FileItem } from '@/components/ui/wideset/file-upload/FileItem';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\n\nimport type { Resource } from './data';\n\n/**\n * A file that comes with the lesson: Wideset's file row for what it is and how big, in a\n * bordered frame like every box on the white page, with the one thing to do with it beside it.\n */\nexport function ResourceFile({ file }: { file: Resource }) {\n  return (\n    <div className=\"border-ws-static-base rounded-ws-container-sm gap-ws-5 py-ws-5 pr-ws-5 pl-ws-7 flex items-center border\">\n      <FileItem variant=\"uncontained\" className=\"min-w-0 flex-1\">\n        <FileItem.Thumbnail name={file.name} />\n        <FileItem.Title>{file.name}</FileItem.Title>\n        <FileItem.Description>{file.size}</FileItem.Description>\n      </FileItem>\n      <IconButton\n        icon={RiDownloadLine}\n        variant=\"secondary\"\n        preset=\"ghost\"\n        size=\"sm\"\n        aria-label={`Download ${file.name}`}\n      />\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/scrubber.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/scrubber.tsx",
      "content": "'use client';\n\n// TODO(custom): video scrubber with chapter marks; Wideset's Slider has no segments, no aria-valuetext for a time, and a form thumb too heavy for a player.\nimport type { KeyboardEvent } from 'react';\n\nimport type { Chapter } from './data';\nimport { formatSpoken } from './format';\n\ntype ScrubberProps = {\n  time: number;\n  duration: number;\n  chapters: Chapter[];\n  onSeek: (time: number) => void;\n  onKeyDown: (event: KeyboardEvent) => void;\n};\n\n/**\n * Where the video is, and the way to move it: a 4px track, the watched part in the brand colour,\n * a gap where each chapter starts. A native range input lies over the track at full height, so\n * the pointer and the keyboard work as they do on any slider and the time is read aloud as\n * a time (\"3 min 12 s of 9 min 40 s, Research the company\").\n */\nexport function Scrubber({ time, duration, chapters, onSeek, onKeyDown }: ScrubberProps) {\n  const at = (seconds: number) => `${(seconds / duration) * 100}%`;\n  const chapter = chapters.filter((item) => item.start <= time).at(-1);\n\n  return (\n    <div className=\"h-ws-12 relative flex items-center\">\n      <input\n        type=\"range\"\n        min={0}\n        max={duration}\n        step={1}\n        value={Math.floor(time)}\n        onChange={(event) => onSeek(Number(event.target.value))}\n        onKeyDown={onKeyDown}\n        aria-label=\"Seek\"\n        aria-valuetext={`${formatSpoken(time)} of ${formatSpoken(duration)}, ${chapter?.title}`}\n        className=\"peer inset-ws-0 absolute w-full cursor-pointer opacity-0\"\n      />\n      <span className=\"rounded-ws-control-sm peer-focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full\">\n        <svg aria-hidden=\"true\" className=\"h-ws-3 w-full overflow-visible\">\n          <rect\n            width=\"100%\"\n            height=\"100%\"\n            rx=\"2\"\n            className=\"fill-(--ws-dynamic-stroke-secondary-default)\"\n          />\n          <rect width={at(time)} height=\"100%\" rx=\"2\" className=\"fill-ws-dynamic-primary-default\" />\n          {/* A chapter starts where the track breaks: a 2px cut in the frame's own colour. */}\n          {chapters.slice(1).map(({ start }) => (\n            <rect\n              key={start}\n              x={at(start)}\n              width=\"2\"\n              height=\"100%\"\n              transform=\"translate(-1 0)\"\n              className=\"fill-(--ws-static-fill-background)\"\n            />\n          ))}\n          <circle cx={at(time)} cy=\"50%\" r=\"6\" className=\"fill-ws-static-strong\" />\n        </svg>\n      </span>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/sidebar.tsx",
      "content": "'use client';\n\n// TODO(custom): workspace switcher and account menu are composed by hand.\nimport {\n  RiAddLine,\n  RiArrowDownSLine,\n  RiLogoutBoxRLine,\n  RiSearchLine,\n  RiSettingsLine,\n} from '@remixicon/react';\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\nimport { type SidebarProps } from '@/components/ui/wideset/sidebar/Sidebar.types';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport {\n  account,\n  helpLink,\n  mainLinks,\n  type NavLink,\n  product,\n  settingsLinks,\n  workspace,\n} from './data';\nimport { PersonAvatar } from './person-avatar';\n\n/**\n * The workspace sidebar: switcher, search, the app's pages, settings and the signed-in account.\n * Its toggle sits in the page bar, so the screen holds `collapsed` and passes it down; collapsed,\n * it keeps the mark, the page icons and the avatar.\n */\nexport function LessonSidebar(props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>) {\n  const [active, setActive] = useState('academy');\n\n  const link = ({ id, label, icon, activeIcon }: NavLink) => (\n    <Sidebar.Item\n      key={id}\n      href={`#${id}`}\n      icon={active === id ? (activeIcon ?? icon) : icon}\n      label={label}\n      active={active === id}\n      onClick={() => setActive(id)}\n    />\n  );\n\n  const nav = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-9 flex flex-col\">\n      <div className=\"flex flex-col\">{mainLinks.map(link)}</div>\n      <Divider weight=\"thin\" />\n      <div role=\"group\" aria-labelledby=\"sidebar-settings\" className=\"gap-ws-2 flex flex-col\">\n        <Sidebar.SectionHeader id=\"sidebar-settings\">Settings</Sidebar.SectionHeader>\n        {settingsLinks.map(link)}\n      </div>\n    </nav>\n  );\n\n  return (\n    <Sidebar {...props}>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-9 flex flex-col\">\n            <div className=\"gap-ws-7 pt-ws-3 pb-ws-7 flex items-center\">\n              <BrandMark className=\"size-ws-15\" />\n              <div className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                  {product.name}\n                </span>\n              </div>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <IconButton\n                    icon={RiArrowDownSLine}\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    aria-label=\"Switch workspace\"\n                    className=\"mr-ws-3\"\n                  />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n                  <DropdownMenu.Item data-state=\"checked\">\n                    <ListItem.Content>\n                      <ListItem.Label>{workspace.name}</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiAddLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>New workspace</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </div>\n            <TextInput size=\"sm\">\n              <TextInput.Prefix inner>\n                <TextInput.Icon icon={RiSearchLine} />\n              </TextInput.Prefix>\n              <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search\" />\n            </TextInput>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"pt-ws-3 pb-ws-7 flex justify-center\">\n            <BrandMark className=\"size-ws-15\" />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      {/* A section draws only the slot for the state it is in, so the pages go in both. */}\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <div className=\"gap-ws-9 flex flex-col\">\n          <div className=\"flex flex-col\">{link(helpLink)}</div>\n          {/* On the grey ground the line keeps the nav's inset: run edge to edge, it would stop\n              short of the page and read as broken. */}\n          <div className=\"border-ws-static-base pt-ws-5 border-t\">\n            <Sidebar.Expanded>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <button\n                    type=\"button\"\n                    className=\"gap-ws-5 px-ws-5 py-ws-3 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n                  >\n                    <PersonAvatar name={account.name} initials={account.initials} color=\"orange\" />\n                    <span className=\"flex min-w-0 flex-1 flex-col\">\n                      <span className=\"typography-label-strong-sm text-ws-static-base truncate\">\n                        {account.name}\n                      </span>\n                      <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                        {account.email}\n                      </span>\n                    </span>\n                    <RiArrowDownSLine\n                      aria-hidden=\"true\"\n                      className=\"size-ws-9 text-ws-static-strong\"\n                    />\n                  </button>\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[14rem]\">\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiSettingsLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Account settings</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item variant=\"danger\">\n                    <ListItem.Prefix>\n                      <RiLogoutBoxRLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Log out</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Sidebar.Expanded>\n            <Sidebar.Collapsed>\n              <div className=\"flex justify-center\">\n                <PersonAvatar\n                  name={account.name}\n                  initials={account.initials}\n                  color=\"orange\"\n                  alt={account.name}\n                  title={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    },
    {
      "path": "src/blocks/lesson/use-playback.ts",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/use-playback.ts",
      "content": "'use client';\n\nimport { type KeyboardEvent, useEffect, useState } from 'react';\n\n/** How often the clock moves, in milliseconds. */\nconst TICK = 250;\n/** How far each arrow key seeks, in seconds. */\nconst SEEK_KEYS: Record<string, number> = {\n  ArrowLeft: -5,\n  ArrowDown: -5,\n  ArrowRight: 5,\n  ArrowUp: 5,\n};\n\nexport type Playback = ReturnType<typeof usePlayback>;\n\n/**\n * The clock of a drawn player. A block ships no media, so a timer moves `time` while `playing`,\n * at `rate`, and stops at the end the way a player does. `seek` clamps to the length.\n */\nexport function usePlayback(duration: number, start = 0) {\n  const [time, setTime] = useState(start);\n  const [playing, setPlaying] = useState(false);\n  const [rate, setRate] = useState(1);\n  const ended = time >= duration;\n\n  useEffect(() => {\n    if (!playing) return;\n    const id = window.setInterval(\n      () => setTime((now) => Math.min(duration, now + (TICK / 1000) * rate)),\n      TICK,\n    );\n    return () => window.clearInterval(id);\n  }, [playing, rate, duration]);\n\n  useEffect(() => {\n    if (ended) setPlaying(false);\n  }, [ended]);\n\n  const seek = (to: number) => setTime(Math.min(duration, Math.max(0, to)));\n  const play = () => {\n    // From the end, play starts over.\n    if (ended) setTime(0);\n    setPlaying(true);\n  };\n  const pause = () => setPlaying(false);\n  const toggle = () => (playing ? pause() : play());\n\n  /**\n   * The player's keys, for the stage and the scrubber: the arrows seek five seconds, Space plays\n   * and pauses. A button already plays on Space through its click, so it is left to do that.\n   */\n  const onPlayerKeyDown = (event: KeyboardEvent) => {\n    const delta = SEEK_KEYS[event.key];\n    if (delta) {\n      event.preventDefault();\n      seek(time + delta);\n    } else if (event.key === ' ' && !(event.target instanceof HTMLButtonElement)) {\n      event.preventDefault();\n      toggle();\n    }\n  };\n\n  return {\n    time,\n    duration,\n    playing,\n    ended,\n    rate,\n    setRate,\n    seek,\n    play,\n    pause,\n    toggle,\n    onPlayerKeyDown,\n  };\n}\n"
    },
    {
      "path": "src/blocks/lesson/video-player.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/lesson/video-player.tsx",
      "content": "'use client';\n\n// TODO(custom): video player (a 16:9 stage, captions, a control bar); Wideset has no media player and no token for a media surface that stays dark in both themes.\nimport {\n  RiClosedCaptioningFill,\n  RiClosedCaptioningLine,\n  RiFullscreenExitLine,\n  RiFullscreenLine,\n  RiPauseFill,\n  RiPlayFill,\n} from '@remixicon/react';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { Select } from '@/components/ui/wideset/select/Select';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { Chapter, TranscriptLine } from './data';\nimport { formatClock } from './format';\nimport { Scrubber } from './scrubber';\nimport type { Playback } from './use-playback';\n\nconst SPEEDS = ['0.75', '1', '1.25', '1.5', '2'].map((value) => ({\n  value,\n  label: `${value}×`,\n}));\n\ntype VideoPlayerProps = {\n  /** The video's title, for the player's name. */\n  title: string;\n  playback: Playback;\n  chapters: Chapter[];\n  captions: TranscriptLine[];\n};\n\n/**\n * The lesson's video, drawn: a 16:9 stage that plays and pauses on a click, the captions over its\n * foot and the control bar along its bottom edge. It is a dark island (`dark` on its root), so\n * the stage stays dark in both themes, as a video does, and the Wideset controls on it take their\n * dark look. With focus on the stage or the scrubber, the arrows seek and Space plays.\n */\nexport function VideoPlayer({ title, playback, chapters, captions }: VideoPlayerProps) {\n  const ref = useRef<HTMLElement>(null);\n  const [captionsOn, setCaptionsOn] = useState(true);\n  const [fullscreen, setFullscreen] = useState(false);\n  const { time, duration, playing, rate, setRate, seek, toggle, onPlayerKeyDown } = playback;\n\n  useEffect(() => {\n    const onChange = () => setFullscreen(document.fullscreenElement === ref.current);\n    document.addEventListener('fullscreenchange', onChange);\n    return () => document.removeEventListener('fullscreenchange', onChange);\n  }, []);\n\n  const chapter = chapters.filter((item) => item.start <= time).at(-1);\n  // Before the first word there is nothing to caption.\n  const caption = time > 0 ? captions.filter((line) => line.at <= time).at(-1) : undefined;\n\n  return (\n    <section\n      ref={ref}\n      aria-label={`Video: ${title}`}\n      className=\"dark bg-ws-static-background rounded-ws-container-md text-ws-static-strong relative flex aspect-video flex-col overflow-hidden\"\n    >\n      <button\n        type=\"button\"\n        aria-label={playing ? 'Pause' : 'Play'}\n        aria-keyshortcuts=\"Space ArrowLeft ArrowRight\"\n        onClick={toggle}\n        onKeyDown={onPlayerKeyDown}\n        className=\"group rounded-ws-container-md focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default p-ws-12 relative flex min-h-0 flex-1 cursor-pointer flex-col items-center justify-end focus-visible:-outline-offset-4\"\n      >\n        {!playing && (\n          <span\n            aria-hidden=\"true\"\n            className=\"bg-ws-static-inverse-background group-hover:bg-ws-static-inverse-foreground text-ws-static-inverse-strong rounded-ws-control-full size-ws-20 inset-ws-0 absolute m-auto flex items-center justify-center\"\n          >\n            <RiPlayFill className=\"size-ws-14\" />\n          </span>\n        )}\n        {captionsOn && caption && (\n          <span\n            aria-hidden=\"true\"\n            className=\"typography-body-lg text-ws-static-strong max-w-[40rem] text-center\"\n          >\n            {caption.text}\n          </span>\n        )}\n      </button>\n\n      <div className=\"px-ws-9 pb-ws-5 flex flex-col\">\n        <Scrubber\n          time={time}\n          duration={duration}\n          chapters={chapters}\n          onSeek={seek}\n          onKeyDown={onPlayerKeyDown}\n        />\n        <div className=\"gap-ws-3 flex items-center\">\n          <IconButton\n            icon={playing ? RiPauseFill : RiPlayFill}\n            variant=\"secondary\"\n            preset=\"ghost\"\n            size=\"sm\"\n            aria-label={playing ? 'Pause' : 'Play'}\n            onClick={toggle}\n            className=\"-ml-ws-3\"\n          />\n          <p className=\"typography-label-sm gap-ws-5 px-ws-3 flex min-w-0 items-baseline\">\n            <span className=\"tabular-nums\">\n              {formatClock(time)}\n              <span className=\"text-ws-static-subtle\"> / {formatClock(duration)}</span>\n            </span>\n            <span className=\"text-ws-static-subtle truncate\">{chapter?.title}</span>\n          </p>\n          <div className=\"gap-ws-3 ml-auto flex items-center\">\n            <Select\n              size=\"sm\"\n              aria-label=\"Playback speed\"\n              options={SPEEDS}\n              value={String(rate)}\n              onValueChange={(value) => setRate(Number(value))}\n              className=\"w-[5.5rem]\"\n            />\n            <IconButton\n              icon={captionsOn ? RiClosedCaptioningFill : RiClosedCaptioningLine}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              aria-label=\"Captions\"\n              aria-pressed={captionsOn}\n              onClick={() => setCaptionsOn(!captionsOn)}\n            />\n            <IconButton\n              icon={fullscreen ? RiFullscreenExitLine : RiFullscreenLine}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              aria-label={fullscreen ? 'Exit full screen' : 'Full screen'}\n              onClick={() =>\n                fullscreen ? document.exitFullscreen() : ref.current?.requestFullscreen()\n              }\n              className=\"-mr-ws-3\"\n            />\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
