@intellectif/lk-react 12.0.1 → 13.0.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 (104) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +8 -5
  3. package/dist/{WrittenResponse-BgcpEM-e.d.ts → WrittenResponse-B5p_-RnJ.d.ts} +1 -1
  4. package/dist/{WrittenResponse-ByzXYEoW.d.cts → WrittenResponse-DWtS4tOL.d.cts} +1 -1
  5. package/dist/{chunk-NK5EVL5C.cjs → chunk-2GXSA322.cjs} +14 -14
  6. package/dist/{chunk-NK5EVL5C.cjs.map → chunk-2GXSA322.cjs.map} +1 -1
  7. package/dist/{chunk-CK7Z275S.js → chunk-3Q4I4KT6.js} +22 -2
  8. package/dist/chunk-3Q4I4KT6.js.map +1 -0
  9. package/dist/{chunk-QXYAOILF.js → chunk-5N7OLFHB.js} +5 -5
  10. package/dist/{chunk-QXYAOILF.js.map → chunk-5N7OLFHB.js.map} +1 -1
  11. package/dist/{chunk-KSXEBV2H.cjs → chunk-74QXBWCI.cjs} +6 -6
  12. package/dist/{chunk-KSXEBV2H.cjs.map → chunk-74QXBWCI.cjs.map} +1 -1
  13. package/dist/{chunk-ZFWC4KZC.js → chunk-DQERNAWI.js} +3 -3
  14. package/dist/{chunk-ZFWC4KZC.js.map → chunk-DQERNAWI.js.map} +1 -1
  15. package/dist/{chunk-GVBEI5R3.cjs → chunk-HT4FFZZQ.cjs} +20 -16
  16. package/dist/chunk-HT4FFZZQ.cjs.map +1 -0
  17. package/dist/chunk-J73TDY7J.cjs +913 -0
  18. package/dist/chunk-J73TDY7J.cjs.map +1 -0
  19. package/dist/{chunk-EWTAMY6L.cjs → chunk-K3EA547J.cjs} +5 -5
  20. package/dist/{chunk-EWTAMY6L.cjs.map → chunk-K3EA547J.cjs.map} +1 -1
  21. package/dist/{chunk-G6PUWKQC.cjs → chunk-K7NMNOPI.cjs} +14 -14
  22. package/dist/{chunk-G6PUWKQC.cjs.map → chunk-K7NMNOPI.cjs.map} +1 -1
  23. package/dist/{chunk-KYOCDRUO.cjs → chunk-MA7GXUWC.cjs} +22 -2
  24. package/dist/chunk-MA7GXUWC.cjs.map +1 -0
  25. package/dist/{chunk-5IH3NRXE.js → chunk-NVP6UEQQ.js} +4 -4
  26. package/dist/{chunk-5IH3NRXE.js.map → chunk-NVP6UEQQ.js.map} +1 -1
  27. package/dist/{chunk-6KMEB7TF.cjs → chunk-NVUFEMPZ.cjs} +28 -15
  28. package/dist/chunk-NVUFEMPZ.cjs.map +1 -0
  29. package/dist/chunk-PSHNTDKG.js +911 -0
  30. package/dist/chunk-PSHNTDKG.js.map +1 -0
  31. package/dist/{chunk-5S2YDMEJ.js → chunk-PY53ABWC.js} +22 -9
  32. package/dist/chunk-PY53ABWC.js.map +1 -0
  33. package/dist/{chunk-2Y6V5E7H.js → chunk-R7DI5UMU.js} +57 -7
  34. package/dist/chunk-R7DI5UMU.js.map +1 -0
  35. package/dist/{chunk-FX7VMZHQ.cjs → chunk-SBIJJ374.cjs} +58 -8
  36. package/dist/chunk-SBIJJ374.cjs.map +1 -0
  37. package/dist/{chunk-64AJVB6O.cjs → chunk-UU2NV6SU.cjs} +13 -13
  38. package/dist/{chunk-64AJVB6O.cjs.map → chunk-UU2NV6SU.cjs.map} +1 -1
  39. package/dist/{chunk-ZFSRMGWO.js → chunk-W4MXRZAB.js} +5 -5
  40. package/dist/{chunk-ZFSRMGWO.js.map → chunk-W4MXRZAB.js.map} +1 -1
  41. package/dist/{chunk-XKGBD3UK.js → chunk-XAGWBVK3.js} +5 -5
  42. package/dist/{chunk-XKGBD3UK.js.map → chunk-XAGWBVK3.js.map} +1 -1
  43. package/dist/{chunk-V6M57YMK.js → chunk-YILH4ETT.js} +13 -9
  44. package/dist/chunk-YILH4ETT.js.map +1 -0
  45. package/dist/{chunk-GWD75Q25.js → chunk-YZWXVZB3.js} +5 -5
  46. package/dist/{chunk-GWD75Q25.js.map → chunk-YZWXVZB3.js.map} +1 -1
  47. package/dist/{chunk-LIHKQEIP.cjs → chunk-Z63JRG4M.cjs} +14 -14
  48. package/dist/{chunk-LIHKQEIP.cjs.map → chunk-Z63JRG4M.cjs.map} +1 -1
  49. package/dist/components/ActivityPreview.cjs +10 -9
  50. package/dist/components/ActivityPreview.d.cts +2 -2
  51. package/dist/components/ActivityPreview.d.ts +2 -2
  52. package/dist/components/ActivityPreview.js +9 -8
  53. package/dist/components/ActivitySequence.cjs +11 -10
  54. package/dist/components/ActivitySequence.d.cts +6 -4
  55. package/dist/components/ActivitySequence.d.ts +6 -4
  56. package/dist/components/ActivitySequence.js +10 -9
  57. package/dist/components/Dictation.cjs +17 -0
  58. package/dist/components/Dictation.cjs.map +1 -0
  59. package/dist/components/Dictation.d.cts +16 -0
  60. package/dist/components/Dictation.d.ts +16 -0
  61. package/dist/components/Dictation.js +8 -0
  62. package/dist/components/Dictation.js.map +1 -0
  63. package/dist/components/FillInTheBlanks.cjs +5 -5
  64. package/dist/components/FillInTheBlanks.d.cts +1 -1
  65. package/dist/components/FillInTheBlanks.d.ts +1 -1
  66. package/dist/components/FillInTheBlanks.js +4 -4
  67. package/dist/components/GapSelect.cjs +5 -5
  68. package/dist/components/GapSelect.d.cts +1 -1
  69. package/dist/components/GapSelect.d.ts +1 -1
  70. package/dist/components/GapSelect.js +4 -4
  71. package/dist/components/MultipleChoice.cjs +5 -5
  72. package/dist/components/MultipleChoice.d.cts +1 -1
  73. package/dist/components/MultipleChoice.d.ts +1 -1
  74. package/dist/components/MultipleChoice.js +4 -4
  75. package/dist/components/StimulusPanel.cjs +4 -4
  76. package/dist/components/StimulusPanel.d.cts +1 -1
  77. package/dist/components/StimulusPanel.d.ts +1 -1
  78. package/dist/components/StimulusPanel.js +3 -3
  79. package/dist/components/WrittenResponse.cjs +5 -5
  80. package/dist/components/WrittenResponse.d.cts +3 -3
  81. package/dist/components/WrittenResponse.d.ts +3 -3
  82. package/dist/components/WrittenResponse.js +4 -4
  83. package/dist/i18n/LkIntlProvider.cjs +7 -7
  84. package/dist/i18n/LkIntlProvider.d.cts +2 -2
  85. package/dist/i18n/LkIntlProvider.d.ts +2 -2
  86. package/dist/i18n/LkIntlProvider.js +1 -1
  87. package/dist/index.cjs +31 -26
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.d.cts +3 -2
  90. package/dist/index.d.ts +3 -2
  91. package/dist/index.js +11 -10
  92. package/dist/index.js.map +1 -1
  93. package/dist/{strings-CN7n-BlE.d.cts → strings-DPTyLpHt.d.cts} +49 -6
  94. package/dist/{strings-CN7n-BlE.d.ts → strings-DPTyLpHt.d.ts} +49 -6
  95. package/dist/theme/skin.css +454 -0
  96. package/package.json +13 -3
  97. package/dist/chunk-2Y6V5E7H.js.map +0 -1
  98. package/dist/chunk-5S2YDMEJ.js.map +0 -1
  99. package/dist/chunk-6KMEB7TF.cjs.map +0 -1
  100. package/dist/chunk-CK7Z275S.js.map +0 -1
  101. package/dist/chunk-FX7VMZHQ.cjs.map +0 -1
  102. package/dist/chunk-GVBEI5R3.cjs.map +0 -1
  103. package/dist/chunk-KYOCDRUO.cjs.map +0 -1
  104. package/dist/chunk-V6M57YMK.js.map +0 -1
@@ -0,0 +1,913 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ var chunkK3EA547J_cjs = require('./chunk-K3EA547J.cjs');
5
+ var chunkSBIJJ374_cjs = require('./chunk-SBIJJ374.cjs');
6
+ var chunkXOR4MPEN_cjs = require('./chunk-XOR4MPEN.cjs');
7
+ var chunkMA7GXUWC_cjs = require('./chunk-MA7GXUWC.cjs');
8
+ var lkCore = require('@intellectif/lk-core');
9
+ var react = require('react');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+
12
+ // src/i18n/direction.ts
13
+ var RTL_SCRIPT_CODES = /* @__PURE__ */ new Set([
14
+ "phlv",
15
+ "adlm",
16
+ "arab",
17
+ "aran",
18
+ "armi",
19
+ "avst",
20
+ "chrs",
21
+ "cprt",
22
+ "elym",
23
+ "gara",
24
+ "hatr",
25
+ "hebr",
26
+ "hung",
27
+ "khar",
28
+ "lydi",
29
+ "mand",
30
+ "mani",
31
+ "mend",
32
+ "merc",
33
+ "mero",
34
+ "narb",
35
+ "nbat",
36
+ "nkoo",
37
+ "orkh",
38
+ "ougr",
39
+ "palm",
40
+ "phli",
41
+ "phlp",
42
+ "phnx",
43
+ "prti",
44
+ "rohg",
45
+ "samr",
46
+ "sarb",
47
+ "sidt",
48
+ "sogd",
49
+ "sogo",
50
+ "syrc",
51
+ "syre",
52
+ "syrj",
53
+ "syrn",
54
+ "thaa",
55
+ "yezi"
56
+ ]);
57
+ var RTL_LANGUAGES = /* @__PURE__ */ new Set([
58
+ "acm",
59
+ "aeb",
60
+ "aii",
61
+ "ajp",
62
+ "apc",
63
+ "ar",
64
+ "arc",
65
+ "ars",
66
+ "ary",
67
+ "arz",
68
+ "azb",
69
+ "bqi",
70
+ "ckb",
71
+ "dv",
72
+ "fa",
73
+ "glk",
74
+ "hbo",
75
+ "he",
76
+ "iw",
77
+ "ji",
78
+ "jrb",
79
+ "khw",
80
+ "lrc",
81
+ "mzn",
82
+ "nqo",
83
+ "ota",
84
+ "pnb",
85
+ "prs",
86
+ "ps",
87
+ "sdh",
88
+ "skr",
89
+ "syc",
90
+ "syr",
91
+ "ur",
92
+ "yi"
93
+ ]);
94
+ var RTL_BLOCKS = [
95
+ [1424, 2303],
96
+ [64285, 65023],
97
+ [65136, 65279],
98
+ [67584, 69631],
99
+ [124928, 126975]
100
+ ];
101
+ var RTL_DIGITS = [
102
+ [1984, 1993],
103
+ [125127, 125135],
104
+ [125264, 125273]
105
+ ];
106
+ var LETTER_RE = /^\p{L}$/u;
107
+ var NUMBER_RE = /^\p{N}$/u;
108
+ function within(point, ranges) {
109
+ return ranges.some(([first, last]) => point >= first && point <= last);
110
+ }
111
+ function scriptSubtagOf(subtags) {
112
+ if (subtags[0].length === 1) {
113
+ return void 0;
114
+ }
115
+ let index = 1;
116
+ while (index < subtags.length && index <= 3 && /^[a-z]{3}$/.test(subtags[index])) {
117
+ index += 1;
118
+ }
119
+ const candidate = subtags[index];
120
+ if (candidate === void 0 || !/^[a-z]{4}$/.test(candidate)) {
121
+ return void 0;
122
+ }
123
+ return /^z/.test(candidate) || candidate >= "qaaa" && candidate <= "qabx" ? void 0 : candidate;
124
+ }
125
+ function localeDirectionOf(locale) {
126
+ if (typeof locale !== "string") {
127
+ return void 0;
128
+ }
129
+ const subtags = locale.toLowerCase().split(/[-_]/);
130
+ const script = scriptSubtagOf(subtags);
131
+ if (script !== void 0) {
132
+ return RTL_SCRIPT_CODES.has(script) ? "rtl" : "ltr";
133
+ }
134
+ return RTL_LANGUAGES.has(subtags[0]) ? "rtl" : void 0;
135
+ }
136
+ var LEFT_TO_RIGHT_MARK = String.fromCodePoint(8206);
137
+ var RIGHT_TO_LEFT_MARKS = /* @__PURE__ */ new Set([String.fromCodePoint(8207), String.fromCodePoint(1564)]);
138
+ function textDirectionOf(text) {
139
+ for (const character of text) {
140
+ if (character === LEFT_TO_RIGHT_MARK) {
141
+ return "ltr";
142
+ }
143
+ if (RIGHT_TO_LEFT_MARKS.has(character)) {
144
+ return "rtl";
145
+ }
146
+ if (LETTER_RE.test(character)) {
147
+ return within(character.codePointAt(0), RTL_BLOCKS) ? "rtl" : "ltr";
148
+ }
149
+ }
150
+ return void 0;
151
+ }
152
+ function characterDirectionOf(character) {
153
+ const point = character.codePointAt(0);
154
+ if (NUMBER_RE.test(character)) {
155
+ return within(point, RTL_DIGITS) ? "rtl" : "ltr";
156
+ }
157
+ if (LETTER_RE.test(character)) {
158
+ return within(point, RTL_BLOCKS) ? "rtl" : "ltr";
159
+ }
160
+ return void 0;
161
+ }
162
+ var TEXT_CHANGED_DEBOUNCE_MS = 500;
163
+ var VISUALLY_HIDDEN = {
164
+ position: "absolute",
165
+ width: 1,
166
+ height: 1,
167
+ margin: -1,
168
+ padding: 0,
169
+ overflow: "hidden",
170
+ clip: "rect(0 0 0 0)",
171
+ clipPath: "inset(50%)",
172
+ whiteSpace: "nowrap",
173
+ border: 0
174
+ };
175
+ var recordingsGroupCount = 0;
176
+ var UNSPELLED_RE = new RegExp(
177
+ `^[\\p{P}\\p{Cc}\\p{Cf}\\p{Default_Ignorable_Code_Point}${String.fromCodePoint(180, 96, 65344, 700, 1600, 2042)}]*$`,
178
+ "u"
179
+ );
180
+ var HINT_SPACE_RE = new RegExp(
181
+ `(?:(?!${String.fromCodePoint(65279)})\\s|${String.fromCodePoint(133)})+`,
182
+ "u"
183
+ );
184
+ var VISIBLE_TEXT_RE = /[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u;
185
+ var BULLET = "\u2022";
186
+ var LEFT_TO_RIGHT_MARK2 = String.fromCodePoint(8206);
187
+ var RIGHT_TO_LEFT_MARK = String.fromCodePoint(8207);
188
+ var EXTENDING_RE = new RegExp(
189
+ `^[\\p{M}${String.fromCodePoint(8204, 8205, 3635, 3763)}${String.fromCodePoint(127995)}-${String.fromCodePoint(127999)}${String.fromCodePoint(917536)}-${String.fromCodePoint(917631)}${String.fromCodePoint(4448)}-${String.fromCodePoint(4607)}${String.fromCodePoint(55216)}-${String.fromCodePoint(55295)}]$`,
190
+ "u"
191
+ );
192
+ var STACKING_VIRAMAS = new Set(
193
+ [
194
+ 2381,
195
+ 2509,
196
+ 2765,
197
+ 2893,
198
+ 3149,
199
+ 3277,
200
+ 3405,
201
+ 4153,
202
+ 6098,
203
+ 6752,
204
+ 6980,
205
+ 43456,
206
+ 69702,
207
+ 69939
208
+ ].map((point) => String.fromCodePoint(point))
209
+ );
210
+ var SUBJOINED_AFTER = new Map([
211
+ ...[2608, 2607, 2613].map(
212
+ (point) => [
213
+ String.fromCodePoint(point),
214
+ (before) => before.at(-1) === String.fromCodePoint(2637)
215
+ ]
216
+ ),
217
+ [
218
+ String.fromCodePoint(2999),
219
+ (before) => before.at(-1) === String.fromCodePoint(3021) && before.at(-2) === String.fromCodePoint(2965)
220
+ ],
221
+ [
222
+ String.fromCodePoint(2992),
223
+ (before) => before.at(-1) === String.fromCodePoint(3021) && before.at(-2) === String.fromCodePoint(3e3)
224
+ ]
225
+ ]);
226
+ var JOINABLE_VIRAMAS = /* @__PURE__ */ new Set([...STACKING_VIRAMAS, String.fromCodePoint(3530)]);
227
+ var ZERO_WIDTH_JOINER = String.fromCodePoint(8205);
228
+ var PREPENDED = /* @__PURE__ */ new Set([String.fromCodePoint(3406), String.fromCodePoint(6158)]);
229
+ var ARABIC_LAM = String.fromCodePoint(1604);
230
+ var LIGATING_ALEFS = new Set(
231
+ [1570, 1571, 1573, 1575, 1649, 1650, 1651, 1653].map(
232
+ (point) => String.fromCodePoint(point)
233
+ )
234
+ );
235
+ var REGIONAL_INDICATOR_RE = /^[\u{1f1e6}-\u{1f1ff}]$/u;
236
+ var LETTER_RE2 = /^\p{L}$/u;
237
+ var LETTER_WITH_REQUIRED_LIGATURES_RE = /(?![\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}])\p{L}/u;
238
+ var DIGIT_RE = /^\p{Nd}$/u;
239
+ var NUMBER_SIGN_RE = new RegExp(
240
+ `^[\\p{Sc}${String.fromCodePoint(176, 177, 8240, 8241, 8494, 8723)}]$`,
241
+ "u"
242
+ );
243
+ var ARABIC_LETTER_BLOCKS = [
244
+ [1536, 1983],
245
+ [2144, 2303],
246
+ [64336, 65023],
247
+ [65136, 65279]
248
+ ];
249
+ function textOf(response) {
250
+ return response !== void 0 && response.type === "dictation" ? response.text : "";
251
+ }
252
+ function hintsOf(response) {
253
+ if (response === void 0 || response.type !== "dictation") {
254
+ return 0;
255
+ }
256
+ const revealed = response.hintsRevealed;
257
+ return typeof revealed === "number" && Number.isInteger(revealed) && revealed > 0 ? revealed : 0;
258
+ }
259
+ function responseOf(text, hintsRevealed) {
260
+ return { type: "dictation", text, ...hintsRevealed > 0 ? { hintsRevealed } : {} };
261
+ }
262
+ function slowMediaFor(data, label) {
263
+ const slow = data.slowMedia;
264
+ if (slow === void 0) {
265
+ return void 0;
266
+ }
267
+ const policy = data.media?.playback ?? {};
268
+ const { maxPlays: _budget, ...inherited } = policy;
269
+ const hasPolicy = Object.values(inherited).some((value) => value !== void 0);
270
+ return {
271
+ type: "audio",
272
+ url: slow.url,
273
+ alt: slow.alt ?? label,
274
+ ...hasPolicy ? { playback: inherited } : {}
275
+ };
276
+ }
277
+ function hintWordsOf(transcript) {
278
+ const words = [];
279
+ let leading = "";
280
+ for (const token of transcript.split(HINT_SPACE_RE)) {
281
+ if (token === "") {
282
+ continue;
283
+ }
284
+ const last = words.length - 1;
285
+ if (!UNSPELLED_RE.test(token.normalize("NFC"))) {
286
+ words.push(leading === "" ? token : `${leading} ${token}`);
287
+ leading = "";
288
+ } else if (last >= 0) {
289
+ words[last] = `${words[last]} ${token}`;
290
+ } else {
291
+ leading = leading === "" ? token : `${leading} ${token}`;
292
+ }
293
+ }
294
+ return words;
295
+ }
296
+ function wordsFromDetails(details) {
297
+ if (details.length === 0 || !details.every((detail) => /^w\d+$/.test(detail.itemId))) {
298
+ return null;
299
+ }
300
+ return details.map((detail) => {
301
+ const attempt = Array.isArray(detail.learnerResponse) ? detail.learnerResponse.join(" ") : detail.learnerResponse;
302
+ const reference = Array.isArray(detail.correctResponse) ? detail.correctResponse.join(" ") : detail.correctResponse;
303
+ const correct = detail.outcome !== void 0 ? detail.outcome === "correct" : detail.correct;
304
+ const missing = detail.outcome === "incorrect-omission" || !correct && attempt === "";
305
+ return {
306
+ itemId: detail.itemId,
307
+ reference,
308
+ attempt,
309
+ similarity: detail.score ?? (correct ? 1 : 0),
310
+ status: correct ? "correct" : missing ? "missing" : "incorrect"
311
+ };
312
+ });
313
+ }
314
+ function extendsCluster(before, shown) {
315
+ const previous = before.at(-1);
316
+ if (EXTENDING_RE.test(shown)) {
317
+ return true;
318
+ }
319
+ if (LETTER_RE2.test(shown)) {
320
+ if (STACKING_VIRAMAS.has(previous) || PREPENDED.has(previous) || SUBJOINED_AFTER.get(shown)?.(before) === true) {
321
+ return true;
322
+ }
323
+ if (previous === ZERO_WIDTH_JOINER && JOINABLE_VIRAMAS.has(before.at(-2))) {
324
+ return true;
325
+ }
326
+ }
327
+ if (previous === ARABIC_LAM && LIGATING_ALEFS.has(shown)) {
328
+ return true;
329
+ }
330
+ return REGIONAL_INDICATOR_RE.test(shown) && before.length % 2 === 1 && before.every((character) => REGIONAL_INDICATOR_RE.test(character));
331
+ }
332
+ function characterOf(op) {
333
+ return op.reference === "" ? op.attempt : op.reference;
334
+ }
335
+ function isArabicLetter(character) {
336
+ const point = character?.codePointAt(0);
337
+ return point !== void 0 && LETTER_RE2.test(character) && ARABIC_LETTER_BLOCKS.some(([first, last]) => point >= first && point <= last);
338
+ }
339
+ function bulletDirections(ops, contentDir) {
340
+ const own = ops.map((op) => characterDirectionOf(characterOf(op)));
341
+ const before = [];
342
+ const arabicBefore = [];
343
+ let lastDirection;
344
+ let lastLetterArabic = false;
345
+ ops.forEach((op, index) => {
346
+ before[index] = lastDirection;
347
+ arabicBefore[index] = lastLetterArabic;
348
+ lastDirection = own[index] ?? lastDirection;
349
+ if (LETTER_RE2.test(characterOf(op))) {
350
+ lastLetterArabic = isArabicLetter(characterOf(op));
351
+ }
352
+ });
353
+ const after = [];
354
+ let nextDirection;
355
+ for (let index = ops.length - 1; index >= 0; index -= 1) {
356
+ after[index] = nextDirection;
357
+ nextDirection = own[index] ?? nextDirection;
358
+ }
359
+ const directions = /* @__PURE__ */ new Map();
360
+ ops.forEach((op, index) => {
361
+ if (op.op !== "missing") {
362
+ return;
363
+ }
364
+ const neighbourIsDigit = [ops[index - 1], ops[index + 1]].some(
365
+ (neighbour) => neighbour !== void 0 && DIGIT_RE.test(characterOf(neighbour))
366
+ );
367
+ directions.set(
368
+ index,
369
+ own[index] ?? (NUMBER_SIGN_RE.test(characterOf(op)) && neighbourIsDigit && !arabicBefore[index] ? "ltr" : before[index] !== void 0 && before[index] === after[index] ? before[index] : contentDir ?? before[index] ?? after[index])
370
+ );
371
+ });
372
+ return directions;
373
+ }
374
+ function clusterOpOf(ops) {
375
+ if (ops[0].op === "missing") {
376
+ return "missing";
377
+ }
378
+ const wrong = new Set(ops.map((op) => op.op).filter((kind) => kind !== "equal"));
379
+ if (wrong.size === 0) {
380
+ return "equal";
381
+ }
382
+ return wrong.size === 1 ? [...wrong][0] : "substitute";
383
+ }
384
+ function clustersOf(ops, contentDir) {
385
+ const bullets = bulletDirections(ops, contentDir);
386
+ const groups = [];
387
+ ops.forEach((op, index) => {
388
+ const shown = op.op === "missing" ? BULLET : op.attempt;
389
+ const current = groups.at(-1);
390
+ if (current !== void 0 && op.op !== "missing" && (current.ops[0].op === "missing" ? EXTENDING_RE.test(shown) : extendsCluster(current.shown, shown))) {
391
+ current.ops.push(op);
392
+ current.shown.push(shown);
393
+ return;
394
+ }
395
+ const direction = bullets.get(index);
396
+ groups.push({
397
+ ops: [op],
398
+ shown: [shown],
399
+ ...direction !== void 0 ? { bullet: direction } : {}
400
+ });
401
+ });
402
+ const clusters = [];
403
+ for (const group of groups) {
404
+ const mark = group.bullet === void 0 ? "" : group.bullet === "rtl" ? RIGHT_TO_LEFT_MARK : LEFT_TO_RIGHT_MARK2;
405
+ const cluster = { op: clusterOpOf(group.ops), text: `${mark}${group.shown.join("")}${mark}` };
406
+ const previous = clusters.at(-1);
407
+ if (previous !== void 0 && previous.op === "equal" && cluster.op === "equal") {
408
+ previous.text += cluster.text;
409
+ } else {
410
+ clusters.push(cluster);
411
+ }
412
+ }
413
+ return clusters;
414
+ }
415
+ function CharOps({
416
+ ops,
417
+ contentDir
418
+ }) {
419
+ return clustersOf(ops, contentDir).map((cluster, index) => /* @__PURE__ */ jsxRuntime.jsx(
420
+ "span",
421
+ {
422
+ className: "lk-dc-op",
423
+ "data-op": cluster.op,
424
+ ...LETTER_WITH_REQUIRED_LIGATURES_RE.test(cluster.text) ? {} : { "data-ligatures": "decorative" },
425
+ "aria-hidden": "true",
426
+ children: cluster.text
427
+ },
428
+ index
429
+ ));
430
+ }
431
+ function AnnouncementText({ announcement }) {
432
+ if (announcement === null) {
433
+ return null;
434
+ }
435
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
436
+ announcement.text,
437
+ announcement.feedback ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
438
+ " ",
439
+ /* @__PURE__ */ jsxRuntime.jsx("span", { dir: "auto", children: announcement.feedback })
440
+ ] }) : null
441
+ ] });
442
+ }
443
+ function Dictation({
444
+ data,
445
+ onComplete,
446
+ onSubmit,
447
+ onChange,
448
+ onInteraction,
449
+ value,
450
+ defaultValue,
451
+ defaultSubmitted,
452
+ renderMode = "practice",
453
+ outcome,
454
+ mediaBudget,
455
+ mediaStrings,
456
+ strings,
457
+ theme,
458
+ locale,
459
+ disabled
460
+ }) {
461
+ const isExam = renderMode === "exam";
462
+ const isReview = renderMode === "review";
463
+ const s = chunkMA7GXUWC_cjs.useLkStrings(strings);
464
+ const hasKey = typeof data.transcript === "string";
465
+ const devError = react.useMemo(() => {
466
+ if (!chunkK3EA547J_cjs.isDevelopment()) {
467
+ return null;
468
+ }
469
+ if (data.redacted === true) {
470
+ if (hasKey) {
471
+ const shape = data;
472
+ return shape.type === "dictation" && typeof shape.id === "string" && typeof shape.title === "string" ? null : new Error(
473
+ "Dictation received a revealed projection (redacted: true with a transcript) that is not a dictation: `type`, `id` and `title` are required."
474
+ );
475
+ }
476
+ try {
477
+ lkCore.assertRedacted(data);
478
+ return null;
479
+ } catch (error) {
480
+ return error instanceof Error ? error : new Error(String(error));
481
+ }
482
+ }
483
+ const result2 = lkCore.validateActivity("dictation", data);
484
+ return result2.success ? null : new lkCore.ActivitySchemaError("dictation", result2.errors);
485
+ }, [data, hasKey]);
486
+ const { state, start, complete, getTimeSpent, reset } = chunkXOR4MPEN_cjs.useActivityState(
487
+ defaultSubmitted === true ? "completed" : "idle"
488
+ );
489
+ const isControlled = value !== void 0;
490
+ const [internalText, setInternalText] = react.useState(() => textOf(defaultValue));
491
+ const [internalRevealed, setInternalRevealed] = react.useState(() => hintsOf(defaultValue));
492
+ const [result, setResult] = react.useState(null);
493
+ const [summary, setSummary] = react.useState(null);
494
+ const [solutionShown, setSolutionShown] = react.useState(false);
495
+ const text = isControlled ? textOf(value) : internalText;
496
+ const revealed = isControlled ? hintsOf(value) : internalRevealed;
497
+ const defaultValueRef = react.useRef(defaultValue);
498
+ react.useEffect(() => {
499
+ defaultValueRef.current = defaultValue;
500
+ }, [defaultValue]);
501
+ const defaultSubmittedRef = react.useRef(defaultSubmitted);
502
+ react.useEffect(() => {
503
+ defaultSubmittedRef.current = defaultSubmitted;
504
+ }, [defaultSubmitted]);
505
+ const lastDataRef = react.useRef(data);
506
+ react.useEffect(() => {
507
+ if (lastDataRef.current === data) {
508
+ return;
509
+ }
510
+ lastDataRef.current = data;
511
+ setInternalText(textOf(defaultValueRef.current));
512
+ setInternalRevealed(hintsOf(defaultValueRef.current));
513
+ setResult(null);
514
+ setSummary(null);
515
+ setSolutionShown(false);
516
+ reset(defaultSubmittedRef.current === true ? "completed" : "idle");
517
+ }, [data, reset]);
518
+ const textChangedRef = react.useRef(
519
+ null
520
+ );
521
+ react.useEffect(
522
+ () => () => {
523
+ if (textChangedRef.current !== null) {
524
+ clearTimeout(textChangedRef.current.timer);
525
+ }
526
+ },
527
+ []
528
+ );
529
+ const revealButtonRef = react.useRef(null);
530
+ const ids = react.useId();
531
+ const hintId = `${ids}-hint`;
532
+ const titleId = `${ids}-title`;
533
+ const solutionId = `${ids}-solution`;
534
+ const [recordingsGroup] = react.useState(() => {
535
+ recordingsGroupCount += 1;
536
+ return `lk-dc-recordings-${recordingsGroupCount}`;
537
+ });
538
+ const slowMedia = react.useMemo(
539
+ () => slowMediaFor(data, s.dictationSlowRecording),
540
+ [data, s.dictationSlowRecording]
541
+ );
542
+ if (devError) {
543
+ throw devError;
544
+ }
545
+ if (data.redacted === true && renderMode === "practice") {
546
+ throw new Error(
547
+ `Dictation "${data.id}" received redacted activity data in renderMode "practice", which grades locally and has no answer key to grade against. Render redacted data with renderMode="exam" (server grades) or "review" (pass \`outcome\`).`
548
+ );
549
+ }
550
+ const submitted = state === "completed";
551
+ const inactive = disabled === true || submitted || isReview;
552
+ const revealing = isReview ? outcome?.status === "scored" : !isExam && submitted;
553
+ const transcript = isExam || !hasKey ? void 0 : data.transcript;
554
+ const hintWords = react.useMemo(
555
+ () => transcript === void 0 ? [] : hintWordsOf(transcript),
556
+ [transcript]
557
+ );
558
+ const hintsOffered = data.hints?.mode === "progressive-words" && !isExam && !isReview && transcript !== void 0;
559
+ const hintsEnabled = hintsOffered && !submitted;
560
+ const hintTotal = hintWords.length;
561
+ const hintsShown = Math.min(revealed, hintTotal);
562
+ const reportedHints = hintsOffered ? hintsShown : 0;
563
+ const fireInteraction = (type, payload) => {
564
+ onInteraction?.({ type, activityId: data.id, timestamp: Date.now(), payload });
565
+ };
566
+ const flushTextChanged = () => {
567
+ const pending = textChangedRef.current;
568
+ if (pending === null) {
569
+ return;
570
+ }
571
+ clearTimeout(pending.timer);
572
+ textChangedRef.current = null;
573
+ fireInteraction("text-changed", { length: pending.length });
574
+ };
575
+ const handleTextChange = (next) => {
576
+ if (inactive) {
577
+ return;
578
+ }
579
+ if (state === "idle") {
580
+ start();
581
+ }
582
+ if (!isControlled) {
583
+ setInternalText(next);
584
+ }
585
+ onChange?.(responseOf(next, reportedHints));
586
+ if (onInteraction === void 0) {
587
+ return;
588
+ }
589
+ if (textChangedRef.current !== null) {
590
+ clearTimeout(textChangedRef.current.timer);
591
+ }
592
+ textChangedRef.current = {
593
+ length: next.length,
594
+ timer: setTimeout(() => {
595
+ const pending = textChangedRef.current;
596
+ textChangedRef.current = null;
597
+ if (pending !== null) {
598
+ fireInteraction("text-changed", { length: pending.length });
599
+ }
600
+ }, TEXT_CHANGED_DEBOUNCE_MS)
601
+ };
602
+ };
603
+ const setRevealed = (next) => {
604
+ if (!isControlled) {
605
+ setInternalRevealed(next);
606
+ }
607
+ onChange?.(responseOf(text, next));
608
+ };
609
+ const revealNextHint = () => {
610
+ if (inactive || hintsShown >= hintTotal) {
611
+ return;
612
+ }
613
+ if (state === "idle") {
614
+ start();
615
+ }
616
+ const next = hintsShown + 1;
617
+ setRevealed(next);
618
+ fireInteraction("hint-requested", { revealed: next, total: hintTotal });
619
+ };
620
+ const resetHints = () => {
621
+ if (inactive || hintsShown === 0) {
622
+ return;
623
+ }
624
+ revealButtonRef.current?.focus();
625
+ setRevealed(0);
626
+ };
627
+ const handleSubmit = (event) => {
628
+ event.preventDefault();
629
+ if (inactive) {
630
+ return;
631
+ }
632
+ const response = responseOf(text, reportedHints);
633
+ onSubmit?.(response);
634
+ flushTextChanged();
635
+ if (isExam) {
636
+ complete();
637
+ setSummary({ text: s.answerSubmitted, feedback: null });
638
+ fireInteraction("submitted", { length: text.length, hintsRevealed: reportedHints });
639
+ return;
640
+ }
641
+ const scoringResult = lkCore.score("dictation", data, response);
642
+ complete();
643
+ const timeSpent = getTimeSpent();
644
+ const xapiStatement = lkCore.xAPIBuilder.buildAnsweredStatement({
645
+ actor: chunkK3EA547J_cjs.ANONYMOUS_ACTOR,
646
+ object: {
647
+ id: chunkK3EA547J_cjs.objectIdFor(data.id),
648
+ name: { [data.locale ?? "en-US"]: data.title },
649
+ ...lkCore.xapiDefinitionFor(data)
650
+ },
651
+ scoringResult,
652
+ timeSpentMs: timeSpent,
653
+ response: response.text
654
+ });
655
+ setResult(scoringResult);
656
+ onComplete?.({
657
+ score: scoringResult.score,
658
+ maxScore: scoringResult.maxScore,
659
+ passed: scoringResult.passed,
660
+ timeSpent,
661
+ xapiStatement
662
+ });
663
+ const correctWords = scoringResult.details.filter(
664
+ (detail) => (detail.outcome ?? (detail.correct ? "correct" : "incorrect")) === "correct"
665
+ ).length;
666
+ setSummary({
667
+ text: `${s.answerSubmitted} ${s.scoreAnnouncement(
668
+ Math.round(scoringResult.score * 100),
669
+ scoringResult.passed
670
+ )} ${s.dictationWordsSummary(correctWords, scoringResult.details.length)}`,
671
+ feedback: scoringResult.feedback
672
+ });
673
+ fireInteraction("submitted", {
674
+ length: text.length,
675
+ hintsRevealed: reportedHints,
676
+ score: scoringResult.score
677
+ });
678
+ };
679
+ const given = isControlled ? value : defaultValue;
680
+ const hasResponse = given !== void 0 && given.type === "dictation";
681
+ const contentLang = typeof data.locale === "string" ? data.locale.replaceAll("_", "-") : void 0;
682
+ const localeDir = localeDirectionOf(data.locale);
683
+ const alignment = react.useMemo(
684
+ () => revealing && transcript !== void 0 && (!isReview || hasResponse) ? lkCore.alignDictation(data, text) : null,
685
+ [revealing, transcript, isReview, hasResponse, data, text]
686
+ );
687
+ const sentenceDiff = react.useMemo(
688
+ () => alignment !== null && alignment.attempt !== "" ? lkCore.diffDictationChars(alignment.reference, alignment.attempt) : null,
689
+ [alignment]
690
+ );
691
+ const detailWords = react.useMemo(
692
+ () => isReview && alignment === null && outcome?.status === "scored" ? wordsFromDetails(outcome.details) : null,
693
+ [isReview, alignment, outcome]
694
+ );
695
+ const words = alignment?.words ?? detailWords;
696
+ const marksShown = revealing && words !== null;
697
+ const contentDir = localeDir ?? textDirectionOf(transcript ?? words?.map((word) => word.reference).join(" ") ?? "");
698
+ const nothingTyped = alignment !== null ? alignment.attempt === "" : words?.every((word) => word.attempt === "") ?? false;
699
+ const passed = isReview ? outcome?.status === "scored" || outcome?.status === "graded" ? outcome.passed : void 0 : result?.passed;
700
+ const reviewSummary = react.useMemo(() => {
701
+ if (!isReview || outcome === void 0) {
702
+ return null;
703
+ }
704
+ if (outcome.status === "scored") {
705
+ return {
706
+ text: s.scoreAnnouncement(Math.round(outcome.score * 100), outcome.passed),
707
+ feedback: outcome.feedback
708
+ };
709
+ }
710
+ if (outcome.status === "deferred") {
711
+ return { text: s.notGradedYet, feedback: null };
712
+ }
713
+ if (outcome.status === "graded") {
714
+ const percent = outcome.maxScore > 0 ? Math.round(outcome.score / outcome.maxScore * 100) : Math.round(outcome.score * 100);
715
+ return {
716
+ text: s.scoreAnnouncement(percent, outcome.passed),
717
+ feedback: outcome.feedback ?? null
718
+ };
719
+ }
720
+ return { text: s.noGradeAvailable, feedback: null };
721
+ }, [isReview, outcome, s]);
722
+ const sentenceFor = (word) => {
723
+ switch (word.status) {
724
+ case "correct":
725
+ return s.dictationWordCorrect(word.attempt);
726
+ case "incorrect":
727
+ return s.dictationWordWrong(word.attempt, word.reference);
728
+ case "missing":
729
+ return s.dictationWordMissing(word.reference);
730
+ default:
731
+ return s.dictationWordExtra(word.attempt);
732
+ }
733
+ };
734
+ const acceptedTranscripts = transcript === void 0 || !Array.isArray(data.acceptedTranscripts) ? void 0 : data.acceptedTranscripts.filter((entry) => typeof entry === "string");
735
+ return /* @__PURE__ */ jsxRuntime.jsxs(
736
+ "form",
737
+ {
738
+ className: "lk-dc",
739
+ "aria-labelledby": VISIBLE_TEXT_RE.test(data.title) ? titleId : void 0,
740
+ lang: locale,
741
+ "data-render-mode": renderMode,
742
+ style: theme,
743
+ onSubmit: handleSubmit,
744
+ children: [
745
+ /* @__PURE__ */ jsxRuntime.jsx("p", { id: titleId, className: "lk-dc-title", dir: localeDir ?? "auto", lang: contentLang, children: data.title }),
746
+ data.media !== void 0 || slowMedia !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lk-dc-recordings", children: [
747
+ data.media !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "lk-dc-recording", children: [
748
+ /* @__PURE__ */ jsxRuntime.jsx("legend", { className: "lk-dc-recording-label", children: s.dictationRecording }),
749
+ /* @__PURE__ */ jsxRuntime.jsx(
750
+ chunkSBIJJ374_cjs.ActivityMedia,
751
+ {
752
+ media: data.media,
753
+ renderMode,
754
+ playbackGroup: recordingsGroup,
755
+ ...mediaBudget !== void 0 ? { mediaBudget } : {},
756
+ ...mediaStrings !== void 0 ? { mediaStrings } : {},
757
+ ...strings !== void 0 ? { strings } : {},
758
+ ...onInteraction !== void 0 ? { onInteraction } : {},
759
+ ...locale !== void 0 ? { locale } : {},
760
+ ...disabled !== void 0 ? { disabled } : {}
761
+ }
762
+ )
763
+ ] }) : null,
764
+ slowMedia !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "lk-dc-recording", "data-slow": "true", children: [
765
+ /* @__PURE__ */ jsxRuntime.jsx("legend", { className: "lk-dc-recording-label", children: s.dictationSlowRecording }),
766
+ /* @__PURE__ */ jsxRuntime.jsx(
767
+ chunkSBIJJ374_cjs.ActivityMedia,
768
+ {
769
+ media: slowMedia,
770
+ renderMode,
771
+ playbackGroup: recordingsGroup,
772
+ ...mediaStrings !== void 0 ? { mediaStrings } : {},
773
+ ...strings !== void 0 ? { strings } : {},
774
+ ...locale !== void 0 ? { locale } : {},
775
+ ...disabled !== void 0 ? { disabled } : {}
776
+ }
777
+ )
778
+ ] }) : null
779
+ ] }) : null,
780
+ hintsEnabled ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lk-dc-hints", children: [
781
+ /* @__PURE__ */ jsxRuntime.jsx(
782
+ "button",
783
+ {
784
+ ref: revealButtonRef,
785
+ type: "button",
786
+ className: "lk-dc-hint-btn",
787
+ disabled: inactive,
788
+ "aria-disabled": hintsShown >= hintTotal || void 0,
789
+ onClick: revealNextHint,
790
+ children: s.dictationRevealNextWord(hintsShown, hintTotal)
791
+ }
792
+ ),
793
+ hintsShown > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
794
+ "button",
795
+ {
796
+ type: "button",
797
+ className: "lk-dc-hint-reset",
798
+ disabled: inactive,
799
+ onClick: resetHints,
800
+ children: s.dictationResetHints
801
+ }
802
+ ) : null,
803
+ /* @__PURE__ */ jsxRuntime.jsx("p", { id: hintId, className: "lk-dc-hint", role: "status", dir: contentDir, lang: contentLang, children: hintsShown > 0 ? `${hintWords.slice(0, hintsShown).join(" ")}${hintsShown < hintTotal ? " \u2026" : ""}` : "" })
804
+ ] }) : null,
805
+ /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { disabled: inactive, children: [
806
+ /* @__PURE__ */ jsxRuntime.jsx(
807
+ "textarea",
808
+ {
809
+ className: "lk-dc-input",
810
+ "aria-label": s.dictationInputLabel,
811
+ "aria-describedby": hintsEnabled && hintsShown > 0 ? hintId : void 0,
812
+ dir: "auto",
813
+ rows: 3,
814
+ maxLength: lkCore.DICTATION_MAX_TEXT_LENGTH,
815
+ autoComplete: "off",
816
+ autoCapitalize: "none",
817
+ autoCorrect: "off",
818
+ spellCheck: false,
819
+ value: text,
820
+ disabled: inactive,
821
+ "aria-disabled": inactive || void 0,
822
+ "data-correct": revealing && passed !== void 0 && (!isReview || hasResponse) ? String(passed) : void 0,
823
+ onChange: (event) => handleTextChange(event.target.value)
824
+ }
825
+ ),
826
+ isReview ? null : (
827
+ // Enabled on empty text: an omission is a recorded answer.
828
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: inactive, children: isExam ? s.submitAnswers : s.checkAnswers })
829
+ )
830
+ ] }),
831
+ marksShown ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lk-dc-result", children: [
832
+ nothingTyped ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lk-dc-nothing", role: "note", children: s.dictationNothingTyped }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
833
+ /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "lk-dc-words", "aria-label": s.dictationMarksLabel, dir: contentDir, children: words?.map((word, index) => {
834
+ const sentence = sentenceFor(word);
835
+ return /* @__PURE__ */ jsxRuntime.jsxs(
836
+ "li",
837
+ {
838
+ className: "lk-dc-word",
839
+ "data-state": word.status,
840
+ title: sentence,
841
+ children: [
842
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lk-visually-hidden", style: VISUALLY_HIDDEN, children: sentence }),
843
+ /* @__PURE__ */ jsxRuntime.jsx(
844
+ "span",
845
+ {
846
+ className: "lk-dc-word-text",
847
+ "aria-hidden": "true",
848
+ dir: contentDir ?? "auto",
849
+ lang: contentLang,
850
+ ...word.status === "incorrect" && alignment !== null ? { "data-marks": "characters" } : {},
851
+ children: word.status === "incorrect" && alignment !== null ? /* @__PURE__ */ jsxRuntime.jsx(
852
+ CharOps,
853
+ {
854
+ ops: lkCore.diffDictationChars(word.reference, word.attempt),
855
+ contentDir
856
+ }
857
+ ) : word.status === "missing" ? word.reference : word.attempt
858
+ }
859
+ )
860
+ ]
861
+ },
862
+ index
863
+ );
864
+ }) }),
865
+ sentenceDiff !== null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lk-dc-diff", "aria-hidden": "true", dir: contentDir, lang: contentLang, children: /* @__PURE__ */ jsxRuntime.jsx(CharOps, { ops: sentenceDiff, contentDir }) }) : null,
866
+ /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: "lk-dc-legend", children: [
867
+ /* @__PURE__ */ jsxRuntime.jsx("li", { "data-state": "correct", children: s.dictationLegendCorrect }),
868
+ /* @__PURE__ */ jsxRuntime.jsx("li", { "data-state": "incorrect", children: s.dictationLegendWrong }),
869
+ /* @__PURE__ */ jsxRuntime.jsx("li", { "data-state": "missing", children: s.dictationLegendMissing }),
870
+ alignment !== null ? /* @__PURE__ */ jsxRuntime.jsx("li", { "data-state": "extra", children: s.dictationLegendExtra }) : null
871
+ ] }),
872
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lk-dc-diff-note", children: s.dictationDiffNote })
873
+ ] }),
874
+ transcript !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
875
+ /* @__PURE__ */ jsxRuntime.jsx(
876
+ "button",
877
+ {
878
+ type: "button",
879
+ className: "lk-dc-solution-toggle",
880
+ "aria-expanded": solutionShown,
881
+ "aria-controls": solutionId,
882
+ onClick: () => setSolutionShown((shown) => !shown),
883
+ children: solutionShown ? s.hideSolution : s.showSolution
884
+ }
885
+ ),
886
+ solutionShown ? /* @__PURE__ */ jsxRuntime.jsxs(
887
+ "blockquote",
888
+ {
889
+ id: solutionId,
890
+ className: "lk-dc-solution",
891
+ "aria-label": s.dictationSolutionLabel,
892
+ dir: contentDir,
893
+ children: [
894
+ /* @__PURE__ */ jsxRuntime.jsx("p", { lang: contentLang, children: transcript }),
895
+ acceptedTranscripts !== void 0 && acceptedTranscripts.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "lk-dc-solution-alternatives", lang: contentLang, children: acceptedTranscripts.map((alternative) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: alternative }, alternative)) }) : null
896
+ ]
897
+ }
898
+ ) : null
899
+ ] }) : null
900
+ ] }) : null,
901
+ /* @__PURE__ */ jsxRuntime.jsx(chunkK3EA547J_cjs.FeedbackRegion, { id: `${data.id}-feedback`, children: /* @__PURE__ */ jsxRuntime.jsx(AnnouncementText, { announcement: isReview ? reviewSummary : summary }) })
902
+ ]
903
+ }
904
+ );
905
+ }
906
+ function Dictation2(props) {
907
+ const strings = chunkMA7GXUWC_cjs.useLkStrings(props.strings);
908
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkK3EA547J_cjs.ActivityErrorBoundary, { activityTitle: props.data?.title, strings, children: /* @__PURE__ */ jsxRuntime.jsx(Dictation, { ...props }) });
909
+ }
910
+
911
+ exports.Dictation = Dictation2;
912
+ //# sourceMappingURL=chunk-J73TDY7J.cjs.map
913
+ //# sourceMappingURL=chunk-J73TDY7J.cjs.map