@pie-element/inline-dropdown 10.1.2-next.2 → 10.1.2-next.20

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 (38) hide show
  1. package/author.js +2 -0
  2. package/dist/author/index.d.ts +1 -0
  3. package/dist/author/index.js +5 -2
  4. package/dist/author/inline-dropdown-toolbar.d.ts +1 -0
  5. package/dist/author/inline-dropdown-toolbar.js +18 -20
  6. package/dist/author/main.js +1 -1
  7. package/dist/author/markupUtils.js +1 -1
  8. package/dist/browser/{Close-ihSzAQyP.js → Close-DJv6MCxq.js} +2284 -2310
  9. package/dist/browser/Close-DJv6MCxq.js.map +1 -0
  10. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  11. package/dist/browser/author/index.js +15785 -20430
  12. package/dist/browser/author/index.js.map +1 -1
  13. package/dist/browser/controller/index.js +3 -3
  14. package/dist/browser/controller/index.js.map +1 -1
  15. package/dist/browser/delivery/index.js +298 -208
  16. package/dist/browser/delivery/index.js.map +1 -1
  17. package/dist/browser/{dist-CAsDMEWi.js → dist-BJd6t-uW.js} +6 -2
  18. package/dist/browser/dist-BJd6t-uW.js.map +1 -0
  19. package/dist/browser/editor-runtime/Close-CYmIbifw.js +9005 -0
  20. package/dist/browser/editor-runtime/Close-CYmIbifw.js.map +1 -0
  21. package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
  22. package/dist/browser/editor-runtime/author/index.js +19547 -0
  23. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  24. package/dist/browser/editor-runtime/controller/index.js +196 -0
  25. package/dist/browser/editor-runtime/controller/index.js.map +1 -0
  26. package/dist/browser/editor-runtime/delivery/index.js +2804 -0
  27. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  28. package/dist/browser/editor-runtime/dist-BJd6t-uW.js +137 -0
  29. package/dist/browser/editor-runtime/dist-BJd6t-uW.js.map +1 -0
  30. package/dist/browser/editor-runtime/rolldown-runtime-CHQKHQ89.js +32 -0
  31. package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
  32. package/dist/delivery/index.js +2 -2
  33. package/dist/delivery/inline-dropdown.js +1 -1
  34. package/dist/index.iife.js +34 -34
  35. package/package.json +36 -23
  36. package/dist/browser/Close-ihSzAQyP.js.map +0 -1
  37. package/dist/browser/dist-CAsDMEWi.js.map +0 -1
  38. package/dist/browser/inline-dropdown.css +0 -2
@@ -0,0 +1,2804 @@
1
+ import { a as e } from "../rolldown-runtime-CHQKHQ89.js";
2
+ import { It as t, L as n, Rt as r, S as i, a, d as o, dt as s, f as c, i as l, j as u, k as d, m as f, n as p, o as m, p as h, pt as g, t as _, ut as v, v as y, w as b } from "../Close-CYmIbifw.js";
3
+ import { _ as x, o as S } from "../dist-BJd6t-uW.js";
4
+ import C, { useRef as w } from "react";
5
+ import { createRoot as T } from "react-dom/client";
6
+ import E from "react-dom";
7
+ import { Fragment as ee, jsx as D, jsxs as O } from "react/jsx-runtime";
8
+ //#region ../../shared/player-events/dist/index.js
9
+ var te = class e extends CustomEvent {
10
+ static {
11
+ this.TYPE = "model-set";
12
+ }
13
+ constructor(t, n, r) {
14
+ super(e.TYPE, {
15
+ bubbles: !0,
16
+ composed: !0,
17
+ detail: {
18
+ complete: n,
19
+ component: t,
20
+ hasModel: r
21
+ }
22
+ }), this.component = t, this.complete = n;
23
+ }
24
+ }, ne = class e extends CustomEvent {
25
+ static {
26
+ this.TYPE = "session-changed";
27
+ }
28
+ constructor(t, n) {
29
+ super(e.TYPE, {
30
+ bubbles: !0,
31
+ composed: !0,
32
+ detail: {
33
+ complete: n,
34
+ component: t
35
+ }
36
+ }), this.component = t, this.complete = n;
37
+ }
38
+ }, k = /* @__PURE__ */ e(t(), 1), re = "height ease-in 300ms, opacity ease-in 300ms", ie = g("div")(() => ({
39
+ position: "relative",
40
+ height: 0,
41
+ overflow: "hidden",
42
+ display: "flex",
43
+ visibility: "hidden",
44
+ width: 0,
45
+ "&.enter": {
46
+ transition: re,
47
+ opacity: 1,
48
+ height: "auto",
49
+ width: "auto",
50
+ visibility: "visible",
51
+ minHeight: "25px"
52
+ },
53
+ "&.enter-done": {
54
+ height: "auto",
55
+ visibility: "visible",
56
+ width: "auto",
57
+ minHeight: "25px"
58
+ },
59
+ "&.exit": {
60
+ transition: re,
61
+ opacity: 0,
62
+ height: 0,
63
+ visibility: "visible",
64
+ width: 0
65
+ },
66
+ "&.exit-done": {
67
+ opacity: 0,
68
+ visibility: "hidden",
69
+ height: 0,
70
+ width: 0
71
+ }
72
+ })), ae = (e) => {
73
+ let { show: t, children: n, className: r } = e, i = w(null);
74
+ return /* @__PURE__ */ D(s, {
75
+ nodeRef: i,
76
+ in: t,
77
+ appear: !0,
78
+ mountOnEnter: !1,
79
+ timeout: 300,
80
+ classNames: {
81
+ enter: "enter",
82
+ enterDone: "enter-done",
83
+ exit: "exit",
84
+ exitDone: "exit-done"
85
+ },
86
+ children: /* @__PURE__ */ D(ie, {
87
+ ref: i,
88
+ className: r,
89
+ children: n
90
+ })
91
+ });
92
+ };
93
+ ae.propTypes = {
94
+ show: k.default.bool.isRequired,
95
+ className: k.default.string,
96
+ children: k.default.oneOfType([k.default.arrayOf(k.default.node), k.default.node]).isRequired
97
+ };
98
+ //#endregion
99
+ //#region ../../lib-react/icons/dist/correct-response-icon.js
100
+ var oe = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ O("svg", {
101
+ preserveAspectRatio: "xMinYMin meet",
102
+ version: "1.1",
103
+ viewBox: "-283 359 34 35",
104
+ style: { enableBackground: "new -283 359 34 35" },
105
+ children: [
106
+ /* @__PURE__ */ D("circle", {
107
+ cx: "-266",
108
+ cy: "375.9",
109
+ r: "14",
110
+ fill: e
111
+ }),
112
+ /* @__PURE__ */ D("path", {
113
+ d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
114
+ fill: e
115
+ }),
116
+ /* @__PURE__ */ D("polygon", {
117
+ points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",
118
+ fill: t
119
+ })
120
+ ]
121
+ });
122
+ oe.propTypes = {
123
+ bgFill: k.default.string.isRequired,
124
+ fgFill: k.default.string.isRequired
125
+ };
126
+ var se = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ O("svg", {
127
+ preserveAspectRatio: "xMinYMin meet",
128
+ version: "1.1",
129
+ viewBox: "-129.5 127 34 35",
130
+ style: { enableBackground: "new -129.5 127 34 35" },
131
+ children: [
132
+ /* @__PURE__ */ D("path", {
133
+ style: {
134
+ fill: "#D0CAC5",
135
+ stroke: "#E6E3E0",
136
+ strokeWidth: .75,
137
+ strokeMiterlimit: 10
138
+ },
139
+ d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\n C-97.4,153.5-104.3,160.4-112.9,160.4z"
140
+ }),
141
+ /* @__PURE__ */ D("path", {
142
+ style: {
143
+ fill: "#B3ABA4",
144
+ stroke: "#CDC7C2",
145
+ strokeWidth: .5,
146
+ strokeMiterlimit: 10
147
+ },
148
+ d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"
149
+ }),
150
+ /* @__PURE__ */ D("circle", {
151
+ cx: "-114.2",
152
+ cy: "143.5",
153
+ r: "14",
154
+ fill: e
155
+ }),
156
+ /* @__PURE__ */ D("path", {
157
+ d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
158
+ fill: n
159
+ }),
160
+ /* @__PURE__ */ D("polygon", {
161
+ points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
162
+ fill: t
163
+ })
164
+ ]
165
+ });
166
+ se.propTypes = {
167
+ bgFill: k.default.string.isRequired,
168
+ fgFill: k.default.string.isRequired,
169
+ borderFill: k.default.string.isRequired
170
+ };
171
+ var ce = g("div")(({ size: e }) => ({
172
+ width: e || "25px",
173
+ height: e || "25px"
174
+ })), A = ({ open: e, size: t }) => /* @__PURE__ */ D(ce, {
175
+ size: t,
176
+ children: e ? /* @__PURE__ */ D(oe, {
177
+ bgFill: "#bce2ff",
178
+ fgFill: "#1a9cff"
179
+ }) : /* @__PURE__ */ D(se, {
180
+ bgFill: "white",
181
+ fgFill: "#1a9cff",
182
+ borderFill: "#bce2ff"
183
+ })
184
+ });
185
+ A.propTypes = {
186
+ open: k.default.bool,
187
+ size: k.default.string
188
+ }, A.defaultProps = { open: !1 };
189
+ //#endregion
190
+ //#region ../../shared/translator/dist/en.js
191
+ var le = {
192
+ translation: {
193
+ categorize: {
194
+ limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
195
+ maxChoicesPerCategoryRestriction: "To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."
196
+ },
197
+ ebsr: { part: "Part {{index}}" },
198
+ numberLine: {
199
+ addElementLimit_one: "You can only add {{count}} element",
200
+ addElementLimit_other: "You can only add {{count}} elements",
201
+ clearAll: "Clear all"
202
+ },
203
+ imageClozeAssociation: {
204
+ reachedLimit_one: "You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",
205
+ reachedLimit_other: "Full"
206
+ },
207
+ drawingResponse: {
208
+ fillColor: "Fill color",
209
+ outlineColor: "Outline color",
210
+ noFill: "No fill",
211
+ lightblue: "Light blue",
212
+ lightyellow: "Light yellow",
213
+ red: "Red",
214
+ orange: "Orange",
215
+ yellow: "Yellow",
216
+ violet: "Violet",
217
+ blue: "Blue",
218
+ green: "Green",
219
+ white: "White",
220
+ black: "Black",
221
+ onDoubleClick: "Double click to edit this text. Press Enter to submit."
222
+ },
223
+ charting: {
224
+ addCategory: "Add category",
225
+ actions: "Actions",
226
+ add: "Add",
227
+ delete: "Delete",
228
+ newLabel: "New label",
229
+ reachedLimit_other: "There can't be more than {{count}} categories.",
230
+ keyLegend: {
231
+ incorrectAnswer: "Student incorrect answer",
232
+ correctAnswer: "Student correct answer",
233
+ correctKeyAnswer: "Answer key correct"
234
+ }
235
+ },
236
+ graphing: {
237
+ point: "Point",
238
+ circle: "Circle",
239
+ line: "Line",
240
+ parabola: "Parabola",
241
+ absolute: "Absolute Value",
242
+ exponential: "Exponential",
243
+ polygon: "Polygon",
244
+ ray: "Ray",
245
+ segment: "Segment",
246
+ sine: "Sine",
247
+ vector: "Vector",
248
+ label: "Label",
249
+ redo: "Redo",
250
+ reset: "Reset"
251
+ },
252
+ mathInline: { primaryCorrectWithAlternates: "Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct." },
253
+ mcPopulatedBlank: {
254
+ answerChoices: "Answer choices",
255
+ blankLabel: "blank",
256
+ emptyBlank: "(blank)",
257
+ blankPreSelectionHint: "The answer you choose will appear on the blank line above.",
258
+ correctAnswerSelected: "Correct answer selected",
259
+ incorrectAnswerSelected: "Incorrect answer selected",
260
+ selectedAnswerImage: "Selected answer image",
261
+ choiceImage: "Choice {{id}}",
262
+ clickToEnableAutoplay: "Click to enable audio autoplay",
263
+ audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
264
+ listen: "Listen",
265
+ listenSilentAlt: "Repeat instructions",
266
+ listenPlayingAlt: "Instructions are playing",
267
+ printAudio: "Audio:",
268
+ printTranscript: "Transcript:"
269
+ },
270
+ multipleChoice: {
271
+ minSelections: "Select at least {{minSelections}}.",
272
+ maxSelections_one: "Only {{maxSelections}} answer is allowed.",
273
+ maxSelections_other: "Only {{maxSelections}} answers are allowed.",
274
+ minmaxSelections_equal: "Select {{minSelections}}.",
275
+ minmaxSelections_range: "Select between {{minSelections}} and {{maxSelections}}."
276
+ },
277
+ selectText: {
278
+ correctAnswerSelected: "Correct",
279
+ correctAnswerNotSelected: "Correct Answer Not Selected",
280
+ incorrectSelection: "Incorrect Selection",
281
+ key: "Key"
282
+ },
283
+ simpleCloze: {
284
+ correctAnswerShown: "Correct answer",
285
+ correct: "Correct",
286
+ incorrect: "Incorrect",
287
+ unanswered: "No answer",
288
+ placeholder: "Enter your answer...",
289
+ answerInput: "Your answer",
290
+ printCorrectAnswer: "Correct answer:",
291
+ printAnswerBlank: "Answer blank"
292
+ },
293
+ vennClassification: {
294
+ tray: "Tiles to classify",
295
+ unknownTarget: "unknown",
296
+ cancelled: "Cancelled",
297
+ returnedToTray: "{{name}} returned to tray",
298
+ placedIn: "{{name}} placed in {{target}}",
299
+ pickedUp: "Picked up {{name}}",
300
+ pickedUpWithKeyboard: "Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.",
301
+ dropTarget: "Drop target: {{target}}",
302
+ unsupportedCircles_one: "This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.",
303
+ unsupportedCircles_other: "This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.",
304
+ setNumber: "Set {{number}}",
305
+ regionOnly: "{{set}} only",
306
+ regionNeither: "Neither {{first}} nor {{second}}",
307
+ regionNoneOf: "None of {{sets}}",
308
+ regionAndSeparator: " and ",
309
+ tileFallbackName: "Tile",
310
+ tileNotPlaced: "not placed",
311
+ tileInRegion: "in {{region}}",
312
+ tileCorrect: "correct",
313
+ tileIncorrect: "incorrect"
314
+ }
315
+ },
316
+ common: {
317
+ undo: "Undo",
318
+ clearAll: "Clear all",
319
+ correct: "Correct",
320
+ incorrect: "Incorrect",
321
+ showCorrectAnswer: "Show correct answer",
322
+ hideCorrectAnswer: "Hide correct answer",
323
+ showTeacherInstructions: "Show Teacher Instructions",
324
+ hideTeacherInstructions: "Hide Teacher Instructions",
325
+ commonCorrectAnswerWithAlternates: "Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",
326
+ warning: "Warning",
327
+ showNote: "Show Note",
328
+ hideNote: "Hide Note",
329
+ cancel: "Cancel"
330
+ }
331
+ }, ue = {
332
+ translation: {
333
+ categorize: {
334
+ limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
335
+ maxChoicesPerCategoryRestriction: "Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"
336
+ },
337
+ ebsr: { part: "Parte {{index}}" },
338
+ numberLine: {
339
+ addElementLimit_one: "Solo puedes agregar {{count}} elemento",
340
+ addElementLimit_other: "Solo puedes agregar {{count}} elementos",
341
+ clearAll: "Borrar todo"
342
+ },
343
+ imageClozeAssociation: {
344
+ reachedLimit_one: "Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
345
+ reachedLimit_other: "Lleno"
346
+ },
347
+ drawingResponse: {
348
+ fillColor: "Color de relleno",
349
+ outlineColor: "Color del contorno",
350
+ noFill: "Sin relleno",
351
+ lightblue: "Azul claro",
352
+ lightyellow: "Amarillo claro",
353
+ red: "Rojo",
354
+ orange: "Naranja",
355
+ yellow: "Amarillo",
356
+ violet: "Violeta",
357
+ blue: "Azul",
358
+ green: "Verde",
359
+ white: "Blanco",
360
+ black: "Negro",
361
+ onDoubleClick: "Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"
362
+ },
363
+ charting: {
364
+ addCategory: "Añadir categoría",
365
+ actions: "Acciones",
366
+ add: "Añadir",
367
+ delete: "Eliminar",
368
+ newLabel: "Nueva etiqueta",
369
+ reachedLimit_other: "No puede haber más de {{count}} categorías.",
370
+ keyLegend: {
371
+ incorrectAnswer: "Respuesta incorrecta del estudiante",
372
+ correctAnswer: "Respuesta correcta del estudiante",
373
+ correctKeyAnswer: "Clave de respuesta correcta"
374
+ }
375
+ },
376
+ graphing: {
377
+ point: "Punto",
378
+ circle: "Circulo",
379
+ line: "Línea",
380
+ parabola: "Parábola",
381
+ absolute: "Valor absoluto",
382
+ exponential: "Exponencial",
383
+ polygon: "Polígono",
384
+ ray: "Semirrecta",
385
+ segment: "Segmento ",
386
+ sine: "Seno",
387
+ vector: "Vector",
388
+ label: "Etiqueta",
389
+ redo: "Rehacer",
390
+ reset: "Reiniciar"
391
+ },
392
+ mathInline: { primaryCorrectWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas." },
393
+ mcPopulatedBlank: {
394
+ answerChoices: "Opciones de respuesta",
395
+ blankLabel: "espacio en blanco",
396
+ emptyBlank: "(en blanco)",
397
+ blankPreSelectionHint: "La respuesta que elijas aparecerá en la línea en blanco de arriba.",
398
+ correctAnswerSelected: "Respuesta correcta seleccionada",
399
+ incorrectAnswerSelected: "Respuesta incorrecta seleccionada",
400
+ selectedAnswerImage: "Imagen de la respuesta seleccionada",
401
+ choiceImage: "Opción {{id}}",
402
+ clickToEnableAutoplay: "Haz clic para activar la reproducción automática del audio",
403
+ audioResourceUnavailable: "El audio está activado, pero no hay una URL de audio reproducible configurada.",
404
+ listen: "Escuchar",
405
+ listenSilentAlt: "Escuchar. Repetir las instrucciones.",
406
+ listenPlayingAlt: "Escuchar. Estas son las instrucciones.",
407
+ printAudio: "Audio:",
408
+ printTranscript: "Transcripción:"
409
+ },
410
+ multipleChoice: {
411
+ minSelections: "Seleccione al menos {{minSelections}}.",
412
+ maxSelections_one: "Sólo se permite {{maxSelections}} respuesta.",
413
+ maxSelections_other: "Sólo se permiten {{maxSelections}} respuestas.",
414
+ minmaxSelections_equal: "Seleccione {{minSelections}}.",
415
+ minmaxSelections_range: "Seleccione entre {{minSelections}} y {{maxSelections}}."
416
+ },
417
+ selectText: {
418
+ correctAnswerSelected: "Respuesta Correcta",
419
+ correctAnswerNotSelected: "Respuesta Correcta No Seleccionada",
420
+ incorrectSelection: "Selección Incorrecta",
421
+ key: "Clave"
422
+ },
423
+ simpleCloze: {
424
+ correctAnswerShown: "Respuesta correcta",
425
+ correct: "Correcto",
426
+ incorrect: "Incorrecto",
427
+ unanswered: "Sin respuesta",
428
+ placeholder: "Escribe tu respuesta...",
429
+ answerInput: "Tu respuesta",
430
+ printCorrectAnswer: "Respuesta correcta:",
431
+ printAnswerBlank: "Espacio para la respuesta"
432
+ },
433
+ vennClassification: {
434
+ tray: "Fichas para clasificar",
435
+ unknownTarget: "desconocido",
436
+ cancelled: "Cancelado",
437
+ returnedToTray: "Se devolvió {{name}} a la bandeja",
438
+ placedIn: "Se colocó {{name}} en {{target}}",
439
+ pickedUp: "Se tomó {{name}}",
440
+ pickedUpWithKeyboard: "Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.",
441
+ dropTarget: "Destino: {{target}}",
442
+ unsupportedCircles_one: "No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.",
443
+ unsupportedCircles_other: "No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.",
444
+ setNumber: "Conjunto {{number}}",
445
+ regionOnly: "Solo {{set}}",
446
+ regionNeither: "Ni {{first}} ni {{second}}",
447
+ regionNoneOf: "Ninguno de {{sets}}",
448
+ regionAndSeparator: " y ",
449
+ tileFallbackName: "Ficha",
450
+ tileNotPlaced: "sin colocar",
451
+ tileInRegion: "en {{region}}",
452
+ tileCorrect: "correcta",
453
+ tileIncorrect: "incorrecta"
454
+ }
455
+ },
456
+ common: {
457
+ undo: "Deshacer",
458
+ clearAll: "Borrar todo",
459
+ correct: "Correcto",
460
+ incorrect: "Incorrecto",
461
+ showCorrectAnswer: "Mostrar respuesta correcta",
462
+ hideCorrectAnswer: "Ocultar respuesta correcta",
463
+ showTeacherInstructions: "Mostrar instrucciones para el maestro",
464
+ hideTeacherInstructions: "Ocultar instrucciones para el maestro",
465
+ commonCorrectAnswerWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",
466
+ warning: "Advertencia",
467
+ showNote: "Mostrar Nota",
468
+ hideNote: "Ocultar Nota",
469
+ cancel: "Cancelar"
470
+ }
471
+ }, j = (e) => typeof e == "string", M = () => {
472
+ let e, t, n = new Promise((n, r) => {
473
+ e = n, t = r;
474
+ });
475
+ return n.resolve = e, n.reject = t, n;
476
+ }, de = (e) => e == null ? "" : "" + e, fe = (e, t, n) => {
477
+ e.forEach((e) => {
478
+ t[e] && (n[e] = t[e]);
479
+ });
480
+ }, pe = /###/g, me = (e) => e && e.indexOf("###") > -1 ? e.replace(pe, ".") : e, he = (e) => !e || j(e), N = (e, t, n) => {
481
+ let r = j(t) ? t.split(".") : t, i = 0;
482
+ for (; i < r.length - 1;) {
483
+ if (he(e)) return {};
484
+ let t = me(r[i]);
485
+ !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
486
+ }
487
+ return he(e) ? {} : {
488
+ obj: e,
489
+ k: me(r[i])
490
+ };
491
+ }, ge = (e, t, n) => {
492
+ let { obj: r, k: i } = N(e, t, Object);
493
+ if (r !== void 0 || t.length === 1) {
494
+ r[i] = n;
495
+ return;
496
+ }
497
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = N(e, o, Object);
498
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = N(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
499
+ s.obj[`${s.k}.${a}`] = n;
500
+ }, _e = (e, t, n, r) => {
501
+ let { obj: i, k: a } = N(e, t, Object);
502
+ i[a] = i[a] || [], i[a].push(n);
503
+ }, P = (e, t) => {
504
+ let { obj: n, k: r } = N(e, t);
505
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
506
+ }, ve = (e, t, n) => {
507
+ let r = P(e, n);
508
+ return r === void 0 ? P(t, n) : r;
509
+ }, ye = (e, t, n) => {
510
+ for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? j(e[r]) || e[r] instanceof String || j(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : ye(e[r], t[r], n) : e[r] = t[r]);
511
+ return e;
512
+ }, F = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), be = {
513
+ "&": "&amp;",
514
+ "<": "&lt;",
515
+ ">": "&gt;",
516
+ "\"": "&quot;",
517
+ "'": "&#39;",
518
+ "/": "&#x2F;"
519
+ }, xe = (e) => j(e) ? e.replace(/[&<>"'\/]/g, (e) => be[e]) : e, Se = class {
520
+ constructor(e) {
521
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
522
+ }
523
+ getRegExp(e) {
524
+ let t = this.regExpMap.get(e);
525
+ if (t !== void 0) return t;
526
+ let n = new RegExp(e);
527
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
528
+ }
529
+ }, Ce = [
530
+ " ",
531
+ ",",
532
+ "?",
533
+ "!",
534
+ ";"
535
+ ], we = new Se(20), Te = (e, t, n) => {
536
+ t ||= "", n ||= "";
537
+ let r = Ce.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
538
+ if (r.length === 0) return !0;
539
+ let i = we.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
540
+ if (!a) {
541
+ let t = e.indexOf(n);
542
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
543
+ }
544
+ return a;
545
+ }, I = (e, t, n = ".") => {
546
+ if (!e) return;
547
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
548
+ let r = t.split(n), i = e;
549
+ for (let e = 0; e < r.length;) {
550
+ if (!i || typeof i != "object") return;
551
+ let t, a = "";
552
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
553
+ if ([
554
+ "string",
555
+ "number",
556
+ "boolean"
557
+ ].indexOf(typeof t) > -1 && o < r.length - 1) continue;
558
+ e += o - e + 1;
559
+ break;
560
+ }
561
+ i = t;
562
+ }
563
+ return i;
564
+ }, L = (e) => e?.replace(/_/g, "-"), Ee = {
565
+ type: "logger",
566
+ log(e) {
567
+ this.output("log", e);
568
+ },
569
+ warn(e) {
570
+ this.output("warn", e);
571
+ },
572
+ error(e) {
573
+ this.output("error", e);
574
+ },
575
+ output(e, t) {
576
+ console?.[e]?.apply?.(console, t);
577
+ }
578
+ }, R = new class e {
579
+ constructor(e, t = {}) {
580
+ this.init(e, t);
581
+ }
582
+ init(e, t = {}) {
583
+ this.prefix = t.prefix || "i18next:", this.logger = e || Ee, this.options = t, this.debug = t.debug;
584
+ }
585
+ log(...e) {
586
+ return this.forward(e, "log", "", !0);
587
+ }
588
+ warn(...e) {
589
+ return this.forward(e, "warn", "", !0);
590
+ }
591
+ error(...e) {
592
+ return this.forward(e, "error", "");
593
+ }
594
+ deprecate(...e) {
595
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
596
+ }
597
+ forward(e, t, n, r) {
598
+ return r && !this.debug ? null : (j(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
599
+ }
600
+ create(t) {
601
+ return new e(this.logger, {
602
+ prefix: `${this.prefix}:${t}:`,
603
+ ...this.options
604
+ });
605
+ }
606
+ clone(t) {
607
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
608
+ }
609
+ }(), z = class {
610
+ constructor() {
611
+ this.observers = {};
612
+ }
613
+ on(e, t) {
614
+ return e.split(" ").forEach((e) => {
615
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
616
+ let n = this.observers[e].get(t) || 0;
617
+ this.observers[e].set(t, n + 1);
618
+ }), this;
619
+ }
620
+ off(e, t) {
621
+ if (this.observers[e]) {
622
+ if (!t) {
623
+ delete this.observers[e];
624
+ return;
625
+ }
626
+ this.observers[e].delete(t);
627
+ }
628
+ }
629
+ emit(e, ...t) {
630
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
631
+ for (let r = 0; r < n; r++) e(...t);
632
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
633
+ for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
634
+ });
635
+ }
636
+ }, De = class extends z {
637
+ constructor(e, t = {
638
+ ns: ["translation"],
639
+ defaultNS: "translation"
640
+ }) {
641
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
642
+ }
643
+ addNamespaces(e) {
644
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
645
+ }
646
+ removeNamespaces(e) {
647
+ let t = this.options.ns.indexOf(e);
648
+ t > -1 && this.options.ns.splice(t, 1);
649
+ }
650
+ getResource(e, t, n, r = {}) {
651
+ let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
652
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : j(n) && i ? o.push(...n.split(i)) : o.push(n)));
653
+ let s = P(this.data, o);
654
+ return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !j(n) ? s : I(this.data?.[e]?.[t], n, i);
655
+ }
656
+ addResource(e, t, n, r, i = { silent: !1 }) {
657
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
658
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), ge(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
659
+ }
660
+ addResources(e, t, n, r = { silent: !1 }) {
661
+ for (let r in n) (j(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
662
+ r.silent || this.emit("added", e, t, n);
663
+ }
664
+ addResourceBundle(e, t, n, r, i, a = {
665
+ silent: !1,
666
+ skipCopy: !1
667
+ }) {
668
+ let o = [e, t];
669
+ e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
670
+ let s = P(this.data, o) || {};
671
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? ye(s, n, i) : s = {
672
+ ...s,
673
+ ...n
674
+ }, ge(this.data, o, s), a.silent || this.emit("added", e, t, n);
675
+ }
676
+ removeResourceBundle(e, t) {
677
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
678
+ }
679
+ hasResourceBundle(e, t) {
680
+ return this.getResource(e, t) !== void 0;
681
+ }
682
+ getResourceBundle(e, t) {
683
+ return t ||= this.options.defaultNS, this.getResource(e, t);
684
+ }
685
+ getDataByLanguage(e) {
686
+ return this.data[e];
687
+ }
688
+ hasLanguageSomeTranslations(e) {
689
+ let t = this.getDataByLanguage(e);
690
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
691
+ }
692
+ toJSON() {
693
+ return this.data;
694
+ }
695
+ }, Oe = {
696
+ processors: {},
697
+ addPostProcessor(e) {
698
+ this.processors[e.name] = e;
699
+ },
700
+ handle(e, t, n, r, i) {
701
+ return e.forEach((e) => {
702
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
703
+ }), t;
704
+ }
705
+ }, ke = Symbol("i18next/PATH_KEY");
706
+ function Ae() {
707
+ let e = [], t = Object.create(null), n;
708
+ return t.get = (r, i) => (n?.revoke?.(), i === ke ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
709
+ }
710
+ function B(e, t) {
711
+ let { [ke]: n } = e(Ae()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
712
+ if (n.length > 1 && i) {
713
+ let e = t?.ns, a = Array.isArray(e) ? e : null;
714
+ if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
715
+ }
716
+ return n.join(r);
717
+ }
718
+ var je = {}, V = (e) => !j(e) && typeof e != "boolean" && typeof e != "number", Me = class e extends z {
719
+ constructor(e, t = {}) {
720
+ super(), fe([
721
+ "resourceStore",
722
+ "languageUtils",
723
+ "pluralResolver",
724
+ "interpolator",
725
+ "backendConnector",
726
+ "i18nFormat",
727
+ "utils"
728
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = R.create("translator");
729
+ }
730
+ changeLanguage(e) {
731
+ e && (this.language = e);
732
+ }
733
+ exists(e, t = { interpolation: {} }) {
734
+ let n = { ...t };
735
+ if (e == null) return !1;
736
+ let r = this.resolve(e, n);
737
+ if (r?.res === void 0) return !1;
738
+ let i = V(r.res);
739
+ return !(n.returnObjects === !1 && i);
740
+ }
741
+ extractFromKey(e, t) {
742
+ let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
743
+ n === void 0 && (n = ":");
744
+ let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Te(e, n, r);
745
+ if (a && !o) {
746
+ let t = e.match(this.interpolator.nestingRegexp);
747
+ if (t && t.length > 0) return {
748
+ key: e,
749
+ namespaces: j(i) ? [i] : i
750
+ };
751
+ let a = e.split(n);
752
+ (n !== r || n === r && this.options.ns.indexOf(a[0]) > -1) && (i = a.shift()), e = a.join(r);
753
+ }
754
+ return {
755
+ key: e,
756
+ namespaces: j(i) ? [i] : i
757
+ };
758
+ }
759
+ translate(t, n, r) {
760
+ let i = typeof n == "object" ? { ...n } : n;
761
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
762
+ typeof t == "function" && (t = B(t, {
763
+ ...this.options,
764
+ ...i
765
+ })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? B(e, {
766
+ ...this.options,
767
+ ...i
768
+ }) : String(e));
769
+ let a = i.returnDetails === void 0 ? this.options.returnDetails : i.returnDetails, o = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, { key: s, namespaces: c } = this.extractFromKey(t[t.length - 1], i), l = c[c.length - 1], u = i.nsSeparator === void 0 ? this.options.nsSeparator : i.nsSeparator;
770
+ u === void 0 && (u = ":");
771
+ let d = i.lng || this.language, f = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
772
+ if (d?.toLowerCase() === "cimode") return f ? a ? {
773
+ res: `${l}${u}${s}`,
774
+ usedKey: s,
775
+ exactUsedKey: s,
776
+ usedLng: d,
777
+ usedNS: l,
778
+ usedParams: this.getUsedParamsDetails(i)
779
+ } : `${l}${u}${s}` : a ? {
780
+ res: s,
781
+ usedKey: s,
782
+ exactUsedKey: s,
783
+ usedLng: d,
784
+ usedNS: l,
785
+ usedParams: this.getUsedParamsDetails(i)
786
+ } : s;
787
+ let p = this.resolve(t, i), m = p?.res, h = p?.usedKey || s, g = p?.exactUsedKey || s, _ = [
788
+ "[object Number]",
789
+ "[object Function]",
790
+ "[object RegExp]"
791
+ ], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !j(i.count), x = e.hasDefaultValue(i), S = b ? this.pluralResolver.getSuffix(d, i.count, i) : "", C = i.ordinal && b ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", w = b && !i.ordinal && i.count === 0, T = w && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${S}`] || i[`defaultValue${C}`] || i.defaultValue, E = m;
792
+ y && !m && x && (E = T);
793
+ let ee = V(E), D = Object.prototype.toString.apply(E);
794
+ if (y && E && ee && _.indexOf(D) < 0 && !(j(v) && Array.isArray(E))) {
795
+ if (!i.returnObjects && !this.options.returnObjects) {
796
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
797
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, E, {
798
+ ...i,
799
+ ns: c
800
+ }) : `key '${s} (${this.language})' returned an object instead of string.`;
801
+ return a ? (p.res = e, p.usedParams = this.getUsedParamsDetails(i), p) : e;
802
+ }
803
+ if (o) {
804
+ let e = Array.isArray(E), t = e ? [] : {}, n = e ? g : h;
805
+ for (let e in E) if (Object.prototype.hasOwnProperty.call(E, e)) {
806
+ let r = `${n}${o}${e}`;
807
+ x && !m ? t[e] = this.translate(r, {
808
+ ...i,
809
+ defaultValue: V(T) ? T[e] : void 0,
810
+ joinArrays: !1,
811
+ ns: c
812
+ }) : t[e] = this.translate(r, {
813
+ ...i,
814
+ joinArrays: !1,
815
+ ns: c
816
+ }), t[e] === r && (t[e] = E[e]);
817
+ }
818
+ m = t;
819
+ }
820
+ } else if (y && j(v) && Array.isArray(m)) m = m.join(v), m &&= this.extendTranslation(m, t, i, r);
821
+ else {
822
+ let e = !1, n = !1;
823
+ !this.isValidLookup(m) && x && (e = !0, m = T), this.isValidLookup(m) || (n = !0, m = s);
824
+ let a = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : m, c = x && T !== m && this.options.updateMissing;
825
+ if (n || e || c) {
826
+ if (this.logger.log(c ? "updateKey" : "missingKey", d, l, s, c ? T : m), o) {
827
+ let e = this.resolve(s, {
828
+ ...i,
829
+ keySeparator: !1
830
+ });
831
+ e && e.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
832
+ }
833
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
834
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
835
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(i.lng || this.language) : e.push(i.lng || this.language);
836
+ let n = (e, t, n) => {
837
+ let r = x && n !== m ? n : a;
838
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(e, l, t, r, c, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, l, t, r, c, i), this.emit("missingKey", e, l, t, m);
839
+ };
840
+ this.options.saveMissing && (this.options.saveMissingPlurals && b ? e.forEach((e) => {
841
+ let t = this.pluralResolver.getSuffixes(e, i);
842
+ w && i[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
843
+ n([e], s + t, i[`defaultValue${t}`] || T);
844
+ });
845
+ }) : n(e, s, T));
846
+ }
847
+ m = this.extendTranslation(m, t, i, p, r), n && m === s && this.options.appendNamespaceToMissingKey && (m = `${l}${u}${s}`), (n || e) && this.options.parseMissingKeyHandler && (m = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${u}${s}` : s, e ? m : void 0, i));
848
+ }
849
+ return a ? (p.res = m, p.usedParams = this.getUsedParamsDetails(i), p) : m;
850
+ }
851
+ extendTranslation(e, t, n, r, i) {
852
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
853
+ ...this.options.interpolation.defaultVariables,
854
+ ...n
855
+ }, n.lng || this.language || r.usedLng, r.usedNS, r.usedKey, { resolved: r });
856
+ else if (!n.skipInterpolation) {
857
+ n.interpolation && this.interpolator.init({
858
+ ...n,
859
+ interpolation: {
860
+ ...this.options.interpolation,
861
+ ...n.interpolation
862
+ }
863
+ });
864
+ let a = j(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
865
+ if (a) {
866
+ let t = e.match(this.interpolator.nestingRegexp);
867
+ o = t && t.length;
868
+ }
869
+ let s = n.replace && !j(n.replace) ? n.replace : n;
870
+ if (this.options.interpolation.defaultVariables && (s = {
871
+ ...this.options.interpolation.defaultVariables,
872
+ ...s
873
+ }), e = this.interpolator.interpolate(e, s, n.lng || this.language || r.usedLng, n), a) {
874
+ let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
875
+ o < r && (n.nest = !1);
876
+ }
877
+ !n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...e) => i?.[0] === e[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), n)), n.interpolation && this.interpolator.reset();
878
+ }
879
+ let a = n.postProcess || this.options.postProcess, o = j(a) ? [a] : a;
880
+ return e != null && o?.length && n.applyPostProcessor !== !1 && (e = Oe.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
881
+ i18nResolved: {
882
+ ...r,
883
+ usedParams: this.getUsedParamsDetails(n)
884
+ },
885
+ ...n
886
+ } : n, this)), e;
887
+ }
888
+ resolve(e, t = {}) {
889
+ let n, r, i, a, o;
890
+ return j(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? B(e, {
891
+ ...this.options,
892
+ ...t
893
+ }) : e)), e.forEach((e) => {
894
+ if (this.isValidLookup(n)) return;
895
+ let s = this.extractFromKey(e, t), c = s.key;
896
+ r = c;
897
+ let l = s.namespaces;
898
+ this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
899
+ let u = t.count !== void 0 && !j(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (j(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
900
+ l.forEach((e) => {
901
+ this.isValidLookup(n) || (o = e, !je[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (je[`${p[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p.forEach((r) => {
902
+ if (this.isValidLookup(n)) return;
903
+ a = r;
904
+ let o = [c];
905
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, c, r, e, t);
906
+ else {
907
+ let e;
908
+ u && (e = this.pluralResolver.getSuffix(r, t.count, t));
909
+ let n = `${this.options.pluralSeparator}zero`, i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
910
+ if (u && (t.ordinal && e.indexOf(i) === 0 && o.push(c + e.replace(i, this.options.pluralSeparator)), o.push(c + e), d && o.push(c + n)), f) {
911
+ let r = `${c}${this.options.contextSeparator || "_"}${t.context}`;
912
+ o.push(r), u && (t.ordinal && e.indexOf(i) === 0 && o.push(r + e.replace(i, this.options.pluralSeparator)), o.push(r + e), d && o.push(r + n));
913
+ }
914
+ }
915
+ let s;
916
+ for (; s = o.pop();) this.isValidLookup(n) || (i = s, n = this.getResource(r, e, s, t));
917
+ }));
918
+ });
919
+ }), {
920
+ res: n,
921
+ usedKey: r,
922
+ exactUsedKey: i,
923
+ usedLng: a,
924
+ usedNS: o
925
+ };
926
+ }
927
+ isValidLookup(e) {
928
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
929
+ }
930
+ getResource(e, t, n, r = {}) {
931
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
932
+ }
933
+ getUsedParamsDetails(e = {}) {
934
+ let t = [
935
+ "defaultValue",
936
+ "ordinal",
937
+ "context",
938
+ "replace",
939
+ "lng",
940
+ "lngs",
941
+ "fallbackLng",
942
+ "ns",
943
+ "keySeparator",
944
+ "nsSeparator",
945
+ "returnObjects",
946
+ "returnDetails",
947
+ "joinArrays",
948
+ "postProcess",
949
+ "interpolation"
950
+ ], n = e.replace && !j(e.replace), r = n ? e.replace : e;
951
+ if (n && e.count !== void 0 && (r.count = e.count), this.options.interpolation.defaultVariables && (r = {
952
+ ...this.options.interpolation.defaultVariables,
953
+ ...r
954
+ }), !n) {
955
+ r = { ...r };
956
+ for (let e of t) delete r[e];
957
+ }
958
+ return r;
959
+ }
960
+ static hasDefaultValue(e) {
961
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
962
+ return !1;
963
+ }
964
+ }, Ne = class {
965
+ constructor(e) {
966
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = R.create("languageUtils");
967
+ }
968
+ getScriptPartFromCode(e) {
969
+ if (e = L(e), !e || e.indexOf("-") < 0) return null;
970
+ let t = e.split("-");
971
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
972
+ }
973
+ getLanguagePartFromCode(e) {
974
+ if (e = L(e), !e || e.indexOf("-") < 0) return e;
975
+ let t = e.split("-");
976
+ return this.formatLanguageCode(t[0]);
977
+ }
978
+ formatLanguageCode(e) {
979
+ if (j(e) && e.indexOf("-") > -1) {
980
+ let t;
981
+ try {
982
+ t = Intl.getCanonicalLocales(e)[0];
983
+ } catch {}
984
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
985
+ }
986
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
987
+ }
988
+ isSupportedCode(e) {
989
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
990
+ }
991
+ getBestMatchFromCodes(e) {
992
+ if (!e) return null;
993
+ let t;
994
+ return e.forEach((e) => {
995
+ if (t) return;
996
+ let n = this.formatLanguageCode(e);
997
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
998
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
999
+ if (t) return;
1000
+ let n = this.getScriptPartFromCode(e);
1001
+ if (this.isSupportedCode(n)) return t = n;
1002
+ let r = this.getLanguagePartFromCode(e);
1003
+ if (this.isSupportedCode(r)) return t = r;
1004
+ t = this.options.supportedLngs.find((e) => {
1005
+ if (e === r || !(e.indexOf("-") < 0 && r.indexOf("-") < 0) && (e.indexOf("-") > 0 && r.indexOf("-") < 0 && e.substring(0, e.indexOf("-")) === r || e.indexOf(r) === 0 && r.length > 1)) return e;
1006
+ });
1007
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
1008
+ }
1009
+ getFallbackCodes(e, t) {
1010
+ if (!e) return [];
1011
+ if (typeof e == "function" && (e = e(t)), j(e) && (e = [e]), Array.isArray(e)) return e;
1012
+ if (!t) return e.default || [];
1013
+ let n = e[t];
1014
+ return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
1015
+ }
1016
+ toResolveHierarchy(e, t) {
1017
+ let n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), r = [], i = (e) => {
1018
+ e && (this.isSupportedCode(e) ? r.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
1019
+ };
1020
+ return j(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : j(e) && i(this.formatLanguageCode(e)), n.forEach((e) => {
1021
+ r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
1022
+ }), r;
1023
+ }
1024
+ }, Pe = {
1025
+ zero: 0,
1026
+ one: 1,
1027
+ two: 2,
1028
+ few: 3,
1029
+ many: 4,
1030
+ other: 5
1031
+ }, Fe = {
1032
+ select: (e) => e === 1 ? "one" : "other",
1033
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
1034
+ }, Ie = class {
1035
+ constructor(e, t = {}) {
1036
+ this.languageUtils = e, this.options = t, this.logger = R.create("pluralResolver"), this.pluralRulesCache = {};
1037
+ }
1038
+ clearCache() {
1039
+ this.pluralRulesCache = {};
1040
+ }
1041
+ getRule(e, t = {}) {
1042
+ let n = L(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
1043
+ cleanedCode: n,
1044
+ type: r
1045
+ });
1046
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
1047
+ let a;
1048
+ try {
1049
+ a = new Intl.PluralRules(n, { type: r });
1050
+ } catch {
1051
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), Fe;
1052
+ if (!e.match(/-|_/)) return Fe;
1053
+ let n = this.languageUtils.getLanguagePartFromCode(e);
1054
+ a = this.getRule(n, t);
1055
+ }
1056
+ return this.pluralRulesCache[i] = a, a;
1057
+ }
1058
+ needsPlural(e, t = {}) {
1059
+ let n = this.getRule(e, t);
1060
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
1061
+ }
1062
+ getPluralFormsOfKey(e, t, n = {}) {
1063
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
1064
+ }
1065
+ getSuffixes(e, t = {}) {
1066
+ let n = this.getRule(e, t);
1067
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => Pe[e] - Pe[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
1068
+ }
1069
+ getSuffix(e, t, n = {}) {
1070
+ let r = this.getRule(e, n);
1071
+ return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
1072
+ }
1073
+ }, Le = (e, t, n, r = ".", i = !0) => {
1074
+ let a = ve(e, t, n);
1075
+ return !a && i && j(n) && (a = I(e, n, r), a === void 0 && (a = I(t, n, r))), a;
1076
+ }, H = (e) => e.replace(/\$/g, "$$$$"), Re = class {
1077
+ constructor(e = {}) {
1078
+ this.logger = R.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
1079
+ }
1080
+ init(e = {}) {
1081
+ e.interpolation ||= { escapeValue: !0 };
1082
+ let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: _ } = e.interpolation;
1083
+ this.escape = t === void 0 ? xe : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? F(i) : a || "{{", this.suffix = o ? F(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? F(d) : f || F("$t("), this.nestingSuffix = p ? F(p) : m || F(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
1084
+ }
1085
+ reset() {
1086
+ this.options && this.init(this.options);
1087
+ }
1088
+ resetRegExp() {
1089
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
1090
+ this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
1091
+ }
1092
+ interpolate(e, t, n, r) {
1093
+ let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
1094
+ if (e.indexOf(this.formatSeparator) < 0) {
1095
+ let i = Le(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
1096
+ return this.alwaysFormat ? this.format(i, void 0, n, {
1097
+ ...r,
1098
+ ...t,
1099
+ interpolationkey: e
1100
+ }) : i;
1101
+ }
1102
+ let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
1103
+ return this.format(Le(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
1104
+ ...r,
1105
+ ...t,
1106
+ interpolationkey: a
1107
+ });
1108
+ };
1109
+ this.resetRegExp();
1110
+ let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
1111
+ return [{
1112
+ regex: this.regexpUnescape,
1113
+ safeValue: (e) => H(e)
1114
+ }, {
1115
+ regex: this.regexp,
1116
+ safeValue: (e) => this.escapeValue ? H(this.escape(e)) : H(e)
1117
+ }].forEach((t) => {
1118
+ for (o = 0; i = t.regex.exec(e);) {
1119
+ let n = i[1].trim();
1120
+ if (a = c(n), a === void 0) if (typeof l == "function") {
1121
+ let t = l(e, i, r);
1122
+ a = j(t) ? t : "";
1123
+ } else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
1124
+ else if (u) {
1125
+ a = i[0];
1126
+ continue;
1127
+ } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
1128
+ else !j(a) && !this.useRawValueToEscape && (a = de(a));
1129
+ let s = t.safeValue(a);
1130
+ if (e = e.replace(i[0], s), u ? (t.regex.lastIndex += a.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
1131
+ }
1132
+ }), e;
1133
+ }
1134
+ nest(e, t, n = {}) {
1135
+ let r, i, a, o = (e, t) => {
1136
+ let n = this.nestingOptionsSeparator;
1137
+ if (e.indexOf(n) < 0) return e;
1138
+ let r = e.split(RegExp(`${F(n)}[ ]*{`)), i = `{${r[1]}`;
1139
+ e = r[0], i = this.interpolate(i, a);
1140
+ let o = i.match(/'/g), s = i.match(/"/g);
1141
+ ((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
1142
+ try {
1143
+ a = JSON.parse(i), t && (a = {
1144
+ ...t,
1145
+ ...a
1146
+ });
1147
+ } catch (t) {
1148
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
1149
+ }
1150
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, e;
1151
+ };
1152
+ for (; r = this.nestingRegexp.exec(e);) {
1153
+ let s = [];
1154
+ a = { ...n }, a = a.replace && !j(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
1155
+ let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
1156
+ if (c !== -1 && (s = r[1].slice(c).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, c)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !j(i)) return i;
1157
+ j(i) || (i = de(i)), i ||= (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), ""), s.length && (i = s.reduce((e, t) => this.format(e, t, n.lng, {
1158
+ ...n,
1159
+ interpolationkey: r[1].trim()
1160
+ }), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
1161
+ }
1162
+ return e;
1163
+ }
1164
+ }, ze = (e) => {
1165
+ let t = e.toLowerCase().trim(), n = {};
1166
+ if (e.indexOf("(") > -1) {
1167
+ let r = e.split("(");
1168
+ t = r[0].toLowerCase().trim();
1169
+ let i = r[1].substring(0, r[1].length - 1);
1170
+ t === "currency" && i.indexOf(":") < 0 ? n.currency ||= i.trim() : t === "relativetime" && i.indexOf(":") < 0 ? n.range ||= i.trim() : i.split(";").forEach((e) => {
1171
+ if (e) {
1172
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
1173
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
1174
+ }
1175
+ });
1176
+ }
1177
+ return {
1178
+ formatName: t,
1179
+ formatOptions: n
1180
+ };
1181
+ }, Be = (e) => {
1182
+ let t = {};
1183
+ return (n, r, i) => {
1184
+ let a = i;
1185
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
1186
+ ...a,
1187
+ [i.interpolationkey]: void 0
1188
+ });
1189
+ let o = r + JSON.stringify(a), s = t[o];
1190
+ return s || (s = e(L(r), i), t[o] = s), s(n);
1191
+ };
1192
+ }, Ve = (e) => (t, n, r) => e(L(n), r)(t), He = class {
1193
+ constructor(e = {}) {
1194
+ this.logger = R.create("formatter"), this.options = e, this.init(e);
1195
+ }
1196
+ init(e, t = { interpolation: {} }) {
1197
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
1198
+ let n = t.cacheInBuiltFormats ? Be : Ve;
1199
+ this.formats = {
1200
+ number: n((e, t) => {
1201
+ let n = new Intl.NumberFormat(e, { ...t });
1202
+ return (e) => n.format(e);
1203
+ }),
1204
+ currency: n((e, t) => {
1205
+ let n = new Intl.NumberFormat(e, {
1206
+ ...t,
1207
+ style: "currency"
1208
+ });
1209
+ return (e) => n.format(e);
1210
+ }),
1211
+ datetime: n((e, t) => {
1212
+ let n = new Intl.DateTimeFormat(e, { ...t });
1213
+ return (e) => n.format(e);
1214
+ }),
1215
+ relativetime: n((e, t) => {
1216
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
1217
+ return (e) => n.format(e, t.range || "day");
1218
+ }),
1219
+ list: n((e, t) => {
1220
+ let n = new Intl.ListFormat(e, { ...t });
1221
+ return (e) => n.format(e);
1222
+ })
1223
+ };
1224
+ }
1225
+ add(e, t) {
1226
+ this.formats[e.toLowerCase().trim()] = t;
1227
+ }
1228
+ addCached(e, t) {
1229
+ this.formats[e.toLowerCase().trim()] = Be(t);
1230
+ }
1231
+ format(e, t, n, r = {}) {
1232
+ let i = t.split(this.formatSeparator);
1233
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((e) => e.indexOf(")") > -1)) {
1234
+ let e = i.findIndex((e) => e.indexOf(")") > -1);
1235
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
1236
+ }
1237
+ return i.reduce((e, t) => {
1238
+ let { formatName: i, formatOptions: a } = ze(t);
1239
+ if (this.formats[i]) {
1240
+ let t = e;
1241
+ try {
1242
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
1243
+ t = this.formats[i](e, s, {
1244
+ ...a,
1245
+ ...r,
1246
+ ...o
1247
+ });
1248
+ } catch (e) {
1249
+ this.logger.warn(e);
1250
+ }
1251
+ return t;
1252
+ } else this.logger.warn(`there was no format function for ${i}`);
1253
+ return e;
1254
+ }, e);
1255
+ }
1256
+ }, Ue = (e, t) => {
1257
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
1258
+ }, We = class extends z {
1259
+ constructor(e, t, n, r = {}) {
1260
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = R.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
1261
+ }
1262
+ queueLoad(e, t, n, r) {
1263
+ let i = {}, a = {}, o = {}, s = {};
1264
+ return e.forEach((e) => {
1265
+ let r = !0;
1266
+ t.forEach((t) => {
1267
+ let o = `${e}|${t}`;
1268
+ !n.reload && this.store.hasResourceBundle(e, t) ? this.state[o] = 2 : this.state[o] < 0 || (this.state[o] === 1 ? a[o] === void 0 && (a[o] = !0) : (this.state[o] = 1, r = !1, a[o] === void 0 && (a[o] = !0), i[o] === void 0 && (i[o] = !0), s[t] === void 0 && (s[t] = !0)));
1269
+ }), r || (o[e] = !0);
1270
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1271
+ pending: a,
1272
+ pendingCount: Object.keys(a).length,
1273
+ loaded: {},
1274
+ errors: [],
1275
+ callback: r
1276
+ }), {
1277
+ toLoad: Object.keys(i),
1278
+ pending: Object.keys(a),
1279
+ toLoadLanguages: Object.keys(o),
1280
+ toLoadNamespaces: Object.keys(s)
1281
+ };
1282
+ }
1283
+ loaded(e, t, n) {
1284
+ let r = e.split("|"), i = r[0], a = r[1];
1285
+ t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
1286
+ let o = {};
1287
+ this.queue.forEach((n) => {
1288
+ _e(n.loaded, [i], a), Ue(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
1289
+ o[e] || (o[e] = {});
1290
+ let t = n.loaded[e];
1291
+ t.length && t.forEach((t) => {
1292
+ o[e][t] === void 0 && (o[e][t] = !0);
1293
+ });
1294
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
1295
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
1296
+ }
1297
+ read(e, t, n, r = 0, i = this.retryTimeout, a) {
1298
+ if (!e.length) return a(null, {});
1299
+ if (this.readingCalls >= this.maxParallelReads) {
1300
+ this.waitingReads.push({
1301
+ lng: e,
1302
+ ns: t,
1303
+ fcName: n,
1304
+ tried: r,
1305
+ wait: i,
1306
+ callback: a
1307
+ });
1308
+ return;
1309
+ }
1310
+ this.readingCalls++;
1311
+ let o = (o, s) => {
1312
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1313
+ let e = this.waitingReads.shift();
1314
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
1315
+ }
1316
+ if (o && s && r < this.maxRetries) {
1317
+ setTimeout(() => {
1318
+ this.read.call(this, e, t, n, r + 1, i * 2, a);
1319
+ }, i);
1320
+ return;
1321
+ }
1322
+ a(o, s);
1323
+ }, s = this.backend[n].bind(this.backend);
1324
+ if (s.length === 2) {
1325
+ try {
1326
+ let n = s(e, t);
1327
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
1328
+ } catch (e) {
1329
+ o(e);
1330
+ }
1331
+ return;
1332
+ }
1333
+ return s(e, t, o);
1334
+ }
1335
+ prepareLoading(e, t, n = {}, r) {
1336
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
1337
+ j(e) && (e = this.languageUtils.toResolveHierarchy(e)), j(t) && (t = [t]);
1338
+ let i = this.queueLoad(e, t, n, r);
1339
+ if (!i.toLoad.length) return i.pending.length || r(), null;
1340
+ i.toLoad.forEach((e) => {
1341
+ this.loadOne(e);
1342
+ });
1343
+ }
1344
+ load(e, t, n) {
1345
+ this.prepareLoading(e, t, {}, n);
1346
+ }
1347
+ reload(e, t, n) {
1348
+ this.prepareLoading(e, t, { reload: !0 }, n);
1349
+ }
1350
+ loadOne(e, t = "") {
1351
+ let n = e.split("|"), r = n[0], i = n[1];
1352
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
1353
+ n && this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`, n), !n && a && this.logger.log(`${t}loaded namespace ${i} for language ${r}`, a), this.loaded(e, n, a);
1354
+ });
1355
+ }
1356
+ saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
1357
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1358
+ this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
1359
+ return;
1360
+ }
1361
+ if (!(n == null || n === "")) {
1362
+ if (this.backend?.create) {
1363
+ let s = {
1364
+ ...a,
1365
+ isUpdate: i
1366
+ }, c = this.backend.create.bind(this.backend);
1367
+ if (c.length < 6) try {
1368
+ let i;
1369
+ i = c.length === 5 ? c(e, t, n, r, s) : c(e, t, n, r), i && typeof i.then == "function" ? i.then((e) => o(null, e)).catch(o) : o(null, i);
1370
+ } catch (e) {
1371
+ o(e);
1372
+ }
1373
+ else c(e, t, n, r, o, s);
1374
+ }
1375
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
1376
+ }
1377
+ }
1378
+ }, Ge = () => ({
1379
+ debug: !1,
1380
+ initAsync: !0,
1381
+ ns: ["translation"],
1382
+ defaultNS: ["translation"],
1383
+ fallbackLng: ["dev"],
1384
+ fallbackNS: !1,
1385
+ supportedLngs: !1,
1386
+ nonExplicitSupportedLngs: !1,
1387
+ load: "all",
1388
+ preload: !1,
1389
+ simplifyPluralSuffix: !0,
1390
+ keySeparator: ".",
1391
+ nsSeparator: ":",
1392
+ pluralSeparator: "_",
1393
+ contextSeparator: "_",
1394
+ partialBundledLanguages: !1,
1395
+ saveMissing: !1,
1396
+ updateMissing: !1,
1397
+ saveMissingTo: "fallback",
1398
+ saveMissingPlurals: !0,
1399
+ missingKeyHandler: !1,
1400
+ missingInterpolationHandler: !1,
1401
+ postProcess: !1,
1402
+ postProcessPassResolved: !1,
1403
+ returnNull: !1,
1404
+ returnEmptyString: !0,
1405
+ returnObjects: !1,
1406
+ joinArrays: !1,
1407
+ returnedObjectHandler: !1,
1408
+ parseMissingKeyHandler: !1,
1409
+ appendNamespaceToMissingKey: !1,
1410
+ appendNamespaceToCIMode: !1,
1411
+ overloadTranslationOptionHandler: (e) => {
1412
+ let t = {};
1413
+ if (typeof e[1] == "object" && (t = e[1]), j(e[1]) && (t.defaultValue = e[1]), j(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
1414
+ let n = e[3] || e[2];
1415
+ Object.keys(n).forEach((e) => {
1416
+ t[e] = n[e];
1417
+ });
1418
+ }
1419
+ return t;
1420
+ },
1421
+ interpolation: {
1422
+ escapeValue: !0,
1423
+ format: (e) => e,
1424
+ prefix: "{{",
1425
+ suffix: "}}",
1426
+ formatSeparator: ",",
1427
+ unescapePrefix: "-",
1428
+ nestingPrefix: "$t(",
1429
+ nestingSuffix: ")",
1430
+ nestingOptionsSeparator: ",",
1431
+ maxReplaces: 1e3,
1432
+ skipOnVariables: !0
1433
+ },
1434
+ cacheInBuiltFormats: !0
1435
+ }), Ke = (e) => (j(e.ns) && (e.ns = [e.ns]), j(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), j(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs?.indexOf?.("cimode") < 0 && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), typeof e.initImmediate == "boolean" && (e.initAsync = e.initImmediate), e), U = () => {}, qe = (e) => {
1436
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
1437
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
1438
+ });
1439
+ }, Je = "__i18next_supportNoticeShown", Ye = () => !!(typeof globalThis < "u" && globalThis[Je] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), Xe = () => {
1440
+ typeof globalThis < "u" && (globalThis[Je] = !0);
1441
+ }, Ze = (e) => !!(e?.modules?.backend?.name?.indexOf("Locize") > 0 || e?.modules?.backend?.constructor?.name?.indexOf("Locize") > 0 || e?.options?.backend?.backends && e.options.backend.backends.some((e) => e?.name?.indexOf("Locize") > 0 || e?.constructor?.name?.indexOf("Locize") > 0) || e?.options?.backend?.projectId || e?.options?.backend?.backendOptions && e.options.backend.backendOptions.some((e) => e?.projectId)), W = class e extends z {
1442
+ constructor(e = {}, t) {
1443
+ if (super(), this.options = Ke(e), this.services = {}, this.logger = R, this.modules = { external: [] }, qe(this), t && !this.isInitialized && !e.isClone) {
1444
+ if (!this.options.initAsync) return this.init(e, t), this;
1445
+ setTimeout(() => {
1446
+ this.init(e, t);
1447
+ }, 0);
1448
+ }
1449
+ }
1450
+ init(e = {}, t) {
1451
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (j(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1452
+ let n = Ge();
1453
+ this.options = {
1454
+ ...n,
1455
+ ...this.options,
1456
+ ...Ke(e)
1457
+ }, this.options.interpolation = {
1458
+ ...n.interpolation,
1459
+ ...this.options.interpolation
1460
+ }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = n.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !Ze(this) && !Ye() && (typeof console < "u" && console.info !== void 0 && console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), Xe());
1461
+ let r = (e) => e ? typeof e == "function" ? new e() : e : null;
1462
+ if (!this.options.isClone) {
1463
+ this.modules.logger ? R.init(r(this.modules.logger), this.options) : R.init(null, this.options);
1464
+ let e;
1465
+ e = this.modules.formatter ? this.modules.formatter : He;
1466
+ let t = new Ne(this.options);
1467
+ this.store = new De(this.options.resources, this.options);
1468
+ let i = this.services;
1469
+ i.logger = R, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new Ie(t, {
1470
+ prepend: this.options.pluralSeparator,
1471
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1472
+ }), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), e && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (i.formatter = r(e), i.formatter.init && i.formatter.init(i, this.options), this.options.interpolation.format = i.formatter.format.bind(i.formatter)), i.interpolator = new Re(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new We(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
1473
+ this.emit(e, ...t);
1474
+ }), this.modules.languageDetector && (i.languageDetector = r(this.modules.languageDetector), i.languageDetector.init && i.languageDetector.init(i, this.options.detection, this.options)), this.modules.i18nFormat && (i.i18nFormat = r(this.modules.i18nFormat), i.i18nFormat.init && i.i18nFormat.init(this)), this.translator = new Me(this.services, this.options), this.translator.on("*", (e, ...t) => {
1475
+ this.emit(e, ...t);
1476
+ }), this.modules.external.forEach((e) => {
1477
+ e.init && e.init(this);
1478
+ });
1479
+ }
1480
+ if (this.format = this.options.interpolation.format, t ||= U, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1481
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1482
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1483
+ }
1484
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1485
+ "getResource",
1486
+ "hasResourceBundle",
1487
+ "getResourceBundle",
1488
+ "getDataByLanguage"
1489
+ ].forEach((e) => {
1490
+ this[e] = (...t) => this.store[e](...t);
1491
+ }), [
1492
+ "addResource",
1493
+ "addResources",
1494
+ "addResourceBundle",
1495
+ "removeResourceBundle"
1496
+ ].forEach((e) => {
1497
+ this[e] = (...t) => (this.store[e](...t), this);
1498
+ });
1499
+ let i = M(), a = () => {
1500
+ let e = (e, n) => {
1501
+ this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i.resolve(n), t(e, n);
1502
+ };
1503
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1504
+ this.changeLanguage(this.options.lng, e);
1505
+ };
1506
+ return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
1507
+ }
1508
+ loadResources(e, t = U) {
1509
+ let n = t, r = j(e) ? e : this.language;
1510
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1511
+ if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1512
+ let e = [], t = (t) => {
1513
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1514
+ t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1515
+ });
1516
+ };
1517
+ r ? t(r) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => t(e)), this.options.preload?.forEach?.((e) => t(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
1518
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(e);
1519
+ });
1520
+ } else n(null);
1521
+ }
1522
+ reloadResources(e, t, n) {
1523
+ let r = M();
1524
+ return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= U, this.services.backendConnector.reload(e, t, (e) => {
1525
+ r.resolve(), n(e);
1526
+ }), r;
1527
+ }
1528
+ use(e) {
1529
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1530
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1531
+ return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && Oe.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1532
+ }
1533
+ setResolvedLanguage(e) {
1534
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1535
+ for (let e = 0; e < this.languages.length; e++) {
1536
+ let t = this.languages[e];
1537
+ if (!(["cimode", "dev"].indexOf(t) > -1) && this.store.hasLanguageSomeTranslations(t)) {
1538
+ this.resolvedLanguage = t;
1539
+ break;
1540
+ }
1541
+ }
1542
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1543
+ }
1544
+ }
1545
+ changeLanguage(e, t) {
1546
+ this.isLanguageChangingTo = e;
1547
+ let n = M();
1548
+ this.emit("languageChanging", e);
1549
+ let r = (e) => {
1550
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1551
+ }, i = (i, a) => {
1552
+ a ? this.isLanguageChangingTo === e && (r(a), this.translator.changeLanguage(a), this.isLanguageChangingTo = void 0, this.emit("languageChanged", a), this.logger.log("languageChanged", a)) : this.isLanguageChangingTo = void 0, n.resolve((...e) => this.t(...e)), t && t(i, (...e) => this.t(...e));
1553
+ }, a = (t) => {
1554
+ !e && !t && this.services.languageDetector && (t = []);
1555
+ let n = j(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(j(t) ? [t] : t);
1556
+ a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
1557
+ i(e, a);
1558
+ });
1559
+ };
1560
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), n;
1561
+ }
1562
+ getFixedT(e, t, n) {
1563
+ let r = (e, t, ...i) => {
1564
+ let a;
1565
+ a = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(i)), a.lng = a.lng || r.lng, a.lngs = a.lngs || r.lngs, a.ns = a.ns || r.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || n || r.keyPrefix);
1566
+ let o = {
1567
+ ...this.options,
1568
+ ...a
1569
+ };
1570
+ typeof a.keyPrefix == "function" && (a.keyPrefix = B(a.keyPrefix, o));
1571
+ let s = this.options.keySeparator || ".", c;
1572
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = B(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = B(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1573
+ };
1574
+ return j(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
1575
+ }
1576
+ t(...e) {
1577
+ return this.translator?.translate(...e);
1578
+ }
1579
+ exists(...e) {
1580
+ return this.translator?.exists(...e);
1581
+ }
1582
+ setDefaultNamespace(e) {
1583
+ this.options.defaultNS = e;
1584
+ }
1585
+ hasLoadedNamespace(e, t = {}) {
1586
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1587
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1588
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1589
+ if (n.toLowerCase() === "cimode") return !0;
1590
+ let a = (e, t) => {
1591
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1592
+ return n === -1 || n === 0 || n === 2;
1593
+ };
1594
+ if (t.precheck) {
1595
+ let e = t.precheck(this, a);
1596
+ if (e !== void 0) return e;
1597
+ }
1598
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1599
+ }
1600
+ loadNamespaces(e, t) {
1601
+ let n = M();
1602
+ return this.options.ns ? (j(e) && (e = [e]), e.forEach((e) => {
1603
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1604
+ }), this.loadResources((e) => {
1605
+ n.resolve(), t && t(e);
1606
+ }), n) : (t && t(), Promise.resolve());
1607
+ }
1608
+ loadLanguages(e, t) {
1609
+ let n = M();
1610
+ j(e) && (e = [e]);
1611
+ let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1612
+ return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
1613
+ n.resolve(), t && t(e);
1614
+ }), n) : (t && t(), Promise.resolve());
1615
+ }
1616
+ dir(e) {
1617
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1618
+ try {
1619
+ let t = new Intl.Locale(e);
1620
+ if (t && t.getTextInfo) {
1621
+ let e = t.getTextInfo();
1622
+ if (e && e.direction) return e.direction;
1623
+ }
1624
+ } catch {}
1625
+ let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new Ne(Ge());
1626
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1627
+ }
1628
+ static createInstance(t = {}, n) {
1629
+ let r = new e(t, n);
1630
+ return r.createInstance = e.createInstance, r;
1631
+ }
1632
+ cloneInstance(t = {}, n = U) {
1633
+ let r = t.forkResourceStore;
1634
+ r && delete t.forkResourceStore;
1635
+ let i = {
1636
+ ...this.options,
1637
+ ...t,
1638
+ isClone: !0
1639
+ }, a = new e(i);
1640
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1641
+ "store",
1642
+ "services",
1643
+ "language"
1644
+ ].forEach((e) => {
1645
+ a[e] = this[e];
1646
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new De(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
1647
+ let e = {
1648
+ ...Ge().interpolation,
1649
+ ...this.options.interpolation,
1650
+ ...t.interpolation
1651
+ }, n = {
1652
+ ...i,
1653
+ interpolation: e
1654
+ };
1655
+ a.services.interpolator = new Re(n);
1656
+ }
1657
+ return a.translator = new Me(a.services, i), a.translator.on("*", (e, ...t) => {
1658
+ a.emit(e, ...t);
1659
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1660
+ }
1661
+ toJSON() {
1662
+ return {
1663
+ options: this.options,
1664
+ store: this.store,
1665
+ language: this.language,
1666
+ languages: this.languages,
1667
+ resolvedLanguage: this.resolvedLanguage
1668
+ };
1669
+ }
1670
+ }.createInstance();
1671
+ //#endregion
1672
+ //#region ../../shared/translator/dist/index.js
1673
+ W.createInstance, W.dir, W.init, W.loadResources, W.reloadResources, W.use, W.changeLanguage, W.getFixedT, W.t, W.exists, W.setDefaultNamespace, W.hasLoadedNamespace, W.loadNamespaces, W.loadLanguages, W.init({
1674
+ fallbackLng: "en",
1675
+ lng: "en",
1676
+ showSupportNotice: !1,
1677
+ resources: {
1678
+ en: le,
1679
+ es: ue
1680
+ }
1681
+ });
1682
+ var Qe = {
1683
+ translator: {
1684
+ ...W,
1685
+ t: (e, t) => {
1686
+ let { lng: n } = t;
1687
+ switch (n) {
1688
+ case "en_US":
1689
+ case "en-US":
1690
+ t.lng = "en";
1691
+ break;
1692
+ case "es_ES":
1693
+ case "es-ES":
1694
+ case "es_MX":
1695
+ case "es-MX":
1696
+ t.lng = "es";
1697
+ break;
1698
+ default: break;
1699
+ }
1700
+ return W.t(e, {
1701
+ lng: n,
1702
+ ...t
1703
+ });
1704
+ }
1705
+ },
1706
+ languageOptions: [{
1707
+ value: "en_US",
1708
+ label: "English (US)"
1709
+ }, {
1710
+ value: "es_ES",
1711
+ label: "Spanish"
1712
+ }]
1713
+ };
1714
+ //#endregion
1715
+ //#region ../../lib-react/correct-answer-toggle/dist/index.js
1716
+ function G(e) {
1717
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1718
+ }
1719
+ function $e(e, t) {
1720
+ return !e || G(e) ? e : G(e.default) ? e.default : t && G(e[t]) ? e[t] : t && G(e[t]?.default) ? e[t].default : e;
1721
+ }
1722
+ var et = $e(h, "Readable") || $e(rt.Readable, "Readable"), tt = a, nt = tt.default, rt = nt && typeof nt == "object" ? nt : tt, { translator: K } = Qe, it = {
1723
+ WebkitTouchCallout: "none",
1724
+ WebkitUserSelect: "none",
1725
+ KhtmlUserSelect: "none",
1726
+ MozUserSelect: "none",
1727
+ msUserSelect: "none",
1728
+ userSelect: "none"
1729
+ }, at = g("div")(() => ({
1730
+ width: "100%",
1731
+ cursor: "pointer"
1732
+ })), ot = g("div")(() => ({
1733
+ margin: "0 auto",
1734
+ textAlign: "center",
1735
+ display: "flex"
1736
+ })), st = g("div")(() => ({
1737
+ width: "fit-content",
1738
+ minWidth: "140px",
1739
+ alignSelf: "center",
1740
+ verticalAlign: "middle",
1741
+ color: `var(--correct-answer-toggle-label-color, ${v.text()})`,
1742
+ fontWeight: "normal",
1743
+ ...it
1744
+ })), ct = g("div")(() => ({
1745
+ position: "absolute",
1746
+ width: "25px",
1747
+ "&.enter": { opacity: "0" },
1748
+ "&.enter-active": {
1749
+ opacity: "1",
1750
+ transition: "opacity 0.3s ease-in"
1751
+ },
1752
+ "&.exit": { opacity: "1" },
1753
+ "&.exit-active": {
1754
+ opacity: "0",
1755
+ transition: "opacity 0.3s ease-in"
1756
+ }
1757
+ })), lt = g("div")(() => ({
1758
+ width: "25px",
1759
+ marginRight: "5px",
1760
+ display: "flex",
1761
+ alignItems: "center"
1762
+ })), ut = class e extends C.Component {
1763
+ static propTypes = {
1764
+ onToggle: k.default.func,
1765
+ toggled: k.default.bool,
1766
+ show: k.default.bool,
1767
+ hideMessage: k.default.string,
1768
+ showMessage: k.default.string,
1769
+ className: k.default.string,
1770
+ language: k.default.string
1771
+ };
1772
+ static defaultProps = {
1773
+ showMessage: "Show correct answer",
1774
+ hideMessage: "Hide correct answer",
1775
+ show: !1,
1776
+ toggled: !1
1777
+ };
1778
+ constructor(t) {
1779
+ super(t), this.state = { show: t.show }, this.openIconRef = C.createRef(), this.closedIconRef = C.createRef(), e.defaultProps = {
1780
+ ...e.defaultProps,
1781
+ showMessage: K.t("common:showCorrectAnswer", { lng: t.language }),
1782
+ hideMessage: K.t("common:hideCorrectAnswer", { lng: t.language })
1783
+ };
1784
+ }
1785
+ onClick() {
1786
+ this.props.onToggle(!this.props.toggled);
1787
+ }
1788
+ onTouch(e) {
1789
+ e.preventDefault(), this.props.onToggle(!this.props.toggled);
1790
+ }
1791
+ UNSAFE_componentWillReceiveProps(t) {
1792
+ this.setState({ show: t.show }), t.language !== this.props?.language && (e.defaultProps = {
1793
+ ...e.defaultProps,
1794
+ showMessage: K.t("common:showCorrectAnswer", { lng: t.language }),
1795
+ hideMessage: K.t("common:hideCorrectAnswer", { lng: t.language })
1796
+ });
1797
+ }
1798
+ render() {
1799
+ let { className: e, toggled: t, hideMessage: n, showMessage: r } = this.props;
1800
+ return /* @__PURE__ */ D(at, {
1801
+ className: e,
1802
+ children: /* @__PURE__ */ D(ae, {
1803
+ show: this.state.show,
1804
+ children: /* @__PURE__ */ O(ot, {
1805
+ onClick: this.onClick.bind(this),
1806
+ onTouchEnd: this.onTouch.bind(this),
1807
+ children: [/* @__PURE__ */ O(lt, { children: [/* @__PURE__ */ D(s, {
1808
+ nodeRef: this.openIconRef,
1809
+ timeout: 400,
1810
+ in: t,
1811
+ exit: !t,
1812
+ classNames: {
1813
+ enter: "enter",
1814
+ enterActive: "enter-active",
1815
+ exit: "exit",
1816
+ exitActive: "exit-active"
1817
+ },
1818
+ children: /* @__PURE__ */ D(ct, {
1819
+ ref: this.openIconRef,
1820
+ children: /* @__PURE__ */ D(A, { open: t }, "correct-open")
1821
+ })
1822
+ }), /* @__PURE__ */ D(s, {
1823
+ nodeRef: this.closedIconRef,
1824
+ timeout: 5e3,
1825
+ in: !t,
1826
+ exit: t,
1827
+ classNames: {
1828
+ enter: "enter",
1829
+ enterActive: "enter-active",
1830
+ exit: "exit",
1831
+ exitActive: "exit-active"
1832
+ },
1833
+ children: /* @__PURE__ */ D(ct, {
1834
+ ref: this.closedIconRef,
1835
+ children: /* @__PURE__ */ D(A, { open: t }, "correct-closed")
1836
+ })
1837
+ })] }), /* @__PURE__ */ D(et, {
1838
+ false: !0,
1839
+ children: /* @__PURE__ */ D(st, {
1840
+ "aria-hidden": !this.state.show,
1841
+ children: t ? n : r
1842
+ })
1843
+ })]
1844
+ })
1845
+ })
1846
+ });
1847
+ }
1848
+ }, dt = /\{\{(\d+)\}\}/g, ft = (e, t) => e ? { markup: e.replace(dt, (e, n) => `<span data-component="${t}" data-id="${n}"></span>`) } : { markup: "" }, q = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), pt = /* @__PURE__ */ q(((e, t) => {
1849
+ t.exports = {
1850
+ "border-radius": 1,
1851
+ "border-top-left-radius": 1,
1852
+ "border-top-right-radius": 1,
1853
+ "border-bottom-left-radius": 1,
1854
+ "border-bottom-right-radius": 1,
1855
+ "box-shadow": 1,
1856
+ order: 1,
1857
+ flex: function(e, t) {
1858
+ return [t + "box-flex"];
1859
+ },
1860
+ "box-flex": 1,
1861
+ "box-align": 1,
1862
+ animation: 1,
1863
+ "animation-duration": 1,
1864
+ "animation-name": 1,
1865
+ transition: 1,
1866
+ "transition-duration": 1,
1867
+ transform: 1,
1868
+ "transform-style": 1,
1869
+ "transform-origin": 1,
1870
+ "backface-visibility": 1,
1871
+ perspective: 1,
1872
+ "box-pack": 1
1873
+ };
1874
+ }));
1875
+ pt();
1876
+ //#endregion
1877
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js
1878
+ var mt = /* @__PURE__ */ q(((e, t) => {
1879
+ t.exports = {
1880
+ animation: 1,
1881
+ "column-count": 1,
1882
+ columns: 1,
1883
+ "font-weight": 1,
1884
+ opacity: 1,
1885
+ "order ": 1,
1886
+ "z-index": 1,
1887
+ zoom: 1,
1888
+ flex: 1,
1889
+ "box-flex": 1,
1890
+ transform: 1,
1891
+ perspective: 1,
1892
+ "box-pack": 1,
1893
+ "box-align": 1,
1894
+ colspan: 1,
1895
+ rowspan: 1
1896
+ };
1897
+ }));
1898
+ mt();
1899
+ //#endregion
1900
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js
1901
+ var J = /* @__PURE__ */ q(((e, t) => {
1902
+ t.exports = function(e) {
1903
+ return e.length ? e.charAt(0).toUpperCase() + e.substring(1) : e;
1904
+ };
1905
+ }));
1906
+ J();
1907
+ //#endregion
1908
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js
1909
+ var ht = /* @__PURE__ */ q(((e, t) => {
1910
+ var n = J(), r = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/, i = typeof document > "u" ? {} : document.documentElement.style;
1911
+ t.exports = (function() {
1912
+ var e = (function() {
1913
+ for (var e in i) if (r.test(e)) return e.match(r)[0];
1914
+ return "WebkitOpacity" in i ? "Webkit" : "KhtmlOpacity" in i ? "Khtml" : "";
1915
+ })();
1916
+ return {
1917
+ style: e,
1918
+ css: "-" + e.toLowerCase() + "-",
1919
+ dom: {
1920
+ Webkit: "WebKit",
1921
+ ms: "MS",
1922
+ o: "WebKit"
1923
+ }[e] || n(e)
1924
+ };
1925
+ })();
1926
+ }));
1927
+ ht();
1928
+ //#endregion
1929
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js
1930
+ var gt = /* @__PURE__ */ q(((e, t) => {
1931
+ t.exports = /[-\s]+(.)?/g;
1932
+ }));
1933
+ gt();
1934
+ //#endregion
1935
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js
1936
+ var _t = /* @__PURE__ */ q(((e, t) => {
1937
+ var n = function(e, t) {
1938
+ return t ? t.toUpperCase() : "";
1939
+ }, r = gt();
1940
+ t.exports = function(e) {
1941
+ return e ? e.replace(r, n) : "";
1942
+ };
1943
+ }));
1944
+ _t();
1945
+ //#endregion
1946
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js
1947
+ var vt = /* @__PURE__ */ q(((e, t) => {
1948
+ var n = /::/g, r = /([A-Z]+)([A-Z][a-z])/g, i = /([a-z\d])([A-Z])/g, a = /_/g;
1949
+ t.exports = function(e, t) {
1950
+ return e ? e.replace(n, "/").replace(r, "$1_$2").replace(i, "$1_$2").replace(a, t || "-") : "";
1951
+ };
1952
+ }));
1953
+ vt();
1954
+ //#endregion
1955
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js
1956
+ var yt = /* @__PURE__ */ q(((e, t) => {
1957
+ var n = vt();
1958
+ t.exports = function(e) {
1959
+ return n(e).toLowerCase();
1960
+ };
1961
+ }));
1962
+ yt();
1963
+ //#endregion
1964
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js
1965
+ var bt = /* @__PURE__ */ q(((e, t) => {
1966
+ t.exports = function(e) {
1967
+ return e.length ? e.charAt(0).toLowerCase() + e.substring(1) : e;
1968
+ };
1969
+ }));
1970
+ bt();
1971
+ //#endregion
1972
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js
1973
+ var xt = /* @__PURE__ */ q(((e, t) => {
1974
+ var n = _t(), r = yt(), i = bt(), a = J(), o = ht(), s = pt(), c = typeof document > "u" ? {} : document.documentElement.style;
1975
+ t.exports = function(e) {
1976
+ return function(t, l) {
1977
+ l ||= {};
1978
+ var u = i(n(t)), d = r(t), f = e ? u : d, p = o.style ? e ? o.style : o.css : "";
1979
+ if (u in c) return l.asString ? f : [f];
1980
+ var m = f, h = s[d], g = [];
1981
+ if (e && (m = a(f)), typeof h == "function") {
1982
+ var _ = h(f, p) || [];
1983
+ _ && !Array.isArray(_) && (_ = [_]), _.length && (_ = _.map(function(t) {
1984
+ return e ? i(n(t)) : r(t);
1985
+ })), g = g.concat(_);
1986
+ }
1987
+ return p && g.push(p + m), g.push(f), l.asString || g.length == 1 ? g[0] : g;
1988
+ };
1989
+ };
1990
+ }));
1991
+ xt();
1992
+ //#endregion
1993
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js
1994
+ var St = /* @__PURE__ */ q(((e, t) => {
1995
+ t.exports = xt()();
1996
+ }));
1997
+ St();
1998
+ //#endregion
1999
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js
2000
+ var Ct = /* @__PURE__ */ q(((e, t) => {
2001
+ var n = Object.prototype.hasOwnProperty;
2002
+ t.exports = function(e, t) {
2003
+ return n.call(e, t);
2004
+ };
2005
+ }));
2006
+ Ct();
2007
+ //#endregion
2008
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js
2009
+ var wt = /* @__PURE__ */ q(((e, t) => {
2010
+ var n = Object.prototype.toString;
2011
+ t.exports = function(e) {
2012
+ return !!e && n.call(e) === "[object Object]";
2013
+ };
2014
+ }));
2015
+ wt();
2016
+ //#endregion
2017
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js
2018
+ var Tt = /* @__PURE__ */ q(((e, t) => {
2019
+ var n = Object.prototype.toString;
2020
+ t.exports = function(e) {
2021
+ return n.apply(e) === "[object Function]";
2022
+ };
2023
+ }));
2024
+ Tt();
2025
+ //#endregion
2026
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js
2027
+ var Et = /* @__PURE__ */ q(((e, t) => {
2028
+ ht();
2029
+ var n = St(), r = yt(), i = _t(), a = Ct(), o = wt(), s = Tt(), c = function(e, t, r, i) {
2030
+ n(t).forEach(function(t) {
2031
+ e[i ? i(t) : t] = r;
2032
+ });
2033
+ }, l = function(e) {
2034
+ e = (e || "").split(";");
2035
+ var t = {};
2036
+ return e.forEach(function(e) {
2037
+ var n = e.split(":");
2038
+ n.length == 2 && (t[n[0].trim()] = n[1].trim());
2039
+ }), t;
2040
+ }, u = { cssUnitless: mt() }, d = function(e, t, n, f) {
2041
+ typeof e == "string" && (e = l(e)), t ||= u, t.cssUnitless = t.cssUnitless || u.cssUnitless, f ||= {};
2042
+ var p = t.scope || {}, m = t.addUnits == null ? p && p.addUnits != null ? p.addUnits : !0 : t.addUnits, h = (t.cssUnitless == null ? p ? p.cssUnitless : null : t.cssUnitless) || {}, g = (t.cssUnit || p ? p.cssUnit : null) || "px", _ = t.prefixProperties || (p ? p.prefixProperties : null) || {}, v = t.camelize ? i : r, y, b, x, S, C, w, T, E;
2043
+ for (x in e) if (a(e, x)) {
2044
+ if (S = e[x], b = r(n ? n + x : x), y = !1, E = !1, s(S) && (T = S.call(p || e, S, x, b, e), o(T) && T.value != null ? (S = T.value, E = T.prefix, b = T.name ? r(T.name) : b) : S = T), C = typeof S, w = C == "number" || C == "string" && S != "" && S * 1 == S, S == null || b == null || b === "") continue;
2045
+ if ((w || C == "string") && (y = !0), !y && S.value != null && S.prefix && (y = !0, E = S.prefix, S = S.value), y) {
2046
+ if (E ||= !!_[b], w && (S = m && !(b in h) ? S + g : S + ""), (b == "border" || !b.indexOf("border") && !~b.indexOf("radius") && !~b.indexOf("width")) && w && (b += "-width"), !b.indexOf("border-radius-") && (b.replace(/border(-radius)(-(.*))/, function(e, t, n) {
2047
+ var r = {
2048
+ "-top": ["-top-left", "-top-right"],
2049
+ "-left": ["-top-left", "-bottom-left"],
2050
+ "-right": ["-top-right", "-bottom-right"],
2051
+ "-bottom": ["-bottom-left", "-bottom-right"]
2052
+ };
2053
+ n in r ? (b = [], r[n].forEach(function(e) {
2054
+ b.push("border" + e + t);
2055
+ })) : b = "border" + n + t;
2056
+ }), Array.isArray(b))) {
2057
+ b.forEach(function(e) {
2058
+ E ? c(f, e, S, v) : f[v(e)] = S;
2059
+ });
2060
+ continue;
2061
+ }
2062
+ E ? c(f, b, S, v) : f[v(b)] = S;
2063
+ } else d(S, t, b + "-", f);
2064
+ }
2065
+ return f;
2066
+ };
2067
+ t.exports = d;
2068
+ }));
2069
+ Et();
2070
+ //#endregion
2071
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js
2072
+ var Dt = /* @__PURE__ */ q(((e, t) => {
2073
+ var n = Et(), r = Ct();
2074
+ t.exports = function(e, t) {
2075
+ e = n(e, t);
2076
+ var i = [], a;
2077
+ for (a in e) r(e, a) && i.push(a + ": " + e[a]);
2078
+ return i.join("; ");
2079
+ };
2080
+ }));
2081
+ Dt();
2082
+ //#endregion
2083
+ //#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js
2084
+ var Ot = /* @__PURE__ */ q(((e, t) => {
2085
+ t.exports = {
2086
+ prefixProperties: pt(),
2087
+ cssUnitless: mt(),
2088
+ object: Et(),
2089
+ string: Dt()
2090
+ };
2091
+ }));
2092
+ Ot();
2093
+ //#endregion
2094
+ //#region ../../lib-react/mask-markup/dist/serialization.js
2095
+ var kt = /* @__PURE__ */ e(u(), 1), At = Ot(), jt = (0, kt.default)("@pie-lib:mask-markup:serialization"), Mt = ["span"], Nt = [
2096
+ "em",
2097
+ "strong",
2098
+ "u"
2099
+ ], Pt = 3, Ft = 8, It = 1, Lt = (e) => {
2100
+ if (!e.attributes || e.attributes.length <= 0) return;
2101
+ let t = {}, n;
2102
+ for (n = 0; n < e.attributes.length; n++) {
2103
+ let r = e.attributes[n];
2104
+ t[r.name] = r.value;
2105
+ }
2106
+ return t;
2107
+ }, Rt = (e) => Mt.includes(e) ? "inline" : Nt.includes(e) ? "mark" : "block", zt = (e) => {
2108
+ let t = /([\w-]*)\s*:\s*([^;]*)/g, n, r = {};
2109
+ for (; n = t.exec(e);) r[n[1]] = n[2].trim();
2110
+ return r;
2111
+ }, Bt = (e) => (0, At.object)(e, {
2112
+ camelize: !0,
2113
+ addUnits: !1
2114
+ }), Vt = (e, t) => Bt(zt(e.getAttribute(t))), Ht = (e, t, n) => {
2115
+ let r = e.getAttribute(n);
2116
+ return delete t.class, r;
2117
+ }, Ut = (e) => (t, n) => {
2118
+ if (!e.getAttribute) return t;
2119
+ if (e.getAttribute(n)) switch (n) {
2120
+ case "style":
2121
+ t.style = Vt(e, n);
2122
+ break;
2123
+ case "class":
2124
+ t.className = Ht(e, t, n);
2125
+ break;
2126
+ default:
2127
+ t[n] = e.getAttribute(n);
2128
+ break;
2129
+ }
2130
+ return t;
2131
+ }, Wt = [
2132
+ "border",
2133
+ "class",
2134
+ "style"
2135
+ ], Gt = {
2136
+ b: "bold",
2137
+ em: "italic",
2138
+ u: "underline",
2139
+ s: "strikethrough",
2140
+ code: "code",
2141
+ strong: "strong"
2142
+ }, Kt = (e, t = []) => {
2143
+ if (e.nodeType === Ft) return null;
2144
+ if (e.nodeType === Pt) {
2145
+ let n = { text: e.textContent };
2146
+ return t.length > 0 && (n.marks = t.map((e) => ({
2147
+ type: e,
2148
+ data: void 0
2149
+ }))), {
2150
+ object: "text",
2151
+ leaves: [n]
2152
+ };
2153
+ }
2154
+ if (e.nodeType === It) {
2155
+ let n = e.tagName.toLowerCase(), r = Gt[n];
2156
+ if (r) return jt("[deserialize] mark: ", r), {
2157
+ _flatten: !0,
2158
+ nodes: qt(e.childNodes, [...t, r])
2159
+ };
2160
+ if (n === "math") return {
2161
+ isMath: !0,
2162
+ nodes: [e]
2163
+ };
2164
+ let i = Lt(e) || {};
2165
+ n === "audio" && i.controls === "" && (i.controls = !0);
2166
+ let a = Wt.reduce(Ut(e), { ...i }), o = Rt(n), s = qt(e.childNodes, t);
2167
+ return {
2168
+ object: o,
2169
+ type: n,
2170
+ data: {
2171
+ dataset: { ...e.dataset },
2172
+ attributes: { ...a }
2173
+ },
2174
+ nodes: s
2175
+ };
2176
+ }
2177
+ return null;
2178
+ }, qt = (e, t = []) => {
2179
+ let n = [];
2180
+ for (let r = 0; r < e.length; r++) {
2181
+ let i = Kt(e[r], t);
2182
+ i !== null && (i._flatten && i.nodes ? n.push(...i.nodes) : n.push(i));
2183
+ }
2184
+ return n;
2185
+ }, Jt = (e) => {
2186
+ if (!e || !e.trim()) return {
2187
+ object: "value",
2188
+ document: {
2189
+ object: "document",
2190
+ data: {},
2191
+ nodes: [{
2192
+ object: "block",
2193
+ type: "span",
2194
+ data: {},
2195
+ isVoid: !1,
2196
+ nodes: []
2197
+ }]
2198
+ }
2199
+ };
2200
+ let t = qt(new DOMParser().parseFromString(e, "text/html").body.childNodes);
2201
+ return !t.some((e) => e.object === "block" || e.object === "inline") && t.length > 0 && (t = [{
2202
+ object: "block",
2203
+ type: "span",
2204
+ data: {},
2205
+ isVoid: !1,
2206
+ nodes: t
2207
+ }]), t.length === 0 && (t = [{
2208
+ object: "block",
2209
+ type: "span",
2210
+ data: {},
2211
+ isVoid: !1,
2212
+ nodes: []
2213
+ }]), {
2214
+ object: "value",
2215
+ document: {
2216
+ object: "document",
2217
+ data: {},
2218
+ nodes: t
2219
+ }
2220
+ };
2221
+ }, Yt = g("div")(({ theme: e }) => ({
2222
+ paddingTop: e.spacing(.5),
2223
+ paddingBottom: e.spacing(.5)
2224
+ })), Xt = g("span")(() => ({
2225
+ display: "inline-block",
2226
+ width: ".75em"
2227
+ })), Zt = ["tbody", "tr"], Qt = (e, t) => {
2228
+ let n = t.trim() === "", r = e && e.type;
2229
+ if (!(n && Zt.includes(r))) return t;
2230
+ }, $t = (e) => {
2231
+ let t = e.leaves.find((e) => x(e, "marks", []).length);
2232
+ return t ? t.marks : null;
2233
+ }, en = (e, t, n, r, i, a) => {
2234
+ if (!t) return null;
2235
+ let o = [];
2236
+ return (e.nodes || []).forEach((e, s) => {
2237
+ let c = e.type ? `${e.type}-${s}` : `${s}`;
2238
+ if (e.isMath) return o.push(/* @__PURE__ */ D("span", { dangerouslySetInnerHTML: { __html: `<math displaystyle="true">${e.nodes[0].innerHTML}</math>` } })), o;
2239
+ if (r) {
2240
+ let i = r(e, t, n);
2241
+ if (i) {
2242
+ let t = e.data?.dataset?.component === "blank";
2243
+ t && o.push(/* @__PURE__ */ D(Xt, {}, `spacer-${s}-before`)), o.push(i), t && o.push(/* @__PURE__ */ D(Xt, {}, `spacer-${s}-after`));
2244
+ return;
2245
+ }
2246
+ }
2247
+ if (e.object === "text") {
2248
+ let t = e.leaves.reduce((e, t) => {
2249
+ let n = t.text, r = Qt(i, n);
2250
+ return r ? e + r : e;
2251
+ }, ""), n = $t(e);
2252
+ if (n?.length > 0) {
2253
+ let e = n.map((e) => Object.keys(Gt).find((t) => Gt[t] === e.type)).filter(Boolean);
2254
+ e.length > 0 ? o.push(e.reduceRight((e, t, n) => /* @__PURE__ */ D(t, { children: e }, `${c}-${t}-${n}`), t)) : o.push(t);
2255
+ } else t.length > 0 && o.push(t);
2256
+ } else {
2257
+ let i = en(e, t, n, r, e, a);
2258
+ if (e.type === "p" || e.type === "paragraph") o.push(/* @__PURE__ */ D(Yt, { children: i }, c));
2259
+ else {
2260
+ let t = e.type;
2261
+ e.nodes && e.nodes.length > 0 ? o.push(/* @__PURE__ */ D(t, {
2262
+ ...e.data.attributes,
2263
+ children: i
2264
+ }, c)) : o.push(/* @__PURE__ */ D(t, { ...e.data.attributes }, c));
2265
+ }
2266
+ }
2267
+ }), o;
2268
+ }, tn = g("div")(() => ({
2269
+ display: "initial",
2270
+ "&:not(.MathJax) table": { borderCollapse: "collapse" },
2271
+ "&:not(.MathJax) table td, &:not(.MathJax) table th": {
2272
+ padding: "8px 12px",
2273
+ textAlign: "left"
2274
+ }
2275
+ })), nn = class extends C.Component {
2276
+ constructor(e) {
2277
+ super(e), this.internalContainerRef = C.createRef();
2278
+ }
2279
+ static propTypes = {
2280
+ renderChildren: k.default.func,
2281
+ layout: k.default.object,
2282
+ value: k.default.object,
2283
+ onChange: k.default.func,
2284
+ elementType: k.default.string,
2285
+ containerRef: k.default.oneOfType([k.default.func, k.default.shape({ current: k.default.instanceOf(Element) })])
2286
+ };
2287
+ componentDidMount() {
2288
+ let e = this.props.containerRef || this.internalContainerRef;
2289
+ e.current && typeof r == "function" && r(e.current);
2290
+ }
2291
+ handleChange = (e, t) => {
2292
+ let n = {
2293
+ ...this.props.value,
2294
+ [e]: t
2295
+ };
2296
+ this.props.onChange(n);
2297
+ };
2298
+ render() {
2299
+ let { value: e, layout: t, elementType: n, containerRef: r } = this.props, i = en(t, e, this.handleChange, this.props.renderChildren, null, n);
2300
+ return /* @__PURE__ */ D(tn, {
2301
+ ref: r || this.internalContainerRef,
2302
+ children: i
2303
+ });
2304
+ }
2305
+ }, rn = (e, t) => {
2306
+ let { markup: n } = ft(e, t);
2307
+ return Jt(n).document;
2308
+ }, an = (e, t) => class extends C.Component {
2309
+ static propTypes = {
2310
+ markup: k.default.string,
2311
+ layout: k.default.object,
2312
+ value: k.default.object,
2313
+ onChange: k.default.func,
2314
+ customMarkMarkupComponent: k.default.func,
2315
+ elementType: k.default.string
2316
+ };
2317
+ constructor(e) {
2318
+ super(e), this.containerRef = C.createRef();
2319
+ }
2320
+ componentDidUpdate(e) {
2321
+ if (this.props.markup !== e.markup) {
2322
+ let e = this.containerRef.current;
2323
+ (e && e.querySelectorAll("[data-latex][data-math-handled=\"true\"]") || []).forEach((e) => {
2324
+ let t = e.querySelector("mjx-container");
2325
+ t && e.removeChild(t), e.innerHTML = e.getAttribute("data-raw"), e.removeAttribute("data-math-handled");
2326
+ });
2327
+ }
2328
+ }
2329
+ render() {
2330
+ let { markup: n, layout: r, value: i, onChange: a, elementType: o } = this.props, s = r || rn(n, e);
2331
+ return /* @__PURE__ */ D(nn, {
2332
+ containerRef: this.containerRef,
2333
+ elementType: o,
2334
+ layout: s,
2335
+ value: i,
2336
+ onChange: a,
2337
+ renderChildren: t(this.props)
2338
+ });
2339
+ }
2340
+ }, on = n(/*#__PURE__*/ D("path", { d: "m7 10 5 5 5-5z" }), "ArrowDropDown"), sn = n(/*#__PURE__*/ D("path", { d: "m7 14 5-5 5 5z" }), "ArrowDropUp");
2341
+ //#endregion
2342
+ //#region ../../lib-react/mask-markup/dist/components/dropdown.js
2343
+ function Y(e) {
2344
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
2345
+ }
2346
+ function cn(e, t) {
2347
+ return !e || Y(e) ? e : Y(e.default) ? e.default : t && Y(e[t]) ? e[t] : t && Y(e[t]?.default) ? e[t].default : e;
2348
+ }
2349
+ var ln = cn(m, "InlineMenu") || cn(fn.InlineMenu, "InlineMenu"), un = a, dn = un.default, fn = dn && typeof dn == "object" ? dn : un, pn = v.v("pie"), mn = g(b)(() => ({
2350
+ color: v.text(),
2351
+ border: `1px solid ${v.borderGray()}`,
2352
+ borderRadius: "4px",
2353
+ justifyContent: "space-between",
2354
+ backgroundColor: v.background(),
2355
+ position: "relative",
2356
+ height: "45px",
2357
+ width: "fit-content",
2358
+ margin: "2px",
2359
+ textTransform: "none",
2360
+ "& span": { paddingRight: "24px" },
2361
+ "& svg": {
2362
+ position: "absolute",
2363
+ right: "4px",
2364
+ top: "calc(50% - 12px)",
2365
+ pointerEvents: "none",
2366
+ color: v.text(),
2367
+ marginLeft: "5px"
2368
+ },
2369
+ "&.Mui-focused": {
2370
+ outline: `3px solid ${v.tertiary()}`,
2371
+ outlineOffset: "2px",
2372
+ borderWidth: "3px"
2373
+ },
2374
+ "&.disabledCorrect": {
2375
+ borderWidth: "2px",
2376
+ borderColor: v.correct(),
2377
+ color: `${v.text()} !important`
2378
+ },
2379
+ "&.disabledIncorrect": {
2380
+ borderWidth: "2px",
2381
+ borderColor: v.incorrectWithIcon(),
2382
+ color: `${v.text()} !important`
2383
+ }
2384
+ })), hn = g(ln)(() => ({
2385
+ "& .MuiPaper-root": { backgroundColor: pn("background", v.defaults.WHITE) },
2386
+ "& .MuiList-root": { padding: 0 }
2387
+ })), gn = g(p)(() => ({
2388
+ height: 24,
2389
+ overflow: "hidden",
2390
+ fontSize: "1rem",
2391
+ fontWeight: 400,
2392
+ fontFamily: "inherit",
2393
+ lineHeight: "1.5em",
2394
+ whiteSpace: "nowrap",
2395
+ color: v.text(),
2396
+ backgroundColor: v.background(),
2397
+ "&.Mui-focusVisible": {
2398
+ outline: `3px solid ${v.tertiary()}`,
2399
+ outlineOffset: "-1px",
2400
+ color: v.text(),
2401
+ backgroundColor: v.background()
2402
+ },
2403
+ "&:hover": {
2404
+ color: v.text(),
2405
+ backgroundColor: v.dropdownBackground()
2406
+ },
2407
+ boxSizing: "border-box",
2408
+ padding: "16px 8px",
2409
+ borderRadius: "4px",
2410
+ "&.selected": {
2411
+ color: `${v.text()} !important`,
2412
+ backgroundColor: `${v.background()} !important`,
2413
+ "&:hover": {
2414
+ color: v.text(),
2415
+ backgroundColor: `${v.dropdownBackground()} !important`
2416
+ }
2417
+ }
2418
+ })), _n = g("span")(() => ({ fontSize: "max(1rem, 14px)" })), vn = g("span")(() => ({
2419
+ fontSize: "max(1rem, 14px)",
2420
+ flexShrink: 0,
2421
+ paddingLeft: "8px"
2422
+ })), yn = g(y)(() => ({
2423
+ position: "absolute",
2424
+ left: "-10000px",
2425
+ top: "auto",
2426
+ width: "1px",
2427
+ height: "1px",
2428
+ overflow: "hidden"
2429
+ })), bn = g(l)(() => ({
2430
+ color: `${v.white()} !important`,
2431
+ position: "absolute",
2432
+ top: "-8px !important",
2433
+ left: "-8px",
2434
+ marginLeft: "0 !important",
2435
+ borderRadius: "50%",
2436
+ fontSize: "16px",
2437
+ padding: "2px",
2438
+ "&.correct": { backgroundColor: v.correct() },
2439
+ "&.incorrect": { backgroundColor: v.incorrectWithIcon() }
2440
+ })), xn = g(_)(() => ({
2441
+ color: `${v.white()} !important`,
2442
+ position: "absolute",
2443
+ top: "-8px !important",
2444
+ left: "-8px",
2445
+ marginLeft: "0 !important",
2446
+ borderRadius: "50%",
2447
+ fontSize: "16px",
2448
+ padding: "2px",
2449
+ "&.correct": { backgroundColor: v.correct() },
2450
+ "&.incorrect": { backgroundColor: v.incorrectWithIcon() }
2451
+ })), Sn = class extends C.Component {
2452
+ static propTypes = {
2453
+ id: k.default.string,
2454
+ value: k.default.string,
2455
+ disabled: k.default.bool,
2456
+ onChange: k.default.func,
2457
+ correct: k.default.bool,
2458
+ choices: k.default.arrayOf(k.default.shape({
2459
+ value: k.default.string,
2460
+ label: k.default.string
2461
+ })),
2462
+ showCorrectAnswer: k.default.bool,
2463
+ singleQuery: k.default.bool,
2464
+ correctValue: k.default.string
2465
+ };
2466
+ constructor(e) {
2467
+ super(e), this.state = {
2468
+ anchorEl: null,
2469
+ highlightedOptionId: null,
2470
+ menuWidth: null,
2471
+ previewValue: null
2472
+ }, this.hiddenRef = C.createRef(), this.buttonRef = C.createRef(), this.previewRef = C.createRef(), this.elementRefs = [];
2473
+ }
2474
+ componentDidMount() {
2475
+ this.hiddenRef.current && this.state.menuWidth === null && this.setState({ menuWidth: this.hiddenRef.current.clientWidth });
2476
+ }
2477
+ componentDidUpdate(e, t) {
2478
+ let n = this.hiddenRef.current;
2479
+ if (!t.anchorEl && this.state.anchorEl && this.elementRefs.forEach((e) => {
2480
+ if (!e) return;
2481
+ let t = e.querySelector("[data-latex], [data-raw]"), n = e.querySelector("mjx-container"), i = e.querySelector("[data-math-handled=\"true\"]");
2482
+ t && (!i || !n) && r(e);
2483
+ }), n) {
2484
+ let e = n.clientWidth;
2485
+ e !== this.state.menuWidth && (this.elementRefs.forEach((e) => {
2486
+ e && r(e);
2487
+ }), r(n), this.setState({ menuWidth: e }));
2488
+ }
2489
+ }
2490
+ handleClick = (e) => {
2491
+ let { id: t, value: n, choices: r } = this.props, i = null;
2492
+ if (n) {
2493
+ let e = (r || []).findIndex((e) => e.value === n);
2494
+ e >= 0 && (i = `dropdown-option-${t}-${e}`);
2495
+ }
2496
+ this.setState({
2497
+ anchorEl: e.currentTarget,
2498
+ highlightedOptionId: i
2499
+ });
2500
+ };
2501
+ handleClose = () => {
2502
+ let { value: e } = this.props;
2503
+ this.setState({
2504
+ anchorEl: null,
2505
+ previewValue: null,
2506
+ highlightedOptionId: null
2507
+ }), !e && this.previewRef.current && (this.previewRef.current.innerHTML = "");
2508
+ };
2509
+ handleHighlight = (e) => {
2510
+ let t = { highlightedOptionId: `dropdown-option-${this.props.id}-${e}` };
2511
+ this.props.value || (t.previewValue = this.props.choices[e].value), this.setState(t);
2512
+ };
2513
+ handleSelect = (e, t) => {
2514
+ this.props.onChange(this.props.id, e), this.handleHighlight(t), this.handleClose();
2515
+ };
2516
+ handleHover = (e) => {
2517
+ if (this.props.value) return;
2518
+ let t = `dropdown-option-${this.props.id}-${e}`, n = this.state.previewValue;
2519
+ this.setState({
2520
+ highlightedOptionId: t,
2521
+ previewValue: n
2522
+ }, () => {
2523
+ let t = this.elementRefs[e], n = this.previewRef.current;
2524
+ t && n && (n.innerHTML = t.innerHTML);
2525
+ });
2526
+ };
2527
+ getLabel(e, t) {
2528
+ let n = (e || []).find((e) => e.value === t);
2529
+ return n ? n.label.trim() : void 0;
2530
+ }
2531
+ render() {
2532
+ let { id: e, correct: t, disabled: n, value: r, choices: i, showCorrectAnswer: a, singleQuery: o, correctValue: s } = this.props, { anchorEl: c } = this.state, l = !!c, u = `dropdown-button-${e}`, d = `dropdown-menu-${e}`, f = `dropdown-value-${e}`, p;
2533
+ this.elementRefs = [], n && t !== void 0 && (p = t || a ? "disabledCorrect" : "disabledIncorrect");
2534
+ let m = parseInt(e, 10) + 1, h = o ? "Query-label" : `Query-label-${m}`, g = o ? "Query" : `Query ${m}`, _ = null;
2535
+ return n && t !== void 0 && (_ = t || a ? /* @__PURE__ */ D(bn, { className: "correct" }) : /* @__PURE__ */ D(xn, { className: "incorrect" })), /* @__PURE__ */ O(ee, { children: [
2536
+ /* @__PURE__ */ D("div", {
2537
+ ref: this.hiddenRef,
2538
+ style: {
2539
+ position: "absolute",
2540
+ visibility: "hidden",
2541
+ top: 0,
2542
+ left: 0
2543
+ },
2544
+ tabIndex: -1,
2545
+ "aria-hidden": "true",
2546
+ children: (i || []).map((e, t) => /* @__PURE__ */ D(gn, {
2547
+ tabIndex: -1,
2548
+ "aria-hidden": "true",
2549
+ children: /* @__PURE__ */ D(_n, { dangerouslySetInnerHTML: { __html: e.label } })
2550
+ }, t))
2551
+ }),
2552
+ /* @__PURE__ */ D(yn, {
2553
+ id: h,
2554
+ tabIndex: -1,
2555
+ "aria-hidden": "true",
2556
+ children: g
2557
+ }),
2558
+ /* @__PURE__ */ O(mn, {
2559
+ ref: this.buttonRef,
2560
+ style: {
2561
+ ...this.state.menuWidth && { minWidth: `calc(${this.state.menuWidth}px + 8px)` },
2562
+ borderWidth: l ? "2px" : "1px",
2563
+ transition: "border-width 0.2s ease-in-out"
2564
+ },
2565
+ "aria-controls": l ? d : void 0,
2566
+ "aria-haspopup": "listbox",
2567
+ "aria-expanded": l ? "true" : void 0,
2568
+ "aria-activedescendant": this.state.highlightedOptionId,
2569
+ onClick: this.handleClick,
2570
+ className: p,
2571
+ disabled: n,
2572
+ id: u,
2573
+ role: "combobox",
2574
+ "aria-label": `Select an option for ${g}`,
2575
+ "aria-labelledby": f,
2576
+ children: [
2577
+ _,
2578
+ /* @__PURE__ */ D(_n, {
2579
+ id: f,
2580
+ ref: this.previewRef,
2581
+ dangerouslySetInnerHTML: { __html: s || (l && this.state.previewValue ? this.getLabel(i, this.state.previewValue) : this.getLabel(i, r) || "") }
2582
+ }),
2583
+ D(l ? sn : on, {})
2584
+ ]
2585
+ }),
2586
+ /* @__PURE__ */ D(hn, {
2587
+ id: d,
2588
+ anchorEl: c,
2589
+ keepMounted: !0,
2590
+ open: l,
2591
+ onClose: this.handleClose,
2592
+ getContentAnchorEl: null,
2593
+ anchorOrigin: {
2594
+ vertical: "bottom",
2595
+ horizontal: "left"
2596
+ },
2597
+ transformOrigin: {
2598
+ vertical: "top",
2599
+ horizontal: "left"
2600
+ },
2601
+ transitionDuration: {
2602
+ enter: 225,
2603
+ exit: 195
2604
+ },
2605
+ slotProps: {
2606
+ paper: this.state.menuWidth ? { style: {
2607
+ minWidth: this.state.menuWidth,
2608
+ padding: "4px"
2609
+ } } : void 0,
2610
+ list: {
2611
+ "aria-labelledby": u,
2612
+ role: "listbox",
2613
+ disablePadding: !0
2614
+ }
2615
+ },
2616
+ children: (i || []).map((t, n) => {
2617
+ let i = `dropdown-option-${e}-${n}`;
2618
+ return /* @__PURE__ */ O(gn, {
2619
+ id: i,
2620
+ className: t.value === r ? "selected" : "",
2621
+ selected: t.value === r,
2622
+ value: t.value,
2623
+ onClick: () => this.handleSelect(t.value, n),
2624
+ role: "option",
2625
+ "aria-selected": this.state.highlightedOptionId === i ? "true" : void 0,
2626
+ onMouseOver: () => this.handleHover(n),
2627
+ children: [/* @__PURE__ */ D(_n, {
2628
+ ref: (e) => this.elementRefs[n] = e,
2629
+ dangerouslySetInnerHTML: { __html: t.label }
2630
+ }), /* @__PURE__ */ D(vn, { dangerouslySetInnerHTML: { __html: t.value === r ? " &check;" : "" } })]
2631
+ }, `${t.label}-${n}`);
2632
+ })
2633
+ })
2634
+ ] });
2635
+ }
2636
+ }, Cn = an("dropdown", (e) => (t, n, r) => {
2637
+ let i = t.data && t.data.dataset || {};
2638
+ if (i.component === "dropdown") {
2639
+ let { choices: a, disabled: o, feedback: s, showCorrectAnswer: c } = e, l = a && a[i.id] && a[i.id].find((e) => e.correct), u = c ? l && l.value : n[i.id];
2640
+ return /* @__PURE__ */ D(Sn, {
2641
+ correct: s && s[i.id] && s[i.id] === "correct",
2642
+ disabled: o || c,
2643
+ value: u,
2644
+ correctValue: c ? l && l.label : void 0,
2645
+ id: i.id,
2646
+ onChange: r,
2647
+ choices: a[i.id],
2648
+ showCorrectAnswer: c,
2649
+ singleQuery: Object.keys(a).length == 1
2650
+ }, `${t.type}-dropdown-${i.id}`);
2651
+ }
2652
+ });
2653
+ //#endregion
2654
+ //#region src/delivery/inline-dropdown.tsx
2655
+ function X(e) {
2656
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
2657
+ }
2658
+ function Z(e, t) {
2659
+ return !e || X(e) ? e : X(e.default) ? e.default : t && X(e[t]) ? e[t] : t && X(e[t]?.default) ? e[t].default : e;
2660
+ }
2661
+ var wn = Z(i, "UiLayout") || Z($.UiLayout, "UiLayout"), Q = Z(f, "PreviewPrompt") || Z($.PreviewPrompt, "PreviewPrompt"), Tn = Z(d, "Collapsible") || Z($.Collapsible, "Collapsible"), En = a, Dn = En.default, $ = Dn && typeof Dn == "object" ? Dn : En, On = g(wn)({
2662
+ color: v.text(),
2663
+ backgroundColor: v.background()
2664
+ }), kn = g(Tn)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), An = g("div")(({ theme: e }) => ({ "&:not(:last-child)": { marginBottom: e.spacing(2) } })), jn = g("div")({
2665
+ display: "flex",
2666
+ whiteSpace: "break-spaces"
2667
+ }), Mn = g("div")(({ correct: e }) => ({
2668
+ display: "flex",
2669
+ ...e ? { color: v.correct() } : { color: v.incorrectWithIcon() }
2670
+ })), Nn = g("h2")({
2671
+ position: "absolute",
2672
+ left: "-10000px",
2673
+ top: "auto",
2674
+ width: "1px",
2675
+ height: "1px",
2676
+ overflow: "hidden"
2677
+ }), Pn = class extends C.Component {
2678
+ static propTypes = {
2679
+ prompt: k.default.string,
2680
+ disabled: k.default.bool,
2681
+ markup: k.default.string,
2682
+ mode: k.default.string,
2683
+ displayType: k.default.string,
2684
+ rationale: k.default.string,
2685
+ teacherInstructions: k.default.string,
2686
+ model: k.default.object.isRequired,
2687
+ choices: k.default.object,
2688
+ value: k.default.object,
2689
+ feedback: k.default.object,
2690
+ onChange: k.default.func,
2691
+ language: k.default.string
2692
+ };
2693
+ static defaultProps = { value: {} };
2694
+ state = { showCorrectAnswer: !1 };
2695
+ UNSAFE_componentWillReceiveProps(e) {
2696
+ S(e.feedback) && this.setState({ showCorrectAnswer: !1 });
2697
+ }
2698
+ componentDidUpdate() {
2699
+ r(E.findDOMNode(this));
2700
+ }
2701
+ toggleShowCorrect = () => {
2702
+ this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });
2703
+ };
2704
+ render() {
2705
+ let { showCorrectAnswer: e } = this.state, { prompt: t, mode: n, model: r, rationale: i, teacherInstructions: a, choices: s, displayType: l, language: u } = this.props, { extraCSSRules: d } = r || {}, f = n === "evaluate", p = !1, m = i && (c(i) || o(i)), h = a && (c(a) || o(a)), g = (Object.keys(s) || []).map((e) => (s[e] || []).reduce((e, t) => (t.rationale && c(t.rationale) && (p = !0, e.push(t)), e), []));
2706
+ return /* @__PURE__ */ O(On, {
2707
+ extraCSSRules: d,
2708
+ style: { display: `${l}` },
2709
+ children: [
2710
+ n === "gather" && /* @__PURE__ */ D(Nn, { children: "Inline Dropdown Question" }),
2711
+ h && /* @__PURE__ */ D(kn, {
2712
+ labels: {
2713
+ hidden: "Show Teacher Instructions",
2714
+ visible: "Hide Teacher Instructions"
2715
+ },
2716
+ children: /* @__PURE__ */ D(Q, { prompt: a })
2717
+ }),
2718
+ t && /* @__PURE__ */ D(Q, { prompt: t }),
2719
+ /* @__PURE__ */ D(ut, {
2720
+ show: f,
2721
+ toggled: e,
2722
+ onToggle: this.toggleShowCorrect,
2723
+ language: u
2724
+ }),
2725
+ /* @__PURE__ */ D(Cn, {
2726
+ ...this.props,
2727
+ showCorrectAnswer: e
2728
+ }),
2729
+ p && /* @__PURE__ */ D(kn, {
2730
+ labels: {
2731
+ hidden: "Show Rationale for choices",
2732
+ visible: "Hide Rationale for choices"
2733
+ },
2734
+ children: g.map((e, t) => /* @__PURE__ */ D(An, { children: e?.length > 0 && e.map((e) => /* @__PURE__ */ O(jn, { children: [/* @__PURE__ */ D(Mn, {
2735
+ correct: e.correct,
2736
+ dangerouslySetInnerHTML: { __html: `${e.label}: ` }
2737
+ }), /* @__PURE__ */ D(Q, { prompt: e.rationale })] }, e.label)) }, t))
2738
+ }),
2739
+ m && /* @__PURE__ */ D(Tn, {
2740
+ labels: {
2741
+ hidden: "Show Rationale",
2742
+ visible: "Hide Rationale"
2743
+ },
2744
+ children: /* @__PURE__ */ D(Q, { prompt: i })
2745
+ })
2746
+ ]
2747
+ });
2748
+ }
2749
+ }, Fn = class extends HTMLElement {
2750
+ constructor() {
2751
+ super(), this._model = null, this._session = null, this._root = null;
2752
+ }
2753
+ set model(e) {
2754
+ this._model = e, this.dispatchEvent(new te(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model)), this._render();
2755
+ }
2756
+ set session(e) {
2757
+ this._session = e, this._render();
2758
+ }
2759
+ get session() {
2760
+ return this._session;
2761
+ }
2762
+ setLangAttribute() {
2763
+ let e = this._model && typeof this._model.language ? this._model.language : "", t = e ? e.slice(0, 2) : "en";
2764
+ this.setAttribute("lang", t);
2765
+ }
2766
+ _render = () => {
2767
+ if (this._model && this._session) {
2768
+ let e = C.createElement(Pn, {
2769
+ model: this._model,
2770
+ prompt: this._model.prompt,
2771
+ rationale: this._model.rationale,
2772
+ teacherInstructions: this._model.teacherInstructions,
2773
+ disabled: this._model.disabled,
2774
+ displayType: this._model.displayType,
2775
+ markup: this._model.markup,
2776
+ mode: this._model.mode,
2777
+ choices: this._model.choices,
2778
+ value: this._session.value,
2779
+ feedback: this._model.feedback,
2780
+ language: this._model.language,
2781
+ onChange: this.changeSession
2782
+ });
2783
+ this.setLangAttribute(), this._root ||= T(this), this._root.render(e), queueMicrotask(() => {
2784
+ r(this);
2785
+ });
2786
+ }
2787
+ };
2788
+ dispatchChangedEvent = () => {
2789
+ this.dispatchEvent(new ne(this.tagName.toLowerCase(), this.session && !!this.session.value));
2790
+ };
2791
+ changeSession = (e) => {
2792
+ this.session.value = e, this.dispatchChangedEvent(), this._render();
2793
+ };
2794
+ connectedCallback() {
2795
+ this.setAttribute("aria-label", "Inline Dropdown Question"), this.setAttribute("role", "region"), this._render();
2796
+ }
2797
+ disconnectedCallback() {
2798
+ this._root &&= (this._root.unmount(), null);
2799
+ }
2800
+ };
2801
+ //#endregion
2802
+ export { Fn as default };
2803
+
2804
+ //# sourceMappingURL=index.js.map