@intellectif/lk-core 1.10.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{ai-zhc9yhRj.d.cts → ai-Cu17iVHa.d.cts} +429 -2
  3. package/dist/ai-Cu17iVHa.d.cts.map +1 -0
  4. package/dist/{ai-zhc9yhRj.d.ts → ai-Cu17iVHa.d.ts} +429 -2
  5. package/dist/ai-Cu17iVHa.d.ts.map +1 -0
  6. package/dist/ai-check.cjs +2 -2
  7. package/dist/ai-check.d.cts +1 -1
  8. package/dist/ai-check.d.ts +1 -1
  9. package/dist/ai-check.js +2 -2
  10. package/dist/{ai-writing-_wciTWaI.cjs → ai-writing-C7f6aKNW.cjs} +27 -4
  11. package/dist/ai-writing-C7f6aKNW.cjs.map +1 -0
  12. package/dist/{ai-writing-BaaiuU5t.js → ai-writing-Dl1bJQbL.js} +22 -5
  13. package/dist/ai-writing-Dl1bJQbL.js.map +1 -0
  14. package/dist/{index-DGmcCid6.d.ts → index-B1zEN1Ur.d.ts} +2 -2
  15. package/dist/{index-DGmcCid6.d.ts.map → index-B1zEN1Ur.d.ts.map} +1 -1
  16. package/dist/{index-Byar5VVs.d.ts → index-BTZWUwOe.d.ts} +2 -2
  17. package/dist/{index-Byar5VVs.d.ts.map → index-BTZWUwOe.d.ts.map} +1 -1
  18. package/dist/{index-f4YuMgFb.d.ts → index-BfUyl6ml.d.ts} +2 -2
  19. package/dist/{index-f4YuMgFb.d.ts.map → index-BfUyl6ml.d.ts.map} +1 -1
  20. package/dist/{index-BBmID0a6.d.cts → index-CpamCGyZ.d.cts} +2 -2
  21. package/dist/{index-BBmID0a6.d.cts.map → index-CpamCGyZ.d.cts.map} +1 -1
  22. package/dist/{index-BeC8tAWf.d.cts → index-DYnacygI.d.cts} +2 -2
  23. package/dist/{index-BeC8tAWf.d.cts.map → index-DYnacygI.d.cts.map} +1 -1
  24. package/dist/{index-Ccj8oL_E.d.cts → index-DjZ1vIVg.d.cts} +2 -2
  25. package/dist/{index-Ccj8oL_E.d.cts.map → index-DjZ1vIVg.d.cts.map} +1 -1
  26. package/dist/index.cjs +761 -6
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +187 -5
  29. package/dist/index.d.cts.map +1 -1
  30. package/dist/index.d.ts +187 -5
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +733 -7
  33. package/dist/index.js.map +1 -1
  34. package/dist/item-group-D7M3E7K2.cjs +1506 -0
  35. package/dist/item-group-D7M3E7K2.cjs.map +1 -0
  36. package/dist/item-group-uNAT5EX5.js +1338 -0
  37. package/dist/item-group-uNAT5EX5.js.map +1 -0
  38. package/dist/{registry-C9O9txy5.cjs → registry-RPfZZEqi.cjs} +28 -1
  39. package/dist/registry-RPfZZEqi.cjs.map +1 -0
  40. package/dist/{registry-Bw9grsCN.js → registry-kTqbi4Lb.js} +28 -1
  41. package/dist/registry-kTqbi4Lb.js.map +1 -0
  42. package/dist/{schemas-DcEAuAeU.cjs → schemas-C4V5wfOS.cjs} +3 -3
  43. package/dist/{schemas-DcEAuAeU.cjs.map → schemas-C4V5wfOS.cjs.map} +1 -1
  44. package/dist/{schemas-D14-tnNl.js → schemas-rDgIN4Vu.js} +3 -3
  45. package/dist/{schemas-D14-tnNl.js.map → schemas-rDgIN4Vu.js.map} +1 -1
  46. package/dist/schemas.cjs +3 -3
  47. package/dist/schemas.d.cts +1 -1
  48. package/dist/schemas.d.ts +1 -1
  49. package/dist/schemas.js +3 -3
  50. package/dist/{scoring-hMsEMhCU.js → scoring-DshU9i7e.js} +2 -2
  51. package/dist/{scoring-hMsEMhCU.js.map → scoring-DshU9i7e.js.map} +1 -1
  52. package/dist/{scoring-Bmfu8RS5.cjs → scoring-KpYfR0lO.cjs} +2 -2
  53. package/dist/{scoring-Bmfu8RS5.cjs.map → scoring-KpYfR0lO.cjs.map} +1 -1
  54. package/dist/scoring.cjs +2 -2
  55. package/dist/scoring.d.cts +2 -2
  56. package/dist/scoring.d.ts +2 -2
  57. package/dist/scoring.js +2 -2
  58. package/dist/{xapi-DOAqH9__.cjs → xapi-CaM7f1sD.cjs} +2 -2
  59. package/dist/{xapi-DOAqH9__.cjs.map → xapi-CaM7f1sD.cjs.map} +1 -1
  60. package/dist/{xapi-BtBm8AWZ.js → xapi-fFq9KEXG.js} +2 -2
  61. package/dist/{xapi-BtBm8AWZ.js.map → xapi-fFq9KEXG.js.map} +1 -1
  62. package/dist/xapi.cjs +1 -1
  63. package/dist/xapi.d.cts +1 -1
  64. package/dist/xapi.d.ts +1 -1
  65. package/dist/xapi.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/ai-writing-BaaiuU5t.js.map +0 -1
  68. package/dist/ai-writing-_wciTWaI.cjs.map +0 -1
  69. package/dist/ai-zhc9yhRj.d.cts.map +0 -1
  70. package/dist/ai-zhc9yhRj.d.ts.map +0 -1
  71. package/dist/item-group-C9boy5Mk.cjs +0 -513
  72. package/dist/item-group-C9boy5Mk.cjs.map +0 -1
  73. package/dist/item-group-Cqng1LPl.js +0 -453
  74. package/dist/item-group-Cqng1LPl.js.map +0 -1
  75. package/dist/registry-Bw9grsCN.js.map +0 -1
  76. package/dist/registry-C9O9txy5.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-group-uNAT5EX5.js","names":["isFields","list","fold"],"sources":["../src/reading-route/layout.ts","../src/reading-route/questions.ts","../src/reading-route/quotes.ts","../src/reading-route/strategies.ts","../src/reading-route/check.ts","../src/timeline-limits.ts","../src/schemas/item-group.ts"],"sourcesContent":["/**\n * The passage cut into paragraphs and sentences, by rules of the SDK's own.\n *\n * `Intl.Segmenter` would be shorter, and wrong here: engines segment\n * differently and change between versions, and a learner's \"found the\n * evidence\" must not depend on their browser. These rules are plain code, so\n * a server and every browser cut the same passage the same way, and a trace's\n * sentence numbers mean one thing. They change only with\n * {@link ROUTE_SEGMENTER}.\n */\n\nimport type {\n PassageLayout,\n PassageParagraph,\n PassageSection,\n PassageSentence,\n RouteSection,\n TextRange,\n} from '../types/reading-route.js';\n\n/** Names the segmentation rules below. A change to them is a new name. */\nexport const ROUTE_SEGMENTER = 'lk-sentences@1';\n\nconst TERMINALS = new Set(['.', '!', '?', '…', '‼', '⁇', '⁈', '⁉']);\n/** Terminals of scripts written without spaces: a sentence ends at them outright. */\nconst CLOSED_TERMINALS = new Set(['。', '!', '?', '。']);\nconst CLOSERS = new Set(['\"', \"'\", '”', '’', ')', ']', '}', '»', '›', '」', '』', ')']);\n\n/**\n * Words a full stop follows without ending a sentence. Lower case, without\n * their dots. `etc` is not one: it ends sentences as often as not, and a\n * capital after it says which.\n */\nconst ABBREVIATIONS = new Set([\n 'mr',\n 'mrs',\n 'ms',\n 'dr',\n 'prof',\n 'sr',\n 'jr',\n 'st',\n 'mt',\n 'vs',\n 'fig',\n 'figs',\n 'vol',\n 'approx',\n 'ca',\n 'cf',\n 'eg',\n 'ie',\n 'inc',\n 'ltd',\n 'co',\n 'corp',\n 'jan',\n 'feb',\n 'mar',\n 'apr',\n 'jun',\n 'jul',\n 'aug',\n 'sep',\n 'sept',\n 'oct',\n 'nov',\n 'dec',\n 'gen',\n 'gov',\n 'rev',\n 'ed',\n 'eds',\n 'pp',\n 'no',\n]);\n\nconst isSpace = (char: string | undefined): boolean => char !== undefined && /\\s/u.test(char);\nconst isLower = (char: string | undefined): boolean => char !== undefined && /\\p{Ll}/u.test(char);\n\n/** The word before a full stop at `dot`, letters and inner dots only (\"e.g\", \"U.S\"). */\nfunction wordBefore(text: string, dot: number): string {\n let start = dot;\n while (start > 0 && /[\\p{L}.]/u.test(text[start - 1] as string)) {\n start -= 1;\n }\n return text.slice(start, dot);\n}\n\n/** Whether the full stop at `dot` follows an abbreviation or an initial (\"J. K.\", \"U.S.\"). */\nfunction abbreviated(text: string, dot: number): boolean {\n const word = wordBefore(text, dot);\n if (word === '') {\n return false;\n }\n const last = word.split('.').at(-1) as string;\n if (last.length === 1 && /\\p{Lu}/u.test(last)) {\n return true;\n }\n return ABBREVIATIONS.has(word.replaceAll('.', '').toLowerCase());\n}\n\n/** `range` with whitespace trimmed off both ends; `null` when nothing is left. */\nfunction trimmed(text: string, start: number, end: number): TextRange | null {\n let from = start;\n let to = end;\n while (from < to && isSpace(text[from])) {\n from += 1;\n }\n while (to > from && isSpace(text[to - 1])) {\n to -= 1;\n }\n return from < to ? { start: from, end: to } : null;\n}\n\n/** The sentences of `text.slice(start, end)`: one paragraph. A line break always ends one. */\nfunction sentencesIn(text: string, start: number, end: number): TextRange[] {\n const found: TextRange[] = [];\n let from = start;\n const close = (to: number, next: number): void => {\n const range = trimmed(text, from, to);\n if (range !== null) {\n found.push(range);\n }\n from = next;\n };\n let index = start;\n while (index < end) {\n const char = text[index] as string;\n if (char === '\\n') {\n close(index, index + 1);\n index += 1;\n continue;\n }\n if (CLOSED_TERMINALS.has(char)) {\n let after = index + 1;\n while (after < end && CLOSERS.has(text[after] as string)) {\n after += 1;\n }\n close(after, after);\n index = after;\n continue;\n }\n if (!TERMINALS.has(char)) {\n index += 1;\n continue;\n }\n let after = index + 1;\n while (after < end && TERMINALS.has(text[after] as string)) {\n after += 1;\n }\n while (after < end && CLOSERS.has(text[after] as string)) {\n after += 1;\n }\n if (after >= end) {\n close(end, end);\n index = end;\n continue;\n }\n if (!isSpace(text[after])) {\n // \"3.5\", \"e.g.,\", \"www.example.org\": no space, no sentence end.\n index = after;\n continue;\n }\n let next = after;\n while (next < end && text[next] !== '\\n' && isSpace(text[next])) {\n next += 1;\n }\n const continues =\n isLower(text[next]) || (char === '.' && after === index + 1 && abbreviated(text, index));\n if (!continues) {\n close(after, after);\n }\n index = after;\n }\n close(end, end);\n return found;\n}\n\n/** The paragraphs of `body`: runs of text between blank lines. */\nfunction paragraphRanges(body: string): TextRange[] {\n const ranges: TextRange[] = [];\n const blank = /\\n[^\\S\\n]*\\n\\s*/gu;\n let from = 0;\n for (const match of body.matchAll(blank)) {\n const range = trimmed(body, from, match.index);\n if (range !== null) {\n ranges.push(range);\n }\n from = match.index + match[0].length;\n }\n const last = trimmed(body, from, body.length);\n if (last !== null) {\n ranges.push(last);\n }\n return ranges;\n}\n\n/** How many paragraphs `body` has, by the rules {@link passageLayout} uses. */\nexport function countParagraphs(body: string): number {\n return paragraphRanges(body).length;\n}\n\n/**\n * The passage cut into paragraphs and sentences. Paragraph labels and sections\n * are applied when they fit; the checks report when they do not.\n */\nexport function passageLayout(\n body: string,\n route?: { paragraphLabels?: readonly string[]; sections?: readonly RouteSection[] },\n): PassageLayout {\n const ranges = paragraphRanges(body);\n const labels = route?.paragraphLabels;\n const sectionList = route?.sections ?? [];\n const sections: PassageSection[] = [];\n const sectionOf: number[] = [];\n const fits =\n sectionList.reduce((total, section) => total + section.paragraphs, 0) === ranges.length;\n if (fits) {\n let first = 0;\n sectionList.forEach((section, index) => {\n const last = first + section.paragraphs - 1;\n sections.push({\n label: section.label,\n ...(section.title !== undefined ? { title: section.title } : {}),\n first,\n last,\n });\n for (let paragraph = first; paragraph <= last; paragraph += 1) {\n sectionOf[paragraph] = index;\n }\n first = last + 1;\n });\n }\n const labelled = labels !== undefined && labels.length === ranges.length;\n const paragraphs: PassageParagraph[] = [];\n const sentences: PassageSentence[] = [];\n ranges.forEach((range, index) => {\n const label = labelled ? (labels[index] as string) : '';\n const section = sectionOf[index];\n paragraphs.push({\n index,\n start: range.start,\n end: range.end,\n ...(label !== '' ? { label } : {}),\n ...(section !== undefined ? { section } : {}),\n });\n for (const sentence of sentencesIn(body, range.start, range.end)) {\n sentences.push({ index: sentences.length, paragraph: index, ...sentence });\n }\n });\n return { paragraphs, sentences, sections };\n}\n\n/** Whether two ranges share at least one character. */\nexport function overlaps(a: TextRange, b: TextRange): boolean {\n return a.start < b.end && b.start < a.end;\n}\n\n/** The sentences a range touches, in order. */\nexport function sentencesTouching(layout: PassageLayout, range: TextRange): number[] {\n return layout.sentences.filter((sentence) => overlaps(sentence, range)).map((s) => s.index);\n}\n","/**\n * The questions of a routed group, read off its items: one per multiple-choice\n * item, one per blank or gap of the others, numbered as on the paper. Read\n * defensively, because the checks run on drafts and on redacted items.\n */\n\nimport { passageWithoutPlaceholders, placeholderOrder } from '../answer-leak.js';\n\n/** A question as the items define it, before the route says anything about it. */\nexport interface ItemQuestion {\n key: string;\n itemId: string;\n partId?: string;\n itemIndex: number;\n /** 0-based position among the group's questions. */\n position: number;\n type: string;\n}\n\ntype Fields = Record<string, unknown>;\n\nconst isFields = (value: unknown): value is Fields =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst text = (value: unknown): string => (typeof value === 'string' ? value : '');\n\nconst list = (value: unknown): Fields[] => (Array.isArray(value) ? value.filter(isFields) : []);\n\n/** `itemId`, or `itemId#partId`: a question's name in traces and summaries. */\nexport function questionKey(itemId: string, partId?: string): string {\n return partId === undefined ? itemId : `${itemId}#${partId}`;\n}\n\n/** The ids of an item's parts in passage order: its blanks or gaps, or none for multiple choice. */\nexport function partIdsOf(item: unknown): string[] | null {\n if (!isFields(item)) {\n return null;\n }\n if (item.type === 'multiple-choice') {\n return null;\n }\n const declared = list(item.type === 'gap-select' ? item.gaps : item.blanks)\n .map((part) => part.id)\n .filter((id): id is string => typeof id === 'string' && id !== '');\n const order = placeholderOrder(text(item.passage)).filter((id) => declared.includes(id));\n const rest = declared.filter((id) => !order.includes(id));\n return [...new Set([...order, ...rest])];\n}\n\n/** Every question of the group's items, in paper order. */\nexport function itemQuestions(items: readonly unknown[]): ItemQuestion[] {\n const found: ItemQuestion[] = [];\n items.forEach((item, itemIndex) => {\n if (!isFields(item) || typeof item.id !== 'string') {\n return;\n }\n const type = text(item.type);\n const parts = partIdsOf(item);\n if (parts === null) {\n found.push({\n key: questionKey(item.id),\n itemId: item.id,\n itemIndex,\n position: found.length,\n type,\n });\n return;\n }\n for (const partId of parts) {\n found.push({\n key: questionKey(item.id, partId),\n itemId: item.id,\n partId,\n itemIndex,\n position: found.length,\n type,\n });\n }\n });\n return found;\n}\n\n/** What the learner reads of an item: its instructions, question or passage, and its options or choices. */\nexport function learnerTextOf(item: unknown): string {\n if (!isFields(item)) {\n return '';\n }\n const parts = [text(item.instructions)];\n if (item.type === 'multiple-choice') {\n parts.push(text(item.question), ...list(item.options).map((option) => text(option.text)));\n } else {\n parts.push(passageWithoutPlaceholders(text(item.passage)));\n for (const gap of list(item.gaps)) {\n parts.push(...list(gap.choices).map((choice) => text(choice.text)));\n }\n for (const bank of list(item.banks)) {\n parts.push(...list(bank.choices).map((choice) => text(choice.text)));\n }\n }\n return parts.filter((part) => part !== '').join('\\n');\n}\n\n/** The options or choices a question offers, by id, with their text and whether each is right. */\nexport function choicesOf(\n item: unknown,\n partId?: string,\n): { id: string; text: string; correct: boolean }[] {\n if (!isFields(item)) {\n return [];\n }\n if (item.type === 'multiple-choice') {\n return list(item.options)\n .filter((option) => typeof option.id === 'string')\n .map((option) => ({\n id: option.id as string,\n text: text(option.text),\n correct: option.isCorrect === true,\n }));\n }\n if (item.type !== 'gap-select') {\n return [];\n }\n const gap = list(item.gaps).find((candidate) => candidate.id === partId);\n if (gap === undefined) {\n return [];\n }\n const bank = list(item.banks).find((candidate) => candidate.id === gap.bankId);\n const offered = gap.choices !== undefined ? list(gap.choices) : list(bank?.choices);\n return offered\n .filter((choice) => typeof choice.id === 'string')\n .map((choice) => ({\n id: choice.id as string,\n text: text(choice.text),\n correct: choice.id === gap.correctChoiceId,\n }));\n}\n\n/** The accepted answers of a blank. */\nexport function acceptedAnswersOf(item: unknown, partId?: string): string[] {\n if (!isFields(item) || item.type !== 'fill-in-the-blanks') {\n return [];\n }\n const blank = list(item.blanks).find((candidate) => candidate.id === partId);\n return Array.isArray(blank?.acceptedAnswers)\n ? blank.acceptedAnswers.filter((answer): answer is string => typeof answer === 'string')\n : [];\n}\n\n/** 1-based position of a blank or gap among its item's placeholders, for the leak check. */\nexport function placeholderPosition(item: unknown, partId?: string): number | undefined {\n if (!isFields(item) || partId === undefined) {\n return undefined;\n }\n const index = placeholderOrder(text(item.passage)).indexOf(partId);\n return index === -1 ? undefined : index + 1;\n}\n","/**\n * Finding a route's quotes in the passage. A quote is the words themselves,\n * so it survives an edit elsewhere in the passage; it is matched ignoring\n * runs of whitespace and the difference between curly and straight quotation\n * marks — what copying words out of a document changes — and nothing else.\n */\n\nimport type { RouteQuote, TextRange } from '../types/reading-route.js';\n\nconst FOLDED: Readonly<Record<string, string>> = {\n '‘': \"'\",\n '’': \"'\",\n '‛': \"'\",\n '′': \"'\",\n '“': '\"',\n '”': '\"',\n '„': '\"',\n '″': '\"',\n};\n\n/** A text folded for matching, and for each folded character the index it came from. */\ninterface Folded {\n text: string;\n origin: number[];\n}\n\nfunction fold(text: string): Folded {\n let folded = '';\n const origin: number[] = [];\n let space = false;\n for (let index = 0; index < text.length; index += 1) {\n const char = text[index] as string;\n if (/\\s/u.test(char)) {\n if (!space && folded !== '') {\n folded += ' ';\n origin.push(index);\n }\n space = true;\n continue;\n }\n space = false;\n folded += FOLDED[char] ?? char;\n origin.push(index);\n }\n if (folded.endsWith(' ')) {\n folded = folded.slice(0, -1);\n origin.pop();\n }\n return { text: folded, origin };\n}\n\n/** The text of a quote, whichever form it takes. Non-strings read as empty. */\nexport function quoteText(quote: RouteQuote | unknown): string {\n if (typeof quote === 'string') {\n return quote;\n }\n if (\n typeof quote === 'object' &&\n quote !== null &&\n typeof (quote as { text?: unknown }).text === 'string'\n ) {\n return (quote as { text: string }).text;\n }\n return '';\n}\n\nfunction occurrenceOf(quote: RouteQuote | unknown): number | undefined {\n if (typeof quote !== 'object' || quote === null) {\n return undefined;\n }\n const occurrence = (quote as { occurrence?: unknown }).occurrence;\n return typeof occurrence === 'number' ? occurrence : undefined;\n}\n\n/** What finding a quote came to. */\nexport type QuoteMatch =\n | { found: true; range: TextRange }\n | { found: false; reason: 'empty' | 'missing' | 'ambiguous' | 'occurrence'; count: number };\n\n/**\n * Where `quote` is in `body`. Every occurrence is counted, overlapping ones\n * included, so \"a a\" in \"a a a\" is ambiguous rather than silently the first.\n */\nexport function findQuote(body: string, quote: RouteQuote | unknown): QuoteMatch {\n const needle = fold(quoteText(quote)).text;\n if (needle === '') {\n return { found: false, reason: 'empty', count: 0 };\n }\n const hay = fold(body);\n const starts: number[] = [];\n let at = hay.text.indexOf(needle);\n while (at !== -1) {\n starts.push(at);\n at = hay.text.indexOf(needle, at + 1);\n }\n if (starts.length === 0) {\n return { found: false, reason: 'missing', count: 0 };\n }\n const occurrence = occurrenceOf(quote);\n if (occurrence === undefined && starts.length > 1) {\n return { found: false, reason: 'ambiguous', count: starts.length };\n }\n const chosen = starts[(occurrence ?? 1) - 1];\n if (chosen === undefined) {\n return { found: false, reason: 'occurrence', count: starts.length };\n }\n const start = hay.origin[chosen] as number;\n const end = (hay.origin[chosen + needle.length - 1] as number) + 1;\n return { found: true, range: { start, end } };\n}\n\n/** Whether `phrase` occurs in `text`, by the same folding as quotes, ignoring case. */\nexport function containsPhrase(text: string, phrase: string): boolean {\n const needle = fold(phrase).text.toLowerCase();\n return needle !== '' && fold(text).text.toLowerCase().includes(needle);\n}\n","/**\n * The strategy library: for each exam reading task, the order in which a\n * skilled candidate looks, and what they do at each look. A leaf module: the\n * schemas, the checks and the planner read it, and it imports none of them.\n *\n * What the steps rest on (the guide, `docs/reading-route.md`, cites each):\n * successful candidates find a small relevant part of the text and read it\n * carefully, where weaker ones read larger chunks for longer; exam reading\n * interleaves fast search with careful reading of what was found; answers are\n * hidden behind paraphrase, and a word-for-word match is the classic\n * distractor; skimming keeps the gist and structure, not details.\n */\n\nimport type { RouteMoveId, RouteStrategyId } from '../types/reading-route.js';\n\n/**\n * The item types a reading route may hold: the three that every common exam\n * reading task is written in. CLOSED on purpose, as an interactive video's\n * list is: a type added later is not silently routable.\n */\nexport const READING_ROUTE_ITEM_TYPES = [\n 'multiple-choice',\n 'fill-in-the-blanks',\n 'gap-select',\n] as const;\n\n/** One of {@link READING_ROUTE_ITEM_TYPES}. */\nexport type ReadingRouteItemType = (typeof READING_ROUTE_ITEM_TYPES)[number];\n\n/** Whether `type` is one of the item types a reading route may hold. */\nexport function isReadingRouteItemType(type: unknown): type is ReadingRouteItemType {\n return (READING_ROUTE_ITEM_TYPES as readonly unknown[]).includes(type);\n}\n\n/** How a strategy is planned. */\nexport interface RouteStrategy {\n id: RouteStrategyId;\n /** Its name, in English, as a learner meets it. */\n title: string;\n /** The exam tasks it serves, in English, for authors. */\n serves: string;\n /** The item types it can be written in. */\n itemTypes: readonly ReadingRouteItemType[];\n /** Its steps, in order. `survey` is planned once, before the route's first question. */\n moves: readonly RouteMoveId[];\n /** Whether the answers come in the order of the text, so each search starts after the previous answer. */\n followsOrder: boolean;\n}\n\nconst CHOICE: readonly ReadingRouteItemType[] = ['multiple-choice', 'gap-select'];\n\n/**\n * The built-in strategies. Data, versioned with lk-core: a route stores only\n * a strategy's id, so a learner always meets the current steps.\n */\nexport const ROUTE_STRATEGIES: Readonly<Record<RouteStrategyId, RouteStrategy>> = Object.freeze({\n tfng: {\n id: 'tfng',\n title: 'True / False / Not Given',\n serves: 'IELTS identifying information.',\n itemTypes: CHOICE,\n moves: ['read-instructions', 'keywords', 'locate', 'read-around', 'paraphrase', 'decide'],\n followsOrder: true,\n },\n ynng: {\n id: 'ynng',\n title: 'Yes / No / Not Given',\n serves: \"IELTS identifying the writer's views or claims.\",\n itemTypes: CHOICE,\n moves: ['read-instructions', 'keywords', 'locate', 'read-around', 'paraphrase', 'decide'],\n followsOrder: true,\n },\n 'multiple-choice': {\n id: 'multiple-choice',\n title: 'Multiple choice',\n serves: 'IELTS multiple choice; Cambridge C1 Advanced and C2 Proficiency Part 5.',\n itemTypes: ['multiple-choice'],\n moves: ['keywords', 'predict', 'locate', 'read-around', 'paraphrase', 'eliminate'],\n followsOrder: true,\n },\n 'matching-headings': {\n id: 'matching-headings',\n title: 'Matching headings',\n serves: 'IELTS matching headings.',\n itemTypes: CHOICE,\n moves: ['survey', 'locate', 'paraphrase', 'eliminate'],\n followsOrder: false,\n },\n 'matching-information': {\n id: 'matching-information',\n title: 'Matching information',\n serves: 'IELTS matching information (\"Which paragraph contains...\").',\n itemTypes: CHOICE,\n moves: ['keywords', 'locate', 'read-around', 'paraphrase'],\n followsOrder: false,\n },\n 'matching-features': {\n id: 'matching-features',\n title: 'Matching features',\n serves: 'IELTS matching features (people, dates, places to statements).',\n itemTypes: CHOICE,\n moves: ['keywords', 'locate', 'read-around', 'paraphrase'],\n followsOrder: false,\n },\n 'multiple-matching': {\n id: 'multiple-matching',\n title: 'Multiple matching',\n serves: 'Cambridge C1 Advanced Part 8 and C2 Proficiency Part 7.',\n itemTypes: CHOICE,\n moves: ['survey', 'keywords', 'locate', 'read-around', 'paraphrase'],\n followsOrder: false,\n },\n 'sentence-endings': {\n id: 'sentence-endings',\n title: 'Matching sentence endings',\n serves: 'IELTS matching sentence endings.',\n itemTypes: CHOICE,\n moves: ['keywords', 'predict', 'locate', 'read-around', 'eliminate'],\n followsOrder: true,\n },\n completion: {\n id: 'completion',\n title: 'Completion',\n serves: 'IELTS sentence, note, table and flow-chart completion, and short answers.',\n itemTypes: ['fill-in-the-blanks'],\n moves: ['read-instructions', 'keywords', 'predict', 'locate', 'read-around', 'check-answer'],\n followsOrder: true,\n },\n 'summary-word-list': {\n id: 'summary-word-list',\n title: 'Summary completion from a list',\n serves: 'IELTS summary completion with a list of words.',\n itemTypes: ['gap-select'],\n moves: ['keywords', 'predict', 'locate', 'read-around', 'paraphrase', 'check-answer'],\n followsOrder: false,\n },\n 'gapped-text': {\n id: 'gapped-text',\n title: 'Gapped text',\n serves: 'Cambridge C1 Advanced Part 7 and C2 Proficiency Part 6.',\n itemTypes: CHOICE,\n moves: ['survey', 'locate', 'cohesion', 'eliminate'],\n followsOrder: false,\n },\n 'cross-text': {\n id: 'cross-text',\n title: 'Cross-text matching',\n serves: 'Cambridge C1 Advanced Part 6.',\n itemTypes: CHOICE,\n moves: ['survey', 'keywords', 'locate', 'compare-views'],\n followsOrder: false,\n },\n});\n\n/** Every built-in strategy id, in the library's order. */\nexport const ROUTE_STRATEGY_IDS = Object.freeze(\n Object.keys(ROUTE_STRATEGIES),\n) as readonly RouteStrategyId[];\n\n/** Whether `id` names a built-in strategy. */\nexport function isRouteStrategyId(id: unknown): id is RouteStrategyId {\n return typeof id === 'string' && Object.hasOwn(ROUTE_STRATEGIES, id);\n}\n\n/** The most characters an author's note on a step may have. */\nexport const ROUTE_NOTE_MAX_LENGTH = 280;\n\n/** The longest word limit a completion question may set. */\nexport const ROUTE_WORD_LIMIT_MAX = 10;\n","/**\n * The rules a reading route keeps, beyond its shape: every question of the\n * group has exactly one entry, every quote is in the passage once, the words\n * an author adds never give the answer away, and the strategy fits the item.\n *\n * One list of rules serves the stored schema (every rule refuses) and the\n * draft checks (each code with its own severity), so the two cannot drift.\n * Read defensively: drafts and redacted groups reach it as they are.\n */\n\nimport { containsWords, fold, numberedPassage, revealsAnswer } from '../answer-leak.js';\nimport { countWords } from '../count-words.js';\nimport { countParagraphs } from './layout.js';\nimport {\n acceptedAnswersOf,\n choicesOf,\n itemQuestions,\n learnerTextOf,\n partIdsOf,\n placeholderPosition,\n questionKey,\n} from './questions.js';\nimport { containsPhrase, findQuote, quoteText } from './quotes.js';\nimport {\n isReadingRouteItemType,\n isRouteStrategyId,\n READING_ROUTE_ITEM_TYPES,\n ROUTE_NOTE_MAX_LENGTH,\n ROUTE_STRATEGIES,\n} from './strategies.js';\n\n/** The codes a route's rules report. Each one's severity is in `DRAFT_ISSUE_SEVERITY`. */\nexport type RouteIssueCode =\n | 'ig_route_stimulus_kind'\n | 'ig_route_body_required'\n | 'ig_route_with_timeline'\n | 'ig_route_shuffle'\n | 'ig_route_item_type'\n | 'ig_route_question_item_unknown'\n | 'ig_route_question_part_required'\n | 'ig_route_question_part_unknown'\n | 'ig_route_question_part_not_allowed'\n | 'ig_route_question_duplicate'\n | 'ig_route_question_missing'\n | 'ig_route_strategy_required'\n | 'ig_route_strategy_unknown'\n | 'ig_route_strategy_item_type'\n | 'ig_route_evidence_required'\n | 'ig_route_quote_not_found'\n | 'ig_route_quote_ambiguous'\n | 'ig_route_keyword_not_in_question'\n | 'ig_route_trap_option_unknown'\n | 'ig_route_trap_on_answer'\n | 'ig_route_note_move_unknown'\n | 'ig_route_note_too_long'\n | 'ig_route_note_reveals_answer'\n | 'ig_route_word_limit_type'\n | 'ig_route_answer_over_limit'\n | 'ig_route_paragraph_labels'\n | 'ig_route_sections';\n\nexport interface RouteIssue {\n code: RouteIssueCode;\n path: (string | number)[];\n message: string;\n}\n\ntype Fields = Record<string, unknown>;\n\nconst isFields = (value: unknown): value is Fields =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst unset = (value: unknown): boolean =>\n value === undefined || value === null || (typeof value === 'string' && value.trim() === '');\n\nconst list = (value: unknown): unknown[] => (Array.isArray(value) ? value : []);\n\n/**\n * Whether an author's note gives a question's answer away. For a choice, a\n * note that names the right option and not every other one; naming them all —\n * \"True if it agrees, False if it contradicts, Not Given if it is silent\" — is\n * the rule, not the answer.\n */\nfunction noteRevealsAnswer(item: unknown, partId: string | undefined, note: string): boolean {\n const accepted = acceptedAnswersOf(item, partId);\n if (accepted.length > 0) {\n const passage = numberedPassage(\n typeof (item as Fields).passage === 'string' ? ((item as Fields).passage as string) : '',\n );\n const position = placeholderPosition(item, partId);\n return accepted.some((answer) => revealsAnswer(note, answer, passage, position));\n }\n const choices = choicesOf(item, partId);\n const words = fold(note);\n const named = choices.filter((choice) => containsWords(words, fold(choice.text)));\n return named.some((choice) => choice.correct) && named.length < choices.length;\n}\n\n/**\n * Every rule the route of `group` breaks. `scope: 'redacted'` checks only what\n * a learner's copy still carries: the evidence, key words, traps and notes are\n * gone from it.\n */\nexport function routeIssues(\n group: unknown,\n scope: 'content' | 'redacted' = 'content',\n): RouteIssue[] {\n if (!isFields(group) || !isFields(group.route)) {\n return [];\n }\n const route = group.route;\n const issues: RouteIssue[] = [];\n const add = (code: RouteIssueCode, path: (string | number)[], message: string): void => {\n issues.push({ code, path, message });\n };\n\n const stimulus = isFields(group.stimulus) ? group.stimulus : undefined;\n const body = typeof stimulus?.body === 'string' ? stimulus.body : '';\n if (\n stimulus !== undefined &&\n !unset(stimulus.kind) &&\n stimulus.kind !== 'text' &&\n stimulus.kind !== 'mixed'\n ) {\n add(\n 'ig_route_stimulus_kind',\n ['stimulus', 'kind'],\n 'A reading route needs a text to read: make the stimulus a text.',\n );\n } else if (stimulus !== undefined && body.trim() === '') {\n add('ig_route_body_required', ['stimulus', 'body'], 'Add the passage the questions are about.');\n }\n if (group.timeline !== undefined && group.timeline !== null) {\n add(\n 'ig_route_with_timeline',\n ['route'],\n 'A group is a reading route or an interactive video, not both.',\n );\n }\n if (group.shuffle === 'within-group') {\n add(\n 'ig_route_shuffle',\n ['shuffle'],\n 'A reading route keeps its questions in paper order: many answers follow the order of the text.',\n );\n }\n\n const items = list(group.items);\n items.forEach((item, index) => {\n if (isFields(item) && !unset(item.type) && !isReadingRouteItemType(item.type)) {\n add(\n 'ig_route_item_type',\n ['items', index, 'type'],\n `A reading route holds ${READING_ROUTE_ITEM_TYPES.join(', ')} questions; \"${String(item.type)}\" is not one of them.`,\n );\n }\n });\n const itemsById = new Map<string, unknown>();\n for (const item of items) {\n if (isFields(item) && typeof item.id === 'string') {\n itemsById.set(item.id, item);\n }\n }\n\n if (body !== '' && route.paragraphLabels !== undefined) {\n const paragraphs = countParagraphs(body);\n if (!Array.isArray(route.paragraphLabels) || route.paragraphLabels.length !== paragraphs) {\n add(\n 'ig_route_paragraph_labels',\n ['route', 'paragraphLabels'],\n `The passage has ${paragraphs} paragraphs (separated by blank lines); give one label for each, or \"\" to leave one unlabelled.`,\n );\n }\n }\n if (body !== '' && Array.isArray(route.sections)) {\n const paragraphs = countParagraphs(body);\n const covered = route.sections.reduce<number>(\n (total, section) =>\n total +\n (isFields(section) && typeof section.paragraphs === 'number' ? section.paragraphs : 0),\n 0,\n );\n if (covered !== paragraphs) {\n add(\n 'ig_route_sections',\n ['route', 'sections'],\n `The sections cover ${covered} paragraphs, but the passage has ${paragraphs}.`,\n );\n }\n }\n\n const seen = new Set<string>();\n const questions = list(route.questions);\n questions.forEach((raw, index) => {\n const at = (...rest: (string | number)[]): (string | number)[] => [\n 'route',\n 'questions',\n index,\n ...rest,\n ];\n if (!isFields(raw)) {\n return;\n }\n const itemId = typeof raw.itemId === 'string' ? raw.itemId : undefined;\n const item = itemId === undefined ? undefined : itemsById.get(itemId);\n if (itemId === undefined || item === undefined) {\n add(\n 'ig_route_question_item_unknown',\n at('itemId'),\n `No item of this group has the id \"${String(raw.itemId)}\".`,\n );\n return;\n }\n const parts = partIdsOf(item);\n const partId = typeof raw.partId === 'string' && raw.partId !== '' ? raw.partId : undefined;\n if (parts === null && partId !== undefined) {\n add(\n 'ig_route_question_part_not_allowed',\n at('partId'),\n 'A multiple-choice item is one question: leave out partId.',\n );\n return;\n }\n if (parts !== null && partId === undefined) {\n add(\n 'ig_route_question_part_required',\n at('partId'),\n 'Name the blank or gap this question is: each one is a question of its own.',\n );\n return;\n }\n if (parts !== null && partId !== undefined && !parts.includes(partId)) {\n add(\n 'ig_route_question_part_unknown',\n at('partId'),\n `Item \"${itemId}\" has no blank or gap \"${partId}\".`,\n );\n return;\n }\n const key = questionKey(itemId, partId);\n if (seen.has(key)) {\n add('ig_route_question_duplicate', at(), `Question \"${key}\" has two entries; keep one.`);\n return;\n }\n seen.add(key);\n\n const type = (item as Fields).type;\n if (unset(raw.strategy)) {\n add(\n 'ig_route_strategy_required',\n at('strategy'),\n 'Choose the reading strategy this question practises.',\n );\n } else if (!isRouteStrategyId(raw.strategy)) {\n add(\n 'ig_route_strategy_unknown',\n at('strategy'),\n `\"${String(raw.strategy)}\" is not a reading strategy.`,\n );\n } else if (\n isReadingRouteItemType(type) &&\n !ROUTE_STRATEGIES[raw.strategy].itemTypes.includes(type)\n ) {\n add(\n 'ig_route_strategy_item_type',\n at('strategy'),\n `The ${ROUTE_STRATEGIES[raw.strategy].title} strategy is written as ${ROUTE_STRATEGIES[raw.strategy].itemTypes.join(' or ')}, not ${String(type)}.`,\n );\n }\n\n if (raw.wordLimit !== undefined) {\n if (type !== 'fill-in-the-blanks') {\n add(\n 'ig_route_word_limit_type',\n at('wordLimit'),\n 'Only a question the learner writes has a word limit.',\n );\n } else if (typeof raw.wordLimit === 'number') {\n const limit = raw.wordLimit;\n for (const answer of acceptedAnswersOf(item, partId)) {\n if (countWords(answer) > limit) {\n add(\n 'ig_route_answer_over_limit',\n at('wordLimit'),\n `The accepted answer \"${answer}\" is longer than ${limit} word${limit === 1 ? '' : 's'}: a learner who writes it would lose the mark.`,\n );\n }\n }\n }\n }\n\n if (scope === 'redacted') {\n return;\n }\n const quote = (value: unknown, path: (string | number)[]): void => {\n if (body === '') {\n return;\n }\n const match = findQuote(body, value);\n if (match.found) {\n return;\n }\n const words = quoteText(value);\n if (match.reason === 'ambiguous') {\n add(\n 'ig_route_quote_ambiguous',\n path,\n `\"${words}\" appears ${match.count} times in the passage. Quote more words, or say which occurrence: { \"text\": ..., \"occurrence\": 2 }.`,\n );\n } else {\n add(\n 'ig_route_quote_not_found',\n path,\n match.reason === 'occurrence'\n ? `\"${words}\" appears only ${match.count} time${match.count === 1 ? '' : 's'} in the passage.`\n : `\"${words}\" is not in the passage. Copy the words exactly as the passage writes them.`,\n );\n }\n };\n\n const evidence = list(raw.evidence);\n if (evidence.length === 0) {\n add(\n 'ig_route_evidence_required',\n at('evidence'),\n 'Quote where the passage justifies the answer — for a Not Given answer, where it discusses the topic.',\n );\n }\n evidence.forEach((value, at2) => {\n quote(value, at('evidence', at2));\n });\n\n const visible = learnerTextOf(item);\n list(raw.keywords).forEach((keyword, at2) => {\n if (!isFields(keyword)) {\n return;\n }\n if (typeof keyword.question === 'string' && !containsPhrase(visible, keyword.question)) {\n add(\n 'ig_route_keyword_not_in_question',\n at('keywords', at2, 'question'),\n `\"${keyword.question}\" is not in the question. Copy the words as the question writes them.`,\n );\n }\n if (keyword.passage !== undefined) {\n quote(keyword.passage, at('keywords', at2, 'passage'));\n }\n });\n list(raw.links).forEach((link, at2) => {\n if (isFields(link)) {\n quote(link.from, at('links', at2, 'from'));\n quote(link.to, at('links', at2, 'to'));\n }\n });\n\n const choices = choicesOf(item, partId);\n list(raw.traps).forEach((trap, at2) => {\n if (!isFields(trap)) {\n return;\n }\n const choice = choices.find((candidate) => candidate.id === trap.optionId);\n if (choice === undefined) {\n add(\n 'ig_route_trap_option_unknown',\n at('traps', at2, 'optionId'),\n `This question has no option or choice \"${String(trap.optionId)}\".`,\n );\n } else if (choice.correct) {\n add(\n 'ig_route_trap_on_answer',\n at('traps', at2, 'optionId'),\n 'A trap is a wrong option; this one is the answer.',\n );\n }\n if (trap.lure !== undefined) {\n quote(trap.lure, at('traps', at2, 'lure'));\n }\n });\n\n if (isFields(raw.notes) && isRouteStrategyId(raw.strategy)) {\n const moves = ROUTE_STRATEGIES[raw.strategy].moves;\n for (const [move, note] of Object.entries(raw.notes)) {\n const path = at('notes', move);\n if (!(moves as readonly string[]).includes(move) || move === 'survey') {\n add(\n 'ig_route_note_move_unknown',\n path,\n `The ${ROUTE_STRATEGIES[raw.strategy].title} strategy has no \"${move}\" step for a question.`,\n );\n continue;\n }\n if (typeof note !== 'string') {\n continue;\n }\n if (note.length > ROUTE_NOTE_MAX_LENGTH) {\n add(\n 'ig_route_note_too_long',\n path,\n `Keep a step's note to ${ROUTE_NOTE_MAX_LENGTH} characters.`,\n );\n } else if (noteRevealsAnswer(item, partId, note)) {\n add(\n 'ig_route_note_reveals_answer',\n path,\n 'This note gives the answer away. Say where to look and why, not what to answer.',\n );\n }\n }\n }\n });\n\n for (const question of itemQuestions(items)) {\n if (\n !seen.has(question.key) &&\n itemsById.has(question.itemId) &&\n isReadingRouteItemType(question.type)\n ) {\n add(\n 'ig_route_question_missing',\n ['route', 'questions'],\n question.partId === undefined\n ? `Question \"${question.itemId}\" has no route entry.`\n : `Blank or gap \"${question.partId}\" of \"${question.itemId}\" has no route entry.`,\n );\n }\n }\n return issues;\n}\n","/**\n * The bounds of an interactive video — an item group with a `timeline`.\n *\n * A leaf module on purpose: the schemas, the authoring checks and the timeline\n * helpers all read these, and nothing here may import any of them back.\n */\n\n/**\n * The item types an interactive video may present. CLOSED on purpose: a type\n * added to the SDK later, or a custom type a host registers, is not silently\n * embeddable. Each one here was chosen, and each works inside a paused video —\n * a read-aloud's and a spoken answer's microphone included, because every quiz\n * pauses the video first.\n *\n * A question's own media is allowed as on any other item, under its own\n * playback policy: a picture to describe, or a recording to answer, which\n * plays only when the learner presses play while the video is paused. A\n * dictation must carry its own recording (the timeline rule).\n *\n * `speaking-response` joined in 1.10.0: a host with an exhaustive `switch` or\n * `Record` over {@link InteractiveVideoItemType} needs one more entry.\n */\nexport const INTERACTIVE_VIDEO_ITEM_TYPES = [\n 'multiple-choice',\n 'fill-in-the-blanks',\n 'gap-select',\n 'dictation',\n 'read-aloud',\n 'speaking-response',\n] as const;\n\n/** One of {@link INTERACTIVE_VIDEO_ITEM_TYPES}. */\nexport type InteractiveVideoItemType = (typeof INTERACTIVE_VIDEO_ITEM_TYPES)[number];\n\n/** Whether `type` is one of the item types an interactive video may present. */\nexport function isInteractiveVideoItemType(type: unknown): type is InteractiveVideoItemType {\n return (INTERACTIVE_VIDEO_ITEM_TYPES as readonly unknown[]).includes(type);\n}\n\n/** The most quizzes one video may hold. */\nexport const TIMELINE_MAX_QUIZZES = 100;\n\n/**\n * The most questions one interactive video may hold, across all its quizzes.\n * The player keeps every one of them mounted, so an answer survives the\n * learner rewinding past its quiz.\n */\nexport const TIMELINE_MAX_ITEMS = 200;\n\n/** The most chapters one video may hold. */\nexport const TIMELINE_MAX_CHAPTERS = 100;\n\n/** The longest quiz or chapter title, in UTF-16 units. A title sits on one line of the player. */\nexport const TIMELINE_MAX_TITLE_LENGTH = 120;\n","import * as z from 'zod/v4';\nimport { routeIssues } from '../reading-route/check.js';\nimport {\n ROUTE_NOTE_MAX_LENGTH,\n ROUTE_STRATEGY_IDS,\n ROUTE_WORD_LIMIT_MAX,\n} from '../reading-route/strategies.js';\nimport { getActivityTypeDescriptor } from '../registry/index.js';\nimport {\n INTERACTIVE_VIDEO_ITEM_TYPES,\n isInteractiveVideoItemType,\n TIMELINE_MAX_CHAPTERS,\n TIMELINE_MAX_ITEMS,\n TIMELINE_MAX_QUIZZES,\n TIMELINE_MAX_TITLE_LENGTH,\n} from '../timeline-limits.js';\nimport type { ActivityData, ValidationError, ValidationResult } from '../types/activity.js';\nimport type { ItemGroup, StimulusKind } from '../types/item-group.js';\nimport { GROUP_CAPTIONS_REVEAL_DICTATION, groupCaptionsField } from './dictation.js';\nimport { MediaSchema, RedactedMediaSchema, ScriptSchema } from './media.js';\nimport { readSchema } from './read-schema.js';\nimport { maxUnits } from './text-length.js';\n\n/**\n * An authored slot key.\n *\n * A `.` is rejected here, not at render time: `flattenSequence` uses the first\n * `.` to separate a group from its item, so a key containing one would produce\n * an ambiguous slot id. `keyOf` already threw on it — this moves the rejection\n * to `validateItemGroup`, where an author finds it, instead of leaving it to\n * surface when a learner opens the paper. Content that would newly fail\n * validation already threw at flatten time, so it can never have been sat.\n */\nconst SlotKeySchema = z\n .string()\n .min(1)\n .refine((key) => !key.includes('.'), {\n error:\n 'slotKey must not contain \".\" — that character separates a group from its item in a slot id, so a key containing one would make the slot ambiguous.',\n });\n\nfunction hasBody(stimulus: { body?: string | undefined }): boolean {\n return typeof stimulus.body === 'string' && stimulus.body.trim().length > 0;\n}\n\n/** Which media types can carry a stimulus of each kind. `text`/`mixed` accept any. */\nfunction mediaFits(kind: StimulusKind, mediaType: string | undefined): boolean {\n switch (kind) {\n case 'audio':\n return mediaType === 'audio';\n case 'video':\n return mediaType === 'video' || mediaType === 'embed';\n case 'image':\n return mediaType === 'image';\n default:\n return true;\n }\n}\n\n/**\n * Zod schema for a {@link Stimulus}. Loose: unknown keys preserved.\n *\n * The semantic guards exist because a stimulus that does not carry what its\n * `kind` promises is an authoring error that must not reach an exam: an\n * \"audio\" stimulus with no recording renders as a blank panel above six\n * listening questions. Unrepresentable in JSON Schema; dropped from\n * `stimulusJsonSchema` by design.\n */\nexport const StimulusSchema = z\n .looseObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: MediaSchema.optional(),\n transcript: z.string().optional(),\n script: ScriptSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n })\n .refine((stimulus) => stimulus.bodyHtml === undefined || hasBody(stimulus), {\n error:\n 'bodyHtml requires a plain-text body: it is the accessible fallback rendered when no sanitiser is supplied.',\n path: ['body'],\n })\n .refine(\n (stimulus) => (stimulus.kind !== 'text' && stimulus.kind !== 'mixed') || hasBody(stimulus),\n {\n error: 'A text or mixed stimulus needs a non-empty body.',\n path: ['body'],\n },\n )\n .refine((stimulus) => stimulus.kind === 'text' || stimulus.media !== undefined, {\n error: 'An audio, video, image or mixed stimulus needs media.',\n path: ['media'],\n })\n .refine(\n (stimulus) => stimulus.media === undefined || mediaFits(stimulus.kind, stimulus.media.type),\n {\n error:\n 'media.type does not fit the stimulus kind: audio needs audio; video needs video or embed; image needs image.',\n path: ['media', 'type'],\n },\n );\n\nconst TimelineTitleSchema = maxUnits(z.string(), TIMELINE_MAX_TITLE_LENGTH).refine(\n (title) => title.trim().length > 0,\n { error: 'A title must not be empty.' },\n);\n\n/** Seconds from the start of the video. zod rejects NaN and ±Infinity itself. */\nconst TimelineTimeSchema = z.number().min(0, { error: 'A time is 0 seconds or more.' });\n\n/**\n * A quiz. STRICT, like every part of a timeline: a misspelt `requried` would\n * otherwise be kept and the quiz silently optional on a paper that believed it\n * was required.\n */\nexport const TimelineCueSchema = z.strictObject({\n id: maxUnits(z.string().min(1), 64),\n at: TimelineTimeSchema,\n itemIds: z.array(z.string().min(1)).min(1).max(TIMELINE_MAX_ITEMS),\n title: TimelineTitleSchema.optional(),\n required: z.boolean().optional(),\n});\n\nexport const TimelineChapterSchema = z.strictObject({\n at: TimelineTimeSchema,\n title: TimelineTitleSchema,\n});\n\n/**\n * A timeline on its own: its quizzes, chapters and navigation. The rules that\n * need the group — every item in exactly one quiz, a video stimulus, the five\n * item types — are {@link timelineIssues}, which both group schemas run.\n */\nexport const MediaTimelineSchema = z\n .strictObject({\n cues: z.array(TimelineCueSchema).max(TIMELINE_MAX_QUIZZES),\n chapters: z.array(TimelineChapterSchema).max(TIMELINE_MAX_CHAPTERS).optional(),\n navigation: z.enum(['free', 'no-skip-ahead']).optional(),\n })\n .check((ctx) => {\n const seen = new Set<string>();\n ctx.value.cues.forEach((cue, index) => {\n if (seen.has(cue.id)) {\n ctx.issues.push({\n code: 'custom',\n input: cue.id,\n message: `Quiz id \"${cue.id}\" is used twice: events, drafts and the contents panel name a quiz by its id.`,\n path: ['cues', index, 'id'],\n });\n }\n seen.add(cue.id);\n });\n // Strictly increasing, not merely sorted: two chapters starting at one\n // moment leave the first with no length, and the scrubber no room to draw it.\n const chapters = ctx.value.chapters ?? [];\n chapters.forEach((chapter, index) => {\n const previous = chapters[index - 1];\n if (previous !== undefined && chapter.at <= previous.at) {\n ctx.issues.push({\n code: 'custom',\n input: chapter.at,\n message: 'Chapter times must be strictly increasing.',\n path: ['chapters', index, 'at'],\n });\n }\n });\n });\n\n/** Words copied from the passage: the words, or the words and which occurrence of them. */\nconst RouteQuoteSchema = z.union([\n z.string().min(1),\n z.strictObject({ text: z.string().min(1), occurrence: z.number().int().min(1).optional() }),\n]);\n\nconst ROUTE_TRAP_KINDS = [\n 'word-match',\n 'opposite',\n 'partial',\n 'outside-knowledge',\n 'too-general',\n 'too-specific',\n 'not-the-question',\n] as const;\n\nconst ROUTE_MOVE_IDS = [\n 'read-instructions',\n 'survey',\n 'keywords',\n 'predict',\n 'locate',\n 'read-around',\n 'paraphrase',\n 'decide',\n 'eliminate',\n 'cohesion',\n 'check-answer',\n 'compare-views',\n] as const;\n\nconst RouteSectionSchema = z.strictObject({\n label: z.string().min(1),\n title: z.string().optional(),\n paragraphs: z.number().int().min(1),\n});\n\n/**\n * One question of a route. STRICT, like every part of a route: a misspelt\n * `evidense` would otherwise leave a question with no evidence and no error.\n * The rules that need the passage or the items are {@link routeIssues}.\n */\nconst RouteQuestionSchema = z.strictObject({\n itemId: z.string().min(1),\n partId: z.string().min(1).optional(),\n strategy: z.enum(ROUTE_STRATEGY_IDS as unknown as [string, ...string[]]),\n evidence: z.array(RouteQuoteSchema).min(1),\n evidenceMatch: z.enum(['any', 'all']).optional(),\n keywords: z\n .array(z.strictObject({ question: z.string().min(1), passage: RouteQuoteSchema.optional() }))\n .optional(),\n links: z.array(z.strictObject({ from: RouteQuoteSchema, to: RouteQuoteSchema })).optional(),\n wordLimit: z.number().int().min(1).max(ROUTE_WORD_LIMIT_MAX).optional(),\n traps: z\n .array(\n z.strictObject({\n optionId: z.string().min(1),\n kind: z.enum(ROUTE_TRAP_KINDS),\n lure: RouteQuoteSchema.optional(),\n }),\n )\n .optional(),\n notes: z\n .partialRecord(z.enum(ROUTE_MOVE_IDS), maxUnits(z.string().min(1), ROUTE_NOTE_MAX_LENGTH))\n .optional(),\n});\n\n/** A route on its own. The rules that span the route, the passage and the items are {@link routeIssues}, which both group schemas run. */\nexport const ReadingRouteSchema = z.strictObject({\n routeVersion: z.literal('1.0'),\n startAt: z.number().int().min(1).optional(),\n paragraphLabels: z.array(z.string()).optional(),\n sections: z.array(RouteSectionSchema).min(1).optional(),\n questions: z.array(RouteQuestionSchema),\n});\n\n/** A route as a learner's copy carries it: which question practises which strategy, and nothing that locates an answer. */\nexport const RedactedReadingRouteSchema = z.strictObject({\n routeVersion: z.literal('1.0'),\n startAt: z.number().int().min(1).optional(),\n paragraphLabels: z.array(z.string()).optional(),\n sections: z.array(RouteSectionSchema).min(1).optional(),\n questions: z.array(\n z.strictObject({\n itemId: z.string().min(1),\n partId: z.string().min(1).optional(),\n strategy: z.enum(ROUTE_STRATEGY_IDS as unknown as [string, ...string[]]),\n wordLimit: z.number().int().min(1).max(ROUTE_WORD_LIMIT_MAX).optional(),\n }),\n ),\n});\n\n/** A URL only this document can resolve, or one that inlines the bytes. */\nfunction isLocalOnlyUrl(url: unknown): boolean {\n return typeof url === 'string' && /^(data|blob):/i.test(url);\n}\n\n/**\n * The rules of an interactive video that span the timeline, the stimulus and\n * the items. Run by the content schema and, for everything but the two\n * authoring-only rules, by the strict redacted schema — a projection built by\n * hand never passed through the content schema.\n *\n * Items are read defensively: the redacted schema leaves them opaque, and each\n * is proven against its own type's schema elsewhere.\n */\nfunction timelineIssues(\n group: {\n stimulus: {\n kind: string;\n media?:\n | {\n type: string;\n url: string;\n poster?: string | undefined;\n tracks?: readonly { src: string }[] | undefined;\n }\n | undefined;\n };\n items: readonly unknown[];\n shuffle?: string | undefined;\n timeline?: { cues: readonly { itemIds: readonly string[] }[] } | undefined;\n },\n scope: 'content' | 'redacted',\n): { path: (string | number)[]; message: string; input: unknown }[] {\n const timeline = group.timeline;\n if (timeline === undefined) {\n return [];\n }\n const issues: { path: (string | number)[]; message: string; input: unknown }[] = [];\n const media = group.stimulus.media;\n\n // Reported at the field that is wrong, so an editor's own check at that path\n // can stand in for it without hiding anything else about the stimulus.\n if (group.stimulus.kind !== 'video') {\n issues.push({\n path: ['stimulus', 'kind'],\n input: group.stimulus.kind,\n message:\n 'An interactive video needs a video stimulus: quizzes open at moments of a video, and nothing else has them.',\n });\n } else if (media !== undefined && media.type !== 'video') {\n issues.push({\n path: ['stimulus', 'media', 'type'],\n input: media.type,\n message:\n 'An interactive video needs a video file. An embedded provider player cannot be paused at the moment a quiz opens.',\n });\n }\n if (group.shuffle === 'within-group') {\n issues.push({\n path: ['shuffle'],\n input: group.shuffle,\n message:\n 'An interactive video presents its questions in the order its quizzes open; shuffle: \"within-group\" cannot apply to it.',\n });\n }\n if (group.items.length > TIMELINE_MAX_ITEMS) {\n issues.push({\n path: ['items'],\n input: group.items.length,\n message: `An interactive video holds at most ${TIMELINE_MAX_ITEMS} questions.`,\n });\n }\n\n const itemIds = new Map<string, number>();\n group.items.forEach((item, index) => {\n const {\n id,\n type,\n media: itemMedia,\n } = (item ?? {}) as { id?: unknown; type?: unknown; media?: unknown };\n if (typeof id === 'string') {\n itemIds.set(id, index);\n }\n if (!isInteractiveVideoItemType(type)) {\n issues.push({\n path: ['items', index, 'type'],\n input: type,\n message: `An interactive video may hold only ${INTERACTIVE_VIDEO_ITEM_TYPES.join(', ')} questions.`,\n });\n }\n // The \"play the stimulus\" fallback a dictation has in a listening group\n // means nothing halfway through a video.\n if (scope === 'content' && type === 'dictation' && itemMedia === undefined) {\n issues.push({\n path: ['items', index, 'media'],\n input: itemMedia,\n message: 'A dictation inside an interactive video needs its own recording.',\n });\n }\n });\n\n const placed = new Set<string>();\n timeline.cues.forEach((cue, cueIndex) => {\n cue.itemIds.forEach((itemId, position) => {\n const path = ['timeline', 'cues', cueIndex, 'itemIds', position];\n if (!itemIds.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `No item in this group has the id \"${itemId}\".`,\n });\n } else if (placed.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `Item \"${itemId}\" is placed twice: every question belongs to exactly one quiz.`,\n });\n }\n placed.add(itemId);\n });\n });\n for (const [itemId, index] of itemIds) {\n if (!placed.has(itemId)) {\n issues.push({\n path: ['items', index],\n input: itemId,\n message: `Item \"${itemId}\" is in no quiz, so the video would never show it.`,\n });\n }\n }\n\n // A `data:` video swells the payload and every fingerprint over it; a stored\n // `blob:` URL means nothing in another document.\n if (scope === 'content' && media !== undefined) {\n const urls: [unknown, (string | number)[]][] = [\n [media.url, ['stimulus', 'media', 'url']],\n [media.poster, ['stimulus', 'media', 'poster']],\n ...(media.tracks ?? []).map((track, index): [unknown, (string | number)[]] => [\n track.src,\n ['stimulus', 'media', 'tracks', index, 'src'],\n ]),\n ];\n for (const [url, path] of urls) {\n if (isLocalOnlyUrl(url)) {\n issues.push({\n path,\n input: url,\n message:\n 'An interactive video is stored and served: its URLs cannot be data: or blob: URLs.',\n });\n }\n }\n }\n return issues;\n}\n\n/**\n * The structural minimum of an item as seen by the CONTAINER schema. Each\n * item's own contract is checked against its registered schema by\n * {@link validateItemGroup} — a zod schema cannot dispatch on a registry\n * that consumers extend at runtime.\n */\nconst ItemShapeSchema = z.looseObject({\n type: z.string().min(1),\n id: z.string().min(1),\n slotKey: SlotKeySchema.optional(),\n});\n\n/**\n * Zod schema for an {@link ItemGroup} CONTAINER. Loose: unknown keys\n * preserved. Validates the group's own fields and the stimulus in full, and\n * each item only structurally (`type` and `id`); use {@link validateItemGroup}\n * to validate the items against their registered schemas as well.\n */\nexport const ItemGroupSchema = z\n .looseObject({\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: StimulusSchema,\n items: z.array(ItemShapeSchema).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n route: ReadingRouteSchema.optional(),\n })\n .refine((group) => group.items.every((item) => item.type !== 'item-group'), {\n error: 'Item groups do not nest: every item must be an activity.',\n path: ['items'],\n })\n .refine((group) => new Set(group.items.map((item) => item.id)).size === group.items.length, {\n error: 'Item ids must be unique within a group.',\n path: ['items'],\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'content')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n for (const { path, message } of routeIssues(ctx.value, 'content')) {\n ctx.issues.push({ code: 'custom', input: ctx.value.route, path, message });\n }\n });\n\n/** Strict learner-safe stimulus: everything but the author-only `transcript`. */\nexport const RedactedStimulusSchema = z.strictObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: RedactedMediaSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n});\n\n/**\n * Strict learner-safe item group. Items are left opaque here — each is proven\n * learner-safe by `assertRedacted` against its OWN type's redacted schema,\n * which is the only place that knowledge lives. The one exception is the one\n * rule that spans the container and an item: a captioned stimulus recording\n * played to a dictation is not learner-safe, because the captions are the\n * dictation's answer.\n */\nexport const RedactedItemGroupSchema = z\n .strictObject({\n redacted: z.literal(true),\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: RedactedStimulusSchema,\n items: z.array(z.unknown()).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n route: RedactedReadingRouteSchema.optional(),\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'redacted')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n for (const { path, message } of routeIssues(ctx.value, 'redacted')) {\n ctx.issues.push({ code: 'custom', input: ctx.value.route, path, message });\n }\n const captions = groupCaptionsField(ctx.value);\n if (captions !== undefined) {\n ctx.issues.push({\n code: 'custom',\n input: ctx.value.stimulus.media?.[captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n path: ['stimulus', 'media', captions],\n });\n }\n });\n\nfunction toValidationErrors(\n issues: readonly { path: readonly PropertyKey[]; message: string; code: string }[],\n prefix: string[],\n): ValidationError[] {\n return issues.map((issue) => ({\n path: [...prefix, ...issue.path.map(String)],\n message: issue.message,\n code: issue.code,\n }));\n}\n\n/**\n * Validates an item group in full: the container and stimulus against\n * {@link ItemGroupSchema}, then every item against the schema registered for\n * its `type`. Errors from items are reported at `items.<index>.…`.\n *\n * Unlike `validateActivity`, an item whose type is not registered is REPORTED\n * (code `unknown_activity_type`) rather than thrown: a group is validated as\n * a whole, and an author fixing a six-item group wants every problem listed,\n * not the first one that happened to throw.\n */\nexport function validateItemGroup(data: unknown): ValidationResult<ItemGroup> {\n const container = ItemGroupSchema.safeParse(data);\n if (!container.success) {\n return { success: false, errors: toValidationErrors(container.error.issues, []) };\n }\n\n const errors: ValidationError[] = [];\n const items: ActivityData[] = [];\n container.data.items.forEach((item, index) => {\n const descriptor = getActivityTypeDescriptor(item.type);\n if (descriptor === undefined) {\n errors.push({\n path: ['items', String(index), 'type'],\n message: `Activity type \"${item.type}\" is not registered`,\n code: 'unknown_activity_type',\n });\n return;\n }\n const parsed = readSchema(descriptor.schema, item, `Activity type \"${descriptor.type}\"`);\n if (!parsed.success) {\n errors.push(...toValidationErrors(parsed.issues, ['items', String(index)]));\n return;\n }\n items.push(parsed.data as ActivityData);\n });\n const captions = groupCaptionsField(container.data);\n if (captions !== undefined) {\n errors.push({\n path: ['stimulus', 'media', captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n code: 'custom',\n });\n }\n\n if (errors.length > 0) {\n return { success: false, errors };\n }\n // zod4 optional outputs are `T | undefined`; the wire type uses exact\n // optionals. Structurally identical at runtime — the cast is type-level.\n return { success: true, data: { ...container.data, items } as unknown as ItemGroup };\n}\n"],"mappings":";;;;AAqBA,MAAa,kBAAkB;AAE/B,MAAM,4BAAY,IAAI,IAAI;CAAC;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;AAAG,CAAC;;AAElE,MAAM,mCAAmB,IAAI,IAAI;CAAC;CAAK;CAAK;CAAK;AAAG,CAAC;AACrD,MAAM,0BAAU,IAAI,IAAI;CAAC;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;AAAG,CAAC;;;;;;AAOpF,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,WAAW,SAAsC,SAAS,KAAA,KAAa,MAAM,KAAK,IAAI;AAC5F,MAAM,WAAW,SAAsC,SA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AM,KAAK,IAAI,MAAM,CAAC;EAC3C,SAAS,MAAM;EACf,MAAM,MAAM;CACd,EAAE;AACJ;;;;;;;;;;;AAYA,SAAgB,kBAAkB,MAA4C;CAC5E,MAAM,YAAY,gBAAgB,UAAU,IAAI;CAChD,IAAI,CAAC,UAAU,SACb,OAAO;EAAE,SAAS;EAAO,QAAQ,mBAAmB,UAAU,MAAM,QAAQ,CAAC,CAAC;CAAE;CAGlF,MAAM,SAA4B,CAAC;CACnC,MAAM,QAAwB,CAAC;CAC/B,UAAU,KAAK,MAAM,SAAS,MAAM,UAAU;EAC5C,MAAM,aAAa,0BAA0B,KAAK,IAAI;EACtD,IAAI,eAAe,KAAA,GAAW;GAC5B,OAAO,KAAK;IACV,MAAM;KAAC;KAAS,OAAO,KAAK;KAAG;IAAM;IACrC,SAAS,kBAAkB,KAAK,KAAK;IACrC,MAAM;GACR,CAAC;GACD;EACF;EACA,MAAM,SAAS,WAAW,WAAW,QAAQ,MAAM,kBAAkB,WAAW,KAAK,EAAE;EACvF,IAAI,CAAC,OAAO,SAAS;GACnB,OAAO,KAAK,GAAG,mBAAmB,OAAO,QAAQ,CAAC,SAAS,OAAO,KAAK,CAAC,CAAC,CAAC;GAC1E;EACF;EACA,MAAM,KAAK,OAAO,IAAoB;CACxC,CAAC;CACD,MAAM,WAAW,mBAAmB,UAAU,IAAI;CAClD,IAAI,aAAa,KAAA,GACf,OAAO,KAAK;EACV,MAAM;GAAC;GAAY;GAAS;EAAQ;EACpC,SAAS;EACT,MAAM;CACR,CAAC;CAGH,IAAI,OAAO,SAAS,GAClB,OAAO;EAAE,SAAS;EAAO;CAAO;CAIlC,OAAO;EAAE,SAAS;EAAM,MAAM;GAAE,GAAG,UAAU;GAAM;EAAM;CAA0B;AACrF"}
@@ -2301,6 +2301,33 @@ const DRAFT_ISSUE_SEVERITY = {
2301
2301
  ig_timeline_dictation_media: "incomplete",
2302
2302
  ig_timeline_chapter_order: "invalid",
2303
2303
  ig_timeline_chapter_title: "incomplete",
2304
+ ig_route_stimulus_kind: "invalid",
2305
+ ig_route_body_required: "incomplete",
2306
+ ig_route_with_timeline: "invalid",
2307
+ ig_route_shuffle: "invalid",
2308
+ ig_route_item_type: "invalid",
2309
+ ig_route_question_item_unknown: "invalid",
2310
+ ig_route_question_part_required: "incomplete",
2311
+ ig_route_question_part_unknown: "invalid",
2312
+ ig_route_question_part_not_allowed: "invalid",
2313
+ ig_route_question_duplicate: "invalid",
2314
+ ig_route_question_missing: "incomplete",
2315
+ ig_route_strategy_required: "incomplete",
2316
+ ig_route_strategy_unknown: "invalid",
2317
+ ig_route_strategy_item_type: "invalid",
2318
+ ig_route_evidence_required: "incomplete",
2319
+ ig_route_quote_not_found: "invalid",
2320
+ ig_route_quote_ambiguous: "invalid",
2321
+ ig_route_keyword_not_in_question: "invalid",
2322
+ ig_route_trap_option_unknown: "invalid",
2323
+ ig_route_trap_on_answer: "invalid",
2324
+ ig_route_note_move_unknown: "invalid",
2325
+ ig_route_note_too_long: "invalid",
2326
+ ig_route_note_reveals_answer: "invalid",
2327
+ ig_route_word_limit_type: "invalid",
2328
+ ig_route_answer_over_limit: "invalid",
2329
+ ig_route_paragraph_labels: "invalid",
2330
+ ig_route_sections: "invalid",
2304
2331
  gs_passage_required: "incomplete",
2305
2332
  gs_gaps_required: "incomplete",
2306
2333
  gs_gap_id_required: "invalid",
@@ -6484,4 +6511,4 @@ Object.defineProperty(exports, "writtenResponseType", {
6484
6511
  }
6485
6512
  });
6486
6513
 
6487
- //# sourceMappingURL=registry-C9O9txy5.cjs.map
6514
+ //# sourceMappingURL=registry-RPfZZEqi.cjs.map