@pie-element/venn-classification 0.1.1-next.6 → 0.1.1-next.7

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.
@@ -0,0 +1,1776 @@
1
+ //#region ../../shared/translator/dist/en.js
2
+ var e = {
3
+ translation: {
4
+ categorize: {
5
+ limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
6
+ maxChoicesPerCategoryRestriction: "To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."
7
+ },
8
+ ebsr: { part: "Part {{index}}" },
9
+ numberLine: {
10
+ addElementLimit_one: "You can only add {{count}} element",
11
+ addElementLimit_other: "You can only add {{count}} elements",
12
+ clearAll: "Clear all"
13
+ },
14
+ imageClozeAssociation: {
15
+ reachedLimit_one: "You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",
16
+ reachedLimit_other: "Full"
17
+ },
18
+ drawingResponse: {
19
+ fillColor: "Fill color",
20
+ outlineColor: "Outline color",
21
+ noFill: "No fill",
22
+ lightblue: "Light blue",
23
+ lightyellow: "Light yellow",
24
+ red: "Red",
25
+ orange: "Orange",
26
+ yellow: "Yellow",
27
+ violet: "Violet",
28
+ blue: "Blue",
29
+ green: "Green",
30
+ white: "White",
31
+ black: "Black",
32
+ onDoubleClick: "Double click to edit this text. Press Enter to submit."
33
+ },
34
+ charting: {
35
+ addCategory: "Add category",
36
+ actions: "Actions",
37
+ add: "Add",
38
+ delete: "Delete",
39
+ newLabel: "New label",
40
+ reachedLimit_other: "There can't be more than {{count}} categories.",
41
+ keyLegend: {
42
+ incorrectAnswer: "Student incorrect answer",
43
+ correctAnswer: "Student correct answer",
44
+ correctKeyAnswer: "Answer key correct"
45
+ }
46
+ },
47
+ graphing: {
48
+ point: "Point",
49
+ circle: "Circle",
50
+ line: "Line",
51
+ parabola: "Parabola",
52
+ absolute: "Absolute Value",
53
+ exponential: "Exponential",
54
+ polygon: "Polygon",
55
+ ray: "Ray",
56
+ segment: "Segment",
57
+ sine: "Sine",
58
+ vector: "Vector",
59
+ label: "Label",
60
+ redo: "Redo",
61
+ reset: "Reset"
62
+ },
63
+ 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." },
64
+ mcPopulatedBlank: {
65
+ answerChoices: "Answer choices",
66
+ blankLabel: "blank",
67
+ emptyBlank: "(blank)",
68
+ blankPreSelectionHint: "The answer you choose will appear on the blank line above.",
69
+ correctAnswerSelected: "Correct answer selected",
70
+ incorrectAnswerSelected: "Incorrect answer selected",
71
+ selectedAnswerImage: "Selected answer image",
72
+ choiceImage: "Choice {{id}}",
73
+ clickToEnableAutoplay: "Click to enable audio autoplay",
74
+ audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
75
+ listen: "Listen",
76
+ listenSilentAlt: "Repeat instructions",
77
+ listenPlayingAlt: "Instructions are playing",
78
+ printAudio: "Audio:",
79
+ printTranscript: "Transcript:",
80
+ printKey: "(key)"
81
+ },
82
+ multipleChoice: {
83
+ minSelections: "Select at least {{minSelections}}.",
84
+ maxSelections_one: "Only {{maxSelections}} answer is allowed.",
85
+ maxSelections_other: "Only {{maxSelections}} answers are allowed.",
86
+ minmaxSelections_equal: "Select {{minSelections}}.",
87
+ minmaxSelections_range: "Select between {{minSelections}} and {{maxSelections}}."
88
+ },
89
+ selectText: {
90
+ correctAnswerSelected: "Correct",
91
+ correctAnswerNotSelected: "Correct Answer Not Selected",
92
+ incorrectSelection: "Incorrect Selection",
93
+ key: "Key"
94
+ },
95
+ simpleCloze: {
96
+ correctAnswerShown: "Correct answer",
97
+ correct: "Correct",
98
+ incorrect: "Incorrect",
99
+ unanswered: "No answer",
100
+ placeholder: "Enter your answer...",
101
+ answerInput: "Your answer",
102
+ printCorrectAnswer: "Correct answer:",
103
+ printAnswerBlank: "Answer blank"
104
+ },
105
+ vennClassification: {
106
+ tray: "Tiles to classify",
107
+ unknownTarget: "unknown",
108
+ cancelled: "Cancelled",
109
+ returnedToTray: "{{name}} returned to tray",
110
+ placedIn: "{{name}} placed in {{target}}",
111
+ pickedUp: "Picked up {{name}}",
112
+ pickedUpWithKeyboard: "Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.",
113
+ dropTarget: "Drop target: {{target}}",
114
+ unsupportedCircles_one: "This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.",
115
+ unsupportedCircles_other: "This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.",
116
+ setNumber: "Set {{number}}",
117
+ regionOnly: "{{set}} only",
118
+ regionNeither: "Neither {{first}} nor {{second}}",
119
+ regionNoneOf: "None of {{sets}}",
120
+ regionAndSeparator: " and ",
121
+ tileFallbackName: "Tile",
122
+ tileNotPlaced: "not placed",
123
+ tileInRegion: "in {{region}}",
124
+ tileCorrect: "correct",
125
+ tileIncorrect: "incorrect"
126
+ }
127
+ },
128
+ common: {
129
+ undo: "Undo",
130
+ clearAll: "Clear all",
131
+ correct: "Correct",
132
+ incorrect: "Incorrect",
133
+ showCorrectAnswer: "Show correct answer",
134
+ hideCorrectAnswer: "Hide correct answer",
135
+ showTeacherInstructions: "Show Teacher Instructions",
136
+ hideTeacherInstructions: "Hide Teacher Instructions",
137
+ 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.",
138
+ warning: "Warning",
139
+ showNote: "Show Note",
140
+ hideNote: "Hide Note",
141
+ cancel: "Cancel"
142
+ }
143
+ }, t = {
144
+ translation: {
145
+ categorize: {
146
+ limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
147
+ maxChoicesPerCategoryRestriction: "Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"
148
+ },
149
+ ebsr: { part: "Parte {{index}}" },
150
+ numberLine: {
151
+ addElementLimit_one: "Solo puedes agregar {{count}} elemento",
152
+ addElementLimit_other: "Solo puedes agregar {{count}} elementos",
153
+ clearAll: "Borrar todo"
154
+ },
155
+ imageClozeAssociation: {
156
+ reachedLimit_one: "Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
157
+ reachedLimit_other: "Lleno"
158
+ },
159
+ drawingResponse: {
160
+ fillColor: "Color de relleno",
161
+ outlineColor: "Color del contorno",
162
+ noFill: "Sin relleno",
163
+ lightblue: "Azul claro",
164
+ lightyellow: "Amarillo claro",
165
+ red: "Rojo",
166
+ orange: "Naranja",
167
+ yellow: "Amarillo",
168
+ violet: "Violeta",
169
+ blue: "Azul",
170
+ green: "Verde",
171
+ white: "Blanco",
172
+ black: "Negro",
173
+ onDoubleClick: "Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"
174
+ },
175
+ charting: {
176
+ addCategory: "Añadir categoría",
177
+ actions: "Acciones",
178
+ add: "Añadir",
179
+ delete: "Eliminar",
180
+ newLabel: "Nueva etiqueta",
181
+ reachedLimit_other: "No puede haber más de {{count}} categorías.",
182
+ keyLegend: {
183
+ incorrectAnswer: "Respuesta incorrecta del estudiante",
184
+ correctAnswer: "Respuesta correcta del estudiante",
185
+ correctKeyAnswer: "Clave de respuesta correcta"
186
+ }
187
+ },
188
+ graphing: {
189
+ point: "Punto",
190
+ circle: "Circulo",
191
+ line: "Línea",
192
+ parabola: "Parábola",
193
+ absolute: "Valor absoluto",
194
+ exponential: "Exponencial",
195
+ polygon: "Polígono",
196
+ ray: "Semirrecta",
197
+ segment: "Segmento ",
198
+ sine: "Seno",
199
+ vector: "Vector",
200
+ label: "Etiqueta",
201
+ redo: "Rehacer",
202
+ reset: "Reiniciar"
203
+ },
204
+ 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." },
205
+ mcPopulatedBlank: {
206
+ answerChoices: "Opciones de respuesta",
207
+ blankLabel: "espacio en blanco",
208
+ emptyBlank: "(en blanco)",
209
+ blankPreSelectionHint: "La respuesta que elijas aparecerá en la línea en blanco de arriba.",
210
+ correctAnswerSelected: "Respuesta correcta seleccionada",
211
+ incorrectAnswerSelected: "Respuesta incorrecta seleccionada",
212
+ selectedAnswerImage: "Imagen de la respuesta seleccionada",
213
+ choiceImage: "Opción {{id}}",
214
+ clickToEnableAutoplay: "Haz clic para activar la reproducción automática del audio",
215
+ audioResourceUnavailable: "El audio está activado, pero no hay una URL de audio reproducible configurada.",
216
+ listen: "Escuchar",
217
+ listenSilentAlt: "Escuchar. Repetir las instrucciones.",
218
+ listenPlayingAlt: "Escuchar. Estas son las instrucciones.",
219
+ printAudio: "Audio:",
220
+ printTranscript: "Transcripción:",
221
+ printKey: "(clave)"
222
+ },
223
+ multipleChoice: {
224
+ minSelections: "Seleccione al menos {{minSelections}}.",
225
+ maxSelections_one: "Sólo se permite {{maxSelections}} respuesta.",
226
+ maxSelections_other: "Sólo se permiten {{maxSelections}} respuestas.",
227
+ minmaxSelections_equal: "Seleccione {{minSelections}}.",
228
+ minmaxSelections_range: "Seleccione entre {{minSelections}} y {{maxSelections}}."
229
+ },
230
+ selectText: {
231
+ correctAnswerSelected: "Respuesta Correcta",
232
+ correctAnswerNotSelected: "Respuesta Correcta No Seleccionada",
233
+ incorrectSelection: "Selección Incorrecta",
234
+ key: "Clave"
235
+ },
236
+ simpleCloze: {
237
+ correctAnswerShown: "Respuesta correcta",
238
+ correct: "Correcto",
239
+ incorrect: "Incorrecto",
240
+ unanswered: "Sin respuesta",
241
+ placeholder: "Escribe tu respuesta...",
242
+ answerInput: "Tu respuesta",
243
+ printCorrectAnswer: "Respuesta correcta:",
244
+ printAnswerBlank: "Espacio para la respuesta"
245
+ },
246
+ vennClassification: {
247
+ tray: "Fichas para clasificar",
248
+ unknownTarget: "desconocido",
249
+ cancelled: "Cancelado",
250
+ returnedToTray: "Se devolvió {{name}} a la bandeja",
251
+ placedIn: "Se colocó {{name}} en {{target}}",
252
+ pickedUp: "Se tomó {{name}}",
253
+ pickedUpWithKeyboard: "Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.",
254
+ dropTarget: "Destino: {{target}}",
255
+ unsupportedCircles_one: "No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.",
256
+ unsupportedCircles_other: "No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.",
257
+ setNumber: "Conjunto {{number}}",
258
+ regionOnly: "Solo {{set}}",
259
+ regionNeither: "Ni {{first}} ni {{second}}",
260
+ regionNoneOf: "Ninguno de {{sets}}",
261
+ regionAndSeparator: " y ",
262
+ tileFallbackName: "Ficha",
263
+ tileNotPlaced: "sin colocar",
264
+ tileInRegion: "en {{region}}",
265
+ tileCorrect: "correcta",
266
+ tileIncorrect: "incorrecta"
267
+ }
268
+ },
269
+ common: {
270
+ undo: "Deshacer",
271
+ clearAll: "Borrar todo",
272
+ correct: "Correcto",
273
+ incorrect: "Incorrecto",
274
+ showCorrectAnswer: "Mostrar respuesta correcta",
275
+ hideCorrectAnswer: "Ocultar respuesta correcta",
276
+ showTeacherInstructions: "Mostrar instrucciones para el maestro",
277
+ hideTeacherInstructions: "Ocultar instrucciones para el maestro",
278
+ 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.",
279
+ warning: "Advertencia",
280
+ showNote: "Mostrar Nota",
281
+ hideNote: "Ocultar Nota",
282
+ cancel: "Cancelar"
283
+ }
284
+ }, n = (e) => typeof e == "string", r = () => {
285
+ let e, t, n = new Promise((n, r) => {
286
+ e = n, t = r;
287
+ });
288
+ return n.resolve = e, n.reject = t, n;
289
+ }, i = (e) => e == null ? "" : "" + e, a = (e, t, n) => {
290
+ e.forEach((e) => {
291
+ t[e] && (n[e] = t[e]);
292
+ });
293
+ }, o = /###/g, s = (e) => e && e.indexOf("###") > -1 ? e.replace(o, ".") : e, c = (e) => !e || n(e), l = (e, t, r) => {
294
+ let i = n(t) ? t.split(".") : t, a = 0;
295
+ for (; a < i.length - 1;) {
296
+ if (c(e)) return {};
297
+ let t = s(i[a]);
298
+ !e[t] && r && (e[t] = new r()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++a;
299
+ }
300
+ return c(e) ? {} : {
301
+ obj: e,
302
+ k: s(i[a])
303
+ };
304
+ }, u = (e, t, n) => {
305
+ let { obj: r, k: i } = l(e, t, Object);
306
+ if (r !== void 0 || t.length === 1) {
307
+ r[i] = n;
308
+ return;
309
+ }
310
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = l(e, o, Object);
311
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = l(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
312
+ s.obj[`${s.k}.${a}`] = n;
313
+ }, d = (e, t, n, r) => {
314
+ let { obj: i, k: a } = l(e, t, Object);
315
+ i[a] = i[a] || [], i[a].push(n);
316
+ }, f = (e, t) => {
317
+ let { obj: n, k: r } = l(e, t);
318
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
319
+ }, p = (e, t, n) => {
320
+ let r = f(e, n);
321
+ return r === void 0 ? f(t, n) : r;
322
+ }, m = (e, t, r) => {
323
+ for (let i in t) i !== "__proto__" && i !== "constructor" && (i in e ? n(e[i]) || e[i] instanceof String || n(t[i]) || t[i] instanceof String ? r && (e[i] = t[i]) : m(e[i], t[i], r) : e[i] = t[i]);
324
+ return e;
325
+ }, h = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), g = {
326
+ "&": "&amp;",
327
+ "<": "&lt;",
328
+ ">": "&gt;",
329
+ "\"": "&quot;",
330
+ "'": "&#39;",
331
+ "/": "&#x2F;"
332
+ }, _ = (e) => n(e) ? e.replace(/[&<>"'\/]/g, (e) => g[e]) : e, v = class {
333
+ constructor(e) {
334
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
335
+ }
336
+ getRegExp(e) {
337
+ let t = this.regExpMap.get(e);
338
+ if (t !== void 0) return t;
339
+ let n = new RegExp(e);
340
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
341
+ }
342
+ }, y = [
343
+ " ",
344
+ ",",
345
+ "?",
346
+ "!",
347
+ ";"
348
+ ], b = new v(20), x = (e, t, n) => {
349
+ t ||= "", n ||= "";
350
+ let r = y.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
351
+ if (r.length === 0) return !0;
352
+ let i = b.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
353
+ if (!a) {
354
+ let t = e.indexOf(n);
355
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
356
+ }
357
+ return a;
358
+ }, S = (e, t, n = ".") => {
359
+ if (!e) return;
360
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
361
+ let r = t.split(n), i = e;
362
+ for (let e = 0; e < r.length;) {
363
+ if (!i || typeof i != "object") return;
364
+ let t, a = "";
365
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
366
+ if ([
367
+ "string",
368
+ "number",
369
+ "boolean"
370
+ ].indexOf(typeof t) > -1 && o < r.length - 1) continue;
371
+ e += o - e + 1;
372
+ break;
373
+ }
374
+ i = t;
375
+ }
376
+ return i;
377
+ }, C = (e) => e?.replace(/_/g, "-"), w = {
378
+ type: "logger",
379
+ log(e) {
380
+ this.output("log", e);
381
+ },
382
+ warn(e) {
383
+ this.output("warn", e);
384
+ },
385
+ error(e) {
386
+ this.output("error", e);
387
+ },
388
+ output(e, t) {
389
+ console?.[e]?.apply?.(console, t);
390
+ }
391
+ }, T = new class e {
392
+ constructor(e, t = {}) {
393
+ this.init(e, t);
394
+ }
395
+ init(e, t = {}) {
396
+ this.prefix = t.prefix || "i18next:", this.logger = e || w, this.options = t, this.debug = t.debug;
397
+ }
398
+ log(...e) {
399
+ return this.forward(e, "log", "", !0);
400
+ }
401
+ warn(...e) {
402
+ return this.forward(e, "warn", "", !0);
403
+ }
404
+ error(...e) {
405
+ return this.forward(e, "error", "");
406
+ }
407
+ deprecate(...e) {
408
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
409
+ }
410
+ forward(e, t, r, i) {
411
+ return i && !this.debug ? null : (n(e[0]) && (e[0] = `${r}${this.prefix} ${e[0]}`), this.logger[t](e));
412
+ }
413
+ create(t) {
414
+ return new e(this.logger, {
415
+ prefix: `${this.prefix}:${t}:`,
416
+ ...this.options
417
+ });
418
+ }
419
+ clone(t) {
420
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
421
+ }
422
+ }(), E = class {
423
+ constructor() {
424
+ this.observers = {};
425
+ }
426
+ on(e, t) {
427
+ return e.split(" ").forEach((e) => {
428
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
429
+ let n = this.observers[e].get(t) || 0;
430
+ this.observers[e].set(t, n + 1);
431
+ }), this;
432
+ }
433
+ off(e, t) {
434
+ if (this.observers[e]) {
435
+ if (!t) {
436
+ delete this.observers[e];
437
+ return;
438
+ }
439
+ this.observers[e].delete(t);
440
+ }
441
+ }
442
+ emit(e, ...t) {
443
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
444
+ for (let r = 0; r < n; r++) e(...t);
445
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
446
+ for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
447
+ });
448
+ }
449
+ }, D = class extends E {
450
+ constructor(e, t = {
451
+ ns: ["translation"],
452
+ defaultNS: "translation"
453
+ }) {
454
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
455
+ }
456
+ addNamespaces(e) {
457
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
458
+ }
459
+ removeNamespaces(e) {
460
+ let t = this.options.ns.indexOf(e);
461
+ t > -1 && this.options.ns.splice(t, 1);
462
+ }
463
+ getResource(e, t, r, i = {}) {
464
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = i.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : i.ignoreJSONStructure, s;
465
+ e.indexOf(".") > -1 ? s = e.split(".") : (s = [e, t], r && (Array.isArray(r) ? s.push(...r) : n(r) && a ? s.push(...r.split(a)) : s.push(r)));
466
+ let c = f(this.data, s);
467
+ return !c && !t && !r && e.indexOf(".") > -1 && (e = s[0], t = s[1], r = s.slice(2).join(".")), c || !o || !n(r) ? c : S(this.data?.[e]?.[t], r, a);
468
+ }
469
+ addResource(e, t, n, r, i = { silent: !1 }) {
470
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
471
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), u(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
472
+ }
473
+ addResources(e, t, r, i = { silent: !1 }) {
474
+ for (let i in r) (n(r[i]) || Array.isArray(r[i])) && this.addResource(e, t, i, r[i], { silent: !0 });
475
+ i.silent || this.emit("added", e, t, r);
476
+ }
477
+ addResourceBundle(e, t, n, r, i, a = {
478
+ silent: !1,
479
+ skipCopy: !1
480
+ }) {
481
+ let o = [e, t];
482
+ e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
483
+ let s = f(this.data, o) || {};
484
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? m(s, n, i) : s = {
485
+ ...s,
486
+ ...n
487
+ }, u(this.data, o, s), a.silent || this.emit("added", e, t, n);
488
+ }
489
+ removeResourceBundle(e, t) {
490
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
491
+ }
492
+ hasResourceBundle(e, t) {
493
+ return this.getResource(e, t) !== void 0;
494
+ }
495
+ getResourceBundle(e, t) {
496
+ return t ||= this.options.defaultNS, this.getResource(e, t);
497
+ }
498
+ getDataByLanguage(e) {
499
+ return this.data[e];
500
+ }
501
+ hasLanguageSomeTranslations(e) {
502
+ let t = this.getDataByLanguage(e);
503
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
504
+ }
505
+ toJSON() {
506
+ return this.data;
507
+ }
508
+ }, O = {
509
+ processors: {},
510
+ addPostProcessor(e) {
511
+ this.processors[e.name] = e;
512
+ },
513
+ handle(e, t, n, r, i) {
514
+ return e.forEach((e) => {
515
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
516
+ }), t;
517
+ }
518
+ }, k = Symbol("i18next/PATH_KEY");
519
+ function ee() {
520
+ let e = [], t = Object.create(null), n;
521
+ return t.get = (r, i) => (n?.revoke?.(), i === k ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
522
+ }
523
+ function A(e, t) {
524
+ let { [k]: n } = e(ee()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
525
+ if (n.length > 1 && i) {
526
+ let e = t?.ns, a = Array.isArray(e) ? e : null;
527
+ if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
528
+ }
529
+ return n.join(r);
530
+ }
531
+ var te = {}, j = (e) => !n(e) && typeof e != "boolean" && typeof e != "number", M = class e extends E {
532
+ constructor(e, t = {}) {
533
+ super(), a([
534
+ "resourceStore",
535
+ "languageUtils",
536
+ "pluralResolver",
537
+ "interpolator",
538
+ "backendConnector",
539
+ "i18nFormat",
540
+ "utils"
541
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = T.create("translator");
542
+ }
543
+ changeLanguage(e) {
544
+ e && (this.language = e);
545
+ }
546
+ exists(e, t = { interpolation: {} }) {
547
+ let n = { ...t };
548
+ if (e == null) return !1;
549
+ let r = this.resolve(e, n);
550
+ if (r?.res === void 0) return !1;
551
+ let i = j(r.res);
552
+ return !(n.returnObjects === !1 && i);
553
+ }
554
+ extractFromKey(e, t) {
555
+ let r = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
556
+ r === void 0 && (r = ":");
557
+ let i = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, a = t.ns || this.options.defaultNS || [], o = r && e.indexOf(r) > -1, s = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !x(e, r, i);
558
+ if (o && !s) {
559
+ let t = e.match(this.interpolator.nestingRegexp);
560
+ if (t && t.length > 0) return {
561
+ key: e,
562
+ namespaces: n(a) ? [a] : a
563
+ };
564
+ let o = e.split(r);
565
+ (r !== i || r === i && this.options.ns.indexOf(o[0]) > -1) && (a = o.shift()), e = o.join(i);
566
+ }
567
+ return {
568
+ key: e,
569
+ namespaces: n(a) ? [a] : a
570
+ };
571
+ }
572
+ translate(t, r, i) {
573
+ let a = typeof r == "object" ? { ...r } : r;
574
+ if (typeof a != "object" && this.options.overloadTranslationOptionHandler && (a = this.options.overloadTranslationOptionHandler(arguments)), typeof a == "object" && (a = { ...a }), a ||= {}, t == null) return "";
575
+ typeof t == "function" && (t = A(t, {
576
+ ...this.options,
577
+ ...a
578
+ })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? A(e, {
579
+ ...this.options,
580
+ ...a
581
+ }) : String(e));
582
+ let o = a.returnDetails === void 0 ? this.options.returnDetails : a.returnDetails, s = a.keySeparator === void 0 ? this.options.keySeparator : a.keySeparator, { key: c, namespaces: l } = this.extractFromKey(t[t.length - 1], a), u = l[l.length - 1], d = a.nsSeparator === void 0 ? this.options.nsSeparator : a.nsSeparator;
583
+ d === void 0 && (d = ":");
584
+ let f = a.lng || this.language, p = a.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
585
+ if (f?.toLowerCase() === "cimode") return p ? o ? {
586
+ res: `${u}${d}${c}`,
587
+ usedKey: c,
588
+ exactUsedKey: c,
589
+ usedLng: f,
590
+ usedNS: u,
591
+ usedParams: this.getUsedParamsDetails(a)
592
+ } : `${u}${d}${c}` : o ? {
593
+ res: c,
594
+ usedKey: c,
595
+ exactUsedKey: c,
596
+ usedLng: f,
597
+ usedNS: u,
598
+ usedParams: this.getUsedParamsDetails(a)
599
+ } : c;
600
+ let m = this.resolve(t, a), h = m?.res, g = m?.usedKey || c, _ = m?.exactUsedKey || c, v = [
601
+ "[object Number]",
602
+ "[object Function]",
603
+ "[object RegExp]"
604
+ ], y = a.joinArrays === void 0 ? this.options.joinArrays : a.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, x = a.count !== void 0 && !n(a.count), S = e.hasDefaultValue(a), C = x ? this.pluralResolver.getSuffix(f, a.count, a) : "", w = a.ordinal && x ? this.pluralResolver.getSuffix(f, a.count, { ordinal: !1 }) : "", T = x && !a.ordinal && a.count === 0, E = T && a[`defaultValue${this.options.pluralSeparator}zero`] || a[`defaultValue${C}`] || a[`defaultValue${w}`] || a.defaultValue, D = h;
605
+ b && !h && S && (D = E);
606
+ let O = j(D), k = Object.prototype.toString.apply(D);
607
+ if (b && D && O && v.indexOf(k) < 0 && !(n(y) && Array.isArray(D))) {
608
+ if (!a.returnObjects && !this.options.returnObjects) {
609
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
610
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(g, D, {
611
+ ...a,
612
+ ns: l
613
+ }) : `key '${c} (${this.language})' returned an object instead of string.`;
614
+ return o ? (m.res = e, m.usedParams = this.getUsedParamsDetails(a), m) : e;
615
+ }
616
+ if (s) {
617
+ let e = Array.isArray(D), t = e ? [] : {}, n = e ? _ : g;
618
+ for (let e in D) if (Object.prototype.hasOwnProperty.call(D, e)) {
619
+ let r = `${n}${s}${e}`;
620
+ S && !h ? t[e] = this.translate(r, {
621
+ ...a,
622
+ defaultValue: j(E) ? E[e] : void 0,
623
+ joinArrays: !1,
624
+ ns: l
625
+ }) : t[e] = this.translate(r, {
626
+ ...a,
627
+ joinArrays: !1,
628
+ ns: l
629
+ }), t[e] === r && (t[e] = D[e]);
630
+ }
631
+ h = t;
632
+ }
633
+ } else if (b && n(y) && Array.isArray(h)) h = h.join(y), h &&= this.extendTranslation(h, t, a, i);
634
+ else {
635
+ let e = !1, n = !1;
636
+ !this.isValidLookup(h) && S && (e = !0, h = E), this.isValidLookup(h) || (n = !0, h = c);
637
+ let r = (a.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : h, o = S && E !== h && this.options.updateMissing;
638
+ if (n || e || o) {
639
+ if (this.logger.log(o ? "updateKey" : "missingKey", f, u, c, o ? E : h), s) {
640
+ let e = this.resolve(c, {
641
+ ...a,
642
+ keySeparator: !1
643
+ });
644
+ 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.");
645
+ }
646
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
647
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
648
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(a.lng || this.language) : e.push(a.lng || this.language);
649
+ let n = (e, t, n) => {
650
+ let i = S && n !== h ? n : r;
651
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(e, u, t, i, o, a) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, u, t, i, o, a), this.emit("missingKey", e, u, t, h);
652
+ };
653
+ this.options.saveMissing && (this.options.saveMissingPlurals && x ? e.forEach((e) => {
654
+ let t = this.pluralResolver.getSuffixes(e, a);
655
+ T && a[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
656
+ n([e], c + t, a[`defaultValue${t}`] || E);
657
+ });
658
+ }) : n(e, c, E));
659
+ }
660
+ h = this.extendTranslation(h, t, a, m, i), n && h === c && this.options.appendNamespaceToMissingKey && (h = `${u}${d}${c}`), (n || e) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${d}${c}` : c, e ? h : void 0, a));
661
+ }
662
+ return o ? (m.res = h, m.usedParams = this.getUsedParamsDetails(a), m) : h;
663
+ }
664
+ extendTranslation(e, t, r, i, a) {
665
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
666
+ ...this.options.interpolation.defaultVariables,
667
+ ...r
668
+ }, r.lng || this.language || i.usedLng, i.usedNS, i.usedKey, { resolved: i });
669
+ else if (!r.skipInterpolation) {
670
+ r.interpolation && this.interpolator.init({
671
+ ...r,
672
+ interpolation: {
673
+ ...this.options.interpolation,
674
+ ...r.interpolation
675
+ }
676
+ });
677
+ let o = n(e) && (r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables), s;
678
+ if (o) {
679
+ let t = e.match(this.interpolator.nestingRegexp);
680
+ s = t && t.length;
681
+ }
682
+ let c = r.replace && !n(r.replace) ? r.replace : r;
683
+ if (this.options.interpolation.defaultVariables && (c = {
684
+ ...this.options.interpolation.defaultVariables,
685
+ ...c
686
+ }), e = this.interpolator.interpolate(e, c, r.lng || this.language || i.usedLng, r), o) {
687
+ let t = e.match(this.interpolator.nestingRegexp), n = t && t.length;
688
+ s < n && (r.nest = !1);
689
+ }
690
+ !r.lng && i && i.res && (r.lng = this.language || i.usedLng), r.nest !== !1 && (e = this.interpolator.nest(e, (...e) => a?.[0] === e[0] && !r.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), r)), r.interpolation && this.interpolator.reset();
691
+ }
692
+ let o = r.postProcess || this.options.postProcess, s = n(o) ? [o] : o;
693
+ return e != null && s?.length && r.applyPostProcessor !== !1 && (e = O.handle(s, e, t, this.options && this.options.postProcessPassResolved ? {
694
+ i18nResolved: {
695
+ ...i,
696
+ usedParams: this.getUsedParamsDetails(r)
697
+ },
698
+ ...r
699
+ } : r, this)), e;
700
+ }
701
+ resolve(e, t = {}) {
702
+ let r, i, a, o, s;
703
+ return n(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? A(e, {
704
+ ...this.options,
705
+ ...t
706
+ }) : e)), e.forEach((e) => {
707
+ if (this.isValidLookup(r)) return;
708
+ let c = this.extractFromKey(e, t), l = c.key;
709
+ i = l;
710
+ let u = c.namespaces;
711
+ this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
712
+ let d = t.count !== void 0 && !n(t.count), f = d && !t.ordinal && t.count === 0, p = t.context !== void 0 && (n(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
713
+ u.forEach((e) => {
714
+ this.isValidLookup(r) || (s = e, !te[`${m[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(s) && (te[`${m[0]}-${e}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" 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!!!")), m.forEach((n) => {
715
+ if (this.isValidLookup(r)) return;
716
+ o = n;
717
+ let i = [l];
718
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(i, l, n, e, t);
719
+ else {
720
+ let e;
721
+ d && (e = this.pluralResolver.getSuffix(n, t.count, t));
722
+ let r = `${this.options.pluralSeparator}zero`, a = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
723
+ if (d && (t.ordinal && e.indexOf(a) === 0 && i.push(l + e.replace(a, this.options.pluralSeparator)), i.push(l + e), f && i.push(l + r)), p) {
724
+ let n = `${l}${this.options.contextSeparator || "_"}${t.context}`;
725
+ i.push(n), d && (t.ordinal && e.indexOf(a) === 0 && i.push(n + e.replace(a, this.options.pluralSeparator)), i.push(n + e), f && i.push(n + r));
726
+ }
727
+ }
728
+ let s;
729
+ for (; s = i.pop();) this.isValidLookup(r) || (a = s, r = this.getResource(n, e, s, t));
730
+ }));
731
+ });
732
+ }), {
733
+ res: r,
734
+ usedKey: i,
735
+ exactUsedKey: a,
736
+ usedLng: o,
737
+ usedNS: s
738
+ };
739
+ }
740
+ isValidLookup(e) {
741
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
742
+ }
743
+ getResource(e, t, n, r = {}) {
744
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
745
+ }
746
+ getUsedParamsDetails(e = {}) {
747
+ let t = [
748
+ "defaultValue",
749
+ "ordinal",
750
+ "context",
751
+ "replace",
752
+ "lng",
753
+ "lngs",
754
+ "fallbackLng",
755
+ "ns",
756
+ "keySeparator",
757
+ "nsSeparator",
758
+ "returnObjects",
759
+ "returnDetails",
760
+ "joinArrays",
761
+ "postProcess",
762
+ "interpolation"
763
+ ], r = e.replace && !n(e.replace), i = r ? e.replace : e;
764
+ if (r && e.count !== void 0 && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
765
+ ...this.options.interpolation.defaultVariables,
766
+ ...i
767
+ }), !r) {
768
+ i = { ...i };
769
+ for (let e of t) delete i[e];
770
+ }
771
+ return i;
772
+ }
773
+ static hasDefaultValue(e) {
774
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
775
+ return !1;
776
+ }
777
+ }, N = class {
778
+ constructor(e) {
779
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = T.create("languageUtils");
780
+ }
781
+ getScriptPartFromCode(e) {
782
+ if (e = C(e), !e || e.indexOf("-") < 0) return null;
783
+ let t = e.split("-");
784
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
785
+ }
786
+ getLanguagePartFromCode(e) {
787
+ if (e = C(e), !e || e.indexOf("-") < 0) return e;
788
+ let t = e.split("-");
789
+ return this.formatLanguageCode(t[0]);
790
+ }
791
+ formatLanguageCode(e) {
792
+ if (n(e) && e.indexOf("-") > -1) {
793
+ let t;
794
+ try {
795
+ t = Intl.getCanonicalLocales(e)[0];
796
+ } catch {}
797
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
798
+ }
799
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
800
+ }
801
+ isSupportedCode(e) {
802
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
803
+ }
804
+ getBestMatchFromCodes(e) {
805
+ if (!e) return null;
806
+ let t;
807
+ return e.forEach((e) => {
808
+ if (t) return;
809
+ let n = this.formatLanguageCode(e);
810
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
811
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
812
+ if (t) return;
813
+ let n = this.getScriptPartFromCode(e);
814
+ if (this.isSupportedCode(n)) return t = n;
815
+ let r = this.getLanguagePartFromCode(e);
816
+ if (this.isSupportedCode(r)) return t = r;
817
+ t = this.options.supportedLngs.find((e) => {
818
+ 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;
819
+ });
820
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
821
+ }
822
+ getFallbackCodes(e, t) {
823
+ if (!e) return [];
824
+ if (typeof e == "function" && (e = e(t)), n(e) && (e = [e]), Array.isArray(e)) return e;
825
+ if (!t) return e.default || [];
826
+ let r = e[t];
827
+ return r ||= e[this.getScriptPartFromCode(t)], r ||= e[this.formatLanguageCode(t)], r ||= e[this.getLanguagePartFromCode(t)], r ||= e.default, r || [];
828
+ }
829
+ toResolveHierarchy(e, t) {
830
+ let r = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), i = [], a = (e) => {
831
+ e && (this.isSupportedCode(e) ? i.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
832
+ };
833
+ return n(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(e))) : n(e) && a(this.formatLanguageCode(e)), r.forEach((e) => {
834
+ i.indexOf(e) < 0 && a(this.formatLanguageCode(e));
835
+ }), i;
836
+ }
837
+ }, P = {
838
+ zero: 0,
839
+ one: 1,
840
+ two: 2,
841
+ few: 3,
842
+ many: 4,
843
+ other: 5
844
+ }, F = {
845
+ select: (e) => e === 1 ? "one" : "other",
846
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
847
+ }, ne = class {
848
+ constructor(e, t = {}) {
849
+ this.languageUtils = e, this.options = t, this.logger = T.create("pluralResolver"), this.pluralRulesCache = {};
850
+ }
851
+ clearCache() {
852
+ this.pluralRulesCache = {};
853
+ }
854
+ getRule(e, t = {}) {
855
+ let n = C(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
856
+ cleanedCode: n,
857
+ type: r
858
+ });
859
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
860
+ let a;
861
+ try {
862
+ a = new Intl.PluralRules(n, { type: r });
863
+ } catch {
864
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), F;
865
+ if (!e.match(/-|_/)) return F;
866
+ let n = this.languageUtils.getLanguagePartFromCode(e);
867
+ a = this.getRule(n, t);
868
+ }
869
+ return this.pluralRulesCache[i] = a, a;
870
+ }
871
+ needsPlural(e, t = {}) {
872
+ let n = this.getRule(e, t);
873
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
874
+ }
875
+ getPluralFormsOfKey(e, t, n = {}) {
876
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
877
+ }
878
+ getSuffixes(e, t = {}) {
879
+ let n = this.getRule(e, t);
880
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => P[e] - P[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
881
+ }
882
+ getSuffix(e, t, n = {}) {
883
+ let r = this.getRule(e, n);
884
+ 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));
885
+ }
886
+ }, I = (e, t, r, i = ".", a = !0) => {
887
+ let o = p(e, t, r);
888
+ return !o && a && n(r) && (o = S(e, r, i), o === void 0 && (o = S(t, r, i))), o;
889
+ }, L = (e) => e.replace(/\$/g, "$$$$"), R = class {
890
+ constructor(e = {}) {
891
+ this.logger = T.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
892
+ }
893
+ init(e = {}) {
894
+ e.interpolation ||= { escapeValue: !0 };
895
+ 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: g, maxReplaces: v, alwaysFormat: y } = e.interpolation;
896
+ this.escape = t === void 0 ? _ : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? h(i) : a || "{{", this.suffix = o ? h(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? h(d) : f || h("$t("), this.nestingSuffix = p ? h(p) : m || h(")"), this.nestingOptionsSeparator = g || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = y !== void 0 && y, this.resetRegExp();
897
+ }
898
+ reset() {
899
+ this.options && this.init(this.options);
900
+ }
901
+ resetRegExp() {
902
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
903
+ 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}`);
904
+ }
905
+ interpolate(e, t, r, a) {
906
+ let o, s, c, l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (e) => {
907
+ if (e.indexOf(this.formatSeparator) < 0) {
908
+ let n = I(t, l, e, this.options.keySeparator, this.options.ignoreJSONStructure);
909
+ return this.alwaysFormat ? this.format(n, void 0, r, {
910
+ ...a,
911
+ ...t,
912
+ interpolationkey: e
913
+ }) : n;
914
+ }
915
+ let n = e.split(this.formatSeparator), i = n.shift().trim(), o = n.join(this.formatSeparator).trim();
916
+ return this.format(I(t, l, i, this.options.keySeparator, this.options.ignoreJSONStructure), o, r, {
917
+ ...a,
918
+ ...t,
919
+ interpolationkey: i
920
+ });
921
+ };
922
+ this.resetRegExp();
923
+ let d = a?.missingInterpolationHandler || this.options.missingInterpolationHandler, f = a?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : a.interpolation.skipOnVariables;
924
+ return [{
925
+ regex: this.regexpUnescape,
926
+ safeValue: (e) => L(e)
927
+ }, {
928
+ regex: this.regexp,
929
+ safeValue: (e) => this.escapeValue ? L(this.escape(e)) : L(e)
930
+ }].forEach((t) => {
931
+ for (c = 0; o = t.regex.exec(e);) {
932
+ let r = o[1].trim();
933
+ if (s = u(r), s === void 0) if (typeof d == "function") {
934
+ let t = d(e, o, a);
935
+ s = n(t) ? t : "";
936
+ } else if (a && Object.prototype.hasOwnProperty.call(a, r)) s = "";
937
+ else if (f) {
938
+ s = o[0];
939
+ continue;
940
+ } else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`), s = "";
941
+ else !n(s) && !this.useRawValueToEscape && (s = i(s));
942
+ let l = t.safeValue(s);
943
+ if (e = e.replace(o[0], l), f ? (t.regex.lastIndex += s.length, t.regex.lastIndex -= o[0].length) : t.regex.lastIndex = 0, c++, c >= this.maxReplaces) break;
944
+ }
945
+ }), e;
946
+ }
947
+ nest(e, t, r = {}) {
948
+ let a, o, s, c = (e, t) => {
949
+ let n = this.nestingOptionsSeparator;
950
+ if (e.indexOf(n) < 0) return e;
951
+ let r = e.split(RegExp(`${h(n)}[ ]*{`)), i = `{${r[1]}`;
952
+ e = r[0], i = this.interpolate(i, s);
953
+ let a = i.match(/'/g), o = i.match(/"/g);
954
+ ((a?.length ?? 0) % 2 == 0 && !o || (o?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
955
+ try {
956
+ s = JSON.parse(i), t && (s = {
957
+ ...t,
958
+ ...s
959
+ });
960
+ } catch (t) {
961
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
962
+ }
963
+ return s.defaultValue && s.defaultValue.indexOf(this.prefix) > -1 && delete s.defaultValue, e;
964
+ };
965
+ for (; a = this.nestingRegexp.exec(e);) {
966
+ let l = [];
967
+ s = { ...r }, s = s.replace && !n(s.replace) ? s.replace : s, s.applyPostProcessor = !1, delete s.defaultValue;
968
+ let u = /{.*}/.test(a[1]) ? a[1].lastIndexOf("}") + 1 : a[1].indexOf(this.formatSeparator);
969
+ if (u !== -1 && (l = a[1].slice(u).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), a[1] = a[1].slice(0, u)), o = t(c.call(this, a[1].trim(), s), s), o && a[0] === e && !n(o)) return o;
970
+ n(o) || (o = i(o)), o ||= (this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`), ""), l.length && (o = l.reduce((e, t) => this.format(e, t, r.lng, {
971
+ ...r,
972
+ interpolationkey: a[1].trim()
973
+ }), o.trim())), e = e.replace(a[0], o), this.regexp.lastIndex = 0;
974
+ }
975
+ return e;
976
+ }
977
+ }, re = (e) => {
978
+ let t = e.toLowerCase().trim(), n = {};
979
+ if (e.indexOf("(") > -1) {
980
+ let r = e.split("(");
981
+ t = r[0].toLowerCase().trim();
982
+ let i = r[1].substring(0, r[1].length - 1);
983
+ t === "currency" && i.indexOf(":") < 0 ? n.currency ||= i.trim() : t === "relativetime" && i.indexOf(":") < 0 ? n.range ||= i.trim() : i.split(";").forEach((e) => {
984
+ if (e) {
985
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
986
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
987
+ }
988
+ });
989
+ }
990
+ return {
991
+ formatName: t,
992
+ formatOptions: n
993
+ };
994
+ }, z = (e) => {
995
+ let t = {};
996
+ return (n, r, i) => {
997
+ let a = i;
998
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
999
+ ...a,
1000
+ [i.interpolationkey]: void 0
1001
+ });
1002
+ let o = r + JSON.stringify(a), s = t[o];
1003
+ return s || (s = e(C(r), i), t[o] = s), s(n);
1004
+ };
1005
+ }, ie = (e) => (t, n, r) => e(C(n), r)(t), ae = class {
1006
+ constructor(e = {}) {
1007
+ this.logger = T.create("formatter"), this.options = e, this.init(e);
1008
+ }
1009
+ init(e, t = { interpolation: {} }) {
1010
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
1011
+ let n = t.cacheInBuiltFormats ? z : ie;
1012
+ this.formats = {
1013
+ number: n((e, t) => {
1014
+ let n = new Intl.NumberFormat(e, { ...t });
1015
+ return (e) => n.format(e);
1016
+ }),
1017
+ currency: n((e, t) => {
1018
+ let n = new Intl.NumberFormat(e, {
1019
+ ...t,
1020
+ style: "currency"
1021
+ });
1022
+ return (e) => n.format(e);
1023
+ }),
1024
+ datetime: n((e, t) => {
1025
+ let n = new Intl.DateTimeFormat(e, { ...t });
1026
+ return (e) => n.format(e);
1027
+ }),
1028
+ relativetime: n((e, t) => {
1029
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
1030
+ return (e) => n.format(e, t.range || "day");
1031
+ }),
1032
+ list: n((e, t) => {
1033
+ let n = new Intl.ListFormat(e, { ...t });
1034
+ return (e) => n.format(e);
1035
+ })
1036
+ };
1037
+ }
1038
+ add(e, t) {
1039
+ this.formats[e.toLowerCase().trim()] = t;
1040
+ }
1041
+ addCached(e, t) {
1042
+ this.formats[e.toLowerCase().trim()] = z(t);
1043
+ }
1044
+ format(e, t, n, r = {}) {
1045
+ let i = t.split(this.formatSeparator);
1046
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((e) => e.indexOf(")") > -1)) {
1047
+ let e = i.findIndex((e) => e.indexOf(")") > -1);
1048
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
1049
+ }
1050
+ return i.reduce((e, t) => {
1051
+ let { formatName: i, formatOptions: a } = re(t);
1052
+ if (this.formats[i]) {
1053
+ let t = e;
1054
+ try {
1055
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
1056
+ t = this.formats[i](e, s, {
1057
+ ...a,
1058
+ ...r,
1059
+ ...o
1060
+ });
1061
+ } catch (e) {
1062
+ this.logger.warn(e);
1063
+ }
1064
+ return t;
1065
+ } else this.logger.warn(`there was no format function for ${i}`);
1066
+ return e;
1067
+ }, e);
1068
+ }
1069
+ }, oe = (e, t) => {
1070
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
1071
+ }, se = class extends E {
1072
+ constructor(e, t, n, r = {}) {
1073
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = T.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);
1074
+ }
1075
+ queueLoad(e, t, n, r) {
1076
+ let i = {}, a = {}, o = {}, s = {};
1077
+ return e.forEach((e) => {
1078
+ let r = !0;
1079
+ t.forEach((t) => {
1080
+ let o = `${e}|${t}`;
1081
+ !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)));
1082
+ }), r || (o[e] = !0);
1083
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1084
+ pending: a,
1085
+ pendingCount: Object.keys(a).length,
1086
+ loaded: {},
1087
+ errors: [],
1088
+ callback: r
1089
+ }), {
1090
+ toLoad: Object.keys(i),
1091
+ pending: Object.keys(a),
1092
+ toLoadLanguages: Object.keys(o),
1093
+ toLoadNamespaces: Object.keys(s)
1094
+ };
1095
+ }
1096
+ loaded(e, t, n) {
1097
+ let r = e.split("|"), i = r[0], a = r[1];
1098
+ 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);
1099
+ let o = {};
1100
+ this.queue.forEach((n) => {
1101
+ d(n.loaded, [i], a), oe(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
1102
+ o[e] || (o[e] = {});
1103
+ let t = n.loaded[e];
1104
+ t.length && t.forEach((t) => {
1105
+ o[e][t] === void 0 && (o[e][t] = !0);
1106
+ });
1107
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
1108
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
1109
+ }
1110
+ read(e, t, n, r = 0, i = this.retryTimeout, a) {
1111
+ if (!e.length) return a(null, {});
1112
+ if (this.readingCalls >= this.maxParallelReads) {
1113
+ this.waitingReads.push({
1114
+ lng: e,
1115
+ ns: t,
1116
+ fcName: n,
1117
+ tried: r,
1118
+ wait: i,
1119
+ callback: a
1120
+ });
1121
+ return;
1122
+ }
1123
+ this.readingCalls++;
1124
+ let o = (o, s) => {
1125
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1126
+ let e = this.waitingReads.shift();
1127
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
1128
+ }
1129
+ if (o && s && r < this.maxRetries) {
1130
+ setTimeout(() => {
1131
+ this.read.call(this, e, t, n, r + 1, i * 2, a);
1132
+ }, i);
1133
+ return;
1134
+ }
1135
+ a(o, s);
1136
+ }, s = this.backend[n].bind(this.backend);
1137
+ if (s.length === 2) {
1138
+ try {
1139
+ let n = s(e, t);
1140
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
1141
+ } catch (e) {
1142
+ o(e);
1143
+ }
1144
+ return;
1145
+ }
1146
+ return s(e, t, o);
1147
+ }
1148
+ prepareLoading(e, t, r = {}, i) {
1149
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
1150
+ n(e) && (e = this.languageUtils.toResolveHierarchy(e)), n(t) && (t = [t]);
1151
+ let a = this.queueLoad(e, t, r, i);
1152
+ if (!a.toLoad.length) return a.pending.length || i(), null;
1153
+ a.toLoad.forEach((e) => {
1154
+ this.loadOne(e);
1155
+ });
1156
+ }
1157
+ load(e, t, n) {
1158
+ this.prepareLoading(e, t, {}, n);
1159
+ }
1160
+ reload(e, t, n) {
1161
+ this.prepareLoading(e, t, { reload: !0 }, n);
1162
+ }
1163
+ loadOne(e, t = "") {
1164
+ let n = e.split("|"), r = n[0], i = n[1];
1165
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
1166
+ 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);
1167
+ });
1168
+ }
1169
+ saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
1170
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1171
+ 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!!!");
1172
+ return;
1173
+ }
1174
+ if (!(n == null || n === "")) {
1175
+ if (this.backend?.create) {
1176
+ let s = {
1177
+ ...a,
1178
+ isUpdate: i
1179
+ }, c = this.backend.create.bind(this.backend);
1180
+ if (c.length < 6) try {
1181
+ let i;
1182
+ 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);
1183
+ } catch (e) {
1184
+ o(e);
1185
+ }
1186
+ else c(e, t, n, r, o, s);
1187
+ }
1188
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
1189
+ }
1190
+ }
1191
+ }, B = () => ({
1192
+ debug: !1,
1193
+ initAsync: !0,
1194
+ ns: ["translation"],
1195
+ defaultNS: ["translation"],
1196
+ fallbackLng: ["dev"],
1197
+ fallbackNS: !1,
1198
+ supportedLngs: !1,
1199
+ nonExplicitSupportedLngs: !1,
1200
+ load: "all",
1201
+ preload: !1,
1202
+ simplifyPluralSuffix: !0,
1203
+ keySeparator: ".",
1204
+ nsSeparator: ":",
1205
+ pluralSeparator: "_",
1206
+ contextSeparator: "_",
1207
+ partialBundledLanguages: !1,
1208
+ saveMissing: !1,
1209
+ updateMissing: !1,
1210
+ saveMissingTo: "fallback",
1211
+ saveMissingPlurals: !0,
1212
+ missingKeyHandler: !1,
1213
+ missingInterpolationHandler: !1,
1214
+ postProcess: !1,
1215
+ postProcessPassResolved: !1,
1216
+ returnNull: !1,
1217
+ returnEmptyString: !0,
1218
+ returnObjects: !1,
1219
+ joinArrays: !1,
1220
+ returnedObjectHandler: !1,
1221
+ parseMissingKeyHandler: !1,
1222
+ appendNamespaceToMissingKey: !1,
1223
+ appendNamespaceToCIMode: !1,
1224
+ overloadTranslationOptionHandler: (e) => {
1225
+ let t = {};
1226
+ if (typeof e[1] == "object" && (t = e[1]), n(e[1]) && (t.defaultValue = e[1]), n(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
1227
+ let n = e[3] || e[2];
1228
+ Object.keys(n).forEach((e) => {
1229
+ t[e] = n[e];
1230
+ });
1231
+ }
1232
+ return t;
1233
+ },
1234
+ interpolation: {
1235
+ escapeValue: !0,
1236
+ format: (e) => e,
1237
+ prefix: "{{",
1238
+ suffix: "}}",
1239
+ formatSeparator: ",",
1240
+ unescapePrefix: "-",
1241
+ nestingPrefix: "$t(",
1242
+ nestingSuffix: ")",
1243
+ nestingOptionsSeparator: ",",
1244
+ maxReplaces: 1e3,
1245
+ skipOnVariables: !0
1246
+ },
1247
+ cacheInBuiltFormats: !0
1248
+ }), V = (e) => (n(e.ns) && (e.ns = [e.ns]), n(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), n(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), H = () => {}, ce = (e) => {
1249
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
1250
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
1251
+ });
1252
+ }, U = "__i18next_supportNoticeShown", le = () => !!(typeof globalThis < "u" && globalThis[U] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), ue = () => {
1253
+ typeof globalThis < "u" && (globalThis[U] = !0);
1254
+ }, de = (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 E {
1255
+ constructor(e = {}, t) {
1256
+ if (super(), this.options = V(e), this.services = {}, this.logger = T, this.modules = { external: [] }, ce(this), t && !this.isInitialized && !e.isClone) {
1257
+ if (!this.options.initAsync) return this.init(e, t), this;
1258
+ setTimeout(() => {
1259
+ this.init(e, t);
1260
+ }, 0);
1261
+ }
1262
+ }
1263
+ init(e = {}, t) {
1264
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (n(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1265
+ let i = B();
1266
+ this.options = {
1267
+ ...i,
1268
+ ...this.options,
1269
+ ...V(e)
1270
+ }, this.options.interpolation = {
1271
+ ...i.interpolation,
1272
+ ...this.options.interpolation
1273
+ }, 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 = i.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !de(this) && !le() && (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 💙"), ue());
1274
+ let a = (e) => e ? typeof e == "function" ? new e() : e : null;
1275
+ if (!this.options.isClone) {
1276
+ this.modules.logger ? T.init(a(this.modules.logger), this.options) : T.init(null, this.options);
1277
+ let e;
1278
+ e = this.modules.formatter ? this.modules.formatter : ae;
1279
+ let t = new N(this.options);
1280
+ this.store = new D(this.options.resources, this.options);
1281
+ let n = this.services;
1282
+ n.logger = T, n.resourceStore = this.store, n.languageUtils = t, n.pluralResolver = new ne(t, {
1283
+ prepend: this.options.pluralSeparator,
1284
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1285
+ }), this.options.interpolation.format && this.options.interpolation.format !== i.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 === i.interpolation.format) && (n.formatter = a(e), n.formatter.init && n.formatter.init(n, this.options), this.options.interpolation.format = n.formatter.format.bind(n.formatter)), n.interpolator = new R(this.options), n.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n.backendConnector = new se(a(this.modules.backend), n.resourceStore, n, this.options), n.backendConnector.on("*", (e, ...t) => {
1286
+ this.emit(e, ...t);
1287
+ }), this.modules.languageDetector && (n.languageDetector = a(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = a(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new M(this.services, this.options), this.translator.on("*", (e, ...t) => {
1288
+ this.emit(e, ...t);
1289
+ }), this.modules.external.forEach((e) => {
1290
+ e.init && e.init(this);
1291
+ });
1292
+ }
1293
+ if (this.format = this.options.interpolation.format, t ||= H, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1294
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1295
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1296
+ }
1297
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1298
+ "getResource",
1299
+ "hasResourceBundle",
1300
+ "getResourceBundle",
1301
+ "getDataByLanguage"
1302
+ ].forEach((e) => {
1303
+ this[e] = (...t) => this.store[e](...t);
1304
+ }), [
1305
+ "addResource",
1306
+ "addResources",
1307
+ "addResourceBundle",
1308
+ "removeResourceBundle"
1309
+ ].forEach((e) => {
1310
+ this[e] = (...t) => (this.store[e](...t), this);
1311
+ });
1312
+ let o = r(), s = () => {
1313
+ let e = (e, n) => {
1314
+ 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), o.resolve(n), t(e, n);
1315
+ };
1316
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1317
+ this.changeLanguage(this.options.lng, e);
1318
+ };
1319
+ return this.options.resources || !this.options.initAsync ? s() : setTimeout(s, 0), o;
1320
+ }
1321
+ loadResources(e, t = H) {
1322
+ let r = t, i = n(e) ? e : this.language;
1323
+ if (typeof e == "function" && (r = e), !this.options.resources || this.options.partialBundledLanguages) {
1324
+ if (i?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return r();
1325
+ let e = [], t = (t) => {
1326
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1327
+ t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1328
+ });
1329
+ };
1330
+ i ? t(i) : 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) => {
1331
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), r(e);
1332
+ });
1333
+ } else r(null);
1334
+ }
1335
+ reloadResources(e, t, n) {
1336
+ let i = r();
1337
+ 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 ||= H, this.services.backendConnector.reload(e, t, (e) => {
1338
+ i.resolve(), n(e);
1339
+ }), i;
1340
+ }
1341
+ use(e) {
1342
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1343
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1344
+ 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" && O.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1345
+ }
1346
+ setResolvedLanguage(e) {
1347
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1348
+ for (let e = 0; e < this.languages.length; e++) {
1349
+ let t = this.languages[e];
1350
+ if (!(["cimode", "dev"].indexOf(t) > -1) && this.store.hasLanguageSomeTranslations(t)) {
1351
+ this.resolvedLanguage = t;
1352
+ break;
1353
+ }
1354
+ }
1355
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1356
+ }
1357
+ }
1358
+ changeLanguage(e, t) {
1359
+ this.isLanguageChangingTo = e;
1360
+ let i = r();
1361
+ this.emit("languageChanging", e);
1362
+ let a = (e) => {
1363
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1364
+ }, o = (n, r) => {
1365
+ r ? this.isLanguageChangingTo === e && (a(r), this.translator.changeLanguage(r), this.isLanguageChangingTo = void 0, this.emit("languageChanged", r), this.logger.log("languageChanged", r)) : this.isLanguageChangingTo = void 0, i.resolve((...e) => this.t(...e)), t && t(n, (...e) => this.t(...e));
1366
+ }, s = (t) => {
1367
+ !e && !t && this.services.languageDetector && (t = []);
1368
+ let r = n(t) ? t : t && t[0], i = this.store.hasLanguageSomeTranslations(r) ? r : this.services.languageUtils.getBestMatchFromCodes(n(t) ? [t] : t);
1369
+ i && (this.language || a(i), this.translator.language || this.translator.changeLanguage(i), this.services.languageDetector?.cacheUserLanguage?.(i)), this.loadResources(i, (e) => {
1370
+ o(e, i);
1371
+ });
1372
+ };
1373
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? s(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(s) : this.services.languageDetector.detect(s) : s(e), i;
1374
+ }
1375
+ getFixedT(e, t, r) {
1376
+ let i = (e, t, ...n) => {
1377
+ let a;
1378
+ a = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(n)), a.lng = a.lng || i.lng, a.lngs = a.lngs || i.lngs, a.ns = a.ns || i.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || r || i.keyPrefix);
1379
+ let o = {
1380
+ ...this.options,
1381
+ ...a
1382
+ };
1383
+ typeof a.keyPrefix == "function" && (a.keyPrefix = A(a.keyPrefix, o));
1384
+ let s = this.options.keySeparator || ".", c;
1385
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = A(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = A(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1386
+ };
1387
+ return n(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = r, i;
1388
+ }
1389
+ t(...e) {
1390
+ return this.translator?.translate(...e);
1391
+ }
1392
+ exists(...e) {
1393
+ return this.translator?.exists(...e);
1394
+ }
1395
+ setDefaultNamespace(e) {
1396
+ this.options.defaultNS = e;
1397
+ }
1398
+ hasLoadedNamespace(e, t = {}) {
1399
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1400
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1401
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1402
+ if (n.toLowerCase() === "cimode") return !0;
1403
+ let a = (e, t) => {
1404
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1405
+ return n === -1 || n === 0 || n === 2;
1406
+ };
1407
+ if (t.precheck) {
1408
+ let e = t.precheck(this, a);
1409
+ if (e !== void 0) return e;
1410
+ }
1411
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1412
+ }
1413
+ loadNamespaces(e, t) {
1414
+ let i = r();
1415
+ return this.options.ns ? (n(e) && (e = [e]), e.forEach((e) => {
1416
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1417
+ }), this.loadResources((e) => {
1418
+ i.resolve(), t && t(e);
1419
+ }), i) : (t && t(), Promise.resolve());
1420
+ }
1421
+ loadLanguages(e, t) {
1422
+ let i = r();
1423
+ n(e) && (e = [e]);
1424
+ let a = this.options.preload || [], o = e.filter((e) => a.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1425
+ return o.length ? (this.options.preload = a.concat(o), this.loadResources((e) => {
1426
+ i.resolve(), t && t(e);
1427
+ }), i) : (t && t(), Promise.resolve());
1428
+ }
1429
+ dir(e) {
1430
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1431
+ try {
1432
+ let t = new Intl.Locale(e);
1433
+ if (t && t.getTextInfo) {
1434
+ let e = t.getTextInfo();
1435
+ if (e && e.direction) return e.direction;
1436
+ }
1437
+ } catch {}
1438
+ 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 N(B());
1439
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1440
+ }
1441
+ static createInstance(t = {}, n) {
1442
+ let r = new e(t, n);
1443
+ return r.createInstance = e.createInstance, r;
1444
+ }
1445
+ cloneInstance(t = {}, n = H) {
1446
+ let r = t.forkResourceStore;
1447
+ r && delete t.forkResourceStore;
1448
+ let i = {
1449
+ ...this.options,
1450
+ ...t,
1451
+ isClone: !0
1452
+ }, a = new e(i);
1453
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1454
+ "store",
1455
+ "services",
1456
+ "language"
1457
+ ].forEach((e) => {
1458
+ a[e] = this[e];
1459
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new D(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) {
1460
+ let e = {
1461
+ ...B().interpolation,
1462
+ ...this.options.interpolation,
1463
+ ...t.interpolation
1464
+ }, n = {
1465
+ ...i,
1466
+ interpolation: e
1467
+ };
1468
+ a.services.interpolator = new R(n);
1469
+ }
1470
+ return a.translator = new M(a.services, i), a.translator.on("*", (e, ...t) => {
1471
+ a.emit(e, ...t);
1472
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1473
+ }
1474
+ toJSON() {
1475
+ return {
1476
+ options: this.options,
1477
+ store: this.store,
1478
+ language: this.language,
1479
+ languages: this.languages,
1480
+ resolvedLanguage: this.resolvedLanguage
1481
+ };
1482
+ }
1483
+ }.createInstance();
1484
+ //#endregion
1485
+ //#region ../../shared/translator/dist/index.js
1486
+ 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({
1487
+ fallbackLng: "en",
1488
+ lng: "en",
1489
+ showSupportNotice: !1,
1490
+ resources: {
1491
+ en: e,
1492
+ es: t
1493
+ }
1494
+ });
1495
+ //#endregion
1496
+ //#region src/i18n.ts
1497
+ var { translator: G } = {
1498
+ translator: {
1499
+ ...W,
1500
+ t: (e, t) => {
1501
+ let { lng: n } = t;
1502
+ switch (n) {
1503
+ case "en_US":
1504
+ case "en-US":
1505
+ t.lng = "en";
1506
+ break;
1507
+ case "es_ES":
1508
+ case "es-ES":
1509
+ case "es_MX":
1510
+ case "es-MX":
1511
+ t.lng = "es";
1512
+ break;
1513
+ default: break;
1514
+ }
1515
+ return W.t(e, {
1516
+ lng: n,
1517
+ ...t
1518
+ });
1519
+ }
1520
+ },
1521
+ languageOptions: [{
1522
+ value: "en_US",
1523
+ label: "English (US)"
1524
+ }, {
1525
+ value: "es_ES",
1526
+ label: "Spanish"
1527
+ }]
1528
+ };
1529
+ function K(e, t, n = {}) {
1530
+ return G.t(`translation:vennClassification:${e}`, {
1531
+ lng: t,
1532
+ ...n,
1533
+ interpolation: { escapeValue: !1 }
1534
+ });
1535
+ }
1536
+ function fe(e, t) {
1537
+ return G.t(`common:${e}`, { lng: t });
1538
+ }
1539
+ //#endregion
1540
+ //#region src/controller/region.ts
1541
+ function q(e) {
1542
+ return !e || e.length === 0 ? "" : [...e].sort((e, t) => e - t).join(",");
1543
+ }
1544
+ function J(e) {
1545
+ return !e || e.length === 0 ? [] : [...e].sort((e, t) => e - t);
1546
+ }
1547
+ function Y(e, t) {
1548
+ if (!e || !t) return !e == !t && (e?.length ?? 0) === (t?.length ?? 0);
1549
+ if (e.length !== t.length) return !1;
1550
+ let n = J(e), r = J(t);
1551
+ for (let e = 0; e < n.length; e++) if (n[e] !== r[e]) return !1;
1552
+ return !0;
1553
+ }
1554
+ function pe(e) {
1555
+ let t = [], n = 1 << e;
1556
+ for (let r = 0; r < n; r++) {
1557
+ let n = [];
1558
+ for (let t = 0; t < e; t++) r & 1 << t && n.push(t);
1559
+ t.push(n);
1560
+ }
1561
+ return t;
1562
+ }
1563
+ function X(e, t, n) {
1564
+ let r = J(t), i = (t) => e[t]?.label ?? K("setNumber", n, { number: t + 1 }), a = r.map(i);
1565
+ return r.length === 0 ? e.length === 2 ? K("regionNeither", n, {
1566
+ first: i(0),
1567
+ second: i(1)
1568
+ }) : K("regionNoneOf", n, { sets: e.map((e, t) => i(t)).join(", ") }) : r.length === 1 ? K("regionOnly", n, { set: a[0] }) : a.join(K("regionAndSeparator", n));
1569
+ }
1570
+ function me(e, t) {
1571
+ let n = q(t), r = e.regionLabels?.[n];
1572
+ return typeof r == "string" && r.trim().length > 0 ? r : X(e.circles ?? [], t, e.language);
1573
+ }
1574
+ var Z = {
1575
+ model: {
1576
+ prompt: "<p>Sort each tile into the correct region of the Venn diagram.</p>",
1577
+ promptEnabled: !0,
1578
+ circles: [{ label: "Set A" }, { label: "Set B" }],
1579
+ tiles: [],
1580
+ regionLabels: {},
1581
+ scoringPolicy: "partialPerTile",
1582
+ teacherInstructionsEnabled: !0
1583
+ },
1584
+ configuration: {
1585
+ prompt: {
1586
+ label: "Prompt",
1587
+ settings: !0
1588
+ },
1589
+ scoringPolicy: {
1590
+ label: "Scoring policy",
1591
+ settings: !0
1592
+ }
1593
+ }
1594
+ }, Q = /* @__PURE__ */ new Set([2]);
1595
+ function he(e) {
1596
+ return String(e ?? "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
1597
+ }
1598
+ function $(e = {}) {
1599
+ let t = {
1600
+ ...Z.model,
1601
+ ...e
1602
+ };
1603
+ return (!Array.isArray(t.circles) || t.circles.length === 0) && (t.circles = Z.model.circles.map((e) => ({ ...e }))), Array.isArray(t.tiles) || (t.tiles = []), (!t.regionLabels || typeof t.regionLabels != "object") && (t.regionLabels = {}), t.scoringPolicy !== "allOrNothing" && t.scoringPolicy !== "partialPerTile" && (t.scoringPolicy = "partialPerTile"), t;
1604
+ }
1605
+ function ge(e, t) {
1606
+ let n = { ...e || {} }, r = e?.placements ?? {}, i = {};
1607
+ for (let [e, t] of Object.entries(r)) t == null ? i[e] = null : Array.isArray(t) ? i[e] = J(t) : i[e] = null;
1608
+ if (t?.tiles) for (let e of t.tiles) e.id in i || (i[e.id] = null);
1609
+ return n.placements = i, n.completed = _e(t, {
1610
+ ...n,
1611
+ placements: i
1612
+ }), n;
1613
+ }
1614
+ function _e(e, t) {
1615
+ if (!e || !Array.isArray(e.tiles) || e.tiles.length === 0) return !1;
1616
+ let n = t?.placements ?? {};
1617
+ for (let t of e.tiles) if (n[t.id] == null) return !1;
1618
+ return !0;
1619
+ }
1620
+ function ve(e, t) {
1621
+ return t == null ? "unanswered" : Y(e.correctRegion, t) ? "correct" : "incorrect";
1622
+ }
1623
+ function ye(e, t) {
1624
+ let n = {}, r = t?.placements ?? {};
1625
+ for (let t of e.tiles ?? []) n[t.id] = ve(t, r[t.id] ?? null);
1626
+ return n;
1627
+ }
1628
+ function be(e, t) {
1629
+ return e.scoringPolicy === "allOrNothing" || t?.partialScoring === !1 ? "allOrNothing" : "partialPerTile";
1630
+ }
1631
+ var xe = {
1632
+ score: 0,
1633
+ empty: !0,
1634
+ traceLog: ["Student did not place any tiles. Score is 0."]
1635
+ };
1636
+ function Se(e, t, n = {}) {
1637
+ return new Promise((r) => {
1638
+ let i = $(e || void 0), a = i.tiles, o = t?.placements ?? {}, s = 0, c = 0;
1639
+ for (let e of a) {
1640
+ let t = o[e.id];
1641
+ t != null && (c += 1, Y(e.correctRegion, t) && (s += 1));
1642
+ }
1643
+ if (c === 0) {
1644
+ r({
1645
+ ...xe,
1646
+ traceLog: [...xe.traceLog]
1647
+ });
1648
+ return;
1649
+ }
1650
+ let l = be(i, n), u = l === "allOrNothing" ? +(s === a.length) : Number.parseFloat((s / a.length).toFixed(2));
1651
+ r({
1652
+ score: u,
1653
+ empty: !1,
1654
+ traceLog: [
1655
+ `Student placed ${c} of ${a.length} tile(s); ${s} in the correct region.`,
1656
+ `Score calculated using ${l === "allOrNothing" ? "all-or-nothing" : "partial"} scoring.`,
1657
+ `Final score: ${u}.`
1658
+ ]
1659
+ });
1660
+ });
1661
+ }
1662
+ function Ce(e, t, n = {}) {
1663
+ return new Promise((r) => {
1664
+ let i = $(e || void 0), a = n || {}, o = {
1665
+ prompt: i.promptEnabled === !1 ? null : i.prompt ?? null,
1666
+ circles: i.circles.map((e) => ({ label: e?.label ?? "" })),
1667
+ tiles: i.tiles.map((e) => {
1668
+ let t = String(e.imageUrl ?? "").trim(), n = t.length > 0 ? {
1669
+ imageUrl: t,
1670
+ imageAlt: String(e.imageAlt ?? "").trim()
1671
+ } : {};
1672
+ return {
1673
+ id: e.id,
1674
+ label: e.label ?? "",
1675
+ ...n,
1676
+ ...a.mode === "evaluate" ? { correctRegion: J(e.correctRegion) } : {}
1677
+ };
1678
+ }),
1679
+ regionLabels: { ...i.regionLabels || {} },
1680
+ scoringPolicy: i.scoringPolicy ?? "partialPerTile",
1681
+ language: i.language,
1682
+ disabled: a.mode !== "gather",
1683
+ mode: a.mode,
1684
+ env: a
1685
+ };
1686
+ if (a.mode === "evaluate") {
1687
+ let e = {};
1688
+ for (let t of i.tiles) e[t.id] = J(t.correctRegion);
1689
+ o.correctRegionsById = e, o.correctness = ye(i, t);
1690
+ }
1691
+ a.role === "instructor" && (a.mode === "view" || a.mode === "evaluate") ? o.teacherInstructions = i.teacherInstructionsEnabled ? i.teacherInstructions ?? null : null : o.teacherInstructions = null, r(o);
1692
+ });
1693
+ }
1694
+ function we(e, t = {}) {
1695
+ return new Promise((n) => {
1696
+ if (t.mode === "evaluate" || t.role !== "instructor") {
1697
+ n(null);
1698
+ return;
1699
+ }
1700
+ let r = $(e || void 0), i = {};
1701
+ for (let e of r.tiles) i[e.id] = J(e.correctRegion);
1702
+ n({
1703
+ id: "1",
1704
+ placements: i,
1705
+ completed: !0
1706
+ });
1707
+ });
1708
+ }
1709
+ function Te(e, t = {}) {
1710
+ let n = {}, r = e || {};
1711
+ if (r.promptEnabled) {
1712
+ let e = (r.prompt ?? "").trim();
1713
+ (!e || e === "<p></p>") && (n.prompt = "Prompt is required when prompt is enabled");
1714
+ }
1715
+ let i = Array.isArray(r.circles) ? r.circles : [];
1716
+ if (!Q.has(i.length)) n.circles = `Venn classification currently supports ${[...Q].sort((e, t) => e - t).join(" or ")} circles (got ${i.length})`;
1717
+ else for (let e = 0; e < i.length; e++) if (!(i[e]?.label ?? "").trim()) {
1718
+ n.circles = `Circle ${e + 1} needs a label`;
1719
+ break;
1720
+ }
1721
+ let a = Array.isArray(r.tiles) ? r.tiles : [];
1722
+ if (a.length < 1) n.tiles = "At least one tile is required";
1723
+ else {
1724
+ let e = /* @__PURE__ */ new Set();
1725
+ for (let t = 0; t < a.length; t++) {
1726
+ let r = a[t];
1727
+ if (!r?.id) {
1728
+ n.tiles = `Tile ${t + 1} is missing an id`;
1729
+ break;
1730
+ }
1731
+ if (e.has(r.id)) {
1732
+ n.tiles = `Tile id "${r.id}" appears more than once`;
1733
+ break;
1734
+ }
1735
+ e.add(r.id);
1736
+ let o = he(r.label), s = String(r.imageUrl ?? "").trim(), c = String(r.imageAlt ?? "").trim();
1737
+ if (!o && !s) {
1738
+ n.tiles = `Tile "${r.id}" needs a label or an image URL`;
1739
+ break;
1740
+ }
1741
+ if (s && !c) {
1742
+ n.tiles = `Tile "${r.id}": when an image URL is set, short alt text is required for accessibility`;
1743
+ break;
1744
+ }
1745
+ let l = r.correctRegion;
1746
+ if (!Array.isArray(l)) {
1747
+ n.tiles = `Tile "${r.id}" is missing correctRegion`;
1748
+ break;
1749
+ }
1750
+ let u = J(l);
1751
+ if (new Set(u).size !== u.length) {
1752
+ n.tiles = `Tile "${r.id}" correctRegion has duplicate indexes`;
1753
+ break;
1754
+ }
1755
+ let d = u.find((e) => !Number.isInteger(e) || e < 0 || e >= i.length);
1756
+ if (d !== void 0) {
1757
+ n.tiles = `Tile "${r.id}" correctRegion index ${d} is out of range for ${i.length} circles`;
1758
+ break;
1759
+ }
1760
+ }
1761
+ }
1762
+ return r.scoringPolicy !== void 0 && r.scoringPolicy !== "allOrNothing" && r.scoringPolicy !== "partialPerTile" && (n.scoringPolicy = "Scoring policy must be \"allOrNothing\" or \"partialPerTile\""), n;
1763
+ }
1764
+ function Ee(e) {
1765
+ let t = $(e || void 0), n = {};
1766
+ for (let e of t.tiles) n[e.id] = J(e.correctRegion);
1767
+ return {
1768
+ id: "preview",
1769
+ placements: n,
1770
+ completed: !0
1771
+ };
1772
+ }
1773
+ //#endregion
1774
+ export { q as _, be as a, fe as b, _e as c, Se as d, Te as f, J as g, me as h, $ as i, Ce as l, pe as m, Ee as n, ye as o, X as p, we as r, ve as s, Q as t, ge as u, Y as v, K as y };
1775
+
1776
+ //# sourceMappingURL=controller-jTPoghNQ.js.map